1 | import Command, { flags } from '@oclif/command';
|
2 | import * as OClifConfig from '@oclif/config';
|
3 | import _inquirer from '@cto.ai/inquirer';
|
4 | import { Config, User, Team, ValidationFields, SigninPipeline, Tokens, Services } from './types';
|
5 | declare abstract class CTOCommand extends Command {
|
6 | accessToken: string;
|
7 | user: User;
|
8 | team: Team;
|
9 | state: {
|
10 | config: Config;
|
11 | };
|
12 | ux: {
|
13 | prompt: <A>(questions: _inquirer.ListQuestion<Record<string, any>> | _inquirer.RawListQuestion<Record<string, any>> | _inquirer.ExpandQuestion<Record<string, any>> | _inquirer.CheckboxQuestion<Record<string, any>> | _inquirer.ConfirmQuestion<Record<string, any>> | _inquirer.InputQuestion<Record<string, any>> | _inquirer.NumberQuestion<Record<string, any>> | _inquirer.PasswordQuestion<Record<string, any>> | _inquirer.EditorQuestion<Record<string, any>> | _inquirer.AutoCompleteQuestion<Record<string, any>> | _inquirer.DatePickerQuestion<Record<string, any>> | _inquirer.Question<Record<string, any>>[]) => Promise<A>;
|
14 | colors: import("chalk").Chalk & {
|
15 | supportsColor: import("chalk").ColorSupport;
|
16 | } & {
|
17 | callOutCyan: (text: string) => string;
|
18 | actionBlue: (text: string) => string;
|
19 | primary: (text: string) => string;
|
20 | secondary: (text: string) => string;
|
21 | tertiary: (text: string) => string;
|
22 | successGreen: (text: string) => string;
|
23 | errorRed: (text: string) => string;
|
24 | multiPurple: (text: string) => string;
|
25 | multiBlue: (text: string) => string;
|
26 | multiOrange: (text: string) => string;
|
27 | };
|
28 | spinner: {
|
29 | start: (text: string) => void;
|
30 | stop: (text: string) => void;
|
31 | };
|
32 | wait: (duration: number) => Promise<void>;
|
33 | url: (text: string, url: string) => string;
|
34 | annotation: (text: string, annotation: string) => void;
|
35 | table: typeof import("cli-ux/lib/styled/table").table;
|
36 | tree: typeof import("cli-ux/lib/styled/tree").default;
|
37 | progress: {
|
38 | init: (options?: import("cli-progress").Options | undefined) => import("cli-progress").Bar;
|
39 | };
|
40 | notify: (options: object) => void;
|
41 | inquirer: _inquirer.Inquirer;
|
42 | };
|
43 | services: Services;
|
44 | constructor(argv: string[], config: OClifConfig.IConfig, services?: Services);
|
45 | init(): Promise<void>;
|
46 | isTokenValid: (tokens: Tokens) => boolean;
|
47 | checkAndRefreshAccessToken: (tokens: Tokens) => Promise<Config>;
|
48 | isLoggedIn(): Promise<Config>;
|
49 | fetchUserInfo: ({ tokens }: SigninPipeline) => Promise<{
|
50 | meResponse: {
|
51 | me: {
|
52 | id: any;
|
53 | username: any;
|
54 | email: any;
|
55 | };
|
56 | teams: Team[];
|
57 | };
|
58 | tokens: Tokens;
|
59 | }>;
|
60 | writeConfig: (oldConfigObj: Partial<Config> | null | undefined, newConfigObj: Partial<Config>) => Promise<Partial<Config>>;
|
61 | readConfig: () => Promise<Config>;
|
62 | clearConfig: () => Promise<void>;
|
63 | invalidateKeycloakSession: () => Promise<void>;
|
64 | initConfig: (tokens: Tokens) => Promise<Config>;
|
65 | validateUniqueField(query: ValidationFields): Promise<boolean>;
|
66 | }
|
67 | export { CTOCommand as default, flags };
|