@contrail/cli 3.4.2 → 3.4.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -1
- package/bin/dev +0 -0
- package/bin/run +0 -0
- package/dist/__mocks__/@contrail/sdk.d.ts +123 -123
- package/dist/__mocks__/@contrail/sdk.js +716 -716
- package/dist/api/app-extension-deployments.d.ts +2 -2
- package/dist/api/app-extension-deployments.js +11 -11
- package/dist/api/app-extension-packages.d.ts +2 -2
- package/dist/api/app-extension-packages.js +11 -11
- package/dist/api/apps.d.ts +10 -10
- package/dist/api/apps.js +63 -63
- package/dist/api/event-workflow-action-definition.d.ts +3 -3
- package/dist/api/event-workflow-action-definition.js +18 -18
- package/dist/api/event-workflow-template-definition.d.ts +7 -7
- package/dist/api/event-workflow-template-definition.js +26 -26
- package/dist/api/event-workflow-templates.d.ts +8 -8
- package/dist/api/event-workflow-templates.js +32 -32
- package/dist/api/schedules.d.ts +7 -7
- package/dist/api/schedules.js +32 -32
- package/dist/api/types.d.ts +11 -11
- package/dist/api/types.js +79 -79
- package/dist/api/users.d.ts +2 -2
- package/dist/api/users.js +18 -18
- package/dist/api/webhooks.d.ts +4 -4
- package/dist/api/webhooks.js +16 -16
- package/dist/auth/login.d.ts +3 -3
- package/dist/auth/login.js +221 -221
- package/dist/auth/login.spec.d.ts +1 -1
- package/dist/auth/login.spec.js +10 -10
- package/dist/baseFlags.d.ts +10 -10
- package/dist/baseFlags.js +25 -25
- package/dist/basecommand.d.ts +15 -15
- package/dist/basecommand.js +83 -83
- package/dist/commands/app/create.d.ts +10 -10
- package/dist/commands/app/create.js +96 -96
- package/dist/commands/app/delete.d.ts +11 -11
- package/dist/commands/app/delete.js +40 -40
- package/dist/commands/app/extension/deploy.d.ts +18 -18
- package/dist/commands/app/extension/deploy.js +127 -127
- package/dist/commands/app/extension/deployment/list.d.ts +14 -14
- package/dist/commands/app/extension/deployment/list.js +82 -82
- package/dist/commands/app/getApiKey.d.ts +11 -11
- package/dist/commands/app/getApiKey.js +49 -49
- package/dist/commands/app/init.d.ts +10 -10
- package/dist/commands/app/init.js +67 -67
- package/dist/commands/app/install.d.ts +13 -13
- package/dist/commands/app/install.js +135 -135
- package/dist/commands/app/publish.d.ts +14 -14
- package/dist/commands/app/publish.js +69 -69
- package/dist/commands/app/uninstall.d.ts +12 -12
- package/dist/commands/app/uninstall.js +68 -68
- package/dist/commands/app/upgrade.d.ts +14 -14
- package/dist/commands/app/upgrade.js +108 -108
- package/dist/commands/app/version/major.d.ts +11 -11
- package/dist/commands/app/version/major.js +39 -39
- package/dist/commands/app/version/minor.d.ts +11 -11
- package/dist/commands/app/version/minor.js +39 -39
- package/dist/commands/app/version/patch.d.ts +11 -11
- package/dist/commands/app/version/patch.js +39 -39
- package/dist/commands/config/create.d.ts +12 -12
- package/dist/commands/config/create.js +27 -27
- package/dist/commands/config/describe.d.ts +14 -14
- package/dist/commands/config/describe.js +46 -46
- package/dist/commands/config/list.d.ts +11 -11
- package/dist/commands/config/list.js +38 -38
- package/dist/commands/config/set.d.ts +16 -16
- package/dist/commands/config/set.js +46 -46
- package/dist/commands/config/use.d.ts +14 -14
- package/dist/commands/config/use.js +47 -47
- package/dist/commands/file/upload.d.ts +15 -15
- package/dist/commands/file/upload.js +69 -69
- package/dist/commands/groups/export.d.ts +14 -14
- package/dist/commands/groups/export.js +103 -103
- package/dist/commands/groups/import.d.ts +14 -14
- package/dist/commands/groups/import.js +190 -190
- package/dist/commands/instance/export.d.ts +12 -12
- package/dist/commands/instance/export.js +36 -36
- package/dist/commands/instance/import.d.ts +11 -11
- package/dist/commands/instance/import.js +34 -34
- package/dist/commands/load/colors.d.ts +14 -14
- package/dist/commands/load/colors.js +53 -53
- package/dist/commands/load/custom-entity.d.ts +14 -14
- package/dist/commands/load/custom-entity.js +55 -55
- package/dist/commands/load/line-sheet.d.ts +14 -14
- package/dist/commands/load/line-sheet.js +55 -55
- package/dist/commands/load/upload-and-load.d.ts +14 -14
- package/dist/commands/load/upload-and-load.js +46 -46
- package/dist/commands/load-local/index.d.ts +17 -0
- package/dist/commands/load-local/index.js +156 -0
- package/dist/commands/projects/export.d.ts +13 -13
- package/dist/commands/projects/export.js +35 -35
- package/dist/commands/projects/list.d.ts +10 -10
- package/dist/commands/projects/list.js +36 -36
- package/dist/commands/projects/load.d.ts +25 -25
- package/dist/commands/projects/load.js +198 -198
- package/dist/commands/types/exportOptionSetHierarchies.d.ts +11 -11
- package/dist/commands/types/exportOptionSetHierarchies.js +133 -133
- package/dist/commands/types/getAll.d.ts +21 -21
- package/dist/commands/types/getAll.js +180 -180
- package/dist/commands/types/getOptionSets.d.ts +16 -16
- package/dist/commands/types/getOptionSets.js +170 -170
- package/dist/commands/types/loadAll.d.ts +12 -12
- package/dist/commands/types/loadAll.js +55 -55
- package/dist/commands/types/mergeOptionSets.d.ts +13 -13
- package/dist/commands/types/mergeOptionSets.js +116 -116
- package/dist/commands/types/mergeTypeProperties.d.ts +15 -15
- package/dist/commands/types/mergeTypeProperties.js +95 -95
- package/dist/commands/types/parseOptionSetsHierarchyLocalFile.d.ts +14 -14
- package/dist/commands/types/parseOptionSetsHierarchyLocalFile.js +133 -133
- package/dist/commands/types/parseOptionSetsHierarchyValuesToKeysLocalFile.d.ts +14 -14
- package/dist/commands/types/parseOptionSetsHierarchyValuesToKeysLocalFile.js +102 -102
- package/dist/commands/types/parseOptionSetsLocalFiles.d.ts +39 -39
- package/dist/commands/types/parseOptionSetsLocalFiles.js +229 -229
- package/dist/commands/types/parseOptionSetsToFolderStructure.d.ts +13 -13
- package/dist/commands/types/parseOptionSetsToFolderStructure.js +68 -68
- package/dist/commands/types/parseTypesFromFiles.d.ts +14 -14
- package/dist/commands/types/parseTypesFromFiles.js +40 -40
- package/dist/commands/types/parseTypesFromLocalFiles.d.ts +14 -14
- package/dist/commands/types/parseTypesFromLocalFiles.js +37 -37
- package/dist/commands/types/parseTypesFromTemplateAndDataFromLocalFiles.d.ts +15 -15
- package/dist/commands/types/parseTypesFromTemplateAndDataFromLocalFiles.js +39 -39
- package/dist/commands/types/parseTypesFromTemplateFromLocalFiles.d.ts +14 -14
- package/dist/commands/types/parseTypesFromTemplateFromLocalFiles.js +38 -38
- package/dist/commands/types/uploadOptionSetHierarchies.d.ts +12 -12
- package/dist/commands/types/uploadOptionSetHierarchies.js +257 -257
- package/dist/commands/types/uploadOptionSets.d.ts +13 -13
- package/dist/commands/types/uploadOptionSets.js +155 -155
- package/dist/commands/types/uploadOptionSetsHierarchyLocalFile.d.ts +15 -15
- package/dist/commands/types/uploadOptionSetsHierarchyLocalFile.js +135 -135
- package/dist/commands/types/uploadRuleSets.d.ts +12 -12
- package/dist/commands/types/uploadRuleSets.js +197 -197
- package/dist/commands/types/uploadTypePolicies.d.ts +12 -12
- package/dist/commands/types/uploadTypePolicies.js +233 -233
- package/dist/commands/types/uploadTypePropertyPolicies.d.ts +13 -13
- package/dist/commands/types/uploadTypePropertyPolicies.js +286 -286
- package/dist/commands/types/uploadTypes.d.ts +13 -13
- package/dist/commands/types/uploadTypes.js +35 -35
- package/dist/commands/types/uploadUsageInfo.d.ts +15 -12
- package/dist/commands/types/uploadUsageInfo.js +179 -172
- package/dist/commands/types/uploadUsageInfo.spec.d.ts +1 -0
- package/dist/commands/types/uploadUsageInfo.spec.js +249 -0
- package/dist/commands/users/export.d.ts +14 -14
- package/dist/commands/users/export.js +76 -76
- package/dist/commands/users/import.d.ts +14 -14
- package/dist/commands/users/import.js +68 -68
- package/dist/commands/webhooks/create.d.ts +11 -11
- package/dist/commands/webhooks/create.js +25 -25
- package/dist/commands/webhooks/delete.d.ts +14 -14
- package/dist/commands/webhooks/delete.js +53 -53
- package/dist/commands/webhooks/getWebhookTrigger.d.ts +13 -13
- package/dist/commands/webhooks/getWebhookTrigger.js +40 -40
- package/dist/commands/webhooks/list.d.ts +12 -12
- package/dist/commands/webhooks/list.js +31 -31
- package/dist/commands/workflow-template-definitions/install.d.ts +10 -10
- package/dist/commands/workflow-template-definitions/install.js +19 -19
- package/dist/commands/workflow-template-definitions/list.d.ts +10 -10
- package/dist/commands/workflow-template-definitions/list.js +19 -19
- package/dist/commands/workflow-templates/delete.d.ts +10 -10
- package/dist/commands/workflow-templates/delete.js +19 -19
- package/dist/commands/workflow-templates/export.d.ts +14 -14
- package/dist/commands/workflow-templates/export.js +78 -78
- package/dist/commands/workflow-templates/list.d.ts +10 -10
- package/dist/commands/workflow-templates/list.js +19 -19
- package/dist/commands/workflow-templates/load.d.ts +13 -13
- package/dist/commands/workflow-templates/load.js +26 -26
- package/dist/common.d.ts +4 -4
- package/dist/common.js +18 -18
- package/dist/helpers/app/actions-deployer.d.ts +11 -11
- package/dist/helpers/app/actions-deployer.js +123 -123
- package/dist/helpers/app/app-config-validators.d.ts +22 -22
- package/dist/helpers/app/app-config-validators.js +100 -100
- package/dist/helpers/app/app-config-validators.spec.d.ts +1 -1
- package/dist/helpers/app/app-config-validators.spec.js +310 -310
- package/dist/helpers/app/app-deployer.d.ts +12 -12
- package/dist/helpers/app/app-deployer.js +278 -278
- package/dist/helpers/app/app-template-parsers.d.ts +14 -14
- package/dist/helpers/app/app-template-parsers.js +106 -106
- package/dist/helpers/app/extension-package-deployer.d.ts +7 -7
- package/dist/helpers/app/extension-package-deployer.js +175 -175
- package/dist/helpers/app/extensions-deployer.d.ts +9 -9
- package/dist/helpers/app/extensions-deployer.js +95 -95
- package/dist/helpers/app/load-app-config.d.ts +4 -4
- package/dist/helpers/app/load-app-config.js +22 -22
- package/dist/helpers/app/metadata-extractor.d.ts +1 -1
- package/dist/helpers/app/metadata-extractor.js +100 -100
- package/dist/helpers/app/setup-template.d.ts +8 -8
- package/dist/helpers/app/setup-template.js +48 -48
- package/dist/helpers/app/update-app-config.d.ts +2 -2
- package/dist/helpers/app/update-app-config.js +20 -20
- package/dist/helpers/app/upgrade-version.d.ts +16 -16
- package/dist/helpers/app/upgrade-version.js +37 -37
- package/dist/helpers/app/upgrade-version.spec.d.ts +1 -1
- package/dist/helpers/app/upgrade-version.spec.js +33 -33
- package/dist/helpers/colors/helpers.d.ts +12 -12
- package/dist/helpers/colors/helpers.js +84 -84
- package/dist/helpers/config/config.d.ts +16 -16
- package/dist/helpers/config/config.js +223 -223
- package/dist/helpers/file-helpers.d.ts +2 -2
- package/dist/helpers/file-helpers.js +36 -36
- package/dist/helpers/load/helpers.d.ts +20 -20
- package/dist/helpers/load/helpers.js +141 -141
- package/dist/helpers/load/helpers.spec.d.ts +1 -1
- package/dist/helpers/load/helpers.spec.js +62 -62
- package/dist/helpers/load/validators.d.ts +14 -14
- package/dist/helpers/load/validators.js +182 -182
- package/dist/helpers/load/validators.spec.d.ts +1 -1
- package/dist/helpers/load/validators.spec.js +450 -450
- package/dist/helpers/pipeline/formatters.d.ts +6 -0
- package/dist/helpers/pipeline/formatters.js +219 -0
- package/dist/helpers/projects/helpers.d.ts +3 -3
- package/dist/helpers/projects/helpers.js +167 -167
- package/dist/helpers/types/csv-parser.d.ts +1 -1
- package/dist/helpers/types/csv-parser.js +59 -59
- package/dist/helpers/types/option-set-helper.d.ts +9 -9
- package/dist/helpers/types/option-set-helper.js +48 -48
- package/dist/helpers/types/option-set-helper.spec.d.ts +1 -1
- package/dist/helpers/types/option-set-helper.spec.js +64 -64
- package/dist/helpers/types/parseOptionSetsLocalFiles.spec.d.ts +1 -1
- package/dist/helpers/types/parseOptionSetsLocalFiles.spec.js +285 -285
- package/dist/helpers/types/type-extractor.d.ts +1 -1
- package/dist/helpers/types/type-extractor.js +36 -36
- package/dist/helpers/types/type-parser.d.ts +4 -4
- package/dist/helpers/types/type-parser.js +119 -119
- package/dist/helpers/types/type-uploader.d.ts +20 -20
- package/dist/helpers/types/type-uploader.js +336 -336
- package/dist/helpers/types/type-uploader.spec.d.ts +1 -1
- package/dist/helpers/types/type-uploader.spec.js +266 -266
- package/dist/helpers/types/uploadOptionSets.spec.d.ts +1 -1
- package/dist/helpers/types/uploadOptionSets.spec.js +19 -19
- package/dist/helpers/workflow-template-definitions/workflow-template-definition-deployer.d.ts +12 -12
- package/dist/helpers/workflow-template-definitions/workflow-template-definition-deployer.js +158 -158
- package/dist/helpers/workflow-templates/helper.d.ts +20 -20
- package/dist/helpers/workflow-templates/helper.js +285 -285
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/interfaces.d.ts +470 -445
- package/dist/interfaces.js +163 -163
- package/dist/logger.d.ts +3 -3
- package/dist/logger.js +33 -33
- package/oclif.manifest.json +85 -1
- package/package.json +11 -6
package/dist/auth/login.js
CHANGED
|
@@ -1,221 +1,221 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getVersionFromPackageJson = exports.authUser = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const amazon_cognito_identity_js_1 = require("amazon-cognito-identity-js");
|
|
6
|
-
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
-
const sdk_1 = require("@contrail/sdk");
|
|
8
|
-
const config_1 = require("../helpers/config/config");
|
|
9
|
-
const logger_1 = tslib_1.__importDefault(require("../logger"));
|
|
10
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
11
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
12
|
-
const CONFIGURATION = {
|
|
13
|
-
userPoolId: 'us-east-1_qIaNZdUfm',
|
|
14
|
-
clientId: process.env.CONTRAIL_COGNITO_CLIENT_ID || '7knkt34gfacbgd0ghnuspefdfg',
|
|
15
|
-
apiGateway: 'https://api.vibeiq.com/prod/api',
|
|
16
|
-
};
|
|
17
|
-
async function authUser() {
|
|
18
|
-
logger_1.default.debug('authorizing user...');
|
|
19
|
-
const config = await (0, config_1.getConfig)();
|
|
20
|
-
if (process.env.CONTRAIL_CLI_API_KEY) {
|
|
21
|
-
const apiKey = process.env.CONTRAIL_CLI_API_KEY;
|
|
22
|
-
const orgSlug = await getOrgSlug(config);
|
|
23
|
-
logger_1.default.debug('Using API key for authentication...');
|
|
24
|
-
return await authenticateWithApiKey(config, apiKey, orgSlug);
|
|
25
|
-
}
|
|
26
|
-
if (config &&
|
|
27
|
-
config.apiUserToken &&
|
|
28
|
-
config.apiRefreshToken &&
|
|
29
|
-
config.apiGateway &&
|
|
30
|
-
config.orgSlug) {
|
|
31
|
-
logger_1.default.debug('populating auth config from fs config...');
|
|
32
|
-
sdk_1.Auth.config = {
|
|
33
|
-
apiUserToken: config.apiUserToken,
|
|
34
|
-
apiRefreshToken: config.apiRefreshToken,
|
|
35
|
-
apiGateway: config.apiGateway,
|
|
36
|
-
orgSlug: config.orgSlug,
|
|
37
|
-
};
|
|
38
|
-
(0, sdk_1.setConfig)(sdk_1.Auth.config);
|
|
39
|
-
try {
|
|
40
|
-
return await refreshCurrentUserOrg();
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
if (isNetworkConnectionError(e)) {
|
|
44
|
-
logger_1.default.error("Encountered a network connection issue. Please ensure you're connected to the internet and try again");
|
|
45
|
-
process.exit(1);
|
|
46
|
-
}
|
|
47
|
-
logger_1.default.info('Token expired. Requesting auth credentials...');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return await authenticateWithUsernamePassword(config);
|
|
51
|
-
}
|
|
52
|
-
exports.authUser = authUser;
|
|
53
|
-
async function getOrgSlug(config) {
|
|
54
|
-
const orgSlug = config?.orgSlug || process.env.CONTRAIL_CLI_ORG_SLUG;
|
|
55
|
-
if (!orgSlug) {
|
|
56
|
-
const answers = await inquirer_1.default.prompt([
|
|
57
|
-
{
|
|
58
|
-
type: 'input',
|
|
59
|
-
name: 'orgSlug',
|
|
60
|
-
validate: (val) => !!val,
|
|
61
|
-
message: 'Org (slug)',
|
|
62
|
-
},
|
|
63
|
-
]);
|
|
64
|
-
return answers.orgSlug;
|
|
65
|
-
}
|
|
66
|
-
return orgSlug;
|
|
67
|
-
}
|
|
68
|
-
async function authenticateWithApiKey(config, apiKey, orgSlug) {
|
|
69
|
-
const apiGateway = config?.apiGateway ?? CONFIGURATION.apiGateway;
|
|
70
|
-
sdk_1.Auth.config = {
|
|
71
|
-
apiUserToken: apiKey,
|
|
72
|
-
apiRefreshToken: null,
|
|
73
|
-
apiGateway,
|
|
74
|
-
orgSlug,
|
|
75
|
-
};
|
|
76
|
-
(0, sdk_1.setConfig)(sdk_1.Auth.config);
|
|
77
|
-
await (0, sdk_1.getCurrentUser)();
|
|
78
|
-
return returnAndStoreConfig(sdk_1.Auth.config);
|
|
79
|
-
}
|
|
80
|
-
async function authenticateWithUsernamePassword(config) {
|
|
81
|
-
const questions = [];
|
|
82
|
-
if (!process.env.CONTRAIL_CLI_EMAIL) {
|
|
83
|
-
questions.push({
|
|
84
|
-
type: 'input',
|
|
85
|
-
name: 'email',
|
|
86
|
-
validate: (val) => !!val,
|
|
87
|
-
message: 'Email',
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
if (!process.env.CONTRAIL_CLI_PASSWORD) {
|
|
91
|
-
questions.push({
|
|
92
|
-
type: 'password',
|
|
93
|
-
name: 'password',
|
|
94
|
-
validate: (val) => !!val,
|
|
95
|
-
message: 'Password',
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
const answers = await inquirer_1.default.prompt(questions);
|
|
99
|
-
const params = {
|
|
100
|
-
email: process.env.CONTRAIL_CLI_EMAIL || answers.email,
|
|
101
|
-
password: process.env.CONTRAIL_CLI_PASSWORD || answers.password,
|
|
102
|
-
orgSlug: await getOrgSlug(config),
|
|
103
|
-
...(config?.apiGateway && { apiGateway: config.apiGateway }),
|
|
104
|
-
};
|
|
105
|
-
if (!params.email || !params.password) {
|
|
106
|
-
throw new Error('Email and Password required');
|
|
107
|
-
}
|
|
108
|
-
const poolData = {
|
|
109
|
-
UserPoolId: CONFIGURATION.userPoolId,
|
|
110
|
-
ClientId: CONFIGURATION.clientId,
|
|
111
|
-
};
|
|
112
|
-
const userPool = new amazon_cognito_identity_js_1.CognitoUserPool(poolData);
|
|
113
|
-
const authData = {
|
|
114
|
-
Username: params.email,
|
|
115
|
-
Password: params.password,
|
|
116
|
-
};
|
|
117
|
-
const authDetails = new amazon_cognito_identity_js_1.AuthenticationDetails(authData);
|
|
118
|
-
const userData = {
|
|
119
|
-
Username: params.email,
|
|
120
|
-
Pool: userPool,
|
|
121
|
-
};
|
|
122
|
-
const cognitoUser = new amazon_cognito_identity_js_1.CognitoUser(userData);
|
|
123
|
-
return new Promise((resolve, reject) => {
|
|
124
|
-
cognitoUser.authenticateUser(authDetails, {
|
|
125
|
-
onSuccess: async (result) => {
|
|
126
|
-
const user = result;
|
|
127
|
-
const config = await setAuthContext(user, params);
|
|
128
|
-
resolve(config);
|
|
129
|
-
},
|
|
130
|
-
onFailure: (err) => {
|
|
131
|
-
reject(err);
|
|
132
|
-
},
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
async function setAuthContext(user, params) {
|
|
137
|
-
const apiGateway = params?.apiGateway ?? CONFIGURATION.apiGateway;
|
|
138
|
-
const { vibeAccessToken, vibeRefreshToken } = await getVibeAccessTokenFromCognitoAccessToken(user.idToken.jwtToken, apiGateway);
|
|
139
|
-
// Set Auth Config
|
|
140
|
-
sdk_1.Auth.config = {
|
|
141
|
-
apiUserToken: vibeAccessToken,
|
|
142
|
-
apiRefreshToken: vibeRefreshToken,
|
|
143
|
-
apiGateway,
|
|
144
|
-
orgSlug: params.orgSlug,
|
|
145
|
-
};
|
|
146
|
-
// SET SDK CONFIG
|
|
147
|
-
(0, sdk_1.setConfig)(sdk_1.Auth.config);
|
|
148
|
-
return refreshCurrentUserOrg();
|
|
149
|
-
}
|
|
150
|
-
async function refreshCurrentUserOrg() {
|
|
151
|
-
logger_1.default.debug('refreshing current user org...');
|
|
152
|
-
const currentUser = await (0, sdk_1.getCurrentUser)();
|
|
153
|
-
if (!currentUser) {
|
|
154
|
-
const config = await (0, config_1.getConfig)();
|
|
155
|
-
try {
|
|
156
|
-
const newVibeAccessToken = await requestRefreshedAccessToken(config.apiRefreshToken, config.apiGateway);
|
|
157
|
-
sdk_1.Auth.config = {
|
|
158
|
-
apiUserToken: newVibeAccessToken,
|
|
159
|
-
apiRefreshToken: config.apiRefreshToken,
|
|
160
|
-
apiGateway: config.apiGateway,
|
|
161
|
-
orgSlug: config.orgSlug,
|
|
162
|
-
};
|
|
163
|
-
console.log('fetched new access token from refresh token', newVibeAccessToken);
|
|
164
|
-
}
|
|
165
|
-
catch (e) {
|
|
166
|
-
throw Error('Could not get refresh token');
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
// TODO: To uncomment when telemetry backend is developed.
|
|
170
|
-
// const current_Version = getVersionFromPackageJson();
|
|
171
|
-
// await checkTelemetry(current_Version);
|
|
172
|
-
return returnAndStoreConfig(sdk_1.Auth.config);
|
|
173
|
-
}
|
|
174
|
-
async function getVibeAccessTokenFromCognitoAccessToken(cognitoAccessToken, apiGateway) {
|
|
175
|
-
const url = `${apiGateway}/auth/cognito/`;
|
|
176
|
-
const response = await fetch(url, {
|
|
177
|
-
method: 'POST',
|
|
178
|
-
headers: {
|
|
179
|
-
Accept: 'application/json',
|
|
180
|
-
'Content-Type': 'application/json',
|
|
181
|
-
},
|
|
182
|
-
body: JSON.stringify({ accessToken: cognitoAccessToken }),
|
|
183
|
-
});
|
|
184
|
-
return await response.json().then((data) => {
|
|
185
|
-
return { vibeAccessToken: data.accessToken, vibeRefreshToken: data.refreshToken };
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
async function requestRefreshedAccessToken(vibeRefreshToken, apiGateway) {
|
|
189
|
-
const url = `${apiGateway}/auth/jwt_refresh/`;
|
|
190
|
-
const response = await fetch(url, {
|
|
191
|
-
method: 'POST',
|
|
192
|
-
headers: {
|
|
193
|
-
Accept: 'application/json',
|
|
194
|
-
'Content-Type': 'application/json',
|
|
195
|
-
},
|
|
196
|
-
body: JSON.stringify({ refreshToken: vibeRefreshToken }),
|
|
197
|
-
});
|
|
198
|
-
return await response.json().then((data) => {
|
|
199
|
-
return data.accessToken;
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
function getVersionFromPackageJson() {
|
|
203
|
-
// Get the path to the package.json file
|
|
204
|
-
const packageJsonPath = path_1.default.resolve(process.cwd(), 'package.json');
|
|
205
|
-
// Read the package.json file
|
|
206
|
-
const packageJsonContent = fs_1.default.readFileSync(packageJsonPath, 'utf8');
|
|
207
|
-
// Parse the package.json content
|
|
208
|
-
const packageJson = JSON.parse(packageJsonContent);
|
|
209
|
-
// Return the version value
|
|
210
|
-
return packageJson.version;
|
|
211
|
-
}
|
|
212
|
-
exports.getVersionFromPackageJson = getVersionFromPackageJson;
|
|
213
|
-
async function returnAndStoreConfig(config) {
|
|
214
|
-
const configCopy = Object.assign({}, config);
|
|
215
|
-
await (0, config_1.storeConfig)(configCopy);
|
|
216
|
-
return configCopy;
|
|
217
|
-
}
|
|
218
|
-
function isNetworkConnectionError(e) {
|
|
219
|
-
const cause = e?.cause;
|
|
220
|
-
return cause?.code === 'ENOTFOUND' || cause?.code === 'ECONNREFUSED';
|
|
221
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVersionFromPackageJson = exports.authUser = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const amazon_cognito_identity_js_1 = require("amazon-cognito-identity-js");
|
|
6
|
+
const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
|
|
7
|
+
const sdk_1 = require("@contrail/sdk");
|
|
8
|
+
const config_1 = require("../helpers/config/config");
|
|
9
|
+
const logger_1 = tslib_1.__importDefault(require("../logger"));
|
|
10
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
11
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
12
|
+
const CONFIGURATION = {
|
|
13
|
+
userPoolId: 'us-east-1_qIaNZdUfm',
|
|
14
|
+
clientId: process.env.CONTRAIL_COGNITO_CLIENT_ID || '7knkt34gfacbgd0ghnuspefdfg',
|
|
15
|
+
apiGateway: 'https://api.vibeiq.com/prod/api',
|
|
16
|
+
};
|
|
17
|
+
async function authUser() {
|
|
18
|
+
logger_1.default.debug('authorizing user...');
|
|
19
|
+
const config = await (0, config_1.getConfig)();
|
|
20
|
+
if (process.env.CONTRAIL_CLI_API_KEY) {
|
|
21
|
+
const apiKey = process.env.CONTRAIL_CLI_API_KEY;
|
|
22
|
+
const orgSlug = await getOrgSlug(config);
|
|
23
|
+
logger_1.default.debug('Using API key for authentication...');
|
|
24
|
+
return await authenticateWithApiKey(config, apiKey, orgSlug);
|
|
25
|
+
}
|
|
26
|
+
if (config &&
|
|
27
|
+
config.apiUserToken &&
|
|
28
|
+
config.apiRefreshToken &&
|
|
29
|
+
config.apiGateway &&
|
|
30
|
+
config.orgSlug) {
|
|
31
|
+
logger_1.default.debug('populating auth config from fs config...');
|
|
32
|
+
sdk_1.Auth.config = {
|
|
33
|
+
apiUserToken: config.apiUserToken,
|
|
34
|
+
apiRefreshToken: config.apiRefreshToken,
|
|
35
|
+
apiGateway: config.apiGateway,
|
|
36
|
+
orgSlug: config.orgSlug,
|
|
37
|
+
};
|
|
38
|
+
(0, sdk_1.setConfig)(sdk_1.Auth.config);
|
|
39
|
+
try {
|
|
40
|
+
return await refreshCurrentUserOrg();
|
|
41
|
+
}
|
|
42
|
+
catch (e) {
|
|
43
|
+
if (isNetworkConnectionError(e)) {
|
|
44
|
+
logger_1.default.error("Encountered a network connection issue. Please ensure you're connected to the internet and try again");
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
logger_1.default.info('Token expired. Requesting auth credentials...');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return await authenticateWithUsernamePassword(config);
|
|
51
|
+
}
|
|
52
|
+
exports.authUser = authUser;
|
|
53
|
+
async function getOrgSlug(config) {
|
|
54
|
+
const orgSlug = config?.orgSlug || process.env.CONTRAIL_CLI_ORG_SLUG;
|
|
55
|
+
if (!orgSlug) {
|
|
56
|
+
const answers = await inquirer_1.default.prompt([
|
|
57
|
+
{
|
|
58
|
+
type: 'input',
|
|
59
|
+
name: 'orgSlug',
|
|
60
|
+
validate: (val) => !!val,
|
|
61
|
+
message: 'Org (slug)',
|
|
62
|
+
},
|
|
63
|
+
]);
|
|
64
|
+
return answers.orgSlug;
|
|
65
|
+
}
|
|
66
|
+
return orgSlug;
|
|
67
|
+
}
|
|
68
|
+
async function authenticateWithApiKey(config, apiKey, orgSlug) {
|
|
69
|
+
const apiGateway = config?.apiGateway ?? CONFIGURATION.apiGateway;
|
|
70
|
+
sdk_1.Auth.config = {
|
|
71
|
+
apiUserToken: apiKey,
|
|
72
|
+
apiRefreshToken: null,
|
|
73
|
+
apiGateway,
|
|
74
|
+
orgSlug,
|
|
75
|
+
};
|
|
76
|
+
(0, sdk_1.setConfig)(sdk_1.Auth.config);
|
|
77
|
+
await (0, sdk_1.getCurrentUser)();
|
|
78
|
+
return returnAndStoreConfig(sdk_1.Auth.config);
|
|
79
|
+
}
|
|
80
|
+
async function authenticateWithUsernamePassword(config) {
|
|
81
|
+
const questions = [];
|
|
82
|
+
if (!process.env.CONTRAIL_CLI_EMAIL) {
|
|
83
|
+
questions.push({
|
|
84
|
+
type: 'input',
|
|
85
|
+
name: 'email',
|
|
86
|
+
validate: (val) => !!val,
|
|
87
|
+
message: 'Email',
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (!process.env.CONTRAIL_CLI_PASSWORD) {
|
|
91
|
+
questions.push({
|
|
92
|
+
type: 'password',
|
|
93
|
+
name: 'password',
|
|
94
|
+
validate: (val) => !!val,
|
|
95
|
+
message: 'Password',
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const answers = await inquirer_1.default.prompt(questions);
|
|
99
|
+
const params = {
|
|
100
|
+
email: process.env.CONTRAIL_CLI_EMAIL || answers.email,
|
|
101
|
+
password: process.env.CONTRAIL_CLI_PASSWORD || answers.password,
|
|
102
|
+
orgSlug: await getOrgSlug(config),
|
|
103
|
+
...(config?.apiGateway && { apiGateway: config.apiGateway }),
|
|
104
|
+
};
|
|
105
|
+
if (!params.email || !params.password) {
|
|
106
|
+
throw new Error('Email and Password required');
|
|
107
|
+
}
|
|
108
|
+
const poolData = {
|
|
109
|
+
UserPoolId: CONFIGURATION.userPoolId,
|
|
110
|
+
ClientId: CONFIGURATION.clientId,
|
|
111
|
+
};
|
|
112
|
+
const userPool = new amazon_cognito_identity_js_1.CognitoUserPool(poolData);
|
|
113
|
+
const authData = {
|
|
114
|
+
Username: params.email,
|
|
115
|
+
Password: params.password,
|
|
116
|
+
};
|
|
117
|
+
const authDetails = new amazon_cognito_identity_js_1.AuthenticationDetails(authData);
|
|
118
|
+
const userData = {
|
|
119
|
+
Username: params.email,
|
|
120
|
+
Pool: userPool,
|
|
121
|
+
};
|
|
122
|
+
const cognitoUser = new amazon_cognito_identity_js_1.CognitoUser(userData);
|
|
123
|
+
return new Promise((resolve, reject) => {
|
|
124
|
+
cognitoUser.authenticateUser(authDetails, {
|
|
125
|
+
onSuccess: async (result) => {
|
|
126
|
+
const user = result;
|
|
127
|
+
const config = await setAuthContext(user, params);
|
|
128
|
+
resolve(config);
|
|
129
|
+
},
|
|
130
|
+
onFailure: (err) => {
|
|
131
|
+
reject(err);
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
async function setAuthContext(user, params) {
|
|
137
|
+
const apiGateway = params?.apiGateway ?? CONFIGURATION.apiGateway;
|
|
138
|
+
const { vibeAccessToken, vibeRefreshToken } = await getVibeAccessTokenFromCognitoAccessToken(user.idToken.jwtToken, apiGateway);
|
|
139
|
+
// Set Auth Config
|
|
140
|
+
sdk_1.Auth.config = {
|
|
141
|
+
apiUserToken: vibeAccessToken,
|
|
142
|
+
apiRefreshToken: vibeRefreshToken,
|
|
143
|
+
apiGateway,
|
|
144
|
+
orgSlug: params.orgSlug,
|
|
145
|
+
};
|
|
146
|
+
// SET SDK CONFIG
|
|
147
|
+
(0, sdk_1.setConfig)(sdk_1.Auth.config);
|
|
148
|
+
return refreshCurrentUserOrg();
|
|
149
|
+
}
|
|
150
|
+
async function refreshCurrentUserOrg() {
|
|
151
|
+
logger_1.default.debug('refreshing current user org...');
|
|
152
|
+
const currentUser = await (0, sdk_1.getCurrentUser)();
|
|
153
|
+
if (!currentUser) {
|
|
154
|
+
const config = await (0, config_1.getConfig)();
|
|
155
|
+
try {
|
|
156
|
+
const newVibeAccessToken = await requestRefreshedAccessToken(config.apiRefreshToken, config.apiGateway);
|
|
157
|
+
sdk_1.Auth.config = {
|
|
158
|
+
apiUserToken: newVibeAccessToken,
|
|
159
|
+
apiRefreshToken: config.apiRefreshToken,
|
|
160
|
+
apiGateway: config.apiGateway,
|
|
161
|
+
orgSlug: config.orgSlug,
|
|
162
|
+
};
|
|
163
|
+
console.log('fetched new access token from refresh token', newVibeAccessToken);
|
|
164
|
+
}
|
|
165
|
+
catch (e) {
|
|
166
|
+
throw Error('Could not get refresh token');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
// TODO: To uncomment when telemetry backend is developed.
|
|
170
|
+
// const current_Version = getVersionFromPackageJson();
|
|
171
|
+
// await checkTelemetry(current_Version);
|
|
172
|
+
return returnAndStoreConfig(sdk_1.Auth.config);
|
|
173
|
+
}
|
|
174
|
+
async function getVibeAccessTokenFromCognitoAccessToken(cognitoAccessToken, apiGateway) {
|
|
175
|
+
const url = `${apiGateway}/auth/cognito/`;
|
|
176
|
+
const response = await fetch(url, {
|
|
177
|
+
method: 'POST',
|
|
178
|
+
headers: {
|
|
179
|
+
Accept: 'application/json',
|
|
180
|
+
'Content-Type': 'application/json',
|
|
181
|
+
},
|
|
182
|
+
body: JSON.stringify({ accessToken: cognitoAccessToken }),
|
|
183
|
+
});
|
|
184
|
+
return await response.json().then((data) => {
|
|
185
|
+
return { vibeAccessToken: data.accessToken, vibeRefreshToken: data.refreshToken };
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
async function requestRefreshedAccessToken(vibeRefreshToken, apiGateway) {
|
|
189
|
+
const url = `${apiGateway}/auth/jwt_refresh/`;
|
|
190
|
+
const response = await fetch(url, {
|
|
191
|
+
method: 'POST',
|
|
192
|
+
headers: {
|
|
193
|
+
Accept: 'application/json',
|
|
194
|
+
'Content-Type': 'application/json',
|
|
195
|
+
},
|
|
196
|
+
body: JSON.stringify({ refreshToken: vibeRefreshToken }),
|
|
197
|
+
});
|
|
198
|
+
return await response.json().then((data) => {
|
|
199
|
+
return data.accessToken;
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
function getVersionFromPackageJson() {
|
|
203
|
+
// Get the path to the package.json file
|
|
204
|
+
const packageJsonPath = path_1.default.resolve(process.cwd(), 'package.json');
|
|
205
|
+
// Read the package.json file
|
|
206
|
+
const packageJsonContent = fs_1.default.readFileSync(packageJsonPath, 'utf8');
|
|
207
|
+
// Parse the package.json content
|
|
208
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
209
|
+
// Return the version value
|
|
210
|
+
return packageJson.version;
|
|
211
|
+
}
|
|
212
|
+
exports.getVersionFromPackageJson = getVersionFromPackageJson;
|
|
213
|
+
async function returnAndStoreConfig(config) {
|
|
214
|
+
const configCopy = Object.assign({}, config);
|
|
215
|
+
await (0, config_1.storeConfig)(configCopy);
|
|
216
|
+
return configCopy;
|
|
217
|
+
}
|
|
218
|
+
function isNetworkConnectionError(e) {
|
|
219
|
+
const cause = e?.cause;
|
|
220
|
+
return cause?.code === 'ENOTFOUND' || cause?.code === 'ECONNREFUSED';
|
|
221
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/auth/login.spec.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const login_1 = require("./login");
|
|
4
|
-
describe('getVersionFromPackageJson', () => {
|
|
5
|
-
it('should return the version value from package.json', () => {
|
|
6
|
-
const version = (0, login_1.getVersionFromPackageJson)();
|
|
7
|
-
expect(version).toBeDefined();
|
|
8
|
-
expect(typeof version).toBe('string');
|
|
9
|
-
});
|
|
10
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const login_1 = require("./login");
|
|
4
|
+
describe('getVersionFromPackageJson', () => {
|
|
5
|
+
it('should return the version value from package.json', () => {
|
|
6
|
+
const version = (0, login_1.getVersionFromPackageJson)();
|
|
7
|
+
expect(version).toBeDefined();
|
|
8
|
+
expect(typeof version).toBe('string');
|
|
9
|
+
});
|
|
10
|
+
});
|
package/dist/baseFlags.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export declare const LogLevelFlag: {
|
|
2
|
-
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
3
|
-
};
|
|
4
|
-
export declare const AlwaysConfirmEnvFlag: {
|
|
5
|
-
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
6
|
-
};
|
|
7
|
-
export declare const baseFlags: {
|
|
8
|
-
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
-
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
-
};
|
|
1
|
+
export declare const LogLevelFlag: {
|
|
2
|
+
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
3
|
+
};
|
|
4
|
+
export declare const AlwaysConfirmEnvFlag: {
|
|
5
|
+
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
6
|
+
};
|
|
7
|
+
export declare const baseFlags: {
|
|
8
|
+
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
};
|
package/dist/baseFlags.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.baseFlags = exports.AlwaysConfirmEnvFlag = exports.LogLevelFlag = void 0;
|
|
4
|
-
const core_1 = require("@oclif/core");
|
|
5
|
-
exports.LogLevelFlag = {
|
|
6
|
-
logLevel: core_1.Flags.string({
|
|
7
|
-
description: 'The Log Level',
|
|
8
|
-
required: false,
|
|
9
|
-
char: 'l',
|
|
10
|
-
options: ['error', 'warn', 'info', 'debug'],
|
|
11
|
-
}),
|
|
12
|
-
};
|
|
13
|
-
exports.AlwaysConfirmEnvFlag = {
|
|
14
|
-
alwaysConfirmEnv: core_1.Flags.string({
|
|
15
|
-
description: 'The Environment variables',
|
|
16
|
-
required: false,
|
|
17
|
-
char: 'e',
|
|
18
|
-
default: 'true',
|
|
19
|
-
options: ['true', 'false'],
|
|
20
|
-
}),
|
|
21
|
-
};
|
|
22
|
-
exports.baseFlags = {
|
|
23
|
-
...exports.LogLevelFlag,
|
|
24
|
-
...exports.AlwaysConfirmEnvFlag,
|
|
25
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.baseFlags = exports.AlwaysConfirmEnvFlag = exports.LogLevelFlag = void 0;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
exports.LogLevelFlag = {
|
|
6
|
+
logLevel: core_1.Flags.string({
|
|
7
|
+
description: 'The Log Level',
|
|
8
|
+
required: false,
|
|
9
|
+
char: 'l',
|
|
10
|
+
options: ['error', 'warn', 'info', 'debug'],
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
exports.AlwaysConfirmEnvFlag = {
|
|
14
|
+
alwaysConfirmEnv: core_1.Flags.string({
|
|
15
|
+
description: 'The Environment variables',
|
|
16
|
+
required: false,
|
|
17
|
+
char: 'e',
|
|
18
|
+
default: 'true',
|
|
19
|
+
options: ['true', 'false'],
|
|
20
|
+
}),
|
|
21
|
+
};
|
|
22
|
+
exports.baseFlags = {
|
|
23
|
+
...exports.LogLevelFlag,
|
|
24
|
+
...exports.AlwaysConfirmEnvFlag,
|
|
25
|
+
};
|
package/dist/basecommand.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export declare abstract class BaseCommand extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
skipValidateEnv: boolean;
|
|
5
|
-
skipConfirmEnv: boolean;
|
|
6
|
-
static baseFlags: {
|
|
7
|
-
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
-
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
-
};
|
|
10
|
-
protected flags: any;
|
|
11
|
-
protected args: any;
|
|
12
|
-
init(): Promise<void>;
|
|
13
|
-
setLogLevel(logLevel: string, config?: any): void;
|
|
14
|
-
private confirmEnv;
|
|
15
|
-
}
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export declare abstract class BaseCommand extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
skipValidateEnv: boolean;
|
|
5
|
+
skipConfirmEnv: boolean;
|
|
6
|
+
static baseFlags: {
|
|
7
|
+
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
protected flags: any;
|
|
11
|
+
protected args: any;
|
|
12
|
+
init(): Promise<void>;
|
|
13
|
+
setLogLevel(logLevel: string, config?: any): void;
|
|
14
|
+
private confirmEnv;
|
|
15
|
+
}
|