@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
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const events_1 = require("events");
|
|
4
|
-
const constants_1 = require("../../common/constants");
|
|
5
|
-
const extraction_1 = require("../../types/extraction");
|
|
6
|
-
const workers_1 = require("../../types/workers");
|
|
7
|
-
const test_utils_1 = require("../../common/test-utils");
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
// Mocks
|
|
10
|
-
// ---------------------------------------------------------------------------
|
|
11
|
-
jest.mock('../create-worker', () => ({
|
|
12
|
-
createWorker: jest.fn(),
|
|
13
|
-
}));
|
|
14
|
-
jest.mock('../../common/control-protocol', () => ({
|
|
15
|
-
emit: jest.fn().mockResolvedValue({}),
|
|
16
|
-
}));
|
|
17
|
-
jest.mock('../../logger/logger', () => ({
|
|
18
|
-
Logger: jest.fn().mockImplementation(() => ({
|
|
19
|
-
log: jest.fn(),
|
|
20
|
-
warn: jest.fn(),
|
|
21
|
-
error: jest.fn(),
|
|
22
|
-
info: jest.fn(),
|
|
23
|
-
logFn: jest.fn(),
|
|
24
|
-
})),
|
|
25
|
-
serializeError: jest.fn((e) => String(e)),
|
|
26
|
-
}));
|
|
27
|
-
jest.mock('../../common/helpers', () => ({
|
|
28
|
-
getLibraryVersion: jest.fn().mockReturnValue('1.0.0-test'),
|
|
29
|
-
getMemoryUsage: jest.fn().mockReturnValue({
|
|
30
|
-
formattedMessage: 'Memory: RSS 100/512MB (19.53%) [...]',
|
|
31
|
-
rssUsedMB: '100.00',
|
|
32
|
-
rssUsedPercent: '19.53%',
|
|
33
|
-
heapUsedPercent: '30.00%',
|
|
34
|
-
externalMB: '10.00',
|
|
35
|
-
arrayBuffersMB: '5.00',
|
|
36
|
-
}),
|
|
37
|
-
sleep: jest.fn(),
|
|
38
|
-
truncateFilename: jest.fn((f) => f),
|
|
39
|
-
truncateMessage: jest.fn((m) => m),
|
|
40
|
-
}));
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
|
-
// Imports after mocks
|
|
43
|
-
// ---------------------------------------------------------------------------
|
|
44
|
-
const spawn_1 = require("./spawn");
|
|
45
|
-
const create_worker_1 = require("../create-worker");
|
|
46
|
-
const control_protocol_1 = require("../../common/control-protocol");
|
|
47
|
-
const helpers_1 = require("../../common/helpers");
|
|
48
|
-
// ---------------------------------------------------------------------------
|
|
49
|
-
// Factory for a fake worker (EventEmitter with postMessage + terminate)
|
|
50
|
-
// ---------------------------------------------------------------------------
|
|
51
|
-
function makeWorker() {
|
|
52
|
-
const w = new events_1.EventEmitter();
|
|
53
|
-
w.postMessage = jest.fn();
|
|
54
|
-
w.terminate = jest.fn().mockResolvedValue(0);
|
|
55
|
-
return w;
|
|
56
|
-
}
|
|
57
|
-
// ---------------------------------------------------------------------------
|
|
58
|
-
// Helper: instantiate Spawn directly, injecting a mock logger via console swap
|
|
59
|
-
// ---------------------------------------------------------------------------
|
|
60
|
-
function buildSpawn(overrides) {
|
|
61
|
-
var _a;
|
|
62
|
-
const event = (0, test_utils_1.createMockEvent)('http://localhost:0', {
|
|
63
|
-
payload: { event_type: extraction_1.EventType.StartExtractingData },
|
|
64
|
-
});
|
|
65
|
-
const mockLogger = {
|
|
66
|
-
log: jest.fn(),
|
|
67
|
-
warn: jest.fn(),
|
|
68
|
-
error: jest.fn(),
|
|
69
|
-
info: jest.fn(),
|
|
70
|
-
logFn: jest.fn(),
|
|
71
|
-
};
|
|
72
|
-
const originalConsole = console;
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
|
-
global.console = mockLogger;
|
|
75
|
-
const s = new spawn_1.Spawn({
|
|
76
|
-
event,
|
|
77
|
-
worker: overrides.worker,
|
|
78
|
-
options: overrides.options,
|
|
79
|
-
resolve: (_a = overrides.resolve) !== null && _a !== void 0 ? _a : jest.fn(),
|
|
80
|
-
originalConsole: originalConsole,
|
|
81
|
-
});
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
83
|
-
global.console = originalConsole;
|
|
84
|
-
return s;
|
|
85
|
-
}
|
|
86
|
-
// ---------------------------------------------------------------------------
|
|
87
|
-
// spawn() factory tests
|
|
88
|
-
// ---------------------------------------------------------------------------
|
|
89
|
-
describe('spawn() factory', () => {
|
|
90
|
-
beforeEach(() => {
|
|
91
|
-
jest.clearAllMocks();
|
|
92
|
-
jest.useFakeTimers({ legacyFakeTimers: true });
|
|
93
|
-
});
|
|
94
|
-
afterEach(() => {
|
|
95
|
-
jest.useRealTimers();
|
|
96
|
-
});
|
|
97
|
-
it('should emit a no-script event and NOT spawn a worker for an unknown event type', async () => {
|
|
98
|
-
// Arrange
|
|
99
|
-
const event = (0, test_utils_1.createMockEvent)('http://localhost:0', {
|
|
100
|
-
payload: { event_type: extraction_1.EventType.UnknownEventType },
|
|
101
|
-
});
|
|
102
|
-
// Act
|
|
103
|
-
await (0, spawn_1.spawn)({ event, initialState: {} });
|
|
104
|
-
// Assert: no worker process should be started, but the platform should
|
|
105
|
-
// still receive a terminal event (so the run doesn't hang).
|
|
106
|
-
expect(create_worker_1.createWorker).not.toHaveBeenCalled();
|
|
107
|
-
expect(control_protocol_1.emit).toHaveBeenCalledWith(expect.objectContaining({ event, eventType: expect.any(String) }));
|
|
108
|
-
});
|
|
109
|
-
it('should reject the returned promise when createWorker throws', async () => {
|
|
110
|
-
// Arrange
|
|
111
|
-
create_worker_1.createWorker.mockRejectedValue(new Error('worker boom'));
|
|
112
|
-
const event = (0, test_utils_1.createMockEvent)('http://localhost:0', {
|
|
113
|
-
payload: { event_type: extraction_1.EventType.StartExtractingData },
|
|
114
|
-
});
|
|
115
|
-
// Act & Assert
|
|
116
|
-
await expect((0, spawn_1.spawn)({
|
|
117
|
-
event,
|
|
118
|
-
initialState: {},
|
|
119
|
-
baseWorkerPath: '/fake',
|
|
120
|
-
options: {
|
|
121
|
-
workerPathOverrides: {
|
|
122
|
-
[extraction_1.EventType.StartExtractingData]: '/path.js',
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
})).rejects.toThrow('worker boom');
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
// ---------------------------------------------------------------------------
|
|
129
|
-
// Spawn class — lifecycle tests
|
|
130
|
-
// ---------------------------------------------------------------------------
|
|
131
|
-
describe('Spawn class', () => {
|
|
132
|
-
let worker;
|
|
133
|
-
let resolveMock;
|
|
134
|
-
beforeEach(() => {
|
|
135
|
-
jest.clearAllMocks();
|
|
136
|
-
jest.useFakeTimers({ legacyFakeTimers: true });
|
|
137
|
-
worker = makeWorker();
|
|
138
|
-
resolveMock = jest.fn();
|
|
139
|
-
});
|
|
140
|
-
afterEach(() => {
|
|
141
|
-
jest.useRealTimers();
|
|
142
|
-
});
|
|
143
|
-
// -------------------------------------------------------------------------
|
|
144
|
-
// WorkerMessageFailed captured and propagated in error emit
|
|
145
|
-
// -------------------------------------------------------------------------
|
|
146
|
-
it('should include the WorkerMessageFailed reason in the error event emitted to the platform', async () => {
|
|
147
|
-
// Arrange
|
|
148
|
-
buildSpawn({ worker, resolve: resolveMock });
|
|
149
|
-
// Act
|
|
150
|
-
worker.emit(workers_1.WorkerEvent.WorkerMessage, {
|
|
151
|
-
subject: workers_1.WorkerMessageSubject.WorkerMessageFailed,
|
|
152
|
-
payload: { message: 'connector exploded' },
|
|
153
|
-
});
|
|
154
|
-
worker.emit(workers_1.WorkerEvent.WorkerExit, 1);
|
|
155
|
-
await Promise.resolve();
|
|
156
|
-
await Promise.resolve();
|
|
157
|
-
// Assert: the platform receives an error event whose message contains
|
|
158
|
-
// the reason sent by the worker — this is what operators see in the run log.
|
|
159
|
-
expect(control_protocol_1.emit).toHaveBeenCalledWith(expect.objectContaining({
|
|
160
|
-
data: expect.objectContaining({
|
|
161
|
-
error: expect.objectContaining({
|
|
162
|
-
message: expect.stringContaining('connector exploded'),
|
|
163
|
-
}),
|
|
164
|
-
}),
|
|
165
|
-
}));
|
|
166
|
-
expect(resolveMock).toHaveBeenCalled();
|
|
167
|
-
});
|
|
168
|
-
it('should emit a data extraction error when the worker exits without ever emitting', async () => {
|
|
169
|
-
// Arrange
|
|
170
|
-
buildSpawn({ worker, resolve: resolveMock });
|
|
171
|
-
// Act
|
|
172
|
-
worker.emit(workers_1.WorkerEvent.WorkerExit, 1);
|
|
173
|
-
await Promise.resolve();
|
|
174
|
-
await Promise.resolve();
|
|
175
|
-
// Assert: a silent worker exit must surface a DataExtractionError to the
|
|
176
|
-
// platform with a non-empty message. The event type is the upstream
|
|
177
|
-
// contract; the exact message wording is implementation detail.
|
|
178
|
-
expect(control_protocol_1.emit).toHaveBeenCalledTimes(1);
|
|
179
|
-
const [emitted] = control_protocol_1.emit.mock.calls[0];
|
|
180
|
-
expect(emitted.eventType).toBe(extraction_1.ExtractorEventType.DataExtractionError);
|
|
181
|
-
expect(emitted.data.error.message).toEqual(expect.any(String));
|
|
182
|
-
expect(emitted.data.error.message.length).toBeGreaterThan(0);
|
|
183
|
-
expect(resolveMock).toHaveBeenCalled();
|
|
184
|
-
});
|
|
185
|
-
// Soft-timeout and hard-timeout timer behavior is covered end-to-end by
|
|
186
|
-
// src/tests/timeout-handling/ (real workers, real timers). Unit tests with
|
|
187
|
-
// fake timers only re-asserted the mocked setTimeout call and gave no signal.
|
|
188
|
-
// -------------------------------------------------------------------------
|
|
189
|
-
// Memory monitoring — error clears the interval
|
|
190
|
-
// -------------------------------------------------------------------------
|
|
191
|
-
it('should clear the memory monitoring interval when getMemoryUsage throws to prevent repeated crashes', async () => {
|
|
192
|
-
// Arrange
|
|
193
|
-
helpers_1.getMemoryUsage.mockImplementation(() => {
|
|
194
|
-
throw new Error('OOM');
|
|
195
|
-
});
|
|
196
|
-
const clearIntervalSpy = jest.spyOn(global, 'clearInterval');
|
|
197
|
-
buildSpawn({ worker, resolve: resolveMock });
|
|
198
|
-
// Act
|
|
199
|
-
jest.advanceTimersByTime(30001); // MEMORY_LOG_INTERVAL = 30 s
|
|
200
|
-
await Promise.resolve();
|
|
201
|
-
// Assert
|
|
202
|
-
expect(clearIntervalSpy).toHaveBeenCalled();
|
|
203
|
-
});
|
|
204
|
-
// -------------------------------------------------------------------------
|
|
205
|
-
// Soft-timeout race: worker emits AFTER softTimeoutSent — no double-emit
|
|
206
|
-
// -------------------------------------------------------------------------
|
|
207
|
-
it('should NOT emit an error when the worker successfully emits just after receiving the soft-timeout signal', async () => {
|
|
208
|
-
// Arrange
|
|
209
|
-
buildSpawn({ worker, resolve: resolveMock });
|
|
210
|
-
// Act: trigger soft timeout — sends WorkerMessageExit to the worker
|
|
211
|
-
jest.advanceTimersByTime(constants_1.DEFAULT_LAMBDA_TIMEOUT + 1);
|
|
212
|
-
await Promise.resolve();
|
|
213
|
-
// Confirm the soft-timeout path actually fired — guards against a silent
|
|
214
|
-
// pass if the timeout constant changes and the timer never runs.
|
|
215
|
-
expect(worker.postMessage).toHaveBeenCalledWith(expect.objectContaining({
|
|
216
|
-
subject: workers_1.WorkerMessageSubject.WorkerMessageExit,
|
|
217
|
-
}));
|
|
218
|
-
// Worker responds: emits its event successfully, then exits normally
|
|
219
|
-
worker.emit(workers_1.WorkerEvent.WorkerMessage, {
|
|
220
|
-
subject: workers_1.WorkerMessageSubject.WorkerMessageEmitted,
|
|
221
|
-
});
|
|
222
|
-
worker.emit(workers_1.WorkerEvent.WorkerExit, 0);
|
|
223
|
-
// The exit handler defers via setImmediate when softTimeoutSent=true
|
|
224
|
-
jest.runAllImmediates();
|
|
225
|
-
await Promise.resolve();
|
|
226
|
-
await Promise.resolve();
|
|
227
|
-
// Assert: no error should reach the platform — the worker completed its job
|
|
228
|
-
const errorEmits = control_protocol_1.emit.mock.calls.filter((call) => { var _a, _b; return (_b = (_a = call[0]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error; });
|
|
229
|
-
expect(errorEmits).toHaveLength(0);
|
|
230
|
-
expect(resolveMock).toHaveBeenCalled();
|
|
231
|
-
});
|
|
232
|
-
});
|
package/dist/repo/repo.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repo.test.d.ts","sourceRoot":"","sources":["../../src/repo/repo.test.ts"],"names":[],"mappings":""}
|
package/dist/repo/repo.test.js
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const constants_1 = require("../common/constants");
|
|
4
|
-
const test_helpers_1 = require("../tests/test-helpers");
|
|
5
|
-
const jest_setup_1 = require("../tests/jest.setup");
|
|
6
|
-
const test_utils_1 = require("../common/test-utils");
|
|
7
|
-
const types_1 = require("../types");
|
|
8
|
-
const repo_1 = require("./repo");
|
|
9
|
-
jest.mock('../tests/test-helpers', () => (Object.assign(Object.assign({}, jest.requireActual('../tests/test-helpers')), { normalizeItem: jest.fn() })));
|
|
10
|
-
describe(repo_1.Repo.name, () => {
|
|
11
|
-
let repo;
|
|
12
|
-
let normalize;
|
|
13
|
-
beforeEach(() => {
|
|
14
|
-
normalize = jest.fn();
|
|
15
|
-
repo = new repo_1.Repo({
|
|
16
|
-
event: (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
17
|
-
payload: { event_type: types_1.EventType.StartExtractingData },
|
|
18
|
-
}),
|
|
19
|
-
itemType: 'test_item_type',
|
|
20
|
-
normalize,
|
|
21
|
-
onUpload: jest.fn(),
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
afterEach(() => {
|
|
25
|
-
jest.clearAllMocks();
|
|
26
|
-
});
|
|
27
|
-
it('should normalize and push items when array contains items', async () => {
|
|
28
|
-
// Arrange
|
|
29
|
-
const items = (0, test_helpers_1.createItems)(10);
|
|
30
|
-
// Act
|
|
31
|
-
await repo.push(items);
|
|
32
|
-
// Assert
|
|
33
|
-
expect(normalize).toHaveBeenCalledTimes(10);
|
|
34
|
-
const normalizedItems = items.map((item) => (0, test_helpers_1.normalizeItem)(item));
|
|
35
|
-
expect(repo.getItems()).toEqual(normalizedItems);
|
|
36
|
-
});
|
|
37
|
-
it('should not normalize items when normalize function is not provided', async () => {
|
|
38
|
-
// Arrange
|
|
39
|
-
repo = new repo_1.Repo({
|
|
40
|
-
event: (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
41
|
-
payload: { event_type: types_1.EventType.StartExtractingData },
|
|
42
|
-
}),
|
|
43
|
-
itemType: 'test_item_type',
|
|
44
|
-
onUpload: jest.fn(),
|
|
45
|
-
options: {},
|
|
46
|
-
});
|
|
47
|
-
const items = (0, test_helpers_1.createItems)(10);
|
|
48
|
-
// Act
|
|
49
|
-
await repo.push(items);
|
|
50
|
-
// Assert
|
|
51
|
-
expect(normalize).not.toHaveBeenCalled();
|
|
52
|
-
});
|
|
53
|
-
it('[edge] should not push items when items array is empty', async () => {
|
|
54
|
-
// Act
|
|
55
|
-
await repo.push([]);
|
|
56
|
-
// Assert
|
|
57
|
-
expect(repo.getItems()).toEqual([]);
|
|
58
|
-
});
|
|
59
|
-
it('should not normalize items when item type is external_domain_metadata', async () => {
|
|
60
|
-
// Arrange
|
|
61
|
-
repo = new repo_1.Repo({
|
|
62
|
-
event: (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
63
|
-
payload: { event_type: types_1.EventType.StartExtractingData },
|
|
64
|
-
}),
|
|
65
|
-
itemType: constants_1.AirSyncDefaultItemTypes.EXTERNAL_DOMAIN_METADATA,
|
|
66
|
-
normalize,
|
|
67
|
-
onUpload: jest.fn(),
|
|
68
|
-
options: {},
|
|
69
|
-
});
|
|
70
|
-
const items = (0, test_helpers_1.createItems)(10);
|
|
71
|
-
// Act
|
|
72
|
-
await repo.push(items);
|
|
73
|
-
// Assert
|
|
74
|
-
expect(normalize).not.toHaveBeenCalled();
|
|
75
|
-
});
|
|
76
|
-
it('should not normalize items when item type is ssor_attachment', async () => {
|
|
77
|
-
// Arrange
|
|
78
|
-
repo = new repo_1.Repo({
|
|
79
|
-
event: (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
80
|
-
payload: { event_type: types_1.EventType.StartExtractingData },
|
|
81
|
-
}),
|
|
82
|
-
itemType: constants_1.SSOR_ATTACHMENT,
|
|
83
|
-
normalize,
|
|
84
|
-
onUpload: jest.fn(),
|
|
85
|
-
options: {},
|
|
86
|
-
});
|
|
87
|
-
const items = (0, test_helpers_1.createItems)(10);
|
|
88
|
-
// Act
|
|
89
|
-
await repo.push(items);
|
|
90
|
-
// Assert
|
|
91
|
-
expect(normalize).not.toHaveBeenCalled();
|
|
92
|
-
});
|
|
93
|
-
it('should leave 5 items in the items array after pushing 2005 items with batch size of 2000', async () => {
|
|
94
|
-
// Arrange
|
|
95
|
-
const items = (0, test_helpers_1.createItems)(2005);
|
|
96
|
-
// Act
|
|
97
|
-
await repo.push(items);
|
|
98
|
-
// Assert
|
|
99
|
-
expect(repo.getItems().length).toBe(5);
|
|
100
|
-
});
|
|
101
|
-
it('should normalize all items when pushing 4005 items with batch size of 2000', async () => {
|
|
102
|
-
// Arrange
|
|
103
|
-
const items = (0, test_helpers_1.createItems)(4005);
|
|
104
|
-
// Act
|
|
105
|
-
await repo.push(items);
|
|
106
|
-
// Assert
|
|
107
|
-
expect(normalize).toHaveBeenCalledTimes(4005);
|
|
108
|
-
});
|
|
109
|
-
it('should upload 2 batches when pushing 4005 items with batch size of 2000', async () => {
|
|
110
|
-
// Arrange
|
|
111
|
-
const uploadSpy = jest.spyOn(repo, 'upload');
|
|
112
|
-
const items = (0, test_helpers_1.createItems)(4005);
|
|
113
|
-
// Act
|
|
114
|
-
await repo.push(items);
|
|
115
|
-
// Assert
|
|
116
|
-
expect(uploadSpy).toHaveBeenCalledTimes(2);
|
|
117
|
-
uploadSpy.mockRestore();
|
|
118
|
-
});
|
|
119
|
-
it('should leave 5 items in array after pushing 4005 items with batch size of 2000', async () => {
|
|
120
|
-
// Arrange
|
|
121
|
-
const items = (0, test_helpers_1.createItems)(4005);
|
|
122
|
-
// Act
|
|
123
|
-
await repo.push(items);
|
|
124
|
-
// Assert
|
|
125
|
-
expect(repo.getItems().length).toBe(5);
|
|
126
|
-
});
|
|
127
|
-
describe('should take batch size into account', () => {
|
|
128
|
-
beforeEach(() => {
|
|
129
|
-
repo = new repo_1.Repo({
|
|
130
|
-
event: (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
131
|
-
payload: { event_type: types_1.EventType.StartExtractingData },
|
|
132
|
-
}),
|
|
133
|
-
itemType: 'test_item_type',
|
|
134
|
-
normalize,
|
|
135
|
-
onUpload: jest.fn(),
|
|
136
|
-
options: {
|
|
137
|
-
batchSize: 50,
|
|
138
|
-
},
|
|
139
|
-
});
|
|
140
|
-
});
|
|
141
|
-
it('should empty the items array after pushing 50 items with batch size of 50', async () => {
|
|
142
|
-
// Arrange
|
|
143
|
-
const items = (0, test_helpers_1.createItems)(50);
|
|
144
|
-
// Act
|
|
145
|
-
await repo.push(items);
|
|
146
|
-
// Assert
|
|
147
|
-
expect(repo.getItems()).toEqual([]);
|
|
148
|
-
});
|
|
149
|
-
it('should leave 5 items in the items array after pushing 205 items with batch size of 50', async () => {
|
|
150
|
-
// Arrange
|
|
151
|
-
const items = (0, test_helpers_1.createItems)(205);
|
|
152
|
-
// Act
|
|
153
|
-
await repo.push(items);
|
|
154
|
-
// Assert
|
|
155
|
-
expect(repo.getItems().length).toBe(5);
|
|
156
|
-
});
|
|
157
|
-
it('should normalize all items when pushing 205 items with batch size of 50', async () => {
|
|
158
|
-
// Arrange
|
|
159
|
-
const items = (0, test_helpers_1.createItems)(205);
|
|
160
|
-
// Act
|
|
161
|
-
await repo.push(items);
|
|
162
|
-
// Assert
|
|
163
|
-
expect(normalize).toHaveBeenCalledTimes(205);
|
|
164
|
-
});
|
|
165
|
-
it('should upload 4 batches when pushing 205 items with batch size of 50', async () => {
|
|
166
|
-
// Arrange
|
|
167
|
-
const uploadSpy = jest.spyOn(repo, 'upload');
|
|
168
|
-
const items = (0, test_helpers_1.createItems)(205);
|
|
169
|
-
// Act
|
|
170
|
-
await repo.push(items);
|
|
171
|
-
// Assert
|
|
172
|
-
expect(uploadSpy).toHaveBeenCalledTimes(4);
|
|
173
|
-
uploadSpy.mockRestore();
|
|
174
|
-
});
|
|
175
|
-
it('should leave 5 items in array after pushing 205 items with batch size of 50', async () => {
|
|
176
|
-
// Arrange
|
|
177
|
-
const items = (0, test_helpers_1.createItems)(205);
|
|
178
|
-
// Act
|
|
179
|
-
await repo.push(items);
|
|
180
|
-
// Assert
|
|
181
|
-
expect(repo.getItems().length).toBe(5);
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.extract-window.test.d.ts","sourceRoot":"","sources":["../../src/state/state.extract-window.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const jest_setup_1 = require("../tests/jest.setup");
|
|
4
|
-
const test_utils_1 = require("../common/test-utils");
|
|
5
|
-
const extraction_1 = require("../types/extraction");
|
|
6
|
-
const extraction_state_1 = require("./extraction-state");
|
|
7
|
-
describe('State — extraction window validation', () => {
|
|
8
|
-
let fetchStateSpy;
|
|
9
|
-
let processExitSpy;
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
jest.clearAllMocks();
|
|
12
|
-
jest.restoreAllMocks();
|
|
13
|
-
fetchStateSpy = jest.spyOn(extraction_state_1.ExtractionState.prototype, 'fetchState');
|
|
14
|
-
processExitSpy = jest.spyOn(process, 'exit').mockImplementation(() => {
|
|
15
|
-
throw new Error('process.exit called');
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
describe('Enhanced Control Protocol - extraction window validation', () => {
|
|
19
|
-
it('should exit the process if extract_from >= extract_to', async () => {
|
|
20
|
-
// Arrange: start is after end (inverted window)
|
|
21
|
-
const event = (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
22
|
-
payload: {
|
|
23
|
-
event_type: extraction_1.EventType.StartExtractingMetadata,
|
|
24
|
-
event_context: {
|
|
25
|
-
extraction_start_time: {
|
|
26
|
-
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
27
|
-
value: '2025-06-01T00:00:00Z',
|
|
28
|
-
},
|
|
29
|
-
extraction_end_time: {
|
|
30
|
-
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
31
|
-
value: '2024-01-01T00:00:00Z',
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
const stringifiedState = JSON.stringify({
|
|
37
|
-
snapInVersionId: 'test_snap_in_version_id',
|
|
38
|
-
});
|
|
39
|
-
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
40
|
-
// Act & Assert
|
|
41
|
-
await expect((0, extraction_state_1.createExtractionState)({
|
|
42
|
-
event,
|
|
43
|
-
initialState: {},
|
|
44
|
-
initialDomainMapping: {},
|
|
45
|
-
})).rejects.toThrow('process.exit called');
|
|
46
|
-
expect(processExitSpy).toHaveBeenCalledWith(1);
|
|
47
|
-
});
|
|
48
|
-
it('should exit the process if extract_from equals extract_to', async () => {
|
|
49
|
-
// Arrange: start equals end (zero-width window)
|
|
50
|
-
const event = (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
51
|
-
payload: {
|
|
52
|
-
event_type: extraction_1.EventType.StartExtractingMetadata,
|
|
53
|
-
event_context: {
|
|
54
|
-
extraction_start_time: {
|
|
55
|
-
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
56
|
-
value: '2024-06-01T00:00:00Z',
|
|
57
|
-
},
|
|
58
|
-
extraction_end_time: {
|
|
59
|
-
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
60
|
-
value: '2024-06-01T00:00:00Z',
|
|
61
|
-
},
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
const stringifiedState = JSON.stringify({
|
|
66
|
-
snapInVersionId: 'test_snap_in_version_id',
|
|
67
|
-
});
|
|
68
|
-
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
69
|
-
// Act & Assert
|
|
70
|
-
await expect((0, extraction_state_1.createExtractionState)({
|
|
71
|
-
event,
|
|
72
|
-
initialState: {},
|
|
73
|
-
initialDomainMapping: {},
|
|
74
|
-
})).rejects.toThrow('process.exit called');
|
|
75
|
-
expect(processExitSpy).toHaveBeenCalledWith(1);
|
|
76
|
-
});
|
|
77
|
-
it('should not exit when extract_from < extract_to', async () => {
|
|
78
|
-
// Arrange: valid window
|
|
79
|
-
const event = (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
80
|
-
payload: {
|
|
81
|
-
event_type: extraction_1.EventType.StartExtractingMetadata,
|
|
82
|
-
event_context: {
|
|
83
|
-
extraction_start_time: {
|
|
84
|
-
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
85
|
-
value: '2024-01-01T00:00:00Z',
|
|
86
|
-
},
|
|
87
|
-
extraction_end_time: {
|
|
88
|
-
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
89
|
-
value: '2025-06-01T00:00:00Z',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
const stringifiedState = JSON.stringify({
|
|
95
|
-
snapInVersionId: 'test_snap_in_version_id',
|
|
96
|
-
});
|
|
97
|
-
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
98
|
-
// Act
|
|
99
|
-
await (0, extraction_state_1.createExtractionState)({
|
|
100
|
-
event,
|
|
101
|
-
initialState: {},
|
|
102
|
-
initialDomainMapping: {},
|
|
103
|
-
});
|
|
104
|
-
// Assert: process.exit should NOT have been called
|
|
105
|
-
expect(processExitSpy).not.toHaveBeenCalled();
|
|
106
|
-
});
|
|
107
|
-
it('should not validate when only extract_from is set', async () => {
|
|
108
|
-
// Arrange: only start, no end
|
|
109
|
-
const event = (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
110
|
-
payload: {
|
|
111
|
-
event_type: extraction_1.EventType.StartExtractingMetadata,
|
|
112
|
-
event_context: {
|
|
113
|
-
extraction_start_time: {
|
|
114
|
-
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
115
|
-
value: '2024-01-01T00:00:00Z',
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
});
|
|
120
|
-
const stringifiedState = JSON.stringify({
|
|
121
|
-
snapInVersionId: 'test_snap_in_version_id',
|
|
122
|
-
});
|
|
123
|
-
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
124
|
-
// Act
|
|
125
|
-
await (0, extraction_state_1.createExtractionState)({
|
|
126
|
-
event,
|
|
127
|
-
initialState: {},
|
|
128
|
-
initialDomainMapping: {},
|
|
129
|
-
});
|
|
130
|
-
// Assert: process.exit should NOT have been called
|
|
131
|
-
expect(processExitSpy).not.toHaveBeenCalled();
|
|
132
|
-
});
|
|
133
|
-
it('should not exit when extract_from is UNBOUNDED and extract_to is a real timestamp', async () => {
|
|
134
|
-
// Arrange: UNBOUNDED start (epoch) with a real ABSOLUTE end timestamp
|
|
135
|
-
const event = (0, test_utils_1.createMockEvent)(jest_setup_1.mockServer.baseUrl, {
|
|
136
|
-
payload: {
|
|
137
|
-
event_type: extraction_1.EventType.StartExtractingMetadata,
|
|
138
|
-
event_context: {
|
|
139
|
-
extraction_start_time: {
|
|
140
|
-
type: extraction_1.TimeValueType.UNBOUNDED,
|
|
141
|
-
},
|
|
142
|
-
extraction_end_time: {
|
|
143
|
-
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
144
|
-
value: '2025-06-01T00:00:00Z',
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
const stringifiedState = JSON.stringify({
|
|
150
|
-
snapInVersionId: 'test_snap_in_version_id',
|
|
151
|
-
});
|
|
152
|
-
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
153
|
-
// Act
|
|
154
|
-
await (0, extraction_state_1.createExtractionState)({
|
|
155
|
-
event,
|
|
156
|
-
initialState: {},
|
|
157
|
-
initialDomainMapping: {},
|
|
158
|
-
});
|
|
159
|
-
// Assert: process.exit should NOT have been called
|
|
160
|
-
expect(processExitSpy).not.toHaveBeenCalled();
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"state.pending-boundaries.test.d.ts","sourceRoot":"","sources":["../../src/state/state.pending-boundaries.test.ts"],"names":[],"mappings":""}
|