@sixb/sync-worker 0.1.0 → 0.1.2
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/README.md +4 -6
- package/dist/checkpoints.d.ts +24 -0
- package/dist/checkpoints.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +683 -207
- package/dist/index.js.map +8 -6
- package/dist/normalize.d.ts +3 -1
- package/dist/normalize.d.ts.map +1 -1
- package/dist/run-sync-job.d.ts +4 -5
- package/dist/run-sync-job.d.ts.map +1 -1
- package/dist/source-read.d.ts +21 -0
- package/dist/source-read.d.ts.map +1 -0
- package/dist/types.d.ts +20 -19
- package/dist/types.d.ts.map +1 -1
- package/dist/worker.d.ts +11 -15
- package/dist/worker.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/checkpoints.ts +200 -0
- package/src/index.ts +1 -1
- package/src/normalize.ts +44 -2
- package/src/run-sync-job.ts +409 -152
- package/src/source-read.ts +207 -0
- package/src/types.ts +27 -31
- package/src/worker.ts +128 -111
package/README.md
CHANGED
|
@@ -24,12 +24,10 @@ const runtime: SyncWorkerContext = {
|
|
|
24
24
|
id: sixb.id,
|
|
25
25
|
syncRunsStorage,
|
|
26
26
|
lakeStorage,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
connector
|
|
31
|
-
return sixb.connector(definition)
|
|
32
|
-
},
|
|
27
|
+
blobs: sixb.blobs,
|
|
28
|
+
datasets: sixb.definitions.datasets,
|
|
29
|
+
syncs: sixb.definitions.syncs,
|
|
30
|
+
connector: sixb.connector,
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
const result = await runSyncJob({
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type JsonValue, type SyncConnectorConnection } from "@sixb/core";
|
|
2
|
+
type SyncCheckpointStrategy = "single" | "connections";
|
|
3
|
+
export interface SyncCheckpointCodec {
|
|
4
|
+
read(value: JsonValue | undefined): JsonValue | undefined;
|
|
5
|
+
serialize(value: JsonValue): JsonValue;
|
|
6
|
+
}
|
|
7
|
+
/** Bind opaque handler checkpoints to the framework source contract stored beside the run. */
|
|
8
|
+
export declare function createSyncCheckpointCodec(options: {
|
|
9
|
+
readonly syncId: string;
|
|
10
|
+
readonly connectorId: string;
|
|
11
|
+
readonly strategy: SyncCheckpointStrategy;
|
|
12
|
+
}): SyncCheckpointCodec;
|
|
13
|
+
/** Per-connection cursor state carried inside a framework-managed checkpoint envelope. */
|
|
14
|
+
export declare class ConnectionCheckpoints {
|
|
15
|
+
private readonly entries;
|
|
16
|
+
private constructor();
|
|
17
|
+
static from(syncId: string, value: JsonValue | undefined): ConnectionCheckpoints;
|
|
18
|
+
reconcile(connections: readonly SyncConnectorConnection[]): void;
|
|
19
|
+
get(connection: SyncConnectorConnection): JsonValue | undefined;
|
|
20
|
+
set(connection: SyncConnectorConnection, checkpoint: JsonValue): void;
|
|
21
|
+
serialize(): JsonValue;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=checkpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoints.d.ts","sourceRoot":"","sources":["../src/checkpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,uBAAuB,EAC7B,MAAM,YAAY,CAAA;AAMnB,KAAK,sBAAsB,GAAG,QAAQ,GAAG,aAAa,CAAA;AAQtD,MAAM,WAAW,mBAAmB;IAClC,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IACzD,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAA;CACvC;AAED,8FAA8F;AAC9F,wBAAgB,yBAAyB,CAAC,OAAO,EAAE;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,sBAAsB,CAAA;CAC1C,GAAG,mBAAmB,CAoCtB;AAED,0FAA0F;AAC1F,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwC;IAEhE,OAAO;IAIP,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,qBAAqB;IA8BhF,SAAS,CAAC,WAAW,EAAE,SAAS,uBAAuB,EAAE,GAAG,IAAI;IAShE,GAAG,CAAC,UAAU,EAAE,uBAAuB,GAAG,SAAS,GAAG,SAAS;IAQ/D,GAAG,CAAC,UAAU,EAAE,uBAAuB,EAAE,UAAU,EAAE,SAAS,GAAG,IAAI;IAQrE,SAAS,IAAI,SAAS;CAevB"}
|
package/dist/index.d.ts
CHANGED