@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
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-bundler.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/runtime-bundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAiB,mBAAmB,EAAkB,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAEL,OAAO,EACP,MAAM,EAIN,UAAU,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAHV,eAAe,EAAE,MAAM,QAAQ,EAC/B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC,EACrC,UAAU,EAAE,UAAU;cAGzB,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;cAsCtF,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;cAgBtD,UAAU,CACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,OAAO,EAAE,EACnB,aAAa,EAAE,GAAG,CAAC,SAAS,CAAC,GAC5B,OAAO,CAAC,MAAM,EAAE,CAAC;IAUP,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAUvG;AAED,qBAAa,qBAAsB,SAAQ,cAAc;IAC1C,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAMvG;AAED,qBAAa,kBAAmB,SAAQ,cAAc;cACpC,UAAU,CACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,OAAO,EAAE,EACnB,aAAa,EAAE,GAAG,CAAC,SAAS,CAAC,GAC5B,OAAO,CAAC,MAAM,EAAE,CAAC;CASrB"}
1
+ {"version":3,"file":"runtime-bundler.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/runtime-bundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAiB,mBAAmB,EAAkB,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAuB,OAAO,EAAE,MAAM,EAA0B,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAFP,eAAe,EAAE,MAAM,QAAQ,EAC/B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC;cAGxC,WAAW,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;cAsCtF,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;cAQtD,UAAU,CACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,OAAO,EAAE,EACnB,aAAa,EAAE,GAAG,CAAC,SAAS,CAAC,GAC5B,OAAO,CAAC,MAAM,EAAE,CAAC;IAUP,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAUvG;AAED,qBAAa,qBAAsB,SAAQ,cAAc;IAC1C,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAMvG;AAED,qBAAa,kBAAmB,SAAQ,cAAc;cACpC,UAAU,CACxB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,OAAO,EAAE,EACnB,aAAa,EAAE,GAAG,CAAC,SAAS,CAAC,GAC5B,OAAO,CAAC,MAAM,EAAE,CAAC;CASrB"}
@@ -7,15 +7,10 @@ const cli_shared_1 = require("@forge/cli-shared");
7
7
  const packager_1 = require("./packager");
8
8
  const node_1 = require("@forge/bundler/out/config/node");
9
9
  class RuntimeBundler {
10
- archiverFactory;
11
- logger;
12
- bundler;
13
- configFile;
14
- constructor(archiverFactory, logger, bundler, configFile) {
10
+ constructor(archiverFactory, logger, bundler) {
15
11
  this.archiverFactory = archiverFactory;
16
12
  this.logger = logger;
17
13
  this.bundler = bundler;
18
- this.configFile = configFile;
19
14
  }
20
15
  async packageCode(archiver, entryPoints) {
21
16
  const moduleList = [];
@@ -48,14 +43,9 @@ class RuntimeBundler {
48
43
  }
49
44
  async packageDependencies(archiver) {
50
45
  for (const fileName of cli_shared_1.dependencyFileNames) {
51
- if (!(0, fs_1.existsSync)(fileName)) {
52
- continue;
46
+ if ((0, fs_1.existsSync)(fileName)) {
47
+ archiver.addFileFrom(fileName, fileName);
53
48
  }
54
- if (fileName === cli_shared_1.manifestFileName) {
55
- archiver.addFile(fileName, Buffer.from(this.configFile.readConfigAsString()));
56
- continue;
57
- }
58
- archiver.addFileFrom(fileName, fileName);
59
49
  }
60
50
  }
61
51
  async packageAll(archiver, handlers, packageConfig) {
@@ -84,8 +74,9 @@ class SandboxRuntimeBundler extends RuntimeBundler {
84
74
  exports.SandboxRuntimeBundler = SandboxRuntimeBundler;
85
75
  class NodeRuntimeBundler extends RuntimeBundler {
86
76
  async packageAll(archiver, handlers, packageConfig) {
77
+ var _a;
87
78
  const moduleList = await super.packageAll(archiver, handlers, packageConfig);
88
- const files = await new cli_shared_1.FileSystemReader().getFileGlobList(packageConfig?.extraFiles ?? []);
79
+ const files = await new cli_shared_1.FileSystemReader().getFileGlobList((_a = packageConfig === null || packageConfig === void 0 ? void 0 : packageConfig.extraFiles) !== null && _a !== void 0 ? _a : []);
89
80
  files.forEach((fileName) => {
90
81
  archiver.addFileFrom(fileName, fileName);
91
82
  });
@@ -21,7 +21,6 @@ class NoUploadIdError extends Error {
21
21
  }
22
22
  exports.NoUploadIdError = NoUploadIdError;
23
23
  class ArtifactGraphQLClient {
24
- graphqlClient;
25
24
  constructor(graphqlClient) {
26
25
  this.graphqlClient = graphqlClient;
27
26
  }
@@ -3,11 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppArchiveUploader = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  class AppArchiveUploader {
6
- getConfiguredApp;
7
- artifact;
8
- uploader;
9
- logger;
10
- uploaderService;
11
6
  constructor(getConfiguredApp, artifact, uploader, logger, uploaderService) {
12
7
  this.getConfiguredApp = getConfiguredApp;
13
8
  this.artifact = artifact;
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EntitiesGraphqlClient = void 0;
4
4
  class EntitiesGraphqlClient {
5
- graphQLClient;
6
5
  constructor(graphQLClient) {
7
6
  this.graphQLClient = graphQLClient;
8
7
  }
9
8
  async getEntitiesDefinitions(oauthClientId) {
9
+ var _a;
10
10
  const query = `
11
11
  query forge_cli_getAppOauthClientIdDetails($oauthClientId: String!) {
12
12
  ersLifecycle {
@@ -28,7 +28,7 @@ class EntitiesGraphqlClient {
28
28
  const result = await this.graphQLClient.query(query, {
29
29
  oauthClientId
30
30
  });
31
- return result?.ersLifecycle?.doneEntitiesFromERS || [];
31
+ return ((_a = result === null || result === void 0 ? void 0 : result.ersLifecycle) === null || _a === void 0 ? void 0 : _a.doneEntitiesFromERS) || [];
32
32
  }
33
33
  }
34
34
  exports.EntitiesGraphqlClient = EntitiesGraphqlClient;
@@ -7,7 +7,6 @@ var CustomEntityIndexStatus;
7
7
  CustomEntityIndexStatus["CREATING"] = "CREATING";
8
8
  })(CustomEntityIndexStatus = exports.CustomEntityIndexStatus || (exports.CustomEntityIndexStatus = {}));
9
9
  class ListEntitiesIndexesCommand {
10
- customEntitiesService;
11
10
  constructor(customEntitiesService) {
12
11
  this.customEntitiesService = customEntitiesService;
13
12
  }
@@ -2,18 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreateEnvironmentCommand = void 0;
4
4
  class CreateEnvironmentCommand {
5
- client;
6
- getAppConfig;
7
5
  constructor(client, getAppConfig) {
8
6
  this.client = client;
9
7
  this.getAppConfig = getAppConfig;
10
8
  }
11
9
  async execute(details) {
12
10
  const { id: appId } = await this.getAppConfig();
13
- await this.client.createEnvironment({
14
- ...details,
15
- appId
16
- });
11
+ await this.client.createEnvironment(Object.assign(Object.assign({}, details), { appId }));
17
12
  }
18
13
  }
19
14
  exports.CreateEnvironmentCommand = CreateEnvironmentCommand;
@@ -2,18 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DeleteEnvironmentCommand = void 0;
4
4
  class DeleteEnvironmentCommand {
5
- client;
6
- getAppConfig;
7
5
  constructor(client, getAppConfig) {
8
6
  this.client = client;
9
7
  this.getAppConfig = getAppConfig;
10
8
  }
11
9
  async batchExecute(details) {
12
10
  const { id: appId } = await this.getAppConfig();
13
- return this.client.deleteEnvironments({
14
- ...details,
15
- appId
16
- });
11
+ return this.client.deleteEnvironments(Object.assign(Object.assign({}, details), { appId }));
17
12
  }
18
13
  }
19
14
  exports.DeleteEnvironmentCommand = DeleteEnvironmentCommand;
@@ -7,7 +7,6 @@ class MissingAppError extends cli_shared_1.UserError {
7
7
  }
8
8
  exports.MissingAppError = MissingAppError;
9
9
  class GraphqlClient {
10
- graphqlClient;
11
10
  constructor(graphqlClient) {
12
11
  this.graphqlClient = graphqlClient;
13
12
  }
@@ -72,10 +71,11 @@ class GraphqlClient {
72
71
  throw new MissingAppError();
73
72
  }
74
73
  return app.environments.map((environment) => {
74
+ var _a, _b, _c;
75
75
  return {
76
76
  type: environment.type,
77
77
  key: environment.key,
78
- lastDeployedAt: environment.versions?.nodes?.[0]?.updatedAt || environment.createdAt
78
+ lastDeployedAt: ((_c = (_b = (_a = environment.versions) === null || _a === void 0 ? void 0 : _a.nodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.updatedAt) || environment.createdAt
79
79
  };
80
80
  });
81
81
  }
@@ -83,10 +83,7 @@ class GraphqlClient {
83
83
  const results = [];
84
84
  for (const environmentKey of details.environmentKeys) {
85
85
  try {
86
- const success = await this.deleteEnvironment({
87
- ...details,
88
- environmentKey
89
- });
86
+ const success = await this.deleteEnvironment(Object.assign(Object.assign({}, details), { environmentKey }));
90
87
  results.push({ environmentKey, successful: success });
91
88
  }
92
89
  catch (err) {
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ListEnvironmentCommand = void 0;
4
4
  class ListEnvironmentCommand {
5
- client;
6
- getAppConfig;
7
5
  constructor(client, getAppConfig) {
8
6
  this.client = client;
9
7
  this.getAppConfig = getAppConfig;
@@ -2,18 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DeleteEnvironmentVariableCommand = void 0;
4
4
  class DeleteEnvironmentVariableCommand {
5
- client;
6
- getAppConfig;
7
5
  constructor(client, getAppConfig) {
8
6
  this.client = client;
9
7
  this.getAppConfig = getAppConfig;
10
8
  }
11
9
  async execute(details) {
12
10
  const { id: appId } = await this.getAppConfig();
13
- await this.client.deleteEnvironmentVariable({
14
- ...details,
15
- appId
16
- });
11
+ await this.client.deleteEnvironmentVariable(Object.assign(Object.assign({}, details), { appId }));
17
12
  }
18
13
  }
19
14
  exports.DeleteEnvironmentVariableCommand = DeleteEnvironmentVariableCommand;
@@ -9,7 +9,6 @@ class MissingAppEnvironmentError extends Error {
9
9
  }
10
10
  exports.MissingAppEnvironmentError = MissingAppEnvironmentError;
11
11
  class GraphqlClient {
12
- graphqlClient;
13
12
  constructor(graphqlClient) {
14
13
  this.graphqlClient = graphqlClient;
15
14
  }
@@ -2,18 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ListEnvironmentVariablesCommand = void 0;
4
4
  class ListEnvironmentVariablesCommand {
5
- client;
6
- getAppConfig;
7
5
  constructor(client, getAppConfig) {
8
6
  this.client = client;
9
7
  this.getAppConfig = getAppConfig;
10
8
  }
11
9
  async execute(details) {
12
10
  const { id: appId } = await this.getAppConfig();
13
- return await this.client.listEnvironmentVariables({
14
- ...details,
15
- appId
16
- });
11
+ return await this.client.listEnvironmentVariables(Object.assign(Object.assign({}, details), { appId }));
17
12
  }
18
13
  }
19
14
  exports.ListEnvironmentVariablesCommand = ListEnvironmentVariablesCommand;
@@ -2,18 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SetEnvironmentVariableCommand = void 0;
4
4
  class SetEnvironmentVariableCommand {
5
- client;
6
- getAppConfig;
7
5
  constructor(client, getAppConfig) {
8
6
  this.client = client;
9
7
  this.getAppConfig = getAppConfig;
10
8
  }
11
9
  async execute(details) {
12
10
  const { id: appId } = await this.getAppConfig();
13
- await this.client.setEnvironmentVariable({
14
- ...details,
15
- appId
16
- });
11
+ await this.client.setEnvironmentVariable(Object.assign(Object.assign({}, details), { appId }));
17
12
  }
18
13
  }
19
14
  exports.SetEnvironmentVariableCommand = SetEnvironmentVariableCommand;
@@ -46,8 +46,6 @@ class MissingTaskIdError extends Error {
46
46
  }
47
47
  exports.MissingTaskIdError = MissingTaskIdError;
48
48
  class InstallationRequestFailedError extends cli_shared_1.BaseError {
49
- userError;
50
- code;
51
49
  constructor(userError, code, message, requestId) {
52
50
  super(requestId, message);
53
51
  this.userError = userError;
@@ -77,13 +75,15 @@ class UnknownSiteWithoutResourceIdError extends Error {
77
75
  }
78
76
  exports.UnknownSiteWithoutResourceIdError = UnknownSiteWithoutResourceIdError;
79
77
  class InstallationsGraphqlClient {
80
- graphqlClient;
81
- cloudIdTranslator;
82
- bitbucketTranslator;
83
- pause;
84
- featureFlagReader;
85
- SITE_RESOURCE_TYPE = 'site';
86
- WORKSPACE_RESOURCE_TYPE = 'workspace';
78
+ constructor(graphqlClient, cloudIdTranslator, bitbucketTranslator, pause, featureFlagReader) {
79
+ this.graphqlClient = graphqlClient;
80
+ this.cloudIdTranslator = cloudIdTranslator;
81
+ this.bitbucketTranslator = bitbucketTranslator;
82
+ this.pause = pause;
83
+ this.featureFlagReader = featureFlagReader;
84
+ this.SITE_RESOURCE_TYPE = 'site';
85
+ this.WORKSPACE_RESOURCE_TYPE = 'workspace';
86
+ }
87
87
  static buildInstallationContext(product, resourceId, resourceType) {
88
88
  const ari = ari_1.AnyAri.create({
89
89
  resourceOwner: (0, cli_shared_1.ariResourceOwner)(product),
@@ -92,13 +92,6 @@ class InstallationsGraphqlClient {
92
92
  });
93
93
  return ari.toString();
94
94
  }
95
- constructor(graphqlClient, cloudIdTranslator, bitbucketTranslator, pause, featureFlagReader) {
96
- this.graphqlClient = graphqlClient;
97
- this.cloudIdTranslator = cloudIdTranslator;
98
- this.bitbucketTranslator = bitbucketTranslator;
99
- this.pause = pause;
100
- this.featureFlagReader = featureFlagReader;
101
- }
102
95
  async buildInstallationContext(product, site) {
103
96
  const ari = await this.getProductTranslation(product).buildInstallationContext(product, site);
104
97
  return ari.toString();
@@ -194,19 +187,20 @@ class InstallationsGraphqlClient {
194
187
  await this.monitorAppInstallOrUpgrade(taskId);
195
188
  }
196
189
  async monitorAppInstallOrUpgrade(taskId) {
190
+ var _a, _b, _c, _d, _e;
197
191
  let status = cli_shared_1.AppTaskState.Pending;
198
192
  while (status !== cli_shared_1.AppTaskState.Complete) {
199
193
  const { state, errors, requestId } = await this.getAppInstallationTask(taskId);
200
194
  status = state;
201
195
  if (status === cli_shared_1.AppTaskState.Failed) {
202
196
  const shouldDisplayHarmonizedAppInstallationErrors = await this.featureFlagReader.shouldDisplayErrorsForHarmonizedApps();
203
- const error = errors?.[0];
204
- const statusCode = error?.extensions?.statusCode;
197
+ const error = errors === null || errors === void 0 ? void 0 : errors[0];
198
+ const statusCode = (_a = error === null || error === void 0 ? void 0 : error.extensions) === null || _a === void 0 ? void 0 : _a.statusCode;
205
199
  const isUserError = statusCode && statusCode >= 400 && statusCode < 500 ? true : false;
206
- const code = error?.extensions?.errorType ?? undefined;
200
+ const code = (_c = (_b = error === null || error === void 0 ? void 0 : error.extensions) === null || _b === void 0 ? void 0 : _b.errorType) !== null && _c !== void 0 ? _c : undefined;
207
201
  throw new InstallationRequestFailedError(isUserError, code, shouldDisplayHarmonizedAppInstallationErrors
208
- ? (0, harmonized_app_installation_errors_1.expandHarmonizedAppInstallationError)(code, error?.message ?? undefined)
209
- : error?.message ?? undefined, requestId);
202
+ ? (0, harmonized_app_installation_errors_1.expandHarmonizedAppInstallationError)(code, (_d = error === null || error === void 0 ? void 0 : error.message) !== null && _d !== void 0 ? _d : undefined)
203
+ : (_e = error === null || error === void 0 ? void 0 : error.message) !== null && _e !== void 0 ? _e : undefined, requestId);
210
204
  }
211
205
  if (status !== cli_shared_1.AppTaskState.Complete)
212
206
  await this.pause(exports.UNINSTALLATION_EVENT_POLL_INTERVAL);
@@ -247,10 +241,10 @@ class InstallationsGraphqlClient {
247
241
  this.uninstallApp(app),
248
242
  new Promise((resolve) => setTimeout(resolve, 1000))
249
243
  ]);
250
- uninstallsResult.push({ ...app, successful: success });
244
+ uninstallsResult.push(Object.assign(Object.assign({}, app), { successful: success }));
251
245
  }
252
246
  catch (err) {
253
- uninstallsResult.push({ ...app, successful: false });
247
+ uninstallsResult.push(Object.assign(Object.assign({}, app), { successful: false }));
254
248
  }
255
249
  }
256
250
  return uninstallsResult;
@@ -316,10 +310,7 @@ class InstallationsGraphqlClient {
316
310
  const workspaceAriToHostname = await this.bitbucketTranslator.getSitesForResourceAris(bitbucketAris);
317
311
  const cloudIdAris = this.getResourceArisForProduct(installationContexts, this.cloudIdTranslator.ariBelongsToProduct);
318
312
  const siteAriToHostname = await this.cloudIdTranslator.getSitesForResourceAris(cloudIdAris);
319
- const combinedAriToHostname = {
320
- ...siteAriToHostname,
321
- ...workspaceAriToHostname
322
- };
313
+ const combinedAriToHostname = Object.assign(Object.assign({}, siteAriToHostname), workspaceAriToHostname);
323
314
  return combinedAriToHostname;
324
315
  }
325
316
  async resolveInstallationsHostnames(installations) {
@@ -352,6 +343,7 @@ class InstallationsGraphqlClient {
352
343
  });
353
344
  }
354
345
  async getAllInstallations(appId) {
346
+ var _a, _b;
355
347
  const query = `
356
348
  query forge_cli_getEcosystemInstallationsByApp($filter: AppInstallationsByAppFilter!, $first: Int, $after: String) {
357
349
  ecosystem {
@@ -388,7 +380,7 @@ class InstallationsGraphqlClient {
388
380
  first: 100,
389
381
  after: cursor
390
382
  }));
391
- if (!result?.ecosystem?.appInstallationsByApp?.nodes) {
383
+ if (!((_b = (_a = result === null || result === void 0 ? void 0 : result.ecosystem) === null || _a === void 0 ? void 0 : _a.appInstallationsByApp) === null || _b === void 0 ? void 0 : _b.nodes)) {
392
384
  throw new MissingAppError();
393
385
  }
394
386
  const { nodes, pageInfo } = result.ecosystem.appInstallationsByApp;
@@ -410,6 +402,7 @@ class InstallationsGraphqlClient {
410
402
  return output;
411
403
  }
412
404
  async getVersions(appId, environmentKey, firstN = 1) {
405
+ var _a;
413
406
  const query = `
414
407
  query forge_cli_getApplicationEnvironmentLatestVersions($appId: ID!, $environmentKey: String!, $firstN: Int!) {
415
408
  app(id: $appId) {
@@ -443,7 +436,7 @@ class InstallationsGraphqlClient {
443
436
  throw new EnvironmentNotFoundError(environmentKey);
444
437
  }
445
438
  return {
446
- nodes: result.app.environmentByKey.versions?.nodes,
439
+ nodes: (_a = result.app.environmentByKey.versions) === null || _a === void 0 ? void 0 : _a.nodes,
447
440
  environmentType: result.app.environmentByKey.type
448
441
  };
449
442
  }
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InstallAppSiteCommand = void 0;
4
4
  class InstallAppSiteCommand {
5
- getAppConfig;
6
- installAppClient;
7
5
  constructor(getAppConfig, installAppClient) {
8
6
  this.getAppConfig = getAppConfig;
9
7
  this.installAppClient = installAppClient;
@@ -27,7 +27,6 @@ const tenantToHostname = (tenantInfo) => {
27
27
  return tenantInfo.hostName || null;
28
28
  };
29
29
  class CloudIdTranslator {
30
- graphqlClient;
31
30
  constructor(graphqlClient) {
32
31
  this.graphqlClient = graphqlClient;
33
32
  }
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UninstallAppCommand = void 0;
4
4
  class UninstallAppCommand {
5
- getAppConfig;
6
- client;
7
5
  constructor(getAppConfig, client) {
8
6
  this.getAppConfig = getAppConfig;
9
7
  this.client = client;
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GraphqlClient = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  class GraphqlClient {
6
- graphqlClient;
7
6
  constructor(graphqlClient) {
8
7
  this.graphqlClient = graphqlClient;
9
8
  }
10
9
  async getLatestMigrationKeys(appId, environmentKey) {
10
+ var _a, _b;
11
11
  const marketplaceQuery = (0, cli_shared_1.isFedrampEnv)() ? '' : 'marketplaceApp { appKey }';
12
12
  const query = `
13
13
  query forge_cli_getMigrationKeys($id: ID!, $key: String!) {
@@ -40,12 +40,12 @@ class GraphqlClient {
40
40
  if (!result.app.environmentByKey) {
41
41
  throw new cli_shared_1.MissingAppEnvironmentError(environmentKey);
42
42
  }
43
- const mpacAppKey = result.app.marketplaceApp?.appKey;
43
+ const mpacAppKey = (_a = result.app.marketplaceApp) === null || _a === void 0 ? void 0 : _a.appKey;
44
44
  const versions = result.app.environmentByKey.versions;
45
45
  let migrationKeys;
46
- for (const edge of versions?.edges || []) {
46
+ for (const edge of (versions === null || versions === void 0 ? void 0 : versions.edges) || []) {
47
47
  if (edge) {
48
- migrationKeys = edge.node?.migrationKeys;
48
+ migrationKeys = (_b = edge.node) === null || _b === void 0 ? void 0 : _b.migrationKeys;
49
49
  }
50
50
  }
51
51
  return { migrationKeys, mpacAppKey };
@@ -2,18 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConfigureProviderCommand = void 0;
4
4
  class ConfigureProviderCommand {
5
- client;
6
- getAppConfig;
7
5
  constructor(client, getAppConfig) {
8
6
  this.client = client;
9
7
  this.getAppConfig = getAppConfig;
10
8
  }
11
9
  async execute(details) {
12
10
  const { id: appId } = await this.getAppConfig();
13
- await this.client.configureProvider({
14
- ...details,
15
- appId
16
- });
11
+ await this.client.configureProvider(Object.assign(Object.assign({}, details), { appId }));
17
12
  }
18
13
  }
19
14
  exports.ConfigureProviderCommand = ConfigureProviderCommand;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GraphqlClient = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  class GraphqlClient {
6
- graphqlClient;
7
6
  constructor(graphqlClient) {
8
7
  this.graphqlClient = graphqlClient;
9
8
  }
@@ -5,7 +5,6 @@ const ANALYTICS_PREFERENCES_KEY = 'analytics-preferences';
5
5
  const DEFAULT_ENVIRONMENT_KEY = 'default-environment';
6
6
  const NGROK_CONFIG_PATH_KEY = 'ngrok-config-path';
7
7
  class CachedConfigService {
8
- cachedConf;
9
8
  constructor(cachedConf) {
10
9
  this.cachedConf = cachedConf;
11
10
  }
@@ -4,9 +4,6 @@ exports.CustomEntitiesService = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
5
  const list_indexes_1 = require("../entities/list-indexes");
6
6
  class CustomEntitiesService {
7
- appConfigProvider;
8
- appOauthClient;
9
- entitiesGraphqlClient;
10
7
  constructor(appConfigProvider, appOauthClient, entitiesGraphqlClient) {
11
8
  this.appConfigProvider = appConfigProvider;
12
9
  this.appOauthClient = appOauthClient;
@@ -27,6 +24,7 @@ class CustomEntitiesService {
27
24
  return transformedIndexes;
28
25
  }
29
26
  async listEntitiesIndexes(environment) {
27
+ var _a;
30
28
  const { id: appId } = await this.appConfigProvider();
31
29
  const { environmentId, oauthClientId } = await this.appOauthClient.getAppOauthClientIdDetails(appId, environment);
32
30
  const results = await this.entitiesGraphqlClient.getEntitiesDefinitions(oauthClientId);
@@ -36,7 +34,7 @@ class CustomEntitiesService {
36
34
  const [, , , ...entityName] = entity.name.split('_');
37
35
  const transformedIndexesPerEntity = [];
38
36
  let byKeyIndex = {};
39
- for (const index of entity.indexes ?? []) {
37
+ for (const index of (_a = entity.indexes) !== null && _a !== void 0 ? _a : []) {
40
38
  if (indexesToExclude.indexOf(index.name) < 0) {
41
39
  if (index.name === 'by-key') {
42
40
  byKeyIndex = {
@@ -8,7 +8,6 @@ const command_exists_1 = tslib_1.__importDefault(require("command-exists"));
8
8
  const cross_spawn_1 = require("cross-spawn");
9
9
  const cli_shared_1 = require("@forge/cli-shared");
10
10
  class DockerError extends cli_shared_1.UserError {
11
- code;
12
11
  constructor(message, code) {
13
12
  super(message);
14
13
  this.code = code;
@@ -47,10 +46,7 @@ class DockerService {
47
46
  downloadImage(imageName) {
48
47
  this.verifyInstalled();
49
48
  return (0, cross_spawn_1.spawn)('docker', ['pull', imageName], {
50
- env: {
51
- ...process.env,
52
- DOCKER_CLI_HINTS: '0'
53
- }
49
+ env: Object.assign(Object.assign({}, process.env), { DOCKER_CLI_HINTS: '0' })
54
50
  });
55
51
  }
56
52
  startCleanupWorker(pids, containerName) {
@@ -8,9 +8,6 @@ const graphql_client_1 = require("../installations/graphql-client");
8
8
  const IDENTITY_PRODUCT_NAME = 'identity';
9
9
  const JIRA_SERVICE_DESK_PRODUCT_NAME = 'jira-servicedesk';
10
10
  class InstallationService {
11
- getAppConfig;
12
- listInstallationsClient;
13
- upgradeAppInstallationsClient;
14
11
  constructor(getAppConfig, listInstallationsClient, upgradeAppInstallationsClient) {
15
12
  this.getAppConfig = getAppConfig;
16
13
  this.listInstallationsClient = listInstallationsClient;
@@ -30,7 +27,7 @@ class InstallationService {
30
27
  async listAppInstallations(filter) {
31
28
  const { id: appId } = await this.getAppConfig();
32
29
  const installations = await this.listInstallationsClient.listInstallations(appId);
33
- return { installations: this.filterInstallations(installations, { ...filter }) };
30
+ return { installations: this.filterInstallations(installations, Object.assign({}, filter)) };
34
31
  }
35
32
  async listNonTechnicalAppInstallations(filter) {
36
33
  const { installations } = await this.listAppInstallations(filter);
@@ -64,17 +61,17 @@ class InstallationService {
64
61
  }
65
62
  }
66
63
  getPermissionsFromAppEnvironmentVersion(appEnvironmentVersion) {
67
- const permissions = appEnvironmentVersion?.permissions[0];
64
+ const permissions = appEnvironmentVersion === null || appEnvironmentVersion === void 0 ? void 0 : appEnvironmentVersion.permissions[0];
68
65
  if (!permissions) {
69
66
  return { scopes: [], egressAddresses: [] };
70
67
  }
71
68
  const scopes = permissions.scopes.map((s) => s.key);
72
- const egressAddresses = permissions?.egress ? (0, cli_shared_1.flatMap)(permissions.egress, ({ addresses }) => addresses ?? []) : [];
69
+ const egressAddresses = (permissions === null || permissions === void 0 ? void 0 : permissions.egress) ? (0, cli_shared_1.flatMap)(permissions.egress, ({ addresses }) => addresses !== null && addresses !== void 0 ? addresses : []) : [];
73
70
  return { scopes, egressAddresses };
74
71
  }
75
72
  async getAppEnvironmentPermissions(appId, environmentKey) {
76
73
  const versionDetails = await this.listInstallationsClient.getVersions(appId, environmentKey, 2);
77
- const versions = versionDetails?.nodes;
74
+ const versions = versionDetails === null || versionDetails === void 0 ? void 0 : versionDetails.nodes;
78
75
  if (!versions || versions.length === 0)
79
76
  return;
80
77
  const [{ scopes, egressAddresses }, oldVersion] = versions.map((appEnvironmentVersion) => this.getPermissionsFromAppEnvironmentVersion(appEnvironmentVersion));
@@ -7,8 +7,6 @@ const lint_1 = require("@forge/lint");
7
7
  const path_1 = tslib_1.__importDefault(require("path"));
8
8
  exports.DEFAULT_DIRECTORY = './src';
9
9
  class LintService {
10
- configFile;
11
- fileSystemReader;
12
10
  constructor(configFile, fileSystemReader) {
13
11
  this.configFile = configFile;
14
12
  this.fileSystemReader = fileSystemReader;
@@ -4,8 +4,6 @@ exports.LiteLintService = void 0;
4
4
  const lint_1 = require("@forge/lint");
5
5
  const manifest_1 = require("@forge/manifest");
6
6
  class LiteLintService {
7
- lintService;
8
- problemCounter;
9
7
  constructor(lintService = lint_1.litelint, problemCounter = lint_1.problemCount) {
10
8
  this.lintService = lintService;
11
9
  this.problemCounter = problemCounter;
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MigrationKeysService = void 0;
4
4
  class MigrationKeysService {
5
- migrationKeysClient;
6
- getAppConfig;
7
5
  constructor(migrationKeysClient, getAppConfig) {
8
6
  this.migrationKeysClient = migrationKeysClient;
9
7
  this.getAppConfig = getAppConfig;
@@ -5,7 +5,6 @@ const portfinder_1 = require("portfinder");
5
5
  const util_1 = require("util");
6
6
  const getPortsPromise = (0, util_1.promisify)(portfinder_1.getPorts);
7
7
  class ConfigFilePortFindingService {
8
- configFile;
9
8
  constructor(configFile) {
10
9
  this.configFile = configFile;
11
10
  }
@@ -42,11 +42,6 @@ class DetailedMalformedHtmlEntrypointError extends cli_shared_1.UserError {
42
42
  }
43
43
  exports.DetailedMalformedHtmlEntrypointError = DetailedMalformedHtmlEntrypointError;
44
44
  class ResourcePackagingService {
45
- archiverFactory;
46
- fileSystemReader;
47
- appDir;
48
- bridgeScriptService;
49
- iframeResizerScriptService;
50
45
  constructor(archiverFactory, fileSystemReader, appDir, bridgeScriptService, iframeResizerScriptService) {
51
46
  this.archiverFactory = archiverFactory;
52
47
  this.fileSystemReader = fileSystemReader;
@@ -6,7 +6,6 @@ const cli_shared_1 = require("@forge/cli-shared");
6
6
  const form_data_1 = tslib_1.__importDefault(require("form-data"));
7
7
  const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
8
8
  class ResourceUploadError extends cli_shared_1.BaseError {
9
- userError;
10
9
  constructor(userError = false, requestId) {
11
10
  super(requestId, 'Failed to upload resource to S3');
12
11
  this.userError = userError;
@@ -16,7 +15,6 @@ class ResourceUploadError extends cli_shared_1.BaseError {
16
15
  }
17
16
  }
18
17
  class ResourcesUploaderService {
19
- fileSystemReader;
20
18
  constructor(fileSystemReader) {
21
19
  this.fileSystemReader = fileSystemReader;
22
20
  }