@devrev/airsync-sdk 2.0.0-beta.1 → 2.0.0-beta.11
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/README.md +7 -21
- package/dist/attachments-streaming/attachments-streaming-pool.d.ts +6 -7
- package/dist/attachments-streaming/attachments-streaming-pool.d.ts.map +1 -1
- package/dist/attachments-streaming/attachments-streaming-pool.interfaces.d.ts +4 -3
- package/dist/attachments-streaming/attachments-streaming-pool.interfaces.d.ts.map +1 -1
- package/dist/attachments-streaming/attachments-streaming-pool.js +69 -61
- package/dist/common/constants.d.ts +15 -12
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +20 -34
- package/dist/common/helpers.d.ts +3 -27
- package/dist/common/helpers.d.ts.map +1 -1
- package/dist/common/helpers.js +6 -36
- package/dist/http/client.d.ts +4 -0
- package/dist/http/client.d.ts.map +1 -0
- package/dist/http/client.js +80 -0
- package/dist/http/errors.d.ts +8 -0
- package/dist/http/errors.d.ts.map +1 -0
- package/dist/http/errors.js +31 -0
- package/dist/index.d.ts +30 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +47 -28
- package/dist/logger/logger.d.ts +13 -70
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.interfaces.d.ts +4 -7
- package/dist/logger/logger.interfaces.d.ts.map +1 -1
- package/dist/logger/logger.js +67 -92
- package/dist/mappers/mappers.d.ts +10 -43
- package/dist/mappers/mappers.d.ts.map +1 -1
- package/dist/mappers/mappers.interfaces.d.ts +173 -0
- package/dist/mappers/mappers.interfaces.d.ts.map +1 -0
- package/dist/mappers/{mappers.interface.js → mappers.interfaces.js} +1 -10
- package/dist/mappers/mappers.js +32 -46
- package/dist/multithreading/adapters/base-adapter.d.ts +39 -0
- package/dist/multithreading/adapters/base-adapter.d.ts.map +1 -0
- package/dist/multithreading/adapters/base-adapter.js +212 -0
- package/dist/multithreading/adapters/extraction-adapter.d.ts +49 -0
- package/dist/multithreading/adapters/extraction-adapter.d.ts.map +1 -0
- package/dist/multithreading/adapters/extraction-adapter.js +375 -0
- package/dist/multithreading/adapters/loading-adapter.d.ts +26 -0
- package/dist/multithreading/adapters/loading-adapter.d.ts.map +1 -0
- package/dist/multithreading/adapters/loading-adapter.helpers.d.ts +12 -0
- package/dist/multithreading/adapters/loading-adapter.helpers.d.ts.map +1 -0
- package/dist/multithreading/{worker-adapter/worker-adapter.helpers.js → adapters/loading-adapter.helpers.js} +2 -12
- package/dist/multithreading/adapters/loading-adapter.js +279 -0
- package/dist/multithreading/emit.d.ts +11 -0
- package/dist/multithreading/emit.d.ts.map +1 -0
- package/dist/multithreading/emit.js +25 -0
- package/dist/multithreading/process-task.d.ts +6 -1
- package/dist/multithreading/process-task.d.ts.map +1 -1
- package/dist/multithreading/process-task.js +120 -82
- package/dist/multithreading/spawn/spawn.d.ts +10 -11
- package/dist/multithreading/spawn/spawn.d.ts.map +1 -1
- package/dist/multithreading/spawn/spawn.helpers.d.ts +12 -11
- package/dist/multithreading/spawn/spawn.helpers.d.ts.map +1 -1
- package/dist/multithreading/spawn/spawn.helpers.js +142 -77
- package/dist/multithreading/spawn/spawn.js +59 -75
- package/dist/multithreading/worker.js +16 -5
- package/dist/repo/repo.d.ts +14 -5
- package/dist/repo/repo.d.ts.map +1 -1
- package/dist/repo/repo.helpers.d.ts +6 -0
- package/dist/repo/repo.helpers.d.ts.map +1 -0
- package/dist/repo/repo.helpers.js +16 -0
- package/dist/repo/repo.interfaces.d.ts +11 -20
- package/dist/repo/repo.interfaces.d.ts.map +1 -1
- package/dist/repo/repo.js +36 -22
- package/dist/state/base-state.d.ts +58 -0
- package/dist/state/base-state.d.ts.map +1 -0
- package/dist/state/base-state.js +242 -0
- package/dist/state/extraction-state.d.ts +14 -0
- package/dist/state/extraction-state.d.ts.map +1 -0
- package/dist/state/extraction-state.js +146 -0
- package/dist/state/install-initial-domain-mapping.d.ts +4 -0
- package/dist/state/install-initial-domain-mapping.d.ts.map +1 -0
- package/dist/{common → state}/install-initial-domain-mapping.js +5 -7
- package/dist/state/loading-state.d.ts +8 -0
- package/dist/state/loading-state.d.ts.map +1 -0
- package/dist/state/loading-state.js +29 -0
- package/dist/state/state.d.ts +3 -29
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.interfaces.d.ts +31 -12
- package/dist/state/state.interfaces.d.ts.map +1 -1
- package/dist/state/state.interfaces.js +17 -1
- package/dist/state/state.js +9 -164
- package/dist/state/time-value-resolver.d.ts +17 -0
- package/dist/state/time-value-resolver.d.ts.map +1 -0
- package/dist/state/time-value-resolver.js +110 -0
- package/dist/testing/mock-event.d.ts +10 -0
- package/dist/testing/mock-event.d.ts.map +1 -0
- package/dist/testing/mock-event.js +96 -0
- package/dist/testing/mock-server.d.ts +31 -0
- package/dist/testing/mock-server.d.ts.map +1 -0
- package/dist/testing/mock-server.interfaces.d.ts +54 -0
- package/dist/testing/mock-server.interfaces.d.ts.map +1 -0
- package/dist/testing/mock-server.interfaces.js +4 -0
- package/dist/testing/mock-server.js +297 -0
- package/dist/testing/test-adapters.d.ts +22 -0
- package/dist/testing/test-adapters.d.ts.map +1 -0
- package/dist/testing/test-adapters.js +32 -0
- package/dist/types/common.d.ts +4 -37
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +2 -17
- package/dist/types/errors.d.ts +15 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +28 -0
- package/dist/types/external-domain-metadata.d.ts +40 -162
- package/dist/types/external-domain-metadata.d.ts.map +1 -1
- package/dist/types/extraction.d.ts +135 -278
- package/dist/types/extraction.d.ts.map +1 -1
- package/dist/types/extraction.js +46 -133
- package/dist/types/loading.d.ts +15 -55
- package/dist/types/loading.d.ts.map +1 -1
- package/dist/types/loading.js +1 -23
- package/dist/types/workers.d.ts +70 -103
- package/dist/types/workers.d.ts.map +1 -1
- package/dist/types/workers.js +1 -6
- package/dist/uploader/uploader.d.ts +10 -61
- package/dist/uploader/uploader.d.ts.map +1 -1
- package/dist/uploader/uploader.helpers.d.ts +7 -27
- package/dist/uploader/uploader.helpers.d.ts.map +1 -1
- package/dist/uploader/uploader.helpers.js +80 -30
- package/dist/uploader/uploader.interfaces.d.ts +19 -54
- package/dist/uploader/uploader.interfaces.d.ts.map +1 -1
- package/dist/uploader/uploader.interfaces.js +8 -0
- package/dist/uploader/uploader.js +72 -124
- package/docs/MIGRATION.md +751 -0
- package/package.json +35 -22
- package/dist/attachments-streaming/attachments-streaming-pool.test.d.ts +0 -2
- package/dist/attachments-streaming/attachments-streaming-pool.test.d.ts.map +0 -1
- package/dist/attachments-streaming/attachments-streaming-pool.test.js +0 -321
- package/dist/common/control-protocol.d.ts +0 -10
- package/dist/common/control-protocol.d.ts.map +0 -1
- package/dist/common/control-protocol.js +0 -31
- package/dist/common/errors.d.ts +0 -6
- package/dist/common/errors.d.ts.map +0 -1
- package/dist/common/errors.js +0 -4
- package/dist/common/event-type-translation.d.ts +0 -24
- package/dist/common/event-type-translation.d.ts.map +0 -1
- package/dist/common/event-type-translation.js +0 -117
- package/dist/common/install-initial-domain-mapping.d.ts +0 -4
- package/dist/common/install-initial-domain-mapping.d.ts.map +0 -1
- package/dist/common/install-initial-domain-mapping.test.d.ts +0 -2
- package/dist/common/install-initial-domain-mapping.test.d.ts.map +0 -1
- package/dist/common/install-initial-domain-mapping.test.js +0 -208
- package/dist/deprecated/adapter/index.d.ts +0 -62
- package/dist/deprecated/adapter/index.d.ts.map +0 -1
- package/dist/deprecated/adapter/index.js +0 -151
- package/dist/deprecated/common/helpers.d.ts +0 -7
- package/dist/deprecated/common/helpers.d.ts.map +0 -1
- package/dist/deprecated/common/helpers.js +0 -47
- package/dist/deprecated/demo-extractor/external_domain_metadata.json +0 -38
- package/dist/deprecated/demo-extractor/index.d.ts +0 -18
- package/dist/deprecated/demo-extractor/index.d.ts.map +0 -1
- package/dist/deprecated/demo-extractor/index.js +0 -161
- package/dist/deprecated/http/client.d.ts +0 -22
- package/dist/deprecated/http/client.d.ts.map +0 -1
- package/dist/deprecated/http/client.js +0 -161
- package/dist/deprecated/uploader/index.d.ts +0 -35
- package/dist/deprecated/uploader/index.d.ts.map +0 -1
- package/dist/deprecated/uploader/index.js +0 -161
- package/dist/http/axios-client-internal.d.ts +0 -3
- package/dist/http/axios-client-internal.d.ts.map +0 -1
- package/dist/http/axios-client-internal.js +0 -66
- package/dist/http/axios-client-internal.test.d.ts +0 -2
- package/dist/http/axios-client-internal.test.d.ts.map +0 -1
- package/dist/http/axios-client-internal.test.js +0 -154
- package/dist/http/axios-client.d.ts +0 -27
- package/dist/http/axios-client.d.ts.map +0 -1
- package/dist/http/axios-client.js +0 -57
- package/dist/http/constants.d.ts +0 -4
- package/dist/http/constants.d.ts.map +0 -1
- package/dist/http/constants.js +0 -6
- package/dist/http/index.d.ts +0 -3
- package/dist/http/index.d.ts.map +0 -1
- package/dist/http/index.js +0 -18
- package/dist/http/types.d.ts +0 -17
- package/dist/http/types.d.ts.map +0 -1
- package/dist/http/types.js +0 -2
- package/dist/logger/logger.constants.d.ts +0 -6
- package/dist/logger/logger.constants.d.ts.map +0 -1
- package/dist/logger/logger.constants.js +0 -13
- package/dist/logger/logger.context.d.ts +0 -58
- package/dist/logger/logger.context.d.ts.map +0 -1
- package/dist/logger/logger.context.js +0 -86
- package/dist/logger/logger.test.d.ts +0 -2
- package/dist/logger/logger.test.d.ts.map +0 -1
- package/dist/logger/logger.test.js +0 -490
- package/dist/mappers/mappers.interface.d.ts +0 -294
- package/dist/mappers/mappers.interface.d.ts.map +0 -1
- package/dist/mappers/mappers.test.d.ts +0 -2
- package/dist/mappers/mappers.test.d.ts.map +0 -1
- package/dist/mappers/mappers.test.js +0 -107
- package/dist/multithreading/create-worker.test.d.ts +0 -2
- package/dist/multithreading/create-worker.test.d.ts.map +0 -1
- package/dist/multithreading/create-worker.test.js +0 -89
- package/dist/multithreading/spawn/spawn.helpers.test.d.ts +0 -2
- package/dist/multithreading/spawn/spawn.helpers.test.d.ts.map +0 -1
- package/dist/multithreading/spawn/spawn.helpers.test.js +0 -293
- package/dist/multithreading/worker-adapter/worker-adapter.artifacts.test.d.ts +0 -2
- package/dist/multithreading/worker-adapter/worker-adapter.artifacts.test.d.ts.map +0 -1
- package/dist/multithreading/worker-adapter/worker-adapter.artifacts.test.js +0 -127
- package/dist/multithreading/worker-adapter/worker-adapter.d.ts +0 -91
- package/dist/multithreading/worker-adapter/worker-adapter.d.ts.map +0 -1
- package/dist/multithreading/worker-adapter/worker-adapter.helpers.d.ts +0 -22
- package/dist/multithreading/worker-adapter/worker-adapter.helpers.d.ts.map +0 -1
- package/dist/multithreading/worker-adapter/worker-adapter.helpers.test.d.ts +0 -2
- package/dist/multithreading/worker-adapter/worker-adapter.helpers.test.d.ts.map +0 -1
- package/dist/multithreading/worker-adapter/worker-adapter.helpers.test.js +0 -514
- package/dist/multithreading/worker-adapter/worker-adapter.js +0 -745
- package/dist/multithreading/worker-adapter/worker-adapter.test.d.ts +0 -2
- package/dist/multithreading/worker-adapter/worker-adapter.test.d.ts.map +0 -1
- package/dist/multithreading/worker-adapter/worker-adapter.test.js +0 -483
- package/dist/repo/repo.test.d.ts +0 -2
- package/dist/repo/repo.test.d.ts.map +0 -1
- package/dist/repo/repo.test.js +0 -131
- package/dist/state/state.test.d.ts +0 -2
- package/dist/state/state.test.d.ts.map +0 -1
- package/dist/state/state.test.js +0 -224
- package/dist/types/extraction.test.d.ts +0 -2
- package/dist/types/extraction.test.d.ts.map +0 -1
- package/dist/types/extraction.test.js +0 -70
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -18
- package/dist/uploader/uploader.helpers.test.d.ts +0 -2
- package/dist/uploader/uploader.helpers.test.d.ts.map +0 -1
- package/dist/uploader/uploader.helpers.test.js +0 -267
- package/dist/uploader/uploader.test.d.ts +0 -2
- package/dist/uploader/uploader.test.d.ts.map +0 -1
- package/dist/uploader/uploader.test.js +0 -589
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.axiosClient = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const axios_retry_1 = __importDefault(require("axios-retry"));
|
|
9
|
+
function createAxiosClient() {
|
|
10
|
+
const client = axios_1.default.create({
|
|
11
|
+
timeout: 30 * 1000,
|
|
12
|
+
});
|
|
13
|
+
(0, axios_retry_1.default)(client, {
|
|
14
|
+
retries: 5,
|
|
15
|
+
shouldResetTimeout: true,
|
|
16
|
+
retryDelay: (retryCount, error) => {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
18
|
+
let delay;
|
|
19
|
+
if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 429) {
|
|
20
|
+
const retryAfter = ((_c = (_b = error.response) === null || _b === void 0 ? void 0 : _b.headers) === null || _c === void 0 ? void 0 : _c['retry-after']) ||
|
|
21
|
+
((_e = (_d = error.response) === null || _d === void 0 ? void 0 : _d.headers) === null || _e === void 0 ? void 0 : _e['Retry-After']);
|
|
22
|
+
delay = parseInt(retryAfter, 10) * 1000;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
delay = axios_retry_1.default.exponentialDelay(retryCount, error, 1000);
|
|
26
|
+
}
|
|
27
|
+
const requestId = ((_g = (_f = error.config) === null || _f === void 0 ? void 0 : _f.headers) === null || _g === void 0 ? void 0 : _g['x-request-id']) ||
|
|
28
|
+
((_j = (_h = error.config) === null || _h === void 0 ? void 0 : _h.headers) === null || _j === void 0 ? void 0 : _j['X-Request-ID']);
|
|
29
|
+
const delayInSeconds = Math.round(delay / 1000);
|
|
30
|
+
console.warn(`Retrying request to ${(_k = error.config) === null || _k === void 0 ? void 0 : _k.url} in ${delayInSeconds}s due to ${(_m = (_l = error.response) === null || _l === void 0 ? void 0 : _l.status) !== null && _m !== void 0 ? _m : 'unknown'} error.`, Object.assign(Object.assign({ method: (_o = error.config) === null || _o === void 0 ? void 0 : _o.method }, (retryCount && { retryCount })), (requestId && { requestId })));
|
|
31
|
+
return delay;
|
|
32
|
+
},
|
|
33
|
+
retryCondition: (error) => {
|
|
34
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
35
|
+
const retryAfter = ((_b = (_a = error.response) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b['retry-after']) ||
|
|
36
|
+
((_d = (_c = error.response) === null || _c === void 0 ? void 0 : _c.headers) === null || _d === void 0 ? void 0 : _d['Retry-After']);
|
|
37
|
+
if (((_e = error.response) === null || _e === void 0 ? void 0 : _e.status) && error.response.status >= 500) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
// 429 only when a valid non-negative Retry-After header is present
|
|
41
|
+
else if (((_f = error.response) === null || _f === void 0 ? void 0 : _f.status) &&
|
|
42
|
+
error.response.status === 429 &&
|
|
43
|
+
retryAfter &&
|
|
44
|
+
!isNaN(Number(retryAfter)) &&
|
|
45
|
+
Number(retryAfter) >= 0) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
// Network errors for idempotent requests; 429 already handled above
|
|
49
|
+
else if (axios_retry_1.default.isNetworkOrIdempotentRequestError(error) &&
|
|
50
|
+
((_g = error.response) === null || _g === void 0 ? void 0 : _g.status) !== 429) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
// axios-retry excludes ECONNABORTED (client-side timeout only, never a
|
|
54
|
+
// server response) from isNetworkError, so handle it here separately.
|
|
55
|
+
else if (error.code === 'ECONNABORTED') {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
onMaxRetryTimesExceeded(error) {
|
|
63
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64
|
+
(_b = (_a = error.config) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? true : delete _b.authorization;
|
|
65
|
+
(_d = (_c = error.config) === null || _c === void 0 ? void 0 : _c.headers) === null || _d === void 0 ? true : delete _d.Authorization;
|
|
66
|
+
(_e = error.request) === null || _e === void 0 ? true : delete _e._header;
|
|
67
|
+
console.error(`Request to ${(_f = error.config) === null || _f === void 0 ? void 0 : _f.url} failed after max retries. Error`, error);
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
return client;
|
|
71
|
+
}
|
|
72
|
+
let instance;
|
|
73
|
+
const getInstance = () => (instance !== null && instance !== void 0 ? instance : (instance = createAxiosClient()));
|
|
74
|
+
// Created on first use so that loading the SDK never calls axios.create(),
|
|
75
|
+
// which breaks connector tests that mock axios.
|
|
76
|
+
const axiosClient = {
|
|
77
|
+
get: async (...args) => getInstance().get(...args),
|
|
78
|
+
post: async (...args) => getInstance().post(...args),
|
|
79
|
+
};
|
|
80
|
+
exports.axiosClient = axiosClient;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Rejection for failed SDK calls to the DevRev platform. */
|
|
2
|
+
export declare class AirSyncHttpError extends Error {
|
|
3
|
+
readonly status?: number;
|
|
4
|
+
constructor(message: string, status?: number);
|
|
5
|
+
}
|
|
6
|
+
export declare function toAirSyncHttpError(error: unknown): AirSyncHttpError;
|
|
7
|
+
export declare function isNotFound(error: unknown): boolean;
|
|
8
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/http/errors.ts"],"names":[],"mappings":"AAEA,6DAA6D;AAC7D,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;gBAEb,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM;CAK7C;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,gBAAgB,CAgBnE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAElD"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AirSyncHttpError = void 0;
|
|
7
|
+
exports.toAirSyncHttpError = toAirSyncHttpError;
|
|
8
|
+
exports.isNotFound = isNotFound;
|
|
9
|
+
const axios_1 = __importDefault(require("axios"));
|
|
10
|
+
/** Rejection for failed SDK calls to the DevRev platform. */
|
|
11
|
+
class AirSyncHttpError extends Error {
|
|
12
|
+
constructor(message, status) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = 'AirSyncHttpError';
|
|
15
|
+
this.status = status;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.AirSyncHttpError = AirSyncHttpError;
|
|
19
|
+
function toAirSyncHttpError(error) {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f;
|
|
21
|
+
if (axios_1.default.isAxiosError(error)) {
|
|
22
|
+
const status = (_a = error.response) === null || _a === void 0 ? void 0 : _a.status;
|
|
23
|
+
const target = `${(_d = (_c = (_b = error.config) === null || _b === void 0 ? void 0 : _b.method) === null || _c === void 0 ? void 0 : _c.toUpperCase()) !== null && _d !== void 0 ? _d : 'REQUEST'} ${(_f = (_e = error.config) === null || _e === void 0 ? void 0 : _e.url) !== null && _f !== void 0 ? _f : ''}`.trim();
|
|
24
|
+
return new AirSyncHttpError(`${target} failed${status ? ` with status ${status}` : ''}: ${error.message}`, status);
|
|
25
|
+
}
|
|
26
|
+
return new AirSyncHttpError(error instanceof Error ? error.message : String(error));
|
|
27
|
+
}
|
|
28
|
+
function isNotFound(error) {
|
|
29
|
+
var _a;
|
|
30
|
+
return axios_1.default.isAxiosError(error) && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) === 404;
|
|
31
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,32 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export * from './http';
|
|
6
|
-
export * from './types';
|
|
7
|
-
export * from './common/install-initial-domain-mapping';
|
|
8
|
-
export { ExtractionCommonError } from './common/errors';
|
|
9
|
-
export { processTask } from './multithreading/process-task';
|
|
1
|
+
export type { BaseAdapter } from './multithreading/adapters/base-adapter';
|
|
2
|
+
export type { ExtractionAdapter } from './multithreading/adapters/extraction-adapter';
|
|
3
|
+
export type { LoadingAdapter } from './multithreading/adapters/loading-adapter';
|
|
4
|
+
export { processExtractionTask, processLoadingTask, } from './multithreading/process-task';
|
|
10
5
|
export { spawn } from './multithreading/spawn/spawn';
|
|
11
|
-
export {
|
|
12
|
-
export
|
|
13
|
-
export {
|
|
6
|
+
export type { Repo } from './repo/repo';
|
|
7
|
+
export type { ExtractionScope, ProcessTaskInterface, RepoOptions, SpawnFactoryInterface, SpawnOptions, TaskAdapterInterface, TaskResult, TaskStatus, WorkerPathOverrides, } from './types/workers';
|
|
8
|
+
export { AirSyncDefaultItemTypes, UNBOUNDED_DATE_TIME_VALUE, } from './common/constants';
|
|
9
|
+
export { AirSyncErrorCode } from './types/errors';
|
|
10
|
+
export { installInitialDomainMapping } from './state/install-initial-domain-mapping';
|
|
11
|
+
export { AirSyncHttpError } from './http/errors';
|
|
12
|
+
export { serializeError } from './logger/logger';
|
|
13
|
+
export type { ErrorRecord, InitialDomainMapping } from './types/common';
|
|
14
|
+
export { SyncMode } from './types/common';
|
|
15
|
+
export type { AirSyncEvent, AirSyncMessage, ConnectionData, EventContext, EventData, ExternalProcessAttachmentFunction, ExternalSyncUnit, ExternalSystemAttachmentIteratorFunction, ExternalSystemAttachmentProcessors, ExternalSystemAttachmentReducerFunction, ExternalSystemAttachmentStreamingFunction, ExternalSystemAttachmentStreamingParams, ExternalSystemAttachmentStreamingResponse, ExtractorEvent, HttpStreamResponse, InputData, ItemTypeCount, ProcessAttachmentReturnType, TimeValue, WorkerMetadata, } from './types/extraction';
|
|
16
|
+
export { EventType, InitialSyncScope, ItemInputType, TimeUnit, TimeValueType, } from './types/extraction';
|
|
17
|
+
export type { ExternalSystemAttachment, ExternalSystemItem, ExternalSystemItemLoadingParams, ExternalSystemItemLoadingResponse, ExternalSystemLoadingFunction, FileToLoad, ItemTypesToLoadParams, ItemTypeToLoad, LoaderReport, } from './types/loading';
|
|
18
|
+
export { ActionType } from './types/loading';
|
|
19
|
+
export type { Item, NormalizedAttachment, NormalizedItem, RepoInterface, } from './repo/repo.interfaces';
|
|
20
|
+
export { Mappers } from './mappers/mappers';
|
|
21
|
+
export type { MappersCreateParams, MappersCreateResponse, MappersFactoryInterface, MappersGetByExternalIdParams, MappersGetByExternalIdResponse, MappersGetByTargetIdParams, MappersGetByTargetIdResponse, MappersUpdateParams, MappersUpdateResponse, SyncMapperRecord, SyncMapperRecordExternalVersion, UpdateSyncMapperRecordParams, } from './mappers/mappers.interfaces';
|
|
22
|
+
export { SyncMapperRecordStatus, SyncMapperRecordTargetType, } from './mappers/mappers.interfaces';
|
|
23
|
+
export type { Artifact, SsorAttachment, UploadResponse, } from './uploader/uploader.interfaces';
|
|
24
|
+
export { ArtifactDateField } from './uploader/uploader.interfaces';
|
|
25
|
+
export type { Attachments, CollectionData, ConditionalPrivilegeData, CustomLinkData, CustomLinkNames, CustomStage, CustomState, EnumData, EnumValue, EnumValueKey, ExternalDomainMetadata, Field, FieldCondition, FieldConditionComparator, FieldConditionEffect, FieldConditions, FieldKey, FieldPrivilegeData, FieldReferenceData, FieldType, FloatData, IntData, ParticipationData, PermissionData, RecordType, RecordTypeCategory, RecordTypeCategoryKey, RecordTypeKey, RecordTypePrivilegeData, RecordTypeScope, ReferenceData, ReferenceDetail, ReferenceType, SchemaVersion, StageDiagram, StageKey, StateKey, StructData, StructType, StructTypeKey, TargetTypeKeyData, TextData, TypedReferenceData, } from './types/external-domain-metadata';
|
|
26
|
+
export type { DeepPartial } from './testing/mock-event';
|
|
27
|
+
export { createMockEvent } from './testing/mock-event';
|
|
28
|
+
export { MOCK_SERVER_DEFAULT_URL, MockServer } from './testing/mock-server';
|
|
29
|
+
export type { RequestInfo, RetryConfig, RouteConfig, } from './testing/mock-server.interfaces';
|
|
30
|
+
export type { TestAdapterParams, TestLoadingAdapterParams, } from './testing/test-adapters';
|
|
31
|
+
export { createTestExtractionAdapter, createTestLoadingAdapter, } from './testing/test-adapters';
|
|
14
32
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1,34 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
2
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
3
|
+
// Public API barrel for @devrev/airsync-sdk. Single source of the public
|
|
4
|
+
// surface: every export is named explicitly (no `export *`), so any public API
|
|
5
|
+
// change shows up as a diff here.
|
|
6
|
+
// ────────────────────────────────────────────────────────────────────────────
|
|
16
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
__exportStar(require("./deprecated/adapter"), exports);
|
|
19
|
-
__exportStar(require("./deprecated/demo-extractor"), exports);
|
|
20
|
-
__exportStar(require("./deprecated/http/client"), exports);
|
|
21
|
-
__exportStar(require("./deprecated/uploader"), exports);
|
|
22
|
-
__exportStar(require("./http"), exports);
|
|
23
|
-
__exportStar(require("./types"), exports);
|
|
24
|
-
__exportStar(require("./common/install-initial-domain-mapping"), exports);
|
|
8
|
+
exports.createTestLoadingAdapter = exports.createTestExtractionAdapter = exports.MockServer = exports.MOCK_SERVER_DEFAULT_URL = exports.createMockEvent = exports.ArtifactDateField = exports.SyncMapperRecordTargetType = exports.SyncMapperRecordStatus = exports.Mappers = exports.ActionType = exports.TimeValueType = exports.TimeUnit = exports.ItemInputType = exports.InitialSyncScope = exports.EventType = exports.SyncMode = exports.serializeError = exports.AirSyncHttpError = exports.installInitialDomainMapping = exports.AirSyncErrorCode = exports.UNBOUNDED_DATE_TIME_VALUE = exports.AirSyncDefaultItemTypes = exports.spawn = exports.processLoadingTask = exports.processExtractionTask = void 0;
|
|
25
9
|
var process_task_1 = require("./multithreading/process-task");
|
|
26
|
-
Object.defineProperty(exports, "
|
|
10
|
+
Object.defineProperty(exports, "processExtractionTask", { enumerable: true, get: function () { return process_task_1.processExtractionTask; } });
|
|
11
|
+
Object.defineProperty(exports, "processLoadingTask", { enumerable: true, get: function () { return process_task_1.processLoadingTask; } });
|
|
27
12
|
var spawn_1 = require("./multithreading/spawn/spawn");
|
|
28
13
|
Object.defineProperty(exports, "spawn", { enumerable: true, get: function () { return spawn_1.spawn; } });
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
// ── Constants & enums ──
|
|
15
|
+
var constants_1 = require("./common/constants");
|
|
16
|
+
Object.defineProperty(exports, "AirSyncDefaultItemTypes", { enumerable: true, get: function () { return constants_1.AirSyncDefaultItemTypes; } });
|
|
17
|
+
Object.defineProperty(exports, "UNBOUNDED_DATE_TIME_VALUE", { enumerable: true, get: function () { return constants_1.UNBOUNDED_DATE_TIME_VALUE; } });
|
|
18
|
+
var errors_1 = require("./types/errors");
|
|
19
|
+
Object.defineProperty(exports, "AirSyncErrorCode", { enumerable: true, get: function () { return errors_1.AirSyncErrorCode; } });
|
|
20
|
+
// ── Domain mapping install ──
|
|
21
|
+
var install_initial_domain_mapping_1 = require("./state/install-initial-domain-mapping");
|
|
22
|
+
Object.defineProperty(exports, "installInitialDomainMapping", { enumerable: true, get: function () { return install_initial_domain_mapping_1.installInitialDomainMapping; } });
|
|
23
|
+
// ── Errors ──
|
|
24
|
+
var errors_2 = require("./http/errors");
|
|
25
|
+
Object.defineProperty(exports, "AirSyncHttpError", { enumerable: true, get: function () { return errors_2.AirSyncHttpError; } });
|
|
32
26
|
var logger_1 = require("./logger/logger");
|
|
33
|
-
Object.defineProperty(exports, "
|
|
34
|
-
|
|
27
|
+
Object.defineProperty(exports, "serializeError", { enumerable: true, get: function () { return logger_1.serializeError; } });
|
|
28
|
+
var common_1 = require("./types/common");
|
|
29
|
+
Object.defineProperty(exports, "SyncMode", { enumerable: true, get: function () { return common_1.SyncMode; } });
|
|
30
|
+
var extraction_1 = require("./types/extraction");
|
|
31
|
+
Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return extraction_1.EventType; } });
|
|
32
|
+
Object.defineProperty(exports, "InitialSyncScope", { enumerable: true, get: function () { return extraction_1.InitialSyncScope; } });
|
|
33
|
+
Object.defineProperty(exports, "ItemInputType", { enumerable: true, get: function () { return extraction_1.ItemInputType; } });
|
|
34
|
+
Object.defineProperty(exports, "TimeUnit", { enumerable: true, get: function () { return extraction_1.TimeUnit; } });
|
|
35
|
+
Object.defineProperty(exports, "TimeValueType", { enumerable: true, get: function () { return extraction_1.TimeValueType; } });
|
|
36
|
+
var loading_1 = require("./types/loading");
|
|
37
|
+
Object.defineProperty(exports, "ActionType", { enumerable: true, get: function () { return loading_1.ActionType; } });
|
|
38
|
+
// ── Mappers ──
|
|
39
|
+
var mappers_1 = require("./mappers/mappers");
|
|
40
|
+
Object.defineProperty(exports, "Mappers", { enumerable: true, get: function () { return mappers_1.Mappers; } });
|
|
41
|
+
var mappers_interfaces_1 = require("./mappers/mappers.interfaces");
|
|
42
|
+
Object.defineProperty(exports, "SyncMapperRecordStatus", { enumerable: true, get: function () { return mappers_interfaces_1.SyncMapperRecordStatus; } });
|
|
43
|
+
Object.defineProperty(exports, "SyncMapperRecordTargetType", { enumerable: true, get: function () { return mappers_interfaces_1.SyncMapperRecordTargetType; } });
|
|
44
|
+
var uploader_interfaces_1 = require("./uploader/uploader.interfaces");
|
|
45
|
+
Object.defineProperty(exports, "ArtifactDateField", { enumerable: true, get: function () { return uploader_interfaces_1.ArtifactDateField; } });
|
|
46
|
+
var mock_event_1 = require("./testing/mock-event");
|
|
47
|
+
Object.defineProperty(exports, "createMockEvent", { enumerable: true, get: function () { return mock_event_1.createMockEvent; } });
|
|
48
|
+
var mock_server_1 = require("./testing/mock-server");
|
|
49
|
+
Object.defineProperty(exports, "MOCK_SERVER_DEFAULT_URL", { enumerable: true, get: function () { return mock_server_1.MOCK_SERVER_DEFAULT_URL; } });
|
|
50
|
+
Object.defineProperty(exports, "MockServer", { enumerable: true, get: function () { return mock_server_1.MockServer; } });
|
|
51
|
+
var test_adapters_1 = require("./testing/test-adapters");
|
|
52
|
+
Object.defineProperty(exports, "createTestExtractionAdapter", { enumerable: true, get: function () { return test_adapters_1.createTestExtractionAdapter; } });
|
|
53
|
+
Object.defineProperty(exports, "createTestLoadingAdapter", { enumerable: true, get: function () { return test_adapters_1.createTestLoadingAdapter; } });
|
package/dist/logger/logger.d.ts
CHANGED
|
@@ -1,89 +1,32 @@
|
|
|
1
|
-
import { AxiosError } from 'axios';
|
|
2
1
|
import { Console } from 'node:console';
|
|
2
|
+
import { InspectOptions } from 'node:util';
|
|
3
|
+
import { AxiosError } from 'axios';
|
|
3
4
|
import { AxiosErrorResponse, LoggerFactoryInterface, LogLevel, PrintableState } from './logger.interfaces';
|
|
5
|
+
export declare const MAX_LOG_STRING_LENGTH = 10000;
|
|
6
|
+
export declare const INSPECT_OPTIONS: InspectOptions;
|
|
7
|
+
export declare function truncateMessage(message: string): string;
|
|
4
8
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
9
|
+
* Console replacement that tags every log line with the event context. Worker
|
|
10
|
+
* threads forward log lines to the main thread, because the snap-in platform
|
|
11
|
+
* only captures logs written through the main thread's console.
|
|
7
12
|
*/
|
|
8
13
|
export declare class Logger extends Console {
|
|
9
14
|
private originalConsole;
|
|
10
15
|
private options?;
|
|
11
16
|
private tags;
|
|
12
17
|
constructor({ event, options }: LoggerFactoryInterface);
|
|
13
|
-
/**
|
|
14
|
-
* Converts any value to a string using `util.inspect()` for complex types.
|
|
15
|
-
*
|
|
16
|
-
* @param value - The value to convert
|
|
17
|
-
* @returns String representation of the value
|
|
18
|
-
*/
|
|
19
18
|
private valueToString;
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
* Adds a suffix indicating how many characters were omitted.
|
|
23
|
-
*
|
|
24
|
-
* @param message - The message to truncate
|
|
25
|
-
* @returns Truncated message or original if within limits
|
|
26
|
-
*/
|
|
27
|
-
private truncateMessage;
|
|
28
|
-
/**
|
|
29
|
-
* Logs a pre-formatted message string to the console.
|
|
30
|
-
* In production mode, wraps the message with JSON formatting and event context tags.
|
|
31
|
-
* In local development mode, logs the message directly without JSON wrapping.
|
|
32
|
-
* This is useful when you need to log already-stringified content.
|
|
33
|
-
*
|
|
34
|
-
* @param message - The pre-formatted message string to log
|
|
35
|
-
* @param level - Log level (info, warn, error)
|
|
36
|
-
* @param isSdkLog - Flag indicating if the log originated from the SDK
|
|
37
|
-
*/
|
|
38
|
-
logFn(message: string, level: LogLevel, isSdkLog?: boolean): void;
|
|
39
|
-
/**
|
|
40
|
-
* Stringifies and logs arguments to the appropriate destination.
|
|
41
|
-
* On main thread, converts arguments to strings and calls logFn.
|
|
42
|
-
* In worker threads, forwards stringified arguments to the main thread for processing.
|
|
43
|
-
* All arguments are converted to strings using util.inspect and joined with spaces.
|
|
44
|
-
*
|
|
45
|
-
* @param args - Values to log (will be stringified and truncated if needed)
|
|
46
|
-
* @param level - Log level (info, warn, error)
|
|
47
|
-
*/
|
|
19
|
+
/** In production wraps the message in JSON with event context tags; in local development logs as-is. */
|
|
20
|
+
logFn(message: string, level: LogLevel): void;
|
|
48
21
|
private stringifyAndLog;
|
|
49
22
|
log(...args: unknown[]): void;
|
|
50
23
|
info(...args: unknown[]): void;
|
|
51
24
|
warn(...args: unknown[]): void;
|
|
52
25
|
error(...args: unknown[]): void;
|
|
53
26
|
}
|
|
54
|
-
/**
|
|
55
|
-
* Converts a state object into a printable format where arrays are summarized.
|
|
56
|
-
* Arrays show their length, first item, and last item instead of all elements.
|
|
57
|
-
* Objects are recursively processed and primitives are returned as-is.
|
|
58
|
-
*
|
|
59
|
-
* @param state - State object to convert
|
|
60
|
-
* @returns Printable representation with summarized arrays
|
|
61
|
-
*/
|
|
27
|
+
/** Summarizes arrays as `{ length, firstItem, lastItem }` instead of listing all elements. */
|
|
62
28
|
export declare function getPrintableState(state: Record<string, any>): PrintableState;
|
|
63
|
-
/**
|
|
64
|
-
|
|
65
|
-
* Automatically detects and formats Axios errors with HTTP details.
|
|
66
|
-
* Returns other error types as-is.
|
|
67
|
-
*
|
|
68
|
-
* @param error - Error to serialize
|
|
69
|
-
* @returns Serialized error or original if not an Axios error
|
|
70
|
-
*/
|
|
71
|
-
export declare function serializeError(error: unknown): unknown;
|
|
72
|
-
/**
|
|
73
|
-
* Serializes an Axios error into a structured format with HTTP request/response details.
|
|
74
|
-
* Extracts method, URL, parameters, status code, headers, and data.
|
|
75
|
-
* Includes CORS/network failure indicator when no response is available.
|
|
76
|
-
*
|
|
77
|
-
* @param error - Axios error to serialize
|
|
78
|
-
* @returns Structured object with error details
|
|
79
|
-
*/
|
|
29
|
+
/** Serializes any error into a loggable string; Axios errors get HTTP details. */
|
|
30
|
+
export declare function serializeError(error: unknown): string;
|
|
80
31
|
export declare function serializeAxiosError(error: AxiosError): AxiosErrorResponse;
|
|
81
|
-
/**
|
|
82
|
-
* Formats an Axios error to a printable format.
|
|
83
|
-
*
|
|
84
|
-
* @param error - Axios error to format
|
|
85
|
-
* @returns Formatted error object
|
|
86
|
-
* @deprecated Use {@link serializeAxiosError} instead
|
|
87
|
-
*/
|
|
88
|
-
export declare function formatAxiosError(error: AxiosError): object;
|
|
89
32
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAW,cAAc,EAAE,MAAM,WAAW,CAAC;AAGpD,OAAO,EAAE,UAAU,EAAgB,MAAM,OAAO,CAAC;AAKjD,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EAEtB,QAAQ,EAER,cAAc,EACf,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAI3C,eAAO,MAAM,eAAe,EAAE,cAM7B,CAAC;AAEF,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED;;;;GAIG;AACH,qBAAa,MAAO,SAAQ,OAAO;IACjC,OAAO,CAAC,eAAe,CAAU;IACjC,OAAO,CAAC,OAAO,CAAC,CAAiB;IACjC,OAAO,CAAC,IAAI,CAAa;gBAEb,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,sBAAsB;IAUtD,OAAO,CAAC,aAAa;IAOrB,wGAAwG;IACxG,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,IAAI;IAa7C,OAAO,CAAC,eAAe;IAcd,GAAG,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI7B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI9B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAI9B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAGzC;AAED,8FAA8F;AAE9F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,cAAc,CAqB5E;AAED,kFAAkF;AAClF,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAmCrD;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,GAAG,kBAAkB,CAuBzE"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type { WorkerAdapterOptions } from '../types/workers';
|
|
1
|
+
import type { AirSyncEvent, EventContext } from '../types/extraction';
|
|
2
|
+
import type { RuntimeOptions } from '../types/workers';
|
|
4
3
|
export interface LoggerFactoryInterface {
|
|
5
|
-
event:
|
|
6
|
-
options?:
|
|
4
|
+
event: AirSyncEvent;
|
|
5
|
+
options?: RuntimeOptions;
|
|
7
6
|
}
|
|
8
7
|
export declare enum LogLevel {
|
|
9
8
|
INFO = "info",
|
|
@@ -29,7 +28,6 @@ export interface AxiosErrorResponse {
|
|
|
29
28
|
isCorsOrNoNetworkError: boolean;
|
|
30
29
|
response?: {
|
|
31
30
|
data: unknown;
|
|
32
|
-
headers: RawAxiosResponseHeaders;
|
|
33
31
|
status: number;
|
|
34
32
|
statusText: string;
|
|
35
33
|
};
|
|
@@ -38,6 +36,5 @@ export interface AxiosErrorResponse {
|
|
|
38
36
|
}
|
|
39
37
|
export interface LoggerTags extends EventContext {
|
|
40
38
|
sdk_version: string;
|
|
41
|
-
is_sdk_log: boolean;
|
|
42
39
|
}
|
|
43
40
|
//# sourceMappingURL=logger.interfaces.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.interfaces.d.ts","sourceRoot":"","sources":["../../src/logger/logger.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"logger.interfaces.d.ts","sourceRoot":"","sources":["../../src/logger/logger.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IAEf,SAAS,CAAC,EAAE,GAAG,CAAC;IAEhB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAE7B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,cAAc,GAAG,cAAc,CAAC;CACtD;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAE3B,MAAM,EAAE,GAAG,CAAC;QACZ,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;KACzB,CAAC;IACF,YAAY,EAAE,OAAO,CAAC;IACtB,sBAAsB,EAAE,OAAO,CAAC;IAChC,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,OAAO,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,WAAW,EAAE,MAAM,CAAC;CACrB"}
|