@forge/cli 6.3.0 → 6.4.0-next.12

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 (42) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/npm-shrinkwrap.json +380 -235
  3. package/out/command-line/controller/prerequisites-controller.js +2 -2
  4. package/out/command-line/dependency-injection.d.ts.map +1 -1
  5. package/out/command-line/dependency-injection.js +2 -2
  6. package/out/command-line/version-info.d.ts +2 -1
  7. package/out/command-line/version-info.d.ts.map +1 -1
  8. package/out/command-line/version-info.js +7 -2
  9. package/out/contributors/graphql-client.js +12 -4
  10. package/out/deploy/deployer/deployer.d.ts +4 -1
  11. package/out/deploy/deployer/deployer.d.ts.map +1 -1
  12. package/out/deploy/deployer/deployer.js +23 -4
  13. package/out/deploy/deployer/trigger-deploy-graphql-client.js +5 -1
  14. package/out/deploy/package-upload-deploy.d.ts +2 -2
  15. package/out/deploy/package-upload-deploy.d.ts.map +1 -1
  16. package/out/deploy/packager/archiver.d.ts +6 -3
  17. package/out/deploy/packager/archiver.d.ts.map +1 -1
  18. package/out/deploy/packager/archiver.js +23 -9
  19. package/out/deploy/packager/nativeui-bundler.d.ts.map +1 -1
  20. package/out/deploy/packager/packager.d.ts +4 -8
  21. package/out/deploy/packager/packager.d.ts.map +1 -1
  22. package/out/deploy/packager/packager.js +1 -1
  23. package/out/deploy/packager/runtime-bundler.d.ts +4 -4
  24. package/out/deploy/packager/runtime-bundler.d.ts.map +1 -1
  25. package/out/deploy/packager/runtime-bundler.js +8 -13
  26. package/out/deploy/uploader/artifact-graphql-client.js +10 -2
  27. package/out/environment-variables/graphql-client.js +10 -2
  28. package/out/installations/graphql-client.d.ts +11 -3
  29. package/out/installations/graphql-client.d.ts.map +1 -1
  30. package/out/installations/graphql-client.js +27 -11
  31. package/out/providers/graphql-client.d.ts +0 -4
  32. package/out/providers/graphql-client.d.ts.map +1 -1
  33. package/out/providers/graphql-client.js +6 -8
  34. package/out/service/resource-packaging-service.d.ts +7 -7
  35. package/out/service/resource-packaging-service.d.ts.map +1 -1
  36. package/out/service/resource-packaging-service.js +6 -6
  37. package/out/service/resources-uploader-service.d.ts.map +1 -1
  38. package/out/service/resources-uploader-service.js +8 -3
  39. package/out/webtrigger/graphql-client.d.ts +1 -1
  40. package/out/webtrigger/graphql-client.d.ts.map +1 -1
  41. package/out/webtrigger/graphql-client.js +4 -4
  42. package/package.json +6 -6
@@ -24,8 +24,8 @@ class PrerequisitesController {
24
24
  if (this.cliDetails && !(0, semver_1.satisfies)(userNodeVersion, this.cliDetails.compatibleNodeVersion)) {
25
25
  (0, cli_shared_1.exitOnError)(this.logger, new Error(cli_shared_1.Text.error.outdatedNodeVersion(this.cliDetails.compatibleNodeVersion, userNodeVersion)), null);
26
26
  }
27
- if (!(0, semver_1.satisfies)(userNodeVersion, version_info_1.supportedNodeVersion)) {
28
- this.logger.warn(cli_shared_1.Text.warning.unsupportedNodeVersion(userNodeVersion));
27
+ if (!(0, semver_1.satisfies)(userNodeVersion, version_info_1.semverSupportedNodeVersion)) {
28
+ this.logger.warn(cli_shared_1.Text.warning.unsupportedNodeVersion(userNodeVersion, version_info_1.humanReadableSupportedNodeVersion));
29
29
  }
30
30
  }
31
31
  async checkCustomWarning() {
@@ -1 +1 @@
1
- {"version":3,"file":"dependency-injection.d.ts","sourceRoot":"","sources":["../../src/command-line/dependency-injection.ts"],"names":[],"mappings":"AAEA,OAAO,EASL,UAAU,EACV,aAAa,EAEb,UAAU,EAGV,gBAAgB,EAGhB,kBAAkB,EAUlB,YAAY,EACZ,aAAa,EAOb,kBAAkB,EAIlB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAML,0BAA0B,EAG3B,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAC;AAExG,OAAO,EAAE,+BAA+B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,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAG3E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAWlE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAIhF,eAAO,MAAM,eAAe,eAAsB,UAAU,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyQvE,CAAC;AAGF,aAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;AAC3D,oBAAY,YAAY,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC,CAAC"}
@@ -127,12 +127,12 @@ const getDependencies = async (cliDetails) => {
127
127
  const uninstallAppCommand = new uninstall_app_1.UninstallAppCommand(assertiveAppConfigReader, installationsClient);
128
128
  const deployMonitorClient = new deploy_1.DeployMonitorGraphqlClient(graphQLClient);
129
129
  const webTriggerGraphqlClient = new graphql_client_6.WebTriggerGraphQLClient(graphQLClient);
130
- const archiverFactory = () => new deploy_1.ZipArchiver();
130
+ const archiverFactory = () => new deploy_1.ZipArchiver(ui);
131
131
  const uploaderArtifactClient = new deploy_1.ArtifactGraphQLClient(graphQLClient);
132
132
  const triggerDeployClient = new deploy_1.TriggerDeployGraphQLClient(graphQLClient);
133
133
  const archiveUploader = new deploy_1.AppArchiveUploader(assertiveAppConfigReader, uploaderArtifactClient, fileUploader, ui, new resources_uploader_service_1.ResourcesUploaderService(fileReader));
134
134
  const deployer = new deploy_1.ArtifactDeployer(assertiveAppConfigReader, triggerDeployClient, deployMonitorClient, cli_shared_1.pause, ui);
135
- const bundle = (await featureFlagService.readFlag('xls-lambda-runtime')) === 'nodejs14.x' ? bundler_1.nodeBundle : bundler_1.sandboxBundle;
135
+ const bundle = (await featureFlagService.isNodeRuntime()) ? bundler_1.nodeBundle : bundler_1.sandboxBundle;
136
136
  const runtimeBundler = new runtime_bundler_1.RuntimeBundler(archiverFactory, ui, bundle);
137
137
  const nativeUiBundler = new nativeui_bundler_1.NativeUIBundler(ui, bundler_1.nativeUiBundle);
138
138
  const appPackager = new deploy_1.AppPackager(runtimeBundler, nativeUiBundler, ui);
@@ -2,7 +2,8 @@ export declare const VERSION_CACHE_KEY = "latest";
2
2
  export declare const VERSION_CACHE_INTERVAL: number;
3
3
  import { CLIDetails } from '@forge/cli-shared';
4
4
  export declare const getCLIDetails: () => CLIDetails | undefined;
5
- export declare const supportedNodeVersion = "14.x || 16.x || 18.x";
5
+ export declare const semverSupportedNodeVersion: string;
6
+ export declare const humanReadableSupportedNodeVersion: string;
6
7
  export declare const cacheLatestVersion: (name: string) => Promise<void>;
7
8
  export declare const clearVersionCache: (name: string) => void;
8
9
  //# sourceMappingURL=version-info.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version-info.d.ts","sourceRoot":"","sources":["../../src/command-line/version-info.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,sBAAsB,QAAsB,CAAC;AAE1D,OAAO,EAAc,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,eAAO,MAAM,aAAa,QAAO,UAAU,GAAG,SAgB7C,CAAC;AAEF,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAE3D,eAAO,MAAM,kBAAkB,SAAgB,MAAM,KAAG,QAAQ,IAAI,CAInE,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,MAAM,SAG7C,CAAC"}
1
+ {"version":3,"file":"version-info.d.ts","sourceRoot":"","sources":["../../src/command-line/version-info.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,sBAAsB,QAAsB,CAAC;AAE1D,OAAO,EAAc,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE3D,eAAO,MAAM,aAAa,QAAO,UAAU,GAAG,SAgB7C,CAAC;AAGF,eAAO,MAAM,0BAA0B,QAA+D,CAAC;AACvG,eAAO,MAAM,iCAAiC,QAGL,CAAC;AAE1C,eAAO,MAAM,kBAAkB,SAAgB,MAAM,KAAG,QAAQ,IAAI,CAInE,CAAC;AAEF,eAAO,MAAM,iBAAiB,SAAU,MAAM,SAG7C,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.clearVersionCache = exports.cacheLatestVersion = exports.supportedNodeVersion = exports.getCLIDetails = exports.VERSION_CACHE_INTERVAL = exports.VERSION_CACHE_KEY = void 0;
3
+ exports.clearVersionCache = exports.cacheLatestVersion = exports.humanReadableSupportedNodeVersion = exports.semverSupportedNodeVersion = exports.getCLIDetails = exports.VERSION_CACHE_INTERVAL = exports.VERSION_CACHE_KEY = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const latest_version_1 = tslib_1.__importDefault(require("latest-version"));
6
6
  exports.VERSION_CACHE_KEY = 'latest';
@@ -23,7 +23,12 @@ const getCLIDetails = () => {
23
23
  }
24
24
  };
25
25
  exports.getCLIDetails = getCLIDetails;
26
- exports.supportedNodeVersion = '14.x || 16.x || 18.x';
26
+ const supportedNodeMajorVersions = [14, 16, 18];
27
+ exports.semverSupportedNodeVersion = supportedNodeMajorVersions.map((v) => `${v}.x`).join(' || ');
28
+ exports.humanReadableSupportedNodeVersion = supportedNodeMajorVersions
29
+ .map((v) => `${v}.x`)
30
+ .join(', ')
31
+ .replace(/^(.*)?,\s(.*)$/g, '$1 or $2');
27
32
  const cacheLatestVersion = async (name) => {
28
33
  const latest = await (0, latest_version_1.default)(name);
29
34
  const cachedConf = cli_shared_1.CachedConf.getCache(name);
@@ -34,12 +34,16 @@ class GraphqlClient {
34
34
  }
35
35
  });
36
36
  if (!addAppContributor) {
37
- throw new cli_shared_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`);
37
+ throw new cli_shared_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`, { requestId });
38
38
  }
39
39
  const { success, errors } = addAppContributor;
40
40
  const error = (0, cli_shared_1.getError)(errors);
41
41
  if (!success) {
42
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
42
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
43
+ requestId,
44
+ code: error.code,
45
+ statusCode: error.statusCode
46
+ });
43
47
  }
44
48
  }
45
49
  async listContributors(appId) {
@@ -93,12 +97,16 @@ class GraphqlClient {
93
97
  }
94
98
  });
95
99
  if (!removeAppContributors) {
96
- throw new cli_shared_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`);
100
+ throw new cli_shared_1.GraphQlMutationError(`Unable to get a response (requestId: ${requestId || 'unknown'})`, { requestId });
97
101
  }
98
102
  const { success, errors } = removeAppContributors;
99
103
  const error = (0, cli_shared_1.getError)(errors);
100
104
  if (!success) {
101
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
105
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
106
+ requestId,
107
+ code: error.code,
108
+ statusCode: error.statusCode
109
+ });
102
110
  }
103
111
  }
104
112
  }
@@ -6,7 +6,10 @@ export declare class AppDeploymentFailedError extends BaseError {
6
6
  constructor(userError?: boolean | undefined, message?: string);
7
7
  isUserError(): boolean;
8
8
  }
9
- export declare class AppSnapshotFailedError extends Error {
9
+ export declare class AppSnapshotFailedError extends BaseError {
10
+ private readonly userError?;
11
+ constructor(userError?: boolean | undefined, message?: string);
12
+ isUserError(): boolean;
10
13
  }
11
14
  export declare class HostedResourceDeploymentFailedError extends BaseError {
12
15
  private readonly userError?;
@@ -1 +1 @@
1
- {"version":3,"file":"deployer.d.ts","sourceRoot":"","sources":["../../../src/deploy/deployer/deployer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAOjB,KAAK,EAEL,EAAE,EAEF,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,mBAAmB,EAAsB,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAItE,qBAAa,wBAAyB,SAAQ,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAAV,SAAS,CAAC,qBAAS,EAAE,OAAO,CAAC,EAAE,MAAM;IAG3D,WAAW,IAAI,OAAO;CAG9B;AACD,qBAAa,sBAAuB,SAAQ,KAAK;CAAG;AACpD,qBAAa,mCAAoC,SAAQ,SAAS;IACpD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC;gBAAV,SAAS,CAAC,qBAAS,EAAE,OAAO,CAAC,EAAE,MAAM;IAG3D,WAAW,IAAI,OAAO;CAG9B;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,sBAAsB,CAAC,EAAE,MAAM,GAAG,OAAO,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eploymentFailedError extends cli_shared_1.BaseError {
14
14
  }
15
15
  }
16
16
  exports.AppDeploymentFailedError = AppDeploymentFailedError;
17
- class AppSnapshotFailedError extends Error {
17
+ class AppSnapshotFailedError extends cli_shared_1.BaseError {
18
+ constructor(userError, message) {
19
+ super(message);
20
+ this.userError = userError;
21
+ }
22
+ isUserError() {
23
+ return Boolean(this.userError);
24
+ }
18
25
  }
19
26
  exports.AppSnapshotFailedError = AppSnapshotFailedError;
20
27
  class HostedResourceDeploymentFailedError extends cli_shared_1.BaseError {
@@ -138,10 +145,10 @@ class ArtifactDeployer {
138
145
  if (errorDetails) {
139
146
  const { code, message } = errorDetails;
140
147
  if (code === 'APP_CODE_SNAPSHOT_FAILED') {
141
- throw new AppSnapshotFailedError(cli_shared_1.Text.snapshot.error('App code snapshot error', message));
148
+ throw new AppSnapshotFailedError(true, cli_shared_1.Text.snapshot.error('App code snapshot error', message));
142
149
  }
143
150
  if (code === 'APP_CODE_SNAPSHOT_TIMEOUT') {
144
- throw new AppSnapshotFailedError(cli_shared_1.Text.snapshot.timeout);
151
+ throw new AppSnapshotFailedError(false, cli_shared_1.Text.snapshot.timeout);
145
152
  }
146
153
  if (code === 'ENVIRONMENT_UPDATE_VALIDATION_FAILED') {
147
154
  const causeMessage = (_a = errorDetails === null || errorDetails === void 0 ? void 0 : errorDetails.fields) === null || _a === void 0 ? void 0 : _a.validationResult.message.replace(/Upsert.*Details /, '');
@@ -155,9 +162,21 @@ class ArtifactDeployer {
155
162
  throw new AppDeploymentFailedError(true, cli_shared_1.Text.deploy.egressURL.tooManyUrlsError(causeMessage));
156
163
  }
157
164
  }
158
- if (code === 'HOSTED_RESOURCE_TOO_MANY_FILES') {
165
+ if ([
166
+ 'HOSTED_RESOURCE_TOO_MANY_FILES',
167
+ 'HOSTED_RESOURCE_ZIP_TOO_BIG',
168
+ 'HOSTED_RESOURCE_FILE_PATH_REFERS_TO_PARENT',
169
+ 'HOSTED_RESOURCE_INVALID_EGRESS_PERMISSIONS'
170
+ ].includes(code)) {
159
171
  throw new HostedResourceDeploymentFailedError(true, cli_shared_1.Text.hostedResources.error(message));
160
172
  }
173
+ if ([
174
+ 'HOSTED_RESOURCE_FAILED_TO_FETCH',
175
+ 'HOSTED_RESOURCE_FAILED_TO_COPY',
176
+ 'HOSTED_RESOURCE_UPLOAD_ID_MISSING'
177
+ ].includes(code)) {
178
+ throw new HostedResourceDeploymentFailedError(false, cli_shared_1.Text.hostedResources.error(message));
179
+ }
161
180
  if (code === 'HOSTED_RESOURCES_LAMBDA_TIMEOUT') {
162
181
  throw new HostedResourceDeploymentFailedError(false, cli_shared_1.Text.hostedResources.error(cli_shared_1.Text.hostedResources.lambdaTimeout));
163
182
  }
@@ -34,7 +34,11 @@ class TriggerDeployGraphQLClient {
34
34
  });
35
35
  const error = (0, cli_shared_1.getError)(errors);
36
36
  if (!success) {
37
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
37
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
38
+ requestId,
39
+ code: error.code,
40
+ statusCode: error.statusCode
41
+ });
38
42
  }
39
43
  if (!deployment) {
40
44
  throw new NoDeploymentError();
@@ -2,10 +2,10 @@ import { Deployer } from './deployer/deployer';
2
2
  import { Packager } from './packager/packager';
3
3
  import { ArchiveUploader } from './uploader/uploader';
4
4
  import { DeploymentResult } from '../command-line/register-deployment-commands';
5
- import { ResourceDetails } from '@forge/cli-shared';
5
+ import { Handler, ResourceDetails } from '@forge/cli-shared';
6
6
  import { ResourcePackagingService } from '../service/resource-packaging-service';
7
7
  export interface Details {
8
- handlers: Array<string>;
8
+ handlers: Array<Handler>;
9
9
  environmentKey: string;
10
10
  resources: ResourceDetails[];
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"package-upload-deploy.d.ts","sourceRoot":"","sources":["../../src/deploy/package-upload-deploy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE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,WAAW,OAAO;IACtB,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,eAAe,EAAE,CAAC;CAC9B;AAED,qBAAa,0BAA0B;IAEnC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,wBAAwB;gBAHxB,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,wBAAwB,EAAE,wBAAwB;IAGxD,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAuClE"}
@@ -2,19 +2,22 @@
2
2
  import { Logger } from '@forge/cli-shared';
3
3
  export interface Archiver {
4
4
  addFile(fileName: string, contents: Buffer): void;
5
- addRootDependencyFiles(filePaths: string[], logger: Logger): void;
5
+ addFileFrom(fileName: string, filePath: string): void;
6
6
  finalise(): Promise<string>;
7
7
  onWarning(cb: (err: Error) => void): void;
8
8
  onEntry(cb: (filePath: string) => void): void;
9
9
  }
10
10
  export declare class ZipArchiver implements Archiver {
11
+ private readonly logger;
11
12
  private archive;
12
13
  private tempFile;
13
14
  private resolves;
14
15
  private rejects;
15
- constructor();
16
+ private inspectDirectory;
17
+ constructor(logger: Logger);
16
18
  addFile(fileName: string, contents: Buffer): void;
17
- addRootDependencyFiles(fileNames: string[], logger: Logger): void;
19
+ addFileFrom(fileName: string, filePath: string): void;
20
+ private copyToInspect;
18
21
  finalise(): Promise<string>;
19
22
  onWarning(cb: (err: Error) => void): void;
20
23
  onEntry(cb: (filePath: string) => void): void;
@@ -1 +1 @@
1
- {"version":3,"file":"archiver.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/archiver.ts"],"names":[],"mappings":";AAKA,OAAO,EAAE,MAAM,EAAQ,MAAM,mB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IAAI,CAAC;IAClD,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACtD,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI,CAAC;IAC1C,OAAO,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CAC/C;AAED,qBAAa,WAAY,YAAW,QAAQ;IAO9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IANnC,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,QAAQ,CAAqC;IACrD,OAAO,CAAC,QAAQ,CAAsC;IACtD,OAAO,CAAC,OAAO,CAAmC;IAClD,OAAO,CAAC,gBAAgB,CAAuB;gBAElB,MAAM,EAAE,MAAM;IAYpC,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMjD,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAM5D,OAAO,CAAC,aAAa;IAYd,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;IAS3B,SAAS,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI;IAIlC,OAAO,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI;IAQ7C,OAAO,CAAC,cAAc,CAIpB;IAEF,OAAO,CAAC,OAAO,CAIb;CACH"}
@@ -8,11 +8,13 @@ const path_1 = require("path");
8
8
  const tmp_1 = tslib_1.__importDefault(require("tmp"));
9
9
  const cli_shared_1 = require("@forge/cli-shared");
10
10
  class ZipArchiver {
11
- constructor() {
11
+ constructor(logger) {
12
+ this.logger = logger;
12
13
  this.archive = (0, archiver_1.default)('zip');
13
14
  this.tempFile = tmp_1.default.fileSync({ postfix: '.zip' });
14
15
  this.resolves = [];
15
16
  this.rejects = [];
17
+ this.inspectDirectory = null;
16
18
  this.onArchiveError = (err) => {
17
19
  for (const reject of this.rejects) {
18
20
  reject(err);
@@ -27,19 +29,31 @@ class ZipArchiver {
27
29
  this.archive.pipe(output);
28
30
  output.on('close', this.onClose);
29
31
  this.archive.on('error', this.onArchiveError);
32
+ if (process.env.FORGE_INSPECT_ARCHIVE) {
33
+ this.inspectDirectory = process.env.FORGE_INSPECT_ARCHIVE;
34
+ }
30
35
  }
31
36
  addFile(fileName, contents) {
32
37
  this.archive.append(contents, { name: fileName });
38
+ this.copyToInspect(fileName, contents);
39
+ this.logger.debug(cli_shared_1.Text.deploy.taskPackage.packageFile(fileName, null));
33
40
  }
34
- addRootDependencyFiles(fileNames, logger) {
35
- const currentDirectory = process.cwd();
36
- fileNames.forEach((fileName) => {
37
- const filePath = (0, path_1.join)(currentDirectory, fileName);
38
- if ((0, fs_1.existsSync)(filePath)) {
39
- logger.debug(cli_shared_1.Text.deploy.taskPackage.packageFile(fileName, filePath));
40
- this.archive.file(filePath, { name: fileName });
41
+ addFileFrom(fileName, filePath) {
42
+ this.archive.file(filePath, { name: fileName });
43
+ this.copyToInspect(fileName, filePath);
44
+ this.logger.debug(cli_shared_1.Text.deploy.taskPackage.packageFile(fileName, filePath));
45
+ }
46
+ copyToInspect(fileName, contents) {
47
+ if (this.inspectDirectory) {
48
+ const targetName = (0, path_1.join)(this.inspectDirectory, fileName);
49
+ (0, fs_1.mkdirSync)((0, path_1.dirname)(targetName), { recursive: true });
50
+ if (typeof contents === 'string') {
51
+ (0, fs_1.copyFileSync)(contents, targetName);
41
52
  }
42
- });
53
+ else {
54
+ (0, fs_1.writeFileSync)(targetName, contents);
55
+ }
56
+ }
43
57
  }
44
58
  finalise() {
45
59
  return new Promise((resolve, reject) => {
@@ -1 +1 @@
1
- {"version":3,"file":"nativeui-bundler.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/nativeui-bundler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG5D,MAAM,WAAW,oBAAoB;IACnC,sBAAsB,EAAE,eAAe,EAAE,CAAC;CAC3C;AAED,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAU,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAxC,MAAM,EAAE,MAAM,EAAmB,OAAO,EAAE,aAAa;IAEvE,MAAM,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA8BjF"}
1
+ {"version":3,"file":"nativeui-bundler.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/nativeui-bundler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG5D,MAAM,WAAW,oBAAoB;IACnC,sBAAsB,EAAE,eAAe,EAAE,CAAC;CAC3C;AAED,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAU,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAxC,MAAM,EAAE,MAAM,EAAmB,OAAO,EAAE,aAAa;IAEvE,MAAM,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA8BjF"}
@@ -1,4 +1,4 @@
1
- import { Logger, ResourceDetails } from '@forge/cli-shared';
1
+ import { Handler, Logger, ResourceDetails, UserError } from '@forge/cli-shared';
2
2
  import { NativeUIBundler } from './nativeui-bundler';
3
3
  import { RuntimeBundler } from './runtime-bundler';
4
4
  export interface PackagerBundlerOutput {
@@ -18,19 +18,15 @@ export interface PackageResult {
18
18
  moduleList?: string[];
19
19
  }
20
20
  export interface Packager {
21
- package(handlers: string[], resources: ResourceDetails[]): Promise<PackageResult>;
21
+ package(handlers: Handler[], resources: ResourceDetails[]): Promise<PackageResult>;
22
22
  }
23
- export interface EntryPoint {
24
- name: string;
25
- path: string;
26
- }
27
- export declare class BundlerError extends Error {
23
+ export declare class BundlerError extends UserError {
28
24
  }
29
25
  export declare class AppPackager implements Packager {
30
26
  private readonly runtimeBundler;
31
27
  private readonly nativeUiBundler;
32
28
  private readonly logger;
33
29
  constructor(runtimeBundler: RuntimeBundler, nativeUiBundler: NativeUIBundler, logger: Logger);
34
- package(handlers: string[], resources: ResourceDetails[]): Promise<PackageResult>;
30
+ package(handlers: Handler[], resources: ResourceDetails[]): Promise<PackageResult>;
35
31
  }
36
32
  //# sourceMappingURL=packager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packager.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/packager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,eAAe,EAAQ,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACvC,SAAS,CAAC,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC3C,QAAQ,CAAC,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB,EAAE,eAAe,EAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,eAAe,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,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACpF;AAED,qBAAa,YAAa,SAAQ,SAAS;CAAG;AAE9C,qBAAa,WAAY,YAAW,QAAQ;IAExC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM;IAGpB,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;CAWhG"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppPackager = exports.BundlerError = void 0;
4
4
  const cli_shared_1 = require("@forge/cli-shared");
5
- class BundlerError extends Error {
5
+ class BundlerError extends cli_shared_1.UserError {
6
6
  }
7
7
  exports.BundlerError = BundlerError;
8
8
  class AppPackager {
@@ -1,5 +1,5 @@
1
- import { Bundler } from '@forge/bundler';
2
- import { Logger } from '@forge/cli-shared';
1
+ import { Bundler, FunctionsEntryPoint } from '@forge/bundler';
2
+ import { Handler, Logger } from '@forge/cli-shared';
3
3
  import { Archiver } from './archiver';
4
4
  export interface RuntimeBundleResult {
5
5
  runtimeArchivePath: string;
@@ -9,7 +9,7 @@ export declare class RuntimeBundler {
9
9
  private readonly archiverFactory;
10
10
  private readonly logger;
11
11
  private readonly bundler;
12
- constructor(archiverFactory: () => Archiver, logger: Logger, bundler: Bundler);
13
- bundle(handlers: string[]): Promise<RuntimeBundleResult>;
12
+ constructor(archiverFactory: () => Archiver, logger: Logger, bundler: Bundler<FunctionsEntryPoint>);
13
+ bundle(handlers: Handler[]): Promise<RuntimeBundleResult>;
14
14
  }
15
15
  //# sourceMappingURL=runtime-bundler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-bundler.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/runtime-bundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAuB,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,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;IAGtB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAyDtE"}
1
+ {"version":3,"file":"runtime-bundler.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/runtime-bundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAkB,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAuB,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,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;IAG3C,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAgDvE"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RuntimeBundler = void 0;
4
- const path_1 = require("path");
4
+ const fs_1 = require("fs");
5
+ const bundler_1 = require("@forge/bundler");
5
6
  const cli_shared_1 = require("@forge/cli-shared");
6
7
  const packager_1 = require("./packager");
7
8
  class RuntimeBundler {
@@ -15,17 +16,7 @@ class RuntimeBundler {
15
16
  archiver.onWarning((err) => {
16
17
  this.logger.warn(cli_shared_1.Text.deploy.taskPackage.archiverWarning(err));
17
18
  });
18
- archiver.onEntry((filePath) => {
19
- this.logger.debug(cli_shared_1.Text.deploy.taskPackage.fileAddedToArchive(filePath));
20
- });
21
- const currentDirectory = process.cwd();
22
- const entryPoints = [];
23
- for (const handler of handlers) {
24
- entryPoints.push({
25
- name: handler,
26
- path: (0, path_1.join)(currentDirectory, 'src', handler)
27
- });
28
- }
19
+ const entryPoints = (0, bundler_1.getEntryPoints)(handlers);
29
20
  const moduleList = [];
30
21
  if (entryPoints.length > 0) {
31
22
  let bundlerResponse;
@@ -49,7 +40,11 @@ class RuntimeBundler {
49
40
  }
50
41
  }
51
42
  }
52
- archiver.addRootDependencyFiles(cli_shared_1.dependencyFileNames, this.logger);
43
+ for (const fileName of cli_shared_1.dependencyFileNames) {
44
+ if ((0, fs_1.existsSync)(fileName)) {
45
+ archiver.addFileFrom(fileName, fileName);
46
+ }
47
+ }
53
48
  const archivePath = await archiver.finalise();
54
49
  this.logger.debug(cli_shared_1.Text.deploy.taskPackage.archiveCreated(archivePath));
55
50
  return { runtimeArchivePath: archivePath, moduleList };
@@ -46,7 +46,11 @@ class ArtifactGraphQLClient {
46
46
  });
47
47
  const error = (0, cli_shared_1.getError)(errors);
48
48
  if (!success) {
49
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
49
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
50
+ requestId,
51
+ code: error.code,
52
+ statusCode: error.statusCode
53
+ });
50
54
  }
51
55
  if (!deploymentUrl) {
52
56
  throw new NoDeploymentURLError();
@@ -81,7 +85,11 @@ class ArtifactGraphQLClient {
81
85
  });
82
86
  const error = (0, cli_shared_1.getError)(errors);
83
87
  if (!success) {
84
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
88
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
89
+ requestId,
90
+ code: error.code,
91
+ statusCode: error.statusCode
92
+ });
85
93
  }
86
94
  if (!preSignedUrls) {
87
95
  throw new NoPresignedUrlsError();
@@ -70,7 +70,11 @@ class GraphqlClient {
70
70
  });
71
71
  const error = (0, cli_shared_1.getError)(errors);
72
72
  if (!success) {
73
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
73
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
74
+ requestId,
75
+ code: error.code,
76
+ statusCode: error.statusCode
77
+ });
74
78
  }
75
79
  }
76
80
  async deleteEnvironmentVariable(details) {
@@ -98,7 +102,11 @@ class GraphqlClient {
98
102
  });
99
103
  const error = (0, cli_shared_1.getError)(errors);
100
104
  if (!success) {
101
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
105
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
106
+ requestId,
107
+ code: error.code,
108
+ statusCode: error.statusCode
109
+ });
102
110
  }
103
111
  }
104
112
  }
@@ -9,13 +9,21 @@ export declare class PermissionDeniedError extends GraphQlMutationError {
9
9
  constructor(requestId: string | undefined, appId: string | undefined, statusCode: number | undefined);
10
10
  }
11
11
  export declare class AlreadyInstalledError extends GraphQlMutationError {
12
- constructor(statusCode: number | undefined);
12
+ constructor(requestId: string | undefined, statusCode: number | undefined);
13
13
  }
14
14
  export declare class InstallationError extends GraphQlMutationError {
15
- constructor(message: string, code: string | undefined, statusCode: number | undefined);
15
+ constructor(message: string, { requestId, code, statusCode }: {
16
+ requestId: string | undefined;
17
+ code: string | undefined;
18
+ statusCode: number | undefined;
19
+ });
16
20
  }
17
21
  export declare class UpgradeError extends GraphQlMutationError {
18
- constructor(message: string, code: string | undefined, statusCode: number | undefined);
22
+ constructor(message: string, { requestId, code, statusCode }: {
23
+ requestId: string | undefined;
24
+ code: string | undefined;
25
+ statusCode: number | undefined;
26
+ });
19
27
  }
20
28
  export declare class EnvironmentNotFoundError extends Error {
21
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/installations/graphql-client.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EAId,sBAAsB,EAItB,aAAa,EACb,oBAAoB,EAMpB,KAAK,EAGL,SAAS,EACT,SAAS,EACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EACL,YAAY,EACZ,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,eAAO,MAAM,kCAAkC,MAAM,CAAC;AAiBtD,eAAO,MAAM,qBAAqB,kCAAkC,CAAC;AAMrE,qBAAa,qBAAsB,SAAQ,oBAAoB;gBACjD,SAAS,oBAAY,EAAE,KAAK,oBAAY,EAAE,UAAU,EAAE,M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CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAKzD,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;YAS5E,sBAAsB;YA8BtB,mBAAmB;IAiBjC,OAAO,CAAC,yBAAyB;YAOnB,sBAAsB;YAoBtB,6BAA6B;YAkC7B,mBAAmB;IAoEpB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;CAqCjH"}
@@ -9,25 +9,29 @@ const ALREADY_INSTALLED_CODE = 'APP_ALREADY_INSTALLED';
9
9
  const PERMISSION_DENIED = 'PERMISSION_DENIED';
10
10
  class PermissionDeniedError extends cli_shared_1.GraphQlMutationError {
11
11
  constructor(requestId = 'unknown', appId = 'unknown', statusCode) {
12
- super(cli_shared_1.Text.install.error.permissionsDeniedInstructions(requestId, appId), PERMISSION_DENIED, statusCode);
12
+ super(cli_shared_1.Text.install.error.permissionsDeniedInstructions(requestId, appId), {
13
+ requestId,
14
+ code: PERMISSION_DENIED,
15
+ statusCode
16
+ });
13
17
  }
14
18
  }
15
19
  exports.PermissionDeniedError = PermissionDeniedError;
16
20
  class AlreadyInstalledError extends cli_shared_1.GraphQlMutationError {
17
- constructor(statusCode) {
18
- super(cli_shared_1.Text.install.error.alreadyInstalledError, ALREADY_INSTALLED_CODE, statusCode);
21
+ constructor(requestId, statusCode) {
22
+ super(cli_shared_1.Text.install.error.alreadyInstalledError, { requestId, code: ALREADY_INSTALLED_CODE, statusCode });
19
23
  }
20
24
  }
21
25
  exports.AlreadyInstalledError = AlreadyInstalledError;
22
26
  class InstallationError extends cli_shared_1.GraphQlMutationError {
23
- constructor(message, code, statusCode) {
24
- super(cli_shared_1.Text.install.error.serverSideInstallationError(message), code, statusCode);
27
+ constructor(message, { requestId, code, statusCode }) {
28
+ super(cli_shared_1.Text.install.error.serverSideInstallationError(message), { requestId, code, statusCode });
25
29
  }
26
30
  }
27
31
  exports.InstallationError = InstallationError;
28
32
  class UpgradeError extends cli_shared_1.GraphQlMutationError {
29
- constructor(message, code, statusCode) {
30
- super(cli_shared_1.Text.upgrade.error.serverSideInstallationError(message), code, statusCode);
33
+ constructor(message, { requestId, code, statusCode }) {
34
+ super(cli_shared_1.Text.upgrade.error.serverSideInstallationError(message), { requestId, code, statusCode });
31
35
  }
32
36
  }
33
37
  exports.UpgradeError = UpgradeError;
@@ -121,12 +125,16 @@ class InstallationsGraphqlClient {
121
125
  const error = (0, cli_shared_1.getError)(errors);
122
126
  if (!success) {
123
127
  if (error.code === ALREADY_INSTALLED_CODE) {
124
- throw new AlreadyInstalledError(error.statusCode);
128
+ throw new AlreadyInstalledError(requestId, error.statusCode);
125
129
  }
126
130
  if (error.code === PERMISSION_DENIED) {
127
131
  throw new PermissionDeniedError(requestId, (0, cs_ari_1.parse)(appId).resourceId, error.statusCode);
128
132
  }
129
- throw new InstallationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
133
+ throw new InstallationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
134
+ requestId,
135
+ code: error.code,
136
+ statusCode: error.statusCode
137
+ });
130
138
  }
131
139
  if (!taskId) {
132
140
  throw new MissingTaskIdError(error.message);
@@ -160,7 +168,11 @@ class InstallationsGraphqlClient {
160
168
  const { response: { upgradeApp: { success, errors, taskId } }, requestId } = await this.graphqlClient.mutate(query, variables);
161
169
  const error = (0, cli_shared_1.getError)(errors);
162
170
  if (!success) {
163
- throw new UpgradeError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
171
+ throw new UpgradeError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
172
+ requestId,
173
+ code: error.code,
174
+ statusCode: error.statusCode
175
+ });
164
176
  }
165
177
  if (!taskId) {
166
178
  throw new MissingTaskIdError(error.message);
@@ -202,7 +214,11 @@ class InstallationsGraphqlClient {
202
214
  const { response: { uninstallApp: { success, errors, taskId } }, requestId } = await this.graphqlClient.mutate(query, { input });
203
215
  const error = (0, cli_shared_1.getError)(errors);
204
216
  if (!success) {
205
- throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
217
+ throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
218
+ requestId,
219
+ code: error.code,
220
+ statusCode: error.statusCode
221
+ });
206
222
  }
207
223
  return this.monitorUninstallApp(taskId);
208
224
  }