@powersync/service-core 0.0.0-dev-20260602073133 → 0.0.0-dev-20260909133214
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/CHANGELOG.md +152 -4
- package/dist/api/RouteAPI.d.ts +42 -14
- package/dist/api/diagnostics.d.ts +12 -1
- package/dist/api/diagnostics.js +36 -22
- package/dist/api/diagnostics.js.map +1 -1
- package/dist/entry/commands/compact-action.js +30 -22
- package/dist/entry/commands/compact-action.js.map +1 -1
- package/dist/metrics/metrics-interfaces.d.ts +5 -1
- package/dist/metrics/metrics-interfaces.js.map +1 -1
- package/dist/metrics/open-telemetry/MetricAttributeFilteringExporter.d.ts +36 -0
- package/dist/metrics/open-telemetry/MetricAttributeFilteringExporter.js +70 -0
- package/dist/metrics/open-telemetry/MetricAttributeFilteringExporter.js.map +1 -0
- package/dist/metrics/open-telemetry/OpenTelemetryMetricsFactory.js +6 -1
- package/dist/metrics/open-telemetry/OpenTelemetryMetricsFactory.js.map +1 -1
- package/dist/metrics/open-telemetry/util.js +7 -3
- package/dist/metrics/open-telemetry/util.js.map +1 -1
- package/dist/modules/AbstractModule.d.ts +6 -2
- package/dist/modules/AbstractModule.js.map +1 -1
- package/dist/replication/AbstractReplicator.d.ts +31 -7
- package/dist/replication/AbstractReplicator.js +168 -74
- package/dist/replication/AbstractReplicator.js.map +1 -1
- package/dist/replication/ReplicationModule.d.ts +3 -3
- package/dist/replication/ReplicationModule.js.map +1 -1
- package/dist/routes/RouterEngine.d.ts +1 -0
- package/dist/routes/RouterEngine.js +6 -1
- package/dist/routes/RouterEngine.js.map +1 -1
- package/dist/routes/configure-fastify.d.ts +104 -56
- package/dist/routes/configure-fastify.js +15 -2
- package/dist/routes/configure-fastify.js.map +1 -1
- package/dist/routes/endpoints/admin.d.ts +42 -24
- package/dist/routes/endpoints/admin.js +49 -36
- package/dist/routes/endpoints/admin.js.map +1 -1
- package/dist/routes/endpoints/checkpointing.d.ts +62 -0
- package/dist/routes/endpoints/checkpointing.js +65 -7
- package/dist/routes/endpoints/checkpointing.js.map +1 -1
- package/dist/routes/endpoints/socket-route.js +3 -2
- package/dist/routes/endpoints/socket-route.js.map +1 -1
- package/dist/routes/endpoints/sync-rules.js +25 -14
- package/dist/routes/endpoints/sync-rules.js.map +1 -1
- package/dist/routes/endpoints/sync-stream.js +1 -1
- package/dist/routes/endpoints/sync-stream.js.map +1 -1
- package/dist/runner/teardown.js +8 -8
- package/dist/runner/teardown.js.map +1 -1
- package/dist/storage/BucketStorageBatch.d.ts +64 -17
- package/dist/storage/BucketStorageBatch.js.map +1 -1
- package/dist/storage/BucketStorageFactory.d.ts +50 -31
- package/dist/storage/BucketStorageFactory.js +10 -20
- package/dist/storage/BucketStorageFactory.js.map +1 -1
- package/dist/storage/CheckpointChecksumInvalidatedError.d.ts +12 -0
- package/dist/storage/CheckpointChecksumInvalidatedError.js +17 -0
- package/dist/storage/CheckpointChecksumInvalidatedError.js.map +1 -0
- package/dist/storage/ChecksumCache.d.ts +11 -6
- package/dist/storage/ChecksumCache.js +5 -4
- package/dist/storage/ChecksumCache.js.map +1 -1
- package/dist/storage/ParsedSyncConfigSet.d.ts +23 -0
- package/dist/storage/ParsedSyncConfigSet.js +2 -0
- package/dist/storage/ParsedSyncConfigSet.js.map +1 -0
- package/dist/storage/PersistedReplicationStream.d.ts +32 -0
- package/dist/storage/PersistedReplicationStream.js +26 -0
- package/dist/storage/PersistedReplicationStream.js.map +1 -0
- package/dist/storage/PersistedSyncConfigContent.d.ts +65 -0
- package/dist/storage/PersistedSyncConfigContent.js +138 -0
- package/dist/storage/PersistedSyncConfigContent.js.map +1 -0
- package/dist/storage/PersistedSyncConfigStatus.d.ts +13 -0
- package/dist/storage/PersistedSyncConfigStatus.js +2 -0
- package/dist/storage/PersistedSyncConfigStatus.js.map +1 -0
- package/dist/storage/ReplicationEventPayload.d.ts +6 -1
- package/dist/storage/SourceEntity.d.ts +13 -2
- package/dist/storage/SourceTable.d.ts +53 -4
- package/dist/storage/SourceTable.js +62 -7
- package/dist/storage/SourceTable.js.map +1 -1
- package/dist/storage/SourceTableReconciler.d.ts +83 -0
- package/dist/storage/SourceTableReconciler.js +95 -0
- package/dist/storage/SourceTableReconciler.js.map +1 -0
- package/dist/storage/StorageVersionConfig.d.ts +4 -0
- package/dist/storage/StorageVersionConfig.js +10 -1
- package/dist/storage/StorageVersionConfig.js.map +1 -1
- package/dist/storage/SyncRulesBucketStorage.d.ts +162 -26
- package/dist/storage/SyncRulesBucketStorage.js +3 -0
- package/dist/storage/SyncRulesBucketStorage.js.map +1 -1
- package/dist/storage/WriteCheckpointAPI.d.ts +85 -6
- package/dist/storage/WriteCheckpointAPI.js +33 -0
- package/dist/storage/WriteCheckpointAPI.js.map +1 -1
- package/dist/storage/implementation/BucketDefinitionMapping.d.ts +133 -0
- package/dist/storage/implementation/BucketDefinitionMapping.js +351 -0
- package/dist/storage/implementation/BucketDefinitionMapping.js.map +1 -0
- package/dist/storage/implementation/IncrementalReprocessingCompatibility.d.ts +6 -0
- package/dist/storage/implementation/IncrementalReprocessingCompatibility.js +31 -0
- package/dist/storage/implementation/IncrementalReprocessingCompatibility.js.map +1 -0
- package/dist/storage/implementation/IncrementalReprocessingSyncConfigLog.d.ts +17 -0
- package/dist/storage/implementation/IncrementalReprocessingSyncConfigLog.js +70 -0
- package/dist/storage/implementation/IncrementalReprocessingSyncConfigLog.js.map +1 -0
- package/dist/storage/implementation/ReplicationStreamStorageIds.d.ts +15 -0
- package/dist/storage/implementation/ReplicationStreamStorageIds.js +20 -0
- package/dist/storage/implementation/ReplicationStreamStorageIds.js.map +1 -0
- package/dist/storage/storage-index.d.ts +10 -1
- package/dist/storage/storage-index.js +10 -1
- package/dist/storage/storage-index.js.map +1 -1
- package/dist/storage/storage-metrics.js +120 -4
- package/dist/storage/storage-metrics.js.map +1 -1
- package/dist/sync/BucketChecksumState.d.ts +12 -2
- package/dist/sync/BucketChecksumState.js +69 -21
- package/dist/sync/BucketChecksumState.js.map +1 -1
- package/dist/sync/RequestTracker.d.ts +7 -0
- package/dist/sync/RequestTracker.js +12 -0
- package/dist/sync/RequestTracker.js.map +1 -1
- package/dist/sync/sync.js +184 -43
- package/dist/sync/sync.js.map +1 -1
- package/dist/sync/util.d.ts +5 -0
- package/dist/sync/util.js +19 -1
- package/dist/sync/util.js.map +1 -1
- package/dist/system/ServiceContext.d.ts +2 -0
- package/dist/system/ServiceContext.js +2 -0
- package/dist/system/ServiceContext.js.map +1 -1
- package/dist/tracing/PerformanceTracer.d.ts +23 -1
- package/dist/tracing/PerformanceTracer.js +11 -0
- package/dist/tracing/PerformanceTracer.js.map +1 -1
- package/dist/util/checkpointing.d.ts +4 -8
- package/dist/util/checkpointing.js +1 -16
- package/dist/util/checkpointing.js.map +1 -1
- package/dist/util/config/compound-config-collector.js +23 -2
- package/dist/util/config/compound-config-collector.js.map +1 -1
- package/dist/util/config/defaults.d.ts +2 -0
- package/dist/util/config/defaults.js +2 -0
- package/dist/util/config/defaults.js.map +1 -1
- package/dist/util/config/sync-rules/impl/base64-sync-rules-collector.js +1 -0
- package/dist/util/config/sync-rules/impl/base64-sync-rules-collector.js.map +1 -1
- package/dist/util/config/sync-rules/impl/filesystem-sync-rules-collector.js +1 -0
- package/dist/util/config/sync-rules/impl/filesystem-sync-rules-collector.js.map +1 -1
- package/dist/util/config/sync-rules/sync-rules-provider.d.ts +2 -0
- package/dist/util/config/sync-rules/sync-rules-provider.js +3 -0
- package/dist/util/config/sync-rules/sync-rules-provider.js.map +1 -1
- package/dist/util/config/types.d.ts +4 -1
- package/dist/util/lsn.d.ts +4 -0
- package/dist/util/lsn.js +10 -0
- package/dist/util/lsn.js.map +1 -1
- package/dist/util/protocol-types.d.ts +4 -4
- package/dist/util/protocol-types.js +3 -2
- package/dist/util/protocol-types.js.map +1 -1
- package/dist/util/util-index.d.ts +1 -0
- package/dist/util/util-index.js +1 -0
- package/dist/util/util-index.js.map +1 -1
- package/dist/util/utils.d.ts +3 -2
- package/dist/util/utils.js +17 -2
- package/dist/util/utils.js.map +1 -1
- package/dist/util/write-checkpoint-batcher.d.ts +19 -0
- package/dist/util/write-checkpoint-batcher.js +100 -0
- package/dist/util/write-checkpoint-batcher.js.map +1 -0
- package/package.json +7 -7
- package/src/api/RouteAPI.ts +43 -14
- package/src/api/diagnostics.ts +45 -26
- package/src/entry/commands/compact-action.ts +37 -23
- package/src/metrics/metrics-interfaces.ts +6 -1
- package/src/metrics/open-telemetry/MetricAttributeFilteringExporter.ts +85 -0
- package/src/metrics/open-telemetry/OpenTelemetryMetricsFactory.ts +7 -2
- package/src/metrics/open-telemetry/util.ts +7 -3
- package/src/modules/AbstractModule.ts +6 -2
- package/src/replication/AbstractReplicator.ts +212 -78
- package/src/replication/ReplicationModule.ts +2 -3
- package/src/routes/RouterEngine.ts +7 -1
- package/src/routes/configure-fastify.ts +25 -2
- package/src/routes/endpoints/admin.ts +75 -51
- package/src/routes/endpoints/checkpointing.ts +79 -8
- package/src/routes/endpoints/socket-route.ts +3 -2
- package/src/routes/endpoints/sync-rules.ts +26 -14
- package/src/routes/endpoints/sync-stream.ts +1 -1
- package/src/runner/teardown.ts +8 -8
- package/src/storage/BucketStorageBatch.ts +65 -18
- package/src/storage/BucketStorageFactory.ts +73 -46
- package/src/storage/CheckpointChecksumInvalidatedError.ts +17 -0
- package/src/storage/ChecksumCache.ts +27 -14
- package/src/storage/ParsedSyncConfigSet.ts +25 -0
- package/src/storage/PersistedReplicationStream.ts +55 -0
- package/src/storage/PersistedSyncConfigContent.ts +207 -0
- package/src/storage/PersistedSyncConfigStatus.ts +14 -0
- package/src/storage/ReplicationEventPayload.ts +6 -1
- package/src/storage/SourceEntity.ts +12 -2
- package/src/storage/SourceTable.ts +96 -8
- package/src/storage/SourceTableReconciler.ts +188 -0
- package/src/storage/StorageVersionConfig.ts +11 -1
- package/src/storage/SyncRulesBucketStorage.ts +189 -27
- package/src/storage/WriteCheckpointAPI.ts +140 -6
- package/src/storage/implementation/BucketDefinitionMapping.ts +539 -0
- package/src/storage/implementation/IncrementalReprocessingCompatibility.ts +41 -0
- package/src/storage/implementation/IncrementalReprocessingSyncConfigLog.ts +126 -0
- package/src/storage/implementation/ReplicationStreamStorageIds.ts +21 -0
- package/src/storage/storage-index.ts +11 -1
- package/src/storage/storage-metrics.ts +154 -8
- package/src/sync/BucketChecksumState.ts +105 -21
- package/src/sync/RequestTracker.ts +20 -0
- package/src/sync/sync.ts +214 -50
- package/src/sync/util.ts +33 -8
- package/src/system/ServiceContext.ts +7 -0
- package/src/tracing/PerformanceTracer.ts +41 -1
- package/src/util/checkpointing.ts +4 -22
- package/src/util/config/compound-config-collector.ts +31 -1
- package/src/util/config/defaults.ts +2 -0
- package/src/util/config/sync-rules/impl/base64-sync-rules-collector.ts +1 -0
- package/src/util/config/sync-rules/impl/filesystem-sync-rules-collector.ts +1 -0
- package/src/util/config/sync-rules/sync-rules-provider.ts +5 -0
- package/src/util/config/types.ts +4 -1
- package/src/util/lsn.ts +9 -0
- package/src/util/protocol-types.ts +3 -2
- package/src/util/util-index.ts +1 -0
- package/src/util/utils.ts +16 -2
- package/src/util/write-checkpoint-batcher.ts +142 -0
- package/test/src/AbstractReplicator.test.ts +177 -0
- package/test/src/MetricAttributeFilteringExporter.test.ts +96 -0
- package/test/src/PersistedSyncConfigContent.test.ts +152 -0
- package/test/src/checksum_cache.test.ts +22 -0
- package/test/src/config.test.ts +142 -0
- package/test/src/diagnostics.test.ts +87 -34
- package/test/src/module-loader.test.ts +33 -1
- package/test/src/routes/admin.test.ts +188 -18
- package/test/src/routes/checkpointing.test.ts +54 -0
- package/test/src/routes/mocks.ts +6 -2
- package/test/src/routes/stream.test.ts +123 -2
- package/test/src/source-table-reconciler.test.ts +244 -0
- package/test/src/storage/SourceTable.test.ts +92 -0
- package/test/src/storage-metrics.test.ts +148 -0
- package/test/src/sync/BucketChecksumState.test.ts +98 -12
- package/test/src/sync/util.test.ts +28 -1
- package/test/src/util/checkpointing.test.ts +249 -0
- package/test/src/util/utils.test.ts +23 -0
- package/tsconfig.json +1 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/storage/PersistedSyncRulesContent.d.ts +0 -59
- package/dist/storage/PersistedSyncRulesContent.js +0 -100
- package/dist/storage/PersistedSyncRulesContent.js.map +0 -1
- package/src/storage/PersistedSyncRulesContent.ts +0 -174
|
@@ -80,8 +80,8 @@ export declare const diagnostics: router.Endpoint<{
|
|
|
80
80
|
ts?: string | undefined;
|
|
81
81
|
}[];
|
|
82
82
|
id: string;
|
|
83
|
-
postgres_uri: string;
|
|
84
83
|
connected: boolean;
|
|
84
|
+
postgres_uri: string;
|
|
85
85
|
}[];
|
|
86
86
|
active_sync_rules?: {
|
|
87
87
|
errors: {
|
|
@@ -123,6 +123,7 @@ export declare const diagnostics: router.Endpoint<{
|
|
|
123
123
|
safe_wal_size?: number | undefined;
|
|
124
124
|
max_slot_wal_keep_size?: number | undefined;
|
|
125
125
|
}[];
|
|
126
|
+
version_label?: string | null | undefined;
|
|
126
127
|
content?: string | undefined;
|
|
127
128
|
} | undefined;
|
|
128
129
|
deploying_sync_rules?: {
|
|
@@ -165,6 +166,7 @@ export declare const diagnostics: router.Endpoint<{
|
|
|
165
166
|
safe_wal_size?: number | undefined;
|
|
166
167
|
max_slot_wal_keep_size?: number | undefined;
|
|
167
168
|
}[];
|
|
169
|
+
version_label?: string | null | undefined;
|
|
168
170
|
content?: string | undefined;
|
|
169
171
|
} | undefined;
|
|
170
172
|
}, import("../router.js").Context, import("../router.js").RequestEndpointHandlerPayload<{
|
|
@@ -183,8 +185,8 @@ export declare const diagnostics: router.Endpoint<{
|
|
|
183
185
|
ts?: string | undefined;
|
|
184
186
|
}[];
|
|
185
187
|
id: string;
|
|
186
|
-
postgres_uri: string;
|
|
187
188
|
connected: boolean;
|
|
189
|
+
postgres_uri: string;
|
|
188
190
|
}[];
|
|
189
191
|
active_sync_rules?: {
|
|
190
192
|
errors: {
|
|
@@ -226,6 +228,7 @@ export declare const diagnostics: router.Endpoint<{
|
|
|
226
228
|
safe_wal_size?: number | undefined;
|
|
227
229
|
max_slot_wal_keep_size?: number | undefined;
|
|
228
230
|
}[];
|
|
231
|
+
version_label?: string | null | undefined;
|
|
229
232
|
content?: string | undefined;
|
|
230
233
|
} | undefined;
|
|
231
234
|
deploying_sync_rules?: {
|
|
@@ -268,6 +271,7 @@ export declare const diagnostics: router.Endpoint<{
|
|
|
268
271
|
safe_wal_size?: number | undefined;
|
|
269
272
|
max_slot_wal_keep_size?: number | undefined;
|
|
270
273
|
}[];
|
|
274
|
+
version_label?: string | null | undefined;
|
|
271
275
|
content?: string | undefined;
|
|
272
276
|
} | undefined;
|
|
273
277
|
}>> & {
|
|
@@ -297,8 +301,8 @@ export declare const diagnostics: router.Endpoint<{
|
|
|
297
301
|
ts?: string | undefined;
|
|
298
302
|
}[];
|
|
299
303
|
id: string;
|
|
300
|
-
postgres_uri: string;
|
|
301
304
|
connected: boolean;
|
|
305
|
+
postgres_uri: string;
|
|
302
306
|
}[];
|
|
303
307
|
active_sync_rules?: {
|
|
304
308
|
errors: {
|
|
@@ -340,6 +344,7 @@ export declare const diagnostics: router.Endpoint<{
|
|
|
340
344
|
safe_wal_size?: number | undefined;
|
|
341
345
|
max_slot_wal_keep_size?: number | undefined;
|
|
342
346
|
}[];
|
|
347
|
+
version_label?: string | null | undefined;
|
|
343
348
|
content?: string | undefined;
|
|
344
349
|
} | undefined;
|
|
345
350
|
deploying_sync_rules?: {
|
|
@@ -382,6 +387,7 @@ export declare const diagnostics: router.Endpoint<{
|
|
|
382
387
|
safe_wal_size?: number | undefined;
|
|
383
388
|
max_slot_wal_keep_size?: number | undefined;
|
|
384
389
|
}[];
|
|
390
|
+
version_label?: string | null | undefined;
|
|
385
391
|
content?: string | undefined;
|
|
386
392
|
} | undefined;
|
|
387
393
|
}>;
|
|
@@ -405,8 +411,8 @@ export declare const getSchema: router.Endpoint<{}, {
|
|
|
405
411
|
}[];
|
|
406
412
|
id?: string | undefined;
|
|
407
413
|
}[];
|
|
408
|
-
defaultConnectionTag: string;
|
|
409
414
|
defaultSchema: string;
|
|
415
|
+
defaultConnectionTag: string;
|
|
410
416
|
}, import("../router.js").Context, import("../router.js").RequestEndpointHandlerPayload<{}, import("../router.js").Context, import("../router.js").BasicRouterRequest>, router.EndpointHandler<import("../router.js").RequestEndpointHandlerPayload<{}, import("../router.js").Context, import("../router.js").BasicRouterRequest>, {
|
|
411
417
|
connections: {
|
|
412
418
|
tag: string;
|
|
@@ -426,8 +432,8 @@ export declare const getSchema: router.Endpoint<{}, {
|
|
|
426
432
|
}[];
|
|
427
433
|
id?: string | undefined;
|
|
428
434
|
}[];
|
|
429
|
-
defaultConnectionTag: string;
|
|
430
435
|
defaultSchema: string;
|
|
436
|
+
defaultConnectionTag: string;
|
|
431
437
|
}>> & {
|
|
432
438
|
path: string;
|
|
433
439
|
method: router.HTTPMethod.POST;
|
|
@@ -458,8 +464,8 @@ export declare const getSchema: router.Endpoint<{}, {
|
|
|
458
464
|
}[];
|
|
459
465
|
id?: string | undefined;
|
|
460
466
|
}[];
|
|
461
|
-
defaultConnectionTag: string;
|
|
462
467
|
defaultSchema: string;
|
|
468
|
+
defaultConnectionTag: string;
|
|
463
469
|
}>;
|
|
464
470
|
};
|
|
465
471
|
export declare const reprocess: router.Endpoint<{}, {
|
|
@@ -508,8 +514,6 @@ export declare const validate: router.Endpoint<{
|
|
|
508
514
|
connections: {
|
|
509
515
|
id: string;
|
|
510
516
|
tag: string;
|
|
511
|
-
slot_name: string;
|
|
512
|
-
initial_replication_done: boolean;
|
|
513
517
|
tables: {
|
|
514
518
|
name: string;
|
|
515
519
|
schema: string;
|
|
@@ -527,6 +531,8 @@ export declare const validate: router.Endpoint<{
|
|
|
527
531
|
}[];
|
|
528
532
|
pattern?: string | undefined;
|
|
529
533
|
}[];
|
|
534
|
+
slot_name: string;
|
|
535
|
+
initial_replication_done: boolean;
|
|
530
536
|
last_lsn?: string | undefined;
|
|
531
537
|
last_keepalive_ts?: string | undefined;
|
|
532
538
|
last_checkpoint_ts?: string | undefined;
|
|
@@ -535,6 +541,7 @@ export declare const validate: router.Endpoint<{
|
|
|
535
541
|
safe_wal_size?: number | undefined;
|
|
536
542
|
max_slot_wal_keep_size?: number | undefined;
|
|
537
543
|
}[];
|
|
544
|
+
version_label?: string | null | undefined;
|
|
538
545
|
content?: string | undefined;
|
|
539
546
|
}, import("../router.js").Context, import("../router.js").RequestEndpointHandlerPayload<{
|
|
540
547
|
sync_rules: string;
|
|
@@ -553,8 +560,6 @@ export declare const validate: router.Endpoint<{
|
|
|
553
560
|
connections: {
|
|
554
561
|
id: string;
|
|
555
562
|
tag: string;
|
|
556
|
-
slot_name: string;
|
|
557
|
-
initial_replication_done: boolean;
|
|
558
563
|
tables: {
|
|
559
564
|
name: string;
|
|
560
565
|
schema: string;
|
|
@@ -572,6 +577,8 @@ export declare const validate: router.Endpoint<{
|
|
|
572
577
|
}[];
|
|
573
578
|
pattern?: string | undefined;
|
|
574
579
|
}[];
|
|
580
|
+
slot_name: string;
|
|
581
|
+
initial_replication_done: boolean;
|
|
575
582
|
last_lsn?: string | undefined;
|
|
576
583
|
last_keepalive_ts?: string | undefined;
|
|
577
584
|
last_checkpoint_ts?: string | undefined;
|
|
@@ -580,6 +587,7 @@ export declare const validate: router.Endpoint<{
|
|
|
580
587
|
safe_wal_size?: number | undefined;
|
|
581
588
|
max_slot_wal_keep_size?: number | undefined;
|
|
582
589
|
}[];
|
|
590
|
+
version_label?: string | null | undefined;
|
|
583
591
|
content?: string | undefined;
|
|
584
592
|
}>> & {
|
|
585
593
|
path: string;
|
|
@@ -609,8 +617,6 @@ export declare const validate: router.Endpoint<{
|
|
|
609
617
|
connections: {
|
|
610
618
|
id: string;
|
|
611
619
|
tag: string;
|
|
612
|
-
slot_name: string;
|
|
613
|
-
initial_replication_done: boolean;
|
|
614
620
|
tables: {
|
|
615
621
|
name: string;
|
|
616
622
|
schema: string;
|
|
@@ -628,6 +634,8 @@ export declare const validate: router.Endpoint<{
|
|
|
628
634
|
}[];
|
|
629
635
|
pattern?: string | undefined;
|
|
630
636
|
}[];
|
|
637
|
+
slot_name: string;
|
|
638
|
+
initial_replication_done: boolean;
|
|
631
639
|
last_lsn?: string | undefined;
|
|
632
640
|
last_keepalive_ts?: string | undefined;
|
|
633
641
|
last_checkpoint_ts?: string | undefined;
|
|
@@ -636,6 +644,7 @@ export declare const validate: router.Endpoint<{
|
|
|
636
644
|
safe_wal_size?: number | undefined;
|
|
637
645
|
max_slot_wal_keep_size?: number | undefined;
|
|
638
646
|
}[];
|
|
647
|
+
version_label?: string | null | undefined;
|
|
639
648
|
content?: string | undefined;
|
|
640
649
|
}>;
|
|
641
650
|
};
|
|
@@ -716,8 +725,8 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
716
725
|
ts?: string | undefined;
|
|
717
726
|
}[];
|
|
718
727
|
id: string;
|
|
719
|
-
postgres_uri: string;
|
|
720
728
|
connected: boolean;
|
|
729
|
+
postgres_uri: string;
|
|
721
730
|
}[];
|
|
722
731
|
active_sync_rules?: {
|
|
723
732
|
errors: {
|
|
@@ -759,6 +768,7 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
759
768
|
safe_wal_size?: number | undefined;
|
|
760
769
|
max_slot_wal_keep_size?: number | undefined;
|
|
761
770
|
}[];
|
|
771
|
+
version_label?: string | null | undefined;
|
|
762
772
|
content?: string | undefined;
|
|
763
773
|
} | undefined;
|
|
764
774
|
deploying_sync_rules?: {
|
|
@@ -801,6 +811,7 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
801
811
|
safe_wal_size?: number | undefined;
|
|
802
812
|
max_slot_wal_keep_size?: number | undefined;
|
|
803
813
|
}[];
|
|
814
|
+
version_label?: string | null | undefined;
|
|
804
815
|
content?: string | undefined;
|
|
805
816
|
} | undefined;
|
|
806
817
|
}, import("../router.js").Context, import("../router.js").RequestEndpointHandlerPayload<{
|
|
@@ -819,8 +830,8 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
819
830
|
ts?: string | undefined;
|
|
820
831
|
}[];
|
|
821
832
|
id: string;
|
|
822
|
-
postgres_uri: string;
|
|
823
833
|
connected: boolean;
|
|
834
|
+
postgres_uri: string;
|
|
824
835
|
}[];
|
|
825
836
|
active_sync_rules?: {
|
|
826
837
|
errors: {
|
|
@@ -862,6 +873,7 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
862
873
|
safe_wal_size?: number | undefined;
|
|
863
874
|
max_slot_wal_keep_size?: number | undefined;
|
|
864
875
|
}[];
|
|
876
|
+
version_label?: string | null | undefined;
|
|
865
877
|
content?: string | undefined;
|
|
866
878
|
} | undefined;
|
|
867
879
|
deploying_sync_rules?: {
|
|
@@ -904,6 +916,7 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
904
916
|
safe_wal_size?: number | undefined;
|
|
905
917
|
max_slot_wal_keep_size?: number | undefined;
|
|
906
918
|
}[];
|
|
919
|
+
version_label?: string | null | undefined;
|
|
907
920
|
content?: string | undefined;
|
|
908
921
|
} | undefined;
|
|
909
922
|
}>> & {
|
|
@@ -933,8 +946,8 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
933
946
|
ts?: string | undefined;
|
|
934
947
|
}[];
|
|
935
948
|
id: string;
|
|
936
|
-
postgres_uri: string;
|
|
937
949
|
connected: boolean;
|
|
950
|
+
postgres_uri: string;
|
|
938
951
|
}[];
|
|
939
952
|
active_sync_rules?: {
|
|
940
953
|
errors: {
|
|
@@ -976,6 +989,7 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
976
989
|
safe_wal_size?: number | undefined;
|
|
977
990
|
max_slot_wal_keep_size?: number | undefined;
|
|
978
991
|
}[];
|
|
992
|
+
version_label?: string | null | undefined;
|
|
979
993
|
content?: string | undefined;
|
|
980
994
|
} | undefined;
|
|
981
995
|
deploying_sync_rules?: {
|
|
@@ -1018,6 +1032,7 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1018
1032
|
safe_wal_size?: number | undefined;
|
|
1019
1033
|
max_slot_wal_keep_size?: number | undefined;
|
|
1020
1034
|
}[];
|
|
1035
|
+
version_label?: string | null | undefined;
|
|
1021
1036
|
content?: string | undefined;
|
|
1022
1037
|
} | undefined;
|
|
1023
1038
|
}>;
|
|
@@ -1040,8 +1055,8 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1040
1055
|
}[];
|
|
1041
1056
|
id?: string | undefined;
|
|
1042
1057
|
}[];
|
|
1043
|
-
defaultConnectionTag: string;
|
|
1044
1058
|
defaultSchema: string;
|
|
1059
|
+
defaultConnectionTag: string;
|
|
1045
1060
|
}, import("../router.js").Context, import("../router.js").RequestEndpointHandlerPayload<{}, import("../router.js").Context, import("../router.js").BasicRouterRequest>, router.EndpointHandler<import("../router.js").RequestEndpointHandlerPayload<{}, import("../router.js").Context, import("../router.js").BasicRouterRequest>, {
|
|
1046
1061
|
connections: {
|
|
1047
1062
|
tag: string;
|
|
@@ -1061,8 +1076,8 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1061
1076
|
}[];
|
|
1062
1077
|
id?: string | undefined;
|
|
1063
1078
|
}[];
|
|
1064
|
-
defaultConnectionTag: string;
|
|
1065
1079
|
defaultSchema: string;
|
|
1080
|
+
defaultConnectionTag: string;
|
|
1066
1081
|
}>> & {
|
|
1067
1082
|
path: string;
|
|
1068
1083
|
method: router.HTTPMethod.POST;
|
|
@@ -1093,8 +1108,8 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1093
1108
|
}[];
|
|
1094
1109
|
id?: string | undefined;
|
|
1095
1110
|
}[];
|
|
1096
|
-
defaultConnectionTag: string;
|
|
1097
1111
|
defaultSchema: string;
|
|
1112
|
+
defaultConnectionTag: string;
|
|
1098
1113
|
}>;
|
|
1099
1114
|
}) | (router.Endpoint<{}, {
|
|
1100
1115
|
connections: {
|
|
@@ -1141,8 +1156,6 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1141
1156
|
connections: {
|
|
1142
1157
|
id: string;
|
|
1143
1158
|
tag: string;
|
|
1144
|
-
slot_name: string;
|
|
1145
|
-
initial_replication_done: boolean;
|
|
1146
1159
|
tables: {
|
|
1147
1160
|
name: string;
|
|
1148
1161
|
schema: string;
|
|
@@ -1160,6 +1173,8 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1160
1173
|
}[];
|
|
1161
1174
|
pattern?: string | undefined;
|
|
1162
1175
|
}[];
|
|
1176
|
+
slot_name: string;
|
|
1177
|
+
initial_replication_done: boolean;
|
|
1163
1178
|
last_lsn?: string | undefined;
|
|
1164
1179
|
last_keepalive_ts?: string | undefined;
|
|
1165
1180
|
last_checkpoint_ts?: string | undefined;
|
|
@@ -1168,6 +1183,7 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1168
1183
|
safe_wal_size?: number | undefined;
|
|
1169
1184
|
max_slot_wal_keep_size?: number | undefined;
|
|
1170
1185
|
}[];
|
|
1186
|
+
version_label?: string | null | undefined;
|
|
1171
1187
|
content?: string | undefined;
|
|
1172
1188
|
}, import("../router.js").Context, import("../router.js").RequestEndpointHandlerPayload<{
|
|
1173
1189
|
sync_rules: string;
|
|
@@ -1186,8 +1202,6 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1186
1202
|
connections: {
|
|
1187
1203
|
id: string;
|
|
1188
1204
|
tag: string;
|
|
1189
|
-
slot_name: string;
|
|
1190
|
-
initial_replication_done: boolean;
|
|
1191
1205
|
tables: {
|
|
1192
1206
|
name: string;
|
|
1193
1207
|
schema: string;
|
|
@@ -1205,6 +1219,8 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1205
1219
|
}[];
|
|
1206
1220
|
pattern?: string | undefined;
|
|
1207
1221
|
}[];
|
|
1222
|
+
slot_name: string;
|
|
1223
|
+
initial_replication_done: boolean;
|
|
1208
1224
|
last_lsn?: string | undefined;
|
|
1209
1225
|
last_keepalive_ts?: string | undefined;
|
|
1210
1226
|
last_checkpoint_ts?: string | undefined;
|
|
@@ -1213,6 +1229,7 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1213
1229
|
safe_wal_size?: number | undefined;
|
|
1214
1230
|
max_slot_wal_keep_size?: number | undefined;
|
|
1215
1231
|
}[];
|
|
1232
|
+
version_label?: string | null | undefined;
|
|
1216
1233
|
content?: string | undefined;
|
|
1217
1234
|
}>> & {
|
|
1218
1235
|
path: string;
|
|
@@ -1242,8 +1259,6 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1242
1259
|
connections: {
|
|
1243
1260
|
id: string;
|
|
1244
1261
|
tag: string;
|
|
1245
|
-
slot_name: string;
|
|
1246
|
-
initial_replication_done: boolean;
|
|
1247
1262
|
tables: {
|
|
1248
1263
|
name: string;
|
|
1249
1264
|
schema: string;
|
|
@@ -1261,6 +1276,8 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1261
1276
|
}[];
|
|
1262
1277
|
pattern?: string | undefined;
|
|
1263
1278
|
}[];
|
|
1279
|
+
slot_name: string;
|
|
1280
|
+
initial_replication_done: boolean;
|
|
1264
1281
|
last_lsn?: string | undefined;
|
|
1265
1282
|
last_keepalive_ts?: string | undefined;
|
|
1266
1283
|
last_checkpoint_ts?: string | undefined;
|
|
@@ -1269,6 +1286,7 @@ export declare const ADMIN_ROUTES: ((router.Endpoint<{
|
|
|
1269
1286
|
safe_wal_size?: number | undefined;
|
|
1270
1287
|
max_slot_wal_keep_size?: number | undefined;
|
|
1271
1288
|
}[];
|
|
1289
|
+
version_label?: string | null | undefined;
|
|
1272
1290
|
content?: string | undefined;
|
|
1273
1291
|
}>;
|
|
1274
1292
|
}))[];
|
|
@@ -49,18 +49,22 @@ export const diagnostics = routeDefinition({
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
const { storageEngine: { activeBucketStorage } } = service_context;
|
|
52
|
-
const active = await activeBucketStorage.
|
|
53
|
-
const
|
|
54
|
-
const active_status = await api.getSyncRulesStatus(
|
|
52
|
+
const active = await activeBucketStorage.getActiveSyncConfig();
|
|
53
|
+
const deploying = await activeBucketStorage.getDeployingSyncConfig();
|
|
54
|
+
const active_status = await api.getSyncRulesStatus(apiHandler, active?.content ?? null, {
|
|
55
55
|
include_content,
|
|
56
56
|
check_connection: status.connected,
|
|
57
|
-
live_status: true
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
57
|
+
live_status: true,
|
|
58
|
+
active: true
|
|
59
|
+
}, active?.storage);
|
|
60
|
+
const deploying_status = deploying == null
|
|
61
|
+
? undefined
|
|
62
|
+
: await api.getSyncRulesStatus(apiHandler, deploying.content, {
|
|
63
|
+
include_content,
|
|
64
|
+
check_connection: status.connected,
|
|
65
|
+
live_status: true,
|
|
66
|
+
active: false
|
|
67
|
+
}, deploying.storage);
|
|
64
68
|
return internal_routes.DiagnosticsResponse.encode({
|
|
65
69
|
connections: [
|
|
66
70
|
{
|
|
@@ -70,7 +74,7 @@ export const diagnostics = routeDefinition({
|
|
|
70
74
|
}
|
|
71
75
|
],
|
|
72
76
|
active_sync_rules: active_status,
|
|
73
|
-
deploying_sync_rules:
|
|
77
|
+
deploying_sync_rules: deploying_status
|
|
74
78
|
});
|
|
75
79
|
}
|
|
76
80
|
});
|
|
@@ -93,11 +97,15 @@ export const reprocess = routeDefinition({
|
|
|
93
97
|
const { context: { service_context } } = payload;
|
|
94
98
|
const { storageEngine: { activeBucketStorage } } = service_context;
|
|
95
99
|
const apiHandler = service_context.routerEngine.getAPI();
|
|
96
|
-
const next = await activeBucketStorage.
|
|
100
|
+
const next = await activeBucketStorage.getDeployingSyncConfig();
|
|
97
101
|
if (next != null) {
|
|
98
|
-
throw new
|
|
102
|
+
throw new errors.ServiceError({
|
|
103
|
+
status: 409,
|
|
104
|
+
code: ErrorCode.PSYNC_S4106,
|
|
105
|
+
description: 'Busy processing sync config - cannot reprocess'
|
|
106
|
+
});
|
|
99
107
|
}
|
|
100
|
-
const active = await activeBucketStorage.
|
|
108
|
+
const active = await activeBucketStorage.getActiveSyncConfig();
|
|
101
109
|
if (active == null) {
|
|
102
110
|
throw new errors.ServiceError({
|
|
103
111
|
status: 422,
|
|
@@ -109,10 +117,12 @@ export const reprocess = routeDefinition({
|
|
|
109
117
|
// 1. This always re-parses the source YAML. If there are changes to the sync stream compiler, that can affect the sync plan.
|
|
110
118
|
// 2. If the source does not set the storage version, this will update it do the current version.
|
|
111
119
|
// We can consider tweaking this behavior in the future.
|
|
112
|
-
const new_rules = await activeBucketStorage.updateSyncRules(storage.updateSyncRulesFromYaml(active.
|
|
120
|
+
const new_rules = await activeBucketStorage.updateSyncRules(storage.updateSyncRulesFromYaml(active.content.sync_rules_content, {
|
|
113
121
|
// This sync config already passed validation. But if the config is not valid anymore due
|
|
114
122
|
// to a service change, we do want to report the error here.
|
|
115
|
-
validate: true
|
|
123
|
+
validate: true,
|
|
124
|
+
version_label: active.content.version_label,
|
|
125
|
+
forceNewReplicationStream: true
|
|
116
126
|
}));
|
|
117
127
|
const baseConfig = await apiHandler.getSourceConfig();
|
|
118
128
|
return internal_routes.ReprocessResponse.encode({
|
|
@@ -121,13 +131,13 @@ export const reprocess = routeDefinition({
|
|
|
121
131
|
// Previously the connection was asserted with `!`
|
|
122
132
|
tag: baseConfig.tag,
|
|
123
133
|
id: baseConfig.id,
|
|
124
|
-
slot_name: new_rules.
|
|
134
|
+
slot_name: new_rules.replicationStreamName
|
|
125
135
|
}
|
|
126
136
|
]
|
|
127
137
|
});
|
|
128
138
|
}
|
|
129
139
|
});
|
|
130
|
-
class FakeSyncRulesContentForValidation extends storage.
|
|
140
|
+
class FakeSyncRulesContentForValidation extends storage.PersistedSyncConfigContent {
|
|
131
141
|
apiHandler;
|
|
132
142
|
schema;
|
|
133
143
|
constructor(apiHandler, schema, data) {
|
|
@@ -135,26 +145,29 @@ class FakeSyncRulesContentForValidation extends storage.PersistedSyncRulesConten
|
|
|
135
145
|
this.apiHandler = apiHandler;
|
|
136
146
|
this.schema = schema;
|
|
137
147
|
}
|
|
138
|
-
current_lock = null;
|
|
139
|
-
async lock() {
|
|
140
|
-
throw new Error('Lock not implemented');
|
|
141
|
-
}
|
|
142
148
|
parsed(options) {
|
|
149
|
+
const syncConfig = SqlSyncRules.fromYaml(this.sync_rules_content, {
|
|
150
|
+
...this.apiHandler.getParseSyncRulesOptions(),
|
|
151
|
+
schema: this.schema
|
|
152
|
+
});
|
|
153
|
+
let hydrated;
|
|
143
154
|
return {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
schema: this.schema
|
|
148
|
-
}),
|
|
155
|
+
replicationStreamId: this.replicationStreamId,
|
|
156
|
+
replicationStreamName: this.replicationStreamName,
|
|
157
|
+
syncConfigs: [syncConfig],
|
|
149
158
|
hydrationState: DEFAULT_HYDRATION_STATE,
|
|
150
|
-
hydratedSyncConfig() {
|
|
151
|
-
|
|
159
|
+
get hydratedSyncConfig() {
|
|
160
|
+
hydrated ??= syncConfig.config.hydrate({
|
|
152
161
|
hydrationState: DEFAULT_HYDRATION_STATE,
|
|
153
162
|
sqlite: nodeSqlite(sqlite)
|
|
154
163
|
});
|
|
164
|
+
return hydrated;
|
|
155
165
|
}
|
|
156
166
|
};
|
|
157
167
|
}
|
|
168
|
+
async getSyncConfigStatus() {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
158
171
|
}
|
|
159
172
|
export const validate = routeDefinition({
|
|
160
173
|
path: '/api/admin/v1/validate',
|
|
@@ -169,13 +182,12 @@ export const validate = routeDefinition({
|
|
|
169
182
|
const schema = new StaticSchema(schemaData.connections);
|
|
170
183
|
const sync_rules = new FakeSyncRulesContentForValidation(apiHandler, schema, {
|
|
171
184
|
// Dummy values
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
active: false,
|
|
175
|
-
last_checkpoint_lsn: '',
|
|
185
|
+
replicationStreamId: 0,
|
|
186
|
+
replicationStreamName: '',
|
|
176
187
|
storageVersion: storage.LEGACY_STORAGE_VERSION,
|
|
177
188
|
sync_rules_content: content,
|
|
178
|
-
compiled_plan: null
|
|
189
|
+
compiled_plan: null,
|
|
190
|
+
syncConfigState: storage.SyncRuleState.PROCESSING
|
|
179
191
|
});
|
|
180
192
|
const connectionStatus = await apiHandler.getConnectionStatus();
|
|
181
193
|
if (!connectionStatus) {
|
|
@@ -184,10 +196,11 @@ export const validate = routeDefinition({
|
|
|
184
196
|
connections: []
|
|
185
197
|
});
|
|
186
198
|
}
|
|
187
|
-
const status = (await api.getSyncRulesStatus(
|
|
199
|
+
const status = (await api.getSyncRulesStatus(apiHandler, sync_rules, {
|
|
188
200
|
include_content: false,
|
|
189
201
|
check_connection: connectionStatus.connected,
|
|
190
|
-
live_status: false
|
|
202
|
+
live_status: false,
|
|
203
|
+
active: false
|
|
191
204
|
}));
|
|
192
205
|
if (connectionStatus == null) {
|
|
193
206
|
status.errors.push({ level: 'fatal', message: 'No connection configured', ts: new Date().toISOString() });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../../src/routes/endpoints/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,
|
|
1
|
+
{"version":3,"file":"admin.js","sourceRoot":"","sources":["../../../src/routes/endpoints/admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAEL,UAAU,EAEV,YAAY,EACZ,YAAY,EACb,MAAM,+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EAAE,EAAE,CAAC;gBAC/F,WAAW,EAAE,EAAE;aAChB,CAAC,CAAC;QACL,CAAC;QAED,MAAM,MAAM,GAAG,CAAC,MAAM,GAAG,CAAC,kBAAkB,CAAC,UAAU,EAAE,UAAU,EAAE;YACnE,eAAe,EAAE,KAAK;YACtB,gBAAgB,EAAE,gBAAgB,CAAC,SAAS;YAC5C,WAAW,EAAE,KAAK;YAClB,MAAM,EAAE,KAAK;SACd,CAAC,CAAE,CAAC;QAEL,IAAI,gBAAgB,IAAI,IAAI,EAAE,CAAC;YAC7B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,0BAA0B,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC5G,CAAC;QAED,OAAO,eAAe,CAAC,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACzD,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { router, schema } from '@powersync/lib-services-framework';
|
|
2
|
+
import * as t from 'ts-codec';
|
|
3
|
+
export declare const CheckpointRequestPayload: t.ObjectCodec<{
|
|
4
|
+
client_id: t.IdentityCodec<t.CodecType.String>;
|
|
5
|
+
checkpoint_request_id: t.Codec<bigint, string | number | bigint, string, t.CodecProps>;
|
|
6
|
+
}>;
|
|
2
7
|
export declare const writeCheckpoint: router.Endpoint<{
|
|
3
8
|
client_id?: string | undefined;
|
|
4
9
|
}, {
|
|
@@ -45,6 +50,35 @@ export declare const writeCheckpoint2: router.Endpoint<{
|
|
|
45
50
|
write_checkpoint: string;
|
|
46
51
|
}>;
|
|
47
52
|
};
|
|
53
|
+
export declare const checkpointRequest: router.Endpoint<{
|
|
54
|
+
client_id: string;
|
|
55
|
+
checkpoint_request_id: string | number | bigint;
|
|
56
|
+
}, {
|
|
57
|
+
checkpoint_request_id: string;
|
|
58
|
+
}, import("../router.js").Context, import("../router.js").RequestEndpointHandlerPayload<{
|
|
59
|
+
client_id: string;
|
|
60
|
+
checkpoint_request_id: string | number | bigint;
|
|
61
|
+
}, import("../router.js").Context, import("../router.js").BasicRouterRequest>, router.EndpointHandler<import("../router.js").RequestEndpointHandlerPayload<{
|
|
62
|
+
client_id: string;
|
|
63
|
+
checkpoint_request_id: string | number | bigint;
|
|
64
|
+
}, import("../router.js").Context, import("../router.js").BasicRouterRequest>, {
|
|
65
|
+
checkpoint_request_id: string;
|
|
66
|
+
}>> & {
|
|
67
|
+
path: string;
|
|
68
|
+
method: router.HTTPMethod.POST;
|
|
69
|
+
authorize: (payload: import("../router.js").RequestEndpointHandlerPayload) => Promise<router.AuthorizationResponse>;
|
|
70
|
+
validator: {
|
|
71
|
+
validate(params: t.Encoded<typeof CheckpointRequestPayload>): schema.ValidationLeft<string[]> | {
|
|
72
|
+
valid: true;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
handler: (request: import("../router.js").RequestEndpointHandlerPayload<{
|
|
76
|
+
client_id: string;
|
|
77
|
+
checkpoint_request_id: string | number | bigint;
|
|
78
|
+
}, import("../router.js").Context, import("../router.js").BasicRouterRequest>) => Promise<{
|
|
79
|
+
checkpoint_request_id: string;
|
|
80
|
+
}>;
|
|
81
|
+
};
|
|
48
82
|
export declare const CHECKPOINT_ROUTES: ((router.Endpoint<{
|
|
49
83
|
client_id?: string | undefined;
|
|
50
84
|
}, {
|
|
@@ -89,4 +123,32 @@ export declare const CHECKPOINT_ROUTES: ((router.Endpoint<{
|
|
|
89
123
|
}, import("../router.js").Context, import("../router.js").BasicRouterRequest>) => Promise<{
|
|
90
124
|
write_checkpoint: string;
|
|
91
125
|
}>;
|
|
126
|
+
}) | (router.Endpoint<{
|
|
127
|
+
client_id: string;
|
|
128
|
+
checkpoint_request_id: string | number | bigint;
|
|
129
|
+
}, {
|
|
130
|
+
checkpoint_request_id: string;
|
|
131
|
+
}, import("../router.js").Context, import("../router.js").RequestEndpointHandlerPayload<{
|
|
132
|
+
client_id: string;
|
|
133
|
+
checkpoint_request_id: string | number | bigint;
|
|
134
|
+
}, import("../router.js").Context, import("../router.js").BasicRouterRequest>, router.EndpointHandler<import("../router.js").RequestEndpointHandlerPayload<{
|
|
135
|
+
client_id: string;
|
|
136
|
+
checkpoint_request_id: string | number | bigint;
|
|
137
|
+
}, import("../router.js").Context, import("../router.js").BasicRouterRequest>, {
|
|
138
|
+
checkpoint_request_id: string;
|
|
139
|
+
}>> & {
|
|
140
|
+
path: string;
|
|
141
|
+
method: router.HTTPMethod.POST;
|
|
142
|
+
authorize: (payload: import("../router.js").RequestEndpointHandlerPayload) => Promise<router.AuthorizationResponse>;
|
|
143
|
+
validator: {
|
|
144
|
+
validate(params: t.Encoded<typeof CheckpointRequestPayload>): schema.ValidationLeft<string[]> | {
|
|
145
|
+
valid: true;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
handler: (request: import("../router.js").RequestEndpointHandlerPayload<{
|
|
149
|
+
client_id: string;
|
|
150
|
+
checkpoint_request_id: string | number | bigint;
|
|
151
|
+
}, import("../router.js").Context, import("../router.js").BasicRouterRequest>) => Promise<{
|
|
152
|
+
checkpoint_request_id: string;
|
|
153
|
+
}>;
|
|
92
154
|
}))[];
|