@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,31 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SyncMapperRecordTargetType = exports.SyncMapperRecordStatus = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Status of a sync mapper record indicating its operational state.
|
|
6
|
-
*/
|
|
7
4
|
var SyncMapperRecordStatus;
|
|
8
5
|
(function (SyncMapperRecordStatus) {
|
|
9
6
|
/** The mapping is active and operational (default) */
|
|
10
7
|
SyncMapperRecordStatus["OPERATIONAL"] = "operational";
|
|
11
8
|
/** The mapping was filtered out by user filter settings */
|
|
12
9
|
SyncMapperRecordStatus["FILTERED"] = "filtered";
|
|
13
|
-
/**
|
|
14
|
-
* The external object should be ignored in sync operations.
|
|
15
|
-
* Use to prevent objects from being created or updated in DevRev.
|
|
16
|
-
*/
|
|
10
|
+
/** Ignore the external object in sync; prevents create/update in DevRev. */
|
|
17
11
|
SyncMapperRecordStatus["IGNORED"] = "ignored";
|
|
18
12
|
})(SyncMapperRecordStatus || (exports.SyncMapperRecordStatus = SyncMapperRecordStatus = {}));
|
|
19
|
-
/**
|
|
20
|
-
* Types of DevRev entities that can be targets in sync mapper records.
|
|
21
|
-
*/
|
|
22
13
|
var SyncMapperRecordTargetType;
|
|
23
14
|
(function (SyncMapperRecordTargetType) {
|
|
24
15
|
SyncMapperRecordTargetType["ACCESS_CONTROL_ENTRY"] = "access_control_entry";
|
|
25
16
|
SyncMapperRecordTargetType["ACCOUNT"] = "account";
|
|
26
|
-
SyncMapperRecordTargetType["
|
|
27
|
-
SyncMapperRecordTargetType["
|
|
28
|
-
SyncMapperRecordTargetType["
|
|
17
|
+
SyncMapperRecordTargetType["AIRDROP_AUTHORIZATION_POLICY"] = "airdrop_authorization_policy";
|
|
18
|
+
SyncMapperRecordTargetType["AIRDROP_FIELD_AUTHORIZATION_POLICY"] = "airdrop_field_authorization_policy";
|
|
19
|
+
SyncMapperRecordTargetType["AIRDROP_PLATFORM_GROUP"] = "airdrop_platform_group";
|
|
29
20
|
SyncMapperRecordTargetType["ARTICLE"] = "article";
|
|
30
21
|
SyncMapperRecordTargetType["ARTIFACT"] = "artifact";
|
|
31
22
|
SyncMapperRecordTargetType["CHAT"] = "chat";
|
package/dist/mappers/mappers.js
CHANGED
|
@@ -1,83 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Mappers = void 0;
|
|
4
|
-
const
|
|
5
|
-
/**
|
|
6
|
-
* Manages sync mapper records that link external system items to DevRev items.
|
|
7
|
-
*
|
|
8
|
-
* Used for tracking relationships between external and DevRev entities during sync operations.
|
|
9
|
-
*/
|
|
4
|
+
const client_1 = require("../http/client");
|
|
5
|
+
/** Manages sync mapper records that link external system items to DevRev items. */
|
|
10
6
|
class Mappers {
|
|
11
7
|
constructor({ event }) {
|
|
12
8
|
this.devrevApiEndpoint = event.execution_metadata.devrev_endpoint;
|
|
13
9
|
this.devrevApiToken = event.context.secrets.service_account_token;
|
|
14
10
|
}
|
|
15
|
-
/**
|
|
16
|
-
* Retrieves a sync mapper record by DevRev ID.
|
|
17
|
-
*
|
|
18
|
-
* Used to find the mapping when you know the DevRev ID and want to find the external system ID.
|
|
19
|
-
*
|
|
20
|
-
* @param params - Query parameters of type MappersGetByTargetIdParams
|
|
21
|
-
* @returns Promise with response data containing the sync mapper record
|
|
22
|
-
*/
|
|
23
11
|
async getByTargetId(params) {
|
|
24
12
|
const { sync_unit, target } = params;
|
|
25
|
-
|
|
13
|
+
const response = await client_1.axiosClient.get(`${this.devrevApiEndpoint}/internal/airdrop.sync-mapper-record.get-by-target`, {
|
|
26
14
|
headers: {
|
|
27
15
|
Authorization: this.devrevApiToken,
|
|
28
16
|
},
|
|
29
17
|
params: { sync_unit, target },
|
|
30
18
|
});
|
|
19
|
+
return response.data;
|
|
31
20
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Retrieves a sync mapper record by external system ID.
|
|
34
|
-
*
|
|
35
|
-
* Used to find the mapping when you know the external system ID and want to find the DevRev ID.
|
|
36
|
-
*
|
|
37
|
-
* @param params - Query parameters of type MappersGetByExternalIdParams
|
|
38
|
-
* @returns Promise with response data containing the sync mapper record
|
|
39
|
-
*/
|
|
40
21
|
async getByExternalId(params) {
|
|
41
22
|
const { sync_unit, external_id, target_type } = params;
|
|
42
|
-
|
|
23
|
+
const response = await client_1.axiosClient.get(`${this.devrevApiEndpoint}/internal/airdrop.sync-mapper-record.get-by-external-id`, {
|
|
43
24
|
headers: {
|
|
44
25
|
Authorization: this.devrevApiToken,
|
|
45
26
|
},
|
|
46
27
|
params: { sync_unit, external_id, target_type },
|
|
47
28
|
});
|
|
29
|
+
return response.data;
|
|
48
30
|
}
|
|
49
|
-
/**
|
|
50
|
-
* Creates a new sync mapper record to establish a relationship between external system
|
|
51
|
-
* entities and DevRev entities.
|
|
52
|
-
*
|
|
53
|
-
* This is called after importing an item from external system to DevRev to record
|
|
54
|
-
* the mapping for future synchronization operations.
|
|
55
|
-
*
|
|
56
|
-
* @param params - Creation parameters of type MappersCreateParams
|
|
57
|
-
* @returns Promise with response data containing the created sync mapper record
|
|
58
|
-
*/
|
|
31
|
+
/** Called after importing an item to DevRev to record the mapping for future syncs. */
|
|
59
32
|
async create(params) {
|
|
60
|
-
|
|
33
|
+
const response = await client_1.axiosClient.post(`${this.devrevApiEndpoint}/internal/airdrop.sync-mapper-record.create`, params, {
|
|
61
34
|
headers: {
|
|
62
35
|
Authorization: this.devrevApiToken,
|
|
63
36
|
},
|
|
64
37
|
});
|
|
38
|
+
return response.data;
|
|
65
39
|
}
|
|
66
|
-
/**
|
|
67
|
-
* Updates an existing sync mapper record.
|
|
68
|
-
*
|
|
69
|
-
* Used to modify existing mappings when external system entities change or when
|
|
70
|
-
* additional DevRev entities need to be associated.
|
|
71
|
-
*
|
|
72
|
-
* @param params - Update parameters of type MappersUpdateParams
|
|
73
|
-
* @returns Promise with response data containing the updated sync mapper record
|
|
74
|
-
*/
|
|
75
40
|
async update(params) {
|
|
76
|
-
|
|
41
|
+
const response = await client_1.axiosClient.post(`${this.devrevApiEndpoint}/internal/airdrop.sync-mapper-record.update`, params, {
|
|
77
42
|
headers: {
|
|
78
43
|
Authorization: this.devrevApiToken,
|
|
79
44
|
},
|
|
80
45
|
});
|
|
46
|
+
return response.data;
|
|
81
47
|
}
|
|
82
48
|
}
|
|
83
49
|
exports.Mappers = Mappers;
|
|
@@ -1,56 +1,54 @@
|
|
|
1
|
-
import { BaseState } from '../../state/
|
|
2
|
-
import {
|
|
3
|
-
import { AirSyncEvent, EventData, ExtractorEventType } from '../../types/extraction';
|
|
1
|
+
import { BaseState } from '../../state/state';
|
|
2
|
+
import { SdkState } from '../../state/state.interfaces';
|
|
3
|
+
import { AirSyncEvent, EventData, ExtractorEventType, WorkerMetadata } from '../../types/extraction';
|
|
4
4
|
import { LoaderEventType } from '../../types/loading';
|
|
5
|
-
import { WorkerAdapterOptions } from '../../types/workers';
|
|
5
|
+
import { TaskResult, WorkerAdapterOptions } from '../../types/workers';
|
|
6
6
|
import { Uploader } from '../../uploader/uploader';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* (`ExtractionAdapter`, `LoadingAdapter`) implement the abstract hooks to inject
|
|
11
|
-
* their own pre-emit work and event payload shaping.
|
|
12
|
-
*
|
|
13
|
-
* @typeParam ConnectorState - the connector-owned state shape
|
|
14
|
-
* @typeParam StateClass - the mode's `BaseState` subclass
|
|
8
|
+
* Shared state/behavior for both sync modes; owns the `emit` control-protocol
|
|
9
|
+
* flow as a template method with mode-specific hooks.
|
|
15
10
|
*/
|
|
16
|
-
export declare abstract class BaseAdapter<ConnectorState
|
|
11
|
+
export declare abstract class BaseAdapter<ConnectorState> {
|
|
17
12
|
readonly event: AirSyncEvent;
|
|
18
13
|
readonly options?: WorkerAdapterOptions;
|
|
19
|
-
isTimeout: boolean;
|
|
20
14
|
hasWorkerEmitted: boolean;
|
|
21
|
-
|
|
15
|
+
private _isTimeout;
|
|
16
|
+
private resolveTimeoutSignal;
|
|
17
|
+
readonly timeoutSignal: Promise<void>;
|
|
18
|
+
protected adapterState: BaseState<ConnectorState>;
|
|
22
19
|
protected uploader: Uploader;
|
|
23
20
|
constructor({ event, adapterState, options, }: {
|
|
24
21
|
event: AirSyncEvent;
|
|
25
|
-
adapterState:
|
|
22
|
+
adapterState: BaseState<ConnectorState>;
|
|
26
23
|
options?: WorkerAdapterOptions;
|
|
27
24
|
});
|
|
25
|
+
get isTimeout(): boolean;
|
|
26
|
+
set isTimeout(value: boolean);
|
|
27
|
+
/** Connector-owned state exposed to snap-in code. */
|
|
28
28
|
get state(): ConnectorState;
|
|
29
29
|
set state(value: ConnectorState);
|
|
30
|
+
/** SDK-internal bookkeeping state; not for connector use. */
|
|
31
|
+
get sdkState(): SdkState;
|
|
32
|
+
get extractionScope(): import("../../types/workers").ExtractionScope;
|
|
30
33
|
postState(): Promise<void>;
|
|
31
|
-
/**
|
|
32
|
-
* Pre-emit hook run before any state is persisted or the event is sent.
|
|
33
|
-
* Extraction uploads pending repos and updates extraction boundaries here;
|
|
34
|
-
* loading has nothing to do. Throwing aborts the emit (the caller signals
|
|
35
|
-
* worker exit).
|
|
36
|
-
*/
|
|
34
|
+
/** Pre-emit hook, runs before state is persisted. Throwing aborts the emit. */
|
|
37
35
|
protected abstract beforeEmit(newEventType: ExtractorEventType | LoaderEventType): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Builds the mode-specific extras merged into the emitted event payload
|
|
40
|
-
* (extraction: artifacts; loading: reports + processed files).
|
|
41
|
-
*/
|
|
36
|
+
/** Mode-specific extras merged into the emitted event payload. */
|
|
42
37
|
protected abstract buildEmitPayload(newEventType: ExtractorEventType | LoaderEventType): EventData;
|
|
43
38
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
39
|
+
* Mode-specific worker metadata merged into the emitted event. The library
|
|
40
|
+
* version and state-date range are added centrally in `emit`, so subclasses
|
|
41
|
+
* only contribute their own statistics.
|
|
46
42
|
*/
|
|
43
|
+
protected buildWorkerMetadata(newEventType: ExtractorEventType | LoaderEventType): WorkerMetadata | undefined;
|
|
44
|
+
/** Post-emit hook, runs after the event has been sent successfully. */
|
|
47
45
|
protected abstract afterEmit(newEventType: ExtractorEventType | LoaderEventType): void;
|
|
48
46
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* @param data - The data to be sent with the event
|
|
47
|
+
* Maps a {@link TaskResult} to the phase-appropriate platform event and emits
|
|
48
|
+
* it exactly once. Invoked by the worker driver, not by connectors —
|
|
49
|
+
* connectors signal outcomes by returning a `TaskResult`, never by emitting.
|
|
53
50
|
*/
|
|
54
|
-
|
|
51
|
+
emitFromResult(result: TaskResult): Promise<void>;
|
|
52
|
+
protected emit(newEventType: ExtractorEventType | LoaderEventType, data?: EventData): Promise<void>;
|
|
55
53
|
}
|
|
56
54
|
//# sourceMappingURL=base-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-adapter.d.ts","sourceRoot":"","sources":["../../../src/multithreading/adapters/base-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-adapter.d.ts","sourceRoot":"","sources":["../../../src/multithreading/adapters/base-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EACL,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,UAAU,EACV,oBAAoB,EAGrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAInD;;;GAGG;AACH,8BAAsB,WAAW,CAAC,cAAc;IAC9C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,oBAAoB,CAAC;IACxC,gBAAgB,EAAE,OAAO,CAAC;IAE1B,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,oBAAoB,CAAc;IAC1C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,CAElC;IAEH,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAClD,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC;gBAEjB,EACV,KAAK,EACL,YAAY,EACZ,OAAO,GACR,EAAE;QACD,KAAK,EAAE,YAAY,CAAC;QACpB,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;QACxC,OAAO,CAAC,EAAE,oBAAoB,CAAC;KAChC;IAWD,IAAI,SAAS,IAAI,OAAO,CAEvB;IAED,IAAI,SAAS,CAAC,KAAK,EAAE,OAAO,EAK3B;IAED,qDAAqD;IACrD,IAAI,KAAK,IAAI,cAAc,CAE1B;IAED,IAAI,KAAK,CAAC,KAAK,EAAE,cAAc,EAE9B;IAED,6DAA6D;IAC7D,IAAI,QAAQ,IAAI,QAAQ,CAEvB;IAED,IAAI,eAAe,kDAElB;IAEK,SAAS;IAIf,+EAA+E;IAC/E,SAAS,CAAC,QAAQ,CAAC,UAAU,CAC3B,YAAY,EAAE,kBAAkB,GAAG,eAAe,GACjD,OAAO,CAAC,IAAI,CAAC;IAEhB,kEAAkE;IAClE,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CACjC,YAAY,EAAE,kBAAkB,GAAG,eAAe,GACjD,SAAS;IAEZ;;;;OAIG;IACH,SAAS,CAAC,mBAAmB,CAE3B,YAAY,EAAE,kBAAkB,GAAG,eAAe,GACjD,cAAc,GAAG,SAAS;IAI7B,uEAAuE;IACvE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAC1B,YAAY,EAAE,kBAAkB,GAAG,eAAe,GACjD,IAAI;IAEP;;;;OAIG;IACG,cAAc,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;cAoBvC,IAAI,CAClB,YAAY,EAAE,kBAAkB,GAAG,eAAe,EAClD,IAAI,CAAC,EAAE,SAAS,GACf,OAAO,CAAC,IAAI,CAAC;CAgEjB"}
|
|
@@ -3,103 +3,138 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseAdapter = void 0;
|
|
4
4
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
5
5
|
const constants_1 = require("../../common/constants");
|
|
6
|
-
const control_protocol_1 = require("../../common/control-protocol");
|
|
7
|
-
const helpers_1 = require("../../common/helpers");
|
|
8
6
|
const logger_1 = require("../../logger/logger");
|
|
9
|
-
const logger_context_1 = require("../../logger/logger.context");
|
|
10
7
|
const workers_1 = require("../../types/workers");
|
|
11
8
|
const uploader_1 = require("../../uploader/uploader");
|
|
9
|
+
const emit_1 = require("../emit");
|
|
10
|
+
const spawn_helpers_1 = require("../spawn/spawn.helpers");
|
|
12
11
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* (`ExtractionAdapter`, `LoadingAdapter`) implement the abstract hooks to inject
|
|
16
|
-
* their own pre-emit work and event payload shaping.
|
|
17
|
-
*
|
|
18
|
-
* @typeParam ConnectorState - the connector-owned state shape
|
|
19
|
-
* @typeParam StateClass - the mode's `BaseState` subclass
|
|
12
|
+
* Shared state/behavior for both sync modes; owns the `emit` control-protocol
|
|
13
|
+
* flow as a template method with mode-specific hooks.
|
|
20
14
|
*/
|
|
21
15
|
class BaseAdapter {
|
|
22
16
|
constructor({ event, adapterState, options, }) {
|
|
17
|
+
this._isTimeout = false;
|
|
18
|
+
this.timeoutSignal = new Promise((resolve) => {
|
|
19
|
+
this.resolveTimeoutSignal = resolve;
|
|
20
|
+
});
|
|
23
21
|
this.event = event;
|
|
24
22
|
this.options = options;
|
|
25
23
|
this.adapterState = adapterState;
|
|
26
24
|
this.hasWorkerEmitted = false;
|
|
27
|
-
this.isTimeout = false;
|
|
28
25
|
this.uploader = new uploader_1.Uploader({
|
|
29
26
|
event,
|
|
30
27
|
options,
|
|
31
28
|
});
|
|
32
29
|
}
|
|
30
|
+
get isTimeout() {
|
|
31
|
+
return this._isTimeout;
|
|
32
|
+
}
|
|
33
|
+
set isTimeout(value) {
|
|
34
|
+
this._isTimeout = value;
|
|
35
|
+
if (value) {
|
|
36
|
+
this.resolveTimeoutSignal();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/** Connector-owned state exposed to snap-in code. */
|
|
33
40
|
get state() {
|
|
34
41
|
return this.adapterState.state;
|
|
35
42
|
}
|
|
36
43
|
set state(value) {
|
|
37
44
|
this.adapterState.state = value;
|
|
38
45
|
}
|
|
46
|
+
/** SDK-internal bookkeeping state; not for connector use. */
|
|
47
|
+
get sdkState() {
|
|
48
|
+
return this.adapterState.sdkState;
|
|
49
|
+
}
|
|
50
|
+
get extractionScope() {
|
|
51
|
+
return this.adapterState.extractionScope;
|
|
52
|
+
}
|
|
39
53
|
async postState() {
|
|
40
|
-
|
|
41
|
-
await this.adapterState.postState();
|
|
42
|
-
});
|
|
54
|
+
await this.adapterState.postState();
|
|
43
55
|
}
|
|
44
56
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
* @param data - The data to be sent with the event
|
|
57
|
+
* Mode-specific worker metadata merged into the emitted event. The library
|
|
58
|
+
* version and state-date range are added centrally in `emit`, so subclasses
|
|
59
|
+
* only contribute their own statistics.
|
|
49
60
|
*/
|
|
61
|
+
buildWorkerMetadata(
|
|
62
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
63
|
+
newEventType) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Maps a {@link TaskResult} to the phase-appropriate platform event and emits
|
|
68
|
+
* it exactly once. Invoked by the worker driver, not by connectors —
|
|
69
|
+
* connectors signal outcomes by returning a `TaskResult`, never by emitting.
|
|
70
|
+
*/
|
|
71
|
+
async emitFromResult(result) {
|
|
72
|
+
const { eventType, illegal } = (0, spawn_helpers_1.getEventTypeForResult)(this.event.payload.event_type, result.status);
|
|
73
|
+
const data = {};
|
|
74
|
+
if (result.status === 'delay') {
|
|
75
|
+
data.delay = result.delaySeconds;
|
|
76
|
+
}
|
|
77
|
+
else if (result.status === 'error') {
|
|
78
|
+
data.error = result.error;
|
|
79
|
+
}
|
|
80
|
+
else if (illegal) {
|
|
81
|
+
data.error = {
|
|
82
|
+
message: `Worker returned status '${result.status}' for a non-resumable phase (${this.event.payload.event_type}), which is not allowed. Emitting an error event instead.`,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
await this.emit(eventType, data);
|
|
86
|
+
}
|
|
50
87
|
async emit(newEventType, data) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
88
|
+
var _a;
|
|
89
|
+
if (this.hasWorkerEmitted) {
|
|
90
|
+
console.warn(`Trying to emit event with event type: ${newEventType}. Ignoring emit request because it has already been emitted.`);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
await this.beforeEmit(newEventType);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.error('Error while preparing to emit event', error);
|
|
98
|
+
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.postMessage(workers_1.WorkerMessageSubject.WorkerMessageExit);
|
|
99
|
+
this.hasWorkerEmitted = true;
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// Save state on every emit, except for start and delete events
|
|
103
|
+
if (!constants_1.STATELESS_EVENT_TYPES.includes(this.event.payload.event_type)) {
|
|
104
|
+
console.log(`Saving state before emitting event with event type: ${newEventType}.`);
|
|
57
105
|
try {
|
|
58
|
-
await this.
|
|
106
|
+
await this.adapterState.postState();
|
|
59
107
|
}
|
|
60
108
|
catch (error) {
|
|
61
|
-
console.error('Error while
|
|
109
|
+
console.error('Error while posting state', error);
|
|
62
110
|
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.postMessage(workers_1.WorkerMessageSubject.WorkerMessageExit);
|
|
63
111
|
this.hasWorkerEmitted = true;
|
|
64
112
|
return;
|
|
65
113
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
await this.adapterState.postState();
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
console.error('Error while posting state', error);
|
|
74
|
-
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.postMessage(workers_1.WorkerMessageSubject.WorkerMessageExit);
|
|
75
|
-
this.hasWorkerEmitted = true;
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
try {
|
|
80
|
-
// Always prune error messages to make them shorter before emit
|
|
81
|
-
if ((_a = data === null || data === void 0 ? void 0 : data.error) === null || _a === void 0 ? void 0 : _a.message) {
|
|
82
|
-
data.error.message = (0, helpers_1.truncateMessage)(data.error.message);
|
|
83
|
-
}
|
|
84
|
-
await (0, control_protocol_1.emit)({
|
|
85
|
-
eventType: newEventType,
|
|
86
|
-
event: this.event,
|
|
87
|
-
data: Object.assign(Object.assign({}, data), this.buildEmitPayload(newEventType)),
|
|
88
|
-
});
|
|
89
|
-
const message = {
|
|
90
|
-
subject: workers_1.WorkerMessageSubject.WorkerMessageEmitted,
|
|
91
|
-
payload: { eventType: newEventType },
|
|
92
|
-
};
|
|
93
|
-
this.afterEmit(newEventType);
|
|
94
|
-
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.postMessage(message);
|
|
95
|
-
this.hasWorkerEmitted = true;
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
console.error(`Error while emitting event with event type: ${newEventType}.`, (0, logger_1.serializeError)(error));
|
|
99
|
-
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.postMessage(workers_1.WorkerMessageSubject.WorkerMessageExit);
|
|
100
|
-
this.hasWorkerEmitted = true;
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
if ((_a = data === null || data === void 0 ? void 0 : data.error) === null || _a === void 0 ? void 0 : _a.message) {
|
|
117
|
+
data.error.message = (0, logger_1.truncateMessage)(data.error.message);
|
|
101
118
|
}
|
|
102
|
-
|
|
119
|
+
await (0, emit_1.emit)({
|
|
120
|
+
eventType: newEventType,
|
|
121
|
+
event: this.event,
|
|
122
|
+
data: Object.assign(Object.assign({}, data), this.buildEmitPayload(newEventType)),
|
|
123
|
+
worker_metadata: this.buildWorkerMetadata(newEventType),
|
|
124
|
+
});
|
|
125
|
+
const message = {
|
|
126
|
+
subject: workers_1.WorkerMessageSubject.WorkerMessageEmitted,
|
|
127
|
+
payload: { eventType: newEventType },
|
|
128
|
+
};
|
|
129
|
+
this.afterEmit(newEventType);
|
|
130
|
+
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.postMessage(message);
|
|
131
|
+
this.hasWorkerEmitted = true;
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
console.error(`Error while emitting event with event type: ${newEventType}.`, (0, logger_1.serializeError)(error));
|
|
135
|
+
node_worker_threads_1.parentPort === null || node_worker_threads_1.parentPort === void 0 ? void 0 : node_worker_threads_1.parentPort.postMessage(workers_1.WorkerMessageSubject.WorkerMessageExit);
|
|
136
|
+
this.hasWorkerEmitted = true;
|
|
137
|
+
}
|
|
103
138
|
}
|
|
104
139
|
}
|
|
105
140
|
exports.BaseAdapter = BaseAdapter;
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
import { Repo } from '../../repo/repo';
|
|
2
2
|
import { NormalizedAttachment, RepoInterface } from '../../repo/repo.interfaces';
|
|
3
|
-
import {
|
|
4
|
-
import { AirSyncEvent, ExternalSystemAttachmentProcessors, ExternalSystemAttachmentStreamingFunction, ExtractorEventType,
|
|
3
|
+
import { BaseState } from '../../state/state';
|
|
4
|
+
import { AirSyncEvent, EventData, ExternalSystemAttachmentProcessors, ExternalSystemAttachmentStreamingFunction, ExtractorEventType, ProcessAttachmentReturnType, WorkerMetadata } from '../../types/extraction';
|
|
5
5
|
import { LoaderEventType } from '../../types/loading';
|
|
6
|
-
import { WorkerAdapterOptions } from '../../types/workers';
|
|
6
|
+
import { TaskResult, WorkerAdapterOptions } from '../../types/workers';
|
|
7
7
|
import { Artifact } from '../../uploader/uploader.interfaces';
|
|
8
8
|
import { BaseAdapter } from './base-adapter';
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
* extraction surface (repos, artifacts, attachment streaming) and updates the
|
|
12
|
-
* extraction boundaries before emitting.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
export declare class ExtractionAdapter<ConnectorState> extends BaseAdapter<ConnectorState, ExtractionState<ConnectorState>> {
|
|
9
|
+
/** Adapter passed to extraction tasks (repos, artifacts, attachment streaming). @public */
|
|
10
|
+
export declare class ExtractionAdapter<ConnectorState> extends BaseAdapter<ConnectorState> {
|
|
17
11
|
private _artifacts;
|
|
18
12
|
private repos;
|
|
13
|
+
private lastExtractedItemType?;
|
|
19
14
|
private currentEventDataLength;
|
|
20
15
|
constructor(params: {
|
|
21
16
|
event: AirSyncEvent;
|
|
22
|
-
adapterState:
|
|
17
|
+
adapterState: BaseState<ConnectorState>;
|
|
23
18
|
options?: WorkerAdapterOptions;
|
|
24
19
|
});
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Returns whether the given item type should be extracted.
|
|
28
|
-
* Defaults to true if the scope is empty or the item type is not listed.
|
|
29
|
-
*/
|
|
20
|
+
/** Defaults to true if the scope is empty or the item type is not listed. */
|
|
30
21
|
shouldExtract(itemType: string): boolean;
|
|
31
22
|
initializeRepos(repos: RepoInterface[]): void;
|
|
32
23
|
getRepo(itemType: string): Repo | undefined;
|
|
@@ -34,25 +25,21 @@ export declare class ExtractionAdapter<ConnectorState> extends BaseAdapter<Conne
|
|
|
34
25
|
set artifacts(artifacts: Artifact[]);
|
|
35
26
|
protected beforeEmit(newEventType: ExtractorEventType | LoaderEventType): Promise<void>;
|
|
36
27
|
protected buildEmitPayload(newEventType: ExtractorEventType | LoaderEventType): EventData;
|
|
28
|
+
/**
|
|
29
|
+
* Attaches the last-extracted item type and its created/modified date ranges
|
|
30
|
+
* to data/attachment done/progress events, mirroring the metadata v1 sent.
|
|
31
|
+
*/
|
|
32
|
+
protected buildWorkerMetadata(newEventType: ExtractorEventType | LoaderEventType): WorkerMetadata | undefined;
|
|
33
|
+
private toRfc3339Timestamp;
|
|
37
34
|
protected afterEmit(): void;
|
|
38
35
|
uploadAllRepos(): Promise<void>;
|
|
39
36
|
processAttachment(attachment: NormalizedAttachment, stream: ExternalSystemAttachmentStreamingFunction): Promise<ProcessAttachmentReturnType>;
|
|
40
|
-
/**
|
|
41
|
-
* Destroys a stream to prevent memory leaks.
|
|
42
|
-
* @param httpStream - The axios response stream to destroy
|
|
43
|
-
*/
|
|
37
|
+
/** Destroys a stream to prevent memory leaks. */
|
|
44
38
|
private destroyHttpStream;
|
|
45
|
-
/**
|
|
46
|
-
* Streams the attachments to the DevRev platform.
|
|
47
|
-
* The attachments are streamed to the platform and the artifact information is returned.
|
|
48
|
-
* @param params - The parameters to stream the attachments
|
|
49
|
-
* @returns The response object containing the ssorAttachment artifact information
|
|
50
|
-
* or error information if there was an error
|
|
51
|
-
*/
|
|
52
39
|
streamAttachments<NewBatch>({ stream, processors, batchSize, }: {
|
|
53
40
|
stream: ExternalSystemAttachmentStreamingFunction;
|
|
54
41
|
processors?: ExternalSystemAttachmentProcessors<ConnectorState, NormalizedAttachment[], NewBatch>;
|
|
55
42
|
batchSize?: number;
|
|
56
|
-
}): Promise<
|
|
43
|
+
}): Promise<TaskResult>;
|
|
57
44
|
}
|
|
58
45
|
//# sourceMappingURL=extraction-adapter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction-adapter.d.ts","sourceRoot":"","sources":["../../../src/multithreading/adapters/extraction-adapter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extraction-adapter.d.ts","sourceRoot":"","sources":["../../../src/multithreading/adapters/extraction-adapter.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EACL,oBAAoB,EACpB,aAAa,EACd,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,SAAS,EACT,kCAAkC,EAClC,yCAAyC,EACzC,kBAAkB,EAElB,2BAA2B,EAC3B,cAAc,EACf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAkB,MAAM,oCAAoC,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,2FAA2F;AAC3F,qBAAa,iBAAiB,CAC5B,cAAc,CACd,SAAQ,WAAW,CAAC,cAAc,CAAC;IACnC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,qBAAqB,CAAC,CAAS;IACvC,OAAO,CAAC,sBAAsB,CAAa;gBAE/B,MAAM,EAAE;QAClB,KAAK,EAAE,YAAY,CAAC;QACpB,YAAY,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;QACxC,OAAO,CAAC,EAAE,oBAAoB,CAAC;KAChC;IAKD,6EAA6E;IAC7E,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAOxC,eAAe,CAAC,KAAK,EAAE,aAAa,EAAE;IA0CtC,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;IAW3C,IAAI,SAAS,IAAI,QAAQ,EAAE,CAE1B;IAED,IAAI,SAAS,CAAC,SAAS,EAAE,QAAQ,EAAE,EAIlC;cAEe,UAAU,CACxB,YAAY,EAAE,kBAAkB,GAAG,eAAe,GACjD,OAAO,CAAC,IAAI,CAAC;IAyChB,SAAS,CAAC,gBAAgB,CACxB,YAAY,EAAE,kBAAkB,GAAG,eAAe,GACjD,SAAS;IAOZ;;;OAGG;cACgB,mBAAmB,CACpC,YAAY,EAAE,kBAAkB,GAAG,eAAe,GACjD,cAAc,GAAG,SAAS;IAmC7B,OAAO,CAAC,kBAAkB;IAQ1B,SAAS,CAAC,SAAS,IAAI,IAAI;IAIrB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAU/B,iBAAiB,CACrB,UAAU,EAAE,oBAAoB,EAChC,MAAM,EAAE,yCAAyC,GAChD,OAAO,CAAC,2BAA2B,CAAC;IA2GvC,iDAAiD;IACjD,OAAO,CAAC,iBAAiB;IAcnB,iBAAiB,CAAC,QAAQ,EAAE,EAChC,MAAM,EACN,UAAU,EACV,SAAa,GACd,EAAE;QACD,MAAM,EAAE,yCAAyC,CAAC;QAClD,UAAU,CAAC,EAAE,kCAAkC,CAC7C,cAAc,EACd,oBAAoB,EAAE,EACtB,QAAQ,CACT,CAAC;QACF,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,UAAU,CAAC;CA8HxB"}
|