@metriport/shared 0.9.8-alpha.0 → 0.9.8
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/net/error.d.ts +6 -4
- package/dist/net/error.d.ts.map +1 -1
- package/dist/net/error.js +4 -5
- package/dist/net/error.js.map +1 -1
- package/package.json +2 -2
package/dist/net/error.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { AxiosError } from "axios";
|
|
2
1
|
export declare const nodeConnRefusedErrorCodes: string[];
|
|
3
2
|
export type NodeConnRefusedNetworkError = (typeof nodeConnRefusedErrorCodes)[number];
|
|
4
3
|
export declare const nodeTimeoutErrorCodes: string[];
|
|
5
4
|
export type NodeTimeoutNetworkError = (typeof nodeTimeoutErrorCodes)[number];
|
|
6
5
|
export type NodeNetworkError = NodeTimeoutNetworkError | NodeConnRefusedNetworkError;
|
|
7
|
-
export declare const axiosTimeoutErrorCodes:
|
|
8
|
-
export type AxiosTimeoutError = typeof
|
|
6
|
+
export declare const axiosTimeoutErrorCodes: string[];
|
|
7
|
+
export type AxiosTimeoutError = (typeof axiosTimeoutErrorCodes)[number];
|
|
8
|
+
export declare const axiosResponseErrorCodes: string[];
|
|
9
|
+
export type AxiosResponseError = (typeof axiosResponseErrorCodes)[number];
|
|
10
|
+
export type AxiosNetworkError = AxiosTimeoutError | AxiosResponseError;
|
|
9
11
|
export declare const networkTimeoutErrors: string[];
|
|
10
12
|
export type NetworkTimeoutError = (typeof networkTimeoutErrors)[number];
|
|
11
|
-
export type NetworkError = NodeNetworkError |
|
|
13
|
+
export type NetworkError = NodeNetworkError | AxiosNetworkError;
|
|
12
14
|
export declare function getNetworkErrorDetails(error: unknown): {
|
|
13
15
|
details: string;
|
|
14
16
|
code: string | undefined;
|
package/dist/net/error.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/net/error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/net/error.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,yBAAyB,UAAiC,CAAC;AACxE,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,yBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErF,eAAO,MAAM,qBAAqB,UAAgB,CAAC;AACnD,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GAAG,2BAA2B,CAAC;AAIrF,eAAO,MAAM,sBAAsB,UAAkD,CAAC;AACtF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,eAAO,MAAM,uBAAuB,UAAgC,CAAC;AACrE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAIvE,eAAO,MAAM,oBAAoB,UAAwD,CAAC;AAC1F,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAEhE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,CAUA"}
|
package/dist/net/error.js
CHANGED
|
@@ -23,17 +23,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getNetworkErrorDetails = exports.networkTimeoutErrors = exports.axiosTimeoutErrorCodes = exports.nodeTimeoutErrorCodes = exports.nodeConnRefusedErrorCodes = void 0;
|
|
26
|
+
exports.getNetworkErrorDetails = exports.networkTimeoutErrors = exports.axiosResponseErrorCodes = exports.axiosTimeoutErrorCodes = exports.nodeTimeoutErrorCodes = exports.nodeConnRefusedErrorCodes = void 0;
|
|
27
27
|
const axios_1 = __importStar(require("axios"));
|
|
28
28
|
const shared_1 = require("../error/shared");
|
|
29
29
|
// https://nodejs.org/docs/latest-v18.x/api/errors.html#common-system-errors
|
|
30
30
|
exports.nodeConnRefusedErrorCodes = ["ECONNREFUSED", "ECONNRESET"];
|
|
31
31
|
exports.nodeTimeoutErrorCodes = ["ETIMEDOUT"];
|
|
32
32
|
// Axios error codes that are timeout errors
|
|
33
|
-
exports.axiosTimeoutErrorCodes = [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
];
|
|
33
|
+
exports.axiosTimeoutErrorCodes = [axios_1.AxiosError.ECONNABORTED, axios_1.AxiosError.ETIMEDOUT];
|
|
34
|
+
exports.axiosResponseErrorCodes = [axios_1.AxiosError.ERR_BAD_RESPONSE];
|
|
35
|
+
// General Network errors
|
|
37
36
|
exports.networkTimeoutErrors = [...exports.nodeTimeoutErrorCodes, ...exports.axiosTimeoutErrorCodes];
|
|
38
37
|
function getNetworkErrorDetails(error) {
|
|
39
38
|
const details = (0, shared_1.errorToString)(error);
|
package/dist/net/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/net/error.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,4CAAgD;AAEhD,4EAA4E;AAC/D,QAAA,yBAAyB,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAG3D,QAAA,qBAAqB,GAAG,CAAC,WAAW,CAAC,CAAC;AAKnD,4CAA4C;
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/net/error.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA0C;AAC1C,4CAAgD;AAEhD,4EAA4E;AAC/D,QAAA,yBAAyB,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAG3D,QAAA,qBAAqB,GAAG,CAAC,WAAW,CAAC,CAAC;AAKnD,4CAA4C;AAE/B,QAAA,sBAAsB,GAAG,CAAC,kBAAU,CAAC,YAAY,EAAE,kBAAU,CAAC,SAAS,CAAC,CAAC;AAGzE,QAAA,uBAAuB,GAAG,CAAC,kBAAU,CAAC,gBAAgB,CAAC,CAAC;AAKrE,yBAAyB;AAEZ,QAAA,oBAAoB,GAAG,CAAC,GAAG,6BAAqB,EAAE,GAAG,8BAAsB,CAAC,CAAC;AAK1F,SAAgB,sBAAsB,CAAC,KAAc;IAKnD,MAAM,OAAO,GAAG,IAAA,sBAAa,EAAC,KAAK,CAAC,CAAC;IACrC,IAAI,eAAK,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE;QAC7B,OAAO;YACL,OAAO;YACP,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,MAAM,EAAE,KAAK,CAAC,QAAQ,EAAE,MAAM;SAC/B,CAAC;KACH;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;AACzD,CAAC;AAdD,wDAcC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metriport/shared",
|
|
3
|
-
"version": "0.9.8
|
|
3
|
+
"version": "0.9.8",
|
|
4
4
|
"description": "Common code shared across packages - by Metriport Inc.",
|
|
5
5
|
"author": "Metriport Inc. <contact@metriport.com>",
|
|
6
6
|
"homepage": "https://metriport.com/",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@faker-js/faker": "^8.0.2"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "dfddbbe2a55f7deb2793a0031c49b9ab09898596"
|
|
62
62
|
}
|