@optimizely/ocp-cli 1.0.0-beta.6 → 1.0.0-beta.7
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/dist/commands/accounts/Whoami.js +5 -5
- package/dist/commands/accounts/Whoami.js.map +1 -1
- package/dist/commands/accounts/Whois.js +9 -9
- package/dist/commands/accounts/Whois.js.map +1 -1
- package/dist/commands/app/BaseBuildCommand.js +40 -39
- package/dist/commands/app/BaseBuildCommand.js.map +1 -1
- package/dist/commands/app/Init.js +32 -32
- package/dist/commands/app/Init.js.map +1 -1
- package/dist/commands/app/Logs.js +38 -38
- package/dist/commands/app/Logs.js.map +1 -1
- package/dist/commands/app/Package.js +8 -8
- package/dist/commands/app/Package.js.map +1 -1
- package/dist/commands/app/Prepare.js +22 -22
- package/dist/commands/app/Prepare.js.map +1 -1
- package/dist/commands/app/Register.js +9 -9
- package/dist/commands/app/Register.js.map +1 -1
- package/dist/commands/app/Validate.js +4 -4
- package/dist/commands/app/Validate.js.map +1 -1
- package/dist/commands/availability/List.js +5 -5
- package/dist/commands/availability/List.js.map +1 -1
- package/dist/commands/directory/Info.js +15 -15
- package/dist/commands/directory/Info.js.map +1 -1
- package/dist/commands/directory/Install.js +10 -10
- package/dist/commands/directory/Install.js.map +1 -1
- package/dist/commands/directory/List.js +11 -11
- package/dist/commands/directory/List.js.map +1 -1
- package/dist/commands/directory/ListFunctions.js +11 -11
- package/dist/commands/directory/ListFunctions.js.map +1 -1
- package/dist/commands/directory/ListGlobalFunctions.js +10 -10
- package/dist/commands/directory/ListGlobalFunctions.js.map +1 -1
- package/dist/commands/directory/ListInstalls.js +9 -9
- package/dist/commands/directory/ListInstalls.js.map +1 -1
- package/dist/commands/directory/Publish.js +24 -24
- package/dist/commands/directory/Publish.js.map +1 -1
- package/dist/commands/directory/Status.js +10 -10
- package/dist/commands/directory/Status.js.map +1 -1
- package/dist/commands/directory/Uninstall.js +9 -9
- package/dist/commands/directory/Uninstall.js.map +1 -1
- package/dist/commands/directory/Unpublish.js +22 -22
- package/dist/commands/directory/Unpublish.js.map +1 -1
- package/dist/commands/directory/Uprade.js +15 -15
- package/dist/commands/directory/Uprade.js.map +1 -1
- package/dist/commands/env/GetEnvironment.js +5 -5
- package/dist/commands/env/GetEnvironment.js.map +1 -1
- package/dist/commands/env/SetEnvironment.js +7 -7
- package/dist/commands/env/SetEnvironment.js.map +1 -1
- package/dist/commands/jobs/List.js +35 -35
- package/dist/commands/jobs/List.js.map +1 -1
- package/dist/commands/jobs/RuntimeStatus.js +15 -15
- package/dist/commands/jobs/RuntimeStatus.js.map +1 -1
- package/dist/commands/jobs/Terminate.js +8 -8
- package/dist/commands/jobs/Terminate.js.map +1 -1
- package/dist/commands/jobs/Trigger.js +11 -11
- package/dist/commands/jobs/Trigger.js.map +1 -1
- package/dist/commands/review/List.js +7 -7
- package/dist/commands/review/List.js.map +1 -1
- package/dist/commands/review/Open.js +7 -7
- package/dist/commands/review/Open.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/AppPackager.js +3 -3
- package/dist/lib/AppPackager.js.map +1 -1
- package/dist/lib/AppUpdater.js +18 -18
- package/dist/lib/AppUpdater.js.map +1 -1
- package/dist/lib/AppUploader.js +13 -12
- package/dist/lib/AppUploader.js.map +1 -1
- package/dist/lib/EnvironmentalOutput.js +11 -10
- package/dist/lib/EnvironmentalOutput.js.map +1 -1
- package/dist/lib/MoriaApi.d.ts +1 -1
- package/dist/lib/MoriaApi.js +1 -1
- package/dist/lib/MoriaApi.js.map +1 -1
- package/dist/lib/RivendellApi.d.ts +1 -1
- package/dist/lib/RivendellApi.js +4 -4
- package/dist/lib/RivendellApi.js.map +1 -1
- package/dist/lib/Shards.js +4 -4
- package/dist/lib/Shards.js.map +1 -1
- package/dist/lib/TeminalPassthru.d.ts +1 -0
- package/dist/lib/TerminalInput.js +23 -23
- package/dist/lib/TerminalInput.js.map +1 -1
- package/dist/lib/TerminalMenu.js +14 -14
- package/dist/lib/TerminalMenu.js.map +1 -1
- package/dist/lib/TerminalSpinner.d.ts +2 -3
- package/dist/lib/TerminalSpinner.js +7 -9
- package/dist/lib/TerminalSpinner.js.map +1 -1
- package/dist/lib/build.d.ts +2 -2
- package/dist/lib/build.js +1 -1
- package/dist/lib/build.js.map +1 -1
- package/dist/lib/checkForUpdate.js +2 -2
- package/dist/lib/checkForUpdate.js.map +1 -1
- package/dist/lib/dev/app.js +6 -6
- package/dist/lib/dev/app.js.map +1 -1
- package/dist/lib/dev/index.js +6 -2
- package/dist/lib/dev/index.js.map +1 -1
- package/dist/lib/dev/logger.d.ts +1 -1
- package/dist/lib/dev/logger.js +3 -3
- package/dist/lib/dev/logger.js.map +1 -1
- package/dist/lib/die.js +2 -2
- package/dist/lib/die.js.map +1 -1
- package/dist/lib/formatBuildState.js +7 -7
- package/dist/lib/formatBuildState.js.map +1 -1
- package/dist/lib/formatError.js.map +1 -1
- package/dist/lib/formatJobStatus.js +9 -9
- package/dist/lib/formatJobStatus.js.map +1 -1
- package/dist/lib/formatReviewStatus.js +7 -7
- package/dist/lib/formatReviewStatus.js.map +1 -1
- package/dist/lib/formatVersionState.js +13 -13
- package/dist/lib/formatVersionState.js.map +1 -1
- package/dist/lib/gatherAppEnv.js +7 -7
- package/dist/lib/gatherAppEnv.js.map +1 -1
- package/dist/lib/parseDate.js +5 -5
- package/dist/lib/parseDate.js.map +1 -1
- package/dist/lib/templating/TemplateRenderer.js +5 -5
- package/dist/lib/templating/TemplateRenderer.js.map +1 -1
- package/dist/lib/templating/fetchTemplatesManifest.js +1 -1
- package/dist/lib/templating/fetchTemplatesManifest.js.map +1 -1
- package/dist/oo-cli.manifest.json +1 -1
- package/package.json +17 -24
- package/src/commands/accounts/Whoami.ts +2 -2
- package/src/commands/accounts/Whois.ts +2 -2
- package/src/commands/app/BaseBuildCommand.ts +4 -4
- package/src/commands/app/Init.ts +3 -3
- package/src/commands/app/Logs.ts +2 -2
- package/src/commands/app/Prepare.ts +1 -1
- package/src/commands/app/Register.ts +1 -1
- package/src/commands/app/Validate.ts +1 -1
- package/src/commands/availability/List.ts +2 -2
- package/src/commands/directory/Info.ts +2 -2
- package/src/commands/directory/Install.ts +2 -2
- package/src/commands/directory/List.ts +2 -2
- package/src/commands/directory/ListFunctions.ts +2 -2
- package/src/commands/directory/ListGlobalFunctions.ts +2 -2
- package/src/commands/directory/ListInstalls.ts +2 -2
- package/src/commands/directory/Publish.ts +4 -4
- package/src/commands/directory/Status.ts +1 -1
- package/src/commands/directory/Uninstall.ts +2 -2
- package/src/commands/directory/Unpublish.ts +4 -4
- package/src/commands/directory/Uprade.ts +3 -3
- package/src/commands/env/GetEnvironment.ts +1 -1
- package/src/commands/env/SetEnvironment.ts +1 -1
- package/src/commands/jobs/List.ts +2 -2
- package/src/commands/jobs/RuntimeStatus.ts +2 -2
- package/src/commands/jobs/Terminate.ts +2 -2
- package/src/commands/jobs/Trigger.ts +2 -2
- package/src/commands/review/List.ts +2 -2
- package/src/commands/review/Open.ts +2 -2
- package/src/lib/AppPackager.ts +1 -1
- package/src/lib/AppUpdater.ts +1 -1
- package/src/lib/AppUploader.ts +10 -14
- package/src/lib/EnvironmentalOutput.ts +9 -8
- package/src/lib/TerminalInput.ts +1 -1
- package/src/lib/TerminalMenu.ts +1 -1
- package/src/lib/TerminalSpinner.ts +4 -5
- package/src/lib/build.ts +1 -1
- package/src/lib/checkForUpdate.ts +1 -1
- package/src/lib/dev/app.ts +1 -1
- package/src/lib/dev/logger.ts +1 -1
- package/src/lib/die.ts +1 -1
- package/src/lib/formatBuildState.ts +1 -1
- package/src/lib/formatJobStatus.ts +1 -1
- package/src/lib/formatReviewStatus.ts +1 -1
- package/src/lib/formatVersionState.ts +1 -1
- package/src/lib/templating/TemplateRenderer.ts +1 -1
- /package/bin/{opti.js → ocp.js} +0 -0
|
@@ -3,7 +3,7 @@ import {die} from '../../lib/die';
|
|
|
3
3
|
import {formatError} from '../../lib/formatError';
|
|
4
4
|
import {Rivendell} from '../../lib/Rivendell';
|
|
5
5
|
import Account = Rivendell.Account;
|
|
6
|
-
import chalk from 'chalk';
|
|
6
|
+
import * as chalk from 'chalk';
|
|
7
7
|
import * as table from 'text-table';
|
|
8
8
|
import {styledStringLength} from '../../lib/StringUtils';
|
|
9
9
|
|
|
@@ -28,7 +28,7 @@ export class WhoisCommand {
|
|
|
28
28
|
const zone = this.availability || 'us';
|
|
29
29
|
console.log(chalk.yellow(`No accounts matching search term '${this.term}' found in ${zone}.`));
|
|
30
30
|
}
|
|
31
|
-
} catch (e) {
|
|
31
|
+
} catch (e: any) {
|
|
32
32
|
die(formatError(e));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {execSync} from 'child_process';
|
|
3
3
|
import {DotenvParseOutput} from 'dotenv';
|
|
4
4
|
import {defaultValue, flag, help, param} from 'oo-cli';
|
|
@@ -92,7 +92,7 @@ export abstract class BaseBuildCommand {
|
|
|
92
92
|
if (version?.state !== AppVersionState.RUNNING) {
|
|
93
93
|
await this.build(context, publish);
|
|
94
94
|
}
|
|
95
|
-
} catch (e) {
|
|
95
|
+
} catch (e: any) {
|
|
96
96
|
die(formatError(e));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -182,7 +182,7 @@ export abstract class BaseBuildCommand {
|
|
|
182
182
|
} else {
|
|
183
183
|
await this.registerVersion(context, packageUrl, appEnv, usePreviousAppEnvValues, shard);
|
|
184
184
|
}
|
|
185
|
-
} catch (e) {
|
|
185
|
+
} catch (e: any) {
|
|
186
186
|
die(`${formatError(e)} (${shard})`);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
@@ -243,7 +243,7 @@ export abstract class BaseBuildCommand {
|
|
|
243
243
|
spinner?.update(`Status: ${formatBuildState(state)}`);
|
|
244
244
|
}).then((errors: ErrorList) => {
|
|
245
245
|
spinner?.stop();
|
|
246
|
-
if (errors) {
|
|
246
|
+
if (errors && errors.length > 0) {
|
|
247
247
|
die(`${publish ? 'Build' : 'Validation'} failed:\n${errors.map((e) => ` * ${e}`).join('\n')}`);
|
|
248
248
|
} else if (publish) {
|
|
249
249
|
if (requiresReview) {
|
package/src/commands/app/Init.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {APP_ID_FORMAT, VENDOR_FORMAT, VERSION_FORMAT} from '@zaiusinc/app-sdk';
|
|
2
|
-
import chalk from 'chalk';
|
|
2
|
+
import * as chalk from 'chalk';
|
|
3
3
|
import * as columnify from 'columnify';
|
|
4
4
|
import * as fs from 'fs';
|
|
5
|
-
import
|
|
5
|
+
import { marked } from 'marked';
|
|
6
6
|
import * as MarkedTerminal from 'marked-terminal';
|
|
7
7
|
import fetch from 'node-fetch';
|
|
8
8
|
import {command, help, namespace, optional, param} from 'oo-cli';
|
|
@@ -294,7 +294,7 @@ export class CreateCommand {
|
|
|
294
294
|
const json = await deps.json() as any;
|
|
295
295
|
this.substitutions['app_sdk_version'] = this.getLatestSDKVersion(json['@zaiusinc/app-sdk']);
|
|
296
296
|
this.substitutions['node_sdk_version'] = this.getLatestSDKVersion(json['@zaiusinc/node-sdk']);
|
|
297
|
-
} catch (e) {
|
|
297
|
+
} catch (e: any) {
|
|
298
298
|
this.warnings.push('Error fetching sdk versions, defaulting to latest: ', e.message);
|
|
299
299
|
this.substitutions['app_sdk_version'] = 'latest';
|
|
300
300
|
this.substitutions['node_sdk_version'] = 'latest';
|
package/src/commands/app/Logs.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
|
|
3
3
|
import {command, defaultValue, flag, help, multiple, namespace, option} from 'oo-cli';
|
|
4
4
|
import {isValidDateOrEpochOrDurationString, parseDate} from '../../lib/parseDate';
|
|
@@ -143,7 +143,7 @@ export class LogsCommand {
|
|
|
143
143
|
spinner.stop();
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
} catch (e) {
|
|
146
|
+
} catch (e: any) {
|
|
147
147
|
die(formatError(e));
|
|
148
148
|
}
|
|
149
149
|
}
|
|
@@ -34,7 +34,7 @@ export class RegisterCommand {
|
|
|
34
34
|
const app = await Rivendell.registerApp(this.id, this.name, this.personal, shard);
|
|
35
35
|
console.log(`Registered app ${app.id} with name "${app.name} in ${shard}`);
|
|
36
36
|
}
|
|
37
|
-
} catch (e) {
|
|
37
|
+
} catch (e: any) {
|
|
38
38
|
die(formatError(e));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -3,7 +3,7 @@ import {die} from '../../lib/die';
|
|
|
3
3
|
import {formatError} from '../../lib/formatError';
|
|
4
4
|
import {Rivendell} from '../../lib/Rivendell';
|
|
5
5
|
import Shard = Rivendell.Shard;
|
|
6
|
-
import chalk from 'chalk';
|
|
6
|
+
import * as chalk from 'chalk';
|
|
7
7
|
import * as table from 'text-table';
|
|
8
8
|
import {styledStringLength} from '../../lib/StringUtils';
|
|
9
9
|
|
|
@@ -14,7 +14,7 @@ export class ListCommand {
|
|
|
14
14
|
public async list() {
|
|
15
15
|
try {
|
|
16
16
|
this.render(await Rivendell.shards());
|
|
17
|
-
} catch (e) {
|
|
17
|
+
} catch (e: any) {
|
|
18
18
|
die(formatError(e));
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {formatVersionState} from '../../lib/formatVersionState';
|
|
@@ -28,7 +28,7 @@ export class InfoCommand {
|
|
|
28
28
|
public async info() {
|
|
29
29
|
try {
|
|
30
30
|
await this.render(await Rivendell.fetchApp(this.appId, this.availability));
|
|
31
|
-
} catch (e) {
|
|
31
|
+
} catch (e: any) {
|
|
32
32
|
die(formatError(e));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {Rivendell} from '../../lib/Rivendell';
|
|
@@ -30,7 +30,7 @@ export class InstallCommand {
|
|
|
30
30
|
const install = await Rivendell.install(appId, version, this.trackerId, this.availability);
|
|
31
31
|
console.log(chalk.green(`Installed ${appId}@${version} for ${this.trackerId} ` +
|
|
32
32
|
`with install id ${install.id} in ${this.availability || 'us'}`));
|
|
33
|
-
} catch (e) {
|
|
33
|
+
} catch (e: any) {
|
|
34
34
|
die(formatError(e));
|
|
35
35
|
}
|
|
36
36
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, flag, help, namespace, option, optional, param} from 'oo-cli';
|
|
3
3
|
import * as semver from 'semver';
|
|
4
4
|
import * as table from 'text-table';
|
|
@@ -40,7 +40,7 @@ export class ListCommand {
|
|
|
40
40
|
criteria.appId = this.appId;
|
|
41
41
|
}
|
|
42
42
|
this.render(await Rivendell.searchAppVersions(criteria, this.availability));
|
|
43
|
-
} catch (e) {
|
|
43
|
+
} catch (e: any) {
|
|
44
44
|
die(formatError(e));
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {formatError} from '../../lib/formatError';
|
|
@@ -31,7 +31,7 @@ export class ListFunctionsCommand {
|
|
|
31
31
|
}, this.availability);
|
|
32
32
|
|
|
33
33
|
this.render(webhooks);
|
|
34
|
-
} catch (e) {
|
|
34
|
+
} catch (e: any) {
|
|
35
35
|
die(formatError(e));
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {Rivendell} from '../../lib/Rivendell';
|
|
@@ -25,7 +25,7 @@ export class ListGlobalFunctionsCommand {
|
|
|
25
25
|
includeInternal: true,
|
|
26
26
|
includeDisabled: true
|
|
27
27
|
}, this.availability));
|
|
28
|
-
} catch (e) {
|
|
28
|
+
} catch (e: any) {
|
|
29
29
|
die(formatError(e));
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import * as table from 'text-table';
|
|
4
4
|
import {die} from '../../lib/die';
|
|
@@ -34,7 +34,7 @@ export class ListInstallsCommand {
|
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
this.render(version, appInstallations);
|
|
37
|
-
} catch (e) {
|
|
37
|
+
} catch (e: any) {
|
|
38
38
|
die(formatError(e));
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, flag, help, namespace, param} from 'oo-cli';
|
|
3
3
|
import {terminal} from 'terminal-kit';
|
|
4
4
|
import {AppContext} from '../../lib/AppContext';
|
|
@@ -65,7 +65,7 @@ export class PublishCommand {
|
|
|
65
65
|
await this.watchForPublishCompletion(context, await this.isStopped(context, shard), shard);
|
|
66
66
|
// since we are handling the interrupt, disable the handler so we can exit
|
|
67
67
|
terminal.removeAllListeners('key');
|
|
68
|
-
} catch (error) {
|
|
68
|
+
} catch (error: any) {
|
|
69
69
|
errors.push(`${formatError(error)} (${shard})`);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -77,7 +77,7 @@ export class PublishCommand {
|
|
|
77
77
|
if (pre && pre[0] !== 'dev') {
|
|
78
78
|
await this.checkOrphanedDeploys(appId, shards);
|
|
79
79
|
}
|
|
80
|
-
} catch (e) {
|
|
80
|
+
} catch (e: any) {
|
|
81
81
|
die(formatError(e));
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -130,7 +130,7 @@ export class PublishCommand {
|
|
|
130
130
|
|
|
131
131
|
private watchForPublishCompletion(context: AppContext, wasStopped: boolean, shard: string) {
|
|
132
132
|
console.log(chalk.gray(`Watching for publish (${shard}) to complete... CTRL+C to stop checking.`));
|
|
133
|
-
return new Promise((resolve, reject) => {
|
|
133
|
+
return new Promise<void>((resolve, reject) => {
|
|
134
134
|
const spinner = this.noProgress ? null : new TerminalSpinner().start('');
|
|
135
135
|
let attempts = 0;
|
|
136
136
|
let ignoreStopped = wasStopped;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {Rivendell} from '../../lib/Rivendell';
|
|
@@ -25,7 +25,7 @@ export class UninstallCommand {
|
|
|
25
25
|
const install = await Rivendell.fetchAppInstallation(this.appId, this.trackerId, this.availability);
|
|
26
26
|
await Rivendell.uninstall(install.id, this.availability);
|
|
27
27
|
console.log(chalk.green(`Uninstalled ${install.appId} from ${install.trackerId} (${this.availability || 'us'})`));
|
|
28
|
-
} catch (e) {
|
|
28
|
+
} catch (e: any) {
|
|
29
29
|
die(formatError(e));
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, flag, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import {terminal} from 'terminal-kit';
|
|
4
4
|
import {AppContext} from '../../lib/AppContext';
|
|
@@ -63,7 +63,7 @@ export class UnpublishCommand {
|
|
|
63
63
|
await Rivendell.unpublish(appId, version, shard);
|
|
64
64
|
console.log(chalk.green(`${this.appVersion} is being unpublished in ${shard}.`));
|
|
65
65
|
await this.watchForCompletion({appId, version}, shard);
|
|
66
|
-
} catch (error) {
|
|
66
|
+
} catch (error: any) {
|
|
67
67
|
errors.push(`${formatError(error)} (${shard})`);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -72,7 +72,7 @@ export class UnpublishCommand {
|
|
|
72
72
|
console.log(chalk.red(errors.join('\n')));
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
} catch (e) {
|
|
75
|
+
} catch (e: any) {
|
|
76
76
|
die(formatError(e));
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -134,7 +134,7 @@ export class UnpublishCommand {
|
|
|
134
134
|
|
|
135
135
|
private async watchForCompletion(context: AppContext, shard: string) {
|
|
136
136
|
console.log(chalk.gray(`Watching for unpublish to complete in ${shard}... CTRL+C to stop checking.`));
|
|
137
|
-
return new Promise((resolve, reject) => {
|
|
137
|
+
return new Promise<void>((resolve, reject) => {
|
|
138
138
|
const spinner = this.noProgress ? null : new TerminalSpinner().start('');
|
|
139
139
|
let attempts = 0;
|
|
140
140
|
const checkStatus = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param, required} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {formatError} from '../../lib/formatError';
|
|
@@ -45,14 +45,14 @@ export class UpgradeCommand {
|
|
|
45
45
|
chalk.green(`Upgraded ${this.trackerId} to ${this.appId}@${this.toVersion} in ${shard}.`));
|
|
46
46
|
terminal.removeAllListeners('key');
|
|
47
47
|
}
|
|
48
|
-
} catch (e) {
|
|
48
|
+
} catch (e: any) {
|
|
49
49
|
die(formatError(e));
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
private watchForCompletion(shard: string) {
|
|
54
54
|
console.log(chalk.gray(`Upgrade was scheduled in ${shard}, watching for completion... CTRL+C to stop checking.`));
|
|
55
|
-
return new Promise((resolve, reject) => {
|
|
55
|
+
return new Promise<void>((resolve, reject) => {
|
|
56
56
|
let attempts = 0;
|
|
57
57
|
const spinner = new TerminalSpinner().start('');
|
|
58
58
|
const checkUpgrade = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, multiple, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import * as table from 'text-table';
|
|
4
4
|
import {isValidDateOrEpochOrDurationString, parseDate} from '../../lib/parseDate';
|
|
@@ -166,7 +166,7 @@ export class ListCommand {
|
|
|
166
166
|
} else {
|
|
167
167
|
this.render(this.amendWithDuration(jobs));
|
|
168
168
|
}
|
|
169
|
-
} catch (e) {
|
|
169
|
+
} catch (e: any) {
|
|
170
170
|
die(formatError(e));
|
|
171
171
|
}
|
|
172
172
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {formatError} from '../../lib/formatError';
|
|
@@ -42,7 +42,7 @@ export class RuntimeStatusCommand {
|
|
|
42
42
|
die(`Runtime Status not available. This is normal for jobs that are not running.`);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
} catch (e) {
|
|
45
|
+
} catch (e: any) {
|
|
46
46
|
die(formatError(e));
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {formatError} from '../../lib/formatError';
|
|
@@ -20,7 +20,7 @@ export class TerminateCommand {
|
|
|
20
20
|
public async terminate(): Promise<void> {
|
|
21
21
|
try {
|
|
22
22
|
await Rivendell.terminateJob(this.jobId, this.availability);
|
|
23
|
-
} catch (e) {
|
|
23
|
+
} catch (e: any) {
|
|
24
24
|
die(formatError(e));
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, option, param} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {formatError} from '../../lib/formatError';
|
|
@@ -32,7 +32,7 @@ export class TriggerCommand {
|
|
|
32
32
|
public async trigger(): Promise<void> {
|
|
33
33
|
try {
|
|
34
34
|
await Rivendell.triggerJob(this.appId, this.jobName, this.trackerId, this.parameters, this.availability);
|
|
35
|
-
} catch (e) {
|
|
35
|
+
} catch (e: any) {
|
|
36
36
|
die(formatError(e));
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, optional, param} from 'oo-cli';
|
|
3
3
|
import * as semver from 'semver';
|
|
4
4
|
import * as table from 'text-table';
|
|
@@ -32,7 +32,7 @@ export class ListCommand {
|
|
|
32
32
|
criteria.appId = this.appId;
|
|
33
33
|
}
|
|
34
34
|
this.render(await Rivendell.searchAppVersions(criteria, 'us'));
|
|
35
|
-
} catch (e) {
|
|
35
|
+
} catch (e: any) {
|
|
36
36
|
die(formatError(e));
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import {command, help, namespace, param} from 'oo-cli';
|
|
3
3
|
import {die} from '../../lib/die';
|
|
4
4
|
import {Rivendell} from '../../lib/Rivendell';
|
|
@@ -21,7 +21,7 @@ export class OpenCommand {
|
|
|
21
21
|
console.log(chalk.gray(`Review URL: ${chalk.white(`${reviewUrl}`)}`));
|
|
22
22
|
await open(reviewUrl);
|
|
23
23
|
console.log(chalk.gray(`Opened review of app ${this.appVersion}`));
|
|
24
|
-
} catch (e) {
|
|
24
|
+
} catch (e: any) {
|
|
25
25
|
die(formatError(e));
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/lib/AppPackager.ts
CHANGED
package/src/lib/AppUpdater.ts
CHANGED
package/src/lib/AppUploader.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import chalk from 'chalk';
|
|
1
|
+
import { S3 } from '@aws-sdk/client-s3';
|
|
2
|
+
import * as chalk from 'chalk';
|
|
3
3
|
import * as crypto from 'crypto';
|
|
4
4
|
import {AppContext} from './AppContext';
|
|
5
5
|
import {runtimeConfig} from './Config';
|
|
@@ -17,22 +17,18 @@ export class AppUploader {
|
|
|
17
17
|
const s3Key = `${vendor}/${appId}@${version}-${md5}.zip`;
|
|
18
18
|
const credentials = await Rivendell.uploadCredentials(vendor!, appId!, version!, md5);
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
await new S3({
|
|
21
21
|
region: runtimeConfig().awsRegion,
|
|
22
|
-
credentials:
|
|
23
|
-
credentials.accessKeyId,
|
|
24
|
-
credentials.secretAccessKey,
|
|
25
|
-
credentials.sessionToken
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
await new AWS.S3()
|
|
30
|
-
.putObject( {
|
|
22
|
+
credentials: {
|
|
23
|
+
accessKeyId: credentials.accessKeyId,
|
|
24
|
+
secretAccessKey: credentials.secretAccessKey,
|
|
25
|
+
sessionToken: credentials.sessionToken
|
|
26
|
+
}
|
|
27
|
+
}).putObject( {
|
|
31
28
|
Bucket: bucket,
|
|
32
29
|
Key: s3Key,
|
|
33
30
|
Body: this.packageData
|
|
34
|
-
})
|
|
35
|
-
.promise();
|
|
31
|
+
});
|
|
36
32
|
|
|
37
33
|
return `s3://${bucket}/${s3Key}`;
|
|
38
34
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import { existsSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import {getEnv} from './Config';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
function printEnv(env: string) {
|
|
7
|
+
switch (env) {
|
|
8
|
+
case 'staging': return chalk.yellow(env);
|
|
9
|
+
case 'production': return chalk.red(env);
|
|
10
|
+
default: return chalk.gray(env);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
11
13
|
|
|
12
14
|
export function showEnvironment() {
|
|
13
15
|
if (existsSync(join(__dirname, '../commands/env'))) {
|
|
14
16
|
const env = getEnv();
|
|
15
|
-
|
|
16
|
-
console.log(chalk.gray(`Active environment: ${color(env)}`));
|
|
17
|
+
console.log(chalk.gray(`Active environment: ${printEnv(env)}`));
|
|
17
18
|
}
|
|
18
19
|
}
|
package/src/lib/TerminalInput.ts
CHANGED
package/src/lib/TerminalMenu.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
1
|
+
import * as chalk from 'chalk';
|
|
2
2
|
import * as cliSpinners from 'cli-spinners';
|
|
3
3
|
import {Spinner} from 'cli-spinners';
|
|
4
4
|
import {stringWidth, terminal, truncateString} from 'terminal-kit';
|
|
@@ -22,7 +22,7 @@ export class TerminalSpinner {
|
|
|
22
22
|
private interval!: NodeJS.Timeout;
|
|
23
23
|
private spinner: Spinner;
|
|
24
24
|
|
|
25
|
-
constructor(
|
|
25
|
+
constructor(spinner?: Spinner) {
|
|
26
26
|
if (spinner) {
|
|
27
27
|
this.spinner = spinner;
|
|
28
28
|
} else {
|
|
@@ -44,9 +44,8 @@ export class TerminalSpinner {
|
|
|
44
44
|
return this;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
public update(text: string
|
|
47
|
+
public update(text: string) {
|
|
48
48
|
this.text = text;
|
|
49
|
-
this.color = spinnerColor;
|
|
50
49
|
this.render();
|
|
51
50
|
}
|
|
52
51
|
|
|
@@ -61,7 +60,7 @@ export class TerminalSpinner {
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
private renderSpinner() {
|
|
64
|
-
terminal(` ${chalk.
|
|
63
|
+
terminal(` ${chalk.yellow(this.spinner.frames[this.counter % this.spinner.frames.length])} `);
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
private render() {
|
package/src/lib/build.ts
CHANGED
|
@@ -18,7 +18,7 @@ export async function watchBuild(
|
|
|
18
18
|
if (state === BuildState.FINISHED) {
|
|
19
19
|
clearInterval(interval);
|
|
20
20
|
if (build.status as BuildStatus === BuildStatus.SUCCESS) {
|
|
21
|
-
resolve();
|
|
21
|
+
resolve([]);
|
|
22
22
|
} else {
|
|
23
23
|
const errors = build.errors || [];
|
|
24
24
|
resolve(errors);
|
package/src/lib/dev/app.ts
CHANGED
package/src/lib/dev/logger.ts
CHANGED
package/src/lib/die.ts
CHANGED