@temporal-contract/client 0.0.1 → 0.0.3
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 +11 -70
- package/dist/index.cjs +50 -80
- package/dist/index.d.cts +11 -10
- package/dist/index.d.mts +11 -10
- package/dist/index.mjs +50 -80
- package/package.json +9 -6
- package/.turbo/turbo-build.log +0 -17
- package/src/client.spec.ts +0 -564
- package/src/client.ts +0 -390
- package/src/errors.ts +0 -80
- package/src/index.ts +0 -9
- package/tsconfig.json +0 -9
package/README.md
CHANGED
|
@@ -2,96 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
> Type-safe client for consuming Temporal workflows
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/@temporal-contract/client)
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
pnpm add @temporal-contract/client @temporal-contract/contract @temporalio/client zod
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
## Quick
|
|
13
|
+
## Quick Example
|
|
12
14
|
|
|
13
15
|
```typescript
|
|
14
|
-
import { Connection } from '@temporalio/client';
|
|
15
16
|
import { TypedClient } from '@temporal-contract/client';
|
|
16
|
-
import {
|
|
17
|
+
import { Connection } from '@temporalio/client';
|
|
17
18
|
|
|
18
|
-
// Connect to Temporal
|
|
19
19
|
const connection = await Connection.connect({ address: 'localhost:7233' });
|
|
20
|
-
|
|
21
|
-
// Create typed client
|
|
22
|
-
const client = TypedClient.create(myContract, {
|
|
23
|
-
connection,
|
|
24
|
-
namespace: 'default',
|
|
25
|
-
});
|
|
20
|
+
const client = TypedClient.create(myContract, { connection });
|
|
26
21
|
|
|
27
22
|
// Execute workflow (fully typed!)
|
|
28
23
|
const result = await client.executeWorkflow('processOrder', {
|
|
29
24
|
workflowId: 'order-123',
|
|
30
|
-
args: { orderId: 'ORD-123'
|
|
25
|
+
args: { orderId: 'ORD-123' }
|
|
31
26
|
});
|
|
32
|
-
|
|
33
|
-
console.log(result.status); // 'success' | 'failed' — typed!
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## API
|
|
37
|
-
|
|
38
|
-
### `TypedClient.create(contract, options)`
|
|
39
|
-
|
|
40
|
-
Creates a type-safe Temporal client.
|
|
41
|
-
|
|
42
|
-
**Returns:** Type-safe client with these methods:
|
|
43
|
-
|
|
44
|
-
#### `executeWorkflow(name, options)`
|
|
45
|
-
|
|
46
|
-
Execute and wait for result:
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
const result = await client.executeWorkflow('processOrder', {
|
|
50
|
-
workflowId: 'order-123',
|
|
51
|
-
args: { orderId: 'ORD-123', customerId: 'CUST-456' },
|
|
52
|
-
});
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
#### `startWorkflow(name, options)` / `getHandle(name, workflowId)`
|
|
56
|
-
|
|
57
|
-
Get a typed workflow handle for signals/queries/updates:
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
const handle = await client.startWorkflow('processOrder', {
|
|
61
|
-
workflowId: 'order-456',
|
|
62
|
-
args: { orderId: 'ORD-456' },
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
// Type-safe queries, signals, updates
|
|
66
|
-
await handle.queries.getStatus();
|
|
67
|
-
await handle.signals.cancel({ reason: 'Customer request' });
|
|
68
|
-
await handle.updates.changeAmount({ newAmount: 150 });
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Error Handling
|
|
72
|
-
|
|
73
|
-
Custom error classes with contextual information:
|
|
74
|
-
|
|
75
|
-
```typescript
|
|
76
|
-
import { WorkflowValidationError, WorkflowNotFoundError } from '@temporal-contract/client';
|
|
77
|
-
|
|
78
|
-
try {
|
|
79
|
-
await client.executeWorkflow('processOrder', { args: invalidData });
|
|
80
|
-
} catch (error) {
|
|
81
|
-
if (error instanceof WorkflowValidationError) {
|
|
82
|
-
console.error('Validation:', error.zodError.errors);
|
|
83
|
-
} else if (error instanceof WorkflowNotFoundError) {
|
|
84
|
-
console.error('Available:', error.availableWorkflows);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
27
|
```
|
|
88
28
|
|
|
89
|
-
|
|
29
|
+
## Documentation
|
|
90
30
|
|
|
91
|
-
|
|
31
|
+
📖 **[Read the full documentation →](https://btravers.github.io/temporal-contract)**
|
|
92
32
|
|
|
93
|
-
- [
|
|
94
|
-
- [
|
|
33
|
+
- [API Reference](https://btravers.github.io/temporal-contract/api/client)
|
|
34
|
+
- [Getting Started](https://btravers.github.io/temporal-contract/guide/getting-started)
|
|
35
|
+
- [Examples](https://btravers.github.io/temporal-contract/examples/)
|
|
95
36
|
|
|
96
37
|
## License
|
|
97
38
|
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
let __temporalio_client = require("@temporalio/client");
|
|
2
|
-
let zod = require("zod");
|
|
3
2
|
|
|
4
3
|
//#region src/errors.ts
|
|
5
4
|
/**
|
|
@@ -16,9 +15,11 @@ var TypedClientError = class extends Error {
|
|
|
16
15
|
* Error thrown when a workflow is not found in the contract
|
|
17
16
|
*/
|
|
18
17
|
var WorkflowNotFoundError = class extends TypedClientError {
|
|
19
|
-
constructor(workflowName) {
|
|
20
|
-
|
|
18
|
+
constructor(workflowName, availableWorkflows = []) {
|
|
19
|
+
const message = availableWorkflows.length > 0 ? `Workflow "${workflowName}" not found in contract. Available workflows: ${availableWorkflows.join(", ")}` : `Workflow "${workflowName}" not found in contract`;
|
|
20
|
+
super(message);
|
|
21
21
|
this.workflowName = workflowName;
|
|
22
|
+
this.availableWorkflows = availableWorkflows;
|
|
22
23
|
this.name = "WorkflowNotFoundError";
|
|
23
24
|
}
|
|
24
25
|
};
|
|
@@ -26,11 +27,12 @@ var WorkflowNotFoundError = class extends TypedClientError {
|
|
|
26
27
|
* Error thrown when workflow input or output validation fails
|
|
27
28
|
*/
|
|
28
29
|
var WorkflowValidationError = class extends TypedClientError {
|
|
29
|
-
constructor(workflowName, phase,
|
|
30
|
-
|
|
30
|
+
constructor(workflowName, phase, issues) {
|
|
31
|
+
const message = issues.map((issue) => issue.message).join("; ");
|
|
32
|
+
super(`Validation failed for workflow "${workflowName}" ${phase}: ${message}`);
|
|
31
33
|
this.workflowName = workflowName;
|
|
32
34
|
this.phase = phase;
|
|
33
|
-
this.
|
|
35
|
+
this.issues = issues;
|
|
34
36
|
this.name = "WorkflowValidationError";
|
|
35
37
|
}
|
|
36
38
|
};
|
|
@@ -38,11 +40,12 @@ var WorkflowValidationError = class extends TypedClientError {
|
|
|
38
40
|
* Error thrown when query input or output validation fails
|
|
39
41
|
*/
|
|
40
42
|
var QueryValidationError = class extends TypedClientError {
|
|
41
|
-
constructor(queryName, phase,
|
|
42
|
-
|
|
43
|
+
constructor(queryName, phase, issues) {
|
|
44
|
+
const message = issues.map((issue) => issue.message).join("; ");
|
|
45
|
+
super(`Validation failed for query "${queryName}" ${phase}: ${message}`);
|
|
43
46
|
this.queryName = queryName;
|
|
44
47
|
this.phase = phase;
|
|
45
|
-
this.
|
|
48
|
+
this.issues = issues;
|
|
46
49
|
this.name = "QueryValidationError";
|
|
47
50
|
}
|
|
48
51
|
};
|
|
@@ -50,10 +53,11 @@ var QueryValidationError = class extends TypedClientError {
|
|
|
50
53
|
* Error thrown when signal input validation fails
|
|
51
54
|
*/
|
|
52
55
|
var SignalValidationError = class extends TypedClientError {
|
|
53
|
-
constructor(signalName,
|
|
54
|
-
|
|
56
|
+
constructor(signalName, issues) {
|
|
57
|
+
const message = issues.map((issue) => issue.message).join("; ");
|
|
58
|
+
super(`Validation failed for signal "${signalName}" input: ${message}`);
|
|
55
59
|
this.signalName = signalName;
|
|
56
|
-
this.
|
|
60
|
+
this.issues = issues;
|
|
57
61
|
this.name = "SignalValidationError";
|
|
58
62
|
}
|
|
59
63
|
};
|
|
@@ -61,11 +65,12 @@ var SignalValidationError = class extends TypedClientError {
|
|
|
61
65
|
* Error thrown when update input or output validation fails
|
|
62
66
|
*/
|
|
63
67
|
var UpdateValidationError = class extends TypedClientError {
|
|
64
|
-
constructor(updateName, phase,
|
|
65
|
-
|
|
68
|
+
constructor(updateName, phase, issues) {
|
|
69
|
+
const message = issues.map((issue) => issue.message).join("; ");
|
|
70
|
+
super(`Validation failed for update "${updateName}" ${phase}: ${message}`);
|
|
66
71
|
this.updateName = updateName;
|
|
67
72
|
this.phase = phase;
|
|
68
|
-
this.
|
|
73
|
+
this.issues = issues;
|
|
69
74
|
this.name = "UpdateValidationError";
|
|
70
75
|
}
|
|
71
76
|
};
|
|
@@ -120,14 +125,10 @@ var TypedClient = class TypedClient {
|
|
|
120
125
|
*/
|
|
121
126
|
async startWorkflow(workflowName, { args, ...temporalOptions }) {
|
|
122
127
|
const definition = this.contract.workflows[workflowName];
|
|
123
|
-
if (!definition) throw new WorkflowNotFoundError(String(workflowName));
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
} catch (error) {
|
|
128
|
-
if (error instanceof zod.ZodError) throw new WorkflowValidationError(String(workflowName), "input", error);
|
|
129
|
-
throw error;
|
|
130
|
-
}
|
|
128
|
+
if (!definition) throw new WorkflowNotFoundError(String(workflowName), Object.keys(this.contract.workflows));
|
|
129
|
+
const inputResult = await definition.input["~standard"].validate(args);
|
|
130
|
+
if (inputResult.issues) throw new WorkflowValidationError(String(workflowName), "input", inputResult.issues);
|
|
131
|
+
const validatedInput = inputResult.value;
|
|
131
132
|
const handle = await this.client.workflow.start(workflowName, {
|
|
132
133
|
...temporalOptions,
|
|
133
134
|
taskQueue: this.contract.taskQueue,
|
|
@@ -152,25 +153,18 @@ var TypedClient = class TypedClient {
|
|
|
152
153
|
*/
|
|
153
154
|
async executeWorkflow(workflowName, { args, ...temporalOptions }) {
|
|
154
155
|
const definition = this.contract.workflows[workflowName];
|
|
155
|
-
if (!definition) throw new WorkflowNotFoundError(String(workflowName));
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
} catch (error) {
|
|
160
|
-
if (error instanceof zod.ZodError) throw new WorkflowValidationError(String(workflowName), "input", error);
|
|
161
|
-
throw error;
|
|
162
|
-
}
|
|
156
|
+
if (!definition) throw new WorkflowNotFoundError(String(workflowName), Object.keys(this.contract.workflows));
|
|
157
|
+
const inputResult = await definition.input["~standard"].validate(args);
|
|
158
|
+
if (inputResult.issues) throw new WorkflowValidationError(String(workflowName), "input", inputResult.issues);
|
|
159
|
+
const validatedInput = inputResult.value;
|
|
163
160
|
const result = await this.client.workflow.execute(workflowName, {
|
|
164
161
|
...temporalOptions,
|
|
165
162
|
taskQueue: this.contract.taskQueue,
|
|
166
163
|
args: [validatedInput]
|
|
167
164
|
});
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (error instanceof zod.ZodError) throw new WorkflowValidationError(String(workflowName), "output", error);
|
|
172
|
-
throw error;
|
|
173
|
-
}
|
|
165
|
+
const outputResult = await definition.output["~standard"].validate(result);
|
|
166
|
+
if (outputResult.issues) throw new WorkflowValidationError(String(workflowName), "output", outputResult.issues);
|
|
167
|
+
return outputResult.value;
|
|
174
168
|
}
|
|
175
169
|
/**
|
|
176
170
|
* Get a handle to an existing workflow
|
|
@@ -183,55 +177,34 @@ var TypedClient = class TypedClient {
|
|
|
183
177
|
*/
|
|
184
178
|
async getHandle(workflowName, workflowId) {
|
|
185
179
|
const definition = this.contract.workflows[workflowName];
|
|
186
|
-
if (!definition) throw new WorkflowNotFoundError(String(workflowName));
|
|
180
|
+
if (!definition) throw new WorkflowNotFoundError(String(workflowName), Object.keys(this.contract.workflows));
|
|
187
181
|
const handle = this.client.workflow.getHandle(workflowId);
|
|
188
182
|
return this.createTypedHandle(handle, definition);
|
|
189
183
|
}
|
|
190
184
|
createTypedHandle(handle, definition) {
|
|
191
185
|
const queries = {};
|
|
192
186
|
for (const [queryName, queryDef] of Object.entries(definition.queries ?? {})) queries[queryName] = async (args) => {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
200
|
-
const result = await handle.query(queryName, validatedInput);
|
|
201
|
-
try {
|
|
202
|
-
return queryDef.output.parse(result);
|
|
203
|
-
} catch (error) {
|
|
204
|
-
if (error instanceof zod.ZodError) throw new QueryValidationError(queryName, "output", error);
|
|
205
|
-
throw error;
|
|
206
|
-
}
|
|
187
|
+
const inputResult = await queryDef.input["~standard"].validate(args);
|
|
188
|
+
if (inputResult.issues) throw new QueryValidationError(queryName, "input", inputResult.issues);
|
|
189
|
+
const result = await handle.query(queryName, inputResult.value);
|
|
190
|
+
const outputResult = await queryDef.output["~standard"].validate(result);
|
|
191
|
+
if (outputResult.issues) throw new QueryValidationError(queryName, "output", outputResult.issues);
|
|
192
|
+
return outputResult.value;
|
|
207
193
|
};
|
|
208
194
|
const signals = {};
|
|
209
195
|
for (const [signalName, signalDef] of Object.entries(definition.signals ?? {})) signals[signalName] = async (args) => {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
} catch (error) {
|
|
214
|
-
if (error instanceof zod.ZodError) throw new SignalValidationError(signalName, error);
|
|
215
|
-
throw error;
|
|
216
|
-
}
|
|
217
|
-
await handle.signal(signalName, validatedInput);
|
|
196
|
+
const inputResult = await signalDef.input["~standard"].validate(args);
|
|
197
|
+
if (inputResult.issues) throw new SignalValidationError(signalName, inputResult.issues);
|
|
198
|
+
await handle.signal(signalName, inputResult.value);
|
|
218
199
|
};
|
|
219
200
|
const updates = {};
|
|
220
201
|
for (const [updateName, updateDef] of Object.entries(definition.updates ?? {})) updates[updateName] = async (args) => {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
const result = await handle.executeUpdate(updateName, { args: [validatedInput] });
|
|
229
|
-
try {
|
|
230
|
-
return updateDef.output.parse(result);
|
|
231
|
-
} catch (error) {
|
|
232
|
-
if (error instanceof zod.ZodError) throw new UpdateValidationError(updateName, "output", error);
|
|
233
|
-
throw error;
|
|
234
|
-
}
|
|
202
|
+
const inputResult = await updateDef.input["~standard"].validate(args);
|
|
203
|
+
if (inputResult.issues) throw new UpdateValidationError(updateName, "input", inputResult.issues);
|
|
204
|
+
const result = await handle.executeUpdate(updateName, { args: [inputResult.value] });
|
|
205
|
+
const outputResult = await updateDef.output["~standard"].validate(result);
|
|
206
|
+
if (outputResult.issues) throw new UpdateValidationError(updateName, "output", outputResult.issues);
|
|
207
|
+
return outputResult.value;
|
|
235
208
|
};
|
|
236
209
|
return {
|
|
237
210
|
workflowId: handle.workflowId,
|
|
@@ -240,12 +213,9 @@ var TypedClient = class TypedClient {
|
|
|
240
213
|
updates,
|
|
241
214
|
result: async () => {
|
|
242
215
|
const result = await handle.result();
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
if (error instanceof zod.ZodError) throw new WorkflowValidationError(handle.workflowId, "output", error);
|
|
247
|
-
throw error;
|
|
248
|
-
}
|
|
216
|
+
const outputResult = await definition.output["~standard"].validate(result);
|
|
217
|
+
if (outputResult.issues) throw new WorkflowValidationError(handle.workflowId, "output", outputResult.issues);
|
|
218
|
+
return outputResult.value;
|
|
249
219
|
},
|
|
250
220
|
terminate: async (reason) => {
|
|
251
221
|
await handle.terminate(reason);
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClientOptions, WorkflowHandle, WorkflowOptions, WorkflowStartOptions } from "@temporalio/client";
|
|
2
2
|
import { ClientInferInput, ClientInferOutput, ClientInferWorkflowQueries, ClientInferWorkflowSignals, ClientInferWorkflowUpdates, ContractDefinition, WorkflowDefinition } from "@temporal-contract/contract";
|
|
3
|
-
import {
|
|
3
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
4
|
|
|
5
5
|
//#region src/client.d.ts
|
|
6
6
|
|
|
@@ -149,7 +149,8 @@ declare class TypedClientError extends Error {
|
|
|
149
149
|
*/
|
|
150
150
|
declare class WorkflowNotFoundError extends TypedClientError {
|
|
151
151
|
readonly workflowName: string;
|
|
152
|
-
|
|
152
|
+
readonly availableWorkflows: readonly string[];
|
|
153
|
+
constructor(workflowName: string, availableWorkflows?: readonly string[]);
|
|
153
154
|
}
|
|
154
155
|
/**
|
|
155
156
|
* Error thrown when workflow input or output validation fails
|
|
@@ -157,8 +158,8 @@ declare class WorkflowNotFoundError extends TypedClientError {
|
|
|
157
158
|
declare class WorkflowValidationError extends TypedClientError {
|
|
158
159
|
readonly workflowName: string;
|
|
159
160
|
readonly phase: "input" | "output";
|
|
160
|
-
readonly
|
|
161
|
-
constructor(workflowName: string, phase: "input" | "output",
|
|
161
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
162
|
+
constructor(workflowName: string, phase: "input" | "output", issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
162
163
|
}
|
|
163
164
|
/**
|
|
164
165
|
* Error thrown when query input or output validation fails
|
|
@@ -166,16 +167,16 @@ declare class WorkflowValidationError extends TypedClientError {
|
|
|
166
167
|
declare class QueryValidationError extends TypedClientError {
|
|
167
168
|
readonly queryName: string;
|
|
168
169
|
readonly phase: "input" | "output";
|
|
169
|
-
readonly
|
|
170
|
-
constructor(queryName: string, phase: "input" | "output",
|
|
170
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
171
|
+
constructor(queryName: string, phase: "input" | "output", issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
171
172
|
}
|
|
172
173
|
/**
|
|
173
174
|
* Error thrown when signal input validation fails
|
|
174
175
|
*/
|
|
175
176
|
declare class SignalValidationError extends TypedClientError {
|
|
176
177
|
readonly signalName: string;
|
|
177
|
-
readonly
|
|
178
|
-
constructor(signalName: string,
|
|
178
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
179
|
+
constructor(signalName: string, issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
179
180
|
}
|
|
180
181
|
/**
|
|
181
182
|
* Error thrown when update input or output validation fails
|
|
@@ -183,8 +184,8 @@ declare class SignalValidationError extends TypedClientError {
|
|
|
183
184
|
declare class UpdateValidationError extends TypedClientError {
|
|
184
185
|
readonly updateName: string;
|
|
185
186
|
readonly phase: "input" | "output";
|
|
186
|
-
readonly
|
|
187
|
-
constructor(updateName: string, phase: "input" | "output",
|
|
187
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
188
|
+
constructor(updateName: string, phase: "input" | "output", issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
188
189
|
}
|
|
189
190
|
//#endregion
|
|
190
191
|
export { QueryValidationError, SignalValidationError, TypedClient, TypedClientError, type TypedWorkflowHandle, type TypedWorkflowStartOptions, UpdateValidationError, WorkflowNotFoundError, WorkflowValidationError };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ClientOptions, WorkflowHandle, WorkflowOptions, WorkflowStartOptions } from "@temporalio/client";
|
|
2
|
-
import { z } from "zod";
|
|
3
2
|
import { ClientInferInput, ClientInferOutput, ClientInferWorkflowQueries, ClientInferWorkflowSignals, ClientInferWorkflowUpdates, ContractDefinition, WorkflowDefinition } from "@temporal-contract/contract";
|
|
3
|
+
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
4
4
|
|
|
5
5
|
//#region src/client.d.ts
|
|
6
6
|
|
|
@@ -149,7 +149,8 @@ declare class TypedClientError extends Error {
|
|
|
149
149
|
*/
|
|
150
150
|
declare class WorkflowNotFoundError extends TypedClientError {
|
|
151
151
|
readonly workflowName: string;
|
|
152
|
-
|
|
152
|
+
readonly availableWorkflows: readonly string[];
|
|
153
|
+
constructor(workflowName: string, availableWorkflows?: readonly string[]);
|
|
153
154
|
}
|
|
154
155
|
/**
|
|
155
156
|
* Error thrown when workflow input or output validation fails
|
|
@@ -157,8 +158,8 @@ declare class WorkflowNotFoundError extends TypedClientError {
|
|
|
157
158
|
declare class WorkflowValidationError extends TypedClientError {
|
|
158
159
|
readonly workflowName: string;
|
|
159
160
|
readonly phase: "input" | "output";
|
|
160
|
-
readonly
|
|
161
|
-
constructor(workflowName: string, phase: "input" | "output",
|
|
161
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
162
|
+
constructor(workflowName: string, phase: "input" | "output", issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
162
163
|
}
|
|
163
164
|
/**
|
|
164
165
|
* Error thrown when query input or output validation fails
|
|
@@ -166,16 +167,16 @@ declare class WorkflowValidationError extends TypedClientError {
|
|
|
166
167
|
declare class QueryValidationError extends TypedClientError {
|
|
167
168
|
readonly queryName: string;
|
|
168
169
|
readonly phase: "input" | "output";
|
|
169
|
-
readonly
|
|
170
|
-
constructor(queryName: string, phase: "input" | "output",
|
|
170
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
171
|
+
constructor(queryName: string, phase: "input" | "output", issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
171
172
|
}
|
|
172
173
|
/**
|
|
173
174
|
* Error thrown when signal input validation fails
|
|
174
175
|
*/
|
|
175
176
|
declare class SignalValidationError extends TypedClientError {
|
|
176
177
|
readonly signalName: string;
|
|
177
|
-
readonly
|
|
178
|
-
constructor(signalName: string,
|
|
178
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
179
|
+
constructor(signalName: string, issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
179
180
|
}
|
|
180
181
|
/**
|
|
181
182
|
* Error thrown when update input or output validation fails
|
|
@@ -183,8 +184,8 @@ declare class SignalValidationError extends TypedClientError {
|
|
|
183
184
|
declare class UpdateValidationError extends TypedClientError {
|
|
184
185
|
readonly updateName: string;
|
|
185
186
|
readonly phase: "input" | "output";
|
|
186
|
-
readonly
|
|
187
|
-
constructor(updateName: string, phase: "input" | "output",
|
|
187
|
+
readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
|
|
188
|
+
constructor(updateName: string, phase: "input" | "output", issues: ReadonlyArray<StandardSchemaV1.Issue>);
|
|
188
189
|
}
|
|
189
190
|
//#endregion
|
|
190
191
|
export { QueryValidationError, SignalValidationError, TypedClient, TypedClientError, type TypedWorkflowHandle, type TypedWorkflowStartOptions, UpdateValidationError, WorkflowNotFoundError, WorkflowValidationError };
|