@contrail/cli 3.7.0 → 3.8.0-alpha.115939c
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 +331 -81
- package/dist/auth/login.js +5 -1
- package/dist/auth/login.spec.js +33 -0
- package/dist/baseFlags.d.ts +4 -0
- package/dist/baseFlags.js +9 -1
- package/dist/basecommand.d.ts +6 -0
- package/dist/basecommand.js +13 -2
- package/dist/basecommand.spec.d.ts +1 -0
- package/dist/basecommand.spec.js +82 -0
- package/dist/commands/app/create.d.ts +1 -0
- package/dist/commands/app/delete.d.ts +1 -0
- package/dist/commands/app/extension/deploy.d.ts +1 -0
- package/dist/commands/app/extension/deployment/list.d.ts +1 -0
- package/dist/commands/app/getApiKey.d.ts +1 -0
- package/dist/commands/app/init.d.ts +1 -0
- package/dist/commands/app/install.d.ts +1 -0
- package/dist/commands/app/publish.d.ts +1 -0
- package/dist/commands/app/publish.js +1 -1
- package/dist/commands/app/uninstall.d.ts +1 -0
- package/dist/commands/app/upgrade.d.ts +1 -0
- package/dist/commands/app/version/major.d.ts +1 -0
- package/dist/commands/app/version/minor.d.ts +1 -0
- package/dist/commands/app/version/patch.d.ts +1 -0
- package/dist/commands/app/version/premajor.d.ts +12 -0
- package/dist/commands/app/version/premajor.js +32 -0
- package/dist/commands/app/version/preminor.d.ts +12 -0
- package/dist/commands/app/version/preminor.js +32 -0
- package/dist/commands/app/version/prepatch.d.ts +12 -0
- package/dist/commands/app/version/prepatch.js +32 -0
- package/dist/commands/app/version/prerelease.d.ts +12 -0
- package/dist/commands/app/version/prerelease.js +32 -0
- package/dist/commands/config/create.d.ts +3 -3
- package/dist/commands/config/create.js +2 -3
- package/dist/commands/config/describe.d.ts +3 -3
- package/dist/commands/config/describe.js +7 -6
- package/dist/commands/config/list.d.ts +3 -3
- package/dist/commands/config/list.js +7 -6
- package/dist/commands/config/set.d.ts +2 -3
- package/dist/commands/config/set.js +13 -9
- package/dist/commands/config/use.d.ts +3 -3
- package/dist/commands/config/use.js +5 -3
- package/dist/commands/entities/create.d.ts +1 -0
- package/dist/commands/entities/delete.d.ts +1 -0
- package/dist/commands/entities/get.d.ts +1 -0
- package/dist/commands/entities/update.d.ts +1 -0
- package/dist/commands/feature-flags/export.d.ts +1 -0
- package/dist/commands/feature-flags/import.d.ts +1 -0
- package/dist/commands/file/upload.d.ts +1 -0
- package/dist/commands/groups/export.d.ts +1 -0
- package/dist/commands/groups/import.d.ts +1 -0
- package/dist/commands/instance/export.d.ts +1 -0
- package/dist/commands/instance/import.d.ts +1 -0
- package/dist/commands/load/colors.d.ts +1 -0
- package/dist/commands/load/custom-entity.d.ts +1 -0
- package/dist/commands/load/line-sheet.d.ts +1 -0
- package/dist/commands/load/upload-and-load.d.ts +1 -0
- package/dist/commands/load-local/index.d.ts +1 -0
- package/dist/commands/login.d.ts +1 -0
- package/dist/commands/org-config/export.d.ts +1 -0
- package/dist/commands/org-config/import.d.ts +1 -0
- package/dist/commands/projects/export.d.ts +1 -0
- package/dist/commands/projects/list.d.ts +1 -0
- package/dist/commands/projects/load.d.ts +1 -0
- package/dist/commands/types/exportOptionSetHierarchies.d.ts +1 -0
- package/dist/commands/types/getAll.d.ts +1 -0
- package/dist/commands/types/getOptionSets.d.ts +1 -0
- package/dist/commands/types/loadAll.d.ts +1 -0
- package/dist/commands/types/mergeOptionSets.d.ts +1 -0
- package/dist/commands/types/mergeTypeProperties.d.ts +1 -0
- package/dist/commands/types/parseOptionSetsHierarchyLocalFile.d.ts +1 -0
- package/dist/commands/types/parseOptionSetsHierarchyValuesToKeysLocalFile.d.ts +1 -0
- package/dist/commands/types/parseOptionSetsLocalFiles.d.ts +1 -0
- package/dist/commands/types/parseOptionSetsToFolderStructure.d.ts +1 -0
- package/dist/commands/types/parseTypesFromFiles.d.ts +1 -0
- package/dist/commands/types/parseTypesFromLocalFiles.d.ts +1 -0
- package/dist/commands/types/parseTypesFromTemplateAndDataFromLocalFiles.d.ts +1 -0
- package/dist/commands/types/parseTypesFromTemplateFromLocalFiles.d.ts +1 -0
- package/dist/commands/types/uploadOptionSetHierarchies.d.ts +1 -0
- package/dist/commands/types/uploadOptionSets.d.ts +1 -0
- package/dist/commands/types/uploadOptionSetsHierarchyLocalFile.d.ts +1 -0
- package/dist/commands/types/uploadRuleSets.d.ts +1 -0
- package/dist/commands/types/uploadTypeOverrides.d.ts +1 -0
- package/dist/commands/types/uploadTypePolicies.d.ts +1 -0
- package/dist/commands/types/uploadTypePropertyPolicies.d.ts +1 -0
- package/dist/commands/types/uploadTypes.d.ts +1 -0
- package/dist/commands/users/export.d.ts +1 -0
- package/dist/commands/users/import.d.ts +1 -0
- package/dist/commands/webhooks/create.d.ts +1 -0
- package/dist/commands/webhooks/delete.d.ts +1 -0
- package/dist/commands/webhooks/getWebhookTrigger.d.ts +1 -0
- package/dist/commands/webhooks/list.d.ts +1 -0
- package/dist/commands/workflow-template-definitions/install.d.ts +1 -0
- package/dist/commands/workflow-template-definitions/list.d.ts +1 -0
- package/dist/commands/workflow-templates/delete.d.ts +1 -0
- package/dist/commands/workflow-templates/export.d.ts +1 -0
- package/dist/commands/workflow-templates/list.d.ts +1 -0
- package/dist/commands/workflow-templates/load.d.ts +1 -0
- package/dist/helpers/app/app-config-validators.js +4 -4
- package/dist/helpers/app/app-config-validators.spec.js +29 -0
- package/dist/helpers/app/app-deployer.d.ts +1 -0
- package/dist/helpers/app/app-deployer.js +35 -0
- package/dist/helpers/app/app-template-parsers.js +4 -1
- package/dist/helpers/app/app-template-parsers.spec.d.ts +1 -0
- package/dist/helpers/app/app-template-parsers.spec.js +15 -0
- package/dist/helpers/app/upgrade-version.d.ts +7 -1
- package/dist/helpers/app/upgrade-version.js +11 -8
- package/dist/helpers/app/upgrade-version.spec.js +26 -0
- package/dist/helpers/config/config.d.ts +6 -2
- package/dist/helpers/config/config.js +54 -41
- package/dist/helpers/config/config.spec.d.ts +1 -0
- package/dist/helpers/config/config.spec.js +81 -0
- package/dist/helpers/config/redact-tokens.d.ts +1 -0
- package/dist/helpers/config/redact-tokens.js +14 -0
- package/dist/helpers/config/redact-tokens.spec.d.ts +1 -0
- package/dist/helpers/config/redact-tokens.spec.js +24 -0
- package/dist/interfaces.d.ts +1 -0
- package/oclif.manifest.json +721 -13
- package/package.json +1 -1
package/dist/auth/login.js
CHANGED
|
@@ -171,7 +171,11 @@ async function authenticateWithApiKey(config, apiKey, orgSlug) {
|
|
|
171
171
|
};
|
|
172
172
|
(0, sdk_1.setConfig)(sdk_1.Auth.config);
|
|
173
173
|
await (0, sdk_1.getCurrentUser)();
|
|
174
|
-
|
|
174
|
+
const legacyStoredKey = config?.signInMethod === 'apiKey'
|
|
175
|
+
? { apiUserToken: undefined, apiRefreshToken: undefined, signInMethod: undefined }
|
|
176
|
+
: {};
|
|
177
|
+
await (0, config_1.storeConfig)({ orgSlug, apiGateway, ...legacyStoredKey });
|
|
178
|
+
return Object.assign({}, sdk_1.Auth.config);
|
|
175
179
|
}
|
|
176
180
|
async function authenticateWithUsernamePassword(params) {
|
|
177
181
|
const cognitoConfig = COGNITO_CONFIGS[params.environment];
|
package/dist/auth/login.spec.js
CHANGED
|
@@ -130,6 +130,39 @@ describe('authUser with email and password', () => {
|
|
|
130
130
|
expect(config_1.storeConfig).not.toHaveBeenCalled();
|
|
131
131
|
});
|
|
132
132
|
});
|
|
133
|
+
describe('authUser with an API key', () => {
|
|
134
|
+
const originalApiKey = process.env.CONTRAIL_CLI_API_KEY;
|
|
135
|
+
beforeEach(() => {
|
|
136
|
+
jest.clearAllMocks();
|
|
137
|
+
process.env.CONTRAIL_CLI_API_KEY = 'api-key-from-env';
|
|
138
|
+
config_1.getConfig.mockResolvedValue({ apiGateway: DEV_GATEWAY, orgSlug: 'adam-zone-1' });
|
|
139
|
+
sdk_1.getCurrentUser.mockResolvedValue({ id: 'user-1' });
|
|
140
|
+
});
|
|
141
|
+
afterEach(() => {
|
|
142
|
+
restoreEnv('CONTRAIL_CLI_API_KEY', originalApiKey);
|
|
143
|
+
});
|
|
144
|
+
it('should sign in with the key and save only the org and environment', async () => {
|
|
145
|
+
const context = await (0, login_1.authUser)();
|
|
146
|
+
expect(context).toMatchObject({ apiUserToken: 'api-key-from-env', orgSlug: 'adam-zone-1' });
|
|
147
|
+
expect(config_1.storeConfig).toHaveBeenCalledWith({ orgSlug: 'adam-zone-1', apiGateway: DEV_GATEWAY });
|
|
148
|
+
});
|
|
149
|
+
it('should remove an API key that an earlier version saved', async () => {
|
|
150
|
+
const legacyConfig = {
|
|
151
|
+
apiGateway: DEV_GATEWAY,
|
|
152
|
+
orgSlug: 'adam-zone-1',
|
|
153
|
+
apiUserToken: 'old-api-key',
|
|
154
|
+
apiRefreshToken: null,
|
|
155
|
+
signInMethod: 'apiKey',
|
|
156
|
+
};
|
|
157
|
+
config_1.getConfig.mockResolvedValue(legacyConfig);
|
|
158
|
+
await (0, login_1.authUser)();
|
|
159
|
+
const savedConfig = { ...legacyConfig, ...config_1.storeConfig.mock.calls[0][0] };
|
|
160
|
+
expect(JSON.parse(JSON.stringify(savedConfig))).toEqual({
|
|
161
|
+
apiGateway: DEV_GATEWAY,
|
|
162
|
+
orgSlug: 'adam-zone-1',
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
});
|
|
133
166
|
describe('authUser with stored tokens', () => {
|
|
134
167
|
const originalFetch = global.fetch;
|
|
135
168
|
const originalEmail = process.env.CONTRAIL_CLI_EMAIL;
|
package/dist/baseFlags.d.ts
CHANGED
|
@@ -4,7 +4,11 @@ export declare const LogLevelFlag: {
|
|
|
4
4
|
export declare const AlwaysConfirmEnvFlag: {
|
|
5
5
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
6
6
|
};
|
|
7
|
+
export declare const ConfigFlag: {
|
|
8
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
};
|
|
7
10
|
export declare const baseFlags: {
|
|
11
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
12
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
13
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
14
|
};
|
package/dist/baseFlags.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.baseFlags = exports.AlwaysConfirmEnvFlag = exports.LogLevelFlag = void 0;
|
|
3
|
+
exports.baseFlags = exports.ConfigFlag = exports.AlwaysConfirmEnvFlag = exports.LogLevelFlag = void 0;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
5
|
exports.LogLevelFlag = {
|
|
6
6
|
logLevel: core_1.Flags.string({
|
|
@@ -19,7 +19,15 @@ exports.AlwaysConfirmEnvFlag = {
|
|
|
19
19
|
options: ['true', 'false'],
|
|
20
20
|
}),
|
|
21
21
|
};
|
|
22
|
+
exports.ConfigFlag = {
|
|
23
|
+
config: core_1.Flags.string({
|
|
24
|
+
description: 'The config to use for this command. Defaults to the one chosen with `contrail config use`.',
|
|
25
|
+
required: false,
|
|
26
|
+
env: 'CONTRAIL_CLI_CONFIG',
|
|
27
|
+
}),
|
|
28
|
+
};
|
|
22
29
|
exports.baseFlags = {
|
|
23
30
|
...exports.LogLevelFlag,
|
|
24
31
|
...exports.AlwaysConfirmEnvFlag,
|
|
32
|
+
...exports.ConfigFlag,
|
|
25
33
|
};
|
package/dist/basecommand.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export declare abstract class BaseCommand extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
skipValidateEnv: boolean;
|
|
5
5
|
skipConfirmEnv: boolean;
|
|
6
|
+
shouldSelectConfigAtStart: boolean;
|
|
6
7
|
static baseFlags: {
|
|
8
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
9
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
10
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
11
|
};
|
|
@@ -16,3 +18,7 @@ export declare abstract class BaseCommand extends Command {
|
|
|
16
18
|
}): Promise<unknown>;
|
|
17
19
|
private confirmEnv;
|
|
18
20
|
}
|
|
21
|
+
export declare abstract class ConfigCommand extends BaseCommand {
|
|
22
|
+
skipConfirmEnv: boolean;
|
|
23
|
+
shouldSelectConfigAtStart: boolean;
|
|
24
|
+
}
|
package/dist/basecommand.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseCommand = void 0;
|
|
3
|
+
exports.ConfigCommand = exports.BaseCommand = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
const common_1 = require("./common");
|
|
@@ -14,6 +14,7 @@ class BaseCommand extends core_1.Command {
|
|
|
14
14
|
static description = 'Global Flags';
|
|
15
15
|
skipValidateEnv = true;
|
|
16
16
|
skipConfirmEnv = false;
|
|
17
|
+
shouldSelectConfigAtStart = true;
|
|
17
18
|
static baseFlags = {
|
|
18
19
|
...baseFlags_1.baseFlags,
|
|
19
20
|
};
|
|
@@ -32,6 +33,10 @@ class BaseCommand extends core_1.Command {
|
|
|
32
33
|
this.flags = flags;
|
|
33
34
|
this.args = args;
|
|
34
35
|
const config = await (0, config_1.readVibeIQConfig)();
|
|
36
|
+
(0, config_1.selectConfigForRun)({ requestedName: flags.config, nameInUse: config?.configInUse });
|
|
37
|
+
if (this.shouldSelectConfigAtStart) {
|
|
38
|
+
await (0, config_1.fetchConfigNameForRun)();
|
|
39
|
+
}
|
|
35
40
|
if (!this.skipValidateEnv) {
|
|
36
41
|
await (0, config_1.validateEnvironments)();
|
|
37
42
|
}
|
|
@@ -70,6 +75,7 @@ class BaseCommand extends core_1.Command {
|
|
|
70
75
|
env = (0, config_1.findEnvironmentName)(data.apiGateway);
|
|
71
76
|
}
|
|
72
77
|
data.environment = env;
|
|
78
|
+
data.config = await (0, config_1.fetchConfigNameForRun)();
|
|
73
79
|
delete data.apiGateway;
|
|
74
80
|
console.table(data);
|
|
75
81
|
const questions = [];
|
|
@@ -82,9 +88,14 @@ class BaseCommand extends core_1.Command {
|
|
|
82
88
|
});
|
|
83
89
|
const { confirm } = await (0, common_1.promptOnStderr)(questions);
|
|
84
90
|
if (confirm === 'no') {
|
|
85
|
-
logger_1.default.info('
|
|
91
|
+
logger_1.default.info('Pass --config <name> or set CONTRAIL_CLI_CONFIG to pick a configuration, or use `contrail config set --environment=prod` to set a different environment.');
|
|
86
92
|
this.exit(1);
|
|
87
93
|
}
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
96
|
exports.BaseCommand = BaseCommand;
|
|
97
|
+
class ConfigCommand extends BaseCommand {
|
|
98
|
+
skipConfirmEnv = true;
|
|
99
|
+
shouldSelectConfigAtStart = false;
|
|
100
|
+
}
|
|
101
|
+
exports.ConfigCommand = ConfigCommand;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const os_1 = require("os");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const basecommand_1 = require("./basecommand");
|
|
8
|
+
const list_1 = tslib_1.__importDefault(require("./commands/config/list"));
|
|
9
|
+
const set_1 = tslib_1.__importDefault(require("./commands/config/set"));
|
|
10
|
+
const config_1 = require("./helpers/config/config");
|
|
11
|
+
jest.mock('node:os', () => {
|
|
12
|
+
const actualOs = jest.requireActual('node:os');
|
|
13
|
+
return {
|
|
14
|
+
...actualOs,
|
|
15
|
+
homedir: () => `${actualOs.tmpdir()}/contrail-cli-basecommand-${process.pid}`,
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
jest.mock('./logger', () => ({
|
|
19
|
+
__esModule: true,
|
|
20
|
+
default: { debug: jest.fn(), info: jest.fn(), warn: jest.fn(), error: jest.fn() },
|
|
21
|
+
}));
|
|
22
|
+
class ConfigNameCommand extends basecommand_1.BaseCommand {
|
|
23
|
+
skipConfirmEnv = true;
|
|
24
|
+
static flags = { ...basecommand_1.BaseCommand.baseFlags };
|
|
25
|
+
async run() {
|
|
26
|
+
return (0, config_1.fetchConfigNameForRun)();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const PACKAGE_ROOT = (0, path_1.resolve)(__dirname, '..');
|
|
30
|
+
const home = (0, path_1.join)((0, os_1.tmpdir)(), `contrail-cli-basecommand-${process.pid}`);
|
|
31
|
+
describe('config selection on a command', () => {
|
|
32
|
+
const originalConfigEnv = process.env.CONTRAIL_CLI_CONFIG;
|
|
33
|
+
let configDir;
|
|
34
|
+
const writeJson = (name, content) => (0, fs_1.writeFileSync)((0, path_1.join)(configDir, `${name}.json`), JSON.stringify(content));
|
|
35
|
+
beforeEach(() => {
|
|
36
|
+
configDir = (0, path_1.join)(home, '.vibeiq', 'configs');
|
|
37
|
+
(0, fs_1.mkdirSync)(configDir, { recursive: true });
|
|
38
|
+
writeJson('config', { configInUse: 'pointer' });
|
|
39
|
+
for (const name of ['pointer', 'from-env', 'from-flag']) {
|
|
40
|
+
writeJson(name, { orgSlug: name });
|
|
41
|
+
}
|
|
42
|
+
delete process.env.CONTRAIL_CLI_CONFIG;
|
|
43
|
+
});
|
|
44
|
+
afterEach(() => {
|
|
45
|
+
if (originalConfigEnv === undefined) {
|
|
46
|
+
delete process.env.CONTRAIL_CLI_CONFIG;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
process.env.CONTRAIL_CLI_CONFIG = originalConfigEnv;
|
|
50
|
+
}
|
|
51
|
+
(0, fs_1.rmSync)(home, { recursive: true, force: true });
|
|
52
|
+
});
|
|
53
|
+
it('should use the config chosen with config use when no flag or env var is set', async () => {
|
|
54
|
+
expect(await ConfigNameCommand.run([], PACKAGE_ROOT)).toBe('pointer');
|
|
55
|
+
});
|
|
56
|
+
it('should use CONTRAIL_CLI_CONFIG over the config chosen with config use', async () => {
|
|
57
|
+
process.env.CONTRAIL_CLI_CONFIG = 'from-env';
|
|
58
|
+
expect(await ConfigNameCommand.run([], PACKAGE_ROOT)).toBe('from-env');
|
|
59
|
+
});
|
|
60
|
+
it('should use --config over CONTRAIL_CLI_CONFIG', async () => {
|
|
61
|
+
process.env.CONTRAIL_CLI_CONFIG = 'from-env';
|
|
62
|
+
expect(await ConfigNameCommand.run(['--config', 'from-flag'], PACKAGE_ROOT)).toBe('from-flag');
|
|
63
|
+
});
|
|
64
|
+
it('should create the named config when config set names one that does not exist', async () => {
|
|
65
|
+
await set_1.default.run(['--orgSlug', 'acme', '--config', 'new-config'], PACKAGE_ROOT);
|
|
66
|
+
expect(JSON.parse((0, fs_1.readFileSync)((0, path_1.join)(configDir, 'new-config.json')).toString())).toEqual({
|
|
67
|
+
orgSlug: 'acme',
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
it('should fail without creating a config when CONTRAIL_CLI_CONFIG names one that does not exist', async () => {
|
|
71
|
+
process.env.CONTRAIL_CLI_CONFIG = 'misspelled';
|
|
72
|
+
await expect(set_1.default.run(['--orgSlug', 'acme'], PACKAGE_ROOT)).rejects.toThrow('No config named "misspelled"');
|
|
73
|
+
expect((0, fs_1.existsSync)((0, path_1.join)(configDir, 'misspelled.json'))).toBe(false);
|
|
74
|
+
});
|
|
75
|
+
it('should list configs when CONTRAIL_CLI_CONFIG names one that does not exist', async () => {
|
|
76
|
+
process.env.CONTRAIL_CLI_CONFIG = 'misspelled';
|
|
77
|
+
const table = jest.spyOn(console, 'table').mockImplementation(() => undefined);
|
|
78
|
+
await list_1.default.run([], PACKAGE_ROOT);
|
|
79
|
+
expect(table).toHaveBeenCalledWith(expect.arrayContaining([{ Name: 'pointer' }]), ['Name']);
|
|
80
|
+
table.mockRestore();
|
|
81
|
+
});
|
|
82
|
+
});
|
|
@@ -3,6 +3,7 @@ export default class CreateApp extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
6
7
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
8
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
};
|
|
@@ -4,6 +4,7 @@ export default class DeleteApp extends BaseCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static strict: boolean;
|
|
6
6
|
static flags: {
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
8
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
};
|
|
@@ -5,6 +5,7 @@ export default class DeployExtension extends BaseCommand {
|
|
|
5
5
|
static flags: {
|
|
6
6
|
identifier: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
7
|
debug: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
11
|
};
|
|
@@ -5,6 +5,7 @@ export default class ListExtensionDeployments extends BaseCommand {
|
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
7
|
all: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
11
|
};
|
|
@@ -4,6 +4,7 @@ export default class GetAPIKeyApp extends BaseCommand {
|
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
6
|
appIdentifier: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
8
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
};
|
|
@@ -3,6 +3,7 @@ export default class InitApp extends BaseCommand {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
5
|
static flags: {
|
|
6
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
6
7
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
8
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
};
|
|
@@ -6,6 +6,7 @@ export default class InstallApp extends BaseCommand {
|
|
|
6
6
|
static flags: {
|
|
7
7
|
appIdentifier: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
8
|
installWorkflowTemplates: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
11
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
12
|
};
|
|
@@ -7,6 +7,7 @@ export default class PublishApp extends BaseCommand {
|
|
|
7
7
|
upgrade: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
dryRun: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
11
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
12
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
13
|
};
|
|
@@ -11,7 +11,7 @@ const upgrade_1 = require("./upgrade");
|
|
|
11
11
|
const basecommand_1 = require("../../basecommand");
|
|
12
12
|
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
13
13
|
class PublishApp extends basecommand_1.BaseCommand {
|
|
14
|
-
static description = 'Publish the app to the marketplace. This visibility of your app depends on the app.yml configuration ("visibility" property)';
|
|
14
|
+
static description = 'Publish the app to the marketplace. This visibility of your app depends on the app.yml configuration ("visibility" property). A pre-release version (e.g. "1.4.0-alpha.1") is published without becoming the latest version of the app.';
|
|
15
15
|
static examples = [
|
|
16
16
|
`$ contrail app publish
|
|
17
17
|
`,
|
|
@@ -5,6 +5,7 @@ export default class UninstallApp extends BaseCommand {
|
|
|
5
5
|
static strict: boolean;
|
|
6
6
|
static flags: {
|
|
7
7
|
appIdentifier: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
11
|
};
|
|
@@ -6,6 +6,7 @@ export default class UpgradeApp extends BaseCommand {
|
|
|
6
6
|
static flags: {
|
|
7
7
|
appIdentifier: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
8
|
latest: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
11
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
12
|
};
|
|
@@ -4,6 +4,7 @@ export default class AppMajorVersionUpgrade extends BaseCommand {
|
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
8
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
};
|
|
@@ -4,6 +4,7 @@ export default class AppMinorVersionUpgrade extends BaseCommand {
|
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
8
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
};
|
|
@@ -4,6 +4,7 @@ export default class AppPatchVersionUpgrade extends BaseCommand {
|
|
|
4
4
|
static description: string;
|
|
5
5
|
static examples: string[];
|
|
6
6
|
static flags: {
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
8
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
9
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
10
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../basecommand';
|
|
2
|
+
export default class AppPremajorVersionUpgrade extends BaseCommand {
|
|
3
|
+
skipConfirmEnv: boolean;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
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
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const load_app_config_1 = require("../../../helpers/app/load-app-config");
|
|
5
|
+
const basecommand_1 = require("../../../basecommand");
|
|
6
|
+
const logger_1 = tslib_1.__importDefault(require("../../../logger"));
|
|
7
|
+
const update_app_config_1 = require("../../../helpers/app/update-app-config");
|
|
8
|
+
const upgrade_version_1 = require("../../../helpers/app/upgrade-version");
|
|
9
|
+
class AppPremajorVersionUpgrade extends basecommand_1.BaseCommand {
|
|
10
|
+
skipConfirmEnv = true;
|
|
11
|
+
static description = 'Start an alpha pre-release of the next major app version (1.2.3 to 2.0.0-alpha.0).';
|
|
12
|
+
static examples = [
|
|
13
|
+
`$ contrail app version premajor
|
|
14
|
+
`,
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...basecommand_1.BaseCommand.baseFlags,
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
try {
|
|
21
|
+
const appDeclaration = (0, load_app_config_1.loadAppConfig)({ skipValidation: true });
|
|
22
|
+
logger_1.default.info(`Upgrading Pre-major Version for ${appDeclaration.version}`);
|
|
23
|
+
const version = (0, upgrade_version_1.upgradeVersion)(appDeclaration.version, 'premajor');
|
|
24
|
+
(0, update_app_config_1.updateAppConfig)({ ...appDeclaration, version });
|
|
25
|
+
logger_1.default.info(`Pre-major Version Upgraded to ${version}`);
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
logger_1.default.error(`Application Pre-major Version Upgrade Failed: ${e}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = AppPremajorVersionUpgrade;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../basecommand';
|
|
2
|
+
export default class AppPreminorVersionUpgrade extends BaseCommand {
|
|
3
|
+
skipConfirmEnv: boolean;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
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
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const load_app_config_1 = require("../../../helpers/app/load-app-config");
|
|
5
|
+
const basecommand_1 = require("../../../basecommand");
|
|
6
|
+
const logger_1 = tslib_1.__importDefault(require("../../../logger"));
|
|
7
|
+
const update_app_config_1 = require("../../../helpers/app/update-app-config");
|
|
8
|
+
const upgrade_version_1 = require("../../../helpers/app/upgrade-version");
|
|
9
|
+
class AppPreminorVersionUpgrade extends basecommand_1.BaseCommand {
|
|
10
|
+
skipConfirmEnv = true;
|
|
11
|
+
static description = 'Start an alpha pre-release of the next minor app version (1.2.3 to 1.3.0-alpha.0).';
|
|
12
|
+
static examples = [
|
|
13
|
+
`$ contrail app version preminor
|
|
14
|
+
`,
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...basecommand_1.BaseCommand.baseFlags,
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
try {
|
|
21
|
+
const appDeclaration = (0, load_app_config_1.loadAppConfig)({ skipValidation: true });
|
|
22
|
+
logger_1.default.info(`Upgrading Pre-minor Version for ${appDeclaration.version}`);
|
|
23
|
+
const version = (0, upgrade_version_1.upgradeVersion)(appDeclaration.version, 'preminor');
|
|
24
|
+
(0, update_app_config_1.updateAppConfig)({ ...appDeclaration, version });
|
|
25
|
+
logger_1.default.info(`Pre-minor Version Upgraded to ${version}`);
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
logger_1.default.error(`Application Pre-minor Version Upgrade Failed: ${e}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = AppPreminorVersionUpgrade;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../basecommand';
|
|
2
|
+
export default class AppPrepatchVersionUpgrade extends BaseCommand {
|
|
3
|
+
skipConfirmEnv: boolean;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
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
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const load_app_config_1 = require("../../../helpers/app/load-app-config");
|
|
5
|
+
const basecommand_1 = require("../../../basecommand");
|
|
6
|
+
const logger_1 = tslib_1.__importDefault(require("../../../logger"));
|
|
7
|
+
const update_app_config_1 = require("../../../helpers/app/update-app-config");
|
|
8
|
+
const upgrade_version_1 = require("../../../helpers/app/upgrade-version");
|
|
9
|
+
class AppPrepatchVersionUpgrade extends basecommand_1.BaseCommand {
|
|
10
|
+
skipConfirmEnv = true;
|
|
11
|
+
static description = 'Start an alpha pre-release of the next patch app version (1.2.3 to 1.2.4-alpha.0).';
|
|
12
|
+
static examples = [
|
|
13
|
+
`$ contrail app version prepatch
|
|
14
|
+
`,
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...basecommand_1.BaseCommand.baseFlags,
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
try {
|
|
21
|
+
const appDeclaration = (0, load_app_config_1.loadAppConfig)({ skipValidation: true });
|
|
22
|
+
logger_1.default.info(`Upgrading Pre-patch Version for ${appDeclaration.version}`);
|
|
23
|
+
const version = (0, upgrade_version_1.upgradeVersion)(appDeclaration.version, 'prepatch');
|
|
24
|
+
(0, update_app_config_1.updateAppConfig)({ ...appDeclaration, version });
|
|
25
|
+
logger_1.default.info(`Pre-patch Version Upgraded to ${version}`);
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
logger_1.default.error(`Application Pre-patch Version Upgrade Failed: ${e}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = AppPrepatchVersionUpgrade;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../basecommand';
|
|
2
|
+
export default class AppPrereleaseVersionUpgrade extends BaseCommand {
|
|
3
|
+
skipConfirmEnv: boolean;
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
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
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const load_app_config_1 = require("../../../helpers/app/load-app-config");
|
|
5
|
+
const basecommand_1 = require("../../../basecommand");
|
|
6
|
+
const logger_1 = tslib_1.__importDefault(require("../../../logger"));
|
|
7
|
+
const update_app_config_1 = require("../../../helpers/app/update-app-config");
|
|
8
|
+
const upgrade_version_1 = require("../../../helpers/app/upgrade-version");
|
|
9
|
+
class AppPrereleaseVersionUpgrade extends basecommand_1.BaseCommand {
|
|
10
|
+
skipConfirmEnv = true;
|
|
11
|
+
static description = 'Upgrade the Pre-release app version. A stable version becomes the first alpha of the next patch (1.2.3 to 1.2.4-alpha.0). A pre-release version gets its number bumped (1.2.4-alpha.0 to 1.2.4-alpha.1).';
|
|
12
|
+
static examples = [
|
|
13
|
+
`$ contrail app version prerelease
|
|
14
|
+
`,
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
...basecommand_1.BaseCommand.baseFlags,
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
try {
|
|
21
|
+
const appDeclaration = (0, load_app_config_1.loadAppConfig)({ skipValidation: true });
|
|
22
|
+
logger_1.default.info(`Upgrading Pre-release Version for ${appDeclaration.version}`);
|
|
23
|
+
const version = (0, upgrade_version_1.upgradeVersion)(appDeclaration.version, 'prerelease');
|
|
24
|
+
(0, update_app_config_1.updateAppConfig)({ ...appDeclaration, version });
|
|
25
|
+
logger_1.default.info(`Pre-release Version Upgraded to ${version}`);
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
logger_1.default.error(`Application Pre-release Version Upgrade Failed: ${e}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.default = AppPrereleaseVersionUpgrade;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class CreateConfig extends
|
|
1
|
+
import { ConfigCommand } from '../../basecommand';
|
|
2
|
+
export default class CreateConfig extends ConfigCommand {
|
|
3
3
|
static description: string;
|
|
4
|
-
skipConfirmEnv: boolean;
|
|
5
4
|
static examples: string[];
|
|
6
5
|
static flags: {
|
|
7
6
|
name: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
8
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
9
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
10
|
};
|
|
@@ -5,12 +5,11 @@ const config_1 = require("../../helpers/config/config");
|
|
|
5
5
|
const basecommand_1 = require("../../basecommand");
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
7
|
const logger_1 = tslib_1.__importDefault(require("../../logger"));
|
|
8
|
-
class CreateConfig extends basecommand_1.
|
|
8
|
+
class CreateConfig extends basecommand_1.ConfigCommand {
|
|
9
9
|
static description = 'Create a new configuration file';
|
|
10
|
-
skipConfirmEnv = true;
|
|
11
10
|
static examples = ['$ contrail config create --name demo-org'];
|
|
12
11
|
static flags = {
|
|
13
|
-
...basecommand_1.
|
|
12
|
+
...basecommand_1.ConfigCommand.baseFlags,
|
|
14
13
|
name: core_1.Flags.string({ description: 'The config name', required: true }),
|
|
15
14
|
};
|
|
16
15
|
async run() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export default class DescribeConfig extends
|
|
1
|
+
import { ConfigCommand } from '../../basecommand';
|
|
2
|
+
export default class DescribeConfig extends ConfigCommand {
|
|
3
3
|
static description: string;
|
|
4
|
-
skipConfirmEnv: boolean;
|
|
5
4
|
static examples: string[];
|
|
6
5
|
static args: {
|
|
7
6
|
name: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
8
7
|
};
|
|
9
8
|
static flags: {
|
|
9
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
10
|
alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
11
|
logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
12
|
};
|