@hatchet-dev/typescript-sdk 1.2.0-alpha.1 → 1.3.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.
Files changed (50) hide show
  1. package/clients/admin/admin-client.d.ts +3 -1
  2. package/clients/admin/admin-client.js +1 -1
  3. package/clients/hatchet-client/features/cron-client.d.ts +3 -0
  4. package/clients/hatchet-client/features/cron-client.js +2 -0
  5. package/clients/hatchet-client/features/schedule-client.d.ts +3 -0
  6. package/clients/hatchet-client/features/schedule-client.js +2 -0
  7. package/clients/rest/generated/data-contracts.d.ts +193 -167
  8. package/clients/rest/generated/data-contracts.js +168 -168
  9. package/clients/worker/worker.js +5 -1
  10. package/package.json +2 -3
  11. package/protoc/dispatcher/dispatcher.d.ts +1 -0
  12. package/protoc/dispatcher/dispatcher.js +17 -1
  13. package/protoc/v1/workflows.d.ts +6 -1
  14. package/protoc/v1/workflows.js +60 -4
  15. package/protoc/workflows/workflows.d.ts +2 -0
  16. package/protoc/workflows/workflows.js +17 -1
  17. package/step.d.ts +15 -34
  18. package/step.js +25 -42
  19. package/v1/client/client.d.ts +3 -11
  20. package/v1/client/client.interface.d.ts +0 -2
  21. package/v1/client/client.js +14 -35
  22. package/v1/client/worker.js +2 -4
  23. package/v1/declaration.d.ts +32 -6
  24. package/v1/declaration.js +55 -64
  25. package/v1/examples/cancellations/run.js +4 -4
  26. package/v1/examples/multiple_wf_concurrency/run.js +39 -0
  27. package/v1/examples/{middleware → multiple_wf_concurrency}/worker.js +3 -8
  28. package/v1/examples/multiple_wf_concurrency/workflow.d.ts +11 -0
  29. package/v1/examples/multiple_wf_concurrency/workflow.js +43 -0
  30. package/v1/examples/priority/run.d.ts +1 -0
  31. package/v1/examples/priority/run.js +41 -0
  32. package/v1/examples/priority/worker.d.ts +1 -0
  33. package/v1/examples/{middleware/run.js → priority/worker.js} +5 -15
  34. package/v1/examples/priority/workflow.d.ts +8 -0
  35. package/v1/examples/priority/workflow.js +50 -0
  36. package/v1/index.d.ts +1 -0
  37. package/v1/index.js +1 -0
  38. package/v1/task.d.ts +6 -7
  39. package/version.d.ts +1 -1
  40. package/version.js +1 -1
  41. package/v1/examples/middleware/hatchet-client.d.ts +0 -2
  42. package/v1/examples/middleware/hatchet-client.js +0 -32
  43. package/v1/examples/middleware/workflow.d.ts +0 -9
  44. package/v1/examples/middleware/workflow.js +0 -37
  45. package/v1/next/index.d.ts +0 -1
  46. package/v1/next/index.js +0 -17
  47. package/v1/next/middleware/middleware.d.ts +0 -27
  48. package/v1/next/middleware/middleware.js +0 -121
  49. /package/v1/examples/{middleware → multiple_wf_concurrency}/run.d.ts +0 -0
  50. /package/v1/examples/{middleware → multiple_wf_concurrency}/worker.d.ts +0 -0
@@ -11,112 +11,69 @@
11
11
  * ---------------------------------------------------------------
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.V1LogLineLevel = exports.V1TaskRunStatus = exports.V1TaskStatus = exports.WebhookWorkerRequestMethod = exports.LogLineOrderByDirection = exports.LogLineOrderByField = exports.LogLineLevel = exports.PullRequestState = exports.WorkerRuntimeSDKs = exports.StepRunEventSeverity = exports.StepRunEventReason = exports.StepRunStatus = exports.JobRunStatus = exports.WorkflowKind = exports.WorkflowRunStatus = exports.WorkflowRunOrderByDirection = exports.WorkflowRunOrderByField = exports.CronWorkflowsOrderByField = exports.ScheduledRunStatus = exports.ScheduledWorkflowsOrderByField = exports.RateLimitOrderByDirection = exports.RateLimitOrderByField = exports.EventOrderByDirection = exports.EventOrderByField = exports.TenantResource = exports.TenantMemberRole = void 0;
15
- var TenantMemberRole;
16
- (function (TenantMemberRole) {
17
- TenantMemberRole["OWNER"] = "OWNER";
18
- TenantMemberRole["ADMIN"] = "ADMIN";
19
- TenantMemberRole["MEMBER"] = "MEMBER";
20
- })(TenantMemberRole || (exports.TenantMemberRole = TenantMemberRole = {}));
21
- var TenantResource;
22
- (function (TenantResource) {
23
- TenantResource["WORKER"] = "WORKER";
24
- TenantResource["WORKER_SLOT"] = "WORKER_SLOT";
25
- TenantResource["EVENT"] = "EVENT";
26
- TenantResource["WORKFLOW_RUN"] = "WORKFLOW_RUN";
27
- TenantResource["TASK_RUN"] = "TASK_RUN";
28
- TenantResource["CRON"] = "CRON";
29
- TenantResource["SCHEDULE"] = "SCHEDULE";
30
- })(TenantResource || (exports.TenantResource = TenantResource = {}));
31
- var EventOrderByField;
32
- (function (EventOrderByField) {
33
- EventOrderByField["CreatedAt"] = "createdAt";
34
- })(EventOrderByField || (exports.EventOrderByField = EventOrderByField = {}));
35
- var EventOrderByDirection;
36
- (function (EventOrderByDirection) {
37
- EventOrderByDirection["Asc"] = "asc";
38
- EventOrderByDirection["Desc"] = "desc";
39
- })(EventOrderByDirection || (exports.EventOrderByDirection = EventOrderByDirection = {}));
40
- var RateLimitOrderByField;
41
- (function (RateLimitOrderByField) {
42
- RateLimitOrderByField["Key"] = "key";
43
- RateLimitOrderByField["Value"] = "value";
44
- RateLimitOrderByField["LimitValue"] = "limitValue";
45
- })(RateLimitOrderByField || (exports.RateLimitOrderByField = RateLimitOrderByField = {}));
46
- var RateLimitOrderByDirection;
47
- (function (RateLimitOrderByDirection) {
48
- RateLimitOrderByDirection["Asc"] = "asc";
49
- RateLimitOrderByDirection["Desc"] = "desc";
50
- })(RateLimitOrderByDirection || (exports.RateLimitOrderByDirection = RateLimitOrderByDirection = {}));
51
- var ScheduledWorkflowsOrderByField;
52
- (function (ScheduledWorkflowsOrderByField) {
53
- ScheduledWorkflowsOrderByField["TriggerAt"] = "triggerAt";
54
- ScheduledWorkflowsOrderByField["CreatedAt"] = "createdAt";
55
- })(ScheduledWorkflowsOrderByField || (exports.ScheduledWorkflowsOrderByField = ScheduledWorkflowsOrderByField = {}));
56
- var ScheduledRunStatus;
57
- (function (ScheduledRunStatus) {
58
- ScheduledRunStatus["PENDING"] = "PENDING";
59
- ScheduledRunStatus["RUNNING"] = "RUNNING";
60
- ScheduledRunStatus["SUCCEEDED"] = "SUCCEEDED";
61
- ScheduledRunStatus["FAILED"] = "FAILED";
62
- ScheduledRunStatus["CANCELLED"] = "CANCELLED";
63
- ScheduledRunStatus["QUEUED"] = "QUEUED";
64
- ScheduledRunStatus["SCHEDULED"] = "SCHEDULED";
65
- })(ScheduledRunStatus || (exports.ScheduledRunStatus = ScheduledRunStatus = {}));
66
- var CronWorkflowsOrderByField;
67
- (function (CronWorkflowsOrderByField) {
68
- CronWorkflowsOrderByField["Name"] = "name";
69
- CronWorkflowsOrderByField["CreatedAt"] = "createdAt";
70
- })(CronWorkflowsOrderByField || (exports.CronWorkflowsOrderByField = CronWorkflowsOrderByField = {}));
71
- var WorkflowRunOrderByField;
72
- (function (WorkflowRunOrderByField) {
73
- WorkflowRunOrderByField["CreatedAt"] = "createdAt";
74
- WorkflowRunOrderByField["StartedAt"] = "startedAt";
75
- WorkflowRunOrderByField["FinishedAt"] = "finishedAt";
76
- WorkflowRunOrderByField["Duration"] = "duration";
77
- })(WorkflowRunOrderByField || (exports.WorkflowRunOrderByField = WorkflowRunOrderByField = {}));
78
- var WorkflowRunOrderByDirection;
79
- (function (WorkflowRunOrderByDirection) {
80
- WorkflowRunOrderByDirection["ASC"] = "ASC";
81
- WorkflowRunOrderByDirection["DESC"] = "DESC";
82
- })(WorkflowRunOrderByDirection || (exports.WorkflowRunOrderByDirection = WorkflowRunOrderByDirection = {}));
83
- var WorkflowRunStatus;
84
- (function (WorkflowRunStatus) {
85
- WorkflowRunStatus["PENDING"] = "PENDING";
86
- WorkflowRunStatus["RUNNING"] = "RUNNING";
87
- WorkflowRunStatus["SUCCEEDED"] = "SUCCEEDED";
88
- WorkflowRunStatus["FAILED"] = "FAILED";
89
- WorkflowRunStatus["CANCELLED"] = "CANCELLED";
90
- WorkflowRunStatus["QUEUED"] = "QUEUED";
91
- WorkflowRunStatus["BACKOFF"] = "BACKOFF";
92
- })(WorkflowRunStatus || (exports.WorkflowRunStatus = WorkflowRunStatus = {}));
93
- var WorkflowKind;
94
- (function (WorkflowKind) {
95
- WorkflowKind["FUNCTION"] = "FUNCTION";
96
- WorkflowKind["DURABLE"] = "DURABLE";
97
- WorkflowKind["DAG"] = "DAG";
98
- })(WorkflowKind || (exports.WorkflowKind = WorkflowKind = {}));
99
- var JobRunStatus;
100
- (function (JobRunStatus) {
101
- JobRunStatus["PENDING"] = "PENDING";
102
- JobRunStatus["RUNNING"] = "RUNNING";
103
- JobRunStatus["SUCCEEDED"] = "SUCCEEDED";
104
- JobRunStatus["FAILED"] = "FAILED";
105
- JobRunStatus["CANCELLED"] = "CANCELLED";
106
- JobRunStatus["BACKOFF"] = "BACKOFF";
107
- })(JobRunStatus || (exports.JobRunStatus = JobRunStatus = {}));
108
- var StepRunStatus;
109
- (function (StepRunStatus) {
110
- StepRunStatus["PENDING"] = "PENDING";
111
- StepRunStatus["PENDING_ASSIGNMENT"] = "PENDING_ASSIGNMENT";
112
- StepRunStatus["ASSIGNED"] = "ASSIGNED";
113
- StepRunStatus["RUNNING"] = "RUNNING";
114
- StepRunStatus["SUCCEEDED"] = "SUCCEEDED";
115
- StepRunStatus["FAILED"] = "FAILED";
116
- StepRunStatus["CANCELLED"] = "CANCELLED";
117
- StepRunStatus["CANCELLING"] = "CANCELLING";
118
- StepRunStatus["BACKOFF"] = "BACKOFF";
119
- })(StepRunStatus || (exports.StepRunStatus = StepRunStatus = {}));
14
+ exports.TenantMemberRole = exports.TenantResource = exports.EventOrderByField = exports.EventOrderByDirection = exports.RateLimitOrderByField = exports.RateLimitOrderByDirection = exports.ScheduledWorkflowsOrderByField = exports.ScheduledRunStatus = exports.CronWorkflowsOrderByField = exports.WorkflowRunOrderByField = exports.WorkflowRunOrderByDirection = exports.WorkflowRunStatus = exports.WorkflowKind = exports.JobRunStatus = exports.StepRunStatus = exports.StepRunEventReason = exports.StepRunEventSeverity = exports.WorkerRuntimeSDKs = exports.PullRequestState = exports.LogLineLevel = exports.LogLineOrderByField = exports.LogLineOrderByDirection = exports.WebhookWorkerRequestMethod = exports.V1TaskStatus = exports.V1TaskRunStatus = exports.V1LogLineLevel = void 0;
15
+ var V1LogLineLevel;
16
+ (function (V1LogLineLevel) {
17
+ V1LogLineLevel["DEBUG"] = "DEBUG";
18
+ V1LogLineLevel["INFO"] = "INFO";
19
+ V1LogLineLevel["WARN"] = "WARN";
20
+ V1LogLineLevel["ERROR"] = "ERROR";
21
+ })(V1LogLineLevel || (exports.V1LogLineLevel = V1LogLineLevel = {}));
22
+ var V1TaskRunStatus;
23
+ (function (V1TaskRunStatus) {
24
+ V1TaskRunStatus["PENDING"] = "PENDING";
25
+ V1TaskRunStatus["RUNNING"] = "RUNNING";
26
+ V1TaskRunStatus["COMPLETED"] = "COMPLETED";
27
+ V1TaskRunStatus["FAILED"] = "FAILED";
28
+ V1TaskRunStatus["CANCELLED"] = "CANCELLED";
29
+ })(V1TaskRunStatus || (exports.V1TaskRunStatus = V1TaskRunStatus = {}));
30
+ var V1TaskStatus;
31
+ (function (V1TaskStatus) {
32
+ V1TaskStatus["QUEUED"] = "QUEUED";
33
+ V1TaskStatus["RUNNING"] = "RUNNING";
34
+ V1TaskStatus["COMPLETED"] = "COMPLETED";
35
+ V1TaskStatus["CANCELLED"] = "CANCELLED";
36
+ V1TaskStatus["FAILED"] = "FAILED";
37
+ })(V1TaskStatus || (exports.V1TaskStatus = V1TaskStatus = {}));
38
+ var WebhookWorkerRequestMethod;
39
+ (function (WebhookWorkerRequestMethod) {
40
+ WebhookWorkerRequestMethod["GET"] = "GET";
41
+ WebhookWorkerRequestMethod["POST"] = "POST";
42
+ WebhookWorkerRequestMethod["PUT"] = "PUT";
43
+ })(WebhookWorkerRequestMethod || (exports.WebhookWorkerRequestMethod = WebhookWorkerRequestMethod = {}));
44
+ var LogLineOrderByDirection;
45
+ (function (LogLineOrderByDirection) {
46
+ LogLineOrderByDirection["Asc"] = "asc";
47
+ LogLineOrderByDirection["Desc"] = "desc";
48
+ })(LogLineOrderByDirection || (exports.LogLineOrderByDirection = LogLineOrderByDirection = {}));
49
+ var LogLineOrderByField;
50
+ (function (LogLineOrderByField) {
51
+ LogLineOrderByField["CreatedAt"] = "createdAt";
52
+ })(LogLineOrderByField || (exports.LogLineOrderByField = LogLineOrderByField = {}));
53
+ var LogLineLevel;
54
+ (function (LogLineLevel) {
55
+ LogLineLevel["DEBUG"] = "DEBUG";
56
+ LogLineLevel["INFO"] = "INFO";
57
+ LogLineLevel["WARN"] = "WARN";
58
+ LogLineLevel["ERROR"] = "ERROR";
59
+ })(LogLineLevel || (exports.LogLineLevel = LogLineLevel = {}));
60
+ var PullRequestState;
61
+ (function (PullRequestState) {
62
+ PullRequestState["Open"] = "open";
63
+ PullRequestState["Closed"] = "closed";
64
+ })(PullRequestState || (exports.PullRequestState = PullRequestState = {}));
65
+ var WorkerRuntimeSDKs;
66
+ (function (WorkerRuntimeSDKs) {
67
+ WorkerRuntimeSDKs["GOLANG"] = "GOLANG";
68
+ WorkerRuntimeSDKs["PYTHON"] = "PYTHON";
69
+ WorkerRuntimeSDKs["TYPESCRIPT"] = "TYPESCRIPT";
70
+ })(WorkerRuntimeSDKs || (exports.WorkerRuntimeSDKs = WorkerRuntimeSDKs = {}));
71
+ var StepRunEventSeverity;
72
+ (function (StepRunEventSeverity) {
73
+ StepRunEventSeverity["INFO"] = "INFO";
74
+ StepRunEventSeverity["WARNING"] = "WARNING";
75
+ StepRunEventSeverity["CRITICAL"] = "CRITICAL";
76
+ })(StepRunEventSeverity || (exports.StepRunEventSeverity = StepRunEventSeverity = {}));
120
77
  var StepRunEventReason;
121
78
  (function (StepRunEventReason) {
122
79
  StepRunEventReason["REQUEUED_NO_WORKER"] = "REQUEUED_NO_WORKER";
@@ -137,65 +94,108 @@ var StepRunEventReason;
137
94
  StepRunEventReason["WORKFLOW_RUN_GROUP_KEY_SUCCEEDED"] = "WORKFLOW_RUN_GROUP_KEY_SUCCEEDED";
138
95
  StepRunEventReason["WORKFLOW_RUN_GROUP_KEY_FAILED"] = "WORKFLOW_RUN_GROUP_KEY_FAILED";
139
96
  })(StepRunEventReason || (exports.StepRunEventReason = StepRunEventReason = {}));
140
- var StepRunEventSeverity;
141
- (function (StepRunEventSeverity) {
142
- StepRunEventSeverity["INFO"] = "INFO";
143
- StepRunEventSeverity["WARNING"] = "WARNING";
144
- StepRunEventSeverity["CRITICAL"] = "CRITICAL";
145
- })(StepRunEventSeverity || (exports.StepRunEventSeverity = StepRunEventSeverity = {}));
146
- var WorkerRuntimeSDKs;
147
- (function (WorkerRuntimeSDKs) {
148
- WorkerRuntimeSDKs["GOLANG"] = "GOLANG";
149
- WorkerRuntimeSDKs["PYTHON"] = "PYTHON";
150
- WorkerRuntimeSDKs["TYPESCRIPT"] = "TYPESCRIPT";
151
- })(WorkerRuntimeSDKs || (exports.WorkerRuntimeSDKs = WorkerRuntimeSDKs = {}));
152
- var PullRequestState;
153
- (function (PullRequestState) {
154
- PullRequestState["Open"] = "open";
155
- PullRequestState["Closed"] = "closed";
156
- })(PullRequestState || (exports.PullRequestState = PullRequestState = {}));
157
- var LogLineLevel;
158
- (function (LogLineLevel) {
159
- LogLineLevel["DEBUG"] = "DEBUG";
160
- LogLineLevel["INFO"] = "INFO";
161
- LogLineLevel["WARN"] = "WARN";
162
- LogLineLevel["ERROR"] = "ERROR";
163
- })(LogLineLevel || (exports.LogLineLevel = LogLineLevel = {}));
164
- var LogLineOrderByField;
165
- (function (LogLineOrderByField) {
166
- LogLineOrderByField["CreatedAt"] = "createdAt";
167
- })(LogLineOrderByField || (exports.LogLineOrderByField = LogLineOrderByField = {}));
168
- var LogLineOrderByDirection;
169
- (function (LogLineOrderByDirection) {
170
- LogLineOrderByDirection["Asc"] = "asc";
171
- LogLineOrderByDirection["Desc"] = "desc";
172
- })(LogLineOrderByDirection || (exports.LogLineOrderByDirection = LogLineOrderByDirection = {}));
173
- var WebhookWorkerRequestMethod;
174
- (function (WebhookWorkerRequestMethod) {
175
- WebhookWorkerRequestMethod["GET"] = "GET";
176
- WebhookWorkerRequestMethod["POST"] = "POST";
177
- WebhookWorkerRequestMethod["PUT"] = "PUT";
178
- })(WebhookWorkerRequestMethod || (exports.WebhookWorkerRequestMethod = WebhookWorkerRequestMethod = {}));
179
- var V1TaskStatus;
180
- (function (V1TaskStatus) {
181
- V1TaskStatus["QUEUED"] = "QUEUED";
182
- V1TaskStatus["RUNNING"] = "RUNNING";
183
- V1TaskStatus["COMPLETED"] = "COMPLETED";
184
- V1TaskStatus["CANCELLED"] = "CANCELLED";
185
- V1TaskStatus["FAILED"] = "FAILED";
186
- })(V1TaskStatus || (exports.V1TaskStatus = V1TaskStatus = {}));
187
- var V1TaskRunStatus;
188
- (function (V1TaskRunStatus) {
189
- V1TaskRunStatus["PENDING"] = "PENDING";
190
- V1TaskRunStatus["RUNNING"] = "RUNNING";
191
- V1TaskRunStatus["COMPLETED"] = "COMPLETED";
192
- V1TaskRunStatus["FAILED"] = "FAILED";
193
- V1TaskRunStatus["CANCELLED"] = "CANCELLED";
194
- })(V1TaskRunStatus || (exports.V1TaskRunStatus = V1TaskRunStatus = {}));
195
- var V1LogLineLevel;
196
- (function (V1LogLineLevel) {
197
- V1LogLineLevel["DEBUG"] = "DEBUG";
198
- V1LogLineLevel["INFO"] = "INFO";
199
- V1LogLineLevel["WARN"] = "WARN";
200
- V1LogLineLevel["ERROR"] = "ERROR";
201
- })(V1LogLineLevel || (exports.V1LogLineLevel = V1LogLineLevel = {}));
97
+ var StepRunStatus;
98
+ (function (StepRunStatus) {
99
+ StepRunStatus["PENDING"] = "PENDING";
100
+ StepRunStatus["PENDING_ASSIGNMENT"] = "PENDING_ASSIGNMENT";
101
+ StepRunStatus["ASSIGNED"] = "ASSIGNED";
102
+ StepRunStatus["RUNNING"] = "RUNNING";
103
+ StepRunStatus["SUCCEEDED"] = "SUCCEEDED";
104
+ StepRunStatus["FAILED"] = "FAILED";
105
+ StepRunStatus["CANCELLED"] = "CANCELLED";
106
+ StepRunStatus["CANCELLING"] = "CANCELLING";
107
+ StepRunStatus["BACKOFF"] = "BACKOFF";
108
+ })(StepRunStatus || (exports.StepRunStatus = StepRunStatus = {}));
109
+ var JobRunStatus;
110
+ (function (JobRunStatus) {
111
+ JobRunStatus["PENDING"] = "PENDING";
112
+ JobRunStatus["RUNNING"] = "RUNNING";
113
+ JobRunStatus["SUCCEEDED"] = "SUCCEEDED";
114
+ JobRunStatus["FAILED"] = "FAILED";
115
+ JobRunStatus["CANCELLED"] = "CANCELLED";
116
+ JobRunStatus["BACKOFF"] = "BACKOFF";
117
+ })(JobRunStatus || (exports.JobRunStatus = JobRunStatus = {}));
118
+ var WorkflowKind;
119
+ (function (WorkflowKind) {
120
+ WorkflowKind["FUNCTION"] = "FUNCTION";
121
+ WorkflowKind["DURABLE"] = "DURABLE";
122
+ WorkflowKind["DAG"] = "DAG";
123
+ })(WorkflowKind || (exports.WorkflowKind = WorkflowKind = {}));
124
+ var WorkflowRunStatus;
125
+ (function (WorkflowRunStatus) {
126
+ WorkflowRunStatus["PENDING"] = "PENDING";
127
+ WorkflowRunStatus["RUNNING"] = "RUNNING";
128
+ WorkflowRunStatus["SUCCEEDED"] = "SUCCEEDED";
129
+ WorkflowRunStatus["FAILED"] = "FAILED";
130
+ WorkflowRunStatus["CANCELLED"] = "CANCELLED";
131
+ WorkflowRunStatus["QUEUED"] = "QUEUED";
132
+ WorkflowRunStatus["BACKOFF"] = "BACKOFF";
133
+ })(WorkflowRunStatus || (exports.WorkflowRunStatus = WorkflowRunStatus = {}));
134
+ var WorkflowRunOrderByDirection;
135
+ (function (WorkflowRunOrderByDirection) {
136
+ WorkflowRunOrderByDirection["ASC"] = "ASC";
137
+ WorkflowRunOrderByDirection["DESC"] = "DESC";
138
+ })(WorkflowRunOrderByDirection || (exports.WorkflowRunOrderByDirection = WorkflowRunOrderByDirection = {}));
139
+ var WorkflowRunOrderByField;
140
+ (function (WorkflowRunOrderByField) {
141
+ WorkflowRunOrderByField["CreatedAt"] = "createdAt";
142
+ WorkflowRunOrderByField["StartedAt"] = "startedAt";
143
+ WorkflowRunOrderByField["FinishedAt"] = "finishedAt";
144
+ WorkflowRunOrderByField["Duration"] = "duration";
145
+ })(WorkflowRunOrderByField || (exports.WorkflowRunOrderByField = WorkflowRunOrderByField = {}));
146
+ var CronWorkflowsOrderByField;
147
+ (function (CronWorkflowsOrderByField) {
148
+ CronWorkflowsOrderByField["Name"] = "name";
149
+ CronWorkflowsOrderByField["CreatedAt"] = "createdAt";
150
+ })(CronWorkflowsOrderByField || (exports.CronWorkflowsOrderByField = CronWorkflowsOrderByField = {}));
151
+ var ScheduledRunStatus;
152
+ (function (ScheduledRunStatus) {
153
+ ScheduledRunStatus["PENDING"] = "PENDING";
154
+ ScheduledRunStatus["RUNNING"] = "RUNNING";
155
+ ScheduledRunStatus["SUCCEEDED"] = "SUCCEEDED";
156
+ ScheduledRunStatus["FAILED"] = "FAILED";
157
+ ScheduledRunStatus["CANCELLED"] = "CANCELLED";
158
+ ScheduledRunStatus["QUEUED"] = "QUEUED";
159
+ ScheduledRunStatus["SCHEDULED"] = "SCHEDULED";
160
+ })(ScheduledRunStatus || (exports.ScheduledRunStatus = ScheduledRunStatus = {}));
161
+ var ScheduledWorkflowsOrderByField;
162
+ (function (ScheduledWorkflowsOrderByField) {
163
+ ScheduledWorkflowsOrderByField["TriggerAt"] = "triggerAt";
164
+ ScheduledWorkflowsOrderByField["CreatedAt"] = "createdAt";
165
+ })(ScheduledWorkflowsOrderByField || (exports.ScheduledWorkflowsOrderByField = ScheduledWorkflowsOrderByField = {}));
166
+ var RateLimitOrderByDirection;
167
+ (function (RateLimitOrderByDirection) {
168
+ RateLimitOrderByDirection["Asc"] = "asc";
169
+ RateLimitOrderByDirection["Desc"] = "desc";
170
+ })(RateLimitOrderByDirection || (exports.RateLimitOrderByDirection = RateLimitOrderByDirection = {}));
171
+ var RateLimitOrderByField;
172
+ (function (RateLimitOrderByField) {
173
+ RateLimitOrderByField["Key"] = "key";
174
+ RateLimitOrderByField["Value"] = "value";
175
+ RateLimitOrderByField["LimitValue"] = "limitValue";
176
+ })(RateLimitOrderByField || (exports.RateLimitOrderByField = RateLimitOrderByField = {}));
177
+ var EventOrderByDirection;
178
+ (function (EventOrderByDirection) {
179
+ EventOrderByDirection["Asc"] = "asc";
180
+ EventOrderByDirection["Desc"] = "desc";
181
+ })(EventOrderByDirection || (exports.EventOrderByDirection = EventOrderByDirection = {}));
182
+ var EventOrderByField;
183
+ (function (EventOrderByField) {
184
+ EventOrderByField["CreatedAt"] = "createdAt";
185
+ })(EventOrderByField || (exports.EventOrderByField = EventOrderByField = {}));
186
+ var TenantResource;
187
+ (function (TenantResource) {
188
+ TenantResource["WORKER"] = "WORKER";
189
+ TenantResource["WORKER_SLOT"] = "WORKER_SLOT";
190
+ TenantResource["EVENT"] = "EVENT";
191
+ TenantResource["WORKFLOW_RUN"] = "WORKFLOW_RUN";
192
+ TenantResource["TASK_RUN"] = "TASK_RUN";
193
+ TenantResource["CRON"] = "CRON";
194
+ TenantResource["SCHEDULE"] = "SCHEDULE";
195
+ })(TenantResource || (exports.TenantResource = TenantResource = {}));
196
+ var TenantMemberRole;
197
+ (function (TenantMemberRole) {
198
+ TenantMemberRole["OWNER"] = "OWNER";
199
+ TenantMemberRole["ADMIN"] = "ADMIN";
200
+ TenantMemberRole["MEMBER"] = "MEMBER";
201
+ })(TenantMemberRole || (exports.TenantMemberRole = TenantMemberRole = {}));
@@ -190,6 +190,8 @@ class V0Worker {
190
190
  ...(workflow.onCrons || []),
191
191
  ...(((_v = workflow.on) === null || _v === void 0 ? void 0 : _v.cron) ? [workflow.on.cron] : []),
192
192
  ];
193
+ const concurrencyArr = Array.isArray(concurrency) ? concurrency : [];
194
+ const concurrencySolo = !Array.isArray(concurrency) ? concurrency : undefined;
193
195
  const registeredWorkflow = this.client.admin.putWorkflowV1({
194
196
  name: workflow.name,
195
197
  description: workflow.description || '',
@@ -197,8 +199,9 @@ class V0Worker {
197
199
  eventTriggers,
198
200
  cronTriggers,
199
201
  sticky: workflow.sticky,
200
- concurrency,
202
+ concurrencyArr,
201
203
  onFailureTask,
204
+ defaultPriority: workflow.defaultPriority,
202
205
  tasks: [...workflow._tasks, ...workflow._durableTasks].map((task) => {
203
206
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
204
207
  return ({
@@ -229,6 +232,7 @@ class V0Worker {
229
232
  : [],
230
233
  });
231
234
  }),
235
+ concurrency: concurrencySolo,
232
236
  });
233
237
  this.registeredWorkflowPromises.push(registeredWorkflow);
234
238
  yield registeredWorkflow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hatchet-dev/typescript-sdk",
3
- "version": "1.2.0-alpha.1",
3
+ "version": "1.3.0",
4
4
  "description": "Background task orchestration & visibility for developers",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -88,6 +88,5 @@
88
88
  "qs": "^6.14.0",
89
89
  "yaml": "^2.7.1",
90
90
  "zod": "^3.24.2"
91
- },
92
- "packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
91
+ }
93
92
  }
@@ -158,6 +158,7 @@ export interface AssignedAction {
158
158
  childWorkflowKey?: string | undefined;
159
159
  /** (optional) the parent workflow run id (if this is a child workflow) */
160
160
  parentWorkflowRunId?: string | undefined;
161
+ priority: number;
161
162
  }
162
163
  export interface WorkerListenRequest {
163
164
  /** the id of the worker */
@@ -1093,6 +1093,7 @@ function createBaseAssignedAction() {
1093
1093
  childWorkflowIndex: undefined,
1094
1094
  childWorkflowKey: undefined,
1095
1095
  parentWorkflowRunId: undefined,
1096
+ priority: 0,
1096
1097
  };
1097
1098
  }
1098
1099
  exports.AssignedAction = {
@@ -1148,6 +1149,9 @@ exports.AssignedAction = {
1148
1149
  if (message.parentWorkflowRunId !== undefined) {
1149
1150
  writer.uint32(138).string(message.parentWorkflowRunId);
1150
1151
  }
1152
+ if (message.priority !== 0) {
1153
+ writer.uint32(144).int32(message.priority);
1154
+ }
1151
1155
  return writer;
1152
1156
  },
1153
1157
  decode(input, length) {
@@ -1276,6 +1280,13 @@ exports.AssignedAction = {
1276
1280
  message.parentWorkflowRunId = reader.string();
1277
1281
  continue;
1278
1282
  }
1283
+ case 18: {
1284
+ if (tag !== 144) {
1285
+ break;
1286
+ }
1287
+ message.priority = reader.int32();
1288
+ continue;
1289
+ }
1279
1290
  }
1280
1291
  if ((tag & 7) === 4 || tag === 0) {
1281
1292
  break;
@@ -1313,6 +1324,7 @@ exports.AssignedAction = {
1313
1324
  parentWorkflowRunId: isSet(object.parentWorkflowRunId)
1314
1325
  ? globalThis.String(object.parentWorkflowRunId)
1315
1326
  : undefined,
1327
+ priority: isSet(object.priority) ? globalThis.Number(object.priority) : 0,
1316
1328
  };
1317
1329
  },
1318
1330
  toJSON(message) {
@@ -1368,13 +1380,16 @@ exports.AssignedAction = {
1368
1380
  if (message.parentWorkflowRunId !== undefined) {
1369
1381
  obj.parentWorkflowRunId = message.parentWorkflowRunId;
1370
1382
  }
1383
+ if (message.priority !== 0) {
1384
+ obj.priority = Math.round(message.priority);
1385
+ }
1371
1386
  return obj;
1372
1387
  },
1373
1388
  create(base) {
1374
1389
  return exports.AssignedAction.fromPartial(base !== null && base !== void 0 ? base : {});
1375
1390
  },
1376
1391
  fromPartial(object) {
1377
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1392
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
1378
1393
  const message = createBaseAssignedAction();
1379
1394
  message.tenantId = (_a = object.tenantId) !== null && _a !== void 0 ? _a : '';
1380
1395
  message.workflowRunId = (_b = object.workflowRunId) !== null && _b !== void 0 ? _b : '';
@@ -1393,6 +1408,7 @@ exports.AssignedAction = {
1393
1408
  message.childWorkflowIndex = (_q = object.childWorkflowIndex) !== null && _q !== void 0 ? _q : undefined;
1394
1409
  message.childWorkflowKey = (_r = object.childWorkflowKey) !== null && _r !== void 0 ? _r : undefined;
1395
1410
  message.parentWorkflowRunId = (_s = object.parentWorkflowRunId) !== null && _s !== void 0 ? _s : undefined;
1411
+ message.priority = (_t = object.priority) !== null && _t !== void 0 ? _t : 0;
1396
1412
  return message;
1397
1413
  },
1398
1414
  };
@@ -71,6 +71,7 @@ export interface TriggerWorkflowRunRequest {
71
71
  workflowName: string;
72
72
  input: Uint8Array;
73
73
  additionalMetadata: Uint8Array;
74
+ priority?: number | undefined;
74
75
  }
75
76
  export interface TriggerWorkflowRunResponse {
76
77
  externalId: string;
@@ -89,7 +90,7 @@ export interface CreateWorkflowVersionRequest {
89
90
  cronTriggers: string[];
90
91
  /** (required) the workflow jobs */
91
92
  tasks: CreateTaskOpts[];
92
- /** (optional) the workflow concurrency options */
93
+ /** Deprecated: use concurrency_arr instead */
93
94
  concurrency: Concurrency | undefined;
94
95
  /** (optional) the input for the cron trigger */
95
96
  cronInput?: string | undefined;
@@ -97,6 +98,10 @@ export interface CreateWorkflowVersionRequest {
97
98
  onFailureTask?: CreateTaskOpts | undefined;
98
99
  /** (optional) the sticky strategy for assigning steps to workers */
99
100
  sticky?: StickyStrategy | undefined;
101
+ /** (optional) the default priority for the workflow */
102
+ defaultPriority?: number | undefined;
103
+ /** (optional) the workflow concurrency options */
104
+ concurrencyArr: Concurrency[];
100
105
  }
101
106
  export interface Concurrency {
102
107
  /** (required) the expression to use for concurrency */