@hatchet-dev/typescript-sdk 1.16.0 → 1.17.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 +14 -2
- package/clients/admin/admin-client.d.ts +2 -2
- package/clients/dispatcher/action-listener.d.ts +3 -6
- package/clients/dispatcher/action-listener.js +12 -17
- package/clients/listeners/durable-listener/durable-listener-client.d.ts +115 -15
- package/clients/listeners/durable-listener/durable-listener-client.js +769 -19
- package/clients/listeners/durable-listener/pooled-durable-listener-client.js +1 -14
- package/clients/listeners/run-listener/pooled-child-listener-client.js +1 -14
- package/clients/rest/generated/Api.d.ts +5 -1
- package/clients/rest/generated/data-contracts.d.ts +16 -2
- package/clients/rest/generated/data-contracts.js +7 -3
- package/legacy/examples/affinity-workers.js +2 -2
- package/legacy/legacy-client.js +1 -1
- package/legacy/step.d.ts +2 -2
- package/legacy/step.js +3 -2
- package/legacy/workflow.d.ts +25 -25
- package/package.json +1 -1
- package/protoc/dispatcher/dispatcher.d.ts +20 -0
- package/protoc/dispatcher/dispatcher.js +136 -2
- package/protoc/v1/dispatcher.d.ts +168 -0
- package/protoc/v1/dispatcher.js +1920 -1
- package/protoc/v1/shared/trigger.d.ts +89 -0
- package/protoc/v1/shared/trigger.js +493 -0
- package/protoc/v1/workflows.d.ts +34 -34
- package/protoc/v1/workflows.js +252 -200
- package/protoc/workflows/workflows.d.ts +2 -75
- package/protoc/workflows/workflows.js +16 -491
- package/util/abort-error.d.ts +10 -0
- package/util/abort-error.js +15 -0
- package/util/errors/eviction-not-supported-error.d.ts +5 -0
- package/util/errors/eviction-not-supported-error.js +18 -0
- package/util/errors/non-determinism-error.d.ts +7 -0
- package/util/errors/non-determinism-error.js +21 -0
- package/util/errors/task-run-terminated-error.d.ts +6 -0
- package/util/errors/task-run-terminated-error.js +15 -0
- package/util/hatchet-promise/hatchet-promise.d.ts +2 -1
- package/util/hatchet-promise/hatchet-promise.js +10 -1
- package/util/sleep.d.ts +3 -2
- package/util/sleep.js +6 -4
- package/v1/client/admin.d.ts +2 -2
- package/v1/client/client.js +1 -1
- package/v1/client/duration.d.ts +11 -1
- package/v1/client/duration.js +44 -0
- package/v1/client/features/runs.d.ts +16 -3
- package/v1/client/features/runs.js +38 -3
- package/v1/client/worker/context.d.ts +101 -6
- package/v1/client/worker/context.js +247 -21
- package/v1/client/worker/deprecated/index.d.ts +1 -1
- package/v1/client/worker/deprecated/index.js +2 -1
- package/v1/client/worker/deprecated/legacy-worker.d.ts +5 -0
- package/v1/client/worker/deprecated/legacy-worker.js +32 -23
- package/v1/client/worker/deprecated/pre-eviction.d.ts +12 -0
- package/v1/client/worker/deprecated/pre-eviction.js +37 -0
- package/v1/client/worker/engine-version.d.ts +5 -0
- package/v1/client/worker/engine-version.js +14 -0
- package/v1/client/worker/eviction/eviction-cache.d.ts +33 -0
- package/v1/client/worker/eviction/eviction-cache.js +139 -0
- package/v1/client/worker/eviction/eviction-manager.d.ts +42 -0
- package/v1/client/worker/eviction/eviction-manager.js +132 -0
- package/v1/client/worker/eviction/eviction-policy.d.ts +19 -0
- package/v1/client/worker/eviction/eviction-policy.js +8 -0
- package/v1/client/worker/eviction/index.d.ts +3 -0
- package/v1/client/worker/eviction/index.js +11 -0
- package/v1/client/worker/worker-internal.d.ts +23 -4
- package/v1/client/worker/worker-internal.js +177 -138
- package/v1/client/worker/worker.d.ts +1 -0
- package/v1/client/worker/worker.js +34 -1
- package/v1/conditions/sleep-condition.js +2 -1
- package/v1/conditions/transformer.js +2 -1
- package/v1/declaration.d.ts +5 -3
- package/v1/declaration.js +8 -0
- package/v1/examples/__e2e__/harness.d.ts +5 -0
- package/v1/examples/__e2e__/harness.js +13 -0
- package/v1/examples/concurrency_workflow_level/workflow.d.ts +1 -1
- package/v1/examples/concurrency_workflow_level/workflow.js +1 -1
- package/v1/examples/durable/workflow.d.ts +57 -0
- package/v1/examples/durable/workflow.js +162 -7
- package/v1/examples/durable-event/workflow.js +2 -7
- package/v1/examples/durable_event/workflow.d.ts +1 -0
- package/v1/examples/durable_event/workflow.js +4 -9
- package/v1/examples/durable_eviction/capacity-worker.d.ts +1 -0
- package/v1/examples/durable_eviction/capacity-worker.js +31 -0
- package/v1/examples/durable_eviction/worker.d.ts +1 -0
- package/v1/examples/durable_eviction/worker.js +34 -0
- package/v1/examples/durable_eviction/workflow.d.ts +44 -0
- package/v1/examples/durable_eviction/workflow.js +129 -0
- package/v1/examples/e2e-worker.js +42 -19
- package/v1/index.d.ts +5 -0
- package/v1/index.js +10 -0
- package/v1/parent-run-context-vars.d.ts +6 -0
- package/v1/task.d.ts +10 -2
- package/v1/task.js +2 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/protoc/v1/workflows.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire';
|
|
2
2
|
import type { CallContext, CallOptions } from 'nice-grpc-common';
|
|
3
3
|
import { TaskConditions } from './shared/condition';
|
|
4
|
+
import { DesiredWorkerLabels } from './shared/trigger';
|
|
4
5
|
export declare const protobufPackage = "v1";
|
|
5
6
|
export declare enum StickyStrategy {
|
|
6
7
|
SOFT = 0,
|
|
@@ -27,6 +28,7 @@ export declare enum RunStatus {
|
|
|
27
28
|
COMPLETED = 2,
|
|
28
29
|
FAILED = 3,
|
|
29
30
|
CANCELLED = 4,
|
|
31
|
+
EVICTED = 5,
|
|
30
32
|
UNRECOGNIZED = -1
|
|
31
33
|
}
|
|
32
34
|
export declare function runStatusFromJSON(object: any): RunStatus;
|
|
@@ -43,17 +45,6 @@ export declare enum ConcurrencyLimitStrategy {
|
|
|
43
45
|
}
|
|
44
46
|
export declare function concurrencyLimitStrategyFromJSON(object: any): ConcurrencyLimitStrategy;
|
|
45
47
|
export declare function concurrencyLimitStrategyToJSON(object: ConcurrencyLimitStrategy): string;
|
|
46
|
-
export declare enum WorkerLabelComparator {
|
|
47
|
-
EQUAL = 0,
|
|
48
|
-
NOT_EQUAL = 1,
|
|
49
|
-
GREATER_THAN = 2,
|
|
50
|
-
GREATER_THAN_OR_EQUAL = 3,
|
|
51
|
-
LESS_THAN = 4,
|
|
52
|
-
LESS_THAN_OR_EQUAL = 5,
|
|
53
|
-
UNRECOGNIZED = -1
|
|
54
|
-
}
|
|
55
|
-
export declare function workerLabelComparatorFromJSON(object: any): WorkerLabelComparator;
|
|
56
|
-
export declare function workerLabelComparatorToJSON(object: WorkerLabelComparator): string;
|
|
57
48
|
export interface CancelTasksRequest {
|
|
58
49
|
/** a list of external UUIDs */
|
|
59
50
|
externalIds: string[];
|
|
@@ -93,6 +84,22 @@ export interface TriggerWorkflowRunRequest_DesiredWorkerLabelsEntry {
|
|
|
93
84
|
export interface TriggerWorkflowRunResponse {
|
|
94
85
|
externalId: string;
|
|
95
86
|
}
|
|
87
|
+
export interface BranchDurableTaskRequest {
|
|
88
|
+
/** (required) the external id (uuid) of the durable task */
|
|
89
|
+
taskExternalId: string;
|
|
90
|
+
/** (required) the node id to branch from */
|
|
91
|
+
nodeId: number;
|
|
92
|
+
/** (required) the branch id to branch from */
|
|
93
|
+
branchId: number;
|
|
94
|
+
}
|
|
95
|
+
export interface BranchDurableTaskResponse {
|
|
96
|
+
/** the external id of the durable task */
|
|
97
|
+
taskExternalId: string;
|
|
98
|
+
/** the node id of the new entry */
|
|
99
|
+
nodeId: number;
|
|
100
|
+
/** the branch id of the new entry */
|
|
101
|
+
branchId: number;
|
|
102
|
+
}
|
|
96
103
|
/** CreateWorkflowVersionRequest represents options to create a workflow version. */
|
|
97
104
|
export interface CreateWorkflowVersionRequest {
|
|
98
105
|
/** (required) the workflow name */
|
|
@@ -140,28 +147,6 @@ export interface Concurrency {
|
|
|
140
147
|
/** (optional) the strategy to use when the concurrency limit is reached, default CANCEL_IN_PROGRESS */
|
|
141
148
|
limitStrategy?: ConcurrencyLimitStrategy | undefined;
|
|
142
149
|
}
|
|
143
|
-
export interface DesiredWorkerLabels {
|
|
144
|
-
/** value of the affinity */
|
|
145
|
-
strValue?: string | undefined;
|
|
146
|
-
intValue?: number | undefined;
|
|
147
|
-
/**
|
|
148
|
-
* (optional) Specifies whether the affinity setting is required.
|
|
149
|
-
* If required, the worker will not accept actions that do not have a truthy affinity setting.
|
|
150
|
-
*
|
|
151
|
-
* Defaults to false.
|
|
152
|
-
*/
|
|
153
|
-
required?: boolean | undefined;
|
|
154
|
-
/**
|
|
155
|
-
* (optional) Specifies the comparator for the affinity setting.
|
|
156
|
-
* If not set, the default is EQUAL.
|
|
157
|
-
*/
|
|
158
|
-
comparator?: WorkerLabelComparator | undefined;
|
|
159
|
-
/**
|
|
160
|
-
* (optional) Specifies the weight of the affinity setting.
|
|
161
|
-
* If not set, the default is 100.
|
|
162
|
-
*/
|
|
163
|
-
weight?: number | undefined;
|
|
164
|
-
}
|
|
165
150
|
/** CreateTaskOpts represents options to create a task. */
|
|
166
151
|
export interface CreateTaskOpts {
|
|
167
152
|
/** (required) the task name */
|
|
@@ -241,6 +226,8 @@ export interface TaskRunDetail {
|
|
|
241
226
|
output?: Uint8Array | undefined;
|
|
242
227
|
/** the readable id of the task */
|
|
243
228
|
readableId: string;
|
|
229
|
+
/** whether the task has been evicted from a worker (status will be RUNNING) */
|
|
230
|
+
isEvicted: boolean;
|
|
244
231
|
}
|
|
245
232
|
export interface GetRunDetailsResponse {
|
|
246
233
|
/** the input payload for the workflow run */
|
|
@@ -255,6 +242,8 @@ export interface GetRunDetailsResponse {
|
|
|
255
242
|
done: boolean;
|
|
256
243
|
/** (optional) additional metadata for the workflow run */
|
|
257
244
|
additionalMetadata: Uint8Array;
|
|
245
|
+
/** whether any task in this run has been evicted */
|
|
246
|
+
isEvicted: boolean;
|
|
258
247
|
}
|
|
259
248
|
export interface GetRunDetailsResponse_TaskRunsEntry {
|
|
260
249
|
key: string;
|
|
@@ -268,10 +257,11 @@ export declare const ReplayTasksResponse: MessageFns<ReplayTasksResponse>;
|
|
|
268
257
|
export declare const TriggerWorkflowRunRequest: MessageFns<TriggerWorkflowRunRequest>;
|
|
269
258
|
export declare const TriggerWorkflowRunRequest_DesiredWorkerLabelsEntry: MessageFns<TriggerWorkflowRunRequest_DesiredWorkerLabelsEntry>;
|
|
270
259
|
export declare const TriggerWorkflowRunResponse: MessageFns<TriggerWorkflowRunResponse>;
|
|
260
|
+
export declare const BranchDurableTaskRequest: MessageFns<BranchDurableTaskRequest>;
|
|
261
|
+
export declare const BranchDurableTaskResponse: MessageFns<BranchDurableTaskResponse>;
|
|
271
262
|
export declare const CreateWorkflowVersionRequest: MessageFns<CreateWorkflowVersionRequest>;
|
|
272
263
|
export declare const DefaultFilter: MessageFns<DefaultFilter>;
|
|
273
264
|
export declare const Concurrency: MessageFns<Concurrency>;
|
|
274
|
-
export declare const DesiredWorkerLabels: MessageFns<DesiredWorkerLabels>;
|
|
275
265
|
export declare const CreateTaskOpts: MessageFns<CreateTaskOpts>;
|
|
276
266
|
export declare const CreateTaskOpts_WorkerLabelsEntry: MessageFns<CreateTaskOpts_WorkerLabelsEntry>;
|
|
277
267
|
export declare const CreateTaskOpts_SlotRequestsEntry: MessageFns<CreateTaskOpts_SlotRequestsEntry>;
|
|
@@ -327,6 +317,14 @@ export declare const AdminServiceDefinition: {
|
|
|
327
317
|
readonly responseStream: false;
|
|
328
318
|
readonly options: {};
|
|
329
319
|
};
|
|
320
|
+
readonly branchDurableTask: {
|
|
321
|
+
readonly name: "BranchDurableTask";
|
|
322
|
+
readonly requestType: MessageFns<BranchDurableTaskRequest>;
|
|
323
|
+
readonly requestStream: false;
|
|
324
|
+
readonly responseType: MessageFns<BranchDurableTaskResponse>;
|
|
325
|
+
readonly responseStream: false;
|
|
326
|
+
readonly options: {};
|
|
327
|
+
};
|
|
330
328
|
};
|
|
331
329
|
};
|
|
332
330
|
export interface AdminServiceImplementation<CallContextExt = {}> {
|
|
@@ -335,6 +333,7 @@ export interface AdminServiceImplementation<CallContextExt = {}> {
|
|
|
335
333
|
replayTasks(request: ReplayTasksRequest, context: CallContext & CallContextExt): Promise<DeepPartial<ReplayTasksResponse>>;
|
|
336
334
|
triggerWorkflowRun(request: TriggerWorkflowRunRequest, context: CallContext & CallContextExt): Promise<DeepPartial<TriggerWorkflowRunResponse>>;
|
|
337
335
|
getRunDetails(request: GetRunDetailsRequest, context: CallContext & CallContextExt): Promise<DeepPartial<GetRunDetailsResponse>>;
|
|
336
|
+
branchDurableTask(request: BranchDurableTaskRequest, context: CallContext & CallContextExt): Promise<DeepPartial<BranchDurableTaskResponse>>;
|
|
338
337
|
}
|
|
339
338
|
export interface AdminServiceClient<CallOptionsExt = {}> {
|
|
340
339
|
putWorkflow(request: DeepPartial<CreateWorkflowVersionRequest>, options?: CallOptions & CallOptionsExt): Promise<CreateWorkflowVersionResponse>;
|
|
@@ -342,6 +341,7 @@ export interface AdminServiceClient<CallOptionsExt = {}> {
|
|
|
342
341
|
replayTasks(request: DeepPartial<ReplayTasksRequest>, options?: CallOptions & CallOptionsExt): Promise<ReplayTasksResponse>;
|
|
343
342
|
triggerWorkflowRun(request: DeepPartial<TriggerWorkflowRunRequest>, options?: CallOptions & CallOptionsExt): Promise<TriggerWorkflowRunResponse>;
|
|
344
343
|
getRunDetails(request: DeepPartial<GetRunDetailsRequest>, options?: CallOptions & CallOptionsExt): Promise<GetRunDetailsResponse>;
|
|
344
|
+
branchDurableTask(request: DeepPartial<BranchDurableTaskRequest>, options?: CallOptions & CallOptionsExt): Promise<BranchDurableTaskResponse>;
|
|
345
345
|
}
|
|
346
346
|
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
347
347
|
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|