@devrev/ts-adaas 1.17.1-beta.5 → 1.17.1-beta.7

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.
Files changed (32) hide show
  1. package/dist/attachments-streaming/attachments-streaming-pool.d.ts.map +1 -1
  2. package/dist/common/constants.d.ts +8 -0
  3. package/dist/common/constants.d.ts.map +1 -1
  4. package/dist/common/constants.js +9 -1
  5. package/dist/common/time-value-resolver.d.ts +47 -0
  6. package/dist/common/time-value-resolver.d.ts.map +1 -0
  7. package/dist/common/time-value-resolver.js +149 -0
  8. package/dist/common/time-value-resolver.test.d.ts +2 -0
  9. package/dist/common/time-value-resolver.test.d.ts.map +1 -0
  10. package/dist/common/time-value-resolver.test.js +273 -0
  11. package/dist/mock-server/mock-server.d.ts +1 -34
  12. package/dist/mock-server/mock-server.d.ts.map +1 -1
  13. package/dist/mock-server/mock-server.interfaces.d.ts +18 -2
  14. package/dist/mock-server/mock-server.interfaces.d.ts.map +1 -1
  15. package/dist/mock-server/mock-server.js +87 -80
  16. package/dist/multithreading/worker-adapter/worker-adapter.d.ts.map +1 -1
  17. package/dist/multithreading/worker-adapter/worker-adapter.js +19 -0
  18. package/dist/multithreading/worker-adapter/worker-adapter.test.js +192 -6
  19. package/dist/state/state.d.ts.map +1 -1
  20. package/dist/state/state.interfaces.d.ts +22 -0
  21. package/dist/state/state.interfaces.d.ts.map +1 -1
  22. package/dist/state/state.interfaces.js +4 -0
  23. package/dist/state/state.js +68 -0
  24. package/dist/state/state.test.js +369 -0
  25. package/dist/types/extraction.d.ts +77 -1
  26. package/dist/types/extraction.d.ts.map +1 -1
  27. package/dist/types/extraction.js +43 -1
  28. package/dist/types/extraction.test.js +22 -11
  29. package/dist/types/index.d.ts +2 -1
  30. package/dist/types/index.d.ts.map +1 -1
  31. package/dist/types/index.js +6 -1
  32. package/package.json +1 -15
@@ -4,7 +4,7 @@ const test_helpers_1 = require("../tests/test-helpers");
4
4
  const extraction_1 = require("./extraction");
5
5
  // Test the EventContext interface and related extraction types
6
6
  describe('ExtractionTypes', () => {
7
- const baseEvent = (0, test_helpers_1.createEvent)({ eventType: extraction_1.EventType.ExtractionDataStart });
7
+ const baseEvent = (0, test_helpers_1.createEvent)({ eventType: extraction_1.EventType.StartExtractingData });
8
8
  it('should create event context without optional fields', () => {
9
9
  const event = Object.assign({}, baseEvent);
10
10
  // If this compiles, the test passes
@@ -13,9 +13,10 @@ describe('ExtractionTypes', () => {
13
13
  });
14
14
  it('should create event context with all optional fields', () => {
15
15
  const event = Object.assign({}, baseEvent);
16
- event.payload.event_context = Object.assign(Object.assign({}, baseEvent.payload.event_context), { extract_from: '2024-01-01T00:00:00Z', initial_sync_scope: extraction_1.InitialSyncScope.TIME_SCOPED, reset_extract_from: true });
16
+ event.payload.event_context = Object.assign(Object.assign({}, baseEvent.payload.event_context), { extract_from: '2024-01-01T00:00:00Z', extract_to: '2024-06-01T00:00:00Z', initial_sync_scope: extraction_1.InitialSyncScope.TIME_SCOPED, reset_extract_from: true });
17
17
  expect(event).toBeDefined();
18
18
  expect(event.payload.event_context.extract_from).toBe('2024-01-01T00:00:00Z');
19
+ expect(event.payload.event_context.extract_to).toBe('2024-06-01T00:00:00Z');
19
20
  expect(event.payload.event_context.initial_sync_scope).toBe(extraction_1.InitialSyncScope.TIME_SCOPED);
20
21
  expect(event.payload.event_context.reset_extract_from).toBe(true);
21
22
  });
@@ -38,26 +39,21 @@ describe('ExtractionTypes', () => {
38
39
  });
39
40
  it('[edge] should handle undefined optional fields', () => {
40
41
  const event = Object.assign({}, baseEvent);
41
- event.payload.event_context = Object.assign(Object.assign({}, baseEvent.payload.event_context), { extract_from: undefined, initial_sync_scope: undefined, reset_extract_from: undefined });
42
+ event.payload.event_context = Object.assign(Object.assign({}, baseEvent.payload.event_context), { extract_from: undefined, extract_to: undefined, initial_sync_scope: undefined, reset_extract_from: undefined });
42
43
  expect(event.payload.event_context.extract_from).toBeUndefined();
44
+ expect(event.payload.event_context.extract_to).toBeUndefined();
43
45
  expect(event.payload.event_context.initial_sync_scope).toBeUndefined();
44
46
  expect(event.payload.event_context.reset_extract_from).toBeUndefined();
45
47
  });
46
- it('[edge] should handle invalid date format in extract_from', () => {
47
- const event = Object.assign({}, baseEvent);
48
- event.payload.event_context = Object.assign(Object.assign({}, baseEvent.payload.event_context), { extract_from: 'invalid-date-format' });
49
- expect(event.payload.event_context.extract_from).toBe('invalid-date-format');
50
- // Note: Type validation would typically happen at runtime, not compile time
51
- });
52
48
  it('[edge] should handle explicit boolean values for reset_extract_from', () => {
53
49
  const eventWithTrue = (0, test_helpers_1.createEvent)({
54
- eventType: extraction_1.EventType.ExtractionDataStart,
50
+ eventType: extraction_1.EventType.StartExtractingData,
55
51
  eventContextOverrides: {
56
52
  reset_extract_from: true,
57
53
  },
58
54
  });
59
55
  const eventWithFalse = (0, test_helpers_1.createEvent)({
60
- eventType: extraction_1.EventType.ExtractionDataStart,
56
+ eventType: extraction_1.EventType.StartExtractingData,
61
57
  eventContextOverrides: {
62
58
  reset_extract_from: false,
63
59
  },
@@ -67,4 +63,19 @@ describe('ExtractionTypes', () => {
67
63
  expect(typeof eventWithTrue.payload.event_context.reset_extract_from).toBe('boolean');
68
64
  expect(typeof eventWithFalse.payload.event_context.reset_extract_from).toBe('boolean');
69
65
  });
66
+ describe('TimeValueType enum', () => {
67
+ it('should have all expected values', () => {
68
+ expect(extraction_1.TimeValueType.WORKERS_OLDEST).toBe('workers_oldest');
69
+ expect(extraction_1.TimeValueType.WORKERS_OLDEST_MINUS_WINDOW).toBe('workers_oldest_minus_window');
70
+ expect(extraction_1.TimeValueType.WORKERS_NEWEST).toBe('workers_newest');
71
+ expect(extraction_1.TimeValueType.WORKERS_NEWEST_PLUS_WINDOW).toBe('workers_newest_plus_window');
72
+ expect(extraction_1.TimeValueType.CURRENT_TIME).toBe('current_time');
73
+ expect(extraction_1.TimeValueType.ABSOLUTE_TIME).toBe('absolute_time');
74
+ expect(extraction_1.TimeValueType.UNBOUNDED).toBe('unbounded');
75
+ });
76
+ it('should have exactly seven values', () => {
77
+ const values = Object.values(extraction_1.TimeValueType);
78
+ expect(values.length).toBe(7);
79
+ });
80
+ });
70
81
  });
@@ -1,8 +1,9 @@
1
1
  export { AdapterUpdateParams, ErrorLevel, ErrorRecord, InitialDomainMapping, LogRecord, SyncMode, } from './common';
2
- export { AirdropEvent, AirdropMessage, ConnectionData, DomainObjectState, EventContextIn, EventContextOut, EventContext, EventData, EventType, ExternalProcessAttachmentFunction, ExternalSyncUnit, ExternalSystemAttachmentIteratorFunction, ExternalSystemAttachmentReducerFunction, ExternalSystemAttachmentStreamingFunction, ExternalSystemAttachmentStreamingParams, ExternalSystemAttachmentStreamingResponse, ExtractionMode, ExtractorEvent, ExtractorEventType, ProcessAttachmentReturnType, } from './extraction';
2
+ export { AirdropEvent, AirdropMessage, ConnectionData, DomainObjectState, EventContextIn, EventContextOut, EventContext, EventData, EventType, ExternalProcessAttachmentFunction, ExternalSyncUnit, ExternalSystemAttachmentIteratorFunction, ExternalSystemAttachmentReducerFunction, ExternalSystemAttachmentStreamingFunction, ExternalSystemAttachmentStreamingParams, ExternalSystemAttachmentStreamingResponse, ExtractionMode, ExtractorEvent, ExtractorEventType, InitialSyncScope, ProcessAttachmentReturnType, TimeUnit, TimeValue, TimeValueType, } from './extraction';
3
3
  export { ExternalSystemAttachment, ExternalSystemItem, ExternalSystemItemLoadingParams, ExternalSystemItemLoadingResponse, LoaderEventType, } from './loading';
4
4
  export { NormalizedAttachment, NormalizedItem, RepoInterface, } from '../repo/repo.interfaces';
5
5
  export { AdapterState } from '../state/state.interfaces';
6
+ export { UNBOUNDED_DATE_TIME_VALUE } from '../common/constants';
6
7
  export { Artifact, ArtifactsPrepareResponse, SsorAttachment, StreamAttachmentsResponse, StreamResponse, UploadResponse, } from '../uploader/uploader.interfaces';
7
8
  export type { MappersCreateParams, MappersGetByExternalIdParams, MappersGetByTargetIdParams, MappersUpdateParams, } from '../mappers/mappers.interface';
8
9
  export { SyncMapperRecordStatus, SyncMapperRecordTargetType, } from '../mappers/mappers.interface';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,QAAQ,GACT,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,SAAS,EACT,SAAS,EACT,iCAAiC,EACjC,gBAAgB,EAChB,wCAAwC,EACxC,uCAAuC,EACvC,yCAAyC,EACzC,uCAAuC,EACvC,yCAAyC,EACzC,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,+BAA+B,EAC/B,iCAAiC,EACjC,eAAe,GAChB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,aAAa,GACd,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,cAAc,GACf,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EACV,mBAAmB,EACnB,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,8BAA8B,CAAC;AAGtC,YAAY,EACV,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,eAAe,EACf,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,sBAAsB,EACtB,KAAK,EACL,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,OAAO,EACP,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACb,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,GACnB,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,UAAU,EACV,WAAW,EACX,oBAAoB,EACpB,SAAS,EACT,QAAQ,GACT,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,SAAS,EACT,SAAS,EACT,iCAAiC,EACjC,gBAAgB,EAChB,wCAAwC,EACxC,uCAAuC,EACvC,yCAAyC,EACzC,uCAAuC,EACvC,yCAAyC,EACzC,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,2BAA2B,EAC3B,QAAQ,EACR,SAAS,EACT,aAAa,GACd,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,+BAA+B,EAC/B,iCAAiC,EACjC,eAAe,GAChB,MAAM,WAAW,CAAC;AAGnB,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,aAAa,GACd,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGhE,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,cAAc,EACd,yBAAyB,EACzB,cAAc,EACd,cAAc,GACf,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EACV,mBAAmB,EACnB,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EACL,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,8BAA8B,CAAC;AAGtC,YAAY,EACV,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,eAAe,EACf,WAAW,EACX,WAAW,EACX,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,sBAAsB,EACtB,KAAK,EACL,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EACf,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACT,SAAS,EACT,OAAO,EACP,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,uBAAuB,EACvB,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,EACb,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,kBAAkB,GACnB,MAAM,4BAA4B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SyncMapperRecordTargetType = exports.SyncMapperRecordStatus = exports.LoaderEventType = exports.ExtractorEventType = exports.ExtractionMode = exports.EventType = exports.SyncMode = exports.ErrorLevel = void 0;
3
+ exports.SyncMapperRecordTargetType = exports.SyncMapperRecordStatus = exports.UNBOUNDED_DATE_TIME_VALUE = exports.LoaderEventType = exports.TimeValueType = exports.TimeUnit = exports.InitialSyncScope = exports.ExtractorEventType = exports.ExtractionMode = exports.EventType = exports.SyncMode = exports.ErrorLevel = void 0;
4
4
  // Common
5
5
  var common_1 = require("./common");
6
6
  Object.defineProperty(exports, "ErrorLevel", { enumerable: true, get: function () { return common_1.ErrorLevel; } });
@@ -10,9 +10,14 @@ var extraction_1 = require("./extraction");
10
10
  Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return extraction_1.EventType; } });
11
11
  Object.defineProperty(exports, "ExtractionMode", { enumerable: true, get: function () { return extraction_1.ExtractionMode; } });
12
12
  Object.defineProperty(exports, "ExtractorEventType", { enumerable: true, get: function () { return extraction_1.ExtractorEventType; } });
13
+ Object.defineProperty(exports, "InitialSyncScope", { enumerable: true, get: function () { return extraction_1.InitialSyncScope; } });
14
+ Object.defineProperty(exports, "TimeUnit", { enumerable: true, get: function () { return extraction_1.TimeUnit; } });
15
+ Object.defineProperty(exports, "TimeValueType", { enumerable: true, get: function () { return extraction_1.TimeValueType; } });
13
16
  // Loading
14
17
  var loading_1 = require("./loading");
15
18
  Object.defineProperty(exports, "LoaderEventType", { enumerable: true, get: function () { return loading_1.LoaderEventType; } });
19
+ var constants_1 = require("../common/constants");
20
+ Object.defineProperty(exports, "UNBOUNDED_DATE_TIME_VALUE", { enumerable: true, get: function () { return constants_1.UNBOUNDED_DATE_TIME_VALUE; } });
16
21
  var mappers_interface_1 = require("../mappers/mappers.interface");
17
22
  Object.defineProperty(exports, "SyncMapperRecordStatus", { enumerable: true, get: function () { return mappers_interface_1.SyncMapperRecordStatus; } });
18
23
  Object.defineProperty(exports, "SyncMapperRecordTargetType", { enumerable: true, get: function () { return mappers_interface_1.SyncMapperRecordTargetType; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devrev/ts-adaas",
3
- "version": "1.17.1-beta.5",
3
+ "version": "1.17.1-beta.7",
4
4
  "description": "Typescript library containing the ADaaS(AirDrop as a Service) control protocol.",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",
@@ -30,7 +30,6 @@
30
30
  "devDependencies": {
31
31
  "@microsoft/api-extractor": "^7.57.6",
32
32
  "@microsoft/api-extractor-model": "^7.30.7",
33
- "@types/express": "^5.0.3",
34
33
  "@types/jest": "^29.5.14",
35
34
  "@types/node": "^22.18.0",
36
35
  "@types/yargs": "^17.0.33",
@@ -38,7 +37,6 @@
38
37
  "eslint": "9.32.0",
39
38
  "eslint-config-prettier": "^9.1.2",
40
39
  "eslint-plugin-prettier": "4.0.0",
41
- "express": "^5.2.1",
42
40
  "jest": "^29.7.0",
43
41
  "jiti": "^2.6.1",
44
42
  "prettier": "^2.8.3",
@@ -46,18 +44,6 @@
46
44
  "typescript": "^5.3.3",
47
45
  "typescript-eslint": "^8.46.1"
48
46
  },
49
- "peerDependencies": {
50
- "@types/express": "^5.0.0",
51
- "express": "^5.0.0"
52
- },
53
- "peerDependenciesMeta": {
54
- "@types/express": {
55
- "optional": true
56
- },
57
- "express": {
58
- "optional": true
59
- }
60
- },
61
47
  "dependencies": {
62
48
  "@devrev/typescript-sdk": "^1.1.59",
63
49
  "axios": "^1.13.5",