@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.
- package/clients/admin/admin-client.d.ts +3 -1
- package/clients/admin/admin-client.js +1 -1
- package/clients/hatchet-client/features/cron-client.d.ts +3 -0
- package/clients/hatchet-client/features/cron-client.js +2 -0
- package/clients/hatchet-client/features/schedule-client.d.ts +3 -0
- package/clients/hatchet-client/features/schedule-client.js +2 -0
- package/clients/rest/generated/data-contracts.d.ts +193 -167
- package/clients/rest/generated/data-contracts.js +168 -168
- package/clients/worker/worker.js +5 -1
- package/package.json +2 -3
- package/protoc/dispatcher/dispatcher.d.ts +1 -0
- package/protoc/dispatcher/dispatcher.js +17 -1
- package/protoc/v1/workflows.d.ts +6 -1
- package/protoc/v1/workflows.js +60 -4
- package/protoc/workflows/workflows.d.ts +2 -0
- package/protoc/workflows/workflows.js +17 -1
- package/step.d.ts +15 -34
- package/step.js +25 -42
- package/v1/client/client.d.ts +3 -11
- package/v1/client/client.interface.d.ts +0 -2
- package/v1/client/client.js +14 -35
- package/v1/client/worker.js +2 -4
- package/v1/declaration.d.ts +32 -6
- package/v1/declaration.js +55 -64
- package/v1/examples/cancellations/run.js +4 -4
- package/v1/examples/multiple_wf_concurrency/run.js +39 -0
- package/v1/examples/{middleware → multiple_wf_concurrency}/worker.js +3 -8
- package/v1/examples/multiple_wf_concurrency/workflow.d.ts +11 -0
- package/v1/examples/multiple_wf_concurrency/workflow.js +43 -0
- package/v1/examples/priority/run.d.ts +1 -0
- package/v1/examples/priority/run.js +41 -0
- package/v1/examples/priority/worker.d.ts +1 -0
- package/v1/examples/{middleware/run.js → priority/worker.js} +5 -15
- package/v1/examples/priority/workflow.d.ts +8 -0
- package/v1/examples/priority/workflow.js +50 -0
- package/v1/index.d.ts +1 -0
- package/v1/index.js +1 -0
- package/v1/task.d.ts +6 -7
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/v1/examples/middleware/hatchet-client.d.ts +0 -2
- package/v1/examples/middleware/hatchet-client.js +0 -32
- package/v1/examples/middleware/workflow.d.ts +0 -9
- package/v1/examples/middleware/workflow.js +0 -37
- package/v1/next/index.d.ts +0 -1
- package/v1/next/index.js +0 -17
- package/v1/next/middleware/middleware.d.ts +0 -27
- package/v1/next/middleware/middleware.js +0 -121
- /package/v1/examples/{middleware → multiple_wf_concurrency}/run.d.ts +0 -0
- /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.
|
|
15
|
-
var
|
|
16
|
-
(function (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
})(
|
|
71
|
-
var
|
|
72
|
-
(function (
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
141
|
-
(function (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
})(
|
|
152
|
-
var
|
|
153
|
-
(function (
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
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 = {}));
|
package/clients/worker/worker.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
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
|
};
|
package/protoc/v1/workflows.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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 */
|