@argos-ci/api-client 0.11.0 → 0.12.0
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 +26 -2
- package/dist/index.js +13 -7
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -104,6 +104,11 @@ interface components {
|
|
|
104
104
|
name: string;
|
|
105
105
|
baseName?: string | null;
|
|
106
106
|
metadata?: {
|
|
107
|
+
/**
|
|
108
|
+
* @description Ignored. Can be set to get completions, validations and documentation in some editors.
|
|
109
|
+
* @example https://api.argos-ci.com/v2/screenshot-metadata.json
|
|
110
|
+
*/
|
|
111
|
+
$schema?: string;
|
|
107
112
|
/** @description The URL of the page that was screenshotted */
|
|
108
113
|
url?: string | null;
|
|
109
114
|
/** @description An URL to an accessible preview of the screenshot */
|
|
@@ -259,23 +264,42 @@ interface operations {
|
|
|
259
264
|
requestBody?: {
|
|
260
265
|
content: {
|
|
261
266
|
"application/json": {
|
|
267
|
+
/** @description The commit the build is running on */
|
|
262
268
|
commit: components["schemas"]["Sha1Hash"];
|
|
269
|
+
/** @description The branch the build is running on */
|
|
263
270
|
branch: string;
|
|
271
|
+
/** @description Keys of screenshot files */
|
|
264
272
|
screenshotKeys: components["schemas"]["Sha256Hash"][];
|
|
273
|
+
/** @description Keys of Playwright trace files */
|
|
265
274
|
pwTraceKeys?: components["schemas"]["Sha256Hash"][];
|
|
275
|
+
/** @description The name of the build (for multi-build setups) */
|
|
266
276
|
name?: string | null;
|
|
277
|
+
/** @description Whether to run the build in parallel */
|
|
267
278
|
parallel?: boolean | null;
|
|
279
|
+
/** @description A unique nonce for the parallel build */
|
|
268
280
|
parallelNonce?: string | null;
|
|
281
|
+
/** @description The pull request number */
|
|
269
282
|
prNumber?: number | null;
|
|
270
|
-
|
|
271
|
-
|
|
283
|
+
/** @description The head commit of the pull request */
|
|
284
|
+
prHeadCommit?: components["schemas"]["Sha1Hash"] | null;
|
|
285
|
+
/** @description The commit to use as a reference for the build */
|
|
286
|
+
referenceCommit?: components["schemas"]["Sha1Hash"] | null;
|
|
287
|
+
/** @description The branch to use as a reference for the build */
|
|
272
288
|
referenceBranch?: string | null;
|
|
289
|
+
/** @description The parent commits of the build */
|
|
273
290
|
parentCommits?: components["schemas"]["Sha1Hash"][] | null;
|
|
291
|
+
/** @description The mode in which the build is running */
|
|
274
292
|
mode?: ("ci" | "monitoring") | null;
|
|
293
|
+
/** @description The CI provider being used */
|
|
275
294
|
ciProvider?: string | null;
|
|
295
|
+
/** @description The version of the Argos SDK being used */
|
|
276
296
|
argosSdk?: string | null;
|
|
297
|
+
/** @description The ID of the current run */
|
|
277
298
|
runId?: string | null;
|
|
299
|
+
/** @description The attempt number of the current run */
|
|
278
300
|
runAttempt?: number | null;
|
|
301
|
+
/** @description Whether the build was skipped, not comparing anything and always succeeding */
|
|
302
|
+
skipped?: boolean | null;
|
|
279
303
|
};
|
|
280
304
|
};
|
|
281
305
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import createFetchClient from "openapi-fetch";
|
|
3
3
|
|
|
4
|
-
// ../../node_modules/.pnpm/is-network-error@1.
|
|
4
|
+
// ../../node_modules/.pnpm/is-network-error@1.3.0/node_modules/is-network-error/index.js
|
|
5
5
|
var objectToString = Object.prototype.toString;
|
|
6
6
|
var isError = (value) => objectToString.call(value) === "[object Error]";
|
|
7
7
|
var errorMessages = /* @__PURE__ */ new Set([
|
|
@@ -13,24 +13,30 @@ var errorMessages = /* @__PURE__ */ new Set([
|
|
|
13
13
|
// Firefox
|
|
14
14
|
"The Internet connection appears to be offline.",
|
|
15
15
|
// Safari 16
|
|
16
|
-
"Load failed",
|
|
17
|
-
// Safari 17+
|
|
18
16
|
"Network request failed",
|
|
19
17
|
// `cross-fetch`
|
|
20
18
|
"fetch failed",
|
|
21
19
|
// Undici (Node.js)
|
|
22
|
-
"terminated"
|
|
20
|
+
"terminated",
|
|
23
21
|
// Undici (Node.js)
|
|
22
|
+
" A network error occurred.",
|
|
23
|
+
// Bun (WebKit)
|
|
24
|
+
"Network connection lost"
|
|
25
|
+
// Cloudflare Workers (fetch)
|
|
24
26
|
]);
|
|
25
27
|
function isNetworkError(error) {
|
|
26
28
|
const isValid = error && isError(error) && error.name === "TypeError" && typeof error.message === "string";
|
|
27
29
|
if (!isValid) {
|
|
28
30
|
return false;
|
|
29
31
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
const { message, stack } = error;
|
|
33
|
+
if (message === "Load failed") {
|
|
34
|
+
return stack === void 0 || "__sentry_captured__" in error;
|
|
32
35
|
}
|
|
33
|
-
|
|
36
|
+
if (message.startsWith("error sending request for url")) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return errorMessages.has(message);
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
// ../../node_modules/.pnpm/p-retry@7.0.0/node_modules/p-retry/index.js
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argos-ci/api-client",
|
|
3
3
|
"description": "Argos API Client library.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"author": "Smooth Code",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/debug": "^4.1.12",
|
|
47
47
|
"@types/node": "catalog:",
|
|
48
|
-
"openapi-typescript": "^7.
|
|
48
|
+
"openapi-typescript": "^7.9.1",
|
|
49
49
|
"p-retry": "^7.0.0"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"debug": "^4.4.
|
|
53
|
-
"openapi-fetch": "^0.14.
|
|
52
|
+
"debug": "^4.4.3",
|
|
53
|
+
"openapi-fetch": "^0.14.1"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "867a93c5ffc01d55c7385d3ac3903c4c3ab270b6"
|
|
56
56
|
}
|