@hatchet-dev/typescript-sdk 0.1.31 → 0.2.1
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/clients/admin/admin-client.d.ts +6 -1
- package/clients/admin/admin-client.js +2 -5
- package/clients/dispatcher/action-listener.d.ts +11 -0
- package/clients/dispatcher/action-listener.js +71 -1
- package/clients/hatchet-client/hatchet-client.js +1 -1
- package/clients/listener/listener-client.d.ts +32 -9
- package/clients/listener/listener-client.js +187 -53
- package/clients/worker/worker.js +2 -2
- package/package.json +10 -6
- package/protoc/dispatcher/dispatcher.d.ts +93 -2
- package/protoc/dispatcher/dispatcher.js +437 -266
- package/protoc/events/events.d.ts +2 -2
- package/protoc/events/events.js +57 -53
- package/protoc/google/protobuf/timestamp.d.ts +1 -1
- package/protoc/google/protobuf/timestamp.js +2 -2
- package/protoc/google/protobuf/wrappers.d.ts +1 -1
- package/protoc/google/protobuf/wrappers.js +10 -10
- package/protoc/workflows/workflows.d.ts +32 -2
- package/protoc/workflows/workflows.js +298 -138
- package/step.d.ts +18 -5
- package/step.js +89 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CallContext, CallOptions } from
|
|
2
|
-
import * as _m0 from
|
|
1
|
+
import type { CallContext, CallOptions } from 'nice-grpc-common';
|
|
2
|
+
import * as _m0 from 'protobufjs/minimal';
|
|
3
3
|
export declare const protobufPackage = "";
|
|
4
4
|
export declare enum ActionType {
|
|
5
5
|
START_STEP_RUN = 0,
|
|
@@ -161,6 +161,10 @@ export interface WorkflowEvent {
|
|
|
161
161
|
* will hang up the connection but clients might want to case
|
|
162
162
|
*/
|
|
163
163
|
hangup: boolean;
|
|
164
|
+
/** (optional) the max number of retries this step can handle */
|
|
165
|
+
stepRetries?: number | undefined;
|
|
166
|
+
/** (optional) the retry count of this step */
|
|
167
|
+
retryCount?: number | undefined;
|
|
164
168
|
}
|
|
165
169
|
export interface OverridesData {
|
|
166
170
|
/** the step run id */
|
|
@@ -174,6 +178,14 @@ export interface OverridesData {
|
|
|
174
178
|
}
|
|
175
179
|
export interface OverridesDataResponse {
|
|
176
180
|
}
|
|
181
|
+
export interface HeartbeatRequest {
|
|
182
|
+
/** the id of the worker */
|
|
183
|
+
workerId: string;
|
|
184
|
+
/** heartbeatAt is the time the worker sent the heartbeat */
|
|
185
|
+
heartbeatAt: Date | undefined;
|
|
186
|
+
}
|
|
187
|
+
export interface HeartbeatResponse {
|
|
188
|
+
}
|
|
177
189
|
export declare const WorkerRegisterRequest: {
|
|
178
190
|
encode(message: WorkerRegisterRequest, writer?: _m0.Writer): _m0.Writer;
|
|
179
191
|
decode(input: _m0.Reader | Uint8Array, length?: number): WorkerRegisterRequest;
|
|
@@ -278,6 +290,22 @@ export declare const OverridesDataResponse: {
|
|
|
278
290
|
create(base?: DeepPartial<OverridesDataResponse>): OverridesDataResponse;
|
|
279
291
|
fromPartial(_: DeepPartial<OverridesDataResponse>): OverridesDataResponse;
|
|
280
292
|
};
|
|
293
|
+
export declare const HeartbeatRequest: {
|
|
294
|
+
encode(message: HeartbeatRequest, writer?: _m0.Writer): _m0.Writer;
|
|
295
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): HeartbeatRequest;
|
|
296
|
+
fromJSON(object: any): HeartbeatRequest;
|
|
297
|
+
toJSON(message: HeartbeatRequest): unknown;
|
|
298
|
+
create(base?: DeepPartial<HeartbeatRequest>): HeartbeatRequest;
|
|
299
|
+
fromPartial(object: DeepPartial<HeartbeatRequest>): HeartbeatRequest;
|
|
300
|
+
};
|
|
301
|
+
export declare const HeartbeatResponse: {
|
|
302
|
+
encode(_: HeartbeatResponse, writer?: _m0.Writer): _m0.Writer;
|
|
303
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): HeartbeatResponse;
|
|
304
|
+
fromJSON(_: any): HeartbeatResponse;
|
|
305
|
+
toJSON(_: HeartbeatResponse): unknown;
|
|
306
|
+
create(base?: DeepPartial<HeartbeatResponse>): HeartbeatResponse;
|
|
307
|
+
fromPartial(_: DeepPartial<HeartbeatResponse>): HeartbeatResponse;
|
|
308
|
+
};
|
|
281
309
|
export type DispatcherDefinition = typeof DispatcherDefinition;
|
|
282
310
|
export declare const DispatcherDefinition: {
|
|
283
311
|
readonly name: "Dispatcher";
|
|
@@ -327,6 +355,55 @@ export declare const DispatcherDefinition: {
|
|
|
327
355
|
readonly responseStream: true;
|
|
328
356
|
readonly options: {};
|
|
329
357
|
};
|
|
358
|
+
/**
|
|
359
|
+
* ListenV2 is like listen, but implementation does not include heartbeats. This should only used by SDKs
|
|
360
|
+
* against engine version v0.18.1+
|
|
361
|
+
*/
|
|
362
|
+
readonly listenV2: {
|
|
363
|
+
readonly name: "ListenV2";
|
|
364
|
+
readonly requestType: {
|
|
365
|
+
encode(message: WorkerListenRequest, writer?: _m0.Writer): _m0.Writer;
|
|
366
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WorkerListenRequest;
|
|
367
|
+
fromJSON(object: any): WorkerListenRequest;
|
|
368
|
+
toJSON(message: WorkerListenRequest): unknown;
|
|
369
|
+
create(base?: DeepPartial<WorkerListenRequest>): WorkerListenRequest;
|
|
370
|
+
fromPartial(object: DeepPartial<WorkerListenRequest>): WorkerListenRequest;
|
|
371
|
+
};
|
|
372
|
+
readonly requestStream: false;
|
|
373
|
+
readonly responseType: {
|
|
374
|
+
encode(message: AssignedAction, writer?: _m0.Writer): _m0.Writer;
|
|
375
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): AssignedAction;
|
|
376
|
+
fromJSON(object: any): AssignedAction;
|
|
377
|
+
toJSON(message: AssignedAction): unknown;
|
|
378
|
+
create(base?: DeepPartial<AssignedAction>): AssignedAction;
|
|
379
|
+
fromPartial(object: DeepPartial<AssignedAction>): AssignedAction;
|
|
380
|
+
};
|
|
381
|
+
readonly responseStream: true;
|
|
382
|
+
readonly options: {};
|
|
383
|
+
};
|
|
384
|
+
/** Heartbeat is a method for workers to send heartbeats to the dispatcher */
|
|
385
|
+
readonly heartbeat: {
|
|
386
|
+
readonly name: "Heartbeat";
|
|
387
|
+
readonly requestType: {
|
|
388
|
+
encode(message: HeartbeatRequest, writer?: _m0.Writer): _m0.Writer;
|
|
389
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): HeartbeatRequest;
|
|
390
|
+
fromJSON(object: any): HeartbeatRequest;
|
|
391
|
+
toJSON(message: HeartbeatRequest): unknown;
|
|
392
|
+
create(base?: DeepPartial<HeartbeatRequest>): HeartbeatRequest;
|
|
393
|
+
fromPartial(object: DeepPartial<HeartbeatRequest>): HeartbeatRequest;
|
|
394
|
+
};
|
|
395
|
+
readonly requestStream: false;
|
|
396
|
+
readonly responseType: {
|
|
397
|
+
encode(_: HeartbeatResponse, writer?: _m0.Writer): _m0.Writer;
|
|
398
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): HeartbeatResponse;
|
|
399
|
+
fromJSON(_: any): HeartbeatResponse;
|
|
400
|
+
toJSON(_: HeartbeatResponse): unknown;
|
|
401
|
+
create(base?: DeepPartial<HeartbeatResponse>): HeartbeatResponse;
|
|
402
|
+
fromPartial(_: DeepPartial<HeartbeatResponse>): HeartbeatResponse;
|
|
403
|
+
};
|
|
404
|
+
readonly responseStream: false;
|
|
405
|
+
readonly options: {};
|
|
406
|
+
};
|
|
330
407
|
readonly subscribeToWorkflowEvents: {
|
|
331
408
|
readonly name: "SubscribeToWorkflowEvents";
|
|
332
409
|
readonly requestType: {
|
|
@@ -442,6 +519,13 @@ export declare const DispatcherDefinition: {
|
|
|
442
519
|
export interface DispatcherServiceImplementation<CallContextExt = {}> {
|
|
443
520
|
register(request: WorkerRegisterRequest, context: CallContext & CallContextExt): Promise<DeepPartial<WorkerRegisterResponse>>;
|
|
444
521
|
listen(request: WorkerListenRequest, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<AssignedAction>>;
|
|
522
|
+
/**
|
|
523
|
+
* ListenV2 is like listen, but implementation does not include heartbeats. This should only used by SDKs
|
|
524
|
+
* against engine version v0.18.1+
|
|
525
|
+
*/
|
|
526
|
+
listenV2(request: WorkerListenRequest, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<AssignedAction>>;
|
|
527
|
+
/** Heartbeat is a method for workers to send heartbeats to the dispatcher */
|
|
528
|
+
heartbeat(request: HeartbeatRequest, context: CallContext & CallContextExt): Promise<DeepPartial<HeartbeatResponse>>;
|
|
445
529
|
subscribeToWorkflowEvents(request: SubscribeToWorkflowEventsRequest, context: CallContext & CallContextExt): ServerStreamingMethodResult<DeepPartial<WorkflowEvent>>;
|
|
446
530
|
sendStepActionEvent(request: StepActionEvent, context: CallContext & CallContextExt): Promise<DeepPartial<ActionEventResponse>>;
|
|
447
531
|
sendGroupKeyActionEvent(request: GroupKeyActionEvent, context: CallContext & CallContextExt): Promise<DeepPartial<ActionEventResponse>>;
|
|
@@ -451,6 +535,13 @@ export interface DispatcherServiceImplementation<CallContextExt = {}> {
|
|
|
451
535
|
export interface DispatcherClient<CallOptionsExt = {}> {
|
|
452
536
|
register(request: DeepPartial<WorkerRegisterRequest>, options?: CallOptions & CallOptionsExt): Promise<WorkerRegisterResponse>;
|
|
453
537
|
listen(request: DeepPartial<WorkerListenRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<AssignedAction>;
|
|
538
|
+
/**
|
|
539
|
+
* ListenV2 is like listen, but implementation does not include heartbeats. This should only used by SDKs
|
|
540
|
+
* against engine version v0.18.1+
|
|
541
|
+
*/
|
|
542
|
+
listenV2(request: DeepPartial<WorkerListenRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<AssignedAction>;
|
|
543
|
+
/** Heartbeat is a method for workers to send heartbeats to the dispatcher */
|
|
544
|
+
heartbeat(request: DeepPartial<HeartbeatRequest>, options?: CallOptions & CallOptionsExt): Promise<HeartbeatResponse>;
|
|
454
545
|
subscribeToWorkflowEvents(request: DeepPartial<SubscribeToWorkflowEventsRequest>, options?: CallOptions & CallOptionsExt): AsyncIterable<WorkflowEvent>;
|
|
455
546
|
sendStepActionEvent(request: DeepPartial<StepActionEvent>, options?: CallOptions & CallOptionsExt): Promise<ActionEventResponse>;
|
|
456
547
|
sendGroupKeyActionEvent(request: DeepPartial<GroupKeyActionEvent>, options?: CallOptions & CallOptionsExt): Promise<ActionEventResponse>;
|