@devrev/ts-adaas 1.17.1-beta.6 → 1.17.1-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attachments-streaming/attachments-streaming-pool.d.ts.map +1 -1
- package/dist/common/constants.d.ts +8 -0
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +9 -1
- package/dist/common/time-value-resolver.d.ts +47 -0
- package/dist/common/time-value-resolver.d.ts.map +1 -0
- package/dist/common/time-value-resolver.js +149 -0
- package/dist/common/time-value-resolver.test.d.ts +2 -0
- package/dist/common/time-value-resolver.test.d.ts.map +1 -0
- package/dist/common/time-value-resolver.test.js +273 -0
- package/dist/multithreading/worker-adapter/worker-adapter.d.ts.map +1 -1
- package/dist/multithreading/worker-adapter/worker-adapter.js +19 -0
- package/dist/multithreading/worker-adapter/worker-adapter.test.js +192 -6
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.interfaces.d.ts +22 -0
- package/dist/state/state.interfaces.d.ts.map +1 -1
- package/dist/state/state.interfaces.js +4 -0
- package/dist/state/state.js +68 -0
- package/dist/state/state.test.js +462 -0
- package/dist/types/extraction.d.ts +77 -1
- package/dist/types/extraction.d.ts.map +1 -1
- package/dist/types/extraction.js +43 -1
- package/dist/types/extraction.test.js +22 -11
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +6 -1
- package/package.json +1 -1
package/dist/state/state.test.js
CHANGED
|
@@ -223,6 +223,468 @@ describe(state_1.State.name, () => {
|
|
|
223
223
|
// Assert
|
|
224
224
|
expect(installInitialDomainMappingSpy).toHaveBeenCalled();
|
|
225
225
|
});
|
|
226
|
+
describe('Enhanced Control Protocol - TimeValue resolution failures', () => {
|
|
227
|
+
it('should exit the process if extraction_start_time resolution fails', async () => {
|
|
228
|
+
// Arrange: WORKERS_NEWEST type but state has no workersNewest
|
|
229
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
230
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
231
|
+
eventContextOverrides: {
|
|
232
|
+
extraction_start_time: {
|
|
233
|
+
type: extraction_1.TimeValueType.WORKERS_NEWEST,
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
});
|
|
237
|
+
const stringifiedState = JSON.stringify({
|
|
238
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
239
|
+
workers_oldest: '',
|
|
240
|
+
workers_newest: '',
|
|
241
|
+
});
|
|
242
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
243
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
244
|
+
jest.spyOn(console, 'error').mockImplementation(() => { });
|
|
245
|
+
// Act & Assert
|
|
246
|
+
await expect((0, state_1.createAdapterState)({
|
|
247
|
+
event,
|
|
248
|
+
initialState: {},
|
|
249
|
+
initialDomainMapping: {},
|
|
250
|
+
})).rejects.toThrow('process.exit called');
|
|
251
|
+
expect(processExitSpy).toHaveBeenCalledWith(1);
|
|
252
|
+
});
|
|
253
|
+
it('should exit the process if extraction_end_time resolution fails', async () => {
|
|
254
|
+
// Arrange: WORKERS_NEWEST type but state has no workersNewest
|
|
255
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
256
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
257
|
+
eventContextOverrides: {
|
|
258
|
+
extraction_start_time: {
|
|
259
|
+
type: extraction_1.TimeValueType.UNBOUNDED,
|
|
260
|
+
},
|
|
261
|
+
extraction_end_time: {
|
|
262
|
+
type: extraction_1.TimeValueType.WORKERS_NEWEST,
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
});
|
|
266
|
+
const stringifiedState = JSON.stringify({
|
|
267
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
268
|
+
workers_oldest: '',
|
|
269
|
+
workers_newest: '',
|
|
270
|
+
});
|
|
271
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
272
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
273
|
+
jest.spyOn(console, 'error').mockImplementation(() => { });
|
|
274
|
+
// Act & Assert
|
|
275
|
+
await expect((0, state_1.createAdapterState)({
|
|
276
|
+
event,
|
|
277
|
+
initialState: {},
|
|
278
|
+
initialDomainMapping: {},
|
|
279
|
+
})).rejects.toThrow('process.exit called');
|
|
280
|
+
expect(processExitSpy).toHaveBeenCalledWith(1);
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
describe('Backwards compatibility - missing TimeValue type', () => {
|
|
284
|
+
it('should skip resolution when extraction_start_time has no type', async () => {
|
|
285
|
+
// Arrange: platform sends extraction_start_time without a type field (old platform version)
|
|
286
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
287
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
288
|
+
eventContextOverrides: {
|
|
289
|
+
extraction_start_time: {},
|
|
290
|
+
extraction_end_time: {
|
|
291
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
292
|
+
value: '2025-06-01T00:00:00Z',
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
contextOverrides: {
|
|
296
|
+
snap_in_version_id: 'test_snap_in_version_id',
|
|
297
|
+
},
|
|
298
|
+
});
|
|
299
|
+
const stringifiedState = JSON.stringify({
|
|
300
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
301
|
+
});
|
|
302
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
303
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
304
|
+
// Act
|
|
305
|
+
const state = await (0, state_1.createAdapterState)({
|
|
306
|
+
event,
|
|
307
|
+
initialState: {},
|
|
308
|
+
initialDomainMapping: {},
|
|
309
|
+
});
|
|
310
|
+
// Assert: should not crash, extract_from is not set, extract_to is resolved
|
|
311
|
+
expect(processExitSpy).not.toHaveBeenCalled();
|
|
312
|
+
expect(event.payload.event_context.extract_from).toBeUndefined();
|
|
313
|
+
expect(event.payload.event_context.extract_to).toBe('2025-06-01T00:00:00.000Z');
|
|
314
|
+
expect(state.state.pendingWorkersNewest).toBe('2025-06-01T00:00:00.000Z');
|
|
315
|
+
});
|
|
316
|
+
it('should skip resolution when extraction_end_time has no type', async () => {
|
|
317
|
+
// Arrange: platform sends extraction_end_time without a type field
|
|
318
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
319
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
320
|
+
eventContextOverrides: {
|
|
321
|
+
extraction_start_time: {
|
|
322
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
323
|
+
value: '2024-01-01T00:00:00Z',
|
|
324
|
+
},
|
|
325
|
+
extraction_end_time: {},
|
|
326
|
+
},
|
|
327
|
+
contextOverrides: {
|
|
328
|
+
snap_in_version_id: 'test_snap_in_version_id',
|
|
329
|
+
},
|
|
330
|
+
});
|
|
331
|
+
const stringifiedState = JSON.stringify({
|
|
332
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
333
|
+
});
|
|
334
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
335
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
336
|
+
// Act
|
|
337
|
+
await (0, state_1.createAdapterState)({
|
|
338
|
+
event,
|
|
339
|
+
initialState: {},
|
|
340
|
+
initialDomainMapping: {},
|
|
341
|
+
});
|
|
342
|
+
// Assert: should not crash, extract_to is not set, extract_from is resolved
|
|
343
|
+
expect(processExitSpy).not.toHaveBeenCalled();
|
|
344
|
+
expect(event.payload.event_context.extract_from).toBe('2024-01-01T00:00:00.000Z');
|
|
345
|
+
expect(event.payload.event_context.extract_to).toBeUndefined();
|
|
346
|
+
});
|
|
347
|
+
it('should skip resolution when both extraction times have no type', async () => {
|
|
348
|
+
// Arrange: platform sends both time values without type fields
|
|
349
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
350
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
351
|
+
eventContextOverrides: {
|
|
352
|
+
extraction_start_time: { value: 'some-value' },
|
|
353
|
+
extraction_end_time: { value: 'some-value' },
|
|
354
|
+
},
|
|
355
|
+
contextOverrides: {
|
|
356
|
+
snap_in_version_id: 'test_snap_in_version_id',
|
|
357
|
+
},
|
|
358
|
+
});
|
|
359
|
+
const stringifiedState = JSON.stringify({
|
|
360
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
361
|
+
});
|
|
362
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
363
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
364
|
+
// Act
|
|
365
|
+
await (0, state_1.createAdapterState)({
|
|
366
|
+
event,
|
|
367
|
+
initialState: {},
|
|
368
|
+
initialDomainMapping: {},
|
|
369
|
+
});
|
|
370
|
+
// Assert: should not crash, neither extraction time is resolved
|
|
371
|
+
expect(processExitSpy).not.toHaveBeenCalled();
|
|
372
|
+
expect(event.payload.event_context.extract_from).toBeUndefined();
|
|
373
|
+
expect(event.payload.event_context.extract_to).toBeUndefined();
|
|
374
|
+
});
|
|
375
|
+
});
|
|
376
|
+
describe('Enhanced Control Protocol - extraction window validation', () => {
|
|
377
|
+
it('should exit the process if extract_from >= extract_to', async () => {
|
|
378
|
+
// Arrange: start is after end (inverted window)
|
|
379
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
380
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
381
|
+
eventContextOverrides: {
|
|
382
|
+
extraction_start_time: {
|
|
383
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
384
|
+
value: '2025-06-01T00:00:00Z',
|
|
385
|
+
},
|
|
386
|
+
extraction_end_time: {
|
|
387
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
388
|
+
value: '2024-01-01T00:00:00Z',
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
});
|
|
392
|
+
const stringifiedState = JSON.stringify({
|
|
393
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
394
|
+
});
|
|
395
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
396
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
397
|
+
jest.spyOn(console, 'error').mockImplementation(() => { });
|
|
398
|
+
// Act & Assert
|
|
399
|
+
await expect((0, state_1.createAdapterState)({
|
|
400
|
+
event,
|
|
401
|
+
initialState: {},
|
|
402
|
+
initialDomainMapping: {},
|
|
403
|
+
})).rejects.toThrow('process.exit called');
|
|
404
|
+
expect(processExitSpy).toHaveBeenCalledWith(1);
|
|
405
|
+
});
|
|
406
|
+
it('should exit the process if extract_from equals extract_to', async () => {
|
|
407
|
+
// Arrange: start equals end (zero-width window)
|
|
408
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
409
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
410
|
+
eventContextOverrides: {
|
|
411
|
+
extraction_start_time: {
|
|
412
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
413
|
+
value: '2024-06-01T00:00:00Z',
|
|
414
|
+
},
|
|
415
|
+
extraction_end_time: {
|
|
416
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
417
|
+
value: '2024-06-01T00:00:00Z',
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
});
|
|
421
|
+
const stringifiedState = JSON.stringify({
|
|
422
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
423
|
+
});
|
|
424
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
425
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
426
|
+
jest.spyOn(console, 'error').mockImplementation(() => { });
|
|
427
|
+
// Act & Assert
|
|
428
|
+
await expect((0, state_1.createAdapterState)({
|
|
429
|
+
event,
|
|
430
|
+
initialState: {},
|
|
431
|
+
initialDomainMapping: {},
|
|
432
|
+
})).rejects.toThrow('process.exit called');
|
|
433
|
+
expect(processExitSpy).toHaveBeenCalledWith(1);
|
|
434
|
+
});
|
|
435
|
+
it('should not exit when extract_from < extract_to', async () => {
|
|
436
|
+
// Arrange: valid window
|
|
437
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
438
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
439
|
+
eventContextOverrides: {
|
|
440
|
+
extraction_start_time: {
|
|
441
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
442
|
+
value: '2024-01-01T00:00:00Z',
|
|
443
|
+
},
|
|
444
|
+
extraction_end_time: {
|
|
445
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
446
|
+
value: '2025-06-01T00:00:00Z',
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
});
|
|
450
|
+
const stringifiedState = JSON.stringify({
|
|
451
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
452
|
+
});
|
|
453
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
454
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
455
|
+
// Act
|
|
456
|
+
await (0, state_1.createAdapterState)({
|
|
457
|
+
event,
|
|
458
|
+
initialState: {},
|
|
459
|
+
initialDomainMapping: {},
|
|
460
|
+
});
|
|
461
|
+
// Assert: process.exit should NOT have been called
|
|
462
|
+
expect(processExitSpy).not.toHaveBeenCalled();
|
|
463
|
+
});
|
|
464
|
+
it('should not validate when only extract_from is set', async () => {
|
|
465
|
+
// Arrange: only start, no end
|
|
466
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
467
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
468
|
+
eventContextOverrides: {
|
|
469
|
+
extraction_start_time: {
|
|
470
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
471
|
+
value: '2024-01-01T00:00:00Z',
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
});
|
|
475
|
+
const stringifiedState = JSON.stringify({
|
|
476
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
477
|
+
});
|
|
478
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
479
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
480
|
+
// Act
|
|
481
|
+
await (0, state_1.createAdapterState)({
|
|
482
|
+
event,
|
|
483
|
+
initialState: {},
|
|
484
|
+
initialDomainMapping: {},
|
|
485
|
+
});
|
|
486
|
+
// Assert: process.exit should NOT have been called
|
|
487
|
+
expect(processExitSpy).not.toHaveBeenCalled();
|
|
488
|
+
});
|
|
489
|
+
it('should not exit when extract_from is UNBOUNDED and extract_to is a real timestamp', async () => {
|
|
490
|
+
// Arrange: UNBOUNDED start (epoch) with a real ABSOLUTE end timestamp
|
|
491
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
492
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
493
|
+
eventContextOverrides: {
|
|
494
|
+
extraction_start_time: {
|
|
495
|
+
type: extraction_1.TimeValueType.UNBOUNDED,
|
|
496
|
+
},
|
|
497
|
+
extraction_end_time: {
|
|
498
|
+
type: extraction_1.TimeValueType.ABSOLUTE_TIME,
|
|
499
|
+
value: '2025-06-01T00:00:00Z',
|
|
500
|
+
},
|
|
501
|
+
},
|
|
502
|
+
});
|
|
503
|
+
const stringifiedState = JSON.stringify({
|
|
504
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
505
|
+
});
|
|
506
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
507
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
508
|
+
// Act
|
|
509
|
+
await (0, state_1.createAdapterState)({
|
|
510
|
+
event,
|
|
511
|
+
initialState: {},
|
|
512
|
+
initialDomainMapping: {},
|
|
513
|
+
});
|
|
514
|
+
// Assert: process.exit should NOT have been called
|
|
515
|
+
expect(processExitSpy).not.toHaveBeenCalled();
|
|
516
|
+
});
|
|
517
|
+
});
|
|
518
|
+
describe('Pending extraction boundaries (pendingWorkersOldest/pendingWorkersNewest)', () => {
|
|
519
|
+
const FIXED_NOW = '2026-03-26T10:00:00.000Z';
|
|
520
|
+
beforeEach(() => {
|
|
521
|
+
jest.useFakeTimers();
|
|
522
|
+
jest.setSystemTime(new Date(FIXED_NOW));
|
|
523
|
+
});
|
|
524
|
+
afterEach(() => {
|
|
525
|
+
jest.useRealTimers();
|
|
526
|
+
});
|
|
527
|
+
it('should store resolved values in pendingWorkersOldest/pendingWorkersNewest on StartExtractingData', async () => {
|
|
528
|
+
// Arrange
|
|
529
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
530
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
531
|
+
eventContextOverrides: {
|
|
532
|
+
extraction_start_time: {
|
|
533
|
+
type: extraction_1.TimeValueType.UNBOUNDED,
|
|
534
|
+
},
|
|
535
|
+
extraction_end_time: {
|
|
536
|
+
type: extraction_1.TimeValueType.CURRENT_TIME,
|
|
537
|
+
},
|
|
538
|
+
},
|
|
539
|
+
contextOverrides: {
|
|
540
|
+
snap_in_version_id: '',
|
|
541
|
+
},
|
|
542
|
+
});
|
|
543
|
+
fetchStateSpy.mockRejectedValue({
|
|
544
|
+
isAxiosError: true,
|
|
545
|
+
response: { status: 404 },
|
|
546
|
+
});
|
|
547
|
+
installInitialDomainMappingSpy.mockResolvedValue({ success: true });
|
|
548
|
+
postStateSpy.mockResolvedValue({ success: true });
|
|
549
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
550
|
+
// Act
|
|
551
|
+
const state = await (0, state_1.createAdapterState)({
|
|
552
|
+
event,
|
|
553
|
+
initialState: {},
|
|
554
|
+
initialDomainMapping: {},
|
|
555
|
+
});
|
|
556
|
+
// Assert
|
|
557
|
+
expect(state.state.pendingWorkersOldest).toBe('1970-01-01T00:00:00.000Z');
|
|
558
|
+
expect(state.state.pendingWorkersNewest).toBe(FIXED_NOW);
|
|
559
|
+
expect(event.payload.event_context.extract_from).toBe('1970-01-01T00:00:00.000Z');
|
|
560
|
+
expect(event.payload.event_context.extract_to).toBe(FIXED_NOW);
|
|
561
|
+
});
|
|
562
|
+
it('should overwrite pending values on a retry (new StartExtractingData after failure)', async () => {
|
|
563
|
+
// Arrange: state has stale pending values from a previous failed attempt
|
|
564
|
+
const staleOldest = '2026-03-25T08:00:00.000Z';
|
|
565
|
+
const staleNewest = '2026-03-25T09:00:00.000Z';
|
|
566
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
567
|
+
eventType: extraction_1.EventType.StartExtractingData,
|
|
568
|
+
eventContextOverrides: {
|
|
569
|
+
extraction_start_time: {
|
|
570
|
+
type: extraction_1.TimeValueType.UNBOUNDED,
|
|
571
|
+
},
|
|
572
|
+
extraction_end_time: {
|
|
573
|
+
type: extraction_1.TimeValueType.CURRENT_TIME,
|
|
574
|
+
},
|
|
575
|
+
},
|
|
576
|
+
contextOverrides: {
|
|
577
|
+
snap_in_version_id: 'test_snap_in_version_id',
|
|
578
|
+
},
|
|
579
|
+
});
|
|
580
|
+
const stringifiedState = JSON.stringify({
|
|
581
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
582
|
+
pendingWorkersOldest: staleOldest,
|
|
583
|
+
pendingWorkersNewest: staleNewest,
|
|
584
|
+
});
|
|
585
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
586
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
587
|
+
// Act
|
|
588
|
+
const state = await (0, state_1.createAdapterState)({
|
|
589
|
+
event,
|
|
590
|
+
initialState: {},
|
|
591
|
+
initialDomainMapping: {},
|
|
592
|
+
});
|
|
593
|
+
// Assert: pending values are overwritten with fresh resolution, not stale values
|
|
594
|
+
expect(state.state.pendingWorkersOldest).toBe('1970-01-01T00:00:00.000Z');
|
|
595
|
+
expect(state.state.pendingWorkersNewest).toBe(FIXED_NOW);
|
|
596
|
+
expect(state.state.pendingWorkersNewest).not.toBe(staleNewest);
|
|
597
|
+
});
|
|
598
|
+
it('should reuse pending values from state on ContinueExtractingData instead of re-resolving', async () => {
|
|
599
|
+
// Arrange: state has pending values from a prior StartExtractingData phase
|
|
600
|
+
const pendingOldest = '1970-01-01T00:00:00.000Z';
|
|
601
|
+
const pendingNewest = '2026-03-26T08:00:00.000Z'; // Earlier than FIXED_NOW
|
|
602
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
603
|
+
eventType: extraction_1.EventType.ContinueExtractingData,
|
|
604
|
+
eventContextOverrides: {
|
|
605
|
+
// Platform still sends TimeValue objects, but they should be ignored
|
|
606
|
+
extraction_start_time: {
|
|
607
|
+
type: extraction_1.TimeValueType.CURRENT_TIME,
|
|
608
|
+
},
|
|
609
|
+
extraction_end_time: {
|
|
610
|
+
type: extraction_1.TimeValueType.CURRENT_TIME,
|
|
611
|
+
},
|
|
612
|
+
},
|
|
613
|
+
contextOverrides: {
|
|
614
|
+
snap_in_version_id: 'test_snap_in_version_id',
|
|
615
|
+
},
|
|
616
|
+
});
|
|
617
|
+
const stringifiedState = JSON.stringify({
|
|
618
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
619
|
+
pendingWorkersOldest: pendingOldest,
|
|
620
|
+
pendingWorkersNewest: pendingNewest,
|
|
621
|
+
});
|
|
622
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
623
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
624
|
+
// Act
|
|
625
|
+
const state = await (0, state_1.createAdapterState)({
|
|
626
|
+
event,
|
|
627
|
+
initialState: {},
|
|
628
|
+
initialDomainMapping: {},
|
|
629
|
+
});
|
|
630
|
+
// Assert: uses cached pending values, NOT new Date() resolution
|
|
631
|
+
expect(event.payload.event_context.extract_from).toBe(pendingOldest);
|
|
632
|
+
expect(event.payload.event_context.extract_to).toBe(pendingNewest);
|
|
633
|
+
// Pending values in state remain unchanged
|
|
634
|
+
expect(state.state.pendingWorkersOldest).toBe(pendingOldest);
|
|
635
|
+
expect(state.state.pendingWorkersNewest).toBe(pendingNewest);
|
|
636
|
+
});
|
|
637
|
+
it('should not set extract_from/extract_to on ContinueExtractingData if no pending values exist', async () => {
|
|
638
|
+
// Arrange: state has no pending values (e.g. old state from before this feature)
|
|
639
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
640
|
+
eventType: extraction_1.EventType.ContinueExtractingData,
|
|
641
|
+
contextOverrides: {
|
|
642
|
+
snap_in_version_id: 'test_snap_in_version_id',
|
|
643
|
+
},
|
|
644
|
+
});
|
|
645
|
+
const stringifiedState = JSON.stringify({
|
|
646
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
647
|
+
});
|
|
648
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
649
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
650
|
+
// Act
|
|
651
|
+
await (0, state_1.createAdapterState)({
|
|
652
|
+
event,
|
|
653
|
+
initialState: {},
|
|
654
|
+
initialDomainMapping: {},
|
|
655
|
+
});
|
|
656
|
+
// Assert: no extraction timestamps are set
|
|
657
|
+
expect(event.payload.event_context.extract_from).toBeUndefined();
|
|
658
|
+
expect(event.payload.event_context.extract_to).toBeUndefined();
|
|
659
|
+
});
|
|
660
|
+
it('should reuse pending values on StartExtractingAttachments', async () => {
|
|
661
|
+
// Arrange: state has pending values from the StartExtractingData phase
|
|
662
|
+
const pendingOldest = '1970-01-01T00:00:00.000Z';
|
|
663
|
+
const pendingNewest = '2026-03-26T08:00:00.000Z';
|
|
664
|
+
const event = (0, test_helpers_1.createEvent)({
|
|
665
|
+
eventType: extraction_1.EventType.StartExtractingAttachments,
|
|
666
|
+
contextOverrides: {
|
|
667
|
+
snap_in_version_id: 'test_snap_in_version_id',
|
|
668
|
+
},
|
|
669
|
+
});
|
|
670
|
+
const stringifiedState = JSON.stringify({
|
|
671
|
+
snapInVersionId: 'test_snap_in_version_id',
|
|
672
|
+
pendingWorkersOldest: pendingOldest,
|
|
673
|
+
pendingWorkersNewest: pendingNewest,
|
|
674
|
+
});
|
|
675
|
+
fetchStateSpy.mockResolvedValue({ state: stringifiedState });
|
|
676
|
+
jest.spyOn(console, 'log').mockImplementation(() => { });
|
|
677
|
+
// Act
|
|
678
|
+
await (0, state_1.createAdapterState)({
|
|
679
|
+
event,
|
|
680
|
+
initialState: {},
|
|
681
|
+
initialDomainMapping: {},
|
|
682
|
+
});
|
|
683
|
+
// Assert: pending values are reused
|
|
684
|
+
expect(event.payload.event_context.extract_from).toBe(pendingOldest);
|
|
685
|
+
expect(event.payload.event_context.extract_to).toBe(pendingNewest);
|
|
686
|
+
});
|
|
687
|
+
});
|
|
226
688
|
it('should populate extractionScope from API response', async () => {
|
|
227
689
|
// Arrange
|
|
228
690
|
const event = (0, test_helpers_1.createEvent)({
|
|
@@ -172,6 +172,57 @@ export declare enum InitialSyncScope {
|
|
|
172
172
|
FULL_HISTORY = "full-history",
|
|
173
173
|
TIME_SCOPED = "time-scoped"
|
|
174
174
|
}
|
|
175
|
+
/**
|
|
176
|
+
* TimeUnit is an enum that defines the supported Go duration units for time window calculations.
|
|
177
|
+
* These correspond directly to Go's time.ParseDuration units.
|
|
178
|
+
*/
|
|
179
|
+
export declare enum TimeUnit {
|
|
180
|
+
/** Nanoseconds */
|
|
181
|
+
NANOSECONDS = "ns",
|
|
182
|
+
/** Microseconds (ASCII alias) */
|
|
183
|
+
MICROSECONDS = "us",
|
|
184
|
+
/** Microseconds (Unicode alias) */
|
|
185
|
+
MICROSECONDS_MU = "\u00B5s",
|
|
186
|
+
/** Milliseconds */
|
|
187
|
+
MILLISECONDS = "ms",
|
|
188
|
+
/** Seconds */
|
|
189
|
+
SECONDS = "s",
|
|
190
|
+
/** Minutes */
|
|
191
|
+
MINUTES = "m",
|
|
192
|
+
/** Hours */
|
|
193
|
+
HOURS = "h"
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* TimeValueType is an enum that defines the type of a time value used in extraction start/end times.
|
|
197
|
+
* The platform sends these types to indicate how the extraction time should be resolved by the SDK.
|
|
198
|
+
*/
|
|
199
|
+
export declare enum TimeValueType {
|
|
200
|
+
/** Oldest timestamp from worker state */
|
|
201
|
+
WORKERS_OLDEST = "workers_oldest",
|
|
202
|
+
/** Oldest timestamp from worker state minus a duration window */
|
|
203
|
+
WORKERS_OLDEST_MINUS_WINDOW = "workers_oldest_minus_window",
|
|
204
|
+
/** Newest timestamp from worker state */
|
|
205
|
+
WORKERS_NEWEST = "workers_newest",
|
|
206
|
+
/** Newest timestamp from worker state plus a duration window */
|
|
207
|
+
WORKERS_NEWEST_PLUS_WINDOW = "workers_newest_plus_window",
|
|
208
|
+
/** Current time */
|
|
209
|
+
CURRENT_TIME = "current_time",
|
|
210
|
+
/** User-specified absolute timestamp */
|
|
211
|
+
ABSOLUTE_TIME = "absolute_time",
|
|
212
|
+
/** No bound - extract all available data */
|
|
213
|
+
UNBOUNDED = "unbounded"
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* TimeValue is an interface that represents a time value used in extraction start/end times.
|
|
217
|
+
* It contains a type (which denotes how the value should be resolved) and an optional value.
|
|
218
|
+
* - For ABSOLUTE: value is an ISO 8601 timestamp
|
|
219
|
+
* - For *_WINDOW types: value is a Go duration string (e.g. '500ms', '30s', '5m', '2h')
|
|
220
|
+
* - For other types: value is not used
|
|
221
|
+
*/
|
|
222
|
+
export interface TimeValue {
|
|
223
|
+
type: TimeValueType;
|
|
224
|
+
value?: string;
|
|
225
|
+
}
|
|
175
226
|
/**
|
|
176
227
|
* EventContextIn is an interface that defines the structure of the input event context that is sent to the external extractor from ADaaS.
|
|
177
228
|
* @deprecated
|
|
@@ -242,6 +293,11 @@ export interface EventContext {
|
|
|
242
293
|
external_system_id: string;
|
|
243
294
|
external_system_name: string;
|
|
244
295
|
external_system_type: string;
|
|
296
|
+
/**
|
|
297
|
+
* Resolved start timestamp of extraction (ISO 8601 format).
|
|
298
|
+
* Automatically computed by the SDK from extraction_start_time and worker state.
|
|
299
|
+
* This is the field developers should read to know when to start extracting from.
|
|
300
|
+
*/
|
|
245
301
|
extract_from?: string;
|
|
246
302
|
import_slug: string;
|
|
247
303
|
initial_sync_scope?: InitialSyncScope;
|
|
@@ -249,9 +305,13 @@ export interface EventContext {
|
|
|
249
305
|
request_id: string;
|
|
250
306
|
request_id_adaas: string;
|
|
251
307
|
/**
|
|
252
|
-
* @deprecated reset_extraction is deprecated and should not be used.
|
|
308
|
+
* @deprecated reset_extraction is deprecated and should not be used.
|
|
253
309
|
*/
|
|
254
310
|
reset_extraction?: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* @deprecated reset_extract_from is deprecated. Use extraction_start_time/extraction_end_time instead,
|
|
313
|
+
* which are automatically resolved into extract_from and extract_to.
|
|
314
|
+
*/
|
|
255
315
|
reset_extract_from?: boolean;
|
|
256
316
|
run_id: string;
|
|
257
317
|
sequence_version: string;
|
|
@@ -273,6 +333,22 @@ export interface EventContext {
|
|
|
273
333
|
*/
|
|
274
334
|
uuid: string;
|
|
275
335
|
worker_data_url: string;
|
|
336
|
+
/**
|
|
337
|
+
* Start time value for extraction, as sent by the platform.
|
|
338
|
+
* The SDK resolves this into a concrete ISO 8601 timestamp on extract_from.
|
|
339
|
+
*/
|
|
340
|
+
extraction_start_time?: TimeValue;
|
|
341
|
+
/**
|
|
342
|
+
* End time value for extraction, as sent by the platform.
|
|
343
|
+
* The SDK resolves this into a concrete ISO 8601 timestamp on extract_to.
|
|
344
|
+
*/
|
|
345
|
+
extraction_end_time?: TimeValue;
|
|
346
|
+
/**
|
|
347
|
+
* Resolved end timestamp of extraction (ISO 8601 format).
|
|
348
|
+
* Automatically computed by the SDK from extraction_end_time and worker state.
|
|
349
|
+
* This is the field developers should read to know when to stop extracting at.
|
|
350
|
+
*/
|
|
351
|
+
extract_to?: string;
|
|
276
352
|
}
|
|
277
353
|
/**
|
|
278
354
|
* ConnectionData is an interface that defines the structure of the connection data that is sent to the external extractor from ADaaS.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../src/types/extraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAA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2B,GACnC;IACE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GACD,SAAS,CAAC;AAEd,MAAM,MAAM,uCAAuC,CACjD,KAAK,EACL,QAAQ,EACR,cAAc,IACZ,CAAC,EACH,WAAW,EACX,OAAO,EACP,SAAS,GACV,EAAE;IACD,WAAW,EAAE,KAAK,CAAC;IACnB,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,KAAK,QAAQ,CAAC;AAEf,MAAM,MAAM,iCAAiC,GAAG,CAAC,EAC/C,UAAU,EACV,MAAM,GACP,EAAE;IACD,UAAU,EAAE,oBAAoB,CAAC;IACjC,MAAM,EAAE,yCAAyC,CAAC;CACnD,KAAK,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAE3C,MAAM,MAAM,wCAAwC,CAAC,QAAQ,EAAE,cAAc,IAC3E,CAAC,EACC,kBAAkB,EAClB,OAAO,EACP,MAAM,GACP,EAAE;IACD,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,OAAO,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACvC,MAAM,EAAE,yCAAyC,CAAC;CACnD,KAAK,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAE7C,MAAM,WAAW,kCAAkC,CACjD,cAAc,EACd,KAAK,EACL,QAAQ;IAER,OAAO,EAAE,uCAAuC,CAC9C,KAAK,EACL,QAAQ,EACR,cAAc,CACf,CAAC;IACF,QAAQ,EAAE,wCAAwC,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;CAC9E"}
|
package/dist/types/extraction.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InitialSyncScope = exports.ExtractionMode = exports.ExtractorEventType = exports.EventType = void 0;
|
|
3
|
+
exports.TimeValueType = exports.TimeUnit = exports.InitialSyncScope = exports.ExtractionMode = exports.ExtractorEventType = exports.EventType = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* EventType is an enum that defines the different types of events that can be sent to the external extractor from ADaaS.
|
|
6
6
|
* The external extractor can use these events to know what to do next in the extraction process.
|
|
@@ -168,3 +168,45 @@ var InitialSyncScope;
|
|
|
168
168
|
InitialSyncScope["FULL_HISTORY"] = "full-history";
|
|
169
169
|
InitialSyncScope["TIME_SCOPED"] = "time-scoped";
|
|
170
170
|
})(InitialSyncScope || (exports.InitialSyncScope = InitialSyncScope = {}));
|
|
171
|
+
/**
|
|
172
|
+
* TimeUnit is an enum that defines the supported Go duration units for time window calculations.
|
|
173
|
+
* These correspond directly to Go's time.ParseDuration units.
|
|
174
|
+
*/
|
|
175
|
+
var TimeUnit;
|
|
176
|
+
(function (TimeUnit) {
|
|
177
|
+
/** Nanoseconds */
|
|
178
|
+
TimeUnit["NANOSECONDS"] = "ns";
|
|
179
|
+
/** Microseconds (ASCII alias) */
|
|
180
|
+
TimeUnit["MICROSECONDS"] = "us";
|
|
181
|
+
/** Microseconds (Unicode alias) */
|
|
182
|
+
TimeUnit["MICROSECONDS_MU"] = "\u00B5s";
|
|
183
|
+
/** Milliseconds */
|
|
184
|
+
TimeUnit["MILLISECONDS"] = "ms";
|
|
185
|
+
/** Seconds */
|
|
186
|
+
TimeUnit["SECONDS"] = "s";
|
|
187
|
+
/** Minutes */
|
|
188
|
+
TimeUnit["MINUTES"] = "m";
|
|
189
|
+
/** Hours */
|
|
190
|
+
TimeUnit["HOURS"] = "h";
|
|
191
|
+
})(TimeUnit || (exports.TimeUnit = TimeUnit = {}));
|
|
192
|
+
/**
|
|
193
|
+
* TimeValueType is an enum that defines the type of a time value used in extraction start/end times.
|
|
194
|
+
* The platform sends these types to indicate how the extraction time should be resolved by the SDK.
|
|
195
|
+
*/
|
|
196
|
+
var TimeValueType;
|
|
197
|
+
(function (TimeValueType) {
|
|
198
|
+
/** Oldest timestamp from worker state */
|
|
199
|
+
TimeValueType["WORKERS_OLDEST"] = "workers_oldest";
|
|
200
|
+
/** Oldest timestamp from worker state minus a duration window */
|
|
201
|
+
TimeValueType["WORKERS_OLDEST_MINUS_WINDOW"] = "workers_oldest_minus_window";
|
|
202
|
+
/** Newest timestamp from worker state */
|
|
203
|
+
TimeValueType["WORKERS_NEWEST"] = "workers_newest";
|
|
204
|
+
/** Newest timestamp from worker state plus a duration window */
|
|
205
|
+
TimeValueType["WORKERS_NEWEST_PLUS_WINDOW"] = "workers_newest_plus_window";
|
|
206
|
+
/** Current time */
|
|
207
|
+
TimeValueType["CURRENT_TIME"] = "current_time";
|
|
208
|
+
/** User-specified absolute timestamp */
|
|
209
|
+
TimeValueType["ABSOLUTE_TIME"] = "absolute_time";
|
|
210
|
+
/** No bound - extract all available data */
|
|
211
|
+
TimeValueType["UNBOUNDED"] = "unbounded";
|
|
212
|
+
})(TimeValueType || (exports.TimeValueType = TimeValueType = {}));
|