@argos-ci/api-client 0.11.0 → 0.11.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.js +13 -7
- package/package.json +4 -4
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.11.
|
|
4
|
+
"version": "0.11.1",
|
|
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.
|
|
52
|
+
"debug": "^4.4.3",
|
|
53
53
|
"openapi-fetch": "^0.14.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "00f28041a847158e437aaab5fc9e816f6b609021"
|
|
56
56
|
}
|