@devrev/airsync-sdk 2.0.0-beta.4 → 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/dist/attachments-streaming/attachments-streaming-pool.d.ts +6 -0
- package/dist/attachments-streaming/attachments-streaming-pool.d.ts.map +1 -1
- package/dist/attachments-streaming/attachments-streaming-pool.interfaces.d.ts +2 -2
- package/dist/attachments-streaming/attachments-streaming-pool.interfaces.d.ts.map +1 -1
- package/dist/attachments-streaming/attachments-streaming-pool.js +47 -21
- package/dist/common/constants.d.ts +3 -5
- package/dist/common/constants.d.ts.map +1 -1
- package/dist/common/constants.js +4 -6
- package/dist/common/helpers.d.ts +3 -21
- package/dist/common/helpers.d.ts.map +1 -1
- package/dist/common/helpers.js +6 -15
- package/dist/http/client.d.ts.map +1 -1
- package/dist/http/client.js +4 -8
- package/dist/index.d.ts +11 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -18
- package/dist/logger/logger.d.ts +8 -63
- 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 +14 -93
- package/dist/mappers/mappers.d.ts +2 -40
- package/dist/mappers/mappers.d.ts.map +1 -1
- package/dist/mappers/mappers.interfaces.d.ts +35 -154
- package/dist/mappers/mappers.interfaces.d.ts.map +1 -1
- package/dist/mappers/mappers.interfaces.js +1 -10
- package/dist/mappers/mappers.js +2 -40
- package/dist/multithreading/adapters/base-adapter.d.ts +19 -36
- package/dist/multithreading/adapters/base-adapter.d.ts.map +1 -1
- package/dist/multithreading/adapters/base-adapter.js +73 -71
- package/dist/multithreading/adapters/extraction-adapter.d.ts +12 -24
- package/dist/multithreading/adapters/extraction-adapter.d.ts.map +1 -1
- package/dist/multithreading/adapters/extraction-adapter.js +199 -200
- package/dist/multithreading/adapters/loading-adapter.d.ts +1 -6
- 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 +292 -314
- package/dist/multithreading/emit.d.ts +3 -2
- package/dist/multithreading/emit.d.ts.map +1 -1
- package/dist/multithreading/emit.js +3 -5
- 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 +45 -59
- 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 +6 -25
- package/dist/multithreading/spawn/spawn.helpers.d.ts.map +1 -1
- package/dist/multithreading/spawn/spawn.helpers.js +7 -49
- package/dist/multithreading/spawn/spawn.js +18 -33
- package/dist/multithreading/worker.js +2 -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 +14 -36
- package/dist/state/base-state.d.ts.map +1 -1
- package/dist/state/base-state.js +16 -38
- package/dist/state/extraction-state.d.ts +4 -19
- package/dist/state/extraction-state.d.ts.map +1 -1
- package/dist/state/extraction-state.js +6 -23
- package/dist/state/install-initial-domain-mapping.d.ts +1 -1
- package/dist/state/install-initial-domain-mapping.d.ts.map +1 -1
- package/dist/state/install-initial-domain-mapping.js +1 -3
- package/dist/state/loading-state.d.ts +1 -11
- package/dist/state/loading-state.d.ts.map +1 -1
- package/dist/state/loading-state.js +2 -12
- package/dist/state/state.d.ts +2 -2
- package/dist/state/state.d.ts.map +1 -1
- package/dist/state/state.interfaces.d.ts +10 -24
- package/dist/state/state.interfaces.d.ts.map +1 -1
- package/dist/state/state.interfaces.js +9 -11
- package/dist/state/state.js +3 -3
- package/dist/state/time-value-resolver.d.ts +7 -36
- package/dist/state/time-value-resolver.d.ts.map +1 -1
- package/dist/state/time-value-resolver.js +7 -40
- package/dist/testing/mock-event.d.ts +2 -10
- package/dist/testing/mock-event.d.ts.map +1 -1
- package/dist/testing/mock-event.js +3 -11
- package/dist/testing/mock-server.d.ts +4 -27
- package/dist/testing/mock-server.d.ts.map +1 -1
- package/dist/testing/mock-server.interfaces.d.ts +10 -35
- package/dist/testing/mock-server.interfaces.d.ts.map +1 -1
- package/dist/testing/mock-server.js +19 -36
- 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/external-domain-metadata.d.ts +30 -171
- package/dist/types/external-domain-metadata.d.ts.map +1 -1
- package/dist/types/extraction.d.ts +35 -120
- package/dist/types/extraction.d.ts.map +1 -1
- package/dist/types/extraction.js +5 -31
- package/dist/types/loading.d.ts.map +1 -1
- package/dist/types/workers.d.ts +18 -116
- package/dist/types/workers.d.ts.map +1 -1
- package/dist/types/workers.js +0 -6
- package/dist/uploader/uploader.d.ts +6 -58
- 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 +18 -84
- package/package.json +6 -4
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AxiosResponse } from 'axios';
|
|
2
|
-
import { AirSyncEvent, EventData, ExtractorEventType } from '../types/extraction';
|
|
2
|
+
import { AirSyncEvent, EventData, ExtractorEventType, WorkerMetadata } from '../types/extraction';
|
|
3
3
|
import { LoaderEventType } from '../types/loading';
|
|
4
4
|
export interface EmitInterface {
|
|
5
5
|
event: AirSyncEvent;
|
|
6
6
|
eventType: ExtractorEventType | LoaderEventType;
|
|
7
7
|
data?: EventData;
|
|
8
|
+
worker_metadata?: WorkerMetadata;
|
|
8
9
|
}
|
|
9
|
-
export declare const emit: ({ event, eventType, data, }: EmitInterface) => Promise<AxiosResponse>;
|
|
10
|
+
export declare const emit: ({ event, eventType, data, worker_metadata, }: EmitInterface) => Promise<AxiosResponse>;
|
|
10
11
|
//# sourceMappingURL=emit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/multithreading/emit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/multithreading/emit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,OAAO,EACL,YAAY,EACZ,SAAS,EAET,kBAAkB,EAElB,cAAc,EACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,kBAAkB,GAAG,eAAe,CAAC;IAChD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,eAAe,CAAC,EAAE,cAAc,CAAC;CAClC;AAED,eAAO,MAAM,IAAI,GAAU,8CAKxB,aAAa,KAAG,OAAO,CAAC,aAAa,CA+BvC,CAAC"}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.emit = void 0;
|
|
4
|
-
const client_1 = require("../http/client");
|
|
5
4
|
const constants_1 = require("../common/constants");
|
|
6
|
-
const
|
|
5
|
+
const client_1 = require("../http/client");
|
|
6
|
+
const emit = async ({ event, eventType, data, worker_metadata, }) => {
|
|
7
7
|
const newEvent = {
|
|
8
8
|
event_type: eventType,
|
|
9
9
|
event_context: event.payload.event_context,
|
|
10
10
|
event_data: Object.assign({}, data),
|
|
11
|
-
worker_metadata: {
|
|
12
|
-
adaas_library_version: constants_1.LIBRARY_VERSION,
|
|
13
|
-
},
|
|
11
|
+
worker_metadata: Object.assign(Object.assign({}, worker_metadata), { newest_state_date: event.payload.event_context.extract_to, oldest_state_date: event.payload.event_context.extract_from, adaas_library_version: constants_1.LIBRARY_VERSION }),
|
|
14
12
|
};
|
|
15
13
|
console.info('Emitting event', newEvent);
|
|
16
14
|
return client_1.axiosClient.post(event.payload.event_context.callback_url, Object.assign({}, newEvent), {
|
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { ProcessTaskInterface } from '../types/workers';
|
|
2
2
|
import { ExtractionAdapter } from './adapters/extraction-adapter';
|
|
3
3
|
import { LoadingAdapter } from './adapters/loading-adapter';
|
|
4
|
-
/**
|
|
5
|
-
* Entry point for an extraction worker. Builds an {@link ExtractionAdapter} and
|
|
6
|
-
* runs the provided task against it.
|
|
7
|
-
*
|
|
8
|
-
* @public
|
|
9
|
-
*/
|
|
4
|
+
/** Entry point for an extraction worker. @public */
|
|
10
5
|
export declare function processExtractionTask<ConnectorState>({ task, onTimeout, }: ProcessTaskInterface<ExtractionAdapter<ConnectorState>>): void;
|
|
11
|
-
/**
|
|
12
|
-
* Entry point for a loading worker. Builds a {@link LoadingAdapter} and runs the
|
|
13
|
-
* provided task against it.
|
|
14
|
-
*
|
|
15
|
-
* @public
|
|
16
|
-
*/
|
|
6
|
+
/** Entry point for a loading worker. @public */
|
|
17
7
|
export declare function processLoadingTask<ConnectorState>({ task, onTimeout, }: ProcessTaskInterface<LoadingAdapter<ConnectorState>>): void;
|
|
18
8
|
//# sourceMappingURL=process-task.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-task.d.ts","sourceRoot":"","sources":["../../src/multithreading/process-task.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"process-task.d.ts","sourceRoot":"","sources":["../../src/multithreading/process-task.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,oBAAoB,EAIrB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AA6D5D,oDAAoD;AACpD,wBAAgB,qBAAqB,CAAC,cAAc,EAAE,EACpD,IAAI,EACJ,SAAS,GACV,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,QA6BzD;AAED,gDAAgD;AAChD,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,EACjD,IAAI,EACJ,SAAS,GACV,EAAE,oBAAoB,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,QA6BtD"}
|
|
@@ -9,66 +9,57 @@ const loading_state_1 = require("../state/loading-state");
|
|
|
9
9
|
const workers_1 = require("../types/workers");
|
|
10
10
|
const extraction_adapter_1 = require("./adapters/extraction-adapter");
|
|
11
11
|
const loading_adapter_1 = require("./adapters/loading-adapter");
|
|
12
|
+
const spawn_helpers_1 = require("./spawn/spawn.helpers");
|
|
12
13
|
/**
|
|
13
|
-
* Shared worker-thread driver
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* and
|
|
17
|
-
*
|
|
18
|
-
* The adapter is constructed by the caller so each entry point can build its
|
|
19
|
-
* own typed adapter.
|
|
20
|
-
*
|
|
21
|
-
* If `onTimeout` is omitted, the SDK emits a phase-appropriate default on
|
|
22
|
-
* timeout: `progress` (resumable phases) or `error` (non-resumable phases) is
|
|
23
|
-
* handled by the status->event mapping when we emit a `progress` result.
|
|
24
|
-
*
|
|
25
|
-
* On timeout the timeout outcome always wins: once the soft timeout has fired,
|
|
26
|
-
* the SDK emits the `onTimeout` result (or the default `progress`) and ignores
|
|
27
|
-
* whatever the task returned, because a phase that ran out of time must hand off
|
|
28
|
-
* for continuation rather than report itself complete.
|
|
14
|
+
* Shared worker-thread driver: builds the adapter, runs the task, maps the
|
|
15
|
+
* returned {@link TaskResult} to a platform event and emits it exactly once.
|
|
16
|
+
* On soft timeout the timeout outcome always wins: the `onTimeout` result (or
|
|
17
|
+
* a phase-appropriate default) is emitted and the task's return value is
|
|
18
|
+
* ignored.
|
|
29
19
|
*/
|
|
30
20
|
async function runWorkerTask(buildAdapter, { task, onTimeout }) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
21
|
+
try {
|
|
22
|
+
const adapter = await buildAdapter();
|
|
23
|
+
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.on(workers_1.WorkerEvent.WorkerMessage, (message) => {
|
|
24
|
+
if (message.subject !== workers_1.WorkerMessageSubject.WorkerMessageExit) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
console.log('Timeout received. Waiting for the task to finish.');
|
|
28
|
+
adapter.isTimeout = true;
|
|
29
|
+
});
|
|
30
|
+
let result = await task({ adapter });
|
|
31
|
+
if (adapter.isTimeout) {
|
|
32
|
+
if (onTimeout) {
|
|
33
|
+
result = await onTimeout({ adapter });
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Non-resumable phases can't hand off with `progress`; report a timeout error.
|
|
37
|
+
const eventType = adapter.event.payload.event_type;
|
|
38
|
+
const { illegal } = (0, spawn_helpers_1.getEventTypeForResult)(eventType, 'progress');
|
|
39
|
+
result = illegal
|
|
40
|
+
? {
|
|
41
|
+
status: 'error',
|
|
42
|
+
error: {
|
|
43
|
+
message: `Worker timed out during a non-resumable phase (${eventType}), which cannot be continued.`,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
48
46
|
: { status: 'progress' };
|
|
49
47
|
}
|
|
50
|
-
await adapter.emitFromResult(result);
|
|
51
|
-
process.exit(0);
|
|
52
48
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
49
|
+
await adapter.emitFromResult(result);
|
|
50
|
+
process.exit(0);
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
const errorMessage = `Error while processing task. ${(0, logger_1.serializeError)(error)}`;
|
|
54
|
+
console.error(errorMessage);
|
|
55
|
+
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.postMessage({
|
|
56
|
+
subject: workers_1.WorkerMessageSubject.WorkerMessageFailed,
|
|
57
|
+
payload: { message: errorMessage },
|
|
58
|
+
});
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
65
61
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Entry point for an extraction worker. Builds an {@link ExtractionAdapter} and
|
|
68
|
-
* runs the provided task against it.
|
|
69
|
-
*
|
|
70
|
-
* @public
|
|
71
|
-
*/
|
|
62
|
+
/** Entry point for an extraction worker. @public */
|
|
72
63
|
function processExtractionTask({ task, onTimeout, }) {
|
|
73
64
|
if (node_worker_threads_1.isMainThread) {
|
|
74
65
|
return;
|
|
@@ -93,12 +84,7 @@ function processExtractionTask({ task, onTimeout, }) {
|
|
|
93
84
|
});
|
|
94
85
|
}, { task, onTimeout });
|
|
95
86
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Entry point for a loading worker. Builds a {@link LoadingAdapter} and runs the
|
|
98
|
-
* provided task against it.
|
|
99
|
-
*
|
|
100
|
-
* @public
|
|
101
|
-
*/
|
|
87
|
+
/** Entry point for a loading worker. @public */
|
|
102
88
|
function processLoadingTask({ task, onTimeout, }) {
|
|
103
89
|
if (node_worker_threads_1.isMainThread) {
|
|
104
90
|
return;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import { SpawnFactoryInterface, SpawnInterface } from '../../types/workers';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* In case of lambda timeout, the class emits a lambda timeout event to the platform.
|
|
7
|
-
* @param {SpawnFactoryInterface} options - The options to create a new instance of Spawn class
|
|
8
|
-
* @param {AirSyncEvent} options.event - The event object received from the platform
|
|
9
|
-
* @param {object} options.initialState - The initial state of the adapter
|
|
10
|
-
* @param {string} [options.baseWorkerPath] - The base path for the worker files, usually `__dirname`
|
|
11
|
-
* @returns {Promise<Spawn>} - A new instance of Spawn class
|
|
3
|
+
* Spawns a worker thread for the event and manages its lifecycle (control
|
|
4
|
+
* events, graceful exit, lambda timeout handling). Resolves when the worker
|
|
5
|
+
* run is fully finished.
|
|
12
6
|
*/
|
|
13
7
|
export declare function spawn<ConnectorState>({ event, initialState, initialDomainMapping, options, baseWorkerPath, }: SpawnFactoryInterface<ConnectorState>): Promise<void>;
|
|
14
8
|
export declare class Spawn {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/multithreading/spawn/spawn.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/multithreading/spawn/spawn.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,qBAAqB,EACrB,cAAc,EAGf,MAAM,qBAAqB,CAAC;AA0C7B;;;;GAIG;AACH,wBAAsB,KAAK,CAAC,cAAc,EAAE,EAC1C,KAAK,EACL,YAAY,EACZ,oBAAoB,EACpB,OAAO,EACP,cAAc,GACf,EAAE,qBAAqB,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAuEvD;AAED,qBAAa,KAAK;IAChB,OAAO,CAAC,KAAK,CAAe;IAC5B,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,eAAe,CAAU;IACjC,OAAO,CAAC,oBAAoB,CAAkC;IAC9D,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,gBAAgB,CAA4C;IACpE,OAAO,CAAC,gBAAgB,CAA4C;IACpE,OAAO,CAAC,wBAAwB,CAA6C;IAC7E,OAAO,CAAC,OAAO,CAA4C;IAC3D,OAAO,CAAC,eAAe,CAAU;IACjC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,mBAAmB,CAAqB;gBACpC,EACV,KAAK,EACL,MAAM,EACN,OAAO,EACP,OAAO,EACP,eAAe,GAChB,EAAE,cAAc;IA0GjB,OAAO,CAAC,aAAa;YAYP,kBAAkB;CAoCjC"}
|
|
@@ -2,39 +2,20 @@ import { EventType, ExtractorEventType } from '../../types/extraction';
|
|
|
2
2
|
import { LoaderEventType } from '../../types/loading';
|
|
3
3
|
import { TaskStatus } from '../../types/workers';
|
|
4
4
|
/**
|
|
5
|
-
* Resolves the outgoing event type
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* every status (success -> *_DONE, progress -> *_PROGRESS, delay -> *_DELAYED,
|
|
11
|
-
* error -> *_ERROR); non-resumable phases (external sync units, metadata, state
|
|
12
|
-
* deletion) only have a done and an error event, so a `progress`/`delay` status
|
|
13
|
-
* there is illegal and is mapped to the phase's error event.
|
|
14
|
-
*
|
|
15
|
-
* @param eventType - The incoming event type that started this worker.
|
|
16
|
-
* @param status - The status the worker's task/onTimeout returned.
|
|
17
|
-
* @returns The outgoing extractor/loader event type to emit, plus whether the
|
|
18
|
-
* status was illegal for the phase (so the caller can attach a descriptive
|
|
19
|
-
* error message).
|
|
5
|
+
* Resolves the outgoing event type to emit for an incoming event type and a
|
|
6
|
+
* {@link TaskResult} status. Resumable phases honor every status
|
|
7
|
+
* (success/progress/delay/error -> *_DONE/*_PROGRESS/*_DELAYED/*_ERROR);
|
|
8
|
+
* non-resumable phases only have done/error, so `progress`/`delay` there is
|
|
9
|
+
* illegal and maps to the phase's error event.
|
|
20
10
|
*/
|
|
21
11
|
export declare function getEventTypeForResult(eventType: EventType, status: TaskStatus): {
|
|
22
12
|
eventType: ExtractorEventType | LoaderEventType;
|
|
23
13
|
illegal: boolean;
|
|
24
14
|
};
|
|
25
|
-
/**
|
|
26
|
-
* Gets the event type for the timeout error.
|
|
27
|
-
* @param {EventType} eventType - The event type to get the timeout error event type for
|
|
28
|
-
* @returns {ExtractorEventType | LoaderEventType} The event type for the timeout error
|
|
29
|
-
*/
|
|
30
15
|
export declare function getTimeoutErrorEventType(eventType: EventType): {
|
|
31
16
|
eventType: ExtractorEventType | LoaderEventType;
|
|
32
17
|
};
|
|
33
|
-
/**
|
|
34
|
-
* Gets the event type for the no script error.
|
|
35
|
-
* @param {EventType} eventType - The event type to get the no script error event type for
|
|
36
|
-
* @returns {ExtractorEventType | LoaderEventType} The event type for the no script error
|
|
37
|
-
*/
|
|
18
|
+
/** Event type to emit when no worker script exists for the incoming event. */
|
|
38
19
|
export declare function getNoScriptEventType(eventType: EventType): {
|
|
39
20
|
eventType: ExtractorEventType | LoaderEventType;
|
|
40
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spawn.helpers.d.ts","sourceRoot":"","sources":["../../../src/multithreading/spawn/spawn.helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"spawn.helpers.d.ts","sourceRoot":"","sources":["../../../src/multithreading/spawn/spawn.helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,UAAU,GACjB;IACD,SAAS,EAAE,kBAAkB,GAAG,eAAe,CAAC;IAChD,OAAO,EAAE,OAAO,CAAC;CAClB,CAiCA;AAuGD,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,GAAG;IAC9D,SAAS,EAAE,kBAAkB,GAAG,eAAe,CAAC;CACjD,CAiEA;AAED,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS;eAwBhB,kBAAkB,GAAG,eAAe;EAG5E"}
|
|
@@ -7,21 +7,11 @@ const constants_1 = require("../../common/constants");
|
|
|
7
7
|
const extraction_1 = require("../../types/extraction");
|
|
8
8
|
const loading_1 = require("../../types/loading");
|
|
9
9
|
/**
|
|
10
|
-
* Resolves the outgoing event type
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* every status (success -> *_DONE, progress -> *_PROGRESS, delay -> *_DELAYED,
|
|
16
|
-
* error -> *_ERROR); non-resumable phases (external sync units, metadata, state
|
|
17
|
-
* deletion) only have a done and an error event, so a `progress`/`delay` status
|
|
18
|
-
* there is illegal and is mapped to the phase's error event.
|
|
19
|
-
*
|
|
20
|
-
* @param eventType - The incoming event type that started this worker.
|
|
21
|
-
* @param status - The status the worker's task/onTimeout returned.
|
|
22
|
-
* @returns The outgoing extractor/loader event type to emit, plus whether the
|
|
23
|
-
* status was illegal for the phase (so the caller can attach a descriptive
|
|
24
|
-
* error message).
|
|
10
|
+
* Resolves the outgoing event type to emit for an incoming event type and a
|
|
11
|
+
* {@link TaskResult} status. Resumable phases honor every status
|
|
12
|
+
* (success/progress/delay/error -> *_DONE/*_PROGRESS/*_DELAYED/*_ERROR);
|
|
13
|
+
* non-resumable phases only have done/error, so `progress`/`delay` there is
|
|
14
|
+
* illegal and maps to the phase's error event.
|
|
25
15
|
*/
|
|
26
16
|
function getEventTypeForResult(eventType, status) {
|
|
27
17
|
const phase = EVENT_PHASE_MAP[eventType];
|
|
@@ -52,24 +42,18 @@ function getEventTypeForResult(eventType, status) {
|
|
|
52
42
|
return { eventType: phase.error, illegal: false };
|
|
53
43
|
}
|
|
54
44
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Per-phase outgoing event types, keyed by the incoming {@link EventType}.
|
|
57
|
-
* `resumable` phases define progress/delayed events; non-resumable ones do not.
|
|
58
|
-
*/
|
|
45
|
+
/** Per-phase outgoing event types, keyed by the incoming {@link EventType}. */
|
|
59
46
|
const EVENT_PHASE_MAP = {
|
|
60
|
-
// External sync units (non-resumable)
|
|
61
47
|
[extraction_1.EventType.StartExtractingExternalSyncUnits]: {
|
|
62
48
|
resumable: false,
|
|
63
49
|
done: extraction_1.ExtractorEventType.ExternalSyncUnitExtractionDone,
|
|
64
50
|
error: extraction_1.ExtractorEventType.ExternalSyncUnitExtractionError,
|
|
65
51
|
},
|
|
66
|
-
// Metadata (non-resumable)
|
|
67
52
|
[extraction_1.EventType.StartExtractingMetadata]: {
|
|
68
53
|
resumable: false,
|
|
69
54
|
done: extraction_1.ExtractorEventType.MetadataExtractionDone,
|
|
70
55
|
error: extraction_1.ExtractorEventType.MetadataExtractionError,
|
|
71
56
|
},
|
|
72
|
-
// Data extraction (resumable)
|
|
73
57
|
[extraction_1.EventType.StartExtractingData]: {
|
|
74
58
|
resumable: true,
|
|
75
59
|
done: extraction_1.ExtractorEventType.DataExtractionDone,
|
|
@@ -84,13 +68,11 @@ const EVENT_PHASE_MAP = {
|
|
|
84
68
|
progress: extraction_1.ExtractorEventType.DataExtractionProgress,
|
|
85
69
|
delayed: extraction_1.ExtractorEventType.DataExtractionDelayed,
|
|
86
70
|
},
|
|
87
|
-
// Extractor state deletion (non-resumable)
|
|
88
71
|
[extraction_1.EventType.StartDeletingExtractorState]: {
|
|
89
72
|
resumable: false,
|
|
90
73
|
done: extraction_1.ExtractorEventType.ExtractorStateDeletionDone,
|
|
91
74
|
error: extraction_1.ExtractorEventType.ExtractorStateDeletionError,
|
|
92
75
|
},
|
|
93
|
-
// Attachment extraction (resumable)
|
|
94
76
|
[extraction_1.EventType.StartExtractingAttachments]: {
|
|
95
77
|
resumable: true,
|
|
96
78
|
done: extraction_1.ExtractorEventType.AttachmentExtractionDone,
|
|
@@ -105,13 +87,11 @@ const EVENT_PHASE_MAP = {
|
|
|
105
87
|
progress: extraction_1.ExtractorEventType.AttachmentExtractionProgress,
|
|
106
88
|
delayed: extraction_1.ExtractorEventType.AttachmentExtractionDelayed,
|
|
107
89
|
},
|
|
108
|
-
// Extractor attachments state deletion (non-resumable)
|
|
109
90
|
[extraction_1.EventType.StartDeletingExtractorAttachmentsState]: {
|
|
110
91
|
resumable: false,
|
|
111
92
|
done: extraction_1.ExtractorEventType.ExtractorAttachmentsStateDeletionDone,
|
|
112
93
|
error: extraction_1.ExtractorEventType.ExtractorAttachmentsStateDeletionError,
|
|
113
94
|
},
|
|
114
|
-
// Data loading (resumable)
|
|
115
95
|
[extraction_1.EventType.StartLoadingData]: {
|
|
116
96
|
resumable: true,
|
|
117
97
|
done: loading_1.LoaderEventType.DataLoadingDone,
|
|
@@ -126,7 +106,6 @@ const EVENT_PHASE_MAP = {
|
|
|
126
106
|
progress: loading_1.LoaderEventType.DataLoadingProgress,
|
|
127
107
|
delayed: loading_1.LoaderEventType.DataLoadingDelayed,
|
|
128
108
|
},
|
|
129
|
-
// Attachment loading (resumable)
|
|
130
109
|
[extraction_1.EventType.StartLoadingAttachments]: {
|
|
131
110
|
resumable: true,
|
|
132
111
|
done: loading_1.LoaderEventType.AttachmentLoadingDone,
|
|
@@ -141,76 +120,59 @@ const EVENT_PHASE_MAP = {
|
|
|
141
120
|
progress: loading_1.LoaderEventType.AttachmentLoadingProgress,
|
|
142
121
|
delayed: loading_1.LoaderEventType.AttachmentLoadingDelayed,
|
|
143
122
|
},
|
|
144
|
-
// Loader state deletion (non-resumable)
|
|
145
123
|
[extraction_1.EventType.StartDeletingLoaderState]: {
|
|
146
124
|
resumable: false,
|
|
147
125
|
done: loading_1.LoaderEventType.LoaderStateDeletionDone,
|
|
148
126
|
error: loading_1.LoaderEventType.LoaderStateDeletionError,
|
|
149
127
|
},
|
|
150
|
-
// Loader attachment state deletion (non-resumable)
|
|
151
128
|
[extraction_1.EventType.StartDeletingLoaderAttachmentState]: {
|
|
152
129
|
resumable: false,
|
|
153
130
|
done: loading_1.LoaderEventType.LoaderAttachmentStateDeletionDone,
|
|
154
131
|
error: loading_1.LoaderEventType.LoaderAttachmentStateDeletionError,
|
|
155
132
|
},
|
|
156
133
|
};
|
|
157
|
-
/**
|
|
158
|
-
* Gets the event type for the timeout error.
|
|
159
|
-
* @param {EventType} eventType - The event type to get the timeout error event type for
|
|
160
|
-
* @returns {ExtractorEventType | LoaderEventType} The event type for the timeout error
|
|
161
|
-
*/
|
|
162
134
|
function getTimeoutErrorEventType(eventType) {
|
|
163
135
|
switch (eventType) {
|
|
164
|
-
// Metadata extraction
|
|
165
136
|
case extraction_1.EventType.StartExtractingMetadata:
|
|
166
137
|
return {
|
|
167
138
|
eventType: extraction_1.ExtractorEventType.MetadataExtractionError,
|
|
168
139
|
};
|
|
169
|
-
// Data extraction
|
|
170
140
|
case extraction_1.EventType.StartExtractingData:
|
|
171
141
|
case extraction_1.EventType.ContinueExtractingData:
|
|
172
142
|
return {
|
|
173
143
|
eventType: extraction_1.ExtractorEventType.DataExtractionError,
|
|
174
144
|
};
|
|
175
|
-
// Data deletion
|
|
176
145
|
case extraction_1.EventType.StartDeletingExtractorState:
|
|
177
146
|
return {
|
|
178
147
|
eventType: extraction_1.ExtractorEventType.ExtractorStateDeletionError,
|
|
179
148
|
};
|
|
180
|
-
// Attachments extraction
|
|
181
149
|
case extraction_1.EventType.StartExtractingAttachments:
|
|
182
150
|
case extraction_1.EventType.ContinueExtractingAttachments:
|
|
183
151
|
return {
|
|
184
152
|
eventType: extraction_1.ExtractorEventType.AttachmentExtractionError,
|
|
185
153
|
};
|
|
186
|
-
// Attachments deletion
|
|
187
154
|
case extraction_1.EventType.StartDeletingExtractorAttachmentsState:
|
|
188
155
|
return {
|
|
189
156
|
eventType: extraction_1.ExtractorEventType.ExtractorAttachmentsStateDeletionError,
|
|
190
157
|
};
|
|
191
|
-
// External sync units
|
|
192
158
|
case extraction_1.EventType.StartExtractingExternalSyncUnits:
|
|
193
159
|
return {
|
|
194
160
|
eventType: extraction_1.ExtractorEventType.ExternalSyncUnitExtractionError,
|
|
195
161
|
};
|
|
196
|
-
// Loading data
|
|
197
162
|
case extraction_1.EventType.StartLoadingData:
|
|
198
163
|
case extraction_1.EventType.ContinueLoadingData:
|
|
199
164
|
return {
|
|
200
165
|
eventType: loading_1.LoaderEventType.DataLoadingError,
|
|
201
166
|
};
|
|
202
|
-
// Deleting loader state
|
|
203
167
|
case extraction_1.EventType.StartDeletingLoaderState:
|
|
204
168
|
return {
|
|
205
169
|
eventType: loading_1.LoaderEventType.LoaderStateDeletionError,
|
|
206
170
|
};
|
|
207
|
-
// Loading attachments
|
|
208
171
|
case extraction_1.EventType.StartLoadingAttachments:
|
|
209
172
|
case extraction_1.EventType.ContinueLoadingAttachments:
|
|
210
173
|
return {
|
|
211
174
|
eventType: loading_1.LoaderEventType.AttachmentLoadingError,
|
|
212
175
|
};
|
|
213
|
-
// Deleting loader attachment state
|
|
214
176
|
case extraction_1.EventType.StartDeletingLoaderAttachmentState:
|
|
215
177
|
return {
|
|
216
178
|
eventType: loading_1.LoaderEventType.LoaderAttachmentStateDeletionError,
|
|
@@ -223,11 +185,7 @@ function getTimeoutErrorEventType(eventType) {
|
|
|
223
185
|
};
|
|
224
186
|
}
|
|
225
187
|
}
|
|
226
|
-
/**
|
|
227
|
-
* Gets the event type for the no script error.
|
|
228
|
-
* @param {EventType} eventType - The event type to get the no script error event type for
|
|
229
|
-
* @returns {ExtractorEventType | LoaderEventType} The event type for the no script error
|
|
230
|
-
*/
|
|
188
|
+
/** Event type to emit when no worker script exists for the incoming event. */
|
|
231
189
|
function getNoScriptEventType(eventType) {
|
|
232
190
|
switch (eventType) {
|
|
233
191
|
case extraction_1.EventType.StartDeletingExtractorState:
|
|
@@ -7,13 +7,13 @@ exports.Spawn = void 0;
|
|
|
7
7
|
exports.spawn = spawn;
|
|
8
8
|
const yargs_1 = __importDefault(require("yargs"));
|
|
9
9
|
const helpers_1 = require("yargs/helpers");
|
|
10
|
-
const
|
|
10
|
+
const constants_1 = require("../../common/constants");
|
|
11
11
|
const helpers_2 = require("../../common/helpers");
|
|
12
12
|
const logger_1 = require("../../logger/logger");
|
|
13
13
|
const extraction_1 = require("../../types/extraction");
|
|
14
14
|
const workers_1 = require("../../types/workers");
|
|
15
|
-
const constants_1 = require("../../common/constants");
|
|
16
15
|
const create_worker_1 = require("../create-worker");
|
|
16
|
+
const emit_1 = require("../emit");
|
|
17
17
|
const spawn_helpers_1 = require("./spawn.helpers");
|
|
18
18
|
function getWorkerPath({ event, workerBasePath, }) {
|
|
19
19
|
let path = null;
|
|
@@ -44,18 +44,11 @@ function getWorkerPath({ event, workerBasePath, }) {
|
|
|
44
44
|
return path ? workerBasePath + path : null;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
* In case of lambda timeout, the class emits a lambda timeout event to the platform.
|
|
51
|
-
* @param {SpawnFactoryInterface} options - The options to create a new instance of Spawn class
|
|
52
|
-
* @param {AirSyncEvent} options.event - The event object received from the platform
|
|
53
|
-
* @param {object} options.initialState - The initial state of the adapter
|
|
54
|
-
* @param {string} [options.baseWorkerPath] - The base path for the worker files, usually `__dirname`
|
|
55
|
-
* @returns {Promise<Spawn>} - A new instance of Spawn class
|
|
47
|
+
* Spawns a worker thread for the event and manages its lifecycle (control
|
|
48
|
+
* events, graceful exit, lambda timeout handling). Resolves when the worker
|
|
49
|
+
* run is fully finished.
|
|
56
50
|
*/
|
|
57
51
|
async function spawn({ event, initialState, initialDomainMapping, options, baseWorkerPath, }) {
|
|
58
|
-
// Read the command line arguments to check if the local flag is passed.
|
|
59
52
|
const argv = await (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)).argv;
|
|
60
53
|
if (argv._.includes('local') || argv.local) {
|
|
61
54
|
options = Object.assign(Object.assign({}, (options || {})), { isLocalDevelopment: true });
|
|
@@ -80,7 +73,6 @@ async function spawn({ event, initialState, initialDomainMapping, options, baseW
|
|
|
80
73
|
workerBasePath: baseWorkerPath !== null && baseWorkerPath !== void 0 ? baseWorkerPath : __dirname,
|
|
81
74
|
});
|
|
82
75
|
}
|
|
83
|
-
// If a script is found for the event type, spawn a new worker.
|
|
84
76
|
if (script) {
|
|
85
77
|
try {
|
|
86
78
|
const worker = await (0, create_worker_1.createWorker)({
|
|
@@ -130,7 +122,7 @@ class Spawn {
|
|
|
130
122
|
? Math.min(options.timeout, this.defaultLambdaTimeout)
|
|
131
123
|
: this.defaultLambdaTimeout;
|
|
132
124
|
this.resolve = resolve;
|
|
133
|
-
//
|
|
125
|
+
// Soft timeout: ask the worker to gracefully exit.
|
|
134
126
|
this.softTimeoutTimer = setTimeout(() => void (async () => {
|
|
135
127
|
console.log('SOFT TIMEOUT: Sending a message to the worker to gracefully exit.');
|
|
136
128
|
this.softTimeoutSent = true;
|
|
@@ -144,7 +136,7 @@ class Spawn {
|
|
|
144
136
|
await this.exitFromMainThread();
|
|
145
137
|
}
|
|
146
138
|
})(), this.lambdaTimeout);
|
|
147
|
-
//
|
|
139
|
+
// Hard timeout: the worker did not exit in time, terminate it.
|
|
148
140
|
this.hardTimeoutTimer = setTimeout(() => void (async () => {
|
|
149
141
|
console.error('HARD TIMEOUT: Worker did not exit in time. Terminating the worker.');
|
|
150
142
|
if (worker) {
|
|
@@ -155,13 +147,10 @@ class Spawn {
|
|
|
155
147
|
await this.exitFromMainThread();
|
|
156
148
|
}
|
|
157
149
|
})(), this.lambdaTimeout * constants_1.HARD_TIMEOUT_MULTIPLIER);
|
|
158
|
-
//
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
// handled first, preventing a race condition where exitFromMainThread sees
|
|
163
|
-
// alreadyEmitted=false and emits an error even though the worker
|
|
164
|
-
// successfully emitted an event.
|
|
150
|
+
// After a soft timeout, defer exit handling via setImmediate so pending
|
|
151
|
+
// WorkerMessage events (e.g. WorkerMessageEmitted from onTimeout) are
|
|
152
|
+
// handled first; otherwise exitFromMainThread could see
|
|
153
|
+
// alreadyEmitted=false and emit a spurious error.
|
|
165
154
|
worker.on(workers_1.WorkerEvent.WorkerExit, (code) => {
|
|
166
155
|
const handler = async () => {
|
|
167
156
|
console.info('Worker exited with exit code: ' + code + '.');
|
|
@@ -176,27 +165,23 @@ class Spawn {
|
|
|
176
165
|
}
|
|
177
166
|
});
|
|
178
167
|
worker.on(workers_1.WorkerEvent.WorkerMessage, (message) => {
|
|
179
|
-
var _a, _b, _c
|
|
180
|
-
//
|
|
181
|
-
//
|
|
182
|
-
// them in main thread.
|
|
168
|
+
var _a, _b, _c;
|
|
169
|
+
// The snap-in platform handles worker-thread logs differently, so worker
|
|
170
|
+
// log messages are re-logged in the main thread.
|
|
183
171
|
if ((message === null || message === void 0 ? void 0 : message.subject) === workers_1.WorkerMessageSubject.WorkerMessageLog) {
|
|
184
172
|
const stringifiedArgs = (_a = message.payload) === null || _a === void 0 ? void 0 : _a.stringifiedArgs;
|
|
185
173
|
const level = (_b = message.payload) === null || _b === void 0 ? void 0 : _b.level;
|
|
186
|
-
|
|
187
|
-
this.logger.logFn(stringifiedArgs, level, isSdkLog);
|
|
174
|
+
this.logger.logFn(stringifiedArgs, level);
|
|
188
175
|
}
|
|
189
|
-
// If worker sends a message that it has emitted an event, then set alreadyEmitted to true.
|
|
190
176
|
if ((message === null || message === void 0 ? void 0 : message.subject) === workers_1.WorkerMessageSubject.WorkerMessageEmitted) {
|
|
191
177
|
console.info('Worker has emitted message to AirSync.');
|
|
192
178
|
this.alreadyEmitted = true;
|
|
193
179
|
}
|
|
194
|
-
//
|
|
180
|
+
// Capture the worker's failure reason for use in the error event.
|
|
195
181
|
if ((message === null || message === void 0 ? void 0 : message.subject) === workers_1.WorkerMessageSubject.WorkerMessageFailed) {
|
|
196
|
-
this.workerFailedMessage = (
|
|
182
|
+
this.workerFailedMessage = (_c = message.payload) === null || _c === void 0 ? void 0 : _c.message;
|
|
197
183
|
}
|
|
198
184
|
});
|
|
199
|
-
// Log memory usage every 30 seconds
|
|
200
185
|
this.memoryMonitoringInterval = setInterval(() => {
|
|
201
186
|
try {
|
|
202
187
|
const memoryInfo = (0, helpers_2.getMemoryUsage)();
|
|
@@ -205,7 +190,7 @@ class Spawn {
|
|
|
205
190
|
}
|
|
206
191
|
}
|
|
207
192
|
catch (error) {
|
|
208
|
-
//
|
|
193
|
+
// Stop monitoring on failure to prevent repeated crashes
|
|
209
194
|
console.warn('Memory monitoring failed, stopping logging of memory usage interval', error);
|
|
210
195
|
if (this.memoryMonitoringInterval) {
|
|
211
196
|
clearInterval(this.memoryMonitoringInterval);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const { workerData } = require('node:worker_threads');
|
|
3
3
|
require('ts-node').register();
|
|
4
|
-
const { Logger
|
|
4
|
+
const { Logger } = require('../logger/logger');
|
|
5
5
|
console = new Logger({ event: workerData.event, options: workerData.options });
|
|
6
|
-
|
|
7
|
-
require(workerData.workerPath);
|
|
8
|
-
});
|
|
6
|
+
require(workerData.workerPath);
|
package/dist/repo/repo.d.ts
CHANGED
|
@@ -10,6 +10,16 @@ export declare class Repo {
|
|
|
10
10
|
private onUpload;
|
|
11
11
|
private options?;
|
|
12
12
|
uploadedArtifacts: Artifact[];
|
|
13
|
+
dateRanges: {
|
|
14
|
+
creationDate: {
|
|
15
|
+
oldest?: number;
|
|
16
|
+
newest?: number;
|
|
17
|
+
};
|
|
18
|
+
modifiedDate: {
|
|
19
|
+
oldest?: number;
|
|
20
|
+
newest?: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
13
23
|
constructor({ event, itemType, normalize, onUpload, options, }: RepoFactoryInterface);
|
|
14
24
|
getItems(): (NormalizedItem | NormalizedAttachment | Item)[];
|
|
15
25
|
upload(batch?: (NormalizedItem | NormalizedAttachment | Item)[]): Promise<void | ErrorRecord>;
|
package/dist/repo/repo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/repo/repo.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/repo/repo.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAG3D,OAAO,EACL,oBAAoB,EACpB,cAAc,EACd,oBAAoB,EACrB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,IAAI;IACf,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,KAAK,CAAmD;IAChE,OAAO,CAAC,SAAS,CAAC,CAAwD;IAC1E,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,OAAO,CAAC,CAAuB;IAChC,iBAAiB,EAAE,QAAQ,EAAE,CAAC;IAC9B,UAAU,EAAE;QACjB,YAAY,EAAE;YAAE,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACnD,YAAY,EAAE;YAAE,MAAM,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACpD,CAGC;gBAEU,EACV,KAAK,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,OAAO,GACR,EAAE,oBAAoB;IAUvB,QAAQ,IAAI,CAAC,cAAc,GAAG,oBAAoB,GAAG,IAAI,CAAC,EAAE;IAItD,MAAM,CACV,KAAK,CAAC,EAAE,CAAC,cAAc,GAAG,oBAAoB,GAAG,IAAI,CAAC,EAAE,GACvD,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC;IAsDxB,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAkC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo.helpers.d.ts","sourceRoot":"","sources":["../../src/repo/repo.helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CACzB,KAAK,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3C,EAAE,EAAE,MAAM,GACT,IAAI,CAON;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGlE"}
|