-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathshared.ts
More file actions
53 lines (47 loc) · 1.17 KB
/
shared.ts
File metadata and controls
53 lines (47 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { Options } from 'yargs';
import { LoggingLevel, LoggingLevelNames } from '../utils/logger';
export type BaseFlags = {
logLevel: LoggingLevelNames;
};
export type SharedFlags = BaseFlags & {
config: string;
cwd?: string;
};
export type SharedFlagsWithCredentials = SharedFlags & {
accountSid?: string;
authToken?: string;
env?: string;
};
export type ExternalCliOptions = {
username: string;
password: string;
accountSid?: string;
profile?: string;
project?: string;
logLevel?: string;
outputFormat?: string;
};
export const baseCliOptions: { [key: string]: Options } = {
logLevel: {
type: 'string',
default: 'info',
alias: 'l',
describe: 'Level of logging messages.',
choices: Object.keys(LoggingLevel),
},
};
export const sharedCliOptions: { [key: string]: Options } = {
...baseCliOptions,
config: {
alias: 'c',
type: 'string',
default: '.twilio-functions',
describe:
'Location of the config file. Absolute path or relative to current working directory (cwd)',
},
cwd: {
type: 'string',
describe:
'Sets the directory of your existing Serverless project. Defaults to current directory',
},
};