@hatchet-dev/typescript-sdk 1.6.3 → 1.7.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.
@@ -11,69 +11,112 @@
11
11
  * ---------------------------------------------------------------
12
12
  */
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
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 = {}));
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 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 = {}));
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.6.3",
3
+ "version": "1.7.1",
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",
@@ -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>;
@@ -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
  };
@@ -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
@@ -21,6 +21,7 @@ const rest_1 = __importDefault(require("../../clients/rest"));
21
21
  const config_loader_1 = require("../../util/config-loader");
22
22
  const hatchet_logger_1 = require("../../clients/hatchet-client/hatchet-logger");
23
23
  const zod_1 = require("zod");
24
+ const event_client_1 = require("../../clients/event/event-client");
24
25
  const declaration_1 = require("../declaration");
25
26
  const worker_1 = require("./worker/worker");
26
27
  const metrics_1 = require("./features/metrics");
@@ -32,6 +33,7 @@ const admin_1 = require("./admin");
32
33
  const filters_1 = require("./features/filters");
33
34
  const schedules_1 = require("./features/schedules");
34
35
  const crons_1 = require("./features/crons");
36
+ const tenant_1 = require("./features/tenant");
35
37
  /**
36
38
  * HatchetV1 implements the main client interface for interacting with the Hatchet workflow engine.
37
39
  * It provides methods for creating and executing workflows, as well as managing workers.
@@ -75,6 +77,23 @@ class HatchetClient {
75
77
  }
76
78
  throw e;
77
79
  }
80
+ try {
81
+ this.tenant
82
+ .get()
83
+ .then((tenant) => {
84
+ if (tenant.version !== 'V1') {
85
+ this.config
86
+ .logger('client-init', event_client_1.LogLevel.INFO)
87
+ .warn('🚨⚠️‼️ YOU ARE USING A V0 ENGINE WITH A V1 SDK, WHICH IS NOT SUPPORTED. PLEASE UPGRADE YOUR ENGINE TO V1.🚨⚠️‼️');
88
+ }
89
+ })
90
+ .catch((error) => {
91
+ // Do nothing here
92
+ });
93
+ }
94
+ catch (e) {
95
+ // Do nothing here
96
+ }
78
97
  }
79
98
  /**
80
99
  * Static factory method to create a new Hatchet client instance.
@@ -243,6 +262,16 @@ class HatchetClient {
243
262
  }
244
263
  return this._filters;
245
264
  }
265
+ /**
266
+ * Get the tenant client for managing tenants
267
+ * @returns A tenant client instance
268
+ */
269
+ get tenant() {
270
+ if (!this._tenant) {
271
+ this._tenant = new tenant_1.TenantClient(this);
272
+ }
273
+ return this._tenant;
274
+ }
246
275
  /**
247
276
  * Get the rate limits client for creating and managing rate limits
248
277
  * @returns A rate limits client instance