@lostgradient/weft 0.12.0 → 0.13.0
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 +1 -1
- package/dist/cli/api.d.ts +2 -0
- package/dist/cli/api.js +3 -4
- package/dist/cli/generated/operation-catalog.snapshot.json +508 -12
- package/dist/cli/generated/operation-client.generated.d.ts +118 -10
- package/dist/cli/generated/operation-client.generated.js +74 -1
- package/dist/cli/operation-catalog-snapshot.d.ts +11 -2
- package/dist/cli/operation-catalog-snapshot.js +14 -5
- package/dist/cli/operation-client-runtime.d.ts +29 -0
- package/dist/client/client-storage.d.ts +24 -0
- package/dist/client/client-storage.js +14 -0
- package/dist/client/handle-delegation.d.ts +3 -3
- package/dist/client/handle-delegation.js +2 -2
- package/dist/client/http-client-requests.d.ts +5 -3
- package/dist/client/http-client-requests.js +20 -2
- package/dist/client/http-client-storage.d.ts +3 -0
- package/dist/client/http-client-storage.js +110 -0
- package/dist/client/http-client.d.ts +9 -6
- package/dist/client/http-client.js +13 -18
- package/dist/client/http-operations.d.ts +3 -1
- package/dist/client/http-operations.js +77 -1
- package/dist/client/http-request.d.ts +15 -8
- package/dist/client/http-request.js +19 -7
- package/dist/client/in-process-operations.d.ts +2 -2
- package/dist/client/in-process-operations.js +2 -2
- package/dist/client/index.d.ts +5 -1
- package/dist/client/index.js +13 -2
- package/dist/client/interface.d.ts +26 -26
- package/dist/client/local.d.ts +9 -6
- package/dist/client/local.js +9 -4
- package/dist/client/search-params.js +10 -6
- package/dist/client/start-body.d.ts +3 -1
- package/dist/client/start-body.js +9 -0
- package/dist/core/bulk-workflow-filter.d.ts +2 -1
- package/dist/core/bulk-workflow-filter.js +5 -1
- package/dist/core/engine/async-activity-records.d.ts +12 -1
- package/dist/core/engine/async-activity-records.js +81 -2
- package/dist/core/engine/bulk-operations-purge.js +16 -1
- package/dist/core/engine/bulk-operations-shared.js +2 -0
- package/dist/core/engine/callback-creators-schedule.d.ts +2 -1
- package/dist/core/engine/callback-creators-schedule.js +3 -3
- package/dist/core/engine/checkpoint-reads.js +11 -1
- package/dist/core/engine/child-workflow.js +15 -6
- package/dist/core/engine/construction.js +3 -0
- package/dist/core/engine/disposal.js +2 -0
- package/dist/core/engine/engine-internal-types.d.ts +4 -1
- package/dist/core/engine/fenced-write.d.ts +5 -3
- package/dist/core/engine/finalizer-status.d.ts +10 -0
- package/dist/core/engine/finalizer-status.js +82 -0
- package/dist/core/engine/index.d.ts +26 -2
- package/dist/core/engine/index.js +71 -8
- package/dist/core/engine/internals.d.ts +3 -0
- package/dist/core/engine/lease-health.d.ts +64 -0
- package/dist/core/engine/lease-health.js +0 -0
- package/dist/core/engine/lease-manager.d.ts +4 -2
- package/dist/core/engine/lease-manager.js +32 -4
- package/dist/core/engine/lifecycle/recovered-services.js +0 -2
- package/dist/core/engine/lifecycle/shared.d.ts +11 -8
- package/dist/core/engine/lifecycle/start-batch.js +12 -0
- package/dist/core/engine/lifecycle/start.d.ts +1 -1
- package/dist/core/engine/lifecycle/start.js +34 -5
- package/dist/core/engine/operations-coordination.d.ts +1 -12
- package/dist/core/engine/operations-coordination.js +57 -10
- package/dist/core/engine/operations-speculate.d.ts +1 -1
- package/dist/core/engine/operations-speculate.js +19 -5
- package/dist/core/engine/registration.js +14 -0
- package/dist/core/engine/schedule-handle.d.ts +4 -4
- package/dist/core/engine/schedule-handle.js +2 -2
- package/dist/core/engine/schedule-overlap.d.ts +11 -0
- package/dist/core/engine/schedule-overlap.js +50 -0
- package/dist/core/engine/schedule-run.d.ts +11 -3
- package/dist/core/engine/schedule-run.js +27 -4
- package/dist/core/engine/schedule-timer.js +10 -1
- package/dist/core/engine/schedules.d.ts +5 -4
- package/dist/core/engine/schedules.js +62 -56
- package/dist/core/engine/state-utilities.js +1 -1
- package/dist/core/engine/storage-io.d.ts +12 -0
- package/dist/core/engine/storage-io.js +49 -10
- package/dist/core/engine/termination/finalizer-claim.d.ts +8 -6
- package/dist/core/engine/termination/finalizer-claim.js +2 -1
- package/dist/core/engine/termination/finalizer.js +10 -14
- package/dist/core/engine/timeline-coordinator-constants.d.ts +3 -0
- package/dist/core/engine/timeline-coordinator-constants.js +1 -0
- package/dist/core/engine/timeline-coordinator-detail.d.ts +13 -0
- package/dist/core/engine/timeline-coordinator-detail.js +76 -0
- package/dist/core/engine/validation/schedule-options.d.ts +8 -1
- package/dist/core/engine/validation/schedule-options.js +18 -0
- package/dist/core/engine/validation/schedule.d.ts +1 -1
- package/dist/core/engine/validation/schedule.js +27 -3
- package/dist/core/engine/validation.js +66 -2
- package/dist/core/engine/workflow-state-stream.d.ts +5 -1
- package/dist/core/engine/workflow-state-stream.js +37 -14
- package/dist/core/events/schedule-events.d.ts +3 -4
- package/dist/core/events/workflow-events.d.ts +2 -1
- package/dist/core/list-filter-validation.d.ts +3 -0
- package/dist/core/list-filter-validation.js +11 -0
- package/dist/core/registry-snapshot.d.ts +32 -0
- package/dist/core/registry-snapshot.js +28 -0
- package/dist/core/review/index.d.ts +4 -4
- package/dist/core/types/activity.d.ts +52 -5
- package/dist/core/types/bulk.d.ts +1 -0
- package/dist/core/types/list-options.d.ts +6 -0
- package/dist/core/types/options.d.ts +6 -5
- package/dist/core/types/reviews.d.ts +2 -2
- package/dist/core/types/schedules.d.ts +45 -2
- package/dist/core/types/services-resolution.d.ts +5 -5
- package/dist/core/types/state.d.ts +64 -0
- package/dist/core/types/workflow-log.d.ts +3 -2
- package/dist/core/types/workflow-observability.d.ts +50 -0
- package/dist/core/types/workflow-observability.js +0 -0
- package/dist/core/types/workflow-registry.d.ts +7 -0
- package/dist/core/types.d.ts +1 -0
- package/dist/core/types.js +1 -0
- package/dist/http.js +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/indexeddb.js +1 -1
- package/dist/server/access-policy-metadata.d.ts +92 -0
- package/dist/server/access-policy-metadata.js +78 -0
- package/dist/server/fault-to-http.d.ts +3 -7
- package/dist/server/fault-to-http.js +2 -34
- package/dist/server/handler/index.js +1 -1
- package/dist/server/handler/route-dispatch.d.ts +10 -3
- package/dist/server/handler/route-dispatch.js +19 -4
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +1 -0
- package/dist/server/interactive-operations.js +2 -0
- package/dist/server/openapi-error-responses.js +55 -4
- package/dist/server/openapi.d.ts +3 -1
- package/dist/server/openapi.js +4 -0
- package/dist/server/openrpc-document-schema.d.ts +64 -0
- package/dist/server/openrpc-document-schema.js +6 -26
- package/dist/server/openrpc.d.ts +4 -0
- package/dist/server/openrpc.js +9 -33
- package/dist/server/operation-fault.d.ts +24 -7
- package/dist/server/operation-fault.js +65 -13
- package/dist/server/operations/aggregate-workflows.d.ts +6 -0
- package/dist/server/operations/aggregate-workflows.js +3 -2
- package/dist/server/operations/async-activity.d.ts +14 -0
- package/dist/server/operations/async-activity.js +88 -4
- package/dist/server/operations/bulk-filter-helpers.d.ts +3 -0
- package/dist/server/operations/bulk-filter-helpers.js +27 -3
- package/dist/server/operations/bulk-mutate-workflow-tags.d.ts +6 -0
- package/dist/server/operations/bulk-signal-workflows.d.ts +6 -0
- package/dist/server/operations/get-stream-chunks.js +2 -7
- package/dist/server/operations/get-system-lease.d.ts +19 -0
- package/dist/server/operations/get-system-lease.js +48 -0
- package/dist/server/operations/get-workflow-observability.d.ts +24 -0
- package/dist/server/operations/get-workflow-observability.js +80 -0
- package/dist/server/operations/get-workflow-result.js +2 -2
- package/dist/server/operations/get-workflow.d.ts +2 -2
- package/dist/server/operations/list-filter-query-extractor.js +15 -0
- package/dist/server/operations/list-workflows.d.ts +6 -0
- package/dist/server/operations/list-workflows.js +12 -3
- package/dist/server/operations/operation-helpers.d.ts +9 -18
- package/dist/server/operations/operation-helpers.js +5 -23
- package/dist/server/operations/purge-workflows.d.ts +3 -0
- package/dist/server/operations/recover-all.js +2 -1
- package/dist/server/operations/single-workflow-tag-mutation.js +2 -2
- package/dist/server/operations/sse-stream.js +2 -7
- package/dist/server/operations/storage-capabilities.d.ts +34 -0
- package/dist/server/operations/storage-capabilities.js +38 -0
- package/dist/server/operations/storage.js +8 -17
- package/dist/server/operations/stream-workflow-sse.js +3 -9
- package/dist/server/operations/update-schedule.d.ts +8 -0
- package/dist/server/operations/update-schedule.js +70 -7
- package/dist/server/operations/workflow-events-sse.js +2 -2
- package/dist/server/rest-binding.d.ts +7 -6
- package/dist/server/rest-bindings.d.ts +2 -13
- package/dist/server/rest-bindings.js +19 -10
- package/dist/server/task-queue.d.ts +7 -5
- package/dist/storage/capabilities.d.ts +1 -1
- package/dist/storage/cloudflare-value-codec.d.ts +5 -3
- package/dist/storage/cloudflare-value-codec.js +1 -1
- package/dist/storage/compressed-storage.js +1 -1
- package/dist/storage/index.d.ts +7 -1
- package/dist/storage/interface.d.ts +16 -4
- package/dist/storage/interface.js +1 -1
- package/dist/storage/key-prefixes.d.ts +1 -1
- package/dist/storage/key-prefixes.js +4 -0
- package/dist/storage/lmdb.js +1 -1
- package/dist/storage/memory.js +1 -1
- package/dist/storage/neon.js +4 -4
- package/dist/storage/postgres.js +4 -4
- package/dist/storage/resolve.js +1 -1
- package/dist/storage/scoped-storage.js +1 -1
- package/dist/storage/testing.js +1 -1
- package/dist/storage/turso.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/web-extension.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import { type CatalogWeftClient, type WeftClientConnection } from '../operation-client-runtime.ts';
|
|
2
|
-
export declare const CATALOG_OPERATION_NAMES: readonly ["weft.activities.complete", "weft.activities.fail", "weft.recover.all", "weft.retention.get", "weft.reviews.decision.submit", "weft.reviews.get", "weft.reviews.list", "weft.schedules.cancel", "weft.schedules.create", "weft.schedules.get", "weft.schedules.list", "weft.schedules.pause", "weft.schedules.resume", "weft.schedules.update", "weft.system.metrics", "weft.system.registry", "weft.task.queues.list", "weft.tasks.diagnostics", "weft.updates.result.get", "weft.worker.deployments.drain", "weft.worker.deployments.resume", "weft.workers.drain", "weft.workers.list", "weft.workers.resume", "weft.workflows.aggregate", "weft.workflows.attributes.get", "weft.workflows.attributes.set", "weft.workflows.bulk.cancel", "weft.workflows.bulk.delete", "weft.workflows.bulk.retryfailed", "weft.workflows.bulk.signal", "weft.workflows.bulk.tags", "weft.workflows.cancel", "weft.workflows.checkpoints.get", "weft.workflows.checkpoints.list", "weft.workflows.events.list", "weft.workflows.fork", "weft.workflows.get", "weft.workflows.list", "weft.workflows.purge", "weft.workflows.query", "weft.workflows.replay", "weft.workflows.result.get", "weft.workflows.resume", "weft.workflows.signal", "weft.workflows.start", "weft.workflows.startorsignal", "weft.workflows.streams.chunks", "weft.workflows.suspend", "weft.workflows.tags.add", "weft.workflows.tags.remove", "weft.workflows.timeline.get", "weft.workflows.timeout", "weft.workflows.update"];
|
|
2
|
+
export declare const CATALOG_OPERATION_NAMES: readonly ["weft.activities.complete", "weft.activities.fail", "weft.recover.all", "weft.retention.get", "weft.reviews.decision.submit", "weft.reviews.get", "weft.reviews.list", "weft.schedules.cancel", "weft.schedules.create", "weft.schedules.get", "weft.schedules.list", "weft.schedules.pause", "weft.schedules.resume", "weft.schedules.update", "weft.storage.capabilities", "weft.system.lease", "weft.system.metrics", "weft.system.registry", "weft.task.queues.list", "weft.tasks.diagnostics", "weft.updates.result.get", "weft.worker.deployments.drain", "weft.worker.deployments.resume", "weft.workers.drain", "weft.workers.list", "weft.workers.resume", "weft.workflows.activities.pending.list", "weft.workflows.aggregate", "weft.workflows.attributes.get", "weft.workflows.attributes.set", "weft.workflows.bulk.cancel", "weft.workflows.bulk.delete", "weft.workflows.bulk.retryfailed", "weft.workflows.bulk.signal", "weft.workflows.bulk.tags", "weft.workflows.cancel", "weft.workflows.checkpoints.get", "weft.workflows.checkpoints.list", "weft.workflows.events.list", "weft.workflows.finalizer.get", "weft.workflows.fork", "weft.workflows.get", "weft.workflows.list", "weft.workflows.purge", "weft.workflows.query", "weft.workflows.replay", "weft.workflows.result.get", "weft.workflows.resume", "weft.workflows.scheduleprovenance.get", "weft.workflows.signal", "weft.workflows.start", "weft.workflows.startorsignal", "weft.workflows.streams.chunks", "weft.workflows.suspend", "weft.workflows.tags.add", "weft.workflows.tags.remove", "weft.workflows.timeline.get", "weft.workflows.timeout", "weft.workflows.update"];
|
|
3
3
|
export type CatalogOperationName = (typeof CATALOG_OPERATION_NAMES)[number];
|
|
4
|
-
|
|
4
|
+
export declare const CLIENT_OPERATION_NAMES: readonly ["weft.activities.complete", "weft.activities.fail", "weft.recover.all", "weft.retention.get", "weft.reviews.decision.submit", "weft.reviews.get", "weft.reviews.list", "weft.schedules.cancel", "weft.schedules.create", "weft.schedules.get", "weft.schedules.list", "weft.schedules.pause", "weft.schedules.resume", "weft.schedules.update", "weft.storage.capabilities", "weft.system.lease", "weft.system.metrics", "weft.system.registry", "weft.task.queues.list", "weft.tasks.diagnostics", "weft.tasks.diagnostics.deadletters.clear", "weft.updates.result.get", "weft.worker.deployments.drain", "weft.worker.deployments.resume", "weft.workers.drain", "weft.workers.list", "weft.workers.resume", "weft.workflows.activities.pending.list", "weft.workflows.aggregate", "weft.workflows.attributes.get", "weft.workflows.attributes.set", "weft.workflows.bulk.cancel", "weft.workflows.bulk.delete", "weft.workflows.bulk.retryfailed", "weft.workflows.bulk.signal", "weft.workflows.bulk.tags", "weft.workflows.cancel", "weft.workflows.checkpoints.get", "weft.workflows.checkpoints.list", "weft.workflows.events.list", "weft.workflows.finalizer.get", "weft.workflows.fork", "weft.workflows.get", "weft.workflows.list", "weft.workflows.purge", "weft.workflows.query", "weft.workflows.replay", "weft.workflows.result.get", "weft.workflows.resume", "weft.workflows.scheduleprovenance.get", "weft.workflows.signal", "weft.workflows.start", "weft.workflows.startorsignal", "weft.workflows.streams.chunks", "weft.workflows.suspend", "weft.workflows.tags.add", "weft.workflows.tags.remove", "weft.workflows.timeline.get", "weft.workflows.timeout", "weft.workflows.update"];
|
|
5
|
+
export type ClientOperationName = (typeof CLIENT_OPERATION_NAMES)[number];
|
|
6
|
+
export declare const CLIENT_REST_OPERATION_BINDINGS: {
|
|
7
|
+
readonly 'weft.tasks.diagnostics.deadletters.clear': {
|
|
8
|
+
readonly method: "DELETE";
|
|
9
|
+
readonly path: "/tasks/diagnostics/dead-letter/:operationId";
|
|
10
|
+
readonly inputSources: {
|
|
11
|
+
readonly operationId: {
|
|
12
|
+
readonly kind: "path";
|
|
13
|
+
readonly pathParam: "operationId";
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
readonly success: {
|
|
17
|
+
readonly kind: "json";
|
|
18
|
+
readonly status: 200;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
type SharedAttributesBulkConcurrenc_f62debcf = {
|
|
5
23
|
readonly attributes?: ReadonlyArray<SharedGtGteKey_896a0c41>;
|
|
6
24
|
readonly bulkConcurrency?: number;
|
|
7
25
|
readonly confirmationToken?: string;
|
|
@@ -12,13 +30,16 @@ type SharedAttributesBulkConcurrenc_73ecbca6 = {
|
|
|
12
30
|
readonly idPrefix?: string;
|
|
13
31
|
readonly limit?: number;
|
|
14
32
|
readonly offset?: number;
|
|
33
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
34
|
+
readonly parentWorkflowId?: string;
|
|
15
35
|
readonly requestId?: string;
|
|
36
|
+
readonly scheduleId?: string;
|
|
16
37
|
readonly status?: unknown;
|
|
17
38
|
readonly tags?: ReadonlyArray<string>;
|
|
18
39
|
readonly type?: string;
|
|
19
40
|
readonly updatedAt?: SharedGtGteLt_d9a61361;
|
|
20
41
|
};
|
|
21
|
-
type
|
|
42
|
+
type SharedAttributesCreatedAtExecu_2af7f9ff = {
|
|
22
43
|
readonly attributes?: ReadonlyArray<SharedGtGteKey_896a0c41>;
|
|
23
44
|
readonly createdAt?: SharedGtGteLt_d9a61361;
|
|
24
45
|
readonly executionDeadline?: SharedGtGteLt_d9a61361;
|
|
@@ -26,6 +47,9 @@ type SharedAttributesCreatedAtExecu_c9ba5dc6 = {
|
|
|
26
47
|
readonly idPrefix?: string;
|
|
27
48
|
readonly limit?: number;
|
|
28
49
|
readonly offset?: number;
|
|
50
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
51
|
+
readonly parentWorkflowId?: string;
|
|
52
|
+
readonly scheduleId?: string;
|
|
29
53
|
readonly status?: unknown;
|
|
30
54
|
readonly tags?: ReadonlyArray<string>;
|
|
31
55
|
readonly type?: string;
|
|
@@ -45,7 +69,7 @@ type SharedGtGteLt_d9a61361 = {
|
|
|
45
69
|
readonly lt?: number;
|
|
46
70
|
readonly lte?: number;
|
|
47
71
|
};
|
|
48
|
-
export type
|
|
72
|
+
export type ClientOperationTypes = {
|
|
49
73
|
'weft.activities.complete': {
|
|
50
74
|
readonly input: {
|
|
51
75
|
readonly result?: unknown;
|
|
@@ -171,12 +195,43 @@ export type CatalogOperationTypes = {
|
|
|
171
195
|
};
|
|
172
196
|
'weft.schedules.update': {
|
|
173
197
|
readonly input: {
|
|
198
|
+
readonly backfill?: unknown;
|
|
174
199
|
readonly cronExpression?: unknown;
|
|
200
|
+
readonly description?: unknown;
|
|
175
201
|
readonly every?: unknown;
|
|
202
|
+
readonly jitter?: unknown;
|
|
203
|
+
readonly overlap?: unknown;
|
|
176
204
|
readonly scheduleId: string;
|
|
177
205
|
};
|
|
178
206
|
readonly output: null;
|
|
179
|
-
readonly faults: 'Conflict' | 'NotFound';
|
|
207
|
+
readonly faults: 'Conflict' | 'InvalidParams' | 'NotFound';
|
|
208
|
+
};
|
|
209
|
+
'weft.storage.capabilities': {
|
|
210
|
+
readonly input: {};
|
|
211
|
+
readonly output: {
|
|
212
|
+
readonly atomicBatch: boolean;
|
|
213
|
+
readonly boundedRangeDelete: boolean;
|
|
214
|
+
readonly conditionalBatch: boolean;
|
|
215
|
+
readonly persistence: 'ephemeral' | 'local' | 'remote';
|
|
216
|
+
readonly readAfterWrite: 'linearizable' | 'session' | 'eventual';
|
|
217
|
+
readonly scanConsistency: 'snapshot' | 'best-effort';
|
|
218
|
+
};
|
|
219
|
+
readonly faults: never;
|
|
220
|
+
};
|
|
221
|
+
'weft.system.lease': {
|
|
222
|
+
readonly input: {};
|
|
223
|
+
readonly output: {
|
|
224
|
+
readonly expiresAt?: number;
|
|
225
|
+
readonly fencingEpoch?: number;
|
|
226
|
+
readonly heldSince?: number;
|
|
227
|
+
readonly holderId?: string;
|
|
228
|
+
readonly holdsLease: boolean;
|
|
229
|
+
readonly lastRenewedAt?: number;
|
|
230
|
+
readonly lossReason?: 'deposed' | 'renewal-unconfirmable';
|
|
231
|
+
readonly mode: 'none' | 'lease';
|
|
232
|
+
readonly status: 'disabled' | 'healthy' | 'no-lease' | 'contested';
|
|
233
|
+
};
|
|
234
|
+
readonly faults: never;
|
|
180
235
|
};
|
|
181
236
|
'weft.system.metrics': {
|
|
182
237
|
readonly input: {};
|
|
@@ -251,6 +306,15 @@ export type CatalogOperationTypes = {
|
|
|
251
306
|
};
|
|
252
307
|
readonly faults: never;
|
|
253
308
|
};
|
|
309
|
+
'weft.tasks.diagnostics.deadletters.clear': {
|
|
310
|
+
readonly input: {
|
|
311
|
+
readonly operationId: string;
|
|
312
|
+
};
|
|
313
|
+
readonly output: {
|
|
314
|
+
readonly ok: boolean;
|
|
315
|
+
};
|
|
316
|
+
readonly faults: never;
|
|
317
|
+
};
|
|
254
318
|
'weft.updates.result.get': {
|
|
255
319
|
readonly input: {
|
|
256
320
|
readonly updateId: string;
|
|
@@ -326,6 +390,25 @@ export type CatalogOperationTypes = {
|
|
|
326
390
|
readonly output: unknown;
|
|
327
391
|
readonly faults: 'NotFound';
|
|
328
392
|
};
|
|
393
|
+
'weft.workflows.activities.pending.list': {
|
|
394
|
+
readonly input: {
|
|
395
|
+
readonly cursor?: string;
|
|
396
|
+
readonly limit: number;
|
|
397
|
+
readonly workflowId: string;
|
|
398
|
+
};
|
|
399
|
+
readonly output: {
|
|
400
|
+
readonly items: ReadonlyArray<{
|
|
401
|
+
readonly activityName: string;
|
|
402
|
+
readonly attempt: number;
|
|
403
|
+
readonly createdAt: number;
|
|
404
|
+
readonly operationId: string;
|
|
405
|
+
readonly step: number;
|
|
406
|
+
readonly token: string;
|
|
407
|
+
}>;
|
|
408
|
+
readonly nextCursor?: string;
|
|
409
|
+
};
|
|
410
|
+
readonly faults: 'InvalidParams' | 'NotFound';
|
|
411
|
+
};
|
|
329
412
|
'weft.workflows.aggregate': {
|
|
330
413
|
readonly input: {
|
|
331
414
|
readonly attributes?: ReadonlyArray<{
|
|
@@ -342,6 +425,9 @@ export type CatalogOperationTypes = {
|
|
|
342
425
|
readonly groupBy: unknown;
|
|
343
426
|
readonly idPrefix?: string;
|
|
344
427
|
readonly limit?: number;
|
|
428
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
429
|
+
readonly parentWorkflowId?: string;
|
|
430
|
+
readonly scheduleId?: string;
|
|
345
431
|
readonly status?: unknown;
|
|
346
432
|
readonly tags?: ReadonlyArray<string>;
|
|
347
433
|
readonly type?: string;
|
|
@@ -375,17 +461,17 @@ export type CatalogOperationTypes = {
|
|
|
375
461
|
readonly faults: never;
|
|
376
462
|
};
|
|
377
463
|
'weft.workflows.bulk.cancel': {
|
|
378
|
-
readonly input:
|
|
464
|
+
readonly input: SharedAttributesBulkConcurrenc_f62debcf;
|
|
379
465
|
readonly output: unknown;
|
|
380
466
|
readonly faults: never;
|
|
381
467
|
};
|
|
382
468
|
'weft.workflows.bulk.delete': {
|
|
383
|
-
readonly input:
|
|
469
|
+
readonly input: SharedAttributesBulkConcurrenc_f62debcf;
|
|
384
470
|
readonly output: unknown;
|
|
385
471
|
readonly faults: 'Unprocessable';
|
|
386
472
|
};
|
|
387
473
|
'weft.workflows.bulk.retryfailed': {
|
|
388
|
-
readonly input:
|
|
474
|
+
readonly input: SharedAttributesBulkConcurrenc_f62debcf;
|
|
389
475
|
readonly output: unknown;
|
|
390
476
|
readonly faults: never;
|
|
391
477
|
};
|
|
@@ -402,8 +488,11 @@ export type CatalogOperationTypes = {
|
|
|
402
488
|
readonly limit?: number;
|
|
403
489
|
readonly name: string;
|
|
404
490
|
readonly offset?: number;
|
|
491
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
492
|
+
readonly parentWorkflowId?: string;
|
|
405
493
|
readonly payload?: unknown;
|
|
406
494
|
readonly requestId?: string;
|
|
495
|
+
readonly scheduleId?: string;
|
|
407
496
|
readonly status?: unknown;
|
|
408
497
|
readonly tags?: ReadonlyArray<string>;
|
|
409
498
|
readonly type?: string;
|
|
@@ -417,7 +506,7 @@ export type CatalogOperationTypes = {
|
|
|
417
506
|
readonly bulkConcurrency?: number;
|
|
418
507
|
readonly confirmationToken?: string;
|
|
419
508
|
readonly dryRun?: boolean;
|
|
420
|
-
readonly filter?:
|
|
509
|
+
readonly filter?: SharedAttributesCreatedAtExecu_2af7f9ff;
|
|
421
510
|
readonly operation: 'add' | 'remove';
|
|
422
511
|
readonly requestId?: string;
|
|
423
512
|
readonly tags: ReadonlyArray<string>;
|
|
@@ -454,6 +543,13 @@ export type CatalogOperationTypes = {
|
|
|
454
543
|
readonly output: unknown;
|
|
455
544
|
readonly faults: 'NotFound';
|
|
456
545
|
};
|
|
546
|
+
'weft.workflows.finalizer.get': {
|
|
547
|
+
readonly input: {
|
|
548
|
+
readonly workflowId: string;
|
|
549
|
+
};
|
|
550
|
+
readonly output: unknown;
|
|
551
|
+
readonly faults: never;
|
|
552
|
+
};
|
|
457
553
|
'weft.workflows.fork': {
|
|
458
554
|
readonly input: {
|
|
459
555
|
readonly fromStep?: unknown;
|
|
@@ -481,6 +577,9 @@ export type CatalogOperationTypes = {
|
|
|
481
577
|
readonly include?: unknown;
|
|
482
578
|
readonly limit?: number;
|
|
483
579
|
readonly offset?: number;
|
|
580
|
+
readonly parentWorkflowExecutionToken?: string;
|
|
581
|
+
readonly parentWorkflowId?: string;
|
|
582
|
+
readonly scheduleId?: string;
|
|
484
583
|
readonly status?: unknown;
|
|
485
584
|
readonly tags?: ReadonlyArray<string>;
|
|
486
585
|
readonly type?: string;
|
|
@@ -490,7 +589,7 @@ export type CatalogOperationTypes = {
|
|
|
490
589
|
readonly faults: 'Unprocessable';
|
|
491
590
|
};
|
|
492
591
|
'weft.workflows.purge': {
|
|
493
|
-
readonly input:
|
|
592
|
+
readonly input: SharedAttributesCreatedAtExecu_2af7f9ff;
|
|
494
593
|
readonly output: unknown;
|
|
495
594
|
readonly faults: never;
|
|
496
595
|
};
|
|
@@ -527,6 +626,13 @@ export type CatalogOperationTypes = {
|
|
|
527
626
|
};
|
|
528
627
|
readonly faults: 'Conflict' | 'NotFound';
|
|
529
628
|
};
|
|
629
|
+
'weft.workflows.scheduleprovenance.get': {
|
|
630
|
+
readonly input: {
|
|
631
|
+
readonly workflowId: string;
|
|
632
|
+
};
|
|
633
|
+
readonly output: unknown;
|
|
634
|
+
readonly faults: never;
|
|
635
|
+
};
|
|
530
636
|
'weft.workflows.signal': {
|
|
531
637
|
readonly input: {
|
|
532
638
|
readonly payload?: unknown;
|
|
@@ -645,6 +751,8 @@ export type CatalogOperationTypes = {
|
|
|
645
751
|
readonly faults: 'Timeout' | 'Unprocessable';
|
|
646
752
|
};
|
|
647
753
|
};
|
|
754
|
+
export type CatalogOperationTypes = Pick<ClientOperationTypes, CatalogOperationName>;
|
|
648
755
|
export type WeftClient = CatalogWeftClient<CatalogOperationTypes>;
|
|
756
|
+
export type ClientOperations = CatalogWeftClient<ClientOperationTypes>;
|
|
649
757
|
export declare function createWeftClient(connection?: WeftClientConnection): WeftClient;
|
|
650
758
|
export {};
|
|
@@ -17,6 +17,8 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
17
17
|
"weft.schedules.pause",
|
|
18
18
|
"weft.schedules.resume",
|
|
19
19
|
"weft.schedules.update",
|
|
20
|
+
"weft.storage.capabilities",
|
|
21
|
+
"weft.system.lease",
|
|
20
22
|
"weft.system.metrics",
|
|
21
23
|
"weft.system.registry",
|
|
22
24
|
"weft.task.queues.list",
|
|
@@ -27,6 +29,7 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
27
29
|
"weft.workers.drain",
|
|
28
30
|
"weft.workers.list",
|
|
29
31
|
"weft.workers.resume",
|
|
32
|
+
"weft.workflows.activities.pending.list",
|
|
30
33
|
"weft.workflows.aggregate",
|
|
31
34
|
"weft.workflows.attributes.get",
|
|
32
35
|
"weft.workflows.attributes.set",
|
|
@@ -39,6 +42,7 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
39
42
|
"weft.workflows.checkpoints.get",
|
|
40
43
|
"weft.workflows.checkpoints.list",
|
|
41
44
|
"weft.workflows.events.list",
|
|
45
|
+
"weft.workflows.finalizer.get",
|
|
42
46
|
"weft.workflows.fork",
|
|
43
47
|
"weft.workflows.get",
|
|
44
48
|
"weft.workflows.list",
|
|
@@ -47,6 +51,7 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
47
51
|
"weft.workflows.replay",
|
|
48
52
|
"weft.workflows.result.get",
|
|
49
53
|
"weft.workflows.resume",
|
|
54
|
+
"weft.workflows.scheduleprovenance.get",
|
|
50
55
|
"weft.workflows.signal",
|
|
51
56
|
"weft.workflows.start",
|
|
52
57
|
"weft.workflows.startorsignal",
|
|
@@ -57,7 +62,75 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
57
62
|
"weft.workflows.timeline.get",
|
|
58
63
|
"weft.workflows.timeout",
|
|
59
64
|
"weft.workflows.update"
|
|
60
|
-
]
|
|
65
|
+
], CLIENT_OPERATION_NAMES = [
|
|
66
|
+
"weft.activities.complete",
|
|
67
|
+
"weft.activities.fail",
|
|
68
|
+
"weft.recover.all",
|
|
69
|
+
"weft.retention.get",
|
|
70
|
+
"weft.reviews.decision.submit",
|
|
71
|
+
"weft.reviews.get",
|
|
72
|
+
"weft.reviews.list",
|
|
73
|
+
"weft.schedules.cancel",
|
|
74
|
+
"weft.schedules.create",
|
|
75
|
+
"weft.schedules.get",
|
|
76
|
+
"weft.schedules.list",
|
|
77
|
+
"weft.schedules.pause",
|
|
78
|
+
"weft.schedules.resume",
|
|
79
|
+
"weft.schedules.update",
|
|
80
|
+
"weft.storage.capabilities",
|
|
81
|
+
"weft.system.lease",
|
|
82
|
+
"weft.system.metrics",
|
|
83
|
+
"weft.system.registry",
|
|
84
|
+
"weft.task.queues.list",
|
|
85
|
+
"weft.tasks.diagnostics",
|
|
86
|
+
"weft.tasks.diagnostics.deadletters.clear",
|
|
87
|
+
"weft.updates.result.get",
|
|
88
|
+
"weft.worker.deployments.drain",
|
|
89
|
+
"weft.worker.deployments.resume",
|
|
90
|
+
"weft.workers.drain",
|
|
91
|
+
"weft.workers.list",
|
|
92
|
+
"weft.workers.resume",
|
|
93
|
+
"weft.workflows.activities.pending.list",
|
|
94
|
+
"weft.workflows.aggregate",
|
|
95
|
+
"weft.workflows.attributes.get",
|
|
96
|
+
"weft.workflows.attributes.set",
|
|
97
|
+
"weft.workflows.bulk.cancel",
|
|
98
|
+
"weft.workflows.bulk.delete",
|
|
99
|
+
"weft.workflows.bulk.retryfailed",
|
|
100
|
+
"weft.workflows.bulk.signal",
|
|
101
|
+
"weft.workflows.bulk.tags",
|
|
102
|
+
"weft.workflows.cancel",
|
|
103
|
+
"weft.workflows.checkpoints.get",
|
|
104
|
+
"weft.workflows.checkpoints.list",
|
|
105
|
+
"weft.workflows.events.list",
|
|
106
|
+
"weft.workflows.finalizer.get",
|
|
107
|
+
"weft.workflows.fork",
|
|
108
|
+
"weft.workflows.get",
|
|
109
|
+
"weft.workflows.list",
|
|
110
|
+
"weft.workflows.purge",
|
|
111
|
+
"weft.workflows.query",
|
|
112
|
+
"weft.workflows.replay",
|
|
113
|
+
"weft.workflows.result.get",
|
|
114
|
+
"weft.workflows.resume",
|
|
115
|
+
"weft.workflows.scheduleprovenance.get",
|
|
116
|
+
"weft.workflows.signal",
|
|
117
|
+
"weft.workflows.start",
|
|
118
|
+
"weft.workflows.startorsignal",
|
|
119
|
+
"weft.workflows.streams.chunks",
|
|
120
|
+
"weft.workflows.suspend",
|
|
121
|
+
"weft.workflows.tags.add",
|
|
122
|
+
"weft.workflows.tags.remove",
|
|
123
|
+
"weft.workflows.timeline.get",
|
|
124
|
+
"weft.workflows.timeout",
|
|
125
|
+
"weft.workflows.update"
|
|
126
|
+
], CLIENT_REST_OPERATION_BINDINGS = {
|
|
127
|
+
"weft.tasks.diagnostics.deadletters.clear": {
|
|
128
|
+
method: "DELETE",
|
|
129
|
+
path: "/tasks/diagnostics/dead-letter/:operationId",
|
|
130
|
+
inputSources: { operationId: { kind: "path", pathParam: "operationId" } },
|
|
131
|
+
success: { kind: "json", status: 200 }
|
|
132
|
+
}
|
|
133
|
+
};
|
|
61
134
|
export function createWeftClient(connection = {}) {
|
|
62
135
|
return createCatalogWeftClient(CATALOG_OPERATION_NAMES, httpJsonRpcTransport(connection));
|
|
63
136
|
}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import type { OperationKind, TransportAvailability } from '../server/operation-catalog.ts';
|
|
1
|
+
import type { ErasedOperation, OperationKind, TransportAvailability } from '../server/operation-catalog.ts';
|
|
2
2
|
import type { FaultCode } from '../server/operation-fault.ts';
|
|
3
|
+
import type { ParamSource, ResponseShape } from '../server/rest-binding.ts';
|
|
4
|
+
export type CatalogRestBindingSnapshot = {
|
|
5
|
+
readonly method: string;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly inputSources: Readonly<Record<string, ParamSource>>;
|
|
8
|
+
readonly success: ResponseShape;
|
|
9
|
+
};
|
|
3
10
|
export type CatalogAccessSnapshot = {
|
|
4
11
|
readonly kind: 'public';
|
|
5
12
|
} | {
|
|
@@ -36,11 +43,13 @@ export type CatalogOperationSnapshot = {
|
|
|
36
43
|
readonly inputSchema: Record<string, unknown>;
|
|
37
44
|
readonly outputSchema: Record<string, unknown>;
|
|
38
45
|
readonly eventSchema?: Record<string, unknown>;
|
|
46
|
+
/** Declarative REST route metadata for generated client transports. */
|
|
47
|
+
readonly rest?: CatalogRestBindingSnapshot;
|
|
39
48
|
};
|
|
40
49
|
export type CatalogSnapshot = {
|
|
41
50
|
readonly generatedBy: 'weft catalog snapshot';
|
|
42
51
|
readonly version: 1;
|
|
43
52
|
readonly operations: ReadonlyArray<CatalogOperationSnapshot>;
|
|
44
53
|
};
|
|
45
|
-
export declare function createCatalogSnapshot(): CatalogSnapshot;
|
|
54
|
+
export declare function createCatalogSnapshot(sourceOperations?: ReadonlyArray<ErasedOperation>): CatalogSnapshot;
|
|
46
55
|
export declare function stringifyCatalogSnapshot(snapshot: CatalogSnapshot): string;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { definitionSchemaToJsonSchema } from "../core/types/definition-schema-to-json.js";
|
|
2
2
|
import { compareStrings, normalizeJsonObject } from "../server/json-schema-utilities.js";
|
|
3
|
-
import { createLiveOperationRegistry } from "../server/rest-bindings.js";
|
|
4
|
-
export function createCatalogSnapshot() {
|
|
3
|
+
import { createLiveOperationRegistry, createLiveRestBindings } from "../server/rest-bindings.js";
|
|
4
|
+
export function createCatalogSnapshot(sourceOperations = createLiveOperationRegistry().list()) {
|
|
5
|
+
const restBindings = new Map(createLiveRestBindings().map((binding) => [binding.operationName, binding]));
|
|
5
6
|
return {
|
|
6
7
|
generatedBy: "weft catalog snapshot",
|
|
7
8
|
version: 1,
|
|
8
|
-
operations:
|
|
9
|
+
operations: sourceOperations.map((operation) => operationToSnapshot(operation, (operation.kind ?? "unary") === "unary" && operation.transports.http && !operation.transports.jsonRpcHttp && !operation.tags.includes("Storage") ? restBindings.get(operation.name) : void 0)).toSorted((left, right) => compareStrings(left.name, right.name))
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
export function stringifyCatalogSnapshot(snapshot) {
|
|
12
13
|
return `${JSON.stringify(snapshot, null, 2)}
|
|
13
14
|
`;
|
|
14
15
|
}
|
|
15
|
-
function operationToSnapshot(operation) {
|
|
16
|
+
function operationToSnapshot(operation, restBinding) {
|
|
16
17
|
const eventSchema = operation.eventSchema;
|
|
17
18
|
return {
|
|
18
19
|
name: operation.name,
|
|
@@ -27,7 +28,15 @@ function operationToSnapshot(operation) {
|
|
|
27
28
|
producibleFaults: [...operation.producibleFaults ?? []].toSorted(compareStrings),
|
|
28
29
|
inputSchema: normalizeJsonObject(definitionSchemaToJsonSchema(operation.inputSchema, "input")),
|
|
29
30
|
outputSchema: normalizeJsonObject(definitionSchemaToJsonSchema(operation.outputSchema, "output")),
|
|
30
|
-
...eventSchema === void 0 ? {} : { eventSchema: normalizeJsonObject(definitionSchemaToJsonSchema(eventSchema, "output")) }
|
|
31
|
+
...eventSchema === void 0 ? {} : { eventSchema: normalizeJsonObject(definitionSchemaToJsonSchema(eventSchema, "output")) },
|
|
32
|
+
...restBinding === void 0 ? {} : {
|
|
33
|
+
rest: {
|
|
34
|
+
method: restBinding.method,
|
|
35
|
+
path: restBinding.path,
|
|
36
|
+
inputSources: Object.fromEntries(Object.entries(restBinding.inputSources).filter((entry) => entry[1] !== void 0)),
|
|
37
|
+
success: { ...restBinding.success }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
31
40
|
};
|
|
32
41
|
}
|
|
33
42
|
function parameterizedAccessToSnapshot(hint) {
|
|
@@ -33,6 +33,35 @@ export type WeftClientConnection = ConnectionOptions;
|
|
|
33
33
|
* one generated surface instead of drifting apart.
|
|
34
34
|
*/
|
|
35
35
|
export type CatalogTransport = (operationName: string, input: unknown) => Promise<unknown>;
|
|
36
|
+
/** Generated metadata needed to map a typed client operation onto REST. */
|
|
37
|
+
export type ClientRestOperationBinding = {
|
|
38
|
+
readonly method: string;
|
|
39
|
+
readonly path: string;
|
|
40
|
+
readonly inputSources: Readonly<Record<string, {
|
|
41
|
+
readonly kind: 'path';
|
|
42
|
+
readonly pathParam: string;
|
|
43
|
+
} | {
|
|
44
|
+
readonly kind: 'query';
|
|
45
|
+
readonly queryParam: string;
|
|
46
|
+
readonly repeating?: boolean;
|
|
47
|
+
} | {
|
|
48
|
+
readonly kind: 'header';
|
|
49
|
+
readonly headerName: string;
|
|
50
|
+
} | {
|
|
51
|
+
readonly kind: 'body';
|
|
52
|
+
readonly mediaType?: 'application/json';
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: 'body-field';
|
|
55
|
+
readonly bodyField: string;
|
|
56
|
+
}>>;
|
|
57
|
+
readonly success: {
|
|
58
|
+
readonly kind: 'json';
|
|
59
|
+
readonly status: number;
|
|
60
|
+
} | {
|
|
61
|
+
readonly kind: 'empty';
|
|
62
|
+
readonly status: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
36
65
|
/**
|
|
37
66
|
* Build a catalog client from a list of operation names and a transport. Each
|
|
38
67
|
* name becomes a method that forwards its input through the transport, so the
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type BatchOperation, type ConditionalBatchCondition, type ScanOptions, type Storage } from '../storage/interface.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Byte-oriented raw storage surface shared by local and HTTP clients.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { Engine, LocalClient, MemoryStorage, type WeftClientStorage } from '@lostgradient/weft';
|
|
8
|
+
*
|
|
9
|
+
* await using engine = new Engine({ storage: new MemoryStorage() });
|
|
10
|
+
* const client = new LocalClient(engine);
|
|
11
|
+
* const storage: WeftClientStorage = client.storage;
|
|
12
|
+
* await storage.put('example:key', new TextEncoder().encode('value'));
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export interface WeftClientStorage {
|
|
16
|
+
get(key: string): Promise<Uint8Array | null>;
|
|
17
|
+
put(key: string, value: Uint8Array): Promise<void>;
|
|
18
|
+
delete(key: string): Promise<void>;
|
|
19
|
+
scan(prefix: string, options?: ScanOptions): AsyncIterable<[string, Uint8Array]>;
|
|
20
|
+
batch(operations: BatchOperation[]): Promise<void>;
|
|
21
|
+
conditionalBatch(conditions: ConditionalBatchCondition[], operations: BatchOperation[]): Promise<boolean>;
|
|
22
|
+
}
|
|
23
|
+
/** Adapt an engine-owned storage backend without exposing adapter-only methods. */
|
|
24
|
+
export declare function createLocalClientStorage(storage: Storage): WeftClientStorage;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
storageBatch,
|
|
3
|
+
storageConditionalBatch
|
|
4
|
+
} from "../storage/interface.js";
|
|
5
|
+
export function createLocalClientStorage(storage) {
|
|
6
|
+
return {
|
|
7
|
+
get: (key) => storage.get(key),
|
|
8
|
+
put: (key, value) => storage.put(key, value),
|
|
9
|
+
delete: (key) => storage.delete(key),
|
|
10
|
+
scan: (prefix, options) => storage.scan(prefix, options),
|
|
11
|
+
batch: (operations) => storageBatch(storage, operations),
|
|
12
|
+
conditionalBatch: (conditions, operations) => storageConditionalBatch(storage, conditions, operations)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { WeftEventMap } from '../core/events.ts';
|
|
2
|
-
import type { QueryDefinition, ScheduleSpec, ScheduleSummary, SearchAttributeValue, SignalDefinition, SignalDeliveryOptions, UpdateDefinition } from '../core/types.ts';
|
|
2
|
+
import type { QueryDefinition, ScheduleSpec, ScheduleSummary, ScheduleUpdateOptions, SearchAttributeValue, SignalDefinition, SignalDeliveryOptions, UpdateDefinition } from '../core/types.ts';
|
|
3
3
|
import type { WorkflowEventTail } from './event-tail.ts';
|
|
4
4
|
import type { ClientHandle, ClientScheduleHandle, StartOrSignalOutcome } from './interface.ts';
|
|
5
5
|
export interface WorkflowHandleDelegationClient {
|
|
@@ -62,7 +62,7 @@ export interface ScheduleHandleDelegationClient {
|
|
|
62
62
|
pauseSchedule(id: string): Promise<void>;
|
|
63
63
|
resumeSchedule(id: string): Promise<void>;
|
|
64
64
|
cancelSchedule(id: string): Promise<void>;
|
|
65
|
-
updateSchedule(id: string, newSpec: string | ScheduleSpec): Promise<void>;
|
|
65
|
+
updateSchedule(id: string, newSpec: string | ScheduleSpec, options?: ScheduleUpdateOptions): Promise<void>;
|
|
66
66
|
getSchedule(id: string): Promise<ScheduleSummary | null>;
|
|
67
67
|
}
|
|
68
68
|
export declare abstract class ScheduleHandleDelegation<TClient extends ScheduleHandleDelegationClient = ScheduleHandleDelegationClient> implements ClientScheduleHandle {
|
|
@@ -72,7 +72,7 @@ export declare abstract class ScheduleHandleDelegation<TClient extends ScheduleH
|
|
|
72
72
|
pause(): Promise<void>;
|
|
73
73
|
resume(): Promise<void>;
|
|
74
74
|
cancel(): Promise<void>;
|
|
75
|
-
update(newSpec: string | ScheduleSpec): Promise<void>;
|
|
75
|
+
update(newSpec: string | ScheduleSpec, options?: ScheduleUpdateOptions): Promise<void>;
|
|
76
76
|
describe(): Promise<ScheduleSummary | null>;
|
|
77
77
|
abstract [Symbol.dispose](): void;
|
|
78
78
|
}
|
|
@@ -65,8 +65,8 @@ export class ScheduleHandleDelegation {
|
|
|
65
65
|
async cancel() {
|
|
66
66
|
return this.client.cancelSchedule(this.id);
|
|
67
67
|
}
|
|
68
|
-
async update(newSpec) {
|
|
69
|
-
return this.client.updateSchedule(this.id, newSpec);
|
|
68
|
+
async update(newSpec, options) {
|
|
69
|
+
return this.client.updateSchedule(this.id, newSpec, options);
|
|
70
70
|
}
|
|
71
71
|
async describe() {
|
|
72
72
|
return this.client.getSchedule(this.id);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StoredStreamChunk } from '../core/context.ts';
|
|
2
|
-
import type { BulkCancelResult, BulkDeleteResult, BulkRetryFailedResult, BulkSignalResult, BulkTagResult, CoordinatedUpdateResult, ForkOptions, ListFilter, PurgeResult, RetentionOverview, ReviewListEntry, ReviewListFilter, ScheduleSpec, ScheduleSummary, SearchAttributeValue, SignalDeliveryOptions, SubmitReviewOptions, WorkflowReplay, WorkflowState, WorkflowTimelineEntry } from '../core/types.ts';
|
|
2
|
+
import type { BulkCancelResult, BulkDeleteResult, BulkRetryFailedResult, BulkSignalResult, BulkTagResult, CoordinatedUpdateResult, ForkOptions, ListFilter, PendingAsyncActivityListOptions, PendingAsyncActivityPage, PurgeResult, RetentionOverview, ReviewListEntry, ReviewListFilter, ScheduleSpec, ScheduleSummary, ScheduleUpdateOptions, SearchAttributeValue, SignalDeliveryOptions, SubmitReviewOptions, WorkflowReplay, WorkflowState, WorkflowTimelineEntry } from '../core/types.ts';
|
|
3
3
|
import type { UpdateResult } from './interface.ts';
|
|
4
4
|
export type HttpClientRequestContext = {
|
|
5
5
|
readonly baseUrl: string;
|
|
@@ -37,6 +37,8 @@ export declare function signalWorkflowRequest(context: HttpClientRequestContext,
|
|
|
37
37
|
* workflow with `result`. Mirrors `LocalClient.activity.complete` over HTTP.
|
|
38
38
|
*/
|
|
39
39
|
export declare function completeAsyncActivityRequest(context: HttpClientRequestContext, token: string, result?: unknown): Promise<void>;
|
|
40
|
+
/** List durable async activities awaiting completion for one workflow. */
|
|
41
|
+
export declare function listPendingAsyncActivitiesRequest(context: HttpClientRequestContext, workflowId: string, options?: PendingAsyncActivityListOptions): Promise<PendingAsyncActivityPage>;
|
|
40
42
|
/**
|
|
41
43
|
* Fail a deferred ("async") activity by task token. A live `Error` cannot cross
|
|
42
44
|
* the wire, so the error is reduced to `message` + `name` — exactly the fields
|
|
@@ -59,8 +61,8 @@ export declare function pauseScheduleRequest(context: HttpClientRequestContext,
|
|
|
59
61
|
export declare function resumeScheduleRequest(context: HttpClientRequestContext, id: string): Promise<void>;
|
|
60
62
|
/** Cancel a recurring schedule (`DELETE /v1/schedules/:id`). */
|
|
61
63
|
export declare function cancelScheduleRequest(context: HttpClientRequestContext, id: string): Promise<void>;
|
|
62
|
-
/** Update a schedule's
|
|
63
|
-
export declare function updateScheduleRequest(context: HttpClientRequestContext, id: string, newSpec: string | ScheduleSpec): Promise<void>;
|
|
64
|
+
/** Update a schedule's cadence and mutable options (`PATCH /v1/schedules/:id`). */
|
|
65
|
+
export declare function updateScheduleRequest(context: HttpClientRequestContext, id: string, newSpec: string | ScheduleSpec, options?: ScheduleUpdateOptions): Promise<void>;
|
|
64
66
|
/**
|
|
65
67
|
* Query a named read-only accessor on a workflow. A no-input query is a GET;
|
|
66
68
|
* an input payload is sent as a POST body.
|
|
@@ -139,6 +139,15 @@ export async function completeAsyncActivityRequest(context, token, result) {
|
|
|
139
139
|
body: JSON.stringify({ token, result })
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
+
export async function listPendingAsyncActivitiesRequest(context, workflowId, options) {
|
|
143
|
+
const search = new URLSearchParams;
|
|
144
|
+
if (options?.limit !== void 0)
|
|
145
|
+
search.set("limit", String(options.limit));
|
|
146
|
+
if (options?.cursor !== void 0)
|
|
147
|
+
search.set("cursor", options.cursor);
|
|
148
|
+
const query = search.size > 0 ? `?${search.toString()}` : "";
|
|
149
|
+
return request(context.baseUrl, `/workflows/${encodeURIComponent(workflowId)}/pending-async-activities${query}`, context.headers);
|
|
150
|
+
}
|
|
142
151
|
export async function failAsyncActivityRequest(context, token, error) {
|
|
143
152
|
const reduced = { message: error instanceof Error ? error.message : String(error) };
|
|
144
153
|
if (error instanceof Error)
|
|
@@ -176,10 +185,19 @@ export function cancelScheduleRequest(context, id) {
|
|
|
176
185
|
method: "DELETE"
|
|
177
186
|
});
|
|
178
187
|
}
|
|
179
|
-
export function updateScheduleRequest(context, id, newSpec) {
|
|
188
|
+
export function updateScheduleRequest(context, id, newSpec, options) {
|
|
189
|
+
const body = scheduleSpecToWireFields(newSpec);
|
|
190
|
+
if (options?.description !== void 0)
|
|
191
|
+
body.description = options.description;
|
|
192
|
+
if (options?.overlap !== void 0)
|
|
193
|
+
body.overlap = options.overlap;
|
|
194
|
+
if (options?.backfill !== void 0)
|
|
195
|
+
body.backfill = options.backfill;
|
|
196
|
+
if (options?.jitter !== void 0)
|
|
197
|
+
body.jitter = options.jitter;
|
|
180
198
|
return request(context.baseUrl, `/schedules/${encodeURIComponent(id)}`, context.headers, {
|
|
181
199
|
method: "PATCH",
|
|
182
|
-
body: JSON.stringify(
|
|
200
|
+
body: JSON.stringify(body)
|
|
183
201
|
});
|
|
184
202
|
}
|
|
185
203
|
export async function queryWorkflowRequest(context, id, name, input) {
|