@hatchet-dev/typescript-sdk 1.6.3 → 1.8.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/rest/generated/Api.d.ts +62 -1
- package/clients/rest/generated/Api.js +39 -0
- package/clients/rest/generated/data-contracts.d.ts +201 -161
- package/clients/rest/generated/data-contracts.js +168 -168
- package/package.json +2 -2
- package/protoc/v1/workflows.d.ts +11 -0
- package/protoc/v1/workflows.js +105 -3
- package/util/workflow-run-ref.js +4 -2
- package/v1/client/client.d.ts +7 -0
- package/v1/client/client.js +29 -0
- package/v1/client/features/filters.d.ts +1 -0
- package/v1/client/features/filters.js +6 -0
- package/v1/client/features/runs.d.ts +1 -0
- package/v1/client/features/runs.js +7 -0
- package/v1/client/features/tenant.d.ts +15 -0
- package/v1/client/features/tenant.js +31 -0
- package/v1/client/worker/worker-internal.js +13 -1
- package/v1/declaration.d.ts +13 -1
- package/v1/declaration.js +17 -6
- package/v1/examples/cancellations/workflow.js +2 -2
- package/v1/examples/child_workflows/workflow.js +1 -1
- package/v1/examples/on_event/workflow.d.ts +1 -0
- package/v1/examples/on_event/workflow.js +27 -1
- package/v1/examples/simple/run.js +10 -5
- package/v1/examples/sticky/workflow.js +1 -1
- package/v1/parent-run-context-vars.d.ts +15 -0
- package/v1/parent-run-context-vars.js +35 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -11,69 +11,112 @@
|
|
|
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
|
-
|
|
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 = {}));
|
|
77
120
|
var StepRunEventReason;
|
|
78
121
|
(function (StepRunEventReason) {
|
|
79
122
|
StepRunEventReason["REQUEUED_NO_WORKER"] = "REQUEUED_NO_WORKER";
|
|
@@ -94,108 +137,65 @@ var StepRunEventReason;
|
|
|
94
137
|
StepRunEventReason["WORKFLOW_RUN_GROUP_KEY_SUCCEEDED"] = "WORKFLOW_RUN_GROUP_KEY_SUCCEEDED";
|
|
95
138
|
StepRunEventReason["WORKFLOW_RUN_GROUP_KEY_FAILED"] = "WORKFLOW_RUN_GROUP_KEY_FAILED";
|
|
96
139
|
})(StepRunEventReason || (exports.StepRunEventReason = StepRunEventReason = {}));
|
|
97
|
-
var
|
|
98
|
-
(function (
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
})(
|
|
109
|
-
var
|
|
110
|
-
(function (
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
(
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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 = {}));
|
|
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 = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"test:e2e": "jest --testMatch='**/*.e2e.ts'",
|
|
26
26
|
"test:unit:watch": "jest --testMatch='**/*.test.ts' --watch",
|
|
27
27
|
"generate": "pnpm run '/generate-.*/'",
|
|
28
|
-
"generate-api": "npx --yes swagger-cli bundle ../../api-contracts/openapi/openapi.yaml --outfile openapi.yaml --type yaml && npx swagger-typescript-api generate -p openapi.yaml -o src/clients/rest/generated -n hatchet.ts --modular --axios",
|
|
28
|
+
"generate-api": "npx --yes swagger-cli bundle ../../api-contracts/openapi/openapi.yaml --outfile openapi.yaml --type yaml && npx swagger-typescript-api@13.1.0 generate -p openapi.yaml -o src/clients/rest/generated -n hatchet.ts --modular --axios",
|
|
29
29
|
"generate-protoc": "./generate-protoc.sh",
|
|
30
30
|
"lint:check": "npm run eslint:check && npm run prettier:check",
|
|
31
31
|
"lint:fix": "npm run eslint:fix && npm run prettier:fix",
|
package/protoc/v1/workflows.d.ts
CHANGED
|
@@ -102,6 +102,16 @@ export interface CreateWorkflowVersionRequest {
|
|
|
102
102
|
defaultPriority?: number | undefined;
|
|
103
103
|
/** (optional) the workflow concurrency options */
|
|
104
104
|
concurrencyArr: Concurrency[];
|
|
105
|
+
/** (optional) the default filters for the workflow */
|
|
106
|
+
defaultFilters: DefaultFilter[];
|
|
107
|
+
}
|
|
108
|
+
export interface DefaultFilter {
|
|
109
|
+
/** (required) the CEL expression for the filter */
|
|
110
|
+
expression: string;
|
|
111
|
+
/** (required) the scope of the filter */
|
|
112
|
+
scope: string;
|
|
113
|
+
/** (optional) the payload for the filter, if any. A JSON object as a string. */
|
|
114
|
+
payload?: string | undefined;
|
|
105
115
|
}
|
|
106
116
|
export interface Concurrency {
|
|
107
117
|
/** (required) the expression to use for concurrency */
|
|
@@ -195,6 +205,7 @@ export declare const ReplayTasksResponse: MessageFns<ReplayTasksResponse>;
|
|
|
195
205
|
export declare const TriggerWorkflowRunRequest: MessageFns<TriggerWorkflowRunRequest>;
|
|
196
206
|
export declare const TriggerWorkflowRunResponse: MessageFns<TriggerWorkflowRunResponse>;
|
|
197
207
|
export declare const CreateWorkflowVersionRequest: MessageFns<CreateWorkflowVersionRequest>;
|
|
208
|
+
export declare const DefaultFilter: MessageFns<DefaultFilter>;
|
|
198
209
|
export declare const Concurrency: MessageFns<Concurrency>;
|
|
199
210
|
export declare const DesiredWorkerLabels: MessageFns<DesiredWorkerLabels>;
|
|
200
211
|
export declare const CreateTaskOpts: MessageFns<CreateTaskOpts>;
|
package/protoc/v1/workflows.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v3.19.1
|
|
6
6
|
// source: v1/workflows.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.AdminServiceDefinition = exports.CreateWorkflowVersionResponse = exports.CreateTaskRateLimit = exports.CreateTaskOpts_WorkerLabelsEntry = exports.CreateTaskOpts = exports.DesiredWorkerLabels = exports.Concurrency = exports.CreateWorkflowVersionRequest = exports.TriggerWorkflowRunResponse = exports.TriggerWorkflowRunRequest = exports.ReplayTasksResponse = exports.CancelTasksResponse = exports.TasksFilter = exports.ReplayTasksRequest = exports.CancelTasksRequest = exports.WorkerLabelComparator = exports.ConcurrencyLimitStrategy = exports.RateLimitDuration = exports.StickyStrategy = exports.protobufPackage = void 0;
|
|
8
|
+
exports.AdminServiceDefinition = exports.CreateWorkflowVersionResponse = exports.CreateTaskRateLimit = exports.CreateTaskOpts_WorkerLabelsEntry = exports.CreateTaskOpts = exports.DesiredWorkerLabels = exports.Concurrency = exports.DefaultFilter = exports.CreateWorkflowVersionRequest = exports.TriggerWorkflowRunResponse = exports.TriggerWorkflowRunRequest = exports.ReplayTasksResponse = exports.CancelTasksResponse = exports.TasksFilter = exports.ReplayTasksRequest = exports.CancelTasksRequest = exports.WorkerLabelComparator = exports.ConcurrencyLimitStrategy = exports.RateLimitDuration = exports.StickyStrategy = exports.protobufPackage = void 0;
|
|
9
9
|
exports.stickyStrategyFromJSON = stickyStrategyFromJSON;
|
|
10
10
|
exports.stickyStrategyToJSON = stickyStrategyToJSON;
|
|
11
11
|
exports.rateLimitDurationFromJSON = rateLimitDurationFromJSON;
|
|
@@ -780,6 +780,7 @@ function createBaseCreateWorkflowVersionRequest() {
|
|
|
780
780
|
sticky: undefined,
|
|
781
781
|
defaultPriority: undefined,
|
|
782
782
|
concurrencyArr: [],
|
|
783
|
+
defaultFilters: [],
|
|
783
784
|
};
|
|
784
785
|
}
|
|
785
786
|
exports.CreateWorkflowVersionRequest = {
|
|
@@ -820,6 +821,9 @@ exports.CreateWorkflowVersionRequest = {
|
|
|
820
821
|
for (const v of message.concurrencyArr) {
|
|
821
822
|
exports.Concurrency.encode(v, writer.uint32(98).fork()).join();
|
|
822
823
|
}
|
|
824
|
+
for (const v of message.defaultFilters) {
|
|
825
|
+
exports.DefaultFilter.encode(v, writer.uint32(106).fork()).join();
|
|
826
|
+
}
|
|
823
827
|
return writer;
|
|
824
828
|
},
|
|
825
829
|
decode(input, length) {
|
|
@@ -913,6 +917,13 @@ exports.CreateWorkflowVersionRequest = {
|
|
|
913
917
|
message.concurrencyArr.push(exports.Concurrency.decode(reader, reader.uint32()));
|
|
914
918
|
continue;
|
|
915
919
|
}
|
|
920
|
+
case 13: {
|
|
921
|
+
if (tag !== 106) {
|
|
922
|
+
break;
|
|
923
|
+
}
|
|
924
|
+
message.defaultFilters.push(exports.DefaultFilter.decode(reader, reader.uint32()));
|
|
925
|
+
continue;
|
|
926
|
+
}
|
|
916
927
|
}
|
|
917
928
|
if ((tag & 7) === 4 || tag === 0) {
|
|
918
929
|
break;
|
|
@@ -947,10 +958,13 @@ exports.CreateWorkflowVersionRequest = {
|
|
|
947
958
|
concurrencyArr: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.concurrencyArr)
|
|
948
959
|
? object.concurrencyArr.map((e) => exports.Concurrency.fromJSON(e))
|
|
949
960
|
: [],
|
|
961
|
+
defaultFilters: globalThis.Array.isArray(object === null || object === void 0 ? void 0 : object.defaultFilters)
|
|
962
|
+
? object.defaultFilters.map((e) => exports.DefaultFilter.fromJSON(e))
|
|
963
|
+
: [],
|
|
950
964
|
};
|
|
951
965
|
},
|
|
952
966
|
toJSON(message) {
|
|
953
|
-
var _a, _b, _c, _d;
|
|
967
|
+
var _a, _b, _c, _d, _e;
|
|
954
968
|
const obj = {};
|
|
955
969
|
if (message.name !== '') {
|
|
956
970
|
obj.name = message.name;
|
|
@@ -988,13 +1002,16 @@ exports.CreateWorkflowVersionRequest = {
|
|
|
988
1002
|
if ((_d = message.concurrencyArr) === null || _d === void 0 ? void 0 : _d.length) {
|
|
989
1003
|
obj.concurrencyArr = message.concurrencyArr.map((e) => exports.Concurrency.toJSON(e));
|
|
990
1004
|
}
|
|
1005
|
+
if ((_e = message.defaultFilters) === null || _e === void 0 ? void 0 : _e.length) {
|
|
1006
|
+
obj.defaultFilters = message.defaultFilters.map((e) => exports.DefaultFilter.toJSON(e));
|
|
1007
|
+
}
|
|
991
1008
|
return obj;
|
|
992
1009
|
},
|
|
993
1010
|
create(base) {
|
|
994
1011
|
return exports.CreateWorkflowVersionRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
995
1012
|
},
|
|
996
1013
|
fromPartial(object) {
|
|
997
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1014
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
998
1015
|
const message = createBaseCreateWorkflowVersionRequest();
|
|
999
1016
|
message.name = (_a = object.name) !== null && _a !== void 0 ? _a : '';
|
|
1000
1017
|
message.description = (_b = object.description) !== null && _b !== void 0 ? _b : '';
|
|
@@ -1014,6 +1031,91 @@ exports.CreateWorkflowVersionRequest = {
|
|
|
1014
1031
|
message.sticky = (_h = object.sticky) !== null && _h !== void 0 ? _h : undefined;
|
|
1015
1032
|
message.defaultPriority = (_j = object.defaultPriority) !== null && _j !== void 0 ? _j : undefined;
|
|
1016
1033
|
message.concurrencyArr = ((_k = object.concurrencyArr) === null || _k === void 0 ? void 0 : _k.map((e) => exports.Concurrency.fromPartial(e))) || [];
|
|
1034
|
+
message.defaultFilters = ((_l = object.defaultFilters) === null || _l === void 0 ? void 0 : _l.map((e) => exports.DefaultFilter.fromPartial(e))) || [];
|
|
1035
|
+
return message;
|
|
1036
|
+
},
|
|
1037
|
+
};
|
|
1038
|
+
function createBaseDefaultFilter() {
|
|
1039
|
+
return { expression: '', scope: '', payload: undefined };
|
|
1040
|
+
}
|
|
1041
|
+
exports.DefaultFilter = {
|
|
1042
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
1043
|
+
if (message.expression !== '') {
|
|
1044
|
+
writer.uint32(10).string(message.expression);
|
|
1045
|
+
}
|
|
1046
|
+
if (message.scope !== '') {
|
|
1047
|
+
writer.uint32(18).string(message.scope);
|
|
1048
|
+
}
|
|
1049
|
+
if (message.payload !== undefined) {
|
|
1050
|
+
writer.uint32(26).string(message.payload);
|
|
1051
|
+
}
|
|
1052
|
+
return writer;
|
|
1053
|
+
},
|
|
1054
|
+
decode(input, length) {
|
|
1055
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
1056
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
1057
|
+
const message = createBaseDefaultFilter();
|
|
1058
|
+
while (reader.pos < end) {
|
|
1059
|
+
const tag = reader.uint32();
|
|
1060
|
+
switch (tag >>> 3) {
|
|
1061
|
+
case 1: {
|
|
1062
|
+
if (tag !== 10) {
|
|
1063
|
+
break;
|
|
1064
|
+
}
|
|
1065
|
+
message.expression = reader.string();
|
|
1066
|
+
continue;
|
|
1067
|
+
}
|
|
1068
|
+
case 2: {
|
|
1069
|
+
if (tag !== 18) {
|
|
1070
|
+
break;
|
|
1071
|
+
}
|
|
1072
|
+
message.scope = reader.string();
|
|
1073
|
+
continue;
|
|
1074
|
+
}
|
|
1075
|
+
case 3: {
|
|
1076
|
+
if (tag !== 26) {
|
|
1077
|
+
break;
|
|
1078
|
+
}
|
|
1079
|
+
message.payload = reader.string();
|
|
1080
|
+
continue;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
reader.skip(tag & 7);
|
|
1087
|
+
}
|
|
1088
|
+
return message;
|
|
1089
|
+
},
|
|
1090
|
+
fromJSON(object) {
|
|
1091
|
+
return {
|
|
1092
|
+
expression: isSet(object.expression) ? globalThis.String(object.expression) : '',
|
|
1093
|
+
scope: isSet(object.scope) ? globalThis.String(object.scope) : '',
|
|
1094
|
+
payload: isSet(object.payload) ? globalThis.String(object.payload) : undefined,
|
|
1095
|
+
};
|
|
1096
|
+
},
|
|
1097
|
+
toJSON(message) {
|
|
1098
|
+
const obj = {};
|
|
1099
|
+
if (message.expression !== '') {
|
|
1100
|
+
obj.expression = message.expression;
|
|
1101
|
+
}
|
|
1102
|
+
if (message.scope !== '') {
|
|
1103
|
+
obj.scope = message.scope;
|
|
1104
|
+
}
|
|
1105
|
+
if (message.payload !== undefined) {
|
|
1106
|
+
obj.payload = message.payload;
|
|
1107
|
+
}
|
|
1108
|
+
return obj;
|
|
1109
|
+
},
|
|
1110
|
+
create(base) {
|
|
1111
|
+
return exports.DefaultFilter.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
1112
|
+
},
|
|
1113
|
+
fromPartial(object) {
|
|
1114
|
+
var _a, _b, _c;
|
|
1115
|
+
const message = createBaseDefaultFilter();
|
|
1116
|
+
message.expression = (_a = object.expression) !== null && _a !== void 0 ? _a : '';
|
|
1117
|
+
message.scope = (_b = object.scope) !== null && _b !== void 0 ? _b : '';
|
|
1118
|
+
message.payload = (_c = object.payload) !== null && _c !== void 0 ? _c : undefined;
|
|
1017
1119
|
return message;
|
|
1018
1120
|
},
|
|
1019
1121
|
};
|
package/util/workflow-run-ref.js
CHANGED
|
@@ -94,8 +94,10 @@ class WorkflowRunRef {
|
|
|
94
94
|
_f = false;
|
|
95
95
|
const event = _c;
|
|
96
96
|
if (event.eventType === dispatcher_1.WorkflowRunEventType.WORKFLOW_RUN_EVENT_TYPE_FINISHED) {
|
|
97
|
-
if (event.results.some((r) =>
|
|
98
|
-
|
|
97
|
+
if (event.results.some((r) => r.error !== undefined)) {
|
|
98
|
+
// HACK: this might replace intentional empty errors but this is the more common case
|
|
99
|
+
const errors = event.results.map((r) => r.error !== '' ? r.error : 'task was cancelled');
|
|
100
|
+
reject(errors);
|
|
99
101
|
return;
|
|
100
102
|
}
|
|
101
103
|
if (event.results.length === 0) {
|
package/v1/client/client.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import { AdminClient } from './admin';
|
|
|
17
17
|
import { FiltersClient } from './features/filters';
|
|
18
18
|
import { ScheduleClient } from './features/schedules';
|
|
19
19
|
import { CronClient } from './features/crons';
|
|
20
|
+
import { TenantClient } from './features/tenant';
|
|
20
21
|
/**
|
|
21
22
|
* HatchetV1 implements the main client interface for interacting with the Hatchet workflow engine.
|
|
22
23
|
* It provides methods for creating and executing workflows, as well as managing workers.
|
|
@@ -177,6 +178,12 @@ export declare class HatchetClient implements IHatchetClient {
|
|
|
177
178
|
* @returns A filters client instance
|
|
178
179
|
*/
|
|
179
180
|
get filters(): FiltersClient;
|
|
181
|
+
private _tenant;
|
|
182
|
+
/**
|
|
183
|
+
* Get the tenant client for managing tenants
|
|
184
|
+
* @returns A tenant client instance
|
|
185
|
+
*/
|
|
186
|
+
get tenant(): TenantClient;
|
|
180
187
|
private _ratelimits;
|
|
181
188
|
/**
|
|
182
189
|
* Get the rate limits client for creating and managing rate limits
|