@forge/cli-shared 3.16.0-next.13 → 3.16.0-next.14
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minimal-graphql-runner.d.ts","sourceRoot":"","sources":["../../src/graphql/minimal-graphql-runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,UAAU,EAA+B,MAAM,UAAU,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAIjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAQjD,qBAAa,0BAA2B,SAAQ,SAAS;CAAG;AAI5D,qBAAa,0BAA2B,SAAQ,SAAS;;CAIxD;AAED,qBAAa,2BAA4B,SAAQ,SAAS;IAK5C,OAAO,CAAC,QAAQ,CAAC,SAAS;IAJtC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAqB;IAC1C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAqB;IAChD,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;gBAEV,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE;IAQtG,OAAO,QAAO,MAAM,GAAG,SAAS,CAE9B;IAEF,aAAa,QAAO,MAAM,GAAG,SAAS,CAEpC;IAEF,YAAY,QAAO,MAAM,GAAG,SAAS,CAEnC;IAEK,WAAW,IAAI,OAAO;CAG9B;AAED,qBAAa,YAAa,SAAQ,KAAK;gBACzB,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM;CAG1C;AAED,qBAA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AO,MAAM,GAAG,SAAS,CAEnC;IAEK,WAAW,IAAI,OAAO;CAG9B;AAED,qBAAa,YAAa,SAAQ,KAAK;gBACzB,IAAI,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM;CAG1C;AAED,qBAAa,oBAAqB,YAAW,aAAa;IAEtD,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAFV,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,UAAU,GAAG,SAAS;IAGxC,GAAG,CAAC,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU;;;;IASjE,SAAS,CAAC,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,mBAAmB,EAAE,mBAAmB;IAMpF,UAAU,CAAC,mBAAmB,EAAE,mBAAmB,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAWtF,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,gBAAgB;YAIV,4BAA4B;IAuC1C,OAAO,CAAC,YAAY;CAUrB"}
|
|
@@ -51,23 +51,8 @@ class MinimalGraphQLRunner {
|
|
|
51
51
|
this.cliDetails = cliDetails;
|
|
52
52
|
}
|
|
53
53
|
async run(query, variables) {
|
|
54
|
-
const { data,
|
|
55
|
-
if (status === 401) {
|
|
56
|
-
const errorMessage = this.authenticator.getInstructionsWhenInvalid();
|
|
57
|
-
throw new GraphQLAuthenticationError(errorMessage);
|
|
58
|
-
}
|
|
54
|
+
const { data, extensions, headers } = await this.rawRequestWithoutClientError(query, variables);
|
|
59
55
|
const requestId = this.getRequestId(extensions, headers);
|
|
60
|
-
if (errors) {
|
|
61
|
-
if (errors.find((e) => isOutdatedClientVersionError(e))) {
|
|
62
|
-
throw new OutdatedClientVersionError();
|
|
63
|
-
}
|
|
64
|
-
const { statusCode } = (0, index_1.getError)(errors);
|
|
65
|
-
const isUserError = statusCode && statusCode >= 400 && statusCode < 500 ? true : false;
|
|
66
|
-
throw new GraphQLProviderServiceError(isUserError, requestId, errors);
|
|
67
|
-
}
|
|
68
|
-
if (status !== 200) {
|
|
69
|
-
throw new GraphqlError(data, requestId);
|
|
70
|
-
}
|
|
71
56
|
return {
|
|
72
57
|
requestId,
|
|
73
58
|
response: data
|
|
@@ -99,12 +84,26 @@ class MinimalGraphQLRunner {
|
|
|
99
84
|
return await client.rawRequest(query, variables);
|
|
100
85
|
}
|
|
101
86
|
catch (error) {
|
|
102
|
-
if (error.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
87
|
+
if (error instanceof graphql_request_1.ClientError) {
|
|
88
|
+
const { data, errors, extensions, headers, status } = error.response;
|
|
89
|
+
if (status === 401) {
|
|
90
|
+
const errorMessage = this.authenticator.getInstructionsWhenInvalid();
|
|
91
|
+
throw new GraphQLAuthenticationError(errorMessage);
|
|
92
|
+
}
|
|
93
|
+
const requestId = this.getRequestId(extensions, headers);
|
|
94
|
+
if (errors) {
|
|
95
|
+
if (errors.find((e) => isOutdatedClientVersionError(e))) {
|
|
96
|
+
throw new OutdatedClientVersionError();
|
|
97
|
+
}
|
|
98
|
+
const { statusCode } = (0, index_1.getError)(errors);
|
|
99
|
+
const isUserError = statusCode && statusCode >= 400 && statusCode < 500 ? true : false;
|
|
100
|
+
throw new GraphQLProviderServiceError(isUserError, requestId, errors);
|
|
101
|
+
}
|
|
102
|
+
if (status !== 200) {
|
|
103
|
+
throw new GraphqlError(data, requestId);
|
|
104
|
+
}
|
|
107
105
|
}
|
|
106
|
+
throw error;
|
|
108
107
|
}
|
|
109
108
|
}
|
|
110
109
|
getRequestId(extensions, headers) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/cli-shared",
|
|
3
|
-
"version": "3.16.0-next.
|
|
3
|
+
"version": "3.16.0-next.14",
|
|
4
4
|
"description": "Common functionality for Forge CLI",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"get-folder-size": "^2.0.1",
|
|
31
31
|
"glob": "^7.2.3",
|
|
32
32
|
"graphql": "^15.8.0",
|
|
33
|
-
"graphql-request": "3.
|
|
33
|
+
"graphql-request": "3.7.0",
|
|
34
34
|
"ignore-walk": "^3.0.4",
|
|
35
35
|
"inquirer": "^8.2.5",
|
|
36
36
|
"io-ts": "^2.2.20",
|