@temporal-contract/client 0.1.0 → 1.0.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/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Future, Result } from "@swan-io/boxed";
2
- import { Client, WorkflowHandle, WorkflowStartOptions } from "@temporalio/client";
3
- import { ActivityDefinition, AnySchema, ContractDefinition, QueryDefinition, SignalDefinition, UpdateDefinition, WorkflowDefinition } from "@temporal-contract/contract";
2
+ import { Client, ScheduleClient, ScheduleDescription, ScheduleOptions, ScheduleOptionsStartWorkflowAction, ScheduleOverlapPolicy, ScheduleSpec, WorkflowHandle, WorkflowSignalWithStartOptions, WorkflowStartOptions } from "@temporalio/client";
3
+ import { ActivityDefinition, AnySchema, ContractDefinition, QueryDefinition, SearchAttributeDefinition, SearchAttributeKindToType, SignalDefinition, UpdateDefinition, WorkflowDefinition } from "@temporal-contract/contract";
4
4
  import { StandardSchemaV1 } from "@standard-schema/spec";
5
5
 
6
6
  //#region src/types.d.ts
@@ -103,6 +103,59 @@ declare class WorkflowNotFoundError extends TypedClientError {
103
103
  readonly availableWorkflows: string[];
104
104
  constructor(workflowName: string, availableWorkflows: string[]);
105
105
  }
106
+ /**
107
+ * Discriminated variant of {@link RuntimeClientError} surfaced when starting
108
+ * a workflow collides with an existing execution — Temporal's
109
+ * `WorkflowExecutionAlreadyStartedError`. The most common cause is a
110
+ * workflowId reuse policy that rejects duplicates while a previous run is
111
+ * still in retention.
112
+ *
113
+ * Distinguishing this from `RuntimeClientError` lets idempotent callers
114
+ * branch on it explicitly (e.g. fetch the existing handle and continue)
115
+ * without inspecting `error.cause` against a Temporal SDK class.
116
+ */
117
+ declare class WorkflowAlreadyStartedError extends TypedClientError {
118
+ readonly workflowType: string;
119
+ readonly workflowId: string;
120
+ readonly cause?: unknown | undefined;
121
+ constructor(workflowType: string, workflowId: string, cause?: unknown | undefined);
122
+ }
123
+ /**
124
+ * Discriminated variant of {@link RuntimeClientError} surfaced when an
125
+ * operation targets a workflow execution that doesn't exist in the
126
+ * namespace — Temporal's `WorkflowNotFoundError` (distinct from this
127
+ * package's contract-level {@link WorkflowNotFoundError}).
128
+ *
129
+ * Returned from:
130
+ * - handle methods: `signal`, `query`, `executeUpdate`, `result`,
131
+ * `terminate`, `cancel`, `describe`, `fetchHistory`
132
+ * - `executeWorkflow` (when the underlying execute call hits a missing
133
+ * execution mid-flight)
134
+ */
135
+ declare class WorkflowExecutionNotFoundError extends TypedClientError {
136
+ readonly workflowId: string;
137
+ readonly runId?: string | undefined;
138
+ readonly cause?: unknown | undefined;
139
+ constructor(workflowId: string, runId?: string | undefined, cause?: unknown | undefined);
140
+ }
141
+ /**
142
+ * Discriminated variant of {@link RuntimeClientError} surfaced when waiting
143
+ * on a workflow's result and the workflow completes with a failure —
144
+ * Temporal's `WorkflowFailedError`.
145
+ *
146
+ * `cause` is the *unwrapped* underlying failure (typically an
147
+ * `ApplicationFailure`, `CancelledFailure`, `TerminatedFailure`, or
148
+ * `TimeoutFailure`) lifted from Temporal's wrapper, so callers can branch
149
+ * on the failure category in one step (`err.cause instanceof
150
+ * ApplicationFailure`) instead of unwrapping twice via the SDK wrapper.
151
+ *
152
+ * Returned from `executeWorkflow` and `handle.result()`.
153
+ */
154
+ declare class WorkflowFailedError extends TypedClientError {
155
+ readonly workflowId: string;
156
+ readonly cause?: unknown | undefined;
157
+ constructor(workflowId: string, cause?: unknown | undefined);
158
+ }
106
159
  /**
107
160
  * Thrown when workflow input or output validation fails
108
161
  */
@@ -139,51 +192,177 @@ declare class UpdateValidationError extends TypedClientError {
139
192
  constructor(updateName: string, direction: "input" | "output", issues: ReadonlyArray<StandardSchemaV1.Issue>);
140
193
  }
141
194
  //#endregion
195
+ //#region src/schedule.d.ts
196
+ /**
197
+ * Workflow-action–level overrides forwarded to Temporal's
198
+ * `ScheduleOptionsStartWorkflowAction`. These live under a nested `action`
199
+ * field so the workflow-level `memo` (per-action workflow metadata) can be
200
+ * set independently from the schedule-level `memo` (metadata on the
201
+ * schedule itself) — Temporal honours both, and they have separate
202
+ * lifecycles.
203
+ *
204
+ * `workflowType` and `taskQueue` are owned by the contract and not exposed.
205
+ */
206
+ type TypedScheduleActionOverrides = Pick<ScheduleOptionsStartWorkflowAction<never>, "workflowId" | "workflowExecutionTimeout" | "workflowRunTimeout" | "workflowTaskTimeout" | "retry" | "memo" | "staticDetails" | "staticSummary">;
207
+ /**
208
+ * Options for {@link TypedScheduleClient.create}.
209
+ *
210
+ * `scheduleId` and `spec` come from Temporal's `ScheduleOptions`. `args` is
211
+ * typed against the destination workflow's input schema. `policies`,
212
+ * `state`, and `memo` mirror Temporal's own schedule-level options.
213
+ * Workflow-action–level overrides nest under {@link action} so memo and
214
+ * other fields with the same name don't collide between the two scopes.
215
+ */
216
+ type TypedScheduleCreateOptions<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"]> = {
217
+ /** Schedule ID. Recommended to use a meaningful business identifier. */scheduleId: string; /** When the schedule should fire (cron, interval, calendar). */
218
+ spec: ScheduleSpec; /** Workflow input — validated against the contract's input schema. */
219
+ args: ClientInferInput<TContract["workflows"][TWorkflowName]>; /** Temporal schedule policies (overlap, catchupWindow, pauseOnFailure, etc.). */
220
+ policies?: ScheduleOptions["policies"]; /** Temporal schedule state (paused, note, limited, etc.). */
221
+ state?: ScheduleOptions["state"]; /** Schedule-level memo (non-indexed metadata on the schedule itself). */
222
+ memo?: ScheduleOptions["memo"];
223
+ /**
224
+ * Workflow-action–level overrides. `workflowType` and `taskQueue` are
225
+ * derived from the contract, so they don't appear here. Note that
226
+ * `action.memo` is a *workflow-level* memo applied to each spawned run,
227
+ * distinct from the top-level `memo` (which is metadata on the schedule
228
+ * itself).
229
+ */
230
+ action?: TypedScheduleActionOverrides;
231
+ };
232
+ /**
233
+ * Typed handle to a schedule. Mirrors Temporal's `ScheduleHandle` lifecycle
234
+ * methods (`pause`, `unpause`, `trigger`, `describe`, `delete`) wrapped in
235
+ * the Future/Result pattern so call sites match the rest of the typed
236
+ * client.
237
+ */
238
+ type TypedScheduleHandle = {
239
+ /** This schedule's identifier. */readonly scheduleId: string; /** Pause the schedule. Optional note becomes part of the audit trail. */
240
+ pause: (note?: string) => Future<Result<void, RuntimeClientError>>; /** Resume a paused schedule. */
241
+ unpause: (note?: string) => Future<Result<void, RuntimeClientError>>; /** Fire the schedule's action immediately. */
242
+ trigger: (overlap?: ScheduleOverlapPolicy) => Future<Result<void, RuntimeClientError>>; /** Delete the schedule. */
243
+ delete: () => Future<Result<void, RuntimeClientError>>; /** Fetch the schedule's current description from the server. */
244
+ describe: () => Future<Result<ScheduleDescription, RuntimeClientError>>;
245
+ };
246
+ /**
247
+ * Typed wrapper around Temporal's `ScheduleClient`. Exposed as
248
+ * `typedClient.schedule` — keeps the typed-client surface organized the
249
+ * same way Temporal's own `Client.schedule` does.
250
+ */
251
+ declare class TypedScheduleClient<TContract extends ContractDefinition> {
252
+ private readonly contract;
253
+ private readonly scheduleClient;
254
+ constructor(contract: TContract, scheduleClient: ScheduleClient);
255
+ /**
256
+ * Create a new schedule that, on each fire, starts the named contract
257
+ * workflow with validated args.
258
+ *
259
+ * Validates `args` against the workflow's input schema before dispatching
260
+ * the create request to Temporal. The workflow's `taskQueue` and
261
+ * `workflowType` are pulled from the contract automatically; the typed
262
+ * options shape omits them so call sites don't have to repeat themselves.
263
+ */
264
+ create<TWorkflowName extends keyof TContract["workflows"]>(workflowName: TWorkflowName, options: TypedScheduleCreateOptions<TContract, TWorkflowName>): Future<Result<TypedScheduleHandle, WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError>>;
265
+ /**
266
+ * Get a typed handle to an existing schedule. Does not validate that the
267
+ * schedule exists — handle methods (`describe`, `pause`, etc.) will
268
+ * surface a `RuntimeClientError` if the underlying ID is unknown.
269
+ */
270
+ getHandle(scheduleId: string): TypedScheduleHandle;
271
+ }
272
+ //#endregion
142
273
  //#region src/client.d.ts
143
- type TypedWorkflowStartOptions<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"]> = Omit<WorkflowStartOptions, "taskQueue" | "args"> & {
274
+ /**
275
+ * Typed `searchAttributes` map for a workflow, derived from the workflow's
276
+ * declared `searchAttributes`. Each key is constrained to a declared
277
+ * attribute name; each value's type is determined by the attribute's `kind`
278
+ * (e.g. `KEYWORD` → `string`, `INT` → `number`, `DATETIME` → `Date`,
279
+ * `KEYWORD_LIST` → `string[]`).
280
+ *
281
+ * If the workflow declares no search attributes, this resolves to `never`,
282
+ * meaning the `searchAttributes` field is effectively absent from the start
283
+ * options for that workflow.
284
+ */
285
+ type TypedSearchAttributeMap<TWorkflow extends WorkflowDefinition> = TWorkflow["searchAttributes"] extends Record<string, SearchAttributeDefinition> ? { [K in keyof TWorkflow["searchAttributes"]]?: SearchAttributeKindToType<TWorkflow["searchAttributes"][K]["kind"]> } : never;
286
+ type TypedWorkflowStartOptions<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"]> = Omit<WorkflowStartOptions, "taskQueue" | "args" | "searchAttributes" | "typedSearchAttributes"> & {
144
287
  args: ClientInferInput<TContract["workflows"][TWorkflowName]>;
288
+ /**
289
+ * Indexed search attributes for the started workflow. Keys and value types
290
+ * are constrained to those declared on the workflow's contract via
291
+ * `defineSearchAttribute`. Translated to Temporal's `typedSearchAttributes`
292
+ * before the start request is dispatched.
293
+ */
294
+ searchAttributes?: TypedSearchAttributeMap<TContract["workflows"][TWorkflowName]>;
295
+ };
296
+ /**
297
+ * Options for {@link TypedClient.signalWithStart} — typed against both the
298
+ * workflow's input schema and the named signal's input schema.
299
+ */
300
+ type TypedSignalWithStartOptions<TContract extends ContractDefinition, TWorkflowName extends keyof TContract["workflows"], TSignalName extends keyof TContract["workflows"][TWorkflowName]["signals"] & string> = Omit<WorkflowSignalWithStartOptions, "taskQueue" | "args" | "signal" | "signalArgs" | "searchAttributes" | "typedSearchAttributes"> & {
301
+ args: ClientInferInput<TContract["workflows"][TWorkflowName]>;
302
+ signalName: TSignalName;
303
+ signalArgs: TContract["workflows"][TWorkflowName]["signals"][TSignalName] extends SignalDefinition ? ClientInferInput<TContract["workflows"][TWorkflowName]["signals"][TSignalName]> : never;
304
+ /**
305
+ * Indexed search attributes for the started workflow. Keys and value types
306
+ * are constrained to those declared on the workflow's contract via
307
+ * `defineSearchAttribute`. Translated to Temporal's `typedSearchAttributes`
308
+ * before the signalWithStart request is dispatched.
309
+ */
310
+ searchAttributes?: TypedSearchAttributeMap<TContract["workflows"][TWorkflowName]>;
311
+ };
312
+ /**
313
+ * Typed workflow handle returned by `signalWithStart`. Adds `signaledRunId`
314
+ * to the standard handle so callers can correlate the signal with the
315
+ * (possibly pre-existing) workflow execution chain.
316
+ */
317
+ type TypedWorkflowHandleWithSignaledRunId<TWorkflow extends WorkflowDefinition> = TypedWorkflowHandle<TWorkflow> & {
318
+ /**
319
+ * The Run Id of the bound Workflow at the time of `signalWithStart`. Since
320
+ * `signalWithStart` may have signaled an existing Workflow Chain, this is
321
+ * not necessarily the `firstExecutionRunId`.
322
+ */
323
+ readonly signaledRunId: string;
145
324
  };
146
325
  /**
147
326
  * Typed workflow handle with validated results using Result/Future pattern
148
327
  */
149
- interface TypedWorkflowHandle<TWorkflow extends WorkflowDefinition> {
328
+ type TypedWorkflowHandle<TWorkflow extends WorkflowDefinition> = {
150
329
  workflowId: string;
151
330
  /**
152
331
  * Type-safe queries based on workflow definition with Result pattern
153
332
  * Each query returns Future<Result<T, Error>> instead of Promise<T>
154
333
  */
155
- queries: { [K in keyof ClientInferWorkflowQueries<TWorkflow>]: ClientInferWorkflowQueries<TWorkflow>[K] extends ((...args: infer Args) => Future<Result<infer R, Error>>) ? (...args: Args) => Future<Result<R, QueryValidationError | RuntimeClientError>> : never };
334
+ queries: { [K in keyof ClientInferWorkflowQueries<TWorkflow>]: ClientInferWorkflowQueries<TWorkflow>[K] extends ((...args: infer Args) => Future<Result<infer R, Error>>) ? (...args: Args) => Future<Result<R, QueryValidationError | WorkflowExecutionNotFoundError | RuntimeClientError>> : never };
156
335
  /**
157
336
  * Type-safe signals based on workflow definition with Result pattern
158
337
  * Each signal returns Future<Result<void, Error>> instead of Promise<void>
159
338
  */
160
- signals: { [K in keyof ClientInferWorkflowSignals<TWorkflow>]: ClientInferWorkflowSignals<TWorkflow>[K] extends ((...args: infer Args) => Future<Result<void, Error>>) ? (...args: Args) => Future<Result<void, SignalValidationError | RuntimeClientError>> : never };
339
+ signals: { [K in keyof ClientInferWorkflowSignals<TWorkflow>]: ClientInferWorkflowSignals<TWorkflow>[K] extends ((...args: infer Args) => Future<Result<void, Error>>) ? (...args: Args) => Future<Result<void, SignalValidationError | WorkflowExecutionNotFoundError | RuntimeClientError>> : never };
161
340
  /**
162
341
  * Type-safe updates based on workflow definition with Result pattern
163
342
  * Each update returns Future<Result<T, Error>> instead of Promise<T>
164
343
  */
165
- updates: { [K in keyof ClientInferWorkflowUpdates<TWorkflow>]: ClientInferWorkflowUpdates<TWorkflow>[K] extends ((...args: infer Args) => Future<Result<infer R, Error>>) ? (...args: Args) => Future<Result<R, UpdateValidationError | RuntimeClientError>> : never };
344
+ updates: { [K in keyof ClientInferWorkflowUpdates<TWorkflow>]: ClientInferWorkflowUpdates<TWorkflow>[K] extends ((...args: infer Args) => Future<Result<infer R, Error>>) ? (...args: Args) => Future<Result<R, UpdateValidationError | WorkflowExecutionNotFoundError | RuntimeClientError>> : never };
166
345
  /**
167
346
  * Get workflow result with Result pattern
168
347
  */
169
- result: () => Future<Result<ClientInferOutput<TWorkflow>, WorkflowValidationError | RuntimeClientError>>;
348
+ result: () => Future<Result<ClientInferOutput<TWorkflow>, WorkflowValidationError | WorkflowFailedError | WorkflowExecutionNotFoundError | RuntimeClientError>>;
170
349
  /**
171
350
  * Terminate workflow with Result pattern
172
351
  */
173
- terminate: (reason?: string) => Future<Result<void, RuntimeClientError>>;
352
+ terminate: (reason?: string) => Future<Result<void, WorkflowExecutionNotFoundError | RuntimeClientError>>;
174
353
  /**
175
354
  * Cancel workflow with Result pattern
176
355
  */
177
- cancel: () => Future<Result<void, RuntimeClientError>>;
356
+ cancel: () => Future<Result<void, WorkflowExecutionNotFoundError | RuntimeClientError>>;
178
357
  /**
179
358
  * Get workflow execution description including status and metadata
180
359
  */
181
- describe: () => Future<Result<Awaited<ReturnType<WorkflowHandle["describe"]>>, RuntimeClientError>>;
360
+ describe: () => Future<Result<Awaited<ReturnType<WorkflowHandle["describe"]>>, WorkflowExecutionNotFoundError | RuntimeClientError>>;
182
361
  /**
183
362
  * Fetch the workflow execution history
184
363
  */
185
- fetchHistory: () => Future<Result<Awaited<ReturnType<WorkflowHandle["fetchHistory"]>>, RuntimeClientError>>;
186
- }
364
+ fetchHistory: () => Future<Result<Awaited<ReturnType<WorkflowHandle["fetchHistory"]>>, WorkflowExecutionNotFoundError | RuntimeClientError>>;
365
+ };
187
366
  /**
188
367
  * Typed Temporal client with Result/Future pattern based on a contract
189
368
  *
@@ -193,6 +372,31 @@ interface TypedWorkflowHandle<TWorkflow extends WorkflowDefinition> {
193
372
  declare class TypedClient<TContract extends ContractDefinition> {
194
373
  private readonly contract;
195
374
  private readonly client;
375
+ /**
376
+ * Typed wrapper around Temporal's `client.schedule.create(...)` and
377
+ * related lifecycle methods. Fires the underlying `startWorkflow` action
378
+ * with args validated against the contract's input schema.
379
+ *
380
+ * **Requires `@temporalio/client` 1.16+.** The Schedule API was added in
381
+ * 1.16; on older versions this property is unset and any access throws.
382
+ * The package's peer dep is pinned to `^1.16.0` so the standard install
383
+ * paths surface a peer-dependency warning rather than a runtime crash.
384
+ *
385
+ * @example
386
+ * ```ts
387
+ * const result = await client.schedule.create("processOrder", {
388
+ * scheduleId: "daily-sweep",
389
+ * spec: { cronExpressions: ["0 2 * * *"] },
390
+ * args: { orderId: "sweep" },
391
+ * });
392
+ *
393
+ * result.match({
394
+ * Ok: async (handle) => { await handle.pause("maintenance"); },
395
+ * Error: (error) => console.error("schedule create failed", error),
396
+ * });
397
+ * ```
398
+ */
399
+ readonly schedule: TypedScheduleClient<TContract>;
196
400
  private constructor();
197
401
  /**
198
402
  * Create a typed Temporal client with boxed pattern from a contract
@@ -200,10 +404,8 @@ declare class TypedClient<TContract extends ContractDefinition> {
200
404
  * @example
201
405
  * ```ts
202
406
  * const connection = await Connection.connect();
203
- * const client = TypedClient.create(myContract, {
204
- * connection,
205
- * namespace: 'default',
206
- * });
407
+ * const temporalClient = new Client({ connection });
408
+ * const client = TypedClient.create(myContract, temporalClient);
207
409
  *
208
410
  * const result = await client.executeWorkflow('processOrder', {
209
411
  * workflowId: 'order-123',
@@ -240,8 +442,42 @@ declare class TypedClient<TContract extends ContractDefinition> {
240
442
  */
241
443
  startWorkflow<TWorkflowName extends keyof TContract["workflows"]>(workflowName: TWorkflowName, {
242
444
  args,
445
+ searchAttributes,
446
+ ...temporalOptions
447
+ }: TypedWorkflowStartOptions<TContract, TWorkflowName>): Future<Result<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | RuntimeClientError>>;
448
+ /**
449
+ * Send a signal to a workflow, starting it first if it doesn't already exist.
450
+ *
451
+ * Validates both halves of the call against the contract:
452
+ * - `args` against the workflow's input schema
453
+ * - `signalArgs` against the named signal's input schema
454
+ *
455
+ * Returns a `TypedWorkflowHandleWithSignaledRunId` — the same shape as
456
+ * `startWorkflow`'s handle, plus a `signaledRunId` field for correlating
457
+ * the signal with the (possibly pre-existing) workflow execution chain.
458
+ *
459
+ * @example
460
+ * ```ts
461
+ * const result = await client.signalWithStart('processOrder', {
462
+ * workflowId: 'order-123',
463
+ * args: { orderId: 'ORD-123', customerId: 'CUST-1' },
464
+ * signalName: 'cancel',
465
+ * signalArgs: { reason: 'duplicate' },
466
+ * });
467
+ *
468
+ * result.match({
469
+ * Ok: (handle) => console.log('signaled run', handle.signaledRunId),
470
+ * Error: (error) => console.error('signalWithStart failed', error),
471
+ * });
472
+ * ```
473
+ */
474
+ signalWithStart<TWorkflowName extends keyof TContract["workflows"], TSignalName extends keyof TContract["workflows"][TWorkflowName]["signals"] & string>(workflowName: TWorkflowName, {
475
+ args,
476
+ signalName,
477
+ signalArgs,
478
+ searchAttributes,
243
479
  ...temporalOptions
244
- }: TypedWorkflowStartOptions<TContract, TWorkflowName>): Future<Result<TypedWorkflowHandle<TContract["workflows"][TWorkflowName]>, WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError>>;
480
+ }: TypedSignalWithStartOptions<TContract, TWorkflowName, TSignalName>): Future<Result<TypedWorkflowHandleWithSignaledRunId<TContract["workflows"][TWorkflowName]>, WorkflowNotFoundError | WorkflowValidationError | SignalValidationError | WorkflowAlreadyStartedError | RuntimeClientError>>;
245
481
  /**
246
482
  * Execute a workflow (start and wait for result) with Future/Result pattern
247
483
  *
@@ -262,8 +498,9 @@ declare class TypedClient<TContract extends ContractDefinition> {
262
498
  */
263
499
  executeWorkflow<TWorkflowName extends keyof TContract["workflows"]>(workflowName: TWorkflowName, {
264
500
  args,
501
+ searchAttributes,
265
502
  ...temporalOptions
266
- }: TypedWorkflowStartOptions<TContract, TWorkflowName>): Future<Result<ClientInferOutput<TContract["workflows"][TWorkflowName]>, WorkflowNotFoundError | WorkflowValidationError | RuntimeClientError>>;
503
+ }: TypedWorkflowStartOptions<TContract, TWorkflowName>): Future<Result<ClientInferOutput<TContract["workflows"][TWorkflowName]>, WorkflowNotFoundError | WorkflowValidationError | WorkflowAlreadyStartedError | WorkflowFailedError | WorkflowExecutionNotFoundError | RuntimeClientError>>;
267
504
  /**
268
505
  * Get a handle to an existing workflow with Future/Result pattern
269
506
  *
@@ -283,4 +520,5 @@ declare class TypedClient<TContract extends ContractDefinition> {
283
520
  private createTypedHandle;
284
521
  }
285
522
  //#endregion
286
- export { type ClientInferActivities, type ClientInferActivity, type ClientInferInput, type ClientInferOutput, type ClientInferQuery, type ClientInferSignal, type ClientInferUpdate, type ClientInferWorkflow, type ClientInferWorkflowActivities, type ClientInferWorkflowContextActivities, type ClientInferWorkflowQueries, type ClientInferWorkflowSignals, type ClientInferWorkflowUpdates, type ClientInferWorkflows, QueryValidationError, SignalValidationError, TypedClient, type TypedWorkflowHandle, type TypedWorkflowStartOptions, UpdateValidationError, WorkflowNotFoundError, WorkflowValidationError };
523
+ export { type ClientInferActivities, type ClientInferActivity, type ClientInferInput, type ClientInferOutput, type ClientInferQuery, type ClientInferSignal, type ClientInferUpdate, type ClientInferWorkflow, type ClientInferWorkflowActivities, type ClientInferWorkflowContextActivities, type ClientInferWorkflowQueries, type ClientInferWorkflowSignals, type ClientInferWorkflowUpdates, type ClientInferWorkflows, QueryValidationError, RuntimeClientError, SignalValidationError, TypedClient, type TypedScheduleActionOverrides, TypedScheduleClient, type TypedScheduleCreateOptions, type TypedScheduleHandle, type TypedSignalWithStartOptions, type TypedWorkflowHandle, type TypedWorkflowHandleWithSignaledRunId, type TypedWorkflowStartOptions, UpdateValidationError, WorkflowAlreadyStartedError, WorkflowExecutionNotFoundError, WorkflowFailedError, WorkflowNotFoundError, WorkflowValidationError };
524
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/errors.ts","../src/schedule.ts","../src/client.ts"],"mappings":";;;;;;;;;AAgBA;KAAY,gBAAA;EAA6B,KAAA,EAAO,SAAA;AAAA,KAAe,gBAAA,CAAiB,UAAA,CAC9E,CAAA;;;;;KAOU,iBAAA;EAA8B,MAAA,EAAQ,SAAA;AAAA,KAAe,gBAAA,CAAiB,WAAA,CAChF,CAAA;;;;;;AADF;;;KAaY,mBAAA,mBAAsC,kBAAA,KAChD,IAAA,EAAM,gBAAA,CAAiB,SAAA,MACpB,OAAA,CAAQ,iBAAA,CAAkB,SAAA;;;;;KAMnB,mBAAA,mBAAsC,kBAAA,KAChD,IAAA,EAAM,gBAAA,CAAiB,SAAA,MACpB,OAAA,CAAQ,iBAAA,CAAkB,SAAA;;;;;KAMnB,iBAAA,iBAAkC,gBAAA,KA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