@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,13 +1,10 @@
|
|
|
1
1
|
import { InputData } from '@devrev/typescript-sdk/dist/snap-ins';
|
|
2
|
+
import { ExtractionAdapter } from '../multithreading/adapters/extraction-adapter';
|
|
3
|
+
import { NormalizedAttachment } from '../repo/repo.interfaces';
|
|
2
4
|
import { Artifact } from '../uploader/uploader.interfaces';
|
|
3
5
|
import { ErrorRecord } from './common';
|
|
4
|
-
import { NormalizedAttachment } from '../repo/repo.interfaces';
|
|
5
|
-
import { ExtractionAdapter } from '../multithreading/adapters/extraction-adapter';
|
|
6
6
|
import { DonV2, LoaderReport, RateLimited } from './loading';
|
|
7
|
-
/**
|
|
8
|
-
* EventType is an enum that defines the different types of events that can be sent to the external extractor from AirSync.
|
|
9
|
-
* The external extractor can use these events to know what to do next in the extraction process.
|
|
10
|
-
*/
|
|
7
|
+
/** Events sent from AirSync to the connector. */
|
|
11
8
|
export declare enum EventType {
|
|
12
9
|
StartExtractingExternalSyncUnits = "START_EXTRACTING_EXTERNAL_SYNC_UNITS",
|
|
13
10
|
StartExtractingMetadata = "START_EXTRACTING_METADATA",
|
|
@@ -24,10 +21,7 @@ export declare enum EventType {
|
|
|
24
21
|
StartDeletingLoaderState = "START_DELETING_LOADER_STATE",
|
|
25
22
|
StartDeletingLoaderAttachmentState = "START_DELETING_LOADER_ATTACHMENT_STATE"
|
|
26
23
|
}
|
|
27
|
-
/**
|
|
28
|
-
* ExtractorEventType is an enum that defines the different types of events that can be sent from the external extractor to AirSync.
|
|
29
|
-
* The external extractor can use these events to inform AirSync about the progress of the extraction process.
|
|
30
|
-
*/
|
|
24
|
+
/** Events sent from the connector to AirSync. */
|
|
31
25
|
export declare enum ExtractorEventType {
|
|
32
26
|
ExternalSyncUnitExtractionDone = "EXTERNAL_SYNC_UNIT_EXTRACTION_DONE",
|
|
33
27
|
ExternalSyncUnitExtractionError = "EXTERNAL_SYNC_UNIT_EXTRACTION_ERROR",
|
|
@@ -46,10 +40,7 @@ export declare enum ExtractorEventType {
|
|
|
46
40
|
ExtractorAttachmentsStateDeletionDone = "EXTRACTOR_ATTACHMENTS_STATE_DELETION_DONE",
|
|
47
41
|
ExtractorAttachmentsStateDeletionError = "EXTRACTOR_ATTACHMENTS_STATE_DELETION_ERROR"
|
|
48
42
|
}
|
|
49
|
-
/**
|
|
50
|
-
* ExternalSyncUnit is an interface that defines the structure of an external sync unit (repos, projects, ...) that can be extracted.
|
|
51
|
-
* It must contain an ID, a name, and a description. It can also contain the number of items in the external sync unit.
|
|
52
|
-
*/
|
|
43
|
+
/** An extractable unit in the external system (repo, project, ...). */
|
|
53
44
|
export interface ExternalSyncUnit {
|
|
54
45
|
id: string;
|
|
55
46
|
name: string;
|
|
@@ -57,174 +48,106 @@ export interface ExternalSyncUnit {
|
|
|
57
48
|
item_count?: number;
|
|
58
49
|
item_type?: string;
|
|
59
50
|
}
|
|
60
|
-
/**
|
|
61
|
-
* InitialSyncScope is an enum that defines the different scopes of initial sync that can be used by the external extractor.
|
|
62
|
-
*/
|
|
63
51
|
export declare enum InitialSyncScope {
|
|
64
52
|
FULL_HISTORY = "full-history",
|
|
65
53
|
TIME_SCOPED = "time-scoped"
|
|
66
54
|
}
|
|
67
|
-
/**
|
|
68
|
-
* TimeUnit is an enum that defines the supported Go duration units for time window calculations.
|
|
69
|
-
* These correspond directly to Go's time.ParseDuration units.
|
|
70
|
-
*/
|
|
55
|
+
/** Duration units for time windows; matches Go's time.ParseDuration units. */
|
|
71
56
|
export declare enum TimeUnit {
|
|
72
|
-
/** Nanoseconds */
|
|
73
57
|
NANOSECONDS = "ns",
|
|
74
|
-
/** Microseconds (ASCII alias) */
|
|
75
58
|
MICROSECONDS = "us",
|
|
76
|
-
/** Microseconds (Unicode alias) */
|
|
77
59
|
MICROSECONDS_MU = "\u00B5s",
|
|
78
|
-
/** Milliseconds */
|
|
79
60
|
MILLISECONDS = "ms",
|
|
80
|
-
/** Seconds */
|
|
81
61
|
SECONDS = "s",
|
|
82
|
-
/** Minutes */
|
|
83
62
|
MINUTES = "m",
|
|
84
|
-
/** Hours */
|
|
85
63
|
HOURS = "h"
|
|
86
64
|
}
|
|
87
65
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
66
|
+
* How the SDK resolves an extraction start/end time sent by the platform.
|
|
67
|
+
* WORKERS_* variants resolve against worker state timestamps; UNBOUNDED means no bound.
|
|
90
68
|
*/
|
|
91
69
|
export declare enum TimeValueType {
|
|
92
|
-
/** Oldest timestamp from worker state */
|
|
93
70
|
WORKERS_OLDEST = "workers_oldest",
|
|
94
|
-
/** Oldest timestamp from worker state minus a duration window */
|
|
95
71
|
WORKERS_OLDEST_MINUS_WINDOW = "workers_oldest_minus_window",
|
|
96
|
-
/** Newest timestamp from worker state */
|
|
97
72
|
WORKERS_NEWEST = "workers_newest",
|
|
98
|
-
/** Newest timestamp from worker state plus a duration window */
|
|
99
73
|
WORKERS_NEWEST_PLUS_WINDOW = "workers_newest_plus_window",
|
|
100
|
-
/** Current time */
|
|
101
74
|
CURRENT_TIME = "current_time",
|
|
102
|
-
/** User-specified absolute timestamp */
|
|
103
75
|
ABSOLUTE_TIME = "absolute_time",
|
|
104
|
-
/** No bound - extract all available data */
|
|
105
76
|
UNBOUNDED = "unbounded"
|
|
106
77
|
}
|
|
107
78
|
/**
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
* - For ABSOLUTE: value is an ISO 8601 timestamp
|
|
111
|
-
* - For *_WINDOW types: value is a Go duration string (e.g. '500ms', '30s', '5m', '2h')
|
|
112
|
-
* - For other types: value is not used
|
|
79
|
+
* Extraction start/end time value. `value` is an ISO 8601 timestamp for ABSOLUTE_TIME,
|
|
80
|
+
* a Go duration string (e.g. '30s', '2h') for *_WINDOW types, and unused otherwise.
|
|
113
81
|
*/
|
|
114
82
|
export interface TimeValue {
|
|
115
83
|
type: TimeValueType;
|
|
116
84
|
value?: string;
|
|
117
85
|
}
|
|
118
|
-
/**
|
|
119
|
-
* EventContext is an interface that defines the structure of the event context that is sent to the external connector from AirSync.
|
|
120
|
-
*/
|
|
121
86
|
export interface EventContext {
|
|
122
87
|
callback_url: string;
|
|
123
|
-
/**
|
|
124
|
-
* @deprecated dev_org is deprecated and should not be used. Use dev_oid instead.
|
|
125
|
-
*/
|
|
88
|
+
/** @deprecated Use dev_oid instead. */
|
|
126
89
|
dev_org: string;
|
|
127
90
|
dev_oid: string;
|
|
128
91
|
dev_org_id: string;
|
|
129
|
-
/**
|
|
130
|
-
* @deprecated dev_user is deprecated and should not be used. Use dev_uid instead.
|
|
131
|
-
*/
|
|
92
|
+
/** @deprecated Use dev_uid instead. */
|
|
132
93
|
dev_user: string;
|
|
133
|
-
/**
|
|
134
|
-
* @deprecated dev_user_id is deprecated and should not be used. Use dev_uid instead.
|
|
135
|
-
*/
|
|
94
|
+
/** @deprecated Use dev_uid instead. */
|
|
136
95
|
dev_user_id: string;
|
|
137
96
|
dev_uid: string;
|
|
138
97
|
event_type_adaas: string;
|
|
139
|
-
/**
|
|
140
|
-
* @deprecated external_sync_unit is deprecated and should not be used. Use external_sync_unit_id instead.
|
|
141
|
-
*/
|
|
98
|
+
/** @deprecated Use external_sync_unit_id instead. */
|
|
142
99
|
external_sync_unit: string;
|
|
143
100
|
external_sync_unit_id: string;
|
|
144
101
|
external_sync_unit_name: string;
|
|
145
|
-
/**
|
|
146
|
-
* @deprecated external_system is deprecated and should not be used. Use external_system_id instead.
|
|
147
|
-
*/
|
|
102
|
+
/** @deprecated Use external_system_id instead. */
|
|
148
103
|
external_system: string;
|
|
149
104
|
external_system_id: string;
|
|
150
105
|
external_system_name: string;
|
|
151
106
|
external_system_type: string;
|
|
152
|
-
/**
|
|
153
|
-
* Resolved start timestamp of extraction (ISO 8601 format).
|
|
154
|
-
* Automatically computed by the SDK from extraction_start_time and worker state.
|
|
155
|
-
* This is the field developers should read to know when to start extracting from.
|
|
156
|
-
*/
|
|
107
|
+
/** Start of extraction (ISO 8601), resolved by the SDK from extraction_start_time and worker state. */
|
|
157
108
|
extract_from?: string;
|
|
158
109
|
import_slug: string;
|
|
159
110
|
initial_sync_scope?: InitialSyncScope;
|
|
160
111
|
mode: string;
|
|
161
112
|
request_id: string;
|
|
162
113
|
request_id_adaas: string;
|
|
163
|
-
/**
|
|
164
|
-
* @deprecated reset_extraction is deprecated and should not be used.
|
|
165
|
-
*/
|
|
114
|
+
/** @deprecated */
|
|
166
115
|
reset_extraction?: boolean;
|
|
167
|
-
/**
|
|
168
|
-
* @deprecated reset_extract_from is deprecated. Use extraction_start_time/extraction_end_time instead,
|
|
169
|
-
* which are automatically resolved into extract_from and extract_to.
|
|
170
|
-
*/
|
|
116
|
+
/** @deprecated Use extraction_start_time/extraction_end_time (resolved into extract_from/extract_to). */
|
|
171
117
|
reset_extract_from?: boolean;
|
|
172
118
|
run_id: string;
|
|
173
119
|
sequence_version: string;
|
|
174
120
|
snap_in_slug: string;
|
|
175
121
|
snap_in_version_id: string;
|
|
176
|
-
/**
|
|
177
|
-
* @deprecated sync_run is deprecated and should not be used. Use run_id instead.
|
|
178
|
-
*/
|
|
122
|
+
/** @deprecated Use run_id instead. */
|
|
179
123
|
sync_run: string;
|
|
180
|
-
/**
|
|
181
|
-
* @deprecated sync_run_id is deprecated and should not be used. Use run_id instead.
|
|
182
|
-
*/
|
|
124
|
+
/** @deprecated Use run_id instead. */
|
|
183
125
|
sync_run_id: string;
|
|
184
126
|
sync_tier: string;
|
|
185
127
|
sync_unit: DonV2;
|
|
186
128
|
sync_unit_id: string;
|
|
187
|
-
/**
|
|
188
|
-
* @deprecated uuid is deprecated and should not be used. Use request_id_adaas instead.
|
|
189
|
-
*/
|
|
129
|
+
/** @deprecated Use request_id_adaas instead. */
|
|
190
130
|
uuid: string;
|
|
191
131
|
worker_data_url: string;
|
|
192
|
-
/**
|
|
193
|
-
* Start time value for extraction, as sent by the platform.
|
|
194
|
-
* The SDK resolves this into a concrete ISO 8601 timestamp on extract_from.
|
|
195
|
-
*/
|
|
132
|
+
/** Platform-sent start time; the SDK resolves it into extract_from. */
|
|
196
133
|
extraction_start_time?: TimeValue;
|
|
197
|
-
/**
|
|
198
|
-
* End time value for extraction, as sent by the platform.
|
|
199
|
-
* The SDK resolves this into a concrete ISO 8601 timestamp on extract_to.
|
|
200
|
-
*/
|
|
134
|
+
/** Platform-sent end time; the SDK resolves it into extract_to. */
|
|
201
135
|
extraction_end_time?: TimeValue;
|
|
202
|
-
/**
|
|
203
|
-
* Resolved end timestamp of extraction (ISO 8601 format).
|
|
204
|
-
* Automatically computed by the SDK from extraction_end_time and worker state.
|
|
205
|
-
* This is the field developers should read to know when to stop extracting at.
|
|
206
|
-
*/
|
|
136
|
+
/** End of extraction (ISO 8601), resolved by the SDK from extraction_end_time and worker state. */
|
|
207
137
|
extract_to?: string;
|
|
208
138
|
}
|
|
209
|
-
/**
|
|
210
|
-
* ConnectionData is an interface that defines the structure of the connection data that is sent to the external extractor from AirSync.
|
|
211
|
-
* It contains the organization ID, organization name, key, and key type.
|
|
212
|
-
*/
|
|
213
139
|
export interface ConnectionData {
|
|
214
140
|
org_id: string;
|
|
215
141
|
org_name: string;
|
|
216
142
|
key: string;
|
|
217
143
|
key_type: string;
|
|
218
144
|
}
|
|
219
|
-
/**
|
|
220
|
-
* EventData is an interface that defines the structure of the event data that is sent from the external extractor to AirSync.
|
|
221
|
-
*/
|
|
222
145
|
export interface EventData {
|
|
223
146
|
error?: ErrorRecord;
|
|
224
147
|
delay?: number;
|
|
225
148
|
/**
|
|
226
149
|
* Artifacts produced by the worker's repos, attached to the emitted event by
|
|
227
|
-
* the SDK.
|
|
150
|
+
* the SDK. Includes external sync units, which are pushed to the
|
|
228
151
|
* AirSyncDefaultItemTypes.EXTERNAL_SYNC_UNITS repo and uploaded as artifacts.
|
|
229
152
|
*/
|
|
230
153
|
artifacts?: Artifact[];
|
|
@@ -232,16 +155,17 @@ export interface EventData {
|
|
|
232
155
|
processed_files?: string[];
|
|
233
156
|
stats_file?: string;
|
|
234
157
|
}
|
|
235
|
-
/**
|
|
236
|
-
* WorkerMetadata is an interface that defines the structure of the worker metadata that is sent from the external extractor to AirSync.
|
|
237
|
-
*/
|
|
238
158
|
export interface WorkerMetadata {
|
|
239
|
-
adaas_library_version
|
|
159
|
+
adaas_library_version?: string;
|
|
160
|
+
item_type?: string;
|
|
161
|
+
oldest_created_date?: string;
|
|
162
|
+
newest_created_date?: string;
|
|
163
|
+
oldest_modified_date?: string;
|
|
164
|
+
newest_modified_date?: string;
|
|
165
|
+
oldest_state_date?: string;
|
|
166
|
+
newest_state_date?: string;
|
|
240
167
|
}
|
|
241
|
-
/**
|
|
242
|
-
* AirSyncEvent is an interface that defines the structure of the event that is sent to the external extractor from AirSync.
|
|
243
|
-
* It contains the context, payload, execution metadata, and input data as common snap-ins.
|
|
244
|
-
*/
|
|
168
|
+
/** Event sent from AirSync to the connector. */
|
|
245
169
|
export interface AirSyncEvent {
|
|
246
170
|
context: {
|
|
247
171
|
secrets: {
|
|
@@ -264,28 +188,19 @@ export interface AirSyncEvent {
|
|
|
264
188
|
};
|
|
265
189
|
input_data: InputData;
|
|
266
190
|
}
|
|
267
|
-
/**
|
|
268
|
-
* AirSyncMessage is an interface that defines the structure of the payload/message that is sent to the external extractor from AirSync.
|
|
269
|
-
*/
|
|
270
191
|
export interface AirSyncMessage {
|
|
271
192
|
connection_data: ConnectionData;
|
|
272
193
|
event_context: EventContext;
|
|
273
194
|
event_type: EventType;
|
|
274
195
|
event_data?: EventData;
|
|
275
196
|
}
|
|
276
|
-
/**
|
|
277
|
-
* ExtractorEvent is an interface that defines the structure of the event that is sent from the external extractor to AirSync.
|
|
278
|
-
* It contains the event type, event context, extractor state, and event data.
|
|
279
|
-
*/
|
|
197
|
+
/** Event sent from the connector to AirSync. */
|
|
280
198
|
export interface ExtractorEvent {
|
|
281
199
|
event_type: string;
|
|
282
200
|
event_context: EventContext;
|
|
283
201
|
event_data?: EventData;
|
|
284
202
|
worker_metadata?: WorkerMetadata;
|
|
285
203
|
}
|
|
286
|
-
/**
|
|
287
|
-
* LoaderEvent
|
|
288
|
-
*/
|
|
289
204
|
export interface LoaderEvent {
|
|
290
205
|
event_type: string;
|
|
291
206
|
event_context: EventContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../src/types/extraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"extraction.d.ts","sourceRoot":"","sources":["../../src/types/extraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7D,iDAAiD;AACjD,oBAAY,SAAS;IAEnB,gCAAgC,yCAAyC;IACzE,uBAAuB,8BAA8B;IACrD,mBAAmB,0BAA0B;IAC7C,sBAAsB,6BAA6B;IACnD,2BAA2B,mCAAmC;IAC9D,0BAA0B,iCAAiC;IAC3D,6BAA6B,oCAAoC;IACjE,sCAAsC,+CAA+C;IAGrF,gBAAgB,uBAAuB;IACvC,mBAAmB,0BAA0B;IAC7C,uBAAuB,8BAA8B;IACrD,0BAA0B,iCAAiC;IAC3D,wBAAwB,gCAAgC;IACxD,kCAAkC,2CAA2C;CAC9E;AAED,iDAAiD;AACjD,oBAAY,kBAAkB;IAE5B,8BAA8B,uCAAuC;IACrE,+BAA+B,wCAAwC;IACvE,sBAAsB,6BAA6B;IACnD,uBAAuB,8BAA8B;IACrD,sBAAsB,6BAA6B;IACnD,qBAAqB,4BAA4B;IACjD,kBAAkB,yBAAyB;IAC3C,mBAAmB,0BAA0B;IAC7C,0BAA0B,kCAAkC;IAC5D,2BAA2B,mCAAmC;IAC9D,4BAA4B,mCAAmC;IAC/D,2BAA2B,k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CAAC;IACf,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB,GACD,SAAS,CAAC;AAEd,MAAM,MAAM,uCAAuC,CACjD,KAAK,EACL,QAAQ,EACR,cAAc,IACZ,CAAC,EACH,WAAW,EACX,OAAO,EACP,SAAS,GACV,EAAE;IACD,WAAW,EAAE,KAAK,CAAC;IACnB,OAAO,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,KAAK,QAAQ,CAAC;AAEf,MAAM,MAAM,iCAAiC,GAAG,CAAC,EAC/C,UAAU,EACV,MAAM,GACP,EAAE;IACD,UAAU,EAAE,oBAAoB,CAAC;IACjC,MAAM,EAAE,yCAAyC,CAAC;CACnD,KAAK,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAE3C,MAAM,MAAM,wCAAwC,CAAC,QAAQ,EAAE,cAAc,IAC3E,CAAC,EACC,kBAAkB,EAClB,OAAO,EACP,MAAM,GACP,EAAE;IACD,kBAAkB,EAAE,QAAQ,CAAC;IAC7B,OAAO,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,EAAE,yCAAyC,CAAC;CACnD,KAAK,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAE7C,MAAM,WAAW,kCAAkC,CACjD,cAAc,EACd,KAAK,EACL,QAAQ;IAER,OAAO,EAAE,uCAAuC,CAC9C,KAAK,EACL,QAAQ,EACR,cAAc,CACf,CAAC;IACF,QAAQ,EAAE,wCAAwC,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;CAC9E"}
|
package/dist/types/extraction.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TimeValueType = exports.TimeUnit = exports.InitialSyncScope = exports.ExtractorEventType = exports.EventType = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* EventType is an enum that defines the different types of events that can be sent to the external extractor from AirSync.
|
|
6
|
-
* The external extractor can use these events to know what to do next in the extraction process.
|
|
7
|
-
*/
|
|
4
|
+
/** Events sent from AirSync to the connector. */
|
|
8
5
|
var EventType;
|
|
9
6
|
(function (EventType) {
|
|
10
7
|
// Extraction
|
|
@@ -24,10 +21,7 @@ var EventType;
|
|
|
24
21
|
EventType["StartDeletingLoaderState"] = "START_DELETING_LOADER_STATE";
|
|
25
22
|
EventType["StartDeletingLoaderAttachmentState"] = "START_DELETING_LOADER_ATTACHMENT_STATE";
|
|
26
23
|
})(EventType || (exports.EventType = EventType = {}));
|
|
27
|
-
/**
|
|
28
|
-
* ExtractorEventType is an enum that defines the different types of events that can be sent from the external extractor to AirSync.
|
|
29
|
-
* The external extractor can use these events to inform AirSync about the progress of the extraction process.
|
|
30
|
-
*/
|
|
24
|
+
/** Events sent from the connector to AirSync. */
|
|
31
25
|
var ExtractorEventType;
|
|
32
26
|
(function (ExtractorEventType) {
|
|
33
27
|
// Extraction
|
|
@@ -48,53 +42,33 @@ var ExtractorEventType;
|
|
|
48
42
|
ExtractorEventType["ExtractorAttachmentsStateDeletionDone"] = "EXTRACTOR_ATTACHMENTS_STATE_DELETION_DONE";
|
|
49
43
|
ExtractorEventType["ExtractorAttachmentsStateDeletionError"] = "EXTRACTOR_ATTACHMENTS_STATE_DELETION_ERROR";
|
|
50
44
|
})(ExtractorEventType || (exports.ExtractorEventType = ExtractorEventType = {}));
|
|
51
|
-
/**
|
|
52
|
-
* InitialSyncScope is an enum that defines the different scopes of initial sync that can be used by the external extractor.
|
|
53
|
-
*/
|
|
54
45
|
var InitialSyncScope;
|
|
55
46
|
(function (InitialSyncScope) {
|
|
56
47
|
InitialSyncScope["FULL_HISTORY"] = "full-history";
|
|
57
48
|
InitialSyncScope["TIME_SCOPED"] = "time-scoped";
|
|
58
49
|
})(InitialSyncScope || (exports.InitialSyncScope = InitialSyncScope = {}));
|
|
59
|
-
/**
|
|
60
|
-
* TimeUnit is an enum that defines the supported Go duration units for time window calculations.
|
|
61
|
-
* These correspond directly to Go's time.ParseDuration units.
|
|
62
|
-
*/
|
|
50
|
+
/** Duration units for time windows; matches Go's time.ParseDuration units. */
|
|
63
51
|
var TimeUnit;
|
|
64
52
|
(function (TimeUnit) {
|
|
65
|
-
/** Nanoseconds */
|
|
66
53
|
TimeUnit["NANOSECONDS"] = "ns";
|
|
67
|
-
/** Microseconds (ASCII alias) */
|
|
68
54
|
TimeUnit["MICROSECONDS"] = "us";
|
|
69
|
-
/** Microseconds (Unicode alias) */
|
|
70
55
|
TimeUnit["MICROSECONDS_MU"] = "\u00B5s";
|
|
71
|
-
/** Milliseconds */
|
|
72
56
|
TimeUnit["MILLISECONDS"] = "ms";
|
|
73
|
-
/** Seconds */
|
|
74
57
|
TimeUnit["SECONDS"] = "s";
|
|
75
|
-
/** Minutes */
|
|
76
58
|
TimeUnit["MINUTES"] = "m";
|
|
77
|
-
/** Hours */
|
|
78
59
|
TimeUnit["HOURS"] = "h";
|
|
79
60
|
})(TimeUnit || (exports.TimeUnit = TimeUnit = {}));
|
|
80
61
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
62
|
+
* How the SDK resolves an extraction start/end time sent by the platform.
|
|
63
|
+
* WORKERS_* variants resolve against worker state timestamps; UNBOUNDED means no bound.
|
|
83
64
|
*/
|
|
84
65
|
var TimeValueType;
|
|
85
66
|
(function (TimeValueType) {
|
|
86
|
-
/** Oldest timestamp from worker state */
|
|
87
67
|
TimeValueType["WORKERS_OLDEST"] = "workers_oldest";
|
|
88
|
-
/** Oldest timestamp from worker state minus a duration window */
|
|
89
68
|
TimeValueType["WORKERS_OLDEST_MINUS_WINDOW"] = "workers_oldest_minus_window";
|
|
90
|
-
/** Newest timestamp from worker state */
|
|
91
69
|
TimeValueType["WORKERS_NEWEST"] = "workers_newest";
|
|
92
|
-
/** Newest timestamp from worker state plus a duration window */
|
|
93
70
|
TimeValueType["WORKERS_NEWEST_PLUS_WINDOW"] = "workers_newest_plus_window";
|
|
94
|
-
/** Current time */
|
|
95
71
|
TimeValueType["CURRENT_TIME"] = "current_time";
|
|
96
|
-
/** User-specified absolute timestamp */
|
|
97
72
|
TimeValueType["ABSOLUTE_TIME"] = "absolute_time";
|
|
98
|
-
/** No bound - extract all available data */
|
|
99
73
|
TimeValueType["UNBOUNDED"] = "unbounded";
|
|
100
74
|
})(TimeValueType || (exports.TimeValueType = TimeValueType = {}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../src/types/loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../src/types/loading.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,KAAK,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,KAAK,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;I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AE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,eAAe;IACzB,mBAAmB,0BAA0B;IAC7C,kBAAkB,yBAAyB;IAC3C,eAAe,sBAAsB;IACrC,gBAAgB,uBAAuB;IAEvC,yBAAyB,gCAAgC;IACzD,wBAAwB,+BAA+B;IACvD,qBAAqB,4BAA4B;IACjD,sBAAsB,6BAA6B;IAEnD,uBAAuB,+BAA+B;IACtD,wBAAwB,gCAAgC;IAExD,iCAAiC,0CAA0C;IAC3E,kCAAkC,2CAA2C;CAC9E"}
|
package/dist/types/workers.d.ts
CHANGED
|
@@ -1,52 +1,27 @@
|
|
|
1
1
|
import { Worker } from 'worker_threads';
|
|
2
2
|
import type { LogLevel } from '../logger/logger.interfaces';
|
|
3
3
|
import { BaseState } from '../state/state';
|
|
4
|
+
import { ErrorRecord, InitialDomainMapping } from './common';
|
|
4
5
|
import { AirSyncEvent, EventType, ExtractorEventType } from './extraction';
|
|
5
6
|
import { LoaderEventType } from './loading';
|
|
6
|
-
import { ErrorRecord, InitialDomainMapping } from './common';
|
|
7
|
-
/**
|
|
8
|
-
* WorkerAdapterInterface is an interface for WorkerAdapter class.
|
|
9
|
-
* @interface WorkerAdapterInterface
|
|
10
|
-
* @constructor
|
|
11
|
-
* @param {AirSyncEvent} event - The event object received from the platform
|
|
12
|
-
* @param {object=} initialState - The initial state of the adapter
|
|
13
|
-
* @param {WorkerAdapterInterface} options - The options to create a new instance of WorkerAdapter class
|
|
14
|
-
*/
|
|
15
7
|
export interface WorkerAdapterInterface<ConnectorState> {
|
|
16
8
|
event: AirSyncEvent;
|
|
17
9
|
adapterState: BaseState<ConnectorState>;
|
|
18
10
|
options?: WorkerAdapterOptions;
|
|
19
11
|
}
|
|
20
|
-
/**
|
|
21
|
-
* ExtractionScope represents the parsed extraction scope from the platform.
|
|
22
|
-
* Each key is an item type name, and the value indicates whether it should be extracted.
|
|
23
|
-
*/
|
|
12
|
+
/** Parsed extraction scope from the platform, keyed by item type name. */
|
|
24
13
|
export type ExtractionScope = Record<string, {
|
|
25
14
|
extract: boolean;
|
|
26
15
|
}>;
|
|
27
|
-
/**
|
|
28
|
-
* WorkerAdapterOptions represents the options for WorkerAdapter class.
|
|
29
|
-
* @interface WorkerAdapterOptions
|
|
30
|
-
* @constructor
|
|
31
|
-
* @param {boolean=} isLocalDevelopment - A flag to indicate if the adapter is being used in local development
|
|
32
|
-
* @param {number=} timeout - The timeout for the worker thread
|
|
33
|
-
* @param {number=} batchSize - Maximum number of extracted items in a batch
|
|
34
|
-
* @param {Record<EventType, string>=} workerPathOverrides - A map of event types to custom worker paths to override default worker paths
|
|
35
|
-
*/
|
|
36
16
|
export interface WorkerAdapterOptions {
|
|
37
17
|
isLocalDevelopment?: boolean;
|
|
18
|
+
/** Worker thread timeout. */
|
|
38
19
|
timeout?: number;
|
|
20
|
+
/** Maximum number of extracted items in a batch. */
|
|
39
21
|
batchSize?: number;
|
|
40
22
|
workerPathOverrides?: WorkerPathOverrides;
|
|
41
23
|
skipConfirmation?: boolean;
|
|
42
24
|
}
|
|
43
|
-
/**
|
|
44
|
-
* SpawnInterface is an interface for Spawn class.
|
|
45
|
-
* @interface SpawnInterface
|
|
46
|
-
* @constructor
|
|
47
|
-
* @param {AirSyncEvent} event - The event object received from the platform
|
|
48
|
-
* @param {Worker} worker - The worker thread
|
|
49
|
-
*/
|
|
50
25
|
export interface SpawnInterface {
|
|
51
26
|
event: AirSyncEvent;
|
|
52
27
|
worker: Worker;
|
|
@@ -54,50 +29,24 @@ export interface SpawnInterface {
|
|
|
54
29
|
resolve: (value: void | PromiseLike<void>) => void;
|
|
55
30
|
originalConsole?: Console;
|
|
56
31
|
}
|
|
57
|
-
/**
|
|
58
|
-
* SpawnFactoryInterface is an interface for Spawn class factory.
|
|
59
|
-
* Spawn class is responsible for spawning a new worker thread and managing the lifecycle of the worker.
|
|
60
|
-
* The class provides utilities to emit control events to the platform and exit the worker gracefully.
|
|
61
|
-
* In case of lambda timeout, the class emits a lambda timeout event to the platform.
|
|
62
|
-
* @interface SpawnFactoryInterface
|
|
63
|
-
* @constructor
|
|
64
|
-
* @param {AirSyncEvent} event - The event object received from the platform
|
|
65
|
-
* @param {object=} initialState - The initial state of the adapter
|
|
66
|
-
* @param {string} initialDomainMapping - The initial domain mapping
|
|
67
|
-
* @param {WorkerAdapterOptions} options - The options to create a new instance of Spawn class
|
|
68
|
-
* @param {string=} baseWorkerPath - The base path for the worker files, usually `__dirname`
|
|
69
|
-
*/
|
|
70
32
|
export interface SpawnFactoryInterface<ConnectorState> {
|
|
71
33
|
event: AirSyncEvent;
|
|
72
34
|
initialState: ConnectorState;
|
|
73
35
|
options?: WorkerAdapterOptions;
|
|
74
36
|
initialDomainMapping?: InitialDomainMapping;
|
|
37
|
+
/** Base path for the worker files, usually `__dirname`. */
|
|
75
38
|
baseWorkerPath?: string;
|
|
76
39
|
}
|
|
77
40
|
/**
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* One lambda invocation = one worker process = exactly one emitted event =
|
|
84
|
-
* terminal. Any continuation (CONTINUE_*, next phase, retry after delay)
|
|
85
|
-
* happens in a fresh invocation driven by the platform.
|
|
86
|
-
*
|
|
87
|
-
* The discriminant is a bare string literal, so connectors write e.g.
|
|
88
|
-
* `return { status: 'delay', delaySeconds: 60 }` with no import.
|
|
41
|
+
* Returned by a worker's `task`/`onTimeout` callback; the SDK (never the connector)
|
|
42
|
+
* maps it to the phase-appropriate platform event and emits it exactly once.
|
|
43
|
+
* One invocation = one worker = one emitted event; continuation happens in a
|
|
44
|
+
* fresh platform-driven invocation.
|
|
89
45
|
*
|
|
90
|
-
* Status -> emitted event
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
* | 'success' | *_DONE | *_DONE |
|
|
95
|
-
* | 'progress' | *_PROGRESS | *_ERROR (illegal; descriptive) |
|
|
96
|
-
* | 'delay' | *_DELAYED | *_ERROR (illegal; descriptive) |
|
|
97
|
-
* | 'error' | *_ERROR | *_ERROR |
|
|
98
|
-
*
|
|
99
|
-
* Resumable phases: data/attachment extraction, data/attachment loading.
|
|
100
|
-
* Non-resumable phases: external sync units, metadata.
|
|
46
|
+
* Status -> emitted event: 'success' -> *_DONE; 'error' -> *_ERROR;
|
|
47
|
+
* 'progress' -> *_PROGRESS and 'delay' -> *_DELAYED in resumable phases
|
|
48
|
+
* (data/attachment extraction and loading), but *_ERROR in non-resumable
|
|
49
|
+
* phases (external sync units, metadata), where they are illegal.
|
|
101
50
|
*/
|
|
102
51
|
export type TaskResult = {
|
|
103
52
|
status: 'success';
|
|
@@ -110,97 +59,55 @@ export type TaskResult = {
|
|
|
110
59
|
status: 'error';
|
|
111
60
|
error: ErrorRecord;
|
|
112
61
|
};
|
|
113
|
-
/**
|
|
114
|
-
* Discriminant string of a {@link TaskResult}.
|
|
115
|
-
*/
|
|
116
62
|
export type TaskStatus = TaskResult['status'];
|
|
117
|
-
/**
|
|
118
|
-
* TaskAdapterInterface is the parameter shape passed to a worker's task and
|
|
119
|
-
* onTimeout callbacks.
|
|
120
|
-
* @param adapter - The mode-specific adapter for the worker.
|
|
121
|
-
*/
|
|
63
|
+
/** Parameter shape passed to a worker's task and onTimeout callbacks. */
|
|
122
64
|
export interface TaskAdapterInterface<Adapter> {
|
|
123
65
|
adapter: Adapter;
|
|
124
66
|
}
|
|
125
67
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* Both callbacks return a {@link TaskResult}; the SDK — not the connector —
|
|
129
|
-
* maps that status to the phase-appropriate platform event and emits it exactly
|
|
130
|
-
* once. Connectors never call `emit` directly.
|
|
131
|
-
*
|
|
132
|
-
* `onTimeout` is optional: if omitted, the SDK emits a phase-appropriate default
|
|
133
|
-
* on timeout (progress for resumable phases, error for ESU/metadata).
|
|
134
|
-
*
|
|
135
|
-
* @param task - Runs the phase; returns how it ended.
|
|
136
|
-
* @param onTimeout - Runs only on timeout; returns how to hand off.
|
|
68
|
+
* If `onTimeout` is omitted, the SDK emits a phase-appropriate default on
|
|
69
|
+
* timeout: progress for resumable phases, error for ESU/metadata.
|
|
137
70
|
*/
|
|
138
71
|
export interface ProcessTaskInterface<Adapter> {
|
|
139
72
|
task: (params: TaskAdapterInterface<Adapter>) => Promise<TaskResult>;
|
|
140
73
|
onTimeout?: (params: TaskAdapterInterface<Adapter>) => Promise<TaskResult>;
|
|
141
74
|
}
|
|
142
|
-
/**
|
|
143
|
-
* WorkerEvent represents the standard worker events.
|
|
144
|
-
*/
|
|
145
75
|
export declare enum WorkerEvent {
|
|
146
76
|
WorkerMessage = "message",
|
|
147
77
|
WorkerOnline = "online",
|
|
148
78
|
WorkerError = "error",
|
|
149
79
|
WorkerExit = "exit"
|
|
150
80
|
}
|
|
151
|
-
/**
|
|
152
|
-
* WorkerMessageSubject represents the handled worker message subjects.
|
|
153
|
-
*/
|
|
154
81
|
export declare enum WorkerMessageSubject {
|
|
155
82
|
WorkerMessageEmitted = "emit",
|
|
156
83
|
WorkerMessageExit = "exit",
|
|
157
84
|
WorkerMessageLog = "log",
|
|
158
85
|
WorkerMessageFailed = "failed"
|
|
159
86
|
}
|
|
160
|
-
/**
|
|
161
|
-
* WorkerMessageEmitted interface represents the structure of the emitted worker message.
|
|
162
|
-
*/
|
|
163
87
|
export interface WorkerMessageEmitted {
|
|
164
88
|
subject: WorkerMessageSubject.WorkerMessageEmitted;
|
|
165
89
|
payload: {
|
|
166
90
|
eventType: ExtractorEventType | LoaderEventType;
|
|
167
91
|
};
|
|
168
92
|
}
|
|
169
|
-
/**
|
|
170
|
-
* WorkerMessageExit interface represents the structure of the exit worker message.
|
|
171
|
-
*/
|
|
172
93
|
export interface WorkerMessageExit {
|
|
173
94
|
subject: WorkerMessageSubject.WorkerMessageExit;
|
|
174
95
|
}
|
|
175
|
-
/**
|
|
176
|
-
* WorkerMessageLog interface represents the structure of the worker log message.
|
|
177
|
-
*/
|
|
178
96
|
export interface WorkerMessageLog {
|
|
179
97
|
subject: WorkerMessageSubject.WorkerMessageLog;
|
|
180
98
|
payload: {
|
|
181
99
|
stringifiedArgs: string;
|
|
182
100
|
level: LogLevel;
|
|
183
|
-
isSdkLog?: boolean;
|
|
184
101
|
};
|
|
185
102
|
}
|
|
186
|
-
/**
|
|
187
|
-
* WorkerMessageFailed interface represents the structure of the worker failed message.
|
|
188
|
-
* Sent from the worker thread before calling process.exit(1) to convey the specific
|
|
189
|
-
* error reason to the main thread.
|
|
190
|
-
*/
|
|
103
|
+
/** Sent from the worker thread before process.exit(1) to convey the error reason to the main thread. */
|
|
191
104
|
export interface WorkerMessageFailed {
|
|
192
105
|
subject: WorkerMessageSubject.WorkerMessageFailed;
|
|
193
106
|
payload: {
|
|
194
107
|
message: string;
|
|
195
108
|
};
|
|
196
109
|
}
|
|
197
|
-
/**
|
|
198
|
-
* WorkerMessage represents the structure of the worker message.
|
|
199
|
-
*/
|
|
200
110
|
export type WorkerMessage = WorkerMessageEmitted | WorkerMessageExit | WorkerMessageLog | WorkerMessageFailed;
|
|
201
|
-
/**
|
|
202
|
-
* WorkerData represents the structure of the worker data object.
|
|
203
|
-
*/
|
|
204
111
|
export interface WorkerData<ConnectorState> {
|
|
205
112
|
event: AirSyncEvent;
|
|
206
113
|
initialState: ConnectorState;
|
|
@@ -208,15 +115,10 @@ export interface WorkerData<ConnectorState> {
|
|
|
208
115
|
initialDomainMapping?: InitialDomainMapping;
|
|
209
116
|
options?: WorkerAdapterOptions;
|
|
210
117
|
}
|
|
211
|
-
/**
|
|
212
|
-
* GetWorkerPathInterface is an interface for getting the worker path.
|
|
213
|
-
*/
|
|
214
118
|
export interface GetWorkerPathInterface {
|
|
215
119
|
event: AirSyncEvent;
|
|
216
120
|
workerBasePath?: string | null;
|
|
217
121
|
}
|
|
218
|
-
/**
|
|
219
|
-
* WorkerPathOverrides represents a mapping of event types to custom worker paths.
|
|
220
|
-
*/
|
|
122
|
+
/** Maps event types to custom worker paths, overriding the defaults. */
|
|
221
123
|
export type WorkerPathOverrides = Partial<Record<EventType, string>>;
|
|
222
124
|
//# sourceMappingURL=workers.d.ts.map
|