@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.
Files changed (163) hide show
  1. package/dist/commands/accounts/Whoami.js +5 -5
  2. package/dist/commands/accounts/Whoami.js.map +1 -1
  3. package/dist/commands/accounts/Whois.js +9 -9
  4. package/dist/commands/accounts/Whois.js.map +1 -1
  5. package/dist/commands/app/BaseBuildCommand.js +40 -39
  6. package/dist/commands/app/BaseBuildCommand.js.map +1 -1
  7. package/dist/commands/app/Init.js +32 -32
  8. package/dist/commands/app/Init.js.map +1 -1
  9. package/dist/commands/app/Logs.js +38 -38
  10. package/dist/commands/app/Logs.js.map +1 -1
  11. package/dist/commands/app/Package.js +8 -8
  12. package/dist/commands/app/Package.js.map +1 -1
  13. package/dist/commands/app/Prepare.js +22 -22
  14. package/dist/commands/app/Prepare.js.map +1 -1
  15. package/dist/commands/app/Register.js +9 -9
  16. package/dist/commands/app/Register.js.map +1 -1
  17. package/dist/commands/app/Validate.js +4 -4
  18. package/dist/commands/app/Validate.js.map +1 -1
  19. package/dist/commands/availability/List.js +5 -5
  20. package/dist/commands/availability/List.js.map +1 -1
  21. package/dist/commands/directory/Info.js +15 -15
  22. package/dist/commands/directory/Info.js.map +1 -1
  23. package/dist/commands/directory/Install.js +10 -10
  24. package/dist/commands/directory/Install.js.map +1 -1
  25. package/dist/commands/directory/List.js +11 -11
  26. package/dist/commands/directory/List.js.map +1 -1
  27. package/dist/commands/directory/ListFunctions.js +11 -11
  28. package/dist/commands/directory/ListFunctions.js.map +1 -1
  29. package/dist/commands/directory/ListGlobalFunctions.js +10 -10
  30. package/dist/commands/directory/ListGlobalFunctions.js.map +1 -1
  31. package/dist/commands/directory/ListInstalls.js +9 -9
  32. package/dist/commands/directory/ListInstalls.js.map +1 -1
  33. package/dist/commands/directory/Publish.js +24 -24
  34. package/dist/commands/directory/Publish.js.map +1 -1
  35. package/dist/commands/directory/Status.js +10 -10
  36. package/dist/commands/directory/Status.js.map +1 -1
  37. package/dist/commands/directory/Uninstall.js +9 -9
  38. package/dist/commands/directory/Uninstall.js.map +1 -1
  39. package/dist/commands/directory/Unpublish.js +22 -22
  40. package/dist/commands/directory/Unpublish.js.map +1 -1
  41. package/dist/commands/directory/Uprade.js +15 -15
  42. package/dist/commands/directory/Uprade.js.map +1 -1
  43. package/dist/commands/env/GetEnvironment.js +5 -5
  44. package/dist/commands/env/GetEnvironment.js.map +1 -1
  45. package/dist/commands/env/SetEnvironment.js +7 -7
  46. package/dist/commands/env/SetEnvironment.js.map +1 -1
  47. package/dist/commands/jobs/List.js +35 -35
  48. package/dist/commands/jobs/List.js.map +1 -1
  49. package/dist/commands/jobs/RuntimeStatus.js +15 -15
  50. package/dist/commands/jobs/RuntimeStatus.js.map +1 -1
  51. package/dist/commands/jobs/Terminate.js +8 -8
  52. package/dist/commands/jobs/Terminate.js.map +1 -1
  53. package/dist/commands/jobs/Trigger.js +11 -11
  54. package/dist/commands/jobs/Trigger.js.map +1 -1
  55. package/dist/commands/review/List.js +7 -7
  56. package/dist/commands/review/List.js.map +1 -1
  57. package/dist/commands/review/Open.js +7 -7
  58. package/dist/commands/review/Open.js.map +1 -1
  59. package/dist/index.js +2 -2
  60. package/dist/index.js.map +1 -1
  61. package/dist/lib/AppPackager.js +3 -3
  62. package/dist/lib/AppPackager.js.map +1 -1
  63. package/dist/lib/AppUpdater.js +18 -18
  64. package/dist/lib/AppUpdater.js.map +1 -1
  65. package/dist/lib/AppUploader.js +13 -12
  66. package/dist/lib/AppUploader.js.map +1 -1
  67. package/dist/lib/EnvironmentalOutput.js +11 -10
  68. package/dist/lib/EnvironmentalOutput.js.map +1 -1
  69. package/dist/lib/MoriaApi.d.ts +1 -1
  70. package/dist/lib/MoriaApi.js +1 -1
  71. package/dist/lib/MoriaApi.js.map +1 -1
  72. package/dist/lib/RivendellApi.d.ts +1 -1
  73. package/dist/lib/RivendellApi.js +4 -4
  74. package/dist/lib/RivendellApi.js.map +1 -1
  75. package/dist/lib/Shards.js +4 -4
  76. package/dist/lib/Shards.js.map +1 -1
  77. package/dist/lib/TeminalPassthru.d.ts +1 -0
  78. package/dist/lib/TerminalInput.js +23 -23
  79. package/dist/lib/TerminalInput.js.map +1 -1
  80. package/dist/lib/TerminalMenu.js +14 -14
  81. package/dist/lib/TerminalMenu.js.map +1 -1
  82. package/dist/lib/TerminalSpinner.d.ts +2 -3
  83. package/dist/lib/TerminalSpinner.js +7 -9
  84. package/dist/lib/TerminalSpinner.js.map +1 -1
  85. package/dist/lib/build.d.ts +2 -2
  86. package/dist/lib/build.js +1 -1
  87. package/dist/lib/build.js.map +1 -1
  88. package/dist/lib/checkForUpdate.js +2 -2
  89. package/dist/lib/checkForUpdate.js.map +1 -1
  90. package/dist/lib/dev/app.js +6 -6
  91. package/dist/lib/dev/app.js.map +1 -1
  92. package/dist/lib/dev/index.js +6 -2
  93. package/dist/lib/dev/index.js.map +1 -1
  94. package/dist/lib/dev/logger.d.ts +1 -1
  95. package/dist/lib/dev/logger.js +3 -3
  96. package/dist/lib/dev/logger.js.map +1 -1
  97. package/dist/lib/die.js +2 -2
  98. package/dist/lib/die.js.map +1 -1
  99. package/dist/lib/formatBuildState.js +7 -7
  100. package/dist/lib/formatBuildState.js.map +1 -1
  101. package/dist/lib/formatError.js.map +1 -1
  102. package/dist/lib/formatJobStatus.js +9 -9
  103. package/dist/lib/formatJobStatus.js.map +1 -1
  104. package/dist/lib/formatReviewStatus.js +7 -7
  105. package/dist/lib/formatReviewStatus.js.map +1 -1
  106. package/dist/lib/formatVersionState.js +13 -13
  107. package/dist/lib/formatVersionState.js.map +1 -1
  108. package/dist/lib/gatherAppEnv.js +7 -7
  109. package/dist/lib/gatherAppEnv.js.map +1 -1
  110. package/dist/lib/parseDate.js +5 -5
  111. package/dist/lib/parseDate.js.map +1 -1
  112. package/dist/lib/templating/TemplateRenderer.js +5 -5
  113. package/dist/lib/templating/TemplateRenderer.js.map +1 -1
  114. package/dist/lib/templating/fetchTemplatesManifest.js +1 -1
  115. package/dist/lib/templating/fetchTemplatesManifest.js.map +1 -1
  116. package/dist/oo-cli.manifest.json +1 -1
  117. package/package.json +17 -24
  118. package/src/commands/accounts/Whoami.ts +2 -2
  119. package/src/commands/accounts/Whois.ts +2 -2
  120. package/src/commands/app/BaseBuildCommand.ts +4 -4
  121. package/src/commands/app/Init.ts +3 -3
  122. package/src/commands/app/Logs.ts +2 -2
  123. package/src/commands/app/Prepare.ts +1 -1
  124. package/src/commands/app/Register.ts +1 -1
  125. package/src/commands/app/Validate.ts +1 -1
  126. package/src/commands/availability/List.ts +2 -2
  127. package/src/commands/directory/Info.ts +2 -2
  128. package/src/commands/directory/Install.ts +2 -2
  129. package/src/commands/directory/List.ts +2 -2
  130. package/src/commands/directory/ListFunctions.ts +2 -2
  131. package/src/commands/directory/ListGlobalFunctions.ts +2 -2
  132. package/src/commands/directory/ListInstalls.ts +2 -2
  133. package/src/commands/directory/Publish.ts +4 -4
  134. package/src/commands/directory/Status.ts +1 -1
  135. package/src/commands/directory/Uninstall.ts +2 -2
  136. package/src/commands/directory/Unpublish.ts +4 -4
  137. package/src/commands/directory/Uprade.ts +3 -3
  138. package/src/commands/env/GetEnvironment.ts +1 -1
  139. package/src/commands/env/SetEnvironment.ts +1 -1
  140. package/src/commands/jobs/List.ts +2 -2
  141. package/src/commands/jobs/RuntimeStatus.ts +2 -2
  142. package/src/commands/jobs/Terminate.ts +2 -2
  143. package/src/commands/jobs/Trigger.ts +2 -2
  144. package/src/commands/review/List.ts +2 -2
  145. package/src/commands/review/Open.ts +2 -2
  146. package/src/lib/AppPackager.ts +1 -1
  147. package/src/lib/AppUpdater.ts +1 -1
  148. package/src/lib/AppUploader.ts +10 -14
  149. package/src/lib/EnvironmentalOutput.ts +9 -8
  150. package/src/lib/TerminalInput.ts +1 -1
  151. package/src/lib/TerminalMenu.ts +1 -1
  152. package/src/lib/TerminalSpinner.ts +4 -5
  153. package/src/lib/build.ts +1 -1
  154. package/src/lib/checkForUpdate.ts +1 -1
  155. package/src/lib/dev/app.ts +1 -1
  156. package/src/lib/dev/logger.ts +1 -1
  157. package/src/lib/die.ts +1 -1
  158. package/src/lib/formatBuildState.ts +1 -1
  159. package/src/lib/formatJobStatus.ts +1 -1
  160. package/src/lib/formatReviewStatus.ts +1 -1
  161. package/src/lib/formatVersionState.ts +1 -1
  162. package/src/lib/templating/TemplateRenderer.ts +1 -1
  163. /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) {
@@ -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 * as marked from 'marked';
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';
@@ -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
  }
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
  import {command, flag, help, namespace} from 'oo-cli';
3
3
  import {appContext} from '../../lib/AppContext';
4
4
  import {PublishCommand} from '../directory/Publish';
@@ -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
  }
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
  import {command, help, namespace} from 'oo-cli';
3
3
  import {BaseBuildCommand} from './BaseBuildCommand';
4
4
 
@@ -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;
@@ -38,7 +38,7 @@ export class StatusCommand {
38
38
  console.log(`Review status: ${formatReviewStatus(reviewStatus, appVersionState)}`);
39
39
  }
40
40
  }
41
- } catch (e) {
41
+ } catch (e: any) {
42
42
  die(formatError(e));
43
43
  }
44
44
  }
@@ -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, namespace} from 'oo-cli';
3
3
  import {getEnv, runtimeConfig} from '../../lib/Config';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import * as fs from 'fs';
2
2
  import * as os from 'os';
3
3
  import * as path from 'path';
4
- import chalk from 'chalk';
4
+ import * as chalk from 'chalk';
5
5
  import {command, help, namespace, param} from 'oo-cli';
6
6
  import { getEnv } from '../../lib/Config';
7
7
 
@@ -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
  }
@@ -1,5 +1,5 @@
1
1
  import * as AdmZip from 'adm-zip';
2
- import chalk from 'chalk';
2
+ import * as chalk from 'chalk';
3
3
  import * as child_process from 'child_process';
4
4
  import * as fs from 'fs';
5
5
  import * as glob from 'glob';
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
  import * as child_process from 'child_process';
3
3
  import fetch from 'node-fetch';
4
4
  import {compare, major} from 'semver';
@@ -1,5 +1,5 @@
1
- import * as AWS from 'aws-sdk';
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
- AWS.config.update({
20
+ await new S3({
21
21
  region: runtimeConfig().awsRegion,
22
- credentials: new AWS.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
- const envColors = {
7
- staging: chalk.yellow,
8
- production: chalk.red,
9
- other: chalk.gray
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
- const color = envColors[env as keyof typeof envColors] || envColors['other'];
16
- console.log(chalk.gray(`Active environment: ${color(env)}`));
17
+ console.log(chalk.gray(`Active environment: ${printEnv(env)}`));
17
18
  }
18
19
  }
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
  import {stringWidth, terminal} from 'terminal-kit';
3
3
 
4
4
  interface Coordinates {
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
  import {stringWidth, terminal, truncateString} from 'terminal-kit';
3
3
 
4
4
  export interface MenuOptions {
@@ -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(private color: string = 'yellow', spinner?: Spinner) {
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, spinnerColor = this.color) {
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.keyword(this.color)(this.spinner.frames[this.counter % this.spinner.frames.length])} `);
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);
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
  import * as fs from 'fs';
3
3
  import * as os from 'os';
4
4
  import * as path from 'path';
@@ -1,7 +1,7 @@
1
1
  import {ChildProcess, spawn} from 'child_process';
2
2
  import fetch from 'node-fetch';
3
3
  import {DevLogger} from './logger';
4
- import chalk from 'chalk';
4
+ import * as chalk from 'chalk';
5
5
 
6
6
  const logger = new DevLogger();
7
7
 
@@ -1,7 +1,7 @@
1
1
  import * as fs from 'fs';
2
2
  import * as path from 'path';
3
3
  import {Readable, Writable} from 'stream';
4
- import chalk from 'chalk';
4
+ import * as chalk from 'chalk';
5
5
 
6
6
  type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'NEVER';
7
7
 
package/src/lib/die.ts CHANGED
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
 
3
3
  /**
4
4
  * Logs an error message (in red) then exits with code 1.
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
  import {Rivendell} from './Rivendell';
3
3
 
4
4
  export function formatBuildState(state: Rivendell.BuildState): string {
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
  import {Rivendell} from './Rivendell';
3
3
  import JobStatus = Rivendell.JobStatus;
4
4
 
@@ -1,4 +1,4 @@
1
- import chalk from 'chalk';
1
+ import * as chalk from 'chalk';
2
2
  import {Rivendell} from './Rivendell';
3
3
  import AppVersionState = Rivendell.AppVersionState;
4
4
  import ReviewStatus = Rivendell.ReviewStatus;