@forge/cli 6.1.0 → 6.2.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/npm-shrinkwrap.json +21 -5700
- package/out/analytics-client/analytics-client.d.ts +10 -1
- package/out/analytics-client/analytics-client.d.ts.map +1 -1
- package/out/analytics-client/analytics-client.js +40 -6
- package/out/command-line/command.d.ts +1 -3
- package/out/command-line/command.d.ts.map +1 -1
- package/out/command-line/command.js +30 -7
- package/out/command-line/controller/deploy-controller.d.ts +5 -4
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -1
- package/out/command-line/controller/deploy-controller.js +8 -6
- package/out/command-line/controller/pre-command-controller.d.ts +2 -2
- package/out/command-line/controller/pre-command-controller.d.ts.map +1 -1
- package/out/command-line/controller/pre-command-controller.js +1 -1
- package/out/command-line/register-authentication-command.js +3 -3
- package/out/command-line/view/tunnel-view.d.ts +3 -1
- package/out/command-line/view/tunnel-view.d.ts.map +1 -1
- package/out/command-line/view/tunnel-view.js +5 -2
- package/out/deploy/deployer/deployer.d.ts +9 -3
- package/out/deploy/deployer/deployer.d.ts.map +1 -1
- package/out/deploy/deployer/deployer.js +22 -8
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +1 -1
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +1 -1
- package/out/deploy/uploader/artifact-graphql-client.d.ts.map +1 -1
- package/out/deploy/uploader/artifact-graphql-client.js +2 -2
- package/out/environment-variables/graphql-client.d.ts +2 -2
- package/out/environment-variables/graphql-client.d.ts.map +1 -1
- package/out/environment-variables/graphql-client.js +3 -3
- package/out/installations/graphql-client.d.ts +11 -8
- package/out/installations/graphql-client.d.ts.map +1 -1
- package/out/installations/graphql-client.js +27 -17
- package/out/installations/site-translation/cloudid-products.d.ts +2 -2
- package/out/installations/site-translation/cloudid-products.d.ts.map +1 -1
- package/out/installations/site-translation/cloudid-products.js +1 -1
- package/out/providers/graphql-client.d.ts.map +1 -1
- package/out/providers/graphql-client.js +1 -1
- package/package.json +4 -4
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
import { PersonalApiCredentialsValidated, Logger } from '@forge/cli-shared';
|
|
2
2
|
import { Storage } from '../storage/local-file-storage';
|
|
3
3
|
import { CachedConfigService } from '../service/cached-config-service';
|
|
4
|
+
import { DeferredErrors } from '../command-line/errors';
|
|
4
5
|
export declare type AttributeMapper<T> = (val: T) => T | undefined;
|
|
5
6
|
export declare class AnalyticsClientReporter {
|
|
6
7
|
private readonly storage;
|
|
7
8
|
private readonly logger;
|
|
8
9
|
private readonly configService;
|
|
9
10
|
constructor(storage: Storage, logger: Logger, configService: CachedConfigService);
|
|
10
|
-
private
|
|
11
|
+
private readonly source;
|
|
11
12
|
reportSuccess(cmdName: string, cred: PersonalApiCredentialsValidated | string, attributes: {
|
|
12
13
|
[key: string]: any;
|
|
13
14
|
}): void;
|
|
14
15
|
reportFailure(cmdName: string, cred: string | PersonalApiCredentialsValidated, attributes: {
|
|
15
16
|
[key: string]: any;
|
|
16
17
|
}, e: Error): void;
|
|
18
|
+
reportCommandInvoke(cmdName: string, cred: string | PersonalApiCredentialsValidated, attributes: {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}): void;
|
|
21
|
+
reportInvokeFailure(cmdName: string, cred: string | PersonalApiCredentialsValidated, attributes: {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}, e: Error | DeferredErrors): void;
|
|
24
|
+
private reportOperationalEvent;
|
|
17
25
|
private processAnalyticsEvent;
|
|
18
26
|
private _getUserId;
|
|
19
27
|
private _getErrorDetails;
|
|
28
|
+
private _getErrorListDetails;
|
|
20
29
|
private _asContainer;
|
|
21
30
|
private _nodeVersion;
|
|
22
31
|
private _machineId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analytics-client.d.ts","sourceRoot":"","sources":["../../src/analytics-client/analytics-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE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,EAC9C,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GACjC,IAAI;IAIA,mBAAmB,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GAAG,+BAA+B,EAC9C,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,EAClC,CAAC,EAAE,KAAK,GAAG,cAAc,GACxB,IAAI;IAQP,OAAO,CAAC,sBAAsB;IA6B9B,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,UAAU;IAWlB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,YAAY;IAYpB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,aAAa;CAOtB"}
|
|
@@ -9,6 +9,7 @@ const analytics_message_handler_1 = require("./analytics-message-handler");
|
|
|
9
9
|
const uuid = require("uuid");
|
|
10
10
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
11
11
|
const unique_machine_id_1 = require("../command-line/unique-machine-id");
|
|
12
|
+
const errors_1 = require("../command-line/errors");
|
|
12
13
|
const Identity = (value) => value;
|
|
13
14
|
function appAidOrUndefined(appAri) {
|
|
14
15
|
try {
|
|
@@ -23,10 +24,7 @@ class AnalyticsClientReporter {
|
|
|
23
24
|
this.storage = storage;
|
|
24
25
|
this.logger = logger;
|
|
25
26
|
this.configService = configService;
|
|
26
|
-
this.
|
|
27
|
-
source: 'forge/cli',
|
|
28
|
-
action: 'invoked'
|
|
29
|
-
};
|
|
27
|
+
this.source = 'forge/cli';
|
|
30
28
|
}
|
|
31
29
|
reportSuccess(cmdName, cred, attributes) {
|
|
32
30
|
this.processAnalyticsEvent({
|
|
@@ -35,17 +33,40 @@ class AnalyticsClientReporter {
|
|
|
35
33
|
event: Object.assign(Object.assign({ timestamp: new Date(), os: {
|
|
36
34
|
name: os.platform(),
|
|
37
35
|
version: os.release()
|
|
38
|
-
} }, this._getUserId(cred)), { trackEvent:
|
|
36
|
+
} }, this._getUserId(cred)), { trackEvent: {
|
|
37
|
+
source: this.source,
|
|
38
|
+
action: 'invoked',
|
|
39
|
+
actionSubject: cmdName,
|
|
40
|
+
attributes: this._getAttributes(attributes),
|
|
41
|
+
containers: this._getContainer(attributes)
|
|
42
|
+
} })
|
|
39
43
|
});
|
|
40
44
|
}
|
|
41
45
|
reportFailure(cmdName, cred, attributes, e) {
|
|
46
|
+
attributes = Object.assign(Object.assign({}, attributes), this._getErrorDetails(e));
|
|
47
|
+
this.reportOperationalEvent('invoked', cmdName, cred, attributes);
|
|
48
|
+
}
|
|
49
|
+
reportCommandInvoke(cmdName, cred, attributes) {
|
|
50
|
+
this.reportOperationalEvent('cmdInvoked', cmdName, cred, attributes);
|
|
51
|
+
}
|
|
52
|
+
reportInvokeFailure(cmdName, cred, attributes, e) {
|
|
53
|
+
attributes = Object.assign(Object.assign({}, attributes), this._getErrorListDetails(e));
|
|
54
|
+
this.reportOperationalEvent('cmdInvokeFailed', cmdName, cred, attributes);
|
|
55
|
+
}
|
|
56
|
+
reportOperationalEvent(action, actionSubject, cred, attributes) {
|
|
42
57
|
this.processAnalyticsEvent({
|
|
43
58
|
id: uuid(),
|
|
44
59
|
eventType: analytics_message_handler_1.EventType.OPERATIONAL,
|
|
45
60
|
event: Object.assign(Object.assign({ timestamp: new Date(), os: {
|
|
46
61
|
name: os.platform(),
|
|
47
62
|
version: os.release()
|
|
48
|
-
} }, this._getUserId(cred)), { operationalEvent:
|
|
63
|
+
} }, this._getUserId(cred)), { operationalEvent: {
|
|
64
|
+
source: this.source,
|
|
65
|
+
action,
|
|
66
|
+
actionSubject,
|
|
67
|
+
attributes: Object.assign({}, this._getAttributes(attributes)),
|
|
68
|
+
containers: this._getContainer(attributes)
|
|
69
|
+
} })
|
|
49
70
|
});
|
|
50
71
|
}
|
|
51
72
|
processAnalyticsEvent(analyticsEvent) {
|
|
@@ -75,6 +96,19 @@ class AnalyticsClientReporter {
|
|
|
75
96
|
}
|
|
76
97
|
return { error: e.constructor.name };
|
|
77
98
|
}
|
|
99
|
+
_getErrorListDetails(e) {
|
|
100
|
+
const errorList = [];
|
|
101
|
+
const errors = e instanceof errors_1.DeferredErrors ? e.getErrors() : [e];
|
|
102
|
+
errors.forEach((error) => {
|
|
103
|
+
if (error instanceof cli_shared_1.GraphQlMutationError) {
|
|
104
|
+
errorList.push(error.getCode());
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
errorList.push(error.constructor.name);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
return { error: errorList.join(',') };
|
|
111
|
+
}
|
|
78
112
|
_asContainer(attrValue, containerType, type, mapper = Identity) {
|
|
79
113
|
const mappedValue = mapper(attrValue);
|
|
80
114
|
return mappedValue
|
|
@@ -15,9 +15,6 @@ export declare class WrapperError extends CommanderError {
|
|
|
15
15
|
constructor(error: CommanderError, commandName: string);
|
|
16
16
|
getCommandName: () => string;
|
|
17
17
|
}
|
|
18
|
-
export interface ErrorWithAnalytics {
|
|
19
|
-
getAttributes: () => Record<string, string | string[]>;
|
|
20
|
-
}
|
|
21
18
|
export declare class Command {
|
|
22
19
|
private readonly ui;
|
|
23
20
|
private readonly analyticsClient;
|
|
@@ -72,6 +69,7 @@ export declare class Command {
|
|
|
72
69
|
private checkPreconditions;
|
|
73
70
|
private checkAuthentication;
|
|
74
71
|
private checkVersion;
|
|
72
|
+
private isLatestVersion;
|
|
75
73
|
private validateContext;
|
|
76
74
|
private findLastValidCommand;
|
|
77
75
|
private outputRelevantHelp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/command-line/command.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,EAAE,EAAE,cAAc,EAAU,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEnF,OAAO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eAAe;YAgBT,eAAe;IAoB7B,OAAO,CAAC,oBAAoB;IAyB5B,OAAO,CAAC,kBAAkB,CAExB;IAEF,OAAO,CAAC,cAAc;IAqCtB,OAAO,CAAC,eAAe;CAyBxB"}
|
|
@@ -44,7 +44,7 @@ class Command {
|
|
|
44
44
|
return this;
|
|
45
45
|
};
|
|
46
46
|
this.actionProcessor = async (cb, ...args) => {
|
|
47
|
-
var _b, _c, _d;
|
|
47
|
+
var _b, _c, _d, _e, _f;
|
|
48
48
|
if (this.newCommand) {
|
|
49
49
|
this.ui.error(new Error(cli_shared_3.Text.deprecate(this.newCommand)));
|
|
50
50
|
}
|
|
@@ -52,6 +52,14 @@ class Command {
|
|
|
52
52
|
let cred = (0, anon_user_id_1.getAnonId)(true);
|
|
53
53
|
let attributes = {};
|
|
54
54
|
try {
|
|
55
|
+
if (this.cliDetails) {
|
|
56
|
+
attributes = {
|
|
57
|
+
version: this.cliDetails.version,
|
|
58
|
+
latest: this.cliDetails.latest,
|
|
59
|
+
isLatest: this.isLatestVersion()
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
this.analyticsClient.reportCommandInvoke((_b = this.analyticsName) !== null && _b !== void 0 ? _b : cmdName, cred, attributes);
|
|
55
63
|
if (!this.expectsArguments && args.length > 2) {
|
|
56
64
|
throw new cli_shared_3.ValidationError(cli_shared_3.Text.extraArguments(cmdName));
|
|
57
65
|
}
|
|
@@ -62,14 +70,11 @@ class Command {
|
|
|
62
70
|
}
|
|
63
71
|
}
|
|
64
72
|
if (this.requiresAnalyticsConsent) {
|
|
65
|
-
await this.preCommandController.verifyAnalyticsPreferences((
|
|
73
|
+
await this.preCommandController.verifyAnalyticsPreferences((_c = options === null || options === void 0 ? void 0 : options.nonInteractive) !== null && _c !== void 0 ? _c : false)();
|
|
66
74
|
}
|
|
67
75
|
if (!(options === null || options === void 0 ? void 0 : options.json)) {
|
|
68
76
|
this.checkVersion();
|
|
69
77
|
}
|
|
70
|
-
if (this.cliDetails) {
|
|
71
|
-
attributes = { version: this.cliDetails.version, latest: this.cliDetails.latest };
|
|
72
|
-
}
|
|
73
78
|
const preconditionCheckAttributes = await this.checkPreconditions(...args);
|
|
74
79
|
attributes = Object.assign(Object.assign({}, attributes), preconditionCheckAttributes);
|
|
75
80
|
const actualCred = await this.checkAuthentication();
|
|
@@ -83,18 +88,22 @@ class Command {
|
|
|
83
88
|
cred = result.creds;
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
|
-
this.analyticsClient.reportSuccess((
|
|
91
|
+
this.analyticsClient.reportSuccess((_d = this.analyticsName) !== null && _d !== void 0 ? _d : cmdName, cred, attributes);
|
|
87
92
|
}
|
|
88
93
|
catch (e) {
|
|
89
94
|
if (isErrorWithAnalytics(e)) {
|
|
90
95
|
attributes = Object.assign(Object.assign({}, e.getAttributes()), attributes);
|
|
91
96
|
}
|
|
97
|
+
if (attributes.isUserError === undefined) {
|
|
98
|
+
attributes = Object.assign(Object.assign({}, attributes), { isUserError: false });
|
|
99
|
+
}
|
|
100
|
+
this.analyticsClient.reportInvokeFailure((_e = this.analyticsName) !== null && _e !== void 0 ? _e : cmdName, cred, attributes, e);
|
|
92
101
|
if (e instanceof errors_1.DeferredErrors) {
|
|
93
102
|
e.getErrors().forEach((error) => { var _b; return this.analyticsClient.reportFailure((_b = this.analyticsName) !== null && _b !== void 0 ? _b : cmdName, cred, attributes, error); });
|
|
94
103
|
process.exit(1);
|
|
95
104
|
}
|
|
96
105
|
else {
|
|
97
|
-
this.analyticsClient.reportFailure((
|
|
106
|
+
this.analyticsClient.reportFailure((_f = this.analyticsName) !== null && _f !== void 0 ? _f : cmdName, cred, attributes, e);
|
|
98
107
|
(0, cli_shared_4.exitOnError)(this.ui, e);
|
|
99
108
|
}
|
|
100
109
|
}
|
|
@@ -278,6 +287,20 @@ class Command {
|
|
|
278
287
|
(0, version_info_1.clearVersionCache)(this.cliDetails.name);
|
|
279
288
|
}
|
|
280
289
|
}
|
|
290
|
+
isLatestVersion() {
|
|
291
|
+
if (!this.cliDetails ||
|
|
292
|
+
!this.cliDetails.latest ||
|
|
293
|
+
!semver_1.default.valid(this.cliDetails.version) ||
|
|
294
|
+
!semver_1.default.valid(this.cliDetails.latest)) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
if (semver_1.default.eq(this.cliDetails.version, this.cliDetails.latest)) {
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
281
304
|
async validateContext() {
|
|
282
305
|
let capitalizedProduct;
|
|
283
306
|
if (this.cmd.opts().product) {
|
|
@@ -3,22 +3,23 @@ import { LintService } from '../../service/lint-service';
|
|
|
3
3
|
import { DeployView } from '../view/deploy-view';
|
|
4
4
|
import { InstallationService } from '../../service/installation-service';
|
|
5
5
|
import { MigrationKeysService } from '../../service/migration-keys-service';
|
|
6
|
-
import { ErrorWithAnalytics } from '../command';
|
|
7
6
|
import { PackageUploadDeployCommand } from '../../deploy';
|
|
8
7
|
import { DeploymentResult } from '../register-deployment-commands';
|
|
9
8
|
interface DeployOptions {
|
|
10
9
|
environment: string;
|
|
11
10
|
verify: boolean;
|
|
12
11
|
}
|
|
13
|
-
export declare class DeployLintFailureError extends HiddenError
|
|
12
|
+
export declare class DeployLintFailureError extends HiddenError {
|
|
14
13
|
private readonly scopes;
|
|
15
14
|
constructor(scopes: string[]);
|
|
16
|
-
getAttributes(): Record<string,
|
|
15
|
+
getAttributes(): Record<string, any>;
|
|
16
|
+
isUserError(): boolean;
|
|
17
17
|
}
|
|
18
|
-
export declare class InvalidConnectKeyError extends HiddenError
|
|
18
|
+
export declare class InvalidConnectKeyError extends HiddenError {
|
|
19
19
|
private readonly reason;
|
|
20
20
|
constructor(reason: string);
|
|
21
21
|
getAttributes(): Record<string, string>;
|
|
22
|
+
isUserError(): boolean;
|
|
22
23
|
}
|
|
23
24
|
export declare class DeployController {
|
|
24
25
|
private readonly appConfigProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/deploy-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAQ,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAA+B,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACzG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"deploy-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/deploy-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,WAAW,EAAQ,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAA+B,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACzG,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,qBAAa,sBAAuB,SAAQ,WAAW;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM,EAAE;IAItC,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAMpC,WAAW,IAAI,OAAO;CAG9B;AAED,qBAAa,sBAAuB,SAAQ,WAAW;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAGpC,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMvC,WAAW,IAAI,OAAO;CAG9B;AAED,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,0BAA0B;gBAN1B,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,oBAAoB,EAAE,mBAAmB,EACzC,oBAAoB,EAAE,oBAAoB,EAC1C,UAAU,EAAE,UAAU,EACtB,0BAA0B,EAAE,0BAA0B;IAGzE,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,iBAAiB;YAGX,wBAAwB;YAwBxB,mBAAmB;YAiBnB,oBAAoB;IAOrB,GAAG,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;CAqD3F"}
|
|
@@ -8,9 +8,10 @@ class DeployLintFailureError extends cli_shared_1.HiddenError {
|
|
|
8
8
|
this.scopes = scopes;
|
|
9
9
|
}
|
|
10
10
|
getAttributes() {
|
|
11
|
-
return {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
return Object.assign(Object.assign({}, super.getAttributes()), { scopes: this.scopes });
|
|
12
|
+
}
|
|
13
|
+
isUserError() {
|
|
14
|
+
return true;
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
exports.DeployLintFailureError = DeployLintFailureError;
|
|
@@ -20,9 +21,10 @@ class InvalidConnectKeyError extends cli_shared_1.HiddenError {
|
|
|
20
21
|
this.reason = reason;
|
|
21
22
|
}
|
|
22
23
|
getAttributes() {
|
|
23
|
-
return {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
return Object.assign(Object.assign({}, super.getAttributes()), { reason: this.reason });
|
|
25
|
+
}
|
|
26
|
+
isUserError() {
|
|
27
|
+
return true;
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
30
|
exports.InvalidConnectKeyError = InvalidConnectKeyError;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LiteLintService } from '../../service/lite-lint-service';
|
|
2
2
|
import { LiteLintView } from '../view/lite-lint-view';
|
|
3
|
-
import { ConfigReader } from '@forge/cli-shared';
|
|
3
|
+
import { ConfigReader, UserError } from '@forge/cli-shared';
|
|
4
4
|
import { CachedConfigService } from '../../service/cached-config-service';
|
|
5
5
|
import { AnalyticsSettingsView } from '../view/analytics-settings-view';
|
|
6
6
|
import { SettingsView } from '../view/settings-view';
|
|
7
|
-
export declare class PreCommandValidationError extends
|
|
7
|
+
export declare class PreCommandValidationError extends UserError {
|
|
8
8
|
constructor();
|
|
9
9
|
}
|
|
10
10
|
export declare class PreCommandController {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pre-command-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/pre-command-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAQ,YAAY,EAAmB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"pre-command-controller.d.ts","sourceRoot":"","sources":["../../../src/command-line/controller/pre-command-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAQ,YAAY,EAAmB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,qBAAa,yBAA0B,SAAQ,SAAS;;CAIvD;AAED,qBAAa,oBAAoB;IAE7B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,YAAY;gBALZ,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,YAAY,EAClB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,mBAAmB,EACxC,qBAAqB,EAAE,qBAAqB,EAC5C,YAAY,EAAE,YAAY;YAG/B,SAAS;IAQvB,oBAAoB,IAAI,MAAM,OAAO,CAAC,IAAI,CAAC;IAI3C,iCAAiC,IAAI,MAAM,OAAO,CAAC;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAUtE,0BAA0B,CAAC,cAAc,UAAQ,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC;CAgB3E"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PreCommandController = exports.PreCommandValidationError = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
class PreCommandValidationError extends
|
|
5
|
+
class PreCommandValidationError extends cli_shared_1.UserError {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(cli_shared_1.Text.config.manifest.invalid);
|
|
8
8
|
}
|
|
@@ -38,7 +38,7 @@ async function loginCommandHandler(ui, instructionsUrl, loginCommand, { email, t
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
41
|
-
throw error instanceof cli_shared_1.UserNotFoundError ? new
|
|
41
|
+
throw error instanceof cli_shared_1.UserNotFoundError ? new cli_shared_1.UserNotFoundError(cli_shared_2.Text.login.error) : error;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
exports.loginCommandHandler = loginCommandHandler;
|
|
@@ -76,10 +76,10 @@ function registerWhoAmICommand({ cmd, ui, services: { credentialStore }, command
|
|
|
76
76
|
catch (error) {
|
|
77
77
|
if (error instanceof cli_shared_1.UserNotFoundError) {
|
|
78
78
|
if (process.env[cli_shared_1.EMAIL_KEY] && process.env[cli_shared_1.API_TOKEN_KEY]) {
|
|
79
|
-
throw new
|
|
79
|
+
throw new cli_shared_1.UserNotFoundError(cli_shared_2.Text.whoami.error.personalCredentialsEnv(cli_shared_1.EMAIL_KEY, cli_shared_1.API_TOKEN_KEY));
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
throw new
|
|
82
|
+
throw new cli_shared_1.UserNotFoundError(cli_shared_2.Text.whoami.error.personalCredentialsKeytar);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
throw error;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { CommandLineUI, exitOnError } from '@forge/cli-shared';
|
|
2
|
+
import { CommandLineUI, exitOnError, UserError } from '@forge/cli-shared';
|
|
3
3
|
import { spawn } from 'cross-spawn';
|
|
4
4
|
export interface DownloadProgressCallbacks {
|
|
5
5
|
onStart: () => void;
|
|
6
6
|
onSuccess: () => void;
|
|
7
7
|
onFailure: () => void;
|
|
8
8
|
}
|
|
9
|
+
export declare class TunnelViewError extends UserError {
|
|
10
|
+
}
|
|
9
11
|
export declare class TunnelView {
|
|
10
12
|
private readonly ui;
|
|
11
13
|
constructor(ui: CommandLineUI);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/tunnel-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"tunnel-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/tunnel-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAkB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAGpC,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,qBAAa,eAAgB,SAAQ,SAAS;CAAG;AAEjD,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,aAAa;IAEvC,cAAc,IAAI,IAAI;IAMtB,qBAAqB,CAAC,MAAM,EAAE,OAAO,WAAW,GAAG,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI;IAQvE,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,MAAM;IA+BxE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAQpG,sBAAsB,CAC3B,yBAAyB,EAAE,UAAU,CAAC,OAAO,KAAK,CAAC,EACnD,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,yBAAyB,GAC3D,OAAO,CAAC,IAAI,CAAC;CAyCjB"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TunnelView = void 0;
|
|
3
|
+
exports.TunnelView = exports.TunnelViewError = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
6
6
|
const ora_1 = tslib_1.__importDefault(require("ora"));
|
|
7
|
+
class TunnelViewError extends cli_shared_1.UserError {
|
|
8
|
+
}
|
|
9
|
+
exports.TunnelViewError = TunnelViewError;
|
|
7
10
|
class TunnelView {
|
|
8
11
|
constructor(ui) {
|
|
9
12
|
this.ui = ui;
|
|
@@ -17,7 +20,7 @@ class TunnelView {
|
|
|
17
20
|
const handler = (err) => {
|
|
18
21
|
if (this.ui.debugEnabled)
|
|
19
22
|
this.ui.error(err);
|
|
20
|
-
exitFn(this.ui, new
|
|
23
|
+
exitFn(this.ui, new TunnelViewError(cli_shared_1.Text.tunnel.error.tunnelPackageMissing));
|
|
21
24
|
};
|
|
22
25
|
return handler;
|
|
23
26
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { AppConfigProvider, Pause, UI } from '@forge/cli-shared';
|
|
1
|
+
import { AppConfigProvider, Pause, UI, BaseError } from '@forge/cli-shared';
|
|
2
2
|
import { DeployMonitorClient, DeployMonitorStatus } from './deploy-monitor-graphql-client';
|
|
3
3
|
import { TriggerDeployClient } from './trigger-deploy-graphql-client';
|
|
4
|
-
export declare class AppDeploymentFailedError extends
|
|
4
|
+
export declare class AppDeploymentFailedError extends BaseError {
|
|
5
|
+
private readonly userError?;
|
|
6
|
+
constructor(userError?: boolean | undefined, message?: string);
|
|
7
|
+
isUserError(): boolean;
|
|
5
8
|
}
|
|
6
9
|
export declare class AppSnapshotFailedError extends Error {
|
|
7
10
|
}
|
|
8
|
-
export declare class HostedResourceDeploymentFailedError extends
|
|
11
|
+
export declare class HostedResourceDeploymentFailedError extends BaseError {
|
|
12
|
+
private readonly userError?;
|
|
13
|
+
constructor(userError?: boolean | undefined, message?: string);
|
|
14
|
+
isUserError(): boolean;
|
|
9
15
|
}
|
|
10
16
|
export interface Deployer {
|
|
11
17
|
deploy(environmentKey: string, artifactUrl: string, hostedResourceUploadId?: string): Promise<void>;
|
|
@@ -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,
|
|
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,CAAC,IAAI,CAAC,CAAC;CACrG;AAyBD,qBAAa,gBAAiB,YAAW,QAAQ;IAE7C,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAJF,gBAAgB,EAAE,iBAAiB,EACnC,YAAY,EAAE,mBAAmB,EACjC,mBAAmB,EAAE,mBAAmB,EACxC,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,EAAE;IAGZ,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,sBAAsB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAMlG,QAAQ;IAcT,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;;;;YA2BpG,iBAAiB;IAa/B,OAAO,CAAC,gBAAgB;IAsBxB,OAAO,CAAC,0BAA0B;IA6BlC,OAAO,CAAC,gBAAgB;CAkCzB"}
|
|
@@ -4,13 +4,27 @@ exports.ArtifactDeployer = exports.HostedResourceDeploymentFailedError = exports
|
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
5
|
const deploy_monitor_graphql_client_1 = require("./deploy-monitor-graphql-client");
|
|
6
6
|
const DEPLOYMENT_EVENT_POLL_INTERVAL = 500;
|
|
7
|
-
class AppDeploymentFailedError extends
|
|
7
|
+
class AppDeploymentFailedError extends cli_shared_1.BaseError {
|
|
8
|
+
constructor(userError, message) {
|
|
9
|
+
super(message);
|
|
10
|
+
this.userError = userError;
|
|
11
|
+
}
|
|
12
|
+
isUserError() {
|
|
13
|
+
return Boolean(this.userError);
|
|
14
|
+
}
|
|
8
15
|
}
|
|
9
16
|
exports.AppDeploymentFailedError = AppDeploymentFailedError;
|
|
10
17
|
class AppSnapshotFailedError extends Error {
|
|
11
18
|
}
|
|
12
19
|
exports.AppSnapshotFailedError = AppSnapshotFailedError;
|
|
13
|
-
class HostedResourceDeploymentFailedError extends
|
|
20
|
+
class HostedResourceDeploymentFailedError extends cli_shared_1.BaseError {
|
|
21
|
+
constructor(userError, message) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.userError = userError;
|
|
24
|
+
}
|
|
25
|
+
isUserError() {
|
|
26
|
+
return Boolean(this.userError);
|
|
27
|
+
}
|
|
14
28
|
}
|
|
15
29
|
exports.HostedResourceDeploymentFailedError = HostedResourceDeploymentFailedError;
|
|
16
30
|
function isTransitionEvent(event) {
|
|
@@ -132,23 +146,23 @@ class ArtifactDeployer {
|
|
|
132
146
|
if (code === 'ENVIRONMENT_UPDATE_VALIDATION_FAILED') {
|
|
133
147
|
const causeMessage = (_a = errorDetails === null || errorDetails === void 0 ? void 0 : errorDetails.fields) === null || _a === void 0 ? void 0 : _a.validationResult.message.replace(/Upsert.*Details /, '');
|
|
134
148
|
if ((causeMessage === null || causeMessage === void 0 ? void 0 : causeMessage.startsWith('Invalid URL')) && causeMessage.includes('EGRESS')) {
|
|
135
|
-
throw new AppDeploymentFailedError(cli_shared_1.Text.deploy.egressURL.invalidURLError(causeMessage));
|
|
149
|
+
throw new AppDeploymentFailedError(true, cli_shared_1.Text.deploy.egressURL.invalidURLError(causeMessage));
|
|
136
150
|
}
|
|
137
151
|
else if (causeMessage === null || causeMessage === void 0 ? void 0 : causeMessage.startsWith('Egress permission URL')) {
|
|
138
|
-
throw new AppDeploymentFailedError(cli_shared_1.Text.deploy.egressURL.tooManyURLCharactersError(causeMessage));
|
|
152
|
+
throw new AppDeploymentFailedError(true, cli_shared_1.Text.deploy.egressURL.tooManyURLCharactersError(causeMessage));
|
|
139
153
|
}
|
|
140
154
|
else if (causeMessage === null || causeMessage === void 0 ? void 0 : causeMessage.includes('permission URLs provided, exceeding')) {
|
|
141
|
-
throw new AppDeploymentFailedError(cli_shared_1.Text.deploy.egressURL.tooManyUrlsError(causeMessage));
|
|
155
|
+
throw new AppDeploymentFailedError(true, cli_shared_1.Text.deploy.egressURL.tooManyUrlsError(causeMessage));
|
|
142
156
|
}
|
|
143
157
|
}
|
|
144
158
|
if (code === 'HOSTED_RESOURCE_TOO_MANY_FILES') {
|
|
145
|
-
throw new HostedResourceDeploymentFailedError(cli_shared_1.Text.hostedResources.error(message));
|
|
159
|
+
throw new HostedResourceDeploymentFailedError(true, cli_shared_1.Text.hostedResources.error(message));
|
|
146
160
|
}
|
|
147
161
|
if (code === 'HOSTED_RESOURCES_LAMBDA_TIMEOUT') {
|
|
148
|
-
throw new HostedResourceDeploymentFailedError(cli_shared_1.Text.hostedResources.error(cli_shared_1.Text.hostedResources.lambdaTimeout));
|
|
162
|
+
throw new HostedResourceDeploymentFailedError(false, cli_shared_1.Text.hostedResources.error(cli_shared_1.Text.hostedResources.lambdaTimeout));
|
|
149
163
|
}
|
|
150
164
|
}
|
|
151
|
-
throw new AppDeploymentFailedError(cli_shared_1.Text.deploy.taskDeploy.serverStepFailed);
|
|
165
|
+
throw new AppDeploymentFailedError(false, cli_shared_1.Text.deploy.taskDeploy.serverStepFailed);
|
|
152
166
|
}
|
|
153
167
|
}
|
|
154
168
|
exports.ArtifactDeployer = ArtifactDeployer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-deploy-graphql-client.d.ts","sourceRoot":"","sources":["../../../src/deploy/deployer/trigger-deploy-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAId,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACxD;AAED,qBAAa,iBAAkB,SAAQ,KAAK;;CAI3C;AAED,qBAAa,0BAA2B,YAAW,mBAAmB;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,MAAM,CAAC,iBAAiB,EAAE,oBAAoB;
|
|
1
|
+
{"version":3,"file":"trigger-deploy-graphql-client.d.ts","sourceRoot":"","sources":["../../../src/deploy/deployer/trigger-deploy-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAId,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACxD;AAED,qBAAa,iBAAkB,SAAQ,KAAK;;CAI3C;AAED,qBAAa,0BAA2B,YAAW,mBAAmB;IACxD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,MAAM,CAAC,iBAAiB,EAAE,oBAAoB;CA2C5D"}
|
|
@@ -34,7 +34,7 @@ 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);
|
|
37
|
+
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
|
|
38
38
|
}
|
|
39
39
|
if (!deployment) {
|
|
40
40
|
throw new NoDeploymentError();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifact-graphql-client.d.ts","sourceRoot":"","sources":["../../../src/deploy/uploader/artifact-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,aAAa,EAIb,0BAA0B,EAG3B,MAAM,mBAAmB,CAAC;AAE3B,U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,SAAQ,KAAK;;CAIzC;AAED,qBAAa,qBAAsB,YAAW,cAAc;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IA4CrD,4BAA4B,CACvC,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,4BAA4B,CAAC;CAmDzC"}
|
|
@@ -46,7 +46,7 @@ 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);
|
|
49
|
+
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
|
|
50
50
|
}
|
|
51
51
|
if (!deploymentUrl) {
|
|
52
52
|
throw new NoDeploymentURLError();
|
|
@@ -81,7 +81,7 @@ class ArtifactGraphQLClient {
|
|
|
81
81
|
});
|
|
82
82
|
const error = (0, cli_shared_1.getError)(errors);
|
|
83
83
|
if (!success) {
|
|
84
|
-
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code);
|
|
84
|
+
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
|
|
85
85
|
}
|
|
86
86
|
if (!preSignedUrls) {
|
|
87
87
|
throw new NoPresignedUrlsError();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AppEnvironmentVariable, GraphQLClient, Maybe } from '@forge/cli-shared';
|
|
1
|
+
import { AppEnvironmentVariable, GraphQLClient, Maybe, UserError } from '@forge/cli-shared';
|
|
2
2
|
import { AppEnvironmentVariableDetails as DeleteAppEnvironmentVariableDetails, DeleteEnvironmentVariableClient } from './delete-environment-variable';
|
|
3
3
|
import { AppEnvironmentVariablesDetails as ListAppEnvironmentVariablesDetails, ListEnvironmentVariablesClient } from './list-environment-variables';
|
|
4
4
|
import { AppEnvironmentVariableDetails as SetAppEnvironmentVariableDetails, SetEnvironmentVariableClient } from './set-environment-variable';
|
|
5
|
-
export declare class MissingAppError extends
|
|
5
|
+
export declare class MissingAppError extends UserError {
|
|
6
6
|
}
|
|
7
7
|
export declare class MissingAppEnvironmentError extends Error {
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/environment-variables/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/environment-variables/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,aAAa,EAEb,KAAK,EACL,SAAS,EACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,6BAA6B,IAAI,mCAAmC,EACpE,+BAA+B,EAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,8BAA8B,IAAI,kCAAkC,EACpE,8BAA8B,EAC/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,6BAA6B,IAAI,gCAAgC,EACjE,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAEpC,qBAAa,eAAgB,SAAQ,SAAS;CAAG;AACjD,qBAAa,0BAA2B,SAAQ,KAAK;CAAG;AAExD,qBAAa,aACX,YAAW,4BAA4B,EAAE,+BAA+B,EAAE,8BAA8B;IAC5F,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,wBAAwB,CACnC,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,CAAC,GAAG,SAAS,CAAC;IAkC1C,sBAAsB,CAAC,OAAO,EAAE,gCAAgC;IA6ChE,yBAAyB,CAAC,OAAO,EAAE,mCAAmC;CA2CpF"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GraphqlClient = exports.MissingAppEnvironmentError = exports.MissingAppError = void 0;
|
|
4
4
|
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
-
class MissingAppError extends
|
|
5
|
+
class MissingAppError extends cli_shared_1.UserError {
|
|
6
6
|
}
|
|
7
7
|
exports.MissingAppError = MissingAppError;
|
|
8
8
|
class MissingAppEnvironmentError extends Error {
|
|
@@ -70,7 +70,7 @@ 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);
|
|
73
|
+
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
async deleteEnvironmentVariable(details) {
|
|
@@ -98,7 +98,7 @@ class GraphqlClient {
|
|
|
98
98
|
});
|
|
99
99
|
const error = (0, cli_shared_1.getError)(errors);
|
|
100
100
|
if (!success) {
|
|
101
|
-
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code);
|
|
101
|
+
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, error.code, error.statusCode);
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
}
|