@argos-ci/api-client 0.5.1 → 0.6.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/dist/index.d.ts +5 -3
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ interface components {
|
|
|
124
124
|
/** @description Error response */
|
|
125
125
|
Error: {
|
|
126
126
|
error: string;
|
|
127
|
-
details
|
|
127
|
+
details?: {
|
|
128
128
|
message: string;
|
|
129
129
|
}[];
|
|
130
130
|
};
|
|
@@ -232,6 +232,7 @@ interface operations {
|
|
|
232
232
|
prHeadCommit?: string | null;
|
|
233
233
|
referenceCommit?: string | null;
|
|
234
234
|
referenceBranch?: string | null;
|
|
235
|
+
parentCommits?: components["schemas"]["Sha1Hash"][] | null;
|
|
235
236
|
/** @enum {string|null} */
|
|
236
237
|
mode?: "ci" | "monitoring" | null;
|
|
237
238
|
ciProvider?: string | null;
|
|
@@ -697,7 +698,7 @@ declare namespace ArgosAPISchema {
|
|
|
697
698
|
/** @description Error response */
|
|
698
699
|
Error: {
|
|
699
700
|
error: string;
|
|
700
|
-
details
|
|
701
|
+
details?: {
|
|
701
702
|
message: string;
|
|
702
703
|
}[];
|
|
703
704
|
};
|
|
@@ -806,6 +807,7 @@ declare namespace ArgosAPISchema {
|
|
|
806
807
|
prHeadCommit?: string | null;
|
|
807
808
|
referenceCommit?: string | null;
|
|
808
809
|
referenceBranch?: string | null;
|
|
810
|
+
parentCommits?: components["schemas"]["Sha1Hash"][] | null;
|
|
809
811
|
/** @enum {string|null} */
|
|
810
812
|
mode?: "ci" | "monitoring" | null;
|
|
811
813
|
ciProvider?: string | null;
|
|
@@ -1160,7 +1162,7 @@ declare class APIError extends Error {
|
|
|
1160
1162
|
*/
|
|
1161
1163
|
declare function throwAPIError(error: {
|
|
1162
1164
|
error: string;
|
|
1163
|
-
details
|
|
1165
|
+
details?: {
|
|
1164
1166
|
message: string;
|
|
1165
1167
|
}[];
|
|
1166
1168
|
}): never;
|
package/dist/index.mjs
CHANGED
|
@@ -28,8 +28,8 @@ class APIError extends Error {
|
|
|
28
28
|
* Handle API errors.
|
|
29
29
|
*/ function throwAPIError(error) {
|
|
30
30
|
debug("API error", error);
|
|
31
|
-
const detailMessage = error.details
|
|
32
|
-
throw new APIError(`${error.error}: ${detailMessage}`);
|
|
31
|
+
const detailMessage = error.details?.map((detail)=>detail.message).join(", ");
|
|
32
|
+
throw new APIError(detailMessage ? `${error.error}: ${detailMessage}` : error.error);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export { APIError, schema as ArgosAPISchema, createClient, throwAPIError };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/api-client",
|
|
3
3
|
"description": "Argos API client.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.6.1",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"debug": "^4.3.6",
|
|
51
51
|
"openapi-fetch": "^0.11.1"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "db599c8bc3021cb18315f4e39717f9c2990e7847"
|
|
54
54
|
}
|