@argos-ci/api-client 0.6.0 → 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 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
  };
@@ -698,7 +698,7 @@ declare namespace ArgosAPISchema {
698
698
  /** @description Error response */
699
699
  Error: {
700
700
  error: string;
701
- details: {
701
+ details?: {
702
702
  message: string;
703
703
  }[];
704
704
  };
@@ -1162,7 +1162,7 @@ declare class APIError extends Error {
1162
1162
  */
1163
1163
  declare function throwAPIError(error: {
1164
1164
  error: string;
1165
- details: {
1165
+ details?: {
1166
1166
  message: string;
1167
1167
  }[];
1168
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.map((detail)=>detail.message).join(", ");
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.6.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": "cae12b0cb7d4e9237cf5973d7911af68bc708773"
53
+ "gitHead": "db599c8bc3021cb18315f4e39717f9c2990e7847"
54
54
  }