@lostgradient/weft 0.19.0 → 0.20.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/dist/cli/generated/operation-catalog.snapshot.json +1334 -0
- package/dist/cli/generated/operation-client.generated.d.ts +9 -2
- package/dist/cli/generated/operation-client.generated.js +2 -0
- package/dist/server/operations/get-task-detail-schema.d.ts +341 -0
- package/dist/server/operations/get-task-detail-schema.js +118 -0
- package/dist/server/operations/get-task-detail.d.ts +346 -0
- package/dist/server/operations/get-task-detail.js +215 -0
- package/dist/server/operations/static-registrations.js +3 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
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.alerts.list", "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.principal", "weft.system.registry", "weft.task.queues.list", "weft.tasks.diagnostics", "weft.updates.result.get", "weft.worker.deployments.drain", "weft.worker.deployments.resume", "weft.workers.diagnostics", "weft.workers.drain", "weft.workers.list", "weft.workers.rejections", "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"];
|
|
2
|
+
export declare const CATALOG_OPERATION_NAMES: readonly ["weft.activities.complete", "weft.activities.fail", "weft.alerts.list", "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.principal", "weft.system.registry", "weft.task.queues.list", "weft.tasks.diagnostics", "weft.tasks.get", "weft.updates.result.get", "weft.worker.deployments.drain", "weft.worker.deployments.resume", "weft.workers.diagnostics", "weft.workers.drain", "weft.workers.list", "weft.workers.rejections", "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
|
-
export declare const CLIENT_OPERATION_NAMES: readonly ["weft.activities.complete", "weft.activities.fail", "weft.alerts.list", "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.principal", "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.diagnostics", "weft.workers.drain", "weft.workers.list", "weft.workers.rejections", "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"];
|
|
4
|
+
export declare const CLIENT_OPERATION_NAMES: readonly ["weft.activities.complete", "weft.activities.fail", "weft.alerts.list", "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.principal", "weft.system.registry", "weft.task.queues.list", "weft.tasks.diagnostics", "weft.tasks.diagnostics.deadletters.clear", "weft.tasks.get", "weft.updates.result.get", "weft.worker.deployments.drain", "weft.worker.deployments.resume", "weft.workers.diagnostics", "weft.workers.drain", "weft.workers.list", "weft.workers.rejections", "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
5
|
export type ClientOperationName = (typeof CLIENT_OPERATION_NAMES)[number];
|
|
6
6
|
export declare const CLIENT_REST_OPERATION_BINDINGS: {
|
|
7
7
|
readonly 'weft.tasks.diagnostics.deadletters.clear': {
|
|
@@ -337,6 +337,13 @@ export type ClientOperationTypes = {
|
|
|
337
337
|
};
|
|
338
338
|
readonly faults: 'NotFound';
|
|
339
339
|
};
|
|
340
|
+
'weft.tasks.get': {
|
|
341
|
+
readonly input: {
|
|
342
|
+
readonly operationId: string;
|
|
343
|
+
};
|
|
344
|
+
readonly output: unknown;
|
|
345
|
+
readonly faults: 'NotFound';
|
|
346
|
+
};
|
|
340
347
|
'weft.updates.result.get': {
|
|
341
348
|
readonly input: {
|
|
342
349
|
readonly updateId: string;
|
|
@@ -25,6 +25,7 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
25
25
|
"weft.system.registry",
|
|
26
26
|
"weft.task.queues.list",
|
|
27
27
|
"weft.tasks.diagnostics",
|
|
28
|
+
"weft.tasks.get",
|
|
28
29
|
"weft.updates.result.get",
|
|
29
30
|
"weft.worker.deployments.drain",
|
|
30
31
|
"weft.worker.deployments.resume",
|
|
@@ -90,6 +91,7 @@ export const CATALOG_OPERATION_NAMES = [
|
|
|
90
91
|
"weft.task.queues.list",
|
|
91
92
|
"weft.tasks.diagnostics",
|
|
92
93
|
"weft.tasks.diagnostics.deadletters.clear",
|
|
94
|
+
"weft.tasks.get",
|
|
93
95
|
"weft.updates.result.get",
|
|
94
96
|
"weft.worker.deployments.drain",
|
|
95
97
|
"weft.worker.deployments.resume",
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schema definitions for `weft.tasks.get` (WFT-92), split out of
|
|
3
|
+
* `get-task-detail.ts` purely to stay under this repo's 500-line-per-file
|
|
4
|
+
* ceiling — see `task-ledger-transitions.ts`/`task-ledger-transitions-cancellation.ts`
|
|
5
|
+
* for the identical precedent. `get-task-detail.ts` re-exports everything a
|
|
6
|
+
* consumer needs, so callers import from one canonical module.
|
|
7
|
+
*
|
|
8
|
+
* @module server/operations/get-task-detail-schema
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
export declare const getTaskDetailInput: z.ZodObject<{
|
|
12
|
+
operationId: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const retryPolicySchema: z.ZodObject<{
|
|
15
|
+
maxAttempts: z.ZodNumber;
|
|
16
|
+
initialBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
17
|
+
backoffMultiplier: z.ZodNumber;
|
|
18
|
+
maxBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
19
|
+
nonRetryableErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
20
|
+
}, z.core.$strict>;
|
|
21
|
+
export declare const executionRequirementSchema: z.ZodObject<{
|
|
22
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
23
|
+
buildId: z.ZodOptional<z.ZodString>;
|
|
24
|
+
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
25
|
+
workflowRevision: z.ZodOptional<z.ZodString>;
|
|
26
|
+
activityContractHash: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
/** Exported for direct schema-level tests; the operation itself uses this via `outputSchema`. */
|
|
29
|
+
export declare const getTaskDetailOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
30
|
+
state: z.ZodLiteral<"queued">;
|
|
31
|
+
availableAt: z.ZodNumber;
|
|
32
|
+
firstQueuedAt: z.ZodNumber;
|
|
33
|
+
lastQueuedAt: z.ZodNumber;
|
|
34
|
+
lastDispatchedAt: z.ZodOptional<z.ZodNumber>;
|
|
35
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
retryCount: z.ZodNumber;
|
|
37
|
+
requeueCount: z.ZodNumber;
|
|
38
|
+
lastRequeueReason: z.ZodOptional<z.ZodString>;
|
|
39
|
+
operationId: z.ZodString;
|
|
40
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
41
|
+
workflowExecutionToken: z.ZodOptional<z.ZodString>;
|
|
42
|
+
workflowType: z.ZodString;
|
|
43
|
+
activityName: z.ZodString;
|
|
44
|
+
queue: z.ZodString;
|
|
45
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
46
|
+
headerKeys: z.ZodArray<z.ZodString>;
|
|
47
|
+
visibilityTimeoutMilliseconds: z.ZodNumber;
|
|
48
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
49
|
+
maxAttempts: z.ZodNumber;
|
|
50
|
+
initialBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
51
|
+
backoffMultiplier: z.ZodNumber;
|
|
52
|
+
maxBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
53
|
+
nonRetryableErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
scheduleToCloseDeadline: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
executionRequirement: z.ZodOptional<z.ZodObject<{
|
|
57
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
58
|
+
buildId: z.ZodOptional<z.ZodString>;
|
|
59
|
+
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
60
|
+
workflowRevision: z.ZodOptional<z.ZodString>;
|
|
61
|
+
activityContractHash: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
fairShareKey: z.ZodOptional<z.ZodString>;
|
|
64
|
+
stickyWorkflowId: z.ZodOptional<z.ZodString>;
|
|
65
|
+
createdAt: z.ZodNumber;
|
|
66
|
+
attempt: z.ZodNumber;
|
|
67
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
68
|
+
leaseDeadline: z.ZodNumber;
|
|
69
|
+
firstQueuedAt: z.ZodNumber;
|
|
70
|
+
lastQueuedAt: z.ZodNumber;
|
|
71
|
+
startedAt: z.ZodNumber;
|
|
72
|
+
lastHeartbeatAt: z.ZodNumber;
|
|
73
|
+
state: z.ZodLiteral<"leased">;
|
|
74
|
+
retryCount: z.ZodNumber;
|
|
75
|
+
requeueCount: z.ZodNumber;
|
|
76
|
+
lastRequeueReason: z.ZodOptional<z.ZodString>;
|
|
77
|
+
operationId: z.ZodString;
|
|
78
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
79
|
+
workflowExecutionToken: z.ZodOptional<z.ZodString>;
|
|
80
|
+
workflowType: z.ZodString;
|
|
81
|
+
activityName: z.ZodString;
|
|
82
|
+
queue: z.ZodString;
|
|
83
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
headerKeys: z.ZodArray<z.ZodString>;
|
|
85
|
+
visibilityTimeoutMilliseconds: z.ZodNumber;
|
|
86
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
87
|
+
maxAttempts: z.ZodNumber;
|
|
88
|
+
initialBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
89
|
+
backoffMultiplier: z.ZodNumber;
|
|
90
|
+
maxBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
91
|
+
nonRetryableErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
scheduleToCloseDeadline: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
executionRequirement: z.ZodOptional<z.ZodObject<{
|
|
95
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
96
|
+
buildId: z.ZodOptional<z.ZodString>;
|
|
97
|
+
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
98
|
+
workflowRevision: z.ZodOptional<z.ZodString>;
|
|
99
|
+
activityContractHash: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$strict>>;
|
|
101
|
+
fairShareKey: z.ZodOptional<z.ZodString>;
|
|
102
|
+
stickyWorkflowId: z.ZodOptional<z.ZodString>;
|
|
103
|
+
createdAt: z.ZodNumber;
|
|
104
|
+
attempt: z.ZodNumber;
|
|
105
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
106
|
+
pendingStatus: z.ZodEnum<{
|
|
107
|
+
completed: "completed";
|
|
108
|
+
failed: "failed";
|
|
109
|
+
}>;
|
|
110
|
+
resultDigest: z.ZodString;
|
|
111
|
+
leaseDeadline: z.ZodNumber;
|
|
112
|
+
firstQueuedAt: z.ZodNumber;
|
|
113
|
+
lastQueuedAt: z.ZodNumber;
|
|
114
|
+
startedAt: z.ZodNumber;
|
|
115
|
+
lastHeartbeatAt: z.ZodNumber;
|
|
116
|
+
state: z.ZodLiteral<"completing">;
|
|
117
|
+
retryCount: z.ZodNumber;
|
|
118
|
+
requeueCount: z.ZodNumber;
|
|
119
|
+
lastRequeueReason: z.ZodOptional<z.ZodString>;
|
|
120
|
+
operationId: z.ZodString;
|
|
121
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
122
|
+
workflowExecutionToken: z.ZodOptional<z.ZodString>;
|
|
123
|
+
workflowType: z.ZodString;
|
|
124
|
+
activityName: z.ZodString;
|
|
125
|
+
queue: z.ZodString;
|
|
126
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
headerKeys: z.ZodArray<z.ZodString>;
|
|
128
|
+
visibilityTimeoutMilliseconds: z.ZodNumber;
|
|
129
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
maxAttempts: z.ZodNumber;
|
|
131
|
+
initialBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
132
|
+
backoffMultiplier: z.ZodNumber;
|
|
133
|
+
maxBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
134
|
+
nonRetryableErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
135
|
+
}, z.core.$strict>>;
|
|
136
|
+
scheduleToCloseDeadline: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
executionRequirement: z.ZodOptional<z.ZodObject<{
|
|
138
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
139
|
+
buildId: z.ZodOptional<z.ZodString>;
|
|
140
|
+
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
141
|
+
workflowRevision: z.ZodOptional<z.ZodString>;
|
|
142
|
+
activityContractHash: z.ZodOptional<z.ZodString>;
|
|
143
|
+
}, z.core.$strict>>;
|
|
144
|
+
fairShareKey: z.ZodOptional<z.ZodString>;
|
|
145
|
+
stickyWorkflowId: z.ZodOptional<z.ZodString>;
|
|
146
|
+
createdAt: z.ZodNumber;
|
|
147
|
+
attempt: z.ZodNumber;
|
|
148
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
149
|
+
cancellationReason: z.ZodString;
|
|
150
|
+
cancellationRequestedAt: z.ZodNumber;
|
|
151
|
+
leaseDeadline: z.ZodNumber;
|
|
152
|
+
firstQueuedAt: z.ZodNumber;
|
|
153
|
+
lastQueuedAt: z.ZodNumber;
|
|
154
|
+
startedAt: z.ZodNumber;
|
|
155
|
+
lastHeartbeatAt: z.ZodNumber;
|
|
156
|
+
state: z.ZodLiteral<"cancelling">;
|
|
157
|
+
retryCount: z.ZodNumber;
|
|
158
|
+
requeueCount: z.ZodNumber;
|
|
159
|
+
lastRequeueReason: z.ZodOptional<z.ZodString>;
|
|
160
|
+
operationId: z.ZodString;
|
|
161
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
162
|
+
workflowExecutionToken: z.ZodOptional<z.ZodString>;
|
|
163
|
+
workflowType: z.ZodString;
|
|
164
|
+
activityName: z.ZodString;
|
|
165
|
+
queue: z.ZodString;
|
|
166
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
headerKeys: z.ZodArray<z.ZodString>;
|
|
168
|
+
visibilityTimeoutMilliseconds: z.ZodNumber;
|
|
169
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
170
|
+
maxAttempts: z.ZodNumber;
|
|
171
|
+
initialBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
172
|
+
backoffMultiplier: z.ZodNumber;
|
|
173
|
+
maxBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
174
|
+
nonRetryableErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
175
|
+
}, z.core.$strict>>;
|
|
176
|
+
scheduleToCloseDeadline: z.ZodOptional<z.ZodNumber>;
|
|
177
|
+
executionRequirement: z.ZodOptional<z.ZodObject<{
|
|
178
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
179
|
+
buildId: z.ZodOptional<z.ZodString>;
|
|
180
|
+
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
181
|
+
workflowRevision: z.ZodOptional<z.ZodString>;
|
|
182
|
+
activityContractHash: z.ZodOptional<z.ZodString>;
|
|
183
|
+
}, z.core.$strict>>;
|
|
184
|
+
fairShareKey: z.ZodOptional<z.ZodString>;
|
|
185
|
+
stickyWorkflowId: z.ZodOptional<z.ZodString>;
|
|
186
|
+
createdAt: z.ZodNumber;
|
|
187
|
+
attempt: z.ZodNumber;
|
|
188
|
+
}, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
189
|
+
disposition: z.ZodLiteral<"resolved">;
|
|
190
|
+
resultDigest: z.ZodString;
|
|
191
|
+
resultStatus: z.ZodEnum<{
|
|
192
|
+
completed: "completed";
|
|
193
|
+
failed: "failed";
|
|
194
|
+
}>;
|
|
195
|
+
error: z.ZodOptional<z.ZodString>;
|
|
196
|
+
state: z.ZodLiteral<"terminal">;
|
|
197
|
+
terminalAt: z.ZodNumber;
|
|
198
|
+
adopted: z.ZodBoolean;
|
|
199
|
+
adoptedAt: z.ZodOptional<z.ZodNumber>;
|
|
200
|
+
operationId: z.ZodString;
|
|
201
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
202
|
+
workflowExecutionToken: z.ZodOptional<z.ZodString>;
|
|
203
|
+
workflowType: z.ZodString;
|
|
204
|
+
activityName: z.ZodString;
|
|
205
|
+
queue: z.ZodString;
|
|
206
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
207
|
+
headerKeys: z.ZodArray<z.ZodString>;
|
|
208
|
+
visibilityTimeoutMilliseconds: z.ZodNumber;
|
|
209
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
210
|
+
maxAttempts: z.ZodNumber;
|
|
211
|
+
initialBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
212
|
+
backoffMultiplier: z.ZodNumber;
|
|
213
|
+
maxBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
214
|
+
nonRetryableErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
215
|
+
}, z.core.$strict>>;
|
|
216
|
+
scheduleToCloseDeadline: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
executionRequirement: z.ZodOptional<z.ZodObject<{
|
|
218
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
219
|
+
buildId: z.ZodOptional<z.ZodString>;
|
|
220
|
+
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
221
|
+
workflowRevision: z.ZodOptional<z.ZodString>;
|
|
222
|
+
activityContractHash: z.ZodOptional<z.ZodString>;
|
|
223
|
+
}, z.core.$strict>>;
|
|
224
|
+
fairShareKey: z.ZodOptional<z.ZodString>;
|
|
225
|
+
stickyWorkflowId: z.ZodOptional<z.ZodString>;
|
|
226
|
+
createdAt: z.ZodNumber;
|
|
227
|
+
attempt: z.ZodNumber;
|
|
228
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
229
|
+
disposition: z.ZodLiteral<"cancelled">;
|
|
230
|
+
cancellationReason: z.ZodString;
|
|
231
|
+
state: z.ZodLiteral<"terminal">;
|
|
232
|
+
terminalAt: z.ZodNumber;
|
|
233
|
+
adopted: z.ZodBoolean;
|
|
234
|
+
adoptedAt: z.ZodOptional<z.ZodNumber>;
|
|
235
|
+
operationId: z.ZodString;
|
|
236
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
237
|
+
workflowExecutionToken: z.ZodOptional<z.ZodString>;
|
|
238
|
+
workflowType: z.ZodString;
|
|
239
|
+
activityName: z.ZodString;
|
|
240
|
+
queue: z.ZodString;
|
|
241
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
242
|
+
headerKeys: z.ZodArray<z.ZodString>;
|
|
243
|
+
visibilityTimeoutMilliseconds: z.ZodNumber;
|
|
244
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
245
|
+
maxAttempts: z.ZodNumber;
|
|
246
|
+
initialBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
247
|
+
backoffMultiplier: z.ZodNumber;
|
|
248
|
+
maxBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
249
|
+
nonRetryableErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
250
|
+
}, z.core.$strict>>;
|
|
251
|
+
scheduleToCloseDeadline: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
executionRequirement: z.ZodOptional<z.ZodObject<{
|
|
253
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
254
|
+
buildId: z.ZodOptional<z.ZodString>;
|
|
255
|
+
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
256
|
+
workflowRevision: z.ZodOptional<z.ZodString>;
|
|
257
|
+
activityContractHash: z.ZodOptional<z.ZodString>;
|
|
258
|
+
}, z.core.$strict>>;
|
|
259
|
+
fairShareKey: z.ZodOptional<z.ZodString>;
|
|
260
|
+
stickyWorkflowId: z.ZodOptional<z.ZodString>;
|
|
261
|
+
createdAt: z.ZodNumber;
|
|
262
|
+
attempt: z.ZodNumber;
|
|
263
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
264
|
+
disposition: z.ZodLiteral<"retryExhausted">;
|
|
265
|
+
error: z.ZodString;
|
|
266
|
+
state: z.ZodLiteral<"terminal">;
|
|
267
|
+
terminalAt: z.ZodNumber;
|
|
268
|
+
adopted: z.ZodBoolean;
|
|
269
|
+
adoptedAt: z.ZodOptional<z.ZodNumber>;
|
|
270
|
+
operationId: z.ZodString;
|
|
271
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
272
|
+
workflowExecutionToken: z.ZodOptional<z.ZodString>;
|
|
273
|
+
workflowType: z.ZodString;
|
|
274
|
+
activityName: z.ZodString;
|
|
275
|
+
queue: z.ZodString;
|
|
276
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
277
|
+
headerKeys: z.ZodArray<z.ZodString>;
|
|
278
|
+
visibilityTimeoutMilliseconds: z.ZodNumber;
|
|
279
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
280
|
+
maxAttempts: z.ZodNumber;
|
|
281
|
+
initialBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
282
|
+
backoffMultiplier: z.ZodNumber;
|
|
283
|
+
maxBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
284
|
+
nonRetryableErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
285
|
+
}, z.core.$strict>>;
|
|
286
|
+
scheduleToCloseDeadline: z.ZodOptional<z.ZodNumber>;
|
|
287
|
+
executionRequirement: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
289
|
+
buildId: z.ZodOptional<z.ZodString>;
|
|
290
|
+
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
291
|
+
workflowRevision: z.ZodOptional<z.ZodString>;
|
|
292
|
+
activityContractHash: z.ZodOptional<z.ZodString>;
|
|
293
|
+
}, z.core.$strict>>;
|
|
294
|
+
fairShareKey: z.ZodOptional<z.ZodString>;
|
|
295
|
+
stickyWorkflowId: z.ZodOptional<z.ZodString>;
|
|
296
|
+
createdAt: z.ZodNumber;
|
|
297
|
+
attempt: z.ZodNumber;
|
|
298
|
+
}, z.core.$strict>], "disposition">, z.ZodObject<{
|
|
299
|
+
state: z.ZodLiteral<"deadLettered">;
|
|
300
|
+
pendingStatus: z.ZodEnum<{
|
|
301
|
+
completed: "completed";
|
|
302
|
+
failed: "failed";
|
|
303
|
+
}>;
|
|
304
|
+
resultDigest: z.ZodString;
|
|
305
|
+
deadLetteredAt: z.ZodNumber;
|
|
306
|
+
persistenceFailureReason: z.ZodString;
|
|
307
|
+
error: z.ZodOptional<z.ZodString>;
|
|
308
|
+
retryCount: z.ZodNumber;
|
|
309
|
+
requeueCount: z.ZodNumber;
|
|
310
|
+
lastRequeueReason: z.ZodOptional<z.ZodString>;
|
|
311
|
+
operationId: z.ZodString;
|
|
312
|
+
workflowId: z.ZodOptional<z.ZodString>;
|
|
313
|
+
workflowExecutionToken: z.ZodOptional<z.ZodString>;
|
|
314
|
+
workflowType: z.ZodString;
|
|
315
|
+
activityName: z.ZodString;
|
|
316
|
+
queue: z.ZodString;
|
|
317
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
318
|
+
headerKeys: z.ZodArray<z.ZodString>;
|
|
319
|
+
visibilityTimeoutMilliseconds: z.ZodNumber;
|
|
320
|
+
retryPolicy: z.ZodOptional<z.ZodObject<{
|
|
321
|
+
maxAttempts: z.ZodNumber;
|
|
322
|
+
initialBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
323
|
+
backoffMultiplier: z.ZodNumber;
|
|
324
|
+
maxBackoff: z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>;
|
|
325
|
+
nonRetryableErrors: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
326
|
+
}, z.core.$strict>>;
|
|
327
|
+
scheduleToCloseDeadline: z.ZodOptional<z.ZodNumber>;
|
|
328
|
+
executionRequirement: z.ZodOptional<z.ZodObject<{
|
|
329
|
+
deploymentName: z.ZodOptional<z.ZodString>;
|
|
330
|
+
buildId: z.ZodOptional<z.ZodString>;
|
|
331
|
+
artifactDigest: z.ZodOptional<z.ZodString>;
|
|
332
|
+
workflowRevision: z.ZodOptional<z.ZodString>;
|
|
333
|
+
activityContractHash: z.ZodOptional<z.ZodString>;
|
|
334
|
+
}, z.core.$strict>>;
|
|
335
|
+
fairShareKey: z.ZodOptional<z.ZodString>;
|
|
336
|
+
stickyWorkflowId: z.ZodOptional<z.ZodString>;
|
|
337
|
+
createdAt: z.ZodNumber;
|
|
338
|
+
attempt: z.ZodNumber;
|
|
339
|
+
}, z.core.$strict>], "state">;
|
|
340
|
+
export type GetTaskDetailInput = z.infer<typeof getTaskDetailInput>;
|
|
341
|
+
export type GetTaskDetailOutput = z.infer<typeof getTaskDetailOutputSchema>;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { MAX_TASK_IDENTIFIER_BYTES, utf8ByteLength } from "../task-ledger.js";
|
|
3
|
+
export const getTaskDetailInput = z.object({
|
|
4
|
+
operationId: z.string().min(1).refine((value) => utf8ByteLength(value) <= MAX_TASK_IDENTIFIER_BYTES, {
|
|
5
|
+
message: `operationId exceeds the ledger's ${MAX_TASK_IDENTIFIER_BYTES}-byte identifier limit`
|
|
6
|
+
})
|
|
7
|
+
});
|
|
8
|
+
const durationSchema = z.union([z.number(), z.string()]);
|
|
9
|
+
export const retryPolicySchema = z.object({
|
|
10
|
+
maxAttempts: z.number(),
|
|
11
|
+
initialBackoff: durationSchema,
|
|
12
|
+
backoffMultiplier: z.number(),
|
|
13
|
+
maxBackoff: durationSchema,
|
|
14
|
+
nonRetryableErrors: z.array(z.string()).optional()
|
|
15
|
+
}).strict(), executionRequirementSchema = z.object({
|
|
16
|
+
deploymentName: z.string().optional(),
|
|
17
|
+
buildId: z.string().optional(),
|
|
18
|
+
artifactDigest: z.string().optional(),
|
|
19
|
+
workflowRevision: z.string().optional(),
|
|
20
|
+
activityContractHash: z.string().optional()
|
|
21
|
+
}).strict();
|
|
22
|
+
const taskDetailBaseFields = {
|
|
23
|
+
operationId: z.string(),
|
|
24
|
+
workflowId: z.string().optional(),
|
|
25
|
+
workflowExecutionToken: z.string().optional(),
|
|
26
|
+
workflowType: z.string(),
|
|
27
|
+
activityName: z.string(),
|
|
28
|
+
queue: z.string(),
|
|
29
|
+
priority: z.number().optional(),
|
|
30
|
+
headerKeys: z.array(z.string()),
|
|
31
|
+
visibilityTimeoutMilliseconds: z.number(),
|
|
32
|
+
retryPolicy: retryPolicySchema.optional(),
|
|
33
|
+
scheduleToCloseDeadline: z.number().optional(),
|
|
34
|
+
executionRequirement: executionRequirementSchema.optional(),
|
|
35
|
+
fairShareKey: z.string().optional(),
|
|
36
|
+
stickyWorkflowId: z.string().optional(),
|
|
37
|
+
createdAt: z.number(),
|
|
38
|
+
attempt: z.number().int().nonnegative()
|
|
39
|
+
}, attemptSchemaFields = {
|
|
40
|
+
retryCount: z.number().int().nonnegative(),
|
|
41
|
+
requeueCount: z.number().int().nonnegative(),
|
|
42
|
+
lastRequeueReason: z.string().optional()
|
|
43
|
+
}, leaseHolderSchemaFields = {
|
|
44
|
+
leaseDeadline: z.number(),
|
|
45
|
+
firstQueuedAt: z.number(),
|
|
46
|
+
lastQueuedAt: z.number(),
|
|
47
|
+
startedAt: z.number(),
|
|
48
|
+
lastHeartbeatAt: z.number()
|
|
49
|
+
}, taskDetailQueuedSchema = z.object({
|
|
50
|
+
...taskDetailBaseFields,
|
|
51
|
+
...attemptSchemaFields,
|
|
52
|
+
state: z.literal("queued"),
|
|
53
|
+
availableAt: z.number(),
|
|
54
|
+
firstQueuedAt: z.number(),
|
|
55
|
+
lastQueuedAt: z.number(),
|
|
56
|
+
lastDispatchedAt: z.number().optional(),
|
|
57
|
+
startedAt: z.number().optional()
|
|
58
|
+
}).strict(), taskDetailLeasedSchema = z.object({
|
|
59
|
+
...taskDetailBaseFields,
|
|
60
|
+
...attemptSchemaFields,
|
|
61
|
+
state: z.literal("leased"),
|
|
62
|
+
...leaseHolderSchemaFields
|
|
63
|
+
}).strict(), taskDetailCompletingSchema = z.object({
|
|
64
|
+
...taskDetailBaseFields,
|
|
65
|
+
...attemptSchemaFields,
|
|
66
|
+
state: z.literal("completing"),
|
|
67
|
+
...leaseHolderSchemaFields,
|
|
68
|
+
pendingStatus: z.enum(["completed", "failed"]),
|
|
69
|
+
resultDigest: z.string()
|
|
70
|
+
}).strict(), taskDetailCancellingSchema = z.object({
|
|
71
|
+
...taskDetailBaseFields,
|
|
72
|
+
...attemptSchemaFields,
|
|
73
|
+
state: z.literal("cancelling"),
|
|
74
|
+
...leaseHolderSchemaFields,
|
|
75
|
+
cancellationReason: z.string(),
|
|
76
|
+
cancellationRequestedAt: z.number()
|
|
77
|
+
}).strict(), terminalCommonFields = {
|
|
78
|
+
...taskDetailBaseFields,
|
|
79
|
+
state: z.literal("terminal"),
|
|
80
|
+
terminalAt: z.number(),
|
|
81
|
+
adopted: z.boolean(),
|
|
82
|
+
adoptedAt: z.number().optional()
|
|
83
|
+
}, taskDetailTerminalResolvedSchema = z.object({
|
|
84
|
+
...terminalCommonFields,
|
|
85
|
+
disposition: z.literal("resolved"),
|
|
86
|
+
resultDigest: z.string(),
|
|
87
|
+
resultStatus: z.enum(["completed", "failed"]),
|
|
88
|
+
error: z.string().optional()
|
|
89
|
+
}).strict(), taskDetailTerminalCancelledSchema = z.object({
|
|
90
|
+
...terminalCommonFields,
|
|
91
|
+
disposition: z.literal("cancelled"),
|
|
92
|
+
cancellationReason: z.string()
|
|
93
|
+
}).strict(), taskDetailTerminalRetryExhaustedSchema = z.object({
|
|
94
|
+
...terminalCommonFields,
|
|
95
|
+
disposition: z.literal("retryExhausted"),
|
|
96
|
+
error: z.string()
|
|
97
|
+
}).strict(), taskDetailTerminalSchema = z.discriminatedUnion("disposition", [
|
|
98
|
+
taskDetailTerminalResolvedSchema,
|
|
99
|
+
taskDetailTerminalCancelledSchema,
|
|
100
|
+
taskDetailTerminalRetryExhaustedSchema
|
|
101
|
+
]), taskDetailDeadLetteredSchema = z.object({
|
|
102
|
+
...taskDetailBaseFields,
|
|
103
|
+
...attemptSchemaFields,
|
|
104
|
+
state: z.literal("deadLettered"),
|
|
105
|
+
pendingStatus: z.enum(["completed", "failed"]),
|
|
106
|
+
resultDigest: z.string(),
|
|
107
|
+
deadLetteredAt: z.number(),
|
|
108
|
+
persistenceFailureReason: z.string(),
|
|
109
|
+
error: z.string().optional()
|
|
110
|
+
}).strict();
|
|
111
|
+
export const getTaskDetailOutputSchema = z.discriminatedUnion("state", [
|
|
112
|
+
taskDetailQueuedSchema,
|
|
113
|
+
taskDetailLeasedSchema,
|
|
114
|
+
taskDetailCompletingSchema,
|
|
115
|
+
taskDetailCancellingSchema,
|
|
116
|
+
taskDetailTerminalSchema,
|
|
117
|
+
taskDetailDeadLetteredSchema
|
|
118
|
+
]);
|