@devrev/airsync-sdk 2.0.0-beta.3 → 2.0.0-beta.5
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/MIGRATION.md +1028 -0
- package/README.md +5 -11
- package/dist/attachments-streaming/attachments-streaming-pool.d.ts +7 -9
- package/dist/attachments-streaming/attachments-streaming-pool.d.ts.map +1 -1
- package/dist/attachments-streaming/attachments-streaming-pool.interfaces.d.ts +2 -7
- package/dist/attachments-streaming/attachments-streaming-pool.interfaces.d.ts.map +1 -1
- package/dist/attachments-streaming/attachments-streaming-pool.js +54 -56
- package/dist/common/constants.d.ts +4 -5
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +6 -7
- package/dist/common/helpers.d.ts +3 -35
- package/dist/common/helpers.d.ts.map +1 -1
- package/dist/common/helpers.js +5 -50
- package/dist/http/{axios-client-internal.d.ts → client.d.ts} +1 -1
- package/dist/http/client.d.ts.map +1 -0
- package/dist/http/{axios-client-internal.js → client.js} +4 -8
- package/dist/index.d.ts +24 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -32
- package/dist/logger/logger.d.ts +12 -53
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.interfaces.d.ts +0 -1
- package/dist/logger/logger.interfaces.d.ts.map +1 -1
- package/dist/logger/logger.js +36 -68
- package/dist/mappers/mappers.d.ts +7 -46
- package/dist/mappers/mappers.d.ts.map +1 -1
- package/dist/mappers/mappers.interfaces.d.ts +175 -0
- package/dist/mappers/mappers.interfaces.d.ts.map +1 -0
- package/dist/mappers/{mappers.interface.js → mappers.interfaces.js} +4 -13
- package/dist/mappers/mappers.js +11 -45
- package/dist/multithreading/adapters/base-adapter.d.ts +30 -32
- package/dist/multithreading/adapters/base-adapter.d.ts.map +1 -1
- package/dist/multithreading/adapters/base-adapter.js +97 -62
- package/dist/multithreading/adapters/extraction-adapter.d.ts +16 -29
- package/dist/multithreading/adapters/extraction-adapter.d.ts.map +1 -1
- package/dist/multithreading/adapters/extraction-adapter.js +203 -206
- package/dist/multithreading/adapters/loading-adapter.d.ts +8 -13
- package/dist/multithreading/adapters/loading-adapter.d.ts.map +1 -1
- package/dist/multithreading/adapters/loading-adapter.helpers.d.ts +2 -12
- package/dist/multithreading/adapters/loading-adapter.helpers.d.ts.map +1 -1
- package/dist/multithreading/adapters/loading-adapter.helpers.js +2 -12
- package/dist/multithreading/adapters/loading-adapter.js +294 -346
- package/dist/multithreading/emit.d.ts +11 -0
- package/dist/multithreading/emit.d.ts.map +1 -0
- package/dist/{common/control-protocol.js → multithreading/emit.js} +5 -7
- package/dist/multithreading/process-task.d.ts +2 -12
- package/dist/multithreading/process-task.d.ts.map +1 -1
- package/dist/multithreading/process-task.js +46 -43
- package/dist/multithreading/spawn/spawn.d.ts +3 -9
- 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 +128 -20
- package/dist/multithreading/spawn/spawn.js +24 -39
- package/dist/multithreading/worker.js +1 -4
- package/dist/repo/repo.d.ts +10 -0
- 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 +4 -16
- package/dist/repo/repo.interfaces.d.ts.map +1 -1
- package/dist/repo/repo.js +23 -8
- package/dist/state/base-state.d.ts +16 -38
- package/dist/state/base-state.d.ts.map +1 -1
- package/dist/state/base-state.js +19 -41
- package/dist/state/extraction-state.d.ts +6 -21
- package/dist/state/extraction-state.d.ts.map +1 -1
- package/dist/state/extraction-state.js +8 -25
- package/dist/{common → state}/install-initial-domain-mapping.d.ts +1 -1
- 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 +3 -14
- package/dist/state/loading-state.d.ts.map +1 -1
- package/dist/state/loading-state.js +3 -14
- package/dist/state/state.d.ts +4 -0
- package/dist/state/state.d.ts.map +1 -0
- package/dist/state/state.interfaces.d.ts +33 -37
- package/dist/state/state.interfaces.d.ts.map +1 -1
- package/dist/state/state.interfaces.js +16 -11
- package/dist/state/state.js +11 -0
- package/dist/state/time-value-resolver.d.ts +17 -0
- package/dist/state/time-value-resolver.d.ts.map +1 -0
- package/dist/{common → state}/time-value-resolver.js +9 -41
- package/dist/testing/mock-event.d.ts +10 -0
- package/dist/testing/mock-event.d.ts.map +1 -0
- package/dist/{common/test-utils.js → testing/mock-event.js} +17 -14
- package/dist/testing/mock-server.d.ts +29 -0
- package/dist/testing/mock-server.d.ts.map +1 -0
- package/dist/testing/mock-server.interfaces.d.ts +48 -0
- package/dist/testing/mock-server.interfaces.d.ts.map +1 -0
- package/dist/{mock-server → testing}/mock-server.js +21 -33
- package/dist/types/common.d.ts +1 -12
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +1 -6
- package/dist/types/errors.d.ts +9 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/external-domain-metadata.d.ts +30 -171
- package/dist/types/external-domain-metadata.d.ts.map +1 -1
- package/dist/types/extraction.d.ts +64 -94
- package/dist/types/extraction.d.ts.map +1 -1
- package/dist/types/extraction.js +6 -34
- package/dist/types/loading.d.ts +1 -2
- package/dist/types/loading.d.ts.map +1 -1
- package/dist/types/loading.js +0 -1
- package/dist/types/workers.d.ts +39 -94
- package/dist/types/workers.d.ts.map +1 -1
- package/dist/types/workers.js +0 -6
- package/dist/uploader/uploader.d.ts +8 -59
- package/dist/uploader/uploader.d.ts.map +1 -1
- package/dist/uploader/uploader.helpers.d.ts +4 -27
- package/dist/uploader/uploader.helpers.d.ts.map +1 -1
- package/dist/uploader/uploader.helpers.js +64 -30
- package/dist/uploader/uploader.interfaces.d.ts +15 -25
- package/dist/uploader/uploader.interfaces.d.ts.map +1 -1
- package/dist/uploader/uploader.interfaces.js +8 -0
- package/dist/uploader/uploader.js +23 -89
- package/package.json +8 -6
- package/dist/airsync-sdk.d.ts +0 -2059
- 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 -540
- package/dist/common/control-protocol.d.ts +0 -10
- package/dist/common/control-protocol.d.ts.map +0 -1
- package/dist/common/errors.d.ts +0 -6
- package/dist/common/errors.d.ts.map +0 -1
- 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 -211
- package/dist/common/test-utils.d.ts +0 -19
- package/dist/common/test-utils.d.ts.map +0 -1
- package/dist/common/time-value-resolver.d.ts +0 -47
- package/dist/common/time-value-resolver.d.ts.map +0 -1
- package/dist/common/time-value-resolver.test.d.ts +0 -2
- package/dist/common/time-value-resolver.test.d.ts.map +0 -1
- package/dist/common/time-value-resolver.test.js +0 -268
- package/dist/http/axios-client-internal.d.ts.map +0 -1
- 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 -175
- 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 -60
- 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 -2
- package/dist/http/index.d.ts.map +0 -1
- package/dist/http/index.js +0 -17
- 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 -537
- 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 -105
- package/dist/mock-server/mock-server.d.ts +0 -47
- package/dist/mock-server/mock-server.d.ts.map +0 -1
- package/dist/mock-server/mock-server.interfaces.d.ts +0 -73
- package/dist/mock-server/mock-server.interfaces.d.ts.map +0 -1
- package/dist/multithreading/adapters/base-adapter.emit.test.d.ts +0 -2
- package/dist/multithreading/adapters/base-adapter.emit.test.d.ts.map +0 -1
- package/dist/multithreading/adapters/base-adapter.emit.test.js +0 -403
- package/dist/multithreading/adapters/extraction-adapter.artifacts.test.d.ts +0 -2
- package/dist/multithreading/adapters/extraction-adapter.artifacts.test.d.ts.map +0 -1
- package/dist/multithreading/adapters/extraction-adapter.artifacts.test.js +0 -175
- package/dist/multithreading/adapters/extraction-adapter.test.d.ts +0 -2
- package/dist/multithreading/adapters/extraction-adapter.test.d.ts.map +0 -1
- package/dist/multithreading/adapters/extraction-adapter.test.js +0 -789
- package/dist/multithreading/adapters/loading-adapter.helpers.test.d.ts +0 -2
- package/dist/multithreading/adapters/loading-adapter.helpers.test.d.ts.map +0 -1
- package/dist/multithreading/adapters/loading-adapter.helpers.test.js +0 -514
- package/dist/multithreading/adapters/loading-adapter.test.d.ts +0 -2
- package/dist/multithreading/adapters/loading-adapter.test.d.ts.map +0 -1
- package/dist/multithreading/adapters/loading-adapter.test.js +0 -589
- package/dist/multithreading/adapters/serialization.test.d.ts +0 -2
- package/dist/multithreading/adapters/serialization.test.d.ts.map +0 -1
- package/dist/multithreading/adapters/serialization.test.js +0 -71
- 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 -108
- package/dist/multithreading/process-task.test.d.ts +0 -2
- package/dist/multithreading/process-task.test.d.ts.map +0 -1
- package/dist/multithreading/process-task.test.js +0 -146
- 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/spawn/spawn.test.d.ts +0 -2
- package/dist/multithreading/spawn/spawn.test.d.ts.map +0 -1
- package/dist/multithreading/spawn/spawn.test.js +0 -232
- 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 -184
- package/dist/state/state.extract-window.test.d.ts +0 -2
- package/dist/state/state.extract-window.test.d.ts.map +0 -1
- package/dist/state/state.extract-window.test.js +0 -163
- package/dist/state/state.pending-boundaries.test.d.ts +0 -2
- package/dist/state/state.pending-boundaries.test.d.ts.map +0 -1
- package/dist/state/state.pending-boundaries.test.js +0 -189
- package/dist/state/state.post-state.test.d.ts +0 -2
- package/dist/state/state.post-state.test.d.ts.map +0 -1
- package/dist/state/state.post-state.test.js +0 -78
- 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 -271
- package/dist/state/state.time-value-resolution.test.d.ts +0 -2
- package/dist/state/state.time-value-resolution.test.d.ts.map +0 -1
- package/dist/state/state.time-value-resolution.test.js +0 -175
- package/dist/tsdoc-metadata.json +0 -11
- 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 -96
- package/dist/types/index.d.ts +0 -10
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -21
- 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 -256
- 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 -601
- /package/dist/{mock-server → testing}/mock-server.interfaces.js +0 -0
- /package/dist/{common → types}/errors.js +0 -0
package/dist/index.js
CHANGED
|
@@ -1,39 +1,50 @@
|
|
|
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.MOCK_SERVER_DEFAULT_URL = exports.createMockEvent = exports.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
Object.defineProperty(exports, "serializeAxiosError", { enumerable: true, get: function () { return logger_1.serializeAxiosError; } });
|
|
24
|
-
var mock_server_1 = require("./mock-server/mock-server");
|
|
25
|
-
Object.defineProperty(exports, "MockServer", { enumerable: true, get: function () { return mock_server_1.MockServer; } });
|
|
8
|
+
exports.MockServer = exports.MOCK_SERVER_DEFAULT_URL = exports.createMockEvent = exports.SyncMapperRecordTargetType = exports.SyncMapperRecordStatus = exports.Mappers = exports.LoaderEventType = exports.TimeValueType = exports.TimeUnit = exports.InitialSyncScope = exports.ExtractorEventType = exports.EventType = exports.SyncMode = exports.serializeError = exports.installInitialDomainMapping = exports.UNBOUNDED_DATE_TIME_VALUE = exports.AirSyncDefaultItemTypes = exports.spawn = exports.processLoadingTask = exports.processExtractionTask = exports.LoadingAdapter = exports.ExtractionAdapter = void 0;
|
|
9
|
+
// ── Entry points & adapters ──
|
|
10
|
+
var extraction_adapter_1 = require("./multithreading/adapters/extraction-adapter");
|
|
11
|
+
Object.defineProperty(exports, "ExtractionAdapter", { enumerable: true, get: function () { return extraction_adapter_1.ExtractionAdapter; } });
|
|
12
|
+
var loading_adapter_1 = require("./multithreading/adapters/loading-adapter");
|
|
13
|
+
Object.defineProperty(exports, "LoadingAdapter", { enumerable: true, get: function () { return loading_adapter_1.LoadingAdapter; } });
|
|
26
14
|
var process_task_1 = require("./multithreading/process-task");
|
|
27
15
|
Object.defineProperty(exports, "processExtractionTask", { enumerable: true, get: function () { return process_task_1.processExtractionTask; } });
|
|
28
16
|
Object.defineProperty(exports, "processLoadingTask", { enumerable: true, get: function () { return process_task_1.processLoadingTask; } });
|
|
29
17
|
var spawn_1 = require("./multithreading/spawn/spawn");
|
|
30
18
|
Object.defineProperty(exports, "spawn", { enumerable: true, get: function () { return spawn_1.spawn; } });
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
19
|
+
// ── Constants & enums ──
|
|
20
|
+
var constants_1 = require("./common/constants");
|
|
21
|
+
Object.defineProperty(exports, "AirSyncDefaultItemTypes", { enumerable: true, get: function () { return constants_1.AirSyncDefaultItemTypes; } });
|
|
22
|
+
var constants_2 = require("./common/constants");
|
|
23
|
+
Object.defineProperty(exports, "UNBOUNDED_DATE_TIME_VALUE", { enumerable: true, get: function () { return constants_2.UNBOUNDED_DATE_TIME_VALUE; } });
|
|
24
|
+
// ── Domain mapping install ──
|
|
25
|
+
var install_initial_domain_mapping_1 = require("./state/install-initial-domain-mapping");
|
|
26
|
+
Object.defineProperty(exports, "installInitialDomainMapping", { enumerable: true, get: function () { return install_initial_domain_mapping_1.installInitialDomainMapping; } });
|
|
27
|
+
// ── Error formatting ──
|
|
28
|
+
var logger_1 = require("./logger/logger");
|
|
29
|
+
Object.defineProperty(exports, "serializeError", { enumerable: true, get: function () { return logger_1.serializeError; } });
|
|
30
|
+
var common_1 = require("./types/common");
|
|
31
|
+
Object.defineProperty(exports, "SyncMode", { enumerable: true, get: function () { return common_1.SyncMode; } });
|
|
32
|
+
var extraction_1 = require("./types/extraction");
|
|
33
|
+
Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return extraction_1.EventType; } });
|
|
34
|
+
Object.defineProperty(exports, "ExtractorEventType", { enumerable: true, get: function () { return extraction_1.ExtractorEventType; } });
|
|
35
|
+
Object.defineProperty(exports, "InitialSyncScope", { enumerable: true, get: function () { return extraction_1.InitialSyncScope; } });
|
|
36
|
+
Object.defineProperty(exports, "TimeUnit", { enumerable: true, get: function () { return extraction_1.TimeUnit; } });
|
|
37
|
+
Object.defineProperty(exports, "TimeValueType", { enumerable: true, get: function () { return extraction_1.TimeValueType; } });
|
|
38
|
+
var loading_1 = require("./types/loading");
|
|
39
|
+
Object.defineProperty(exports, "LoaderEventType", { enumerable: true, get: function () { return loading_1.LoaderEventType; } });
|
|
40
|
+
// ── Mappers ──
|
|
41
|
+
var mappers_1 = require("./mappers/mappers");
|
|
42
|
+
Object.defineProperty(exports, "Mappers", { enumerable: true, get: function () { return mappers_1.Mappers; } });
|
|
43
|
+
var mappers_interfaces_1 = require("./mappers/mappers.interfaces");
|
|
44
|
+
Object.defineProperty(exports, "SyncMapperRecordStatus", { enumerable: true, get: function () { return mappers_interfaces_1.SyncMapperRecordStatus; } });
|
|
45
|
+
Object.defineProperty(exports, "SyncMapperRecordTargetType", { enumerable: true, get: function () { return mappers_interfaces_1.SyncMapperRecordTargetType; } });
|
|
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; } });
|
package/dist/logger/logger.d.ts
CHANGED
|
@@ -1,73 +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
|
-
* In production mode, wraps the message with JSON formatting and event context tags.
|
|
23
|
-
* In local development mode, logs the message directly without JSON wrapping.
|
|
24
|
-
* This is useful when you need to log already-stringified content.
|
|
25
|
-
*
|
|
26
|
-
* @param message - The pre-formatted message string to log
|
|
27
|
-
* @param level - Log level (info, warn, error)
|
|
28
|
-
* @param isSdkLog - Flag indicating if the log originated from the SDK
|
|
29
|
-
*/
|
|
30
|
-
logFn(message: string, level: LogLevel, isSdkLog?: boolean): void;
|
|
31
|
-
/**
|
|
32
|
-
* Stringifies and logs arguments to the appropriate destination.
|
|
33
|
-
* On main thread, converts arguments to strings and calls logFn.
|
|
34
|
-
* In worker threads, forwards stringified arguments to the main thread for processing.
|
|
35
|
-
* All arguments are converted to strings using util.inspect and joined with spaces.
|
|
36
|
-
*
|
|
37
|
-
* @param args - Values to log (will be stringified and truncated if needed)
|
|
38
|
-
* @param level - Log level (info, warn, error)
|
|
39
|
-
*/
|
|
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;
|
|
40
21
|
private stringifyAndLog;
|
|
41
22
|
log(...args: unknown[]): void;
|
|
42
23
|
info(...args: unknown[]): void;
|
|
43
24
|
warn(...args: unknown[]): void;
|
|
44
25
|
error(...args: unknown[]): void;
|
|
45
26
|
}
|
|
46
|
-
/**
|
|
47
|
-
* Converts a state object into a printable format where arrays are summarized.
|
|
48
|
-
* Arrays show their length, first item, and last item instead of all elements.
|
|
49
|
-
* Objects are recursively processed and primitives are returned as-is.
|
|
50
|
-
*
|
|
51
|
-
* @param state - State object to convert
|
|
52
|
-
* @returns Printable representation with summarized arrays
|
|
53
|
-
*/
|
|
27
|
+
/** Summarizes arrays as `{ length, firstItem, lastItem }` instead of listing all elements. */
|
|
54
28
|
export declare function getPrintableState(state: Record<string, any>): PrintableState;
|
|
55
|
-
/**
|
|
56
|
-
* Serializes an error into a structured format.
|
|
57
|
-
* Automatically detects and formats Axios errors with HTTP details.
|
|
58
|
-
* Returns other error types as-is.
|
|
59
|
-
*
|
|
60
|
-
* @param error - Error to serialize
|
|
61
|
-
* @returns Serialized error or original if not an Axios error
|
|
62
|
-
*/
|
|
29
|
+
/** Serializes any error into a loggable string; Axios errors get HTTP details. */
|
|
63
30
|
export declare function serializeError(error: unknown): string;
|
|
64
|
-
/**
|
|
65
|
-
* Serializes an Axios error into a structured format with HTTP request/response details.
|
|
66
|
-
* Extracts method, URL, parameters, status code, headers, and data.
|
|
67
|
-
* Includes CORS/network failure indicator when no response is available.
|
|
68
|
-
*
|
|
69
|
-
* @param error - Axios error to serialize
|
|
70
|
-
* @returns Structured object with error details
|
|
71
|
-
*/
|
|
72
31
|
export declare function serializeAxiosError(error: AxiosError): AxiosErrorResponse;
|
|
73
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,EAAyC,MAAM,OAAO,CAAC;AAK1E,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,CAAuB;IACvC,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,CAwBzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.interfaces.d.ts","sourceRoot":"","sources":["../../src/logger/logger.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.interfaces.d.ts","sourceRoot":"","sources":["../../src/logger/logger.interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE7D,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,YAAY,CAAC;IACpB,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC;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,OAAO,EAAE,uBAAuB,CAAC;QACjC,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"}
|
package/dist/logger/logger.js
CHANGED
|
@@ -1,81 +1,72 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Logger = void 0;
|
|
3
|
+
exports.Logger = exports.INSPECT_OPTIONS = exports.MAX_LOG_STRING_LENGTH = void 0;
|
|
4
|
+
exports.truncateMessage = truncateMessage;
|
|
4
5
|
exports.getPrintableState = getPrintableState;
|
|
5
6
|
exports.serializeError = serializeError;
|
|
6
7
|
exports.serializeAxiosError = serializeAxiosError;
|
|
7
|
-
const axios_1 = require("axios");
|
|
8
8
|
const node_console_1 = require("node:console");
|
|
9
9
|
const node_util_1 = require("node:util");
|
|
10
10
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
11
|
+
const axios_1 = require("axios");
|
|
11
12
|
const constants_1 = require("../common/constants");
|
|
12
13
|
const workers_1 = require("../types/workers");
|
|
13
|
-
const logger_constants_1 = require("./logger.constants");
|
|
14
|
-
const logger_context_1 = require("./logger.context");
|
|
15
14
|
const logger_interfaces_1 = require("./logger.interfaces");
|
|
16
|
-
|
|
15
|
+
// ── Log formatting ──
|
|
16
|
+
exports.MAX_LOG_STRING_LENGTH = 10000;
|
|
17
|
+
const MAX_LOG_DEPTH = 10;
|
|
18
|
+
const MAX_LOG_ARRAY_LENGTH = 100;
|
|
19
|
+
exports.INSPECT_OPTIONS = {
|
|
20
|
+
compact: false,
|
|
21
|
+
breakLength: Infinity,
|
|
22
|
+
depth: MAX_LOG_DEPTH,
|
|
23
|
+
maxArrayLength: MAX_LOG_ARRAY_LENGTH,
|
|
24
|
+
maxStringLength: exports.MAX_LOG_STRING_LENGTH,
|
|
25
|
+
};
|
|
26
|
+
function truncateMessage(message) {
|
|
27
|
+
if (message.length > exports.MAX_LOG_STRING_LENGTH) {
|
|
28
|
+
return `${message.substring(0, exports.MAX_LOG_STRING_LENGTH)}... ${message.length - exports.MAX_LOG_STRING_LENGTH} more characters`;
|
|
29
|
+
}
|
|
30
|
+
return message;
|
|
31
|
+
}
|
|
17
32
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
33
|
+
* Console replacement that tags every log line with the event context. Worker
|
|
34
|
+
* threads forward log lines to the main thread, because the snap-in platform
|
|
35
|
+
* only captures logs written through the main thread's console.
|
|
20
36
|
*/
|
|
21
37
|
class Logger extends node_console_1.Console {
|
|
22
38
|
constructor({ event, options }) {
|
|
23
39
|
super(process.stdout, process.stderr);
|
|
24
40
|
this.originalConsole = console;
|
|
25
41
|
this.options = options;
|
|
26
|
-
this.tags = Object.assign(Object.assign({}, event.payload.event_context), { sdk_version: constants_1.LIBRARY_VERSION
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Converts any value to a string using `util.inspect()` for complex types.
|
|
30
|
-
*
|
|
31
|
-
* @param value - The value to convert
|
|
32
|
-
* @returns String representation of the value
|
|
33
|
-
*/
|
|
42
|
+
this.tags = Object.assign(Object.assign({}, event.payload.event_context), { sdk_version: constants_1.LIBRARY_VERSION });
|
|
43
|
+
}
|
|
34
44
|
valueToString(value) {
|
|
35
45
|
if (typeof value === 'string') {
|
|
36
46
|
return value;
|
|
37
47
|
}
|
|
38
|
-
return (0, node_util_1.inspect)(value,
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
-
* In production mode, wraps the message with JSON formatting and event context tags.
|
|
43
|
-
* In local development mode, logs the message directly without JSON wrapping.
|
|
44
|
-
* This is useful when you need to log already-stringified content.
|
|
45
|
-
*
|
|
46
|
-
* @param message - The pre-formatted message string to log
|
|
47
|
-
* @param level - Log level (info, warn, error)
|
|
48
|
-
* @param isSdkLog - Flag indicating if the log originated from the SDK
|
|
49
|
-
*/
|
|
50
|
-
logFn(message, level, isSdkLog = (0, logger_context_1.getSdkLogContextValue)(true)) {
|
|
48
|
+
return (0, node_util_1.inspect)(value, exports.INSPECT_OPTIONS);
|
|
49
|
+
}
|
|
50
|
+
/** In production wraps the message in JSON with event context tags; in local development logs as-is. */
|
|
51
|
+
logFn(message, level) {
|
|
51
52
|
var _a;
|
|
52
53
|
if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.isLocalDevelopment) {
|
|
53
54
|
this.originalConsole[level](message);
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
|
-
const logObject = Object.assign(
|
|
57
|
+
const logObject = Object.assign({ message }, this.tags);
|
|
57
58
|
this.originalConsole[level](JSON.stringify(logObject));
|
|
58
59
|
}
|
|
59
|
-
/**
|
|
60
|
-
* Stringifies and logs arguments to the appropriate destination.
|
|
61
|
-
* On main thread, converts arguments to strings and calls logFn.
|
|
62
|
-
* In worker threads, forwards stringified arguments to the main thread for processing.
|
|
63
|
-
* All arguments are converted to strings using util.inspect and joined with spaces.
|
|
64
|
-
*
|
|
65
|
-
* @param args - Values to log (will be stringified and truncated if needed)
|
|
66
|
-
* @param level - Log level (info, warn, error)
|
|
67
|
-
*/
|
|
68
60
|
stringifyAndLog(args, level) {
|
|
69
61
|
let stringifiedArgs = args.map((arg) => this.valueToString(arg)).join(' ');
|
|
70
|
-
stringifiedArgs =
|
|
71
|
-
const isSdkLog = (0, logger_context_1.getSdkLogContextValue)(true);
|
|
62
|
+
stringifiedArgs = truncateMessage(stringifiedArgs);
|
|
72
63
|
if (node_worker_threads_1.isMainThread) {
|
|
73
|
-
this.logFn(stringifiedArgs, level
|
|
64
|
+
this.logFn(stringifiedArgs, level);
|
|
74
65
|
}
|
|
75
66
|
else {
|
|
76
67
|
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.postMessage({
|
|
77
68
|
subject: workers_1.WorkerMessageSubject.WorkerMessageLog,
|
|
78
|
-
payload: { stringifiedArgs, level
|
|
69
|
+
payload: { stringifiedArgs, level },
|
|
79
70
|
});
|
|
80
71
|
}
|
|
81
72
|
}
|
|
@@ -93,14 +84,7 @@ class Logger extends node_console_1.Console {
|
|
|
93
84
|
}
|
|
94
85
|
}
|
|
95
86
|
exports.Logger = Logger;
|
|
96
|
-
/**
|
|
97
|
-
* Converts a state object into a printable format where arrays are summarized.
|
|
98
|
-
* Arrays show their length, first item, and last item instead of all elements.
|
|
99
|
-
* Objects are recursively processed and primitives are returned as-is.
|
|
100
|
-
*
|
|
101
|
-
* @param state - State object to convert
|
|
102
|
-
* @returns Printable representation with summarized arrays
|
|
103
|
-
*/
|
|
87
|
+
/** Summarizes arrays as `{ length, firstItem, lastItem }` instead of listing all elements. */
|
|
104
88
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
105
89
|
function getPrintableState(state) {
|
|
106
90
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -124,21 +108,13 @@ function getPrintableState(state) {
|
|
|
124
108
|
}
|
|
125
109
|
return processValue(state);
|
|
126
110
|
}
|
|
127
|
-
/**
|
|
128
|
-
* Serializes an error into a structured format.
|
|
129
|
-
* Automatically detects and formats Axios errors with HTTP details.
|
|
130
|
-
* Returns other error types as-is.
|
|
131
|
-
*
|
|
132
|
-
* @param error - Error to serialize
|
|
133
|
-
* @returns Serialized error or original if not an Axios error
|
|
134
|
-
*/
|
|
111
|
+
/** Serializes any error into a loggable string; Axios errors get HTTP details. */
|
|
135
112
|
function serializeError(error) {
|
|
136
113
|
if ((0, axios_1.isAxiosError)(error)) {
|
|
137
114
|
return JSON.stringify(serializeAxiosError(error));
|
|
138
115
|
}
|
|
139
116
|
if (error instanceof Error) {
|
|
140
|
-
// Include error name (e.g. TypeError
|
|
141
|
-
// for easier debugging
|
|
117
|
+
// Include non-default error name (e.g. TypeError) for easier debugging
|
|
142
118
|
return error.name !== 'Error'
|
|
143
119
|
? `${error.name}: ${error.message}`
|
|
144
120
|
: error.message;
|
|
@@ -169,14 +145,6 @@ function serializeError(error) {
|
|
|
169
145
|
}
|
|
170
146
|
return stringified;
|
|
171
147
|
}
|
|
172
|
-
/**
|
|
173
|
-
* Serializes an Axios error into a structured format with HTTP request/response details.
|
|
174
|
-
* Extracts method, URL, parameters, status code, headers, and data.
|
|
175
|
-
* Includes CORS/network failure indicator when no response is available.
|
|
176
|
-
*
|
|
177
|
-
* @param error - Axios error to serialize
|
|
178
|
-
* @returns Structured object with error details
|
|
179
|
-
*/
|
|
180
148
|
function serializeAxiosError(error) {
|
|
181
149
|
var _a, _b, _c;
|
|
182
150
|
const serializedAxiosError = {
|
|
@@ -1,52 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Manages sync mapper records that link external system items to DevRev items.
|
|
5
|
-
*
|
|
6
|
-
* Used for tracking relationships between external and DevRev entities during sync operations.
|
|
7
|
-
*/
|
|
1
|
+
import { MappersCreateParams, MappersCreateResponse, MappersFactoryInterface, MappersGetByExternalIdParams, MappersGetByExternalIdResponse, MappersGetByTargetIdParams, MappersGetByTargetIdResponse, MappersUpdateParams, MappersUpdateResponse } from './mappers.interfaces';
|
|
2
|
+
/** Manages sync mapper records that link external system items to DevRev items. */
|
|
8
3
|
export declare class Mappers {
|
|
9
4
|
private devrevApiEndpoint;
|
|
10
5
|
private devrevApiToken;
|
|
11
6
|
constructor({ event }: MappersFactoryInterface);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* @param params - Query parameters of type MappersGetByTargetIdParams
|
|
18
|
-
* @returns Promise with response data containing the sync mapper record
|
|
19
|
-
*/
|
|
20
|
-
getByTargetId(params: MappersGetByTargetIdParams): Promise<AxiosResponse<MappersGetByTargetIdResponse>>;
|
|
21
|
-
/**
|
|
22
|
-
* Retrieves a sync mapper record by external system ID.
|
|
23
|
-
*
|
|
24
|
-
* Used to find the mapping when you know the external system ID and want to find the DevRev ID.
|
|
25
|
-
*
|
|
26
|
-
* @param params - Query parameters of type MappersGetByExternalIdParams
|
|
27
|
-
* @returns Promise with response data containing the sync mapper record
|
|
28
|
-
*/
|
|
29
|
-
getByExternalId(params: MappersGetByExternalIdParams): Promise<AxiosResponse<MappersGetByExternalIdResponse>>;
|
|
30
|
-
/**
|
|
31
|
-
* Creates a new sync mapper record to establish a relationship between external system
|
|
32
|
-
* entities and DevRev entities.
|
|
33
|
-
*
|
|
34
|
-
* This is called after importing an item from external system to DevRev to record
|
|
35
|
-
* the mapping for future synchronization operations.
|
|
36
|
-
*
|
|
37
|
-
* @param params - Creation parameters of type MappersCreateParams
|
|
38
|
-
* @returns Promise with response data containing the created sync mapper record
|
|
39
|
-
*/
|
|
40
|
-
create(params: MappersCreateParams): Promise<AxiosResponse<MappersCreateResponse>>;
|
|
41
|
-
/**
|
|
42
|
-
* Updates an existing sync mapper record.
|
|
43
|
-
*
|
|
44
|
-
* Used to modify existing mappings when external system entities change or when
|
|
45
|
-
* additional DevRev entities need to be associated.
|
|
46
|
-
*
|
|
47
|
-
* @param params - Update parameters of type MappersUpdateParams
|
|
48
|
-
* @returns Promise with response data containing the updated sync mapper record
|
|
49
|
-
*/
|
|
50
|
-
update(params: MappersUpdateParams): Promise<AxiosResponse<MappersUpdateResponse>>;
|
|
7
|
+
getByTargetId(params: MappersGetByTargetIdParams): Promise<MappersGetByTargetIdResponse>;
|
|
8
|
+
getByExternalId(params: MappersGetByExternalIdParams): Promise<MappersGetByExternalIdResponse>;
|
|
9
|
+
/** Called after importing an item to DevRev to record the mapping for future syncs. */
|
|
10
|
+
create(params: MappersCreateParams): Promise<MappersCreateResponse>;
|
|
11
|
+
update(params: MappersUpdateParams): Promise<MappersUpdateResponse>;
|
|
51
12
|
}
|
|
52
13
|
//# sourceMappingURL=mappers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../src/mappers/mappers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../src/mappers/mappers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,uBAAuB,EACvB,4BAA4B,EAC5B,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC5B,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,mFAAmF;AACnF,qBAAa,OAAO;IAClB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,cAAc,CAAS;gBAEnB,EAAE,KAAK,EAAE,EAAE,uBAAuB;IAKxC,aAAa,CACjB,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,4BAA4B,CAAC;IAclC,eAAe,CACnB,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,8BAA8B,CAAC;IAc1C,uFAAuF;IACjF,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAanE,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAY1E"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { AirSyncEvent } from '../types/extraction';
|
|
2
|
+
import { DonV2 } from '../types/loading';
|
|
3
|
+
import { WorkerAdapterOptions } from '../types/workers';
|
|
4
|
+
export interface MappersFactoryInterface {
|
|
5
|
+
event: AirSyncEvent;
|
|
6
|
+
options?: WorkerAdapterOptions;
|
|
7
|
+
}
|
|
8
|
+
export interface UpdateSyncMapperRecordParams {
|
|
9
|
+
external_ids: {
|
|
10
|
+
add: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Labels values in `external_ids` with their usage context (e.g. a UUID for
|
|
14
|
+
* one API call, a login username for another). Not indexed: to look up by a
|
|
15
|
+
* secondary value it must also be present in `external_ids`.
|
|
16
|
+
*/
|
|
17
|
+
secondary_ids?: Record<string, string>;
|
|
18
|
+
targets: {
|
|
19
|
+
add: DonV2[];
|
|
20
|
+
};
|
|
21
|
+
status: SyncMapperRecordStatus;
|
|
22
|
+
/** Input file name(s) containing the object data; helps later debugging. */
|
|
23
|
+
input_files?: {
|
|
24
|
+
add: string[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Prevents update loops: after writing the object to the external system,
|
|
28
|
+
* add its modified_date here. The Loader skips extracted updates whose
|
|
29
|
+
* modified_date is listed (the change originated in DevRev).
|
|
30
|
+
*/
|
|
31
|
+
external_versions?: {
|
|
32
|
+
add: SyncMapperRecordExternalVersion[];
|
|
33
|
+
};
|
|
34
|
+
/** Free-form storage; opaque to the platform. */
|
|
35
|
+
extra_data?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Links external system entities to DevRev entities. */
|
|
38
|
+
export interface SyncMapperRecord {
|
|
39
|
+
id: DonV2;
|
|
40
|
+
external_ids: string[];
|
|
41
|
+
/**
|
|
42
|
+
* Labels values in `external_ids` with their usage context (e.g. a UUID for
|
|
43
|
+
* one API call, a login username for another). Not indexed: to look up by a
|
|
44
|
+
* secondary value it must also be present in `external_ids`.
|
|
45
|
+
*/
|
|
46
|
+
secondary_ids?: Record<string, string>;
|
|
47
|
+
targets: DonV2[];
|
|
48
|
+
status: SyncMapperRecordStatus;
|
|
49
|
+
/** Input file name(s) containing the object data; helps later debugging. */
|
|
50
|
+
input_files?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Prevents update loops: after writing the object to the external system,
|
|
53
|
+
* its modified_date is stored here. The Loader skips extracted updates whose
|
|
54
|
+
* modified_date is listed (the change originated in DevRev).
|
|
55
|
+
*/
|
|
56
|
+
external_versions?: SyncMapperRecordExternalVersion[];
|
|
57
|
+
/** Free-form storage; opaque to the platform. */
|
|
58
|
+
extra_data?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface MappersGetByTargetIdParams {
|
|
61
|
+
sync_unit: DonV2;
|
|
62
|
+
target: DonV2;
|
|
63
|
+
}
|
|
64
|
+
export interface MappersGetByTargetIdResponse {
|
|
65
|
+
sync_mapper_record: SyncMapperRecord;
|
|
66
|
+
}
|
|
67
|
+
export interface MappersCreateParams {
|
|
68
|
+
sync_unit: DonV2;
|
|
69
|
+
external_ids: string[];
|
|
70
|
+
/**
|
|
71
|
+
* Labels values in `external_ids` with their usage context (e.g. a UUID for
|
|
72
|
+
* one API call, a login username for another). Not indexed: to look up by a
|
|
73
|
+
* secondary value it must also be present in `external_ids`.
|
|
74
|
+
*/
|
|
75
|
+
secondary_ids?: Record<string, string>;
|
|
76
|
+
targets: DonV2[];
|
|
77
|
+
status: SyncMapperRecordStatus;
|
|
78
|
+
/** Input file name(s) containing the object data; helps later debugging. */
|
|
79
|
+
input_files?: string[];
|
|
80
|
+
/**
|
|
81
|
+
* Prevents update loops: after writing the object to the external system,
|
|
82
|
+
* add its modified_date here. The Loader skips extracted updates whose
|
|
83
|
+
* modified_date is listed (the change originated in DevRev).
|
|
84
|
+
*/
|
|
85
|
+
external_versions?: SyncMapperRecordExternalVersion[];
|
|
86
|
+
/** Free-form storage; opaque to the platform. */
|
|
87
|
+
extra_data?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface MappersCreateResponse {
|
|
90
|
+
sync_mapper_record: SyncMapperRecord;
|
|
91
|
+
}
|
|
92
|
+
export interface MappersUpdateParams {
|
|
93
|
+
id: DonV2;
|
|
94
|
+
sync_unit: DonV2;
|
|
95
|
+
external_ids: {
|
|
96
|
+
add: string[];
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Labels values in `external_ids` with their usage context (e.g. a UUID for
|
|
100
|
+
* one API call, a login username for another). Not indexed: to look up by a
|
|
101
|
+
* secondary value it must also be present in `external_ids`.
|
|
102
|
+
*/
|
|
103
|
+
secondary_ids?: Record<string, string>;
|
|
104
|
+
targets: {
|
|
105
|
+
add: DonV2[];
|
|
106
|
+
};
|
|
107
|
+
status: SyncMapperRecordStatus;
|
|
108
|
+
/** Input file name(s) containing the object data; helps later debugging. */
|
|
109
|
+
input_files?: {
|
|
110
|
+
add: string[];
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Prevents update loops: after writing the object to the external system,
|
|
114
|
+
* add its modified_date here. The Loader skips extracted updates whose
|
|
115
|
+
* modified_date is listed (the change originated in DevRev).
|
|
116
|
+
*/
|
|
117
|
+
external_versions?: {
|
|
118
|
+
add: SyncMapperRecordExternalVersion[];
|
|
119
|
+
};
|
|
120
|
+
/** Free-form storage; opaque to the platform. */
|
|
121
|
+
extra_data?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface MappersUpdateResponse {
|
|
124
|
+
sync_mapper_record: SyncMapperRecord;
|
|
125
|
+
}
|
|
126
|
+
export declare enum SyncMapperRecordStatus {
|
|
127
|
+
/** The mapping is active and operational (default) */
|
|
128
|
+
OPERATIONAL = "operational",
|
|
129
|
+
/** The mapping was filtered out by user filter settings */
|
|
130
|
+
FILTERED = "filtered",
|
|
131
|
+
/** Ignore the external object in sync; prevents create/update in DevRev. */
|
|
132
|
+
IGNORED = "ignored"
|
|
133
|
+
}
|
|
134
|
+
/** Marks external changes as DevRev-originated to prevent update loops. */
|
|
135
|
+
export interface SyncMapperRecordExternalVersion {
|
|
136
|
+
/** Sync recipe version at the time the external change was written */
|
|
137
|
+
recipe_version: number;
|
|
138
|
+
/** External system modified timestamp (ISO 8601 string) used for loop detection */
|
|
139
|
+
modified_date: string;
|
|
140
|
+
}
|
|
141
|
+
export interface MappersGetByExternalIdParams {
|
|
142
|
+
sync_unit: DonV2;
|
|
143
|
+
external_id: string;
|
|
144
|
+
target_type: SyncMapperRecordTargetType;
|
|
145
|
+
}
|
|
146
|
+
export declare enum SyncMapperRecordTargetType {
|
|
147
|
+
ACCESS_CONTROL_ENTRY = "access_control_entry",
|
|
148
|
+
ACCOUNT = "account",
|
|
149
|
+
AIRDROP_AUTHORIZATION_POLICY = "airdrop_authorization_policy",
|
|
150
|
+
AIRDROP_FIELD_AUTHORIZATION_POLICY = "airdrop_field_authorization_policy",
|
|
151
|
+
AIRDROP_PLATFORM_GROUP = "airdrop_platform_group",
|
|
152
|
+
ARTICLE = "article",
|
|
153
|
+
ARTIFACT = "artifact",
|
|
154
|
+
CHAT = "chat",
|
|
155
|
+
CONVERSATION = "conversation",
|
|
156
|
+
CUSTOM_OBJECT = "custom_object",
|
|
157
|
+
DIRECTORY = "directory",
|
|
158
|
+
GROUP = "group",
|
|
159
|
+
INCIDENT = "incident",
|
|
160
|
+
LINK = "link",
|
|
161
|
+
MEETING = "meeting",
|
|
162
|
+
OBJECT_MEMBER = "object_member",
|
|
163
|
+
PART = "part",
|
|
164
|
+
REV_ORG = "rev_org",
|
|
165
|
+
ROLE = "role",
|
|
166
|
+
ROLE_SET = "role_set",
|
|
167
|
+
TAG = "tag",
|
|
168
|
+
TIMELINE_COMMENT = "timeline_comment",
|
|
169
|
+
USER = "user",
|
|
170
|
+
WORK = "work"
|
|
171
|
+
}
|
|
172
|
+
export interface MappersGetByExternalIdResponse {
|
|
173
|
+
sync_mapper_record: SyncMapperRecord;
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=mappers.interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mappers.interfaces.d.ts","sourceRoot":"","sources":["../../src/mappers/mappers.interfaces.ts"],"names":[],"mappings":"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"}
|