@forge/cli 9.1.0 → 9.1.1-next.3

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 (82) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/npm-shrinkwrap.json +34 -35
  3. package/out/analytics-client/analytics-client.js +12 -39
  4. package/out/analytics-client/analytics-message-handler.js +27 -28
  5. package/out/autocomplete/index.js +2 -1
  6. package/out/autocomplete/util.js +1 -1
  7. package/out/bin/postinstall.js +1 -1
  8. package/out/command-line/command.js +116 -132
  9. package/out/command-line/controller/autocomplete-controller.js +0 -1
  10. package/out/command-line/controller/default-environment-controller.js +0 -8
  11. package/out/command-line/controller/deploy-controller.js +9 -25
  12. package/out/command-line/controller/feedback-controller.js +0 -2
  13. package/out/command-line/controller/install-controller.js +5 -11
  14. package/out/command-line/controller/lint-controller.js +1 -3
  15. package/out/command-line/controller/pre-command-controller.js +0 -6
  16. package/out/command-line/controller/prerequisites-controller.js +0 -3
  17. package/out/command-line/controller/settings-controller.js +57 -60
  18. package/out/command-line/controller/tunnel-controller.js +1 -7
  19. package/out/command-line/dependency-injection.js +2 -2
  20. package/out/command-line/errors.js +0 -1
  21. package/out/command-line/register-authentication-command.js +1 -1
  22. package/out/command-line/register-environment-variables-commands.js +8 -6
  23. package/out/command-line/register-installation-commands.js +7 -5
  24. package/out/command-line/register-log-commands.js +1 -1
  25. package/out/command-line/register-settings-commands.js +5 -3
  26. package/out/command-line/register-storage-commands.js +2 -1
  27. package/out/command-line/sentry.js +1 -4
  28. package/out/command-line/version-info.js +1 -1
  29. package/out/command-line/view/analytics-settings-view.js +0 -1
  30. package/out/command-line/view/deploy-view.js +0 -1
  31. package/out/command-line/view/install-view.js +0 -1
  32. package/out/command-line/view/lint-view.js +0 -2
  33. package/out/command-line/view/lite-lint-view.js +0 -2
  34. package/out/command-line/view/settings-view.js +0 -1
  35. package/out/command-line/view/tunnel-view.js +4 -4
  36. package/out/deploy/deployer/deploy-monitor-graphql-client.js +1 -2
  37. package/out/deploy/deployer/deployer.js +6 -13
  38. package/out/deploy/deployer/trigger-deploy-graphql-client.js +0 -1
  39. package/out/deploy/package-upload-deploy.js +0 -4
  40. package/out/deploy/packager/archiver.js +15 -19
  41. package/out/deploy/packager/nativeui-bundler.js +1 -6
  42. package/out/deploy/packager/packager.js +1 -7
  43. package/out/deploy/packager/runtime-bundler.d.ts +2 -3
  44. package/out/deploy/packager/runtime-bundler.d.ts.map +1 -1
  45. package/out/deploy/packager/runtime-bundler.js +5 -14
  46. package/out/deploy/uploader/artifact-graphql-client.js +0 -1
  47. package/out/deploy/uploader/uploader.js +0 -5
  48. package/out/entities/graphql-client.js +2 -2
  49. package/out/entities/list-indexes.js +0 -1
  50. package/out/environment/create-environment.js +1 -6
  51. package/out/environment/delete-environment.js +1 -6
  52. package/out/environment/graphql-client.js +3 -6
  53. package/out/environment/list-environment.js +0 -2
  54. package/out/environment-variables/delete-environment-variable.js +1 -6
  55. package/out/environment-variables/graphql-client.js +0 -1
  56. package/out/environment-variables/list-environment-variables.js +1 -6
  57. package/out/environment-variables/set-environment-variable.js +1 -6
  58. package/out/installations/graphql-client.js +22 -29
  59. package/out/installations/install-app-site.js +0 -2
  60. package/out/installations/site-translation/cloudid-products.js +0 -1
  61. package/out/installations/uninstall-app.js +0 -2
  62. package/out/migration-keys/graphql-client.js +4 -4
  63. package/out/providers/configure-provider.js +1 -6
  64. package/out/providers/graphql-client.js +0 -1
  65. package/out/service/cached-config-service.js +0 -1
  66. package/out/service/custom-entities-service.js +2 -4
  67. package/out/service/docker-service.js +1 -5
  68. package/out/service/installation-service.js +4 -7
  69. package/out/service/lint-service.js +0 -2
  70. package/out/service/lite-lint-service.js +0 -2
  71. package/out/service/migration-keys-service.js +0 -2
  72. package/out/service/port-finding-service.js +0 -1
  73. package/out/service/resource-packaging-service.js +0 -5
  74. package/out/service/resources-uploader-service.js +0 -2
  75. package/out/service/tunnel-analytics-service.js +3 -10
  76. package/out/service/tunnel-service.js +10 -19
  77. package/out/storage/local-file-storage.js +2 -2
  78. package/out/webtrigger/get-webtrigger-url.js +0 -4
  79. package/out/webtrigger/graphql-client.js +1 -2
  80. package/out/workers/analytics-message-worker.js +0 -3
  81. package/out/workers/version-check-worker.js +0 -1
  82. package/package.json +7 -7
@@ -9,75 +9,72 @@ const manifest_1 = require("@forge/manifest");
9
9
  const environment_1 = require("../environment");
10
10
  exports.ALLOWED_SETTINGS = ['usage-analytics', 'ngrok-config-path', 'default-environment'];
11
11
  class SettingsController {
12
- settingsView;
13
- cachedConfigService;
14
- getAppConfig;
15
12
  constructor(settingsView, cachedConfigService, getAppConfig) {
16
13
  this.settingsView = settingsView;
17
14
  this.cachedConfigService = cachedConfigService;
18
15
  this.getAppConfig = getAppConfig;
19
- }
20
- SETTINGS_MAP = {
21
- 'usage-analytics': {
22
- description: cli_shared_1.Text.settings.usageAnalytics.description,
23
- get: async () => this.cachedConfigService.getAnalyticsPreferences(),
24
- set: async (value) => {
25
- const parsedValue = this.parseBoolean(value);
26
- this.cachedConfigService.setAnalyticsPreferences(parsedValue);
27
- }
28
- },
29
- 'ngrok-config-path': {
30
- description: cli_shared_1.Text.settings.ngrokConfig.description,
31
- get: async () => this.cachedConfigService.getNgrokConfigPath(),
32
- set: async (value) => {
33
- value = path_1.default.resolve(value);
34
- let stat;
35
- try {
36
- stat = await promises_1.default.stat(value);
37
- }
38
- catch (e) {
39
- throw new cli_shared_1.ValidationError(cli_shared_1.Text.settings.ngrokConfig.errors.inaccessible(value, e.code));
16
+ this.SETTINGS_MAP = {
17
+ 'usage-analytics': {
18
+ description: cli_shared_1.Text.settings.usageAnalytics.description,
19
+ get: async () => this.cachedConfigService.getAnalyticsPreferences(),
20
+ set: async (value) => {
21
+ const parsedValue = this.parseBoolean(value);
22
+ this.cachedConfigService.setAnalyticsPreferences(parsedValue);
40
23
  }
41
- if (!stat.isFile()) {
42
- throw new cli_shared_1.ValidationError(cli_shared_1.Text.settings.ngrokConfig.errors.notAFile(value));
43
- }
44
- this.cachedConfigService.setNgrokConfigPath(value);
45
24
  },
46
- getDisplayValue: (value) => path_1.default.resolve(value)
47
- },
48
- 'default-environment': {
49
- description: cli_shared_1.Text.settings.defaultEnvironment.description,
50
- get: async () => {
51
- try {
52
- const { id: appId } = await this.getAppConfig();
53
- const environment = this.cachedConfigService.getDefaultEnvironment(appId);
54
- return environment ? (0, cli_shared_1.environmentToOption)(environment) : environment;
55
- }
56
- catch (e) {
57
- if (e instanceof cli_shared_1.InvalidManifestError) {
58
- return;
25
+ 'ngrok-config-path': {
26
+ description: cli_shared_1.Text.settings.ngrokConfig.description,
27
+ get: async () => this.cachedConfigService.getNgrokConfigPath(),
28
+ set: async (value) => {
29
+ value = path_1.default.resolve(value);
30
+ let stat;
31
+ try {
32
+ stat = await promises_1.default.stat(value);
59
33
  }
60
- throw e;
61
- }
62
- },
63
- set: async (value) => {
64
- (0, environment_1.validateDevEnvironment)(value);
65
- const environment = (0, environment_1.checkEnvironmentOption)(value);
66
- try {
67
- const { id: appId } = await this.getAppConfig();
68
- this.cachedConfigService.setDefaultEnvironment(appId, environment);
69
- }
70
- catch (e) {
71
- if (e instanceof cli_shared_1.InvalidManifestError) {
72
- throw new cli_shared_1.ValidationError(manifest_1.errors.missingManifest());
34
+ catch (e) {
35
+ throw new cli_shared_1.ValidationError(cli_shared_1.Text.settings.ngrokConfig.errors.inaccessible(value, e.code));
73
36
  }
74
- throw e;
75
- }
37
+ if (!stat.isFile()) {
38
+ throw new cli_shared_1.ValidationError(cli_shared_1.Text.settings.ngrokConfig.errors.notAFile(value));
39
+ }
40
+ this.cachedConfigService.setNgrokConfigPath(value);
41
+ },
42
+ getDisplayValue: (value) => path_1.default.resolve(value)
76
43
  },
77
- getDisplayValue: (value) => cli_shared_1.Text.env.displayEnvironment(value, cli_shared_1.AppEnvironmentType.Development),
78
- additionalInfo: cli_shared_1.Text.settings.defaultEnvironment.info
79
- }
80
- };
44
+ 'default-environment': {
45
+ description: cli_shared_1.Text.settings.defaultEnvironment.description,
46
+ get: async () => {
47
+ try {
48
+ const { id: appId } = await this.getAppConfig();
49
+ const environment = this.cachedConfigService.getDefaultEnvironment(appId);
50
+ return environment ? (0, cli_shared_1.environmentToOption)(environment) : environment;
51
+ }
52
+ catch (e) {
53
+ if (e instanceof cli_shared_1.InvalidManifestError) {
54
+ return;
55
+ }
56
+ throw e;
57
+ }
58
+ },
59
+ set: async (value) => {
60
+ (0, environment_1.validateDevEnvironment)(value);
61
+ const environment = (0, environment_1.checkEnvironmentOption)(value);
62
+ try {
63
+ const { id: appId } = await this.getAppConfig();
64
+ this.cachedConfigService.setDefaultEnvironment(appId, environment);
65
+ }
66
+ catch (e) {
67
+ if (e instanceof cli_shared_1.InvalidManifestError) {
68
+ throw new cli_shared_1.ValidationError(manifest_1.errors.missingManifest());
69
+ }
70
+ throw e;
71
+ }
72
+ },
73
+ getDisplayValue: (value) => cli_shared_1.Text.env.displayEnvironment(value, cli_shared_1.AppEnvironmentType.Development),
74
+ additionalInfo: cli_shared_1.Text.settings.defaultEnvironment.info
75
+ }
76
+ };
77
+ }
81
78
  parseBoolean(value) {
82
79
  switch (value) {
83
80
  case 'true':
@@ -5,12 +5,6 @@ const cli_shared_1 = require("@forge/cli-shared");
5
5
  const docker_service_1 = require("../../service/docker-service");
6
6
  const tunnel_service_1 = require("../../service/tunnel-service");
7
7
  class TunnelController {
8
- analyticsService;
9
- nodeTunnelService;
10
- localTunnelService;
11
- dockerTunnelService;
12
- tunnelView;
13
- configFile;
14
8
  constructor(analyticsService, nodeTunnelService, localTunnelService, dockerTunnelService, tunnelView, configFile) {
15
9
  this.analyticsService = analyticsService;
16
10
  this.nodeTunnelService = nodeTunnelService;
@@ -20,7 +14,7 @@ class TunnelController {
20
14
  this.configFile = configFile;
21
15
  }
22
16
  async run(tunnelOptions, ui) {
23
- const options = { ...tunnelOptions, debugStartingPort: undefined };
17
+ const options = Object.assign(Object.assign({}, tunnelOptions), { debugStartingPort: undefined });
24
18
  if (tunnelOptions.debugStartingPort !== undefined) {
25
19
  const port = parseInt(tunnelOptions.debugStartingPort);
26
20
  if (isNaN(port) || port < 0 || port > 65535) {
@@ -147,8 +147,8 @@ const getDependencies = async (cliDetails) => {
147
147
  const deployer = new deploy_1.ArtifactDeployer(assertiveAppConfigReader, triggerDeployClient, deployMonitorClient, cli_shared_1.pause, ui);
148
148
  const sandboxBundle = (0, bundler_1.getSandboxBundler)();
149
149
  const nodeBundle = (0, bundler_1.getNodeBundler)((0, bundler_1.getWrapperProvider)({ fileSystemReader: fileReader }));
150
- const sandboxRuntimeBundler = new runtime_bundler_1.SandboxRuntimeBundler(archiverFactory, ui, sandboxBundle, configFile);
151
- const nodeRuntimeBundler = new runtime_bundler_1.NodeRuntimeBundler(archiverFactory, ui, nodeBundle, configFile);
150
+ const sandboxRuntimeBundler = new runtime_bundler_1.SandboxRuntimeBundler(archiverFactory, ui, sandboxBundle);
151
+ const nodeRuntimeBundler = new runtime_bundler_1.NodeRuntimeBundler(archiverFactory, ui, nodeBundle);
152
152
  const nativeUiBundler = new nativeui_bundler_1.NativeUIBundler(ui, bundler_1.nativeUiBundle);
153
153
  const sandboxAppPackager = new deploy_1.AppPackager(sandboxRuntimeBundler, nativeUiBundler, ui);
154
154
  const nodeAppPackager = new deploy_1.AppPackager(nodeRuntimeBundler, nativeUiBundler, ui);
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UserAbortError = exports.DeferredErrors = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  class DeferredErrors {
6
- errors;
7
6
  constructor(errors) {
8
7
  this.errors = errors;
9
8
  }
@@ -35,7 +35,7 @@ async function loginCommandHandler(ui, instructionsUrl, loginCommand, { email, t
35
35
  ui.info(cli_shared_2.Text.login.nextStep);
36
36
  return {
37
37
  creds,
38
- analytics: { ...analytics, anonymousId: (0, anon_user_id_1.getAnonId)(true) }
38
+ analytics: Object.assign(Object.assign({}, analytics), { anonymousId: (0, anon_user_id_1.getAnonId)(true) })
39
39
  };
40
40
  }
41
41
  catch (error) {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerCommands = exports.listEnvironmentVariableCommandHandler = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const cli_shared_1 = require("@forge/cli-shared");
5
6
  const COMMAND_NAME = 'variables';
6
7
  const SET_COMMAND_NAME = 'set';
@@ -60,7 +61,7 @@ async function listEnvironmentVariableCommandHandler(ui, listEnvironmentVariable
60
61
  ['encrypted', 'Encrypted?'],
61
62
  ['key', 'Key'],
62
63
  ['value', 'Value']
63
- ], variables?.map(({ encrypt: encrypted, key, value }) => ({
64
+ ], variables === null || variables === void 0 ? void 0 : variables.map(({ encrypt: encrypted, key, value }) => ({
64
65
  encrypted,
65
66
  key,
66
67
  value: encrypted ? cli_shared_1.Text.varsList.encryptedValue : value
@@ -94,11 +95,12 @@ const registerVariablesSubcommandStubs = ({ cmd, controllers: { stubController }
94
95
  cmd.deprecatedCommand(DEPRECATED_UNSET_COMMAND, `${COMMAND_NAME} ${UNSET_COMMAND_NAME}`, stubController);
95
96
  cmd.deprecatedCommand(DEPRECATED_LIST_COMMAND, `${COMMAND_NAME} ${LIST_COMMAND_NAME}`, stubController);
96
97
  };
97
- const registerCommands = ({ cmd, ...deps }) => {
98
+ const registerCommands = (_a) => {
99
+ var { cmd } = _a, deps = tslib_1.__rest(_a, ["cmd"]);
98
100
  const variables = cmd.command(COMMAND_NAME).description(cli_shared_1.Text.variables.description);
99
- registerVariablesSubcommandStubs({ cmd, ...deps });
100
- registerSetEnvironmentVariableCommand({ cmd: variables, ...deps });
101
- registerDeleteEnvironmentVariableCommand({ cmd: variables, ...deps });
102
- registerListEnvironmentVariableCommand({ cmd: variables, ...deps });
101
+ registerVariablesSubcommandStubs(Object.assign({ cmd }, deps));
102
+ registerSetEnvironmentVariableCommand(Object.assign({ cmd: variables }, deps));
103
+ registerDeleteEnvironmentVariableCommand(Object.assign({ cmd: variables }, deps));
104
+ registerListEnvironmentVariableCommand(Object.assign({ cmd: variables }, deps));
103
105
  };
104
106
  exports.registerCommands = registerCommands;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerCommands = exports.performMultipleUninstalls = exports.performSingleUninstall = exports.validateContext = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const cli_shared_1 = require("@forge/cli-shared");
5
6
  const shared_1 = require("../installations/shared");
6
7
  const errors_1 = require("./errors");
@@ -117,7 +118,7 @@ const registerUninstallCommand = (deps) => {
117
118
  ui.info(cli_shared_1.Text.installList.noInstallations);
118
119
  return;
119
120
  }
120
- const installId = installationId?.trim();
121
+ const installId = installationId === null || installationId === void 0 ? void 0 : installationId.trim();
121
122
  if (installId && installId.length > 0) {
122
123
  ui.info(cli_shared_1.Text.uninstall.info);
123
124
  ui.info(cli_shared_1.Text.ctrlC);
@@ -144,11 +145,12 @@ const registerUninstallCommand = (deps) => {
144
145
  });
145
146
  };
146
147
  const DEPRECATED_LIST_COMMAND = 'install:list';
147
- const registerCommands = ({ cmd, ...deps }) => {
148
+ const registerCommands = (_a) => {
149
+ var { cmd } = _a, deps = tslib_1.__rest(_a, ["cmd"]);
148
150
  const install = cmd.command(COMMAND_NAME).description(cli_shared_1.Text.variables.description);
149
- registerUninstallCommand({ cmd, ...deps });
151
+ registerUninstallCommand(Object.assign({ cmd }, deps));
150
152
  cmd.deprecatedCommand(DEPRECATED_LIST_COMMAND, `${COMMAND_NAME} ${LIST_COMMAND_NAME}`, deps.controllers.stubController);
151
- registerInstallAppCommand({ cmd: install, ...deps });
152
- registerListInstallationsCommand({ cmd: install, ...deps });
153
+ registerInstallAppCommand(Object.assign({ cmd: install }, deps));
154
+ registerListInstallationsCommand(Object.assign({ cmd: install }, deps));
153
155
  };
154
156
  exports.registerCommands = registerCommands;
@@ -25,7 +25,7 @@ function parseSinceDateTime(dateTime) {
25
25
  parsed = dayjs_1.default.utc(dateTime);
26
26
  }
27
27
  }
28
- return parsed?.isValid() ? parsed.toISOString() : null;
28
+ return (parsed === null || parsed === void 0 ? void 0 : parsed.isValid()) ? parsed.toISOString() : null;
29
29
  }
30
30
  exports.parseSinceDateTime = parseSinceDateTime;
31
31
  function combineLogParts(message, other) {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.registerCommands = void 0;
4
+ const tslib_1 = require("tslib");
4
5
  const cli_shared_1 = require("@forge/cli-shared");
5
6
  const settings_controller_1 = require("./controller/settings-controller");
6
7
  const COMMAND_NAME = 'settings';
@@ -29,9 +30,10 @@ const registerSettingsSet = ({ cmd, controllers: { settingsController } }) => {
29
30
  return { analytics: {} };
30
31
  });
31
32
  };
32
- const registerCommands = ({ cmd, ...deps }) => {
33
+ const registerCommands = (_a) => {
34
+ var { cmd } = _a, deps = tslib_1.__rest(_a, ["cmd"]);
33
35
  const preferences = cmd.command(COMMAND_NAME).requireNoAuthentication().description(cli_shared_1.Text.settings.description);
34
- registerSettingsList({ cmd: preferences, ...deps });
35
- registerSettingsSet({ cmd: preferences, ...deps });
36
+ registerSettingsList(Object.assign({ cmd: preferences }, deps));
37
+ registerSettingsSet(Object.assign({ cmd: preferences }, deps));
36
38
  };
37
39
  exports.registerCommands = registerCommands;
@@ -4,8 +4,9 @@ exports.registerCommands = exports.listIndexes = exports.getManifestEntities = v
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  const COMMAND_NAME = 'storage';
6
6
  async function getManifestEntities(configFile) {
7
+ var _a, _b;
7
8
  const manifest = await configFile.readConfig();
8
- return { entities: manifest.app.storage?.entities?.map((entity) => entity.name) || [] };
9
+ return { entities: ((_b = (_a = manifest.app.storage) === null || _a === void 0 ? void 0 : _a.entities) === null || _b === void 0 ? void 0 : _b.map((entity) => entity.name)) || [] };
9
10
  }
10
11
  exports.getManifestEntities = getManifestEntities;
11
12
  async function listIndexes(data, configFile, { ui, commands: { listEntitiesIndexesCommand } }) {
@@ -10,10 +10,7 @@ function initialiseSentry({ cliDetails, cachedConfigService, options = { dsn: SE
10
10
  if (!cachedConfigService.getAnalyticsPreferences()) {
11
11
  return;
12
12
  }
13
- Sentry.init({
14
- ...options,
15
- release: cliDetails?.version
16
- });
13
+ Sentry.init(Object.assign(Object.assign({}, options), { release: cliDetails === null || cliDetails === void 0 ? void 0 : cliDetails.version }));
17
14
  Sentry.setTag('latestVersion', (0, cli_shared_1.isLatestCLIVersion)(cliDetails) ? 'true' : 'false');
18
15
  }
19
16
  exports.initialiseSentry = initialiseSentry;
@@ -16,7 +16,7 @@ const getCLIDetails = () => {
16
16
  compatibleNodeVersion: packageInfo.engines.node
17
17
  };
18
18
  }
19
- catch {
19
+ catch (_a) {
20
20
  return undefined;
21
21
  }
22
22
  };
@@ -5,7 +5,6 @@ const cli_shared_1 = require("@forge/cli-shared");
5
5
  const ANALYTICS_TRUE = 'Yes';
6
6
  const ANALYTICS_FALSE = 'No';
7
7
  class AnalyticsSettingsView {
8
- ui;
9
8
  constructor(ui) {
10
9
  this.ui = ui;
11
10
  }
@@ -5,7 +5,6 @@ const cli_shared_1 = require("@forge/cli-shared");
5
5
  const lint_1 = require("@forge/lint");
6
6
  const ari_1 = require("@forge/util/packages/ari");
7
7
  class DeployView {
8
- ui;
9
8
  constructor(ui) {
10
9
  this.ui = ui;
11
10
  }
@@ -6,7 +6,6 @@ const egress_1 = require("@forge/egress");
6
6
  const lodash_1 = require("lodash");
7
7
  const installation_helper_1 = require("../../installations/installation-helper");
8
8
  class InstallView {
9
- ui;
10
9
  constructor(ui) {
11
10
  this.ui = ui;
12
11
  }
@@ -4,8 +4,6 @@ exports.LintView = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  const lint_1 = require("@forge/lint");
6
6
  class LintView {
7
- ui;
8
- lintResultReporter;
9
7
  constructor(ui, lintResultReporter = lint_1.reportLintResults) {
10
8
  this.ui = ui;
11
9
  this.lintResultReporter = lintResultReporter;
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LiteLintView = void 0;
4
4
  const lint_1 = require("@forge/lint");
5
5
  class LiteLintView {
6
- ui;
7
- reporter;
8
6
  constructor(ui, reporter = lint_1.reportLintResults) {
9
7
  this.ui = ui;
10
8
  this.reporter = reporter;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SettingsView = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  class SettingsView {
6
- ui;
7
6
  constructor(ui) {
8
7
  this.ui = ui;
9
8
  }
@@ -8,10 +8,9 @@ class TunnelViewError extends cli_shared_1.UserError {
8
8
  }
9
9
  exports.TunnelViewError = TunnelViewError;
10
10
  class TunnelView {
11
- ui;
12
- FAILED_DOCKER_CONNECTION_MESSAGE = 'Cannot connect to the Docker daemon';
13
11
  constructor(ui) {
14
12
  this.ui = ui;
13
+ this.FAILED_DOCKER_CONNECTION_MESSAGE = 'Cannot connect to the Docker daemon';
15
14
  }
16
15
  dockerPreamble(environmentKey) {
17
16
  this.ui.info(cli_shared_1.Text.tunnel.preamble);
@@ -64,6 +63,7 @@ class TunnelView {
64
63
  }
65
64
  reportDownloadProgress(imageDownloadChildProcess, { onStart, onFailure, onSuccess }) {
66
65
  return new Promise((resolve, reject) => {
66
+ var _a, _b;
67
67
  let dockerPullPercent = 0;
68
68
  const spinner = (0, ora_1.default)({
69
69
  spinner: {
@@ -72,12 +72,12 @@ class TunnelView {
72
72
  prefixText: cli_shared_1.Text.tunnel.pullDockerProgress(dockerPullPercent)
73
73
  }).start();
74
74
  onStart();
75
- imageDownloadChildProcess.stdout?.on('data', (data) => {
75
+ (_a = imageDownloadChildProcess.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
76
76
  dockerPullPercent = this.updatePullPercent(data, dockerPullPercent);
77
77
  spinner.prefixText = cli_shared_1.Text.tunnel.pullDockerProgress(dockerPullPercent);
78
78
  });
79
79
  let stderr = '';
80
- imageDownloadChildProcess.stderr?.on('data', (data) => {
80
+ (_b = imageDownloadChildProcess.stderr) === null || _b === void 0 ? void 0 : _b.on('data', (data) => {
81
81
  stderr += data.toString();
82
82
  });
83
83
  imageDownloadChildProcess.on('exit', (code) => {
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DeployMonitorGraphqlClient = void 0;
4
4
  const trigger_deploy_graphql_client_1 = require("./trigger-deploy-graphql-client");
5
5
  class DeployMonitorGraphqlClient {
6
- graphqlClient;
7
6
  constructor(graphqlClient) {
8
7
  this.graphqlClient = graphqlClient;
9
8
  }
@@ -46,7 +45,7 @@ class DeployMonitorGraphqlClient {
46
45
  if (!appDeployment) {
47
46
  throw new trigger_deploy_graphql_client_1.NoDeploymentError();
48
47
  }
49
- return { ...appDeployment, requestId };
48
+ return Object.assign(Object.assign({}, appDeployment), { requestId });
50
49
  }
51
50
  }
52
51
  exports.DeployMonitorGraphqlClient = DeployMonitorGraphqlClient;
@@ -4,7 +4,6 @@ exports.ArtifactDeployer = exports.ManifestValidationFailedError = exports.Hoste
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  const DEPLOYMENT_EVENT_POLL_INTERVAL = 500;
6
6
  class AppDeploymentFailedError extends cli_shared_1.BaseError {
7
- userError;
8
7
  constructor(userError = false, requestId, message) {
9
8
  super(requestId, `${message} (requestId: ${requestId || 'unknown'})`);
10
9
  this.userError = userError;
@@ -15,7 +14,6 @@ class AppDeploymentFailedError extends cli_shared_1.BaseError {
15
14
  }
16
15
  exports.AppDeploymentFailedError = AppDeploymentFailedError;
17
16
  class AppSnapshotFailedError extends cli_shared_1.BaseError {
18
- userError;
19
17
  constructor(userError = false, requestId, message) {
20
18
  super(requestId, message);
21
19
  this.userError = userError;
@@ -26,7 +24,6 @@ class AppSnapshotFailedError extends cli_shared_1.BaseError {
26
24
  }
27
25
  exports.AppSnapshotFailedError = AppSnapshotFailedError;
28
26
  class HostedResourceDeploymentFailedError extends cli_shared_1.BaseError {
29
- userError;
30
27
  constructor(userError = false, requestId, message) {
31
28
  super(requestId, message);
32
29
  this.userError = userError;
@@ -52,11 +49,6 @@ function isValidSnapshotLogEvent(event) {
52
49
  return !!(event.message && event.level);
53
50
  }
54
51
  class ArtifactDeployer {
55
- getConfiguredApp;
56
- deployClient;
57
- deployMonitorClient;
58
- pause;
59
- ui;
60
52
  constructor(getConfiguredApp, deployClient, deployMonitorClient, pause, ui) {
61
53
  this.getConfiguredApp = getConfiguredApp;
62
54
  this.deployClient = deployClient;
@@ -124,7 +116,7 @@ class ArtifactDeployer {
124
116
  stageHasTransitionEvent = true;
125
117
  return true;
126
118
  })
127
- .map((event) => ({ ...event, stepName: stage.description }));
119
+ .map((event) => (Object.assign(Object.assign({}, event), { stepName: stage.description })));
128
120
  });
129
121
  }
130
122
  getDeploymentEventsHandler() {
@@ -154,6 +146,7 @@ class ArtifactDeployer {
154
146
  };
155
147
  }
156
148
  handleErrorEvent(errorDetails, requestId) {
149
+ var _a;
157
150
  if (errorDetails) {
158
151
  const { code, message } = errorDetails;
159
152
  switch (code) {
@@ -164,14 +157,14 @@ class ArtifactDeployer {
164
157
  throw new AppSnapshotFailedError(false, requestId, cli_shared_1.Text.snapshot.timeout);
165
158
  }
166
159
  case 'ENVIRONMENT_UPDATE_VALIDATION_FAILED': {
167
- const causeMessage = errorDetails?.fields?.validationResult.message.replace(/Upsert.*Details /, '');
168
- if (causeMessage?.startsWith('Invalid URL') && causeMessage.includes('EGRESS')) {
160
+ const causeMessage = (_a = errorDetails === null || errorDetails === void 0 ? void 0 : errorDetails.fields) === null || _a === void 0 ? void 0 : _a.validationResult.message.replace(/Upsert.*Details /, '');
161
+ if ((causeMessage === null || causeMessage === void 0 ? void 0 : causeMessage.startsWith('Invalid URL')) && causeMessage.includes('EGRESS')) {
169
162
  throw new AppDeploymentFailedError(true, requestId, cli_shared_1.Text.deploy.egressURL.invalidURLError(causeMessage));
170
163
  }
171
- else if (causeMessage?.startsWith('Egress permission URL')) {
164
+ else if (causeMessage === null || causeMessage === void 0 ? void 0 : causeMessage.startsWith('Egress permission URL')) {
172
165
  throw new AppDeploymentFailedError(true, requestId, cli_shared_1.Text.deploy.egressURL.tooManyURLCharactersError(causeMessage));
173
166
  }
174
- else if (causeMessage?.includes('permission URLs provided, exceeding')) {
167
+ else if (causeMessage === null || causeMessage === void 0 ? void 0 : causeMessage.includes('permission URLs provided, exceeding')) {
175
168
  throw new AppDeploymentFailedError(true, requestId, cli_shared_1.Text.deploy.egressURL.tooManyUrlsError(causeMessage));
176
169
  }
177
170
  break;
@@ -9,7 +9,6 @@ class NoDeploymentError extends Error {
9
9
  }
10
10
  exports.NoDeploymentError = NoDeploymentError;
11
11
  class TriggerDeployGraphQLClient {
12
- graphqlClient;
13
12
  constructor(graphqlClient) {
14
13
  this.graphqlClient = graphqlClient;
15
14
  }
@@ -3,10 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PackageUploadDeployCommand = void 0;
4
4
  const lodash_1 = require("lodash");
5
5
  class PackageUploadDeployCommand {
6
- packager;
7
- archiveUploader;
8
- deployer;
9
- resourcePackagingService;
10
6
  constructor(packager, archiveUploader, deployer, resourcePackagingService) {
11
7
  this.packager = packager;
12
8
  this.archiveUploader = archiveUploader;
@@ -11,13 +11,23 @@ class ArchiverError extends cli_shared_1.UserError {
11
11
  }
12
12
  exports.ArchiverError = ArchiverError;
13
13
  class ZipArchiver {
14
- logger;
15
- archive = (0, archiver_1.default)('zip');
16
- tempFile = tmp_1.default.fileSync({ postfix: '.zip' });
17
- resolves = [];
18
- rejects = [];
19
14
  constructor(logger) {
20
15
  this.logger = logger;
16
+ this.archive = (0, archiver_1.default)('zip');
17
+ this.tempFile = tmp_1.default.fileSync({ postfix: '.zip' });
18
+ this.resolves = [];
19
+ this.rejects = [];
20
+ this.onArchiveError = (err) => {
21
+ const error = new ArchiverError(err.message);
22
+ for (const reject of this.rejects) {
23
+ reject(error);
24
+ }
25
+ };
26
+ this.onClose = () => {
27
+ for (const resolve of this.resolves) {
28
+ resolve(this.tempFile.name);
29
+ }
30
+ };
21
31
  const output = (0, fs_1.createWriteStream)(this.tempFile.name);
22
32
  this.archive.pipe(output);
23
33
  output.on('close', this.onClose);
@@ -42,22 +52,9 @@ class ZipArchiver {
42
52
  onWarning(cb) {
43
53
  this.archive.on('warning', cb);
44
54
  }
45
- onArchiveError = (err) => {
46
- const error = new ArchiverError(err.message);
47
- for (const reject of this.rejects) {
48
- reject(error);
49
- }
50
- };
51
- onClose = () => {
52
- for (const resolve of this.resolves) {
53
- resolve(this.tempFile.name);
54
- }
55
- };
56
55
  }
57
56
  exports.ZipArchiver = ZipArchiver;
58
57
  class DirectoryArchiver {
59
- directory;
60
- logger;
61
58
  constructor(directory, logger) {
62
59
  this.directory = directory;
63
60
  this.logger = logger;
@@ -91,7 +88,6 @@ class DirectoryArchiver {
91
88
  }
92
89
  exports.DirectoryArchiver = DirectoryArchiver;
93
90
  class MultiArchiver {
94
- archivers;
95
91
  constructor(archivers) {
96
92
  this.archivers = archivers;
97
93
  }
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NativeUIBundler = void 0;
4
4
  const packager_1 = require("./packager");
5
5
  class NativeUIBundler {
6
- logger;
7
- bundler;
8
6
  constructor(logger, bundler) {
9
7
  this.logger = logger;
10
8
  this.bundler = bundler;
@@ -25,10 +23,7 @@ class NativeUIBundler {
25
23
  }
26
24
  bundlerOutputs.forEach(({ outputDir }, index) => {
27
25
  this.logger.debug(`NativeUI bundle created: ${outputDir}`);
28
- nativeUiBundlesDetails.push({
29
- ...resources[index],
30
- path: outputDir
31
- });
26
+ nativeUiBundlesDetails.push(Object.assign(Object.assign({}, resources[index]), { path: outputDir }));
32
27
  });
33
28
  }
34
29
  return {
@@ -6,9 +6,6 @@ class BundlerError extends cli_shared_1.UserError {
6
6
  }
7
7
  exports.BundlerError = BundlerError;
8
8
  class AppPackager {
9
- runtimeBundler;
10
- nativeUiBundler;
11
- logger;
12
9
  constructor(runtimeBundler, nativeUiBundler, logger) {
13
10
  this.runtimeBundler = runtimeBundler;
14
11
  this.nativeUiBundler = nativeUiBundler;
@@ -18,10 +15,7 @@ class AppPackager {
18
15
  this.logger.info(cli_shared_1.Text.deploy.taskPackage.title);
19
16
  const runtimeBundle = await this.runtimeBundler.bundle(handlers, packageConfig);
20
17
  const nativeUiBundle = await this.nativeUiBundler.bundle(resources);
21
- return {
22
- ...runtimeBundle,
23
- ...nativeUiBundle
24
- };
18
+ return Object.assign(Object.assign({}, runtimeBundle), nativeUiBundle);
25
19
  }
26
20
  }
27
21
  exports.AppPackager = AppPackager;
@@ -1,5 +1,5 @@
1
1
  import { Bundler, FunctionsEntryPoint } from '@forge/bundler';
2
- import { Handler, Logger, ConfigFile } from '@forge/cli-shared';
2
+ import { Handler, Logger } from '@forge/cli-shared';
3
3
  import { App } from '@forge/manifest';
4
4
  import { Archiver } from './archiver';
5
5
  export interface RuntimeBundleResult {
@@ -10,8 +10,7 @@ export declare class RuntimeBundler {
10
10
  private readonly archiverFactory;
11
11
  private readonly logger;
12
12
  private readonly bundler;
13
- private readonly configFile;
14
- constructor(archiverFactory: () => Archiver, logger: Logger, bundler: Bundler<FunctionsEntryPoint>, configFile: ConfigFile);
13
+ constructor(archiverFactory: () => Archiver, logger: Logger, bundler: Bundler<FunctionsEntryPoint>);
15
14
  protected packageCode(archiver: Archiver, entryPoints: FunctionsEntryPoint[]): Promise<string[]>;
16
15
  protected packageDependencies(archiver: Archiver): Promise<void>;
17
16
  protected packageAll(archiver: Archiver, handlers: Handler[], packageConfig: App['package']): Promise<string[]>;