@hatchet-dev/typescript-sdk 1.14.0 → 1.15.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.
Files changed (40) hide show
  1. package/clients/admin/admin-client.d.ts +9 -1
  2. package/clients/admin/admin-client.js +20 -4
  3. package/legacy/step.d.ts +12 -12
  4. package/legacy/workflow.d.ts +36 -36
  5. package/package.json +4 -3
  6. package/protoc/v1/workflows.d.ts +8 -0
  7. package/protoc/v1/workflows.js +109 -2
  8. package/protoc/workflows/workflows.d.ts +9 -0
  9. package/protoc/workflows/workflows.js +109 -2
  10. package/v1/client/admin.d.ts +10 -1
  11. package/v1/client/admin.js +20 -4
  12. package/v1/client/client.d.ts +19 -1
  13. package/v1/client/client.js +19 -1
  14. package/v1/client/features/crons.d.ts +3 -1
  15. package/v1/client/features/crons.js +2 -1
  16. package/v1/client/features/filters.d.ts +30 -0
  17. package/v1/client/features/filters.js +30 -0
  18. package/v1/client/features/metrics.d.ts +10 -6
  19. package/v1/client/features/metrics.js +10 -6
  20. package/v1/client/features/ratelimits.d.ts +11 -1
  21. package/v1/client/features/ratelimits.js +11 -1
  22. package/v1/client/features/runs.d.ts +36 -1
  23. package/v1/client/features/runs.js +36 -1
  24. package/v1/client/features/schedules.d.ts +4 -1
  25. package/v1/client/features/schedules.js +3 -1
  26. package/v1/client/features/tenant.d.ts +3 -0
  27. package/v1/client/features/webhooks.d.ts +30 -4
  28. package/v1/client/features/webhooks.js +30 -4
  29. package/v1/client/features/workers.d.ts +25 -1
  30. package/v1/client/features/workers.js +25 -1
  31. package/v1/client/features/workflows.d.ts +19 -1
  32. package/v1/client/features/workflows.js +19 -1
  33. package/v1/client/worker/context.d.ts +21 -0
  34. package/v1/client/worker/context.js +21 -0
  35. package/v1/declaration.d.ts +89 -5
  36. package/v1/declaration.js +62 -4
  37. package/v1/examples/runtime_affinity/workflow.d.ts +3 -0
  38. package/v1/examples/runtime_affinity/workflow.js +19 -0
  39. package/version.d.ts +1 -1
  40. package/version.js +1 -1
@@ -1,5 +1,5 @@
1
1
  import { Channel, ClientFactory } from 'nice-grpc';
2
- import { CreateWorkflowVersionOpts, RateLimitDuration, WorkflowServiceClient } from '../../protoc/workflows';
2
+ import { CreateWorkflowVersionOpts, RateLimitDuration, WorkerLabelComparator, WorkflowServiceClient } from '../../protoc/workflows';
3
3
  import { ClientConfig } from '../hatchet-client/client-config';
4
4
  import { Logger } from '../../util/logger';
5
5
  import WorkflowRunRef from '../../util/workflow-run-ref';
@@ -8,6 +8,12 @@ import { Priority, RunsClient } from '../../v1';
8
8
  import { Api } from '../rest';
9
9
  import { WebhookWorkerCreateRequest, WorkflowRunStatus, WorkflowRunStatusList } from '../rest/generated/data-contracts';
10
10
  import { RunListenerClient } from '../listeners/run-listener/child-listener-client';
11
+ type DesiredWorkerLabelOpt = {
12
+ value: string | number;
13
+ required?: boolean;
14
+ weight?: number;
15
+ comparator?: WorkerLabelComparator;
16
+ };
11
17
  type WorkflowMetricsQuery = {
12
18
  workflowId?: string;
13
19
  workflowName?: string;
@@ -114,6 +120,7 @@ export declare class AdminClient {
114
120
  additionalMetadata?: Record<string, string> | undefined;
115
121
  desiredWorkerId?: string | undefined;
116
122
  priority?: Priority;
123
+ desiredWorkerLabels?: Record<string, DesiredWorkerLabelOpt>;
117
124
  }): WorkflowRunRef<P>;
118
125
  /**
119
126
  * Run multiple workflows runs with the given input and options. This will create new workflow runs and return their IDs.
@@ -142,6 +149,7 @@ export declare class AdminClient {
142
149
  additionalMetadata?: Record<string, string> | undefined;
143
150
  desiredWorkerId?: string | undefined;
144
151
  priority?: Priority;
152
+ desiredWorkerLabels?: Record<string, DesiredWorkerLabelOpt>;
145
153
  };
146
154
  }>): Promise<WorkflowRunRef<P>[]>;
147
155
  /**
@@ -30,6 +30,18 @@ const retrier_1 = require("../../util/retrier");
30
30
  const workflow_run_ref_1 = __importDefault(require("../../util/workflow-run-ref"));
31
31
  const workflows_2 = require("../../protoc/v1/workflows");
32
32
  const apply_namespace_1 = require("../../util/apply-namespace");
33
+ function convertDesiredWorkerLabels(labels) {
34
+ return Object.fromEntries(Object.entries(labels).map(([key, label]) => [
35
+ key,
36
+ {
37
+ strValue: typeof label.value === 'string' ? label.value : undefined,
38
+ intValue: typeof label.value === 'number' ? label.value : undefined,
39
+ required: label.required,
40
+ weight: label.weight,
41
+ comparator: label.comparator,
42
+ },
43
+ ]));
44
+ }
33
45
  class AdminClient {
34
46
  constructor(config, channel, factory, api, tenantId, listenerClient, workflows) {
35
47
  this.config = config;
@@ -132,10 +144,12 @@ class AdminClient {
132
144
  try {
133
145
  const inputStr = JSON.stringify(input);
134
146
  const opts = options !== null && options !== void 0 ? options : {};
135
- const { additionalMetadata, parentStepRunId, parentTaskRunExternalId } = opts, rest = __rest(opts, ["additionalMetadata", "parentStepRunId", "parentTaskRunExternalId"]);
147
+ const { additionalMetadata, parentStepRunId, parentTaskRunExternalId, desiredWorkerLabels } = opts, rest = __rest(opts, ["additionalMetadata", "parentStepRunId", "parentTaskRunExternalId", "desiredWorkerLabels"]);
136
148
  const resp = this.client.triggerWorkflow(Object.assign(Object.assign({ name: computedName, input: inputStr }, rest), {
137
149
  // API expects `parentTaskRunExternalId`; accept the old name as an alias.
138
- parentTaskRunExternalId: parentTaskRunExternalId !== null && parentTaskRunExternalId !== void 0 ? parentTaskRunExternalId : parentStepRunId, additionalMetadata: additionalMetadata ? JSON.stringify(additionalMetadata) : undefined, priority: opts.priority }));
150
+ parentTaskRunExternalId: parentTaskRunExternalId !== null && parentTaskRunExternalId !== void 0 ? parentTaskRunExternalId : parentStepRunId, additionalMetadata: additionalMetadata ? JSON.stringify(additionalMetadata) : undefined, priority: opts.priority, desiredWorkerLabels: desiredWorkerLabels
151
+ ? convertDesiredWorkerLabels(desiredWorkerLabels)
152
+ : {} }));
139
153
  return new workflow_run_ref_1.default(resp, this.listenerClient, this.workflows, options === null || options === void 0 ? void 0 : options.parentId);
140
154
  }
141
155
  catch (e) {
@@ -154,8 +168,10 @@ class AdminClient {
154
168
  const computedName = (0, apply_namespace_1.applyNamespace)(workflowName, this.config.namespace);
155
169
  const inputStr = JSON.stringify(input);
156
170
  const opts = options !== null && options !== void 0 ? options : {};
157
- const { additionalMetadata, parentStepRunId, parentTaskRunExternalId } = opts, rest = __rest(opts, ["additionalMetadata", "parentStepRunId", "parentTaskRunExternalId"]);
158
- return Object.assign(Object.assign({ name: computedName, input: inputStr }, rest), { parentTaskRunExternalId: parentTaskRunExternalId !== null && parentTaskRunExternalId !== void 0 ? parentTaskRunExternalId : parentStepRunId, additionalMetadata: additionalMetadata ? JSON.stringify(additionalMetadata) : undefined });
171
+ const { additionalMetadata, parentStepRunId, parentTaskRunExternalId, desiredWorkerLabels } = opts, rest = __rest(opts, ["additionalMetadata", "parentStepRunId", "parentTaskRunExternalId", "desiredWorkerLabels"]);
172
+ return Object.assign(Object.assign({ name: computedName, input: inputStr }, rest), { parentTaskRunExternalId: parentTaskRunExternalId !== null && parentTaskRunExternalId !== void 0 ? parentTaskRunExternalId : parentStepRunId, additionalMetadata: additionalMetadata ? JSON.stringify(additionalMetadata) : undefined, desiredWorkerLabels: desiredWorkerLabels
173
+ ? convertDesiredWorkerLabels(desiredWorkerLabels)
174
+ : {} });
159
175
  });
160
176
  try {
161
177
  // Call the bulk trigger workflow method
package/legacy/step.d.ts CHANGED
@@ -24,17 +24,17 @@ export declare const CreateRateLimitSchema: z.ZodObject<{
24
24
  }, "strip", z.ZodTypeAny, {
25
25
  units: string | number;
26
26
  key?: string | undefined;
27
+ duration?: RateLimitDuration | undefined;
27
28
  staticKey?: string | undefined;
28
29
  dynamicKey?: string | undefined;
29
30
  limit?: string | number | undefined;
30
- duration?: RateLimitDuration | undefined;
31
31
  }, {
32
32
  units: string | number;
33
33
  key?: string | undefined;
34
+ duration?: RateLimitDuration | undefined;
34
35
  staticKey?: string | undefined;
35
36
  dynamicKey?: string | undefined;
36
37
  limit?: string | number | undefined;
37
- duration?: RateLimitDuration | undefined;
38
38
  }>;
39
39
  export declare const DesiredWorkerLabelSchema: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
40
40
  value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
@@ -44,13 +44,13 @@ export declare const DesiredWorkerLabelSchema: z.ZodOptional<z.ZodUnion<[z.ZodSt
44
44
  }, "strip", z.ZodTypeAny, {
45
45
  value: string | number;
46
46
  required?: boolean | undefined;
47
- weight?: number | undefined;
48
47
  comparator?: WorkerLabelComparator | undefined;
48
+ weight?: number | undefined;
49
49
  }, {
50
50
  value: string | number;
51
51
  required?: boolean | undefined;
52
- weight?: number | undefined;
53
52
  comparator?: WorkerLabelComparator | undefined;
53
+ weight?: number | undefined;
54
54
  }>]>>;
55
55
  export declare const CreateStepSchema: z.ZodObject<{
56
56
  name: z.ZodString;
@@ -67,17 +67,17 @@ export declare const CreateStepSchema: z.ZodObject<{
67
67
  }, "strip", z.ZodTypeAny, {
68
68
  units: string | number;
69
69
  key?: string | undefined;
70
+ duration?: RateLimitDuration | undefined;
70
71
  staticKey?: string | undefined;
71
72
  dynamicKey?: string | undefined;
72
73
  limit?: string | number | undefined;
73
- duration?: RateLimitDuration | undefined;
74
74
  }, {
75
75
  units: string | number;
76
76
  key?: string | undefined;
77
+ duration?: RateLimitDuration | undefined;
77
78
  staticKey?: string | undefined;
78
79
  dynamicKey?: string | undefined;
79
80
  limit?: string | number | undefined;
80
- duration?: RateLimitDuration | undefined;
81
81
  }>, "many">>;
82
82
  worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
83
83
  value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
@@ -87,13 +87,13 @@ export declare const CreateStepSchema: z.ZodObject<{
87
87
  }, "strip", z.ZodTypeAny, {
88
88
  value: string | number;
89
89
  required?: boolean | undefined;
90
- weight?: number | undefined;
91
90
  comparator?: WorkerLabelComparator | undefined;
91
+ weight?: number | undefined;
92
92
  }, {
93
93
  value: string | number;
94
94
  required?: boolean | undefined;
95
- weight?: number | undefined;
96
95
  comparator?: WorkerLabelComparator | undefined;
96
+ weight?: number | undefined;
97
97
  }>]>>>>>;
98
98
  backoff: z.ZodOptional<z.ZodObject<{
99
99
  factor: z.ZodOptional<z.ZodNumber>;
@@ -113,16 +113,16 @@ export declare const CreateStepSchema: z.ZodObject<{
113
113
  rate_limits?: {
114
114
  units: string | number;
115
115
  key?: string | undefined;
116
+ duration?: RateLimitDuration | undefined;
116
117
  staticKey?: string | undefined;
117
118
  dynamicKey?: string | undefined;
118
119
  limit?: string | number | undefined;
119
- duration?: RateLimitDuration | undefined;
120
120
  }[] | undefined;
121
121
  worker_labels?: Record<string, string | number | {
122
122
  value: string | number;
123
123
  required?: boolean | undefined;
124
- weight?: number | undefined;
125
124
  comparator?: WorkerLabelComparator | undefined;
125
+ weight?: number | undefined;
126
126
  } | undefined> | undefined;
127
127
  backoff?: {
128
128
  factor?: number | undefined;
@@ -136,16 +136,16 @@ export declare const CreateStepSchema: z.ZodObject<{
136
136
  rate_limits?: {
137
137
  units: string | number;
138
138
  key?: string | undefined;
139
+ duration?: RateLimitDuration | undefined;
139
140
  staticKey?: string | undefined;
140
141
  dynamicKey?: string | undefined;
141
142
  limit?: string | number | undefined;
142
- duration?: RateLimitDuration | undefined;
143
143
  }[] | undefined;
144
144
  worker_labels?: Record<string, string | number | {
145
145
  value: string | number;
146
146
  required?: boolean | undefined;
147
- weight?: number | undefined;
148
147
  comparator?: WorkerLabelComparator | undefined;
148
+ weight?: number | undefined;
149
149
  } | undefined> | undefined;
150
150
  backoff?: {
151
151
  factor?: number | undefined;
@@ -16,17 +16,17 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
16
16
  }, "strip", z.ZodTypeAny, {
17
17
  units: string | number;
18
18
  key?: string | undefined;
19
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
19
20
  staticKey?: string | undefined;
20
21
  dynamicKey?: string | undefined;
21
22
  limit?: string | number | undefined;
22
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
23
23
  }, {
24
24
  units: string | number;
25
25
  key?: string | undefined;
26
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
26
27
  staticKey?: string | undefined;
27
28
  dynamicKey?: string | undefined;
28
29
  limit?: string | number | undefined;
29
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
30
30
  }>, "many">>;
31
31
  worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
32
32
  value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
@@ -36,13 +36,13 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
36
36
  }, "strip", z.ZodTypeAny, {
37
37
  value: string | number;
38
38
  required?: boolean | undefined;
39
- weight?: number | undefined;
40
39
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
40
+ weight?: number | undefined;
41
41
  }, {
42
42
  value: string | number;
43
43
  required?: boolean | undefined;
44
- weight?: number | undefined;
45
44
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
45
+ weight?: number | undefined;
46
46
  }>]>>>>>;
47
47
  backoff: z.ZodOptional<z.ZodObject<{
48
48
  factor: z.ZodOptional<z.ZodNumber>;
@@ -62,16 +62,16 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
62
62
  rate_limits?: {
63
63
  units: string | number;
64
64
  key?: string | undefined;
65
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
65
66
  staticKey?: string | undefined;
66
67
  dynamicKey?: string | undefined;
67
68
  limit?: string | number | undefined;
68
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
69
69
  }[] | undefined;
70
70
  worker_labels?: Record<string, string | number | {
71
71
  value: string | number;
72
72
  required?: boolean | undefined;
73
- weight?: number | undefined;
74
73
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
74
+ weight?: number | undefined;
75
75
  } | undefined> | undefined;
76
76
  backoff?: {
77
77
  factor?: number | undefined;
@@ -85,16 +85,16 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
85
85
  rate_limits?: {
86
86
  units: string | number;
87
87
  key?: string | undefined;
88
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
88
89
  staticKey?: string | undefined;
89
90
  dynamicKey?: string | undefined;
90
91
  limit?: string | number | undefined;
91
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
92
92
  }[] | undefined;
93
93
  worker_labels?: Record<string, string | number | {
94
94
  value: string | number;
95
95
  required?: boolean | undefined;
96
- weight?: number | undefined;
97
96
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
97
+ weight?: number | undefined;
98
98
  } | undefined> | undefined;
99
99
  backoff?: {
100
100
  factor?: number | undefined;
@@ -110,14 +110,14 @@ export declare const WorkflowConcurrency: z.ZodObject<{
110
110
  expression: z.ZodOptional<z.ZodString>;
111
111
  }, "strip", z.ZodTypeAny, {
112
112
  name: string;
113
+ expression?: string | undefined;
113
114
  maxRuns?: number | undefined;
114
115
  limitStrategy?: PbConcurrencyLimitStrategy | undefined;
115
- expression?: string | undefined;
116
116
  }, {
117
117
  name: string;
118
+ expression?: string | undefined;
118
119
  maxRuns?: number | undefined;
119
120
  limitStrategy?: PbConcurrencyLimitStrategy | undefined;
120
- expression?: string | undefined;
121
121
  }>;
122
122
  export declare const HatchetTimeoutSchema: z.ZodString;
123
123
  export declare const StickyStrategy: typeof PbStickyStrategy;
@@ -165,17 +165,17 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
165
165
  }, "strip", z.ZodTypeAny, {
166
166
  units: string | number;
167
167
  key?: string | undefined;
168
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
168
169
  staticKey?: string | undefined;
169
170
  dynamicKey?: string | undefined;
170
171
  limit?: string | number | undefined;
171
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
172
172
  }, {
173
173
  units: string | number;
174
174
  key?: string | undefined;
175
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
175
176
  staticKey?: string | undefined;
176
177
  dynamicKey?: string | undefined;
177
178
  limit?: string | number | undefined;
178
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
179
179
  }>, "many">>;
180
180
  worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
181
181
  value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
@@ -185,13 +185,13 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
185
185
  }, "strip", z.ZodTypeAny, {
186
186
  value: string | number;
187
187
  required?: boolean | undefined;
188
- weight?: number | undefined;
189
188
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
189
+ weight?: number | undefined;
190
190
  }, {
191
191
  value: string | number;
192
192
  required?: boolean | undefined;
193
- weight?: number | undefined;
194
193
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
194
+ weight?: number | undefined;
195
195
  }>]>>>>>;
196
196
  backoff: z.ZodOptional<z.ZodObject<{
197
197
  factor: z.ZodOptional<z.ZodNumber>;
@@ -211,16 +211,16 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
211
211
  rate_limits?: {
212
212
  units: string | number;
213
213
  key?: string | undefined;
214
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
214
215
  staticKey?: string | undefined;
215
216
  dynamicKey?: string | undefined;
216
217
  limit?: string | number | undefined;
217
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
218
218
  }[] | undefined;
219
219
  worker_labels?: Record<string, string | number | {
220
220
  value: string | number;
221
221
  required?: boolean | undefined;
222
- weight?: number | undefined;
223
222
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
223
+ weight?: number | undefined;
224
224
  } | undefined> | undefined;
225
225
  backoff?: {
226
226
  factor?: number | undefined;
@@ -234,16 +234,16 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
234
234
  rate_limits?: {
235
235
  units: string | number;
236
236
  key?: string | undefined;
237
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
237
238
  staticKey?: string | undefined;
238
239
  dynamicKey?: string | undefined;
239
240
  limit?: string | number | undefined;
240
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
241
241
  }[] | undefined;
242
242
  worker_labels?: Record<string, string | number | {
243
243
  value: string | number;
244
244
  required?: boolean | undefined;
245
- weight?: number | undefined;
246
245
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
246
+ weight?: number | undefined;
247
247
  } | undefined> | undefined;
248
248
  backoff?: {
249
249
  factor?: number | undefined;
@@ -265,17 +265,17 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
265
265
  }, "strip", z.ZodTypeAny, {
266
266
  units: string | number;
267
267
  key?: string | undefined;
268
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
268
269
  staticKey?: string | undefined;
269
270
  dynamicKey?: string | undefined;
270
271
  limit?: string | number | undefined;
271
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
272
272
  }, {
273
273
  units: string | number;
274
274
  key?: string | undefined;
275
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
275
276
  staticKey?: string | undefined;
276
277
  dynamicKey?: string | undefined;
277
278
  limit?: string | number | undefined;
278
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
279
279
  }>, "many">>;
280
280
  worker_labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodLazy<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodObject<{
281
281
  value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
@@ -285,13 +285,13 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
285
285
  }, "strip", z.ZodTypeAny, {
286
286
  value: string | number;
287
287
  required?: boolean | undefined;
288
- weight?: number | undefined;
289
288
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
289
+ weight?: number | undefined;
290
290
  }, {
291
291
  value: string | number;
292
292
  required?: boolean | undefined;
293
- weight?: number | undefined;
294
293
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
294
+ weight?: number | undefined;
295
295
  }>]>>>>>;
296
296
  backoff: z.ZodOptional<z.ZodObject<{
297
297
  factor: z.ZodOptional<z.ZodNumber>;
@@ -311,16 +311,16 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
311
311
  rate_limits?: {
312
312
  units: string | number;
313
313
  key?: string | undefined;
314
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
314
315
  staticKey?: string | undefined;
315
316
  dynamicKey?: string | undefined;
316
317
  limit?: string | number | undefined;
317
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
318
318
  }[] | undefined;
319
319
  worker_labels?: Record<string, string | number | {
320
320
  value: string | number;
321
321
  required?: boolean | undefined;
322
- weight?: number | undefined;
323
322
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
323
+ weight?: number | undefined;
324
324
  } | undefined> | undefined;
325
325
  backoff?: {
326
326
  factor?: number | undefined;
@@ -334,16 +334,16 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
334
334
  rate_limits?: {
335
335
  units: string | number;
336
336
  key?: string | undefined;
337
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
337
338
  staticKey?: string | undefined;
338
339
  dynamicKey?: string | undefined;
339
340
  limit?: string | number | undefined;
340
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
341
341
  }[] | undefined;
342
342
  worker_labels?: Record<string, string | number | {
343
343
  value: string | number;
344
344
  required?: boolean | undefined;
345
- weight?: number | undefined;
346
345
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
346
+ weight?: number | undefined;
347
347
  } | undefined> | undefined;
348
348
  backoff?: {
349
349
  factor?: number | undefined;
@@ -351,8 +351,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
351
351
  } | undefined;
352
352
  }>>;
353
353
  }, "strip", z.ZodTypeAny, {
354
- id: string;
355
354
  description: string;
355
+ id: string;
356
356
  steps: {
357
357
  name: string;
358
358
  timeout?: string | undefined;
@@ -361,16 +361,16 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
361
361
  rate_limits?: {
362
362
  units: string | number;
363
363
  key?: string | undefined;
364
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
364
365
  staticKey?: string | undefined;
365
366
  dynamicKey?: string | undefined;
366
367
  limit?: string | number | undefined;
367
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
368
368
  }[] | undefined;
369
369
  worker_labels?: Record<string, string | number | {
370
370
  value: string | number;
371
371
  required?: boolean | undefined;
372
- weight?: number | undefined;
373
372
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
373
+ weight?: number | undefined;
374
374
  } | undefined> | undefined;
375
375
  backoff?: {
376
376
  factor?: number | undefined;
@@ -396,16 +396,16 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
396
396
  rate_limits?: {
397
397
  units: string | number;
398
398
  key?: string | undefined;
399
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
399
400
  staticKey?: string | undefined;
400
401
  dynamicKey?: string | undefined;
401
402
  limit?: string | number | undefined;
402
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
403
403
  }[] | undefined;
404
404
  worker_labels?: Record<string, string | number | {
405
405
  value: string | number;
406
406
  required?: boolean | undefined;
407
- weight?: number | undefined;
408
407
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
408
+ weight?: number | undefined;
409
409
  } | undefined> | undefined;
410
410
  backoff?: {
411
411
  factor?: number | undefined;
@@ -413,8 +413,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
413
413
  } | undefined;
414
414
  } | undefined;
415
415
  }, {
416
- id: string;
417
416
  description: string;
417
+ id: string;
418
418
  steps: {
419
419
  name: string;
420
420
  timeout?: string | undefined;
@@ -423,16 +423,16 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
423
423
  rate_limits?: {
424
424
  units: string | number;
425
425
  key?: string | undefined;
426
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
426
427
  staticKey?: string | undefined;
427
428
  dynamicKey?: string | undefined;
428
429
  limit?: string | number | undefined;
429
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
430
430
  }[] | undefined;
431
431
  worker_labels?: Record<string, string | number | {
432
432
  value: string | number;
433
433
  required?: boolean | undefined;
434
- weight?: number | undefined;
435
434
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
435
+ weight?: number | undefined;
436
436
  } | undefined> | undefined;
437
437
  backoff?: {
438
438
  factor?: number | undefined;
@@ -458,16 +458,16 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
458
458
  rate_limits?: {
459
459
  units: string | number;
460
460
  key?: string | undefined;
461
+ duration?: import("../protoc/workflows").RateLimitDuration | undefined;
461
462
  staticKey?: string | undefined;
462
463
  dynamicKey?: string | undefined;
463
464
  limit?: string | number | undefined;
464
- duration?: import("../protoc/workflows").RateLimitDuration | undefined;
465
465
  }[] | undefined;
466
466
  worker_labels?: Record<string, string | number | {
467
467
  value: string | number;
468
468
  required?: boolean | undefined;
469
- weight?: number | undefined;
470
469
  comparator?: import("../protoc/workflows").WorkerLabelComparator | undefined;
470
+ weight?: number | undefined;
471
471
  } | undefined> | undefined;
472
472
  backoff?: {
473
473
  factor?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "1.14.0",
3
+ "version": "1.15.1",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -49,8 +49,9 @@
49
49
  "ts-jest": "^29.3.1",
50
50
  "ts-node": "^10.9.2",
51
51
  "ts-proto": "^2.7.0",
52
- "typedoc": "^0.28.0",
52
+ "typedoc": "^0.28.17",
53
53
  "typedoc-plugin-markdown": "^4.6.0",
54
+ "typedoc-plugin-no-inherit": "^1.6.1",
54
55
  "typescript": "^5.8.2"
55
56
  },
56
57
  "dependencies": {
@@ -91,7 +92,7 @@
91
92
  "prepublish": "cp package.json dist/package.json; cp README.md dist/; cp -r scripts dist/",
92
93
  "publish:ci": "rm -rf ./dist && pnpm run dump-version && pnpm run tsc:build && pnpm run prepublish && cd dist && pnpm publish --access public --no-git-checks",
93
94
  "publish:ci:alpha": "rm -rf ./dist && pnpm run dump-version && pnpm run tsc:build && pnpm run prepublish && cd dist && pnpm publish --access public --no-git-checks --tag alpha",
94
- "generate-docs": "typedoc",
95
+ "generate-docs": "ts-node docs/generate.ts",
95
96
  "exec": "npx dotenv -- ts-node -r tsconfig-paths/register --project tsconfig.json"
96
97
  }
97
98
  }
@@ -82,6 +82,13 @@ export interface TriggerWorkflowRunRequest {
82
82
  input: Uint8Array;
83
83
  additionalMetadata: Uint8Array;
84
84
  priority?: number | undefined;
85
+ desiredWorkerLabels: {
86
+ [key: string]: DesiredWorkerLabels;
87
+ };
88
+ }
89
+ export interface TriggerWorkflowRunRequest_DesiredWorkerLabelsEntry {
90
+ key: string;
91
+ value: DesiredWorkerLabels | undefined;
85
92
  }
86
93
  export interface TriggerWorkflowRunResponse {
87
94
  externalId: string;
@@ -259,6 +266,7 @@ export declare const TasksFilter: MessageFns<TasksFilter>;
259
266
  export declare const CancelTasksResponse: MessageFns<CancelTasksResponse>;
260
267
  export declare const ReplayTasksResponse: MessageFns<ReplayTasksResponse>;
261
268
  export declare const TriggerWorkflowRunRequest: MessageFns<TriggerWorkflowRunRequest>;
269
+ export declare const TriggerWorkflowRunRequest_DesiredWorkerLabelsEntry: MessageFns<TriggerWorkflowRunRequest_DesiredWorkerLabelsEntry>;
262
270
  export declare const TriggerWorkflowRunResponse: MessageFns<TriggerWorkflowRunResponse>;
263
271
  export declare const CreateWorkflowVersionRequest: MessageFns<CreateWorkflowVersionRequest>;
264
272
  export declare const DefaultFilter: MessageFns<DefaultFilter>;