@hatchet-dev/typescript-sdk 0.7.0 → 0.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.
- package/clients/admin/admin-client.js +2 -2
- package/clients/dispatcher/heartbeat/heartbeat-controller.js +1 -1
- package/clients/hatchet-client/hatchet-client.d.ts +1 -1
- package/clients/listener/child-listener-client.d.ts +2 -2
- package/clients/listener/child-listener-client.js +3 -3
- package/clients/listener/listener-client.d.ts +1 -1
- package/clients/listener/listener-client.js +3 -3
- package/clients/rest/generated/Api.d.ts +210 -3
- package/clients/rest/generated/Api.js +151 -3
- package/clients/rest/generated/data-contracts.d.ts +153 -0
- package/clients/rest/generated/data-contracts.js +24 -1
- package/clients/rest/generated/http-client.d.ts +1 -1
- package/clients/worker/worker.js +3 -3
- package/package.json +2 -2
- package/step.d.ts +2 -2
- package/util/retrier.js +2 -2
- package/workflow.d.ts +10 -10
|
@@ -56,8 +56,8 @@ class AdminClient {
|
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
put_rate_limit(
|
|
60
|
-
return __awaiter(this,
|
|
59
|
+
put_rate_limit(key_1, limit_1) {
|
|
60
|
+
return __awaiter(this, arguments, void 0, function* (key, limit, duration = workflows_1.RateLimitDuration.SECOND) {
|
|
61
61
|
try {
|
|
62
62
|
yield (0, retrier_1.retrier)(() => __awaiter(this, void 0, void 0, function* () {
|
|
63
63
|
return this.client.putRateLimit({
|
|
@@ -36,8 +36,8 @@ class Heartbeat {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
stop() {
|
|
39
|
-
var _a, _b;
|
|
40
39
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
var _a, _b;
|
|
41
41
|
(_a = this.heartbeatWorker) === null || _a === void 0 ? void 0 : _a.postMessage('stop');
|
|
42
42
|
(_b = this.heartbeatWorker) === null || _b === void 0 ? void 0 : _b.terminate();
|
|
43
43
|
this.heartbeatWorker = undefined;
|
|
@@ -14,7 +14,7 @@ export interface HatchetClientOptions {
|
|
|
14
14
|
credentials?: ChannelCredentials;
|
|
15
15
|
}
|
|
16
16
|
export declare const channelFactory: (config: ClientConfig, credentials: ChannelCredentials) => import("nice-grpc").Channel;
|
|
17
|
-
export declare const addTokenMiddleware: (token: string) => <
|
|
17
|
+
export declare const addTokenMiddleware: (token: string) => <Request, Response>(call: ClientMiddlewareCall<Request, Response>, options: CallOptions) => AsyncGenerator<Awaited<Response>, Awaited<Response> | undefined, undefined>;
|
|
18
18
|
export declare class HatchetClient {
|
|
19
19
|
config: ClientConfig;
|
|
20
20
|
credentials: ChannelCredentials;
|
|
@@ -5,13 +5,13 @@ import { ListenerClient } from './listener-client';
|
|
|
5
5
|
export declare class Streamable {
|
|
6
6
|
listener: AsyncIterable<WorkflowRunEvent>;
|
|
7
7
|
id: string;
|
|
8
|
-
responseEmitter: EventEmitter
|
|
8
|
+
responseEmitter: EventEmitter<[never]>;
|
|
9
9
|
constructor(listener: AsyncIterable<WorkflowRunEvent>, id: string);
|
|
10
10
|
stream(): AsyncGenerator<WorkflowRunEvent, void, unknown>;
|
|
11
11
|
}
|
|
12
12
|
export declare class GrpcPooledListener {
|
|
13
13
|
listener: AsyncIterable<WorkflowRunEvent> | undefined;
|
|
14
|
-
requestEmitter: EventEmitter
|
|
14
|
+
requestEmitter: EventEmitter<[never]>;
|
|
15
15
|
signal: AbortController;
|
|
16
16
|
client: ListenerClient;
|
|
17
17
|
subscribers: Record<string, Streamable>;
|
|
@@ -68,9 +68,9 @@ class GrpcPooledListener {
|
|
|
68
68
|
this.init();
|
|
69
69
|
this.onFinish = onFinish;
|
|
70
70
|
}
|
|
71
|
-
init(
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
init() {
|
|
72
|
+
return __awaiter(this, arguments, void 0, function* (retries = 0) {
|
|
73
|
+
var _a, e_1, _b, _c;
|
|
74
74
|
if (retries > DEFAULT_EVENT_LISTENER_RETRY_COUNT)
|
|
75
75
|
return;
|
|
76
76
|
if (retries > 0) {
|
|
@@ -26,7 +26,7 @@ export interface StepRunEvent {
|
|
|
26
26
|
export declare class PollingAsyncListener {
|
|
27
27
|
client: ListenerClient;
|
|
28
28
|
q: Array<StepRunEvent>;
|
|
29
|
-
eventEmitter: EventEmitter
|
|
29
|
+
eventEmitter: EventEmitter<[never]>;
|
|
30
30
|
pollInterval: any;
|
|
31
31
|
constructor(workflowRunid: string, client: ListenerClient);
|
|
32
32
|
emit(event: StepRunEvent): void;
|
|
@@ -107,9 +107,9 @@ class PollingAsyncListener {
|
|
|
107
107
|
this.eventEmitter.emit('event');
|
|
108
108
|
}
|
|
109
109
|
listen(workflowRunId) {
|
|
110
|
-
var _a, e_1, _b, _c;
|
|
111
|
-
var _d;
|
|
112
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
var _a, e_1, _b, _c;
|
|
112
|
+
var _d;
|
|
113
113
|
let listener = this.client.client.subscribeToWorkflowEvents({
|
|
114
114
|
workflowRunId,
|
|
115
115
|
});
|
|
@@ -180,8 +180,8 @@ class PollingAsyncListener {
|
|
|
180
180
|
});
|
|
181
181
|
}
|
|
182
182
|
getWorkflowRun(workflowRunId) {
|
|
183
|
-
var _a, _b, _c;
|
|
184
183
|
return __awaiter(this, void 0, void 0, function* () {
|
|
184
|
+
var _a, _b, _c;
|
|
185
185
|
try {
|
|
186
186
|
const res = yield this.client.api.workflowRunGet(this.client.config.tenant_id, workflowRunId);
|
|
187
187
|
const stepRuns = (_c = (_b = (_a = res.data.jobRuns) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.stepRuns) !== null && _c !== void 0 ? _c : [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIMeta, AcceptInviteRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreatePullRequestFromStepRun, CreateSNSIntegrationRequest, CreateTenantInviteRequest, CreateTenantRequest, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, GetStepRunDiffResponse, LinkGithubRepositoryRequest, ListAPIMetaIntegration, ListAPITokensResponse, ListGithubAppInstallationsResponse, ListGithubBranchesResponse, ListGithubReposResponse, ListPullRequestsResponse, ListSNSIntegrations, LogLineLevelField, LogLineList, LogLineOrderByDirection, LogLineOrderByField, LogLineSearch, PullRequestState, RejectInviteRequest, ReplayEventRequest, RerunStepRunRequest, SNSIntegration, StepRun, Tenant, TenantInvite, TenantInviteList, TenantMemberList, TriggerWorkflowRunRequest, UpdateTenantInviteRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, Worker, WorkerList, Workflow, WorkflowID, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunStatus, WorkflowRunStatusList, WorkflowVersion, WorkflowVersionDefinition } from './data-contracts';
|
|
1
|
+
import { APIMeta, AcceptInviteRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreatePullRequestFromStepRun, CreateSNSIntegrationRequest, CreateTenantAlertEmailGroupRequest, CreateTenantInviteRequest, CreateTenantRequest, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, GetStepRunDiffResponse, LinkGithubRepositoryRequest, ListAPIMetaIntegration, ListAPITokensResponse, ListGithubAppInstallationsResponse, ListGithubBranchesResponse, ListGithubReposResponse, ListPullRequestsResponse, ListSNSIntegrations, ListSlackWebhooks, LogLineLevelField, LogLineList, LogLineOrderByDirection, LogLineOrderByField, LogLineSearch, PullRequestState, RejectInviteRequest, ReplayEventRequest, RerunStepRunRequest, SNSIntegration, StepRun, StepRunEventList, Tenant, TenantAlertEmailGroup, TenantAlertEmailGroupList, TenantAlertingSettings, TenantInvite, TenantInviteList, TenantMemberList, TriggerWorkflowRunRequest, UpdateTenantAlertEmailGroupRequest, UpdateTenantInviteRequest, UpdateTenantRequest, User, UserChangePasswordRequest, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, Worker, WorkerList, Workflow, WorkflowID, WorkflowList, WorkflowMetrics, WorkflowRun, WorkflowRunList, WorkflowRunStatus, WorkflowRunStatusList, WorkflowRunsCancelRequest, WorkflowRunsMetrics, WorkflowVersion, WorkflowVersionDefinition } from './data-contracts';
|
|
2
2
|
import { HttpClient, RequestParams } from './http-client';
|
|
3
3
|
export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
4
4
|
/**
|
|
@@ -72,7 +72,6 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
72
72
|
* @name UserUpdateGithubOauthStart
|
|
73
73
|
* @summary Start OAuth flow
|
|
74
74
|
* @request GET:/api/v1/users/github/start
|
|
75
|
-
* @secure
|
|
76
75
|
*/
|
|
77
76
|
userUpdateGithubOauthStart: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
78
77
|
/**
|
|
@@ -82,9 +81,48 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
82
81
|
* @name UserUpdateGithubOauthCallback
|
|
83
82
|
* @summary Complete OAuth flow
|
|
84
83
|
* @request GET:/api/v1/users/github/callback
|
|
85
|
-
* @secure
|
|
86
84
|
*/
|
|
87
85
|
userUpdateGithubOauthCallback: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
86
|
+
/**
|
|
87
|
+
* @description Starts the OAuth flow
|
|
88
|
+
*
|
|
89
|
+
* @tags User
|
|
90
|
+
* @name UserUpdateGithubAppOauthStart
|
|
91
|
+
* @summary Start OAuth flow
|
|
92
|
+
* @request GET:/api/v1/users/github-app/start
|
|
93
|
+
* @secure
|
|
94
|
+
*/
|
|
95
|
+
userUpdateGithubAppOauthStart: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
96
|
+
/**
|
|
97
|
+
* @description Completes the OAuth flow
|
|
98
|
+
*
|
|
99
|
+
* @tags User
|
|
100
|
+
* @name UserUpdateGithubAppOauthCallback
|
|
101
|
+
* @summary Complete OAuth flow
|
|
102
|
+
* @request GET:/api/v1/users/github-app/callback
|
|
103
|
+
* @secure
|
|
104
|
+
*/
|
|
105
|
+
userUpdateGithubAppOauthCallback: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
106
|
+
/**
|
|
107
|
+
* @description Starts the OAuth flow
|
|
108
|
+
*
|
|
109
|
+
* @tags User
|
|
110
|
+
* @name UserUpdateSlackOauthStart
|
|
111
|
+
* @summary Start OAuth flow
|
|
112
|
+
* @request GET:/api/v1/tenants/{tenant}/slack/start
|
|
113
|
+
* @secure
|
|
114
|
+
*/
|
|
115
|
+
userUpdateSlackOauthStart: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
116
|
+
/**
|
|
117
|
+
* @description Completes the OAuth flow
|
|
118
|
+
*
|
|
119
|
+
* @tags User
|
|
120
|
+
* @name UserUpdateSlackOauthCallback
|
|
121
|
+
* @summary Complete OAuth flow
|
|
122
|
+
* @request GET:/api/v1/users/slack/callback
|
|
123
|
+
* @secure
|
|
124
|
+
*/
|
|
125
|
+
userUpdateSlackOauthCallback: (params?: RequestParams) => Promise<import("axios").AxiosResponse<any, any>>;
|
|
88
126
|
/**
|
|
89
127
|
* @description Github App global webhook
|
|
90
128
|
*
|
|
@@ -132,6 +170,46 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
132
170
|
* @secure
|
|
133
171
|
*/
|
|
134
172
|
snsCreate: (tenant: string, data: CreateSNSIntegrationRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<SNSIntegration, any>>;
|
|
173
|
+
/**
|
|
174
|
+
* @description Creates a new tenant alert email group
|
|
175
|
+
*
|
|
176
|
+
* @tags Tenant
|
|
177
|
+
* @name AlertEmailGroupCreate
|
|
178
|
+
* @summary Create tenant alert email group
|
|
179
|
+
* @request POST:/api/v1/tenants/{tenant}/alerting-email-groups
|
|
180
|
+
* @secure
|
|
181
|
+
*/
|
|
182
|
+
alertEmailGroupCreate: (tenant: string, data: CreateTenantAlertEmailGroupRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<TenantAlertEmailGroup, any>>;
|
|
183
|
+
/**
|
|
184
|
+
* @description Gets a list of tenant alert email groups
|
|
185
|
+
*
|
|
186
|
+
* @tags Tenant
|
|
187
|
+
* @name AlertEmailGroupList
|
|
188
|
+
* @summary List tenant alert email groups
|
|
189
|
+
* @request GET:/api/v1/tenants/{tenant}/alerting-email-groups
|
|
190
|
+
* @secure
|
|
191
|
+
*/
|
|
192
|
+
alertEmailGroupList: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<TenantAlertEmailGroupList, any>>;
|
|
193
|
+
/**
|
|
194
|
+
* @description Updates a tenant alert email group
|
|
195
|
+
*
|
|
196
|
+
* @tags Tenant
|
|
197
|
+
* @name AlertEmailGroupUpdate
|
|
198
|
+
* @summary Update tenant alert email group
|
|
199
|
+
* @request PATCH:/api/v1/alerting-email-groups/{alert-email-group}
|
|
200
|
+
* @secure
|
|
201
|
+
*/
|
|
202
|
+
alertEmailGroupUpdate: (alertEmailGroup: string, data: UpdateTenantAlertEmailGroupRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<TenantAlertEmailGroup, any>>;
|
|
203
|
+
/**
|
|
204
|
+
* @description Deletes a tenant alert email group
|
|
205
|
+
*
|
|
206
|
+
* @tags Tenant
|
|
207
|
+
* @name AlertEmailGroupDelete
|
|
208
|
+
* @summary Delete tenant alert email group
|
|
209
|
+
* @request DELETE:/api/v1/alerting-email-groups/{alert-email-group}
|
|
210
|
+
* @secure
|
|
211
|
+
*/
|
|
212
|
+
alertEmailGroupDelete: (alertEmailGroup: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
135
213
|
/**
|
|
136
214
|
* @description Delete SNS integration
|
|
137
215
|
*
|
|
@@ -142,6 +220,26 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
142
220
|
* @secure
|
|
143
221
|
*/
|
|
144
222
|
snsDelete: (sns: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
223
|
+
/**
|
|
224
|
+
* @description List Slack webhooks
|
|
225
|
+
*
|
|
226
|
+
* @tags Slack
|
|
227
|
+
* @name SlackWebhookList
|
|
228
|
+
* @summary List Slack integrations
|
|
229
|
+
* @request GET:/api/v1/tenants/{tenant}/slack
|
|
230
|
+
* @secure
|
|
231
|
+
*/
|
|
232
|
+
slackWebhookList: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<ListSlackWebhooks, any>>;
|
|
233
|
+
/**
|
|
234
|
+
* @description Delete Slack webhook
|
|
235
|
+
*
|
|
236
|
+
* @tags Slack
|
|
237
|
+
* @name SlackWebhookDelete
|
|
238
|
+
* @summary Delete Slack webhook
|
|
239
|
+
* @request DELETE:/api/v1/slack/{slack}
|
|
240
|
+
* @secure
|
|
241
|
+
*/
|
|
242
|
+
slackWebhookDelete: (slack: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
145
243
|
/**
|
|
146
244
|
* @description Gets the current user
|
|
147
245
|
*
|
|
@@ -231,6 +329,26 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
231
329
|
* @secure
|
|
232
330
|
*/
|
|
233
331
|
tenantCreate: (data: CreateTenantRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<Tenant, any>>;
|
|
332
|
+
/**
|
|
333
|
+
* @description Update an existing tenant
|
|
334
|
+
*
|
|
335
|
+
* @tags Tenant
|
|
336
|
+
* @name TenantUpdate
|
|
337
|
+
* @summary Update tenant
|
|
338
|
+
* @request PATCH:/api/v1/tenants/{tenant}
|
|
339
|
+
* @secure
|
|
340
|
+
*/
|
|
341
|
+
tenantUpdate: (tenant: string, data: UpdateTenantRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<Tenant, any>>;
|
|
342
|
+
/**
|
|
343
|
+
* @description Gets the alerting settings for a tenant
|
|
344
|
+
*
|
|
345
|
+
* @tags Tenant
|
|
346
|
+
* @name TenantAlertingSettingsGet
|
|
347
|
+
* @summary Get tenant alerting settings
|
|
348
|
+
* @request GET:/api/v1/tenants/{tenant}/alerting/settings
|
|
349
|
+
* @secure
|
|
350
|
+
*/
|
|
351
|
+
tenantAlertingSettingsGet: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<TenantAlertingSettings, any>>;
|
|
234
352
|
/**
|
|
235
353
|
* @description Creates a new tenant invite
|
|
236
354
|
*
|
|
@@ -331,6 +449,11 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
331
449
|
orderByField?: EventOrderByField;
|
|
332
450
|
/** The order direction */
|
|
333
451
|
orderByDirection?: EventOrderByDirection;
|
|
452
|
+
/**
|
|
453
|
+
* A list of metadata key value pairs to filter by
|
|
454
|
+
* @example ["key1:value1","key2:value2"]
|
|
455
|
+
*/
|
|
456
|
+
additionalMetadata?: string[];
|
|
334
457
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<EventList, any>>;
|
|
335
458
|
/**
|
|
336
459
|
* @description Replays a list of events.
|
|
@@ -382,6 +505,18 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
382
505
|
* @secure
|
|
383
506
|
*/
|
|
384
507
|
workflowList: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<WorkflowList, any>>;
|
|
508
|
+
/**
|
|
509
|
+
* @description Cancel a batch of workflow runs
|
|
510
|
+
*
|
|
511
|
+
* @tags Workflow Run
|
|
512
|
+
* @name WorkflowRunCancel
|
|
513
|
+
* @summary Cancel workflow runs
|
|
514
|
+
* @request POST:/api/v1/tenants/{tenant}/workflows/cancel
|
|
515
|
+
* @secure
|
|
516
|
+
*/
|
|
517
|
+
workflowRunCancel: (tenant: string, data: WorkflowRunsCancelRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<{
|
|
518
|
+
workflowRunIds?: string[] | undefined;
|
|
519
|
+
}, any>>;
|
|
385
520
|
/**
|
|
386
521
|
* @description Get a workflow for a tenant
|
|
387
522
|
*
|
|
@@ -530,6 +665,27 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
530
665
|
* @secure
|
|
531
666
|
*/
|
|
532
667
|
stepRunGetDiff: (stepRun: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<GetStepRunDiffResponse, any>>;
|
|
668
|
+
/**
|
|
669
|
+
* @description List events for a step run
|
|
670
|
+
*
|
|
671
|
+
* @tags Step Run
|
|
672
|
+
* @name StepRunListEvents
|
|
673
|
+
* @summary List events for step run
|
|
674
|
+
* @request GET:/api/v1/step-runs/{step-run}/events
|
|
675
|
+
* @secure
|
|
676
|
+
*/
|
|
677
|
+
stepRunListEvents: (stepRun: string, query?: {
|
|
678
|
+
/**
|
|
679
|
+
* The number to skip
|
|
680
|
+
* @format int64
|
|
681
|
+
*/
|
|
682
|
+
offset?: number;
|
|
683
|
+
/**
|
|
684
|
+
* The number to limit by
|
|
685
|
+
* @format int64
|
|
686
|
+
*/
|
|
687
|
+
limit?: number;
|
|
688
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<StepRunEventList, any>>;
|
|
533
689
|
/**
|
|
534
690
|
* @description Get all workflow runs for a tenant
|
|
535
691
|
*
|
|
@@ -578,7 +734,58 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
578
734
|
* @maxLength 36
|
|
579
735
|
*/
|
|
580
736
|
parentStepRunId?: string;
|
|
737
|
+
/** A list of workflow run statuses to filter by */
|
|
738
|
+
statuses?: WorkflowRunStatusList;
|
|
739
|
+
/**
|
|
740
|
+
* A list of metadata key value pairs to filter by
|
|
741
|
+
* @example ["key1:value1","key2:value2"]
|
|
742
|
+
*/
|
|
743
|
+
additionalMetadata?: string[];
|
|
581
744
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<WorkflowRunList, any>>;
|
|
745
|
+
/**
|
|
746
|
+
* @description Get a summary of workflow run metrics for a tenant
|
|
747
|
+
*
|
|
748
|
+
* @tags Workflow
|
|
749
|
+
* @name WorkflowRunGetMetrics
|
|
750
|
+
* @summary Get workflow runs
|
|
751
|
+
* @request GET:/api/v1/tenants/{tenant}/workflows/runs/metrics
|
|
752
|
+
* @secure
|
|
753
|
+
*/
|
|
754
|
+
workflowRunGetMetrics: (tenant: string, query?: {
|
|
755
|
+
/**
|
|
756
|
+
* The event id to get runs for.
|
|
757
|
+
* @format uuid
|
|
758
|
+
* @minLength 36
|
|
759
|
+
* @maxLength 36
|
|
760
|
+
*/
|
|
761
|
+
eventId?: string;
|
|
762
|
+
/**
|
|
763
|
+
* The workflow id to get runs for.
|
|
764
|
+
* @format uuid
|
|
765
|
+
* @minLength 36
|
|
766
|
+
* @maxLength 36
|
|
767
|
+
*/
|
|
768
|
+
workflowId?: string;
|
|
769
|
+
/**
|
|
770
|
+
* The parent workflow run id
|
|
771
|
+
* @format uuid
|
|
772
|
+
* @minLength 36
|
|
773
|
+
* @maxLength 36
|
|
774
|
+
*/
|
|
775
|
+
parentWorkflowRunId?: string;
|
|
776
|
+
/**
|
|
777
|
+
* The parent step run id
|
|
778
|
+
* @format uuid
|
|
779
|
+
* @minLength 36
|
|
780
|
+
* @maxLength 36
|
|
781
|
+
*/
|
|
782
|
+
parentStepRunId?: string;
|
|
783
|
+
/**
|
|
784
|
+
* A list of metadata key value pairs to filter by
|
|
785
|
+
* @example ["key1:value1","key2:value2"]
|
|
786
|
+
*/
|
|
787
|
+
additionalMetadata?: string[];
|
|
788
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<WorkflowRunsMetrics, any>>;
|
|
582
789
|
/**
|
|
583
790
|
* @description Get a workflow run for a tenant
|
|
584
791
|
*
|
|
@@ -86,9 +86,8 @@ class Api extends http_client_1.HttpClient {
|
|
|
86
86
|
* @name UserUpdateGithubOauthStart
|
|
87
87
|
* @summary Start OAuth flow
|
|
88
88
|
* @request GET:/api/v1/users/github/start
|
|
89
|
-
* @secure
|
|
90
89
|
*/
|
|
91
|
-
this.userUpdateGithubOauthStart = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/github/start`, method: 'GET'
|
|
90
|
+
this.userUpdateGithubOauthStart = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/github/start`, method: 'GET' }, params));
|
|
92
91
|
/**
|
|
93
92
|
* @description Completes the OAuth flow
|
|
94
93
|
*
|
|
@@ -96,9 +95,48 @@ class Api extends http_client_1.HttpClient {
|
|
|
96
95
|
* @name UserUpdateGithubOauthCallback
|
|
97
96
|
* @summary Complete OAuth flow
|
|
98
97
|
* @request GET:/api/v1/users/github/callback
|
|
98
|
+
*/
|
|
99
|
+
this.userUpdateGithubOauthCallback = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/github/callback`, method: 'GET' }, params));
|
|
100
|
+
/**
|
|
101
|
+
* @description Starts the OAuth flow
|
|
102
|
+
*
|
|
103
|
+
* @tags User
|
|
104
|
+
* @name UserUpdateGithubAppOauthStart
|
|
105
|
+
* @summary Start OAuth flow
|
|
106
|
+
* @request GET:/api/v1/users/github-app/start
|
|
107
|
+
* @secure
|
|
108
|
+
*/
|
|
109
|
+
this.userUpdateGithubAppOauthStart = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/github-app/start`, method: 'GET', secure: true }, params));
|
|
110
|
+
/**
|
|
111
|
+
* @description Completes the OAuth flow
|
|
112
|
+
*
|
|
113
|
+
* @tags User
|
|
114
|
+
* @name UserUpdateGithubAppOauthCallback
|
|
115
|
+
* @summary Complete OAuth flow
|
|
116
|
+
* @request GET:/api/v1/users/github-app/callback
|
|
117
|
+
* @secure
|
|
118
|
+
*/
|
|
119
|
+
this.userUpdateGithubAppOauthCallback = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/github-app/callback`, method: 'GET', secure: true }, params));
|
|
120
|
+
/**
|
|
121
|
+
* @description Starts the OAuth flow
|
|
122
|
+
*
|
|
123
|
+
* @tags User
|
|
124
|
+
* @name UserUpdateSlackOauthStart
|
|
125
|
+
* @summary Start OAuth flow
|
|
126
|
+
* @request GET:/api/v1/tenants/{tenant}/slack/start
|
|
99
127
|
* @secure
|
|
100
128
|
*/
|
|
101
|
-
this.
|
|
129
|
+
this.userUpdateSlackOauthStart = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/slack/start`, method: 'GET', secure: true }, params));
|
|
130
|
+
/**
|
|
131
|
+
* @description Completes the OAuth flow
|
|
132
|
+
*
|
|
133
|
+
* @tags User
|
|
134
|
+
* @name UserUpdateSlackOauthCallback
|
|
135
|
+
* @summary Complete OAuth flow
|
|
136
|
+
* @request GET:/api/v1/users/slack/callback
|
|
137
|
+
* @secure
|
|
138
|
+
*/
|
|
139
|
+
this.userUpdateSlackOauthCallback = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/slack/callback`, method: 'GET', secure: true }, params));
|
|
102
140
|
/**
|
|
103
141
|
* @description Github App global webhook
|
|
104
142
|
*
|
|
@@ -146,6 +184,46 @@ class Api extends http_client_1.HttpClient {
|
|
|
146
184
|
* @secure
|
|
147
185
|
*/
|
|
148
186
|
this.snsCreate = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/sns`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
187
|
+
/**
|
|
188
|
+
* @description Creates a new tenant alert email group
|
|
189
|
+
*
|
|
190
|
+
* @tags Tenant
|
|
191
|
+
* @name AlertEmailGroupCreate
|
|
192
|
+
* @summary Create tenant alert email group
|
|
193
|
+
* @request POST:/api/v1/tenants/{tenant}/alerting-email-groups
|
|
194
|
+
* @secure
|
|
195
|
+
*/
|
|
196
|
+
this.alertEmailGroupCreate = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/alerting-email-groups`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
197
|
+
/**
|
|
198
|
+
* @description Gets a list of tenant alert email groups
|
|
199
|
+
*
|
|
200
|
+
* @tags Tenant
|
|
201
|
+
* @name AlertEmailGroupList
|
|
202
|
+
* @summary List tenant alert email groups
|
|
203
|
+
* @request GET:/api/v1/tenants/{tenant}/alerting-email-groups
|
|
204
|
+
* @secure
|
|
205
|
+
*/
|
|
206
|
+
this.alertEmailGroupList = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/alerting-email-groups`, method: 'GET', secure: true, format: 'json' }, params));
|
|
207
|
+
/**
|
|
208
|
+
* @description Updates a tenant alert email group
|
|
209
|
+
*
|
|
210
|
+
* @tags Tenant
|
|
211
|
+
* @name AlertEmailGroupUpdate
|
|
212
|
+
* @summary Update tenant alert email group
|
|
213
|
+
* @request PATCH:/api/v1/alerting-email-groups/{alert-email-group}
|
|
214
|
+
* @secure
|
|
215
|
+
*/
|
|
216
|
+
this.alertEmailGroupUpdate = (alertEmailGroup, data, params = {}) => this.request(Object.assign({ path: `/api/v1/alerting-email-groups/${alertEmailGroup}`, method: 'PATCH', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
217
|
+
/**
|
|
218
|
+
* @description Deletes a tenant alert email group
|
|
219
|
+
*
|
|
220
|
+
* @tags Tenant
|
|
221
|
+
* @name AlertEmailGroupDelete
|
|
222
|
+
* @summary Delete tenant alert email group
|
|
223
|
+
* @request DELETE:/api/v1/alerting-email-groups/{alert-email-group}
|
|
224
|
+
* @secure
|
|
225
|
+
*/
|
|
226
|
+
this.alertEmailGroupDelete = (alertEmailGroup, params = {}) => this.request(Object.assign({ path: `/api/v1/alerting-email-groups/${alertEmailGroup}`, method: 'DELETE', secure: true }, params));
|
|
149
227
|
/**
|
|
150
228
|
* @description Delete SNS integration
|
|
151
229
|
*
|
|
@@ -156,6 +234,26 @@ class Api extends http_client_1.HttpClient {
|
|
|
156
234
|
* @secure
|
|
157
235
|
*/
|
|
158
236
|
this.snsDelete = (sns, params = {}) => this.request(Object.assign({ path: `/api/v1/sns/${sns}`, method: 'DELETE', secure: true }, params));
|
|
237
|
+
/**
|
|
238
|
+
* @description List Slack webhooks
|
|
239
|
+
*
|
|
240
|
+
* @tags Slack
|
|
241
|
+
* @name SlackWebhookList
|
|
242
|
+
* @summary List Slack integrations
|
|
243
|
+
* @request GET:/api/v1/tenants/{tenant}/slack
|
|
244
|
+
* @secure
|
|
245
|
+
*/
|
|
246
|
+
this.slackWebhookList = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/slack`, method: 'GET', secure: true, format: 'json' }, params));
|
|
247
|
+
/**
|
|
248
|
+
* @description Delete Slack webhook
|
|
249
|
+
*
|
|
250
|
+
* @tags Slack
|
|
251
|
+
* @name SlackWebhookDelete
|
|
252
|
+
* @summary Delete Slack webhook
|
|
253
|
+
* @request DELETE:/api/v1/slack/{slack}
|
|
254
|
+
* @secure
|
|
255
|
+
*/
|
|
256
|
+
this.slackWebhookDelete = (slack, params = {}) => this.request(Object.assign({ path: `/api/v1/slack/${slack}`, method: 'DELETE', secure: true }, params));
|
|
159
257
|
/**
|
|
160
258
|
* @description Gets the current user
|
|
161
259
|
*
|
|
@@ -245,6 +343,26 @@ class Api extends http_client_1.HttpClient {
|
|
|
245
343
|
* @secure
|
|
246
344
|
*/
|
|
247
345
|
this.tenantCreate = (data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
346
|
+
/**
|
|
347
|
+
* @description Update an existing tenant
|
|
348
|
+
*
|
|
349
|
+
* @tags Tenant
|
|
350
|
+
* @name TenantUpdate
|
|
351
|
+
* @summary Update tenant
|
|
352
|
+
* @request PATCH:/api/v1/tenants/{tenant}
|
|
353
|
+
* @secure
|
|
354
|
+
*/
|
|
355
|
+
this.tenantUpdate = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}`, method: 'PATCH', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
356
|
+
/**
|
|
357
|
+
* @description Gets the alerting settings for a tenant
|
|
358
|
+
*
|
|
359
|
+
* @tags Tenant
|
|
360
|
+
* @name TenantAlertingSettingsGet
|
|
361
|
+
* @summary Get tenant alerting settings
|
|
362
|
+
* @request GET:/api/v1/tenants/{tenant}/alerting/settings
|
|
363
|
+
* @secure
|
|
364
|
+
*/
|
|
365
|
+
this.tenantAlertingSettingsGet = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/alerting/settings`, method: 'GET', secure: true, format: 'json' }, params));
|
|
248
366
|
/**
|
|
249
367
|
* @description Creates a new tenant invite
|
|
250
368
|
*
|
|
@@ -373,6 +491,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
373
491
|
* @secure
|
|
374
492
|
*/
|
|
375
493
|
this.workflowList = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflows`, method: 'GET', secure: true, format: 'json' }, params));
|
|
494
|
+
/**
|
|
495
|
+
* @description Cancel a batch of workflow runs
|
|
496
|
+
*
|
|
497
|
+
* @tags Workflow Run
|
|
498
|
+
* @name WorkflowRunCancel
|
|
499
|
+
* @summary Cancel workflow runs
|
|
500
|
+
* @request POST:/api/v1/tenants/{tenant}/workflows/cancel
|
|
501
|
+
* @secure
|
|
502
|
+
*/
|
|
503
|
+
this.workflowRunCancel = (tenant, data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflows/cancel`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
376
504
|
/**
|
|
377
505
|
* @description Get a workflow for a tenant
|
|
378
506
|
*
|
|
@@ -473,6 +601,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
473
601
|
* @secure
|
|
474
602
|
*/
|
|
475
603
|
this.stepRunGetDiff = (stepRun, params = {}) => this.request(Object.assign({ path: `/api/v1/step-runs/${stepRun}/diff`, method: 'GET', secure: true, format: 'json' }, params));
|
|
604
|
+
/**
|
|
605
|
+
* @description List events for a step run
|
|
606
|
+
*
|
|
607
|
+
* @tags Step Run
|
|
608
|
+
* @name StepRunListEvents
|
|
609
|
+
* @summary List events for step run
|
|
610
|
+
* @request GET:/api/v1/step-runs/{step-run}/events
|
|
611
|
+
* @secure
|
|
612
|
+
*/
|
|
613
|
+
this.stepRunListEvents = (stepRun, query, params = {}) => this.request(Object.assign({ path: `/api/v1/step-runs/${stepRun}/events`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
476
614
|
/**
|
|
477
615
|
* @description Get all workflow runs for a tenant
|
|
478
616
|
*
|
|
@@ -483,6 +621,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
483
621
|
* @secure
|
|
484
622
|
*/
|
|
485
623
|
this.workflowRunList = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflows/runs`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
624
|
+
/**
|
|
625
|
+
* @description Get a summary of workflow run metrics for a tenant
|
|
626
|
+
*
|
|
627
|
+
* @tags Workflow
|
|
628
|
+
* @name WorkflowRunGetMetrics
|
|
629
|
+
* @summary Get workflow runs
|
|
630
|
+
* @request GET:/api/v1/tenants/{tenant}/workflows/runs/metrics
|
|
631
|
+
* @secure
|
|
632
|
+
*/
|
|
633
|
+
this.workflowRunGetMetrics = (tenant, query, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/workflows/runs/metrics`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
486
634
|
/**
|
|
487
635
|
* @description Get a workflow run for a tenant
|
|
488
636
|
*
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export interface APIMeta {
|
|
2
2
|
auth?: APIMetaAuth;
|
|
3
|
+
/**
|
|
4
|
+
* the Pylon app ID for usepylon.com chat support
|
|
5
|
+
* @example "12345678-1234-1234-1234-123456789012"
|
|
6
|
+
*/
|
|
7
|
+
pylonAppId?: string;
|
|
8
|
+
posthog?: APIMetaPosthog;
|
|
3
9
|
}
|
|
4
10
|
export interface APIMetaAuth {
|
|
5
11
|
/**
|
|
@@ -8,6 +14,18 @@ export interface APIMetaAuth {
|
|
|
8
14
|
*/
|
|
9
15
|
schemes?: string[];
|
|
10
16
|
}
|
|
17
|
+
export interface APIMetaPosthog {
|
|
18
|
+
/**
|
|
19
|
+
* the PostHog API key
|
|
20
|
+
* @example "phk_1234567890abcdef"
|
|
21
|
+
*/
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
/**
|
|
24
|
+
* the PostHog API host
|
|
25
|
+
* @example "https://posthog.example.com"
|
|
26
|
+
*/
|
|
27
|
+
apiHost?: string;
|
|
28
|
+
}
|
|
11
29
|
export type ListAPIMetaIntegration = APIMetaIntegration[];
|
|
12
30
|
export interface APIMetaIntegration {
|
|
13
31
|
/**
|
|
@@ -100,6 +118,8 @@ export interface User {
|
|
|
100
118
|
emailVerified: boolean;
|
|
101
119
|
/** Whether the user has a password set. */
|
|
102
120
|
hasPassword?: boolean;
|
|
121
|
+
/** A hash of the user's email address for use with Pylon Support Chat */
|
|
122
|
+
emailHash?: string;
|
|
103
123
|
}
|
|
104
124
|
export interface UserTenantPublic {
|
|
105
125
|
/**
|
|
@@ -146,6 +166,8 @@ export interface Tenant {
|
|
|
146
166
|
name: string;
|
|
147
167
|
/** The slug of the tenant. */
|
|
148
168
|
slug: string;
|
|
169
|
+
/** Whether the tenant has opted out of analytics. */
|
|
170
|
+
analyticsOptOut?: boolean;
|
|
149
171
|
}
|
|
150
172
|
export interface TenantMember {
|
|
151
173
|
metadata: APIResourceMeta;
|
|
@@ -175,6 +197,33 @@ export interface UpdateTenantInviteRequest {
|
|
|
175
197
|
/** The role of the user in the tenant. */
|
|
176
198
|
role: TenantMemberRole;
|
|
177
199
|
}
|
|
200
|
+
export interface TenantAlertingSettings {
|
|
201
|
+
metadata: APIResourceMeta;
|
|
202
|
+
/** The max frequency at which to alert. */
|
|
203
|
+
maxAlertingFrequency: string;
|
|
204
|
+
/**
|
|
205
|
+
* The last time an alert was sent.
|
|
206
|
+
* @format date-time
|
|
207
|
+
*/
|
|
208
|
+
lastAlertedAt?: string;
|
|
209
|
+
}
|
|
210
|
+
export interface TenantAlertEmailGroup {
|
|
211
|
+
metadata: APIResourceMeta;
|
|
212
|
+
/** A list of emails for users */
|
|
213
|
+
emails: string[];
|
|
214
|
+
}
|
|
215
|
+
export interface TenantAlertEmailGroupList {
|
|
216
|
+
pagination?: PaginationResponse;
|
|
217
|
+
rows?: TenantAlertEmailGroup[];
|
|
218
|
+
}
|
|
219
|
+
export interface CreateTenantAlertEmailGroupRequest {
|
|
220
|
+
/** A list of emails for users */
|
|
221
|
+
emails: string[];
|
|
222
|
+
}
|
|
223
|
+
export interface UpdateTenantAlertEmailGroupRequest {
|
|
224
|
+
/** A list of emails for users */
|
|
225
|
+
emails: string[];
|
|
226
|
+
}
|
|
178
227
|
export interface TenantInvite {
|
|
179
228
|
metadata: APIResourceMeta;
|
|
180
229
|
/** The email of the user to invite. */
|
|
@@ -221,6 +270,14 @@ export interface CreateTenantRequest {
|
|
|
221
270
|
/** The slug of the tenant. */
|
|
222
271
|
slug: string;
|
|
223
272
|
}
|
|
273
|
+
export interface UpdateTenantRequest {
|
|
274
|
+
/** The name of the tenant. */
|
|
275
|
+
name?: string;
|
|
276
|
+
/** Whether the tenant has opted out of analytics. */
|
|
277
|
+
analyticsOptOut?: boolean;
|
|
278
|
+
/** The max frequency at which to alert. */
|
|
279
|
+
maxAlertingFrequency?: string;
|
|
280
|
+
}
|
|
224
281
|
export interface Event {
|
|
225
282
|
metadata: APIResourceMeta;
|
|
226
283
|
/** The key for the event. */
|
|
@@ -231,6 +288,8 @@ export interface Event {
|
|
|
231
288
|
tenantId: string;
|
|
232
289
|
/** The workflow run summary for this event. */
|
|
233
290
|
workflowRunSummary?: EventWorkflowRunSummary;
|
|
291
|
+
/** Additional metadata for the event. */
|
|
292
|
+
additionalMetadata?: object;
|
|
234
293
|
}
|
|
235
294
|
export interface EventData {
|
|
236
295
|
/** The data for the event (JSON bytes). */
|
|
@@ -346,6 +405,7 @@ export interface WorkflowVersion {
|
|
|
346
405
|
workflow?: Workflow;
|
|
347
406
|
concurrency?: WorkflowConcurrency;
|
|
348
407
|
triggers?: WorkflowTriggers;
|
|
408
|
+
scheduleTimeout?: string;
|
|
349
409
|
jobs?: Job[];
|
|
350
410
|
}
|
|
351
411
|
export interface WorkflowVersionDefinition {
|
|
@@ -430,11 +490,22 @@ export interface WorkflowRun {
|
|
|
430
490
|
* @example "bb214807-246e-43a5-a25d-41761d1cff9e"
|
|
431
491
|
*/
|
|
432
492
|
parentStepRunId?: string;
|
|
493
|
+
additionalMetadata?: Record<string, any>;
|
|
433
494
|
}
|
|
434
495
|
export interface WorkflowRunList {
|
|
435
496
|
rows?: WorkflowRun[];
|
|
436
497
|
pagination?: PaginationResponse;
|
|
437
498
|
}
|
|
499
|
+
export interface WorkflowRunsMetrics {
|
|
500
|
+
counts?: WorkflowRunsMetricsCounts;
|
|
501
|
+
}
|
|
502
|
+
export interface WorkflowRunsMetricsCounts {
|
|
503
|
+
PENDING?: number;
|
|
504
|
+
RUNNING?: number;
|
|
505
|
+
SUCCEEDED?: number;
|
|
506
|
+
FAILED?: number;
|
|
507
|
+
QUEUED?: number;
|
|
508
|
+
}
|
|
438
509
|
export declare enum WorkflowRunStatus {
|
|
439
510
|
PENDING = "PENDING",
|
|
440
511
|
RUNNING = "RUNNING",
|
|
@@ -444,6 +515,9 @@ export declare enum WorkflowRunStatus {
|
|
|
444
515
|
QUEUED = "QUEUED"
|
|
445
516
|
}
|
|
446
517
|
export type WorkflowRunStatusList = WorkflowRunStatus[];
|
|
518
|
+
export interface WorkflowRunsCancelRequest {
|
|
519
|
+
workflowRunIds: string[];
|
|
520
|
+
}
|
|
447
521
|
export declare enum JobRunStatus {
|
|
448
522
|
PENDING = "PENDING",
|
|
449
523
|
RUNNING = "RUNNING",
|
|
@@ -523,6 +597,44 @@ export interface StepRun {
|
|
|
523
597
|
cancelledReason?: string;
|
|
524
598
|
cancelledError?: string;
|
|
525
599
|
}
|
|
600
|
+
export declare enum StepRunEventReason {
|
|
601
|
+
REQUEUED_NO_WORKER = "REQUEUED_NO_WORKER",
|
|
602
|
+
REQUEUED_RATE_LIMIT = "REQUEUED_RATE_LIMIT",
|
|
603
|
+
SCHEDULING_TIMED_OUT = "SCHEDULING_TIMED_OUT",
|
|
604
|
+
ASSIGNED = "ASSIGNED",
|
|
605
|
+
STARTED = "STARTED",
|
|
606
|
+
FINISHED = "FINISHED",
|
|
607
|
+
FAILED = "FAILED",
|
|
608
|
+
RETRYING = "RETRYING",
|
|
609
|
+
CANCELLED = "CANCELLED",
|
|
610
|
+
TIMEOUT_REFRESHED = "TIMEOUT_REFRESHED",
|
|
611
|
+
REASSIGNED = "REASSIGNED",
|
|
612
|
+
TIMED_OUT = "TIMED_OUT",
|
|
613
|
+
SLOT_RELEASED = "SLOT_RELEASED",
|
|
614
|
+
RETRIED_BY_USER = "RETRIED_BY_USER"
|
|
615
|
+
}
|
|
616
|
+
export declare enum StepRunEventSeverity {
|
|
617
|
+
INFO = "INFO",
|
|
618
|
+
WARNING = "WARNING",
|
|
619
|
+
CRITICAL = "CRITICAL"
|
|
620
|
+
}
|
|
621
|
+
export interface StepRunEvent {
|
|
622
|
+
id: number;
|
|
623
|
+
/** @format date-time */
|
|
624
|
+
timeFirstSeen: string;
|
|
625
|
+
/** @format date-time */
|
|
626
|
+
timeLastSeen: string;
|
|
627
|
+
stepRunId: string;
|
|
628
|
+
reason: StepRunEventReason;
|
|
629
|
+
severity: StepRunEventSeverity;
|
|
630
|
+
message: string;
|
|
631
|
+
count: number;
|
|
632
|
+
data?: object;
|
|
633
|
+
}
|
|
634
|
+
export interface StepRunEventList {
|
|
635
|
+
pagination?: PaginationResponse;
|
|
636
|
+
rows?: StepRunEvent[];
|
|
637
|
+
}
|
|
526
638
|
export interface WorkerList {
|
|
527
639
|
pagination?: PaginationResponse;
|
|
528
640
|
rows?: Worker[];
|
|
@@ -537,10 +649,30 @@ export interface Worker {
|
|
|
537
649
|
* @example "2022-12-13T20:06:48.888Z"
|
|
538
650
|
*/
|
|
539
651
|
lastHeartbeatAt?: string;
|
|
652
|
+
/**
|
|
653
|
+
* The time this worker last sent a heartbeat.
|
|
654
|
+
* @format date-time
|
|
655
|
+
* @example "2022-12-13T20:06:48.888Z"
|
|
656
|
+
*/
|
|
657
|
+
lastListenerEstablished?: string;
|
|
540
658
|
/** The actions this worker can perform. */
|
|
541
659
|
actions?: string[];
|
|
542
660
|
/** The recent step runs for this worker. */
|
|
543
661
|
recentStepRuns?: StepRun[];
|
|
662
|
+
/** The status of the worker. */
|
|
663
|
+
status?: 'ACTIVE' | 'INACTIVE';
|
|
664
|
+
/** The maximum number of runs this worker can execute concurrently. */
|
|
665
|
+
maxRuns?: number;
|
|
666
|
+
/** The number of runs this worker can execute concurrently. */
|
|
667
|
+
availableRuns?: number;
|
|
668
|
+
/**
|
|
669
|
+
* the id of the assigned dispatcher, in UUID format
|
|
670
|
+
* @format uuid
|
|
671
|
+
* @minLength 36
|
|
672
|
+
* @maxLength 36
|
|
673
|
+
* @example "bb214807-246e-43a5-a25d-41761d1cff9e"
|
|
674
|
+
*/
|
|
675
|
+
dispatcherId?: string;
|
|
544
676
|
}
|
|
545
677
|
export interface APIToken {
|
|
546
678
|
metadata: APIResourceMeta;
|
|
@@ -575,6 +707,7 @@ export interface RerunStepRunRequest {
|
|
|
575
707
|
}
|
|
576
708
|
export interface TriggerWorkflowRunRequest {
|
|
577
709
|
input: object;
|
|
710
|
+
additionalMetadata?: object;
|
|
578
711
|
}
|
|
579
712
|
export interface LinkGithubRepositoryRequest {
|
|
580
713
|
/**
|
|
@@ -684,6 +817,26 @@ export interface ListSNSIntegrations {
|
|
|
684
817
|
pagination: PaginationResponse;
|
|
685
818
|
rows: SNSIntegration[];
|
|
686
819
|
}
|
|
820
|
+
export interface SlackWebhook {
|
|
821
|
+
metadata: APIResourceMeta;
|
|
822
|
+
/**
|
|
823
|
+
* The unique identifier for the tenant that the SNS integration belongs to.
|
|
824
|
+
* @format uuid
|
|
825
|
+
*/
|
|
826
|
+
tenantId: string;
|
|
827
|
+
/** The team name associated with this slack webhook. */
|
|
828
|
+
teamName: string;
|
|
829
|
+
/** The team id associated with this slack webhook. */
|
|
830
|
+
teamId: string;
|
|
831
|
+
/** The channel name associated with this slack webhook. */
|
|
832
|
+
channelName: string;
|
|
833
|
+
/** The channel id associated with this slack webhook. */
|
|
834
|
+
channelId: string;
|
|
835
|
+
}
|
|
836
|
+
export interface ListSlackWebhooks {
|
|
837
|
+
pagination: PaginationResponse;
|
|
838
|
+
rows: SlackWebhook[];
|
|
839
|
+
}
|
|
687
840
|
export interface CreateSNSIntegrationRequest {
|
|
688
841
|
/** The Amazon Resource Name (ARN) of the SNS topic. */
|
|
689
842
|
topicArn: string;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* ---------------------------------------------------------------
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.LogLineOrderByDirection = exports.LogLineOrderByField = exports.LogLineLevel = exports.PullRequestState = exports.StepRunStatus = exports.JobRunStatus = exports.WorkflowRunStatus = exports.EventOrderByDirection = exports.EventOrderByField = exports.TenantMemberRole = void 0;
|
|
13
|
+
exports.LogLineOrderByDirection = exports.LogLineOrderByField = exports.LogLineLevel = exports.PullRequestState = exports.StepRunEventSeverity = exports.StepRunEventReason = exports.StepRunStatus = exports.JobRunStatus = exports.WorkflowRunStatus = exports.EventOrderByDirection = exports.EventOrderByField = exports.TenantMemberRole = void 0;
|
|
14
14
|
var TenantMemberRole;
|
|
15
15
|
(function (TenantMemberRole) {
|
|
16
16
|
TenantMemberRole["OWNER"] = "OWNER";
|
|
@@ -53,6 +53,29 @@ var StepRunStatus;
|
|
|
53
53
|
StepRunStatus["FAILED"] = "FAILED";
|
|
54
54
|
StepRunStatus["CANCELLED"] = "CANCELLED";
|
|
55
55
|
})(StepRunStatus || (exports.StepRunStatus = StepRunStatus = {}));
|
|
56
|
+
var StepRunEventReason;
|
|
57
|
+
(function (StepRunEventReason) {
|
|
58
|
+
StepRunEventReason["REQUEUED_NO_WORKER"] = "REQUEUED_NO_WORKER";
|
|
59
|
+
StepRunEventReason["REQUEUED_RATE_LIMIT"] = "REQUEUED_RATE_LIMIT";
|
|
60
|
+
StepRunEventReason["SCHEDULING_TIMED_OUT"] = "SCHEDULING_TIMED_OUT";
|
|
61
|
+
StepRunEventReason["ASSIGNED"] = "ASSIGNED";
|
|
62
|
+
StepRunEventReason["STARTED"] = "STARTED";
|
|
63
|
+
StepRunEventReason["FINISHED"] = "FINISHED";
|
|
64
|
+
StepRunEventReason["FAILED"] = "FAILED";
|
|
65
|
+
StepRunEventReason["RETRYING"] = "RETRYING";
|
|
66
|
+
StepRunEventReason["CANCELLED"] = "CANCELLED";
|
|
67
|
+
StepRunEventReason["TIMEOUT_REFRESHED"] = "TIMEOUT_REFRESHED";
|
|
68
|
+
StepRunEventReason["REASSIGNED"] = "REASSIGNED";
|
|
69
|
+
StepRunEventReason["TIMED_OUT"] = "TIMED_OUT";
|
|
70
|
+
StepRunEventReason["SLOT_RELEASED"] = "SLOT_RELEASED";
|
|
71
|
+
StepRunEventReason["RETRIED_BY_USER"] = "RETRIED_BY_USER";
|
|
72
|
+
})(StepRunEventReason || (exports.StepRunEventReason = StepRunEventReason = {}));
|
|
73
|
+
var StepRunEventSeverity;
|
|
74
|
+
(function (StepRunEventSeverity) {
|
|
75
|
+
StepRunEventSeverity["INFO"] = "INFO";
|
|
76
|
+
StepRunEventSeverity["WARNING"] = "WARNING";
|
|
77
|
+
StepRunEventSeverity["CRITICAL"] = "CRITICAL";
|
|
78
|
+
})(StepRunEventSeverity || (exports.StepRunEventSeverity = StepRunEventSeverity = {}));
|
|
56
79
|
var PullRequestState;
|
|
57
80
|
(function (PullRequestState) {
|
|
58
81
|
PullRequestState["Open"] = "open";
|
|
@@ -37,5 +37,5 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
37
37
|
protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
|
|
38
38
|
protected stringifyFormItem(formItem: unknown): string;
|
|
39
39
|
protected createFormData(input: Record<string, unknown>): FormData;
|
|
40
|
-
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<AxiosResponse<T
|
|
40
|
+
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<AxiosResponse<T>>;
|
|
41
41
|
}
|
package/clients/worker/worker.js
CHANGED
|
@@ -49,8 +49,8 @@ class Worker {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
register_workflow(initWorkflow) {
|
|
52
|
-
var _a, _b, _c;
|
|
53
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
var _a, _b, _c;
|
|
54
54
|
const workflow = Object.assign(Object.assign({}, initWorkflow), { id: this.client.config.namespace + initWorkflow.id });
|
|
55
55
|
try {
|
|
56
56
|
const concurrency = ((_a = workflow.concurrency) === null || _a === void 0 ? void 0 : _a.name)
|
|
@@ -301,8 +301,8 @@ class Worker {
|
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
exitGracefully(handleKill) {
|
|
304
|
-
var _a;
|
|
305
304
|
return __awaiter(this, void 0, void 0, function* () {
|
|
305
|
+
var _a;
|
|
306
306
|
this.killing = true;
|
|
307
307
|
this.logger.info('Starting to exit...');
|
|
308
308
|
try {
|
|
@@ -322,8 +322,8 @@ class Worker {
|
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
start() {
|
|
325
|
-
var _a, e_1, _b, _c;
|
|
326
325
|
return __awaiter(this, void 0, void 0, function* () {
|
|
326
|
+
var _a, e_1, _b, _c;
|
|
327
327
|
// ensure all workflows are registered
|
|
328
328
|
yield Promise.all(this.registeredWorkflowPromises);
|
|
329
329
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hatchet-dev/typescript-sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Background task orchestration & visibility for developers",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"ts-node": "^10.9.2",
|
|
86
86
|
"ts-proto": "^1.167.0",
|
|
87
87
|
"typedoc": "^0.25.7",
|
|
88
|
-
"typedoc-plugin-markdown": "^
|
|
88
|
+
"typedoc-plugin-markdown": "^4.0.2",
|
|
89
89
|
"typescript": "^5.3.3"
|
|
90
90
|
},
|
|
91
91
|
"dependencies": {
|
package/step.d.ts
CHANGED
|
@@ -31,8 +31,8 @@ export declare const CreateStepSchema: z.ZodObject<{
|
|
|
31
31
|
}>, "many">>;
|
|
32
32
|
}, "strip", z.ZodTypeAny, {
|
|
33
33
|
name: string;
|
|
34
|
-
parents?: string[] | undefined;
|
|
35
34
|
timeout?: string | undefined;
|
|
35
|
+
parents?: string[] | undefined;
|
|
36
36
|
retries?: number | undefined;
|
|
37
37
|
rate_limits?: {
|
|
38
38
|
key: string;
|
|
@@ -40,8 +40,8 @@ export declare const CreateStepSchema: z.ZodObject<{
|
|
|
40
40
|
}[] | undefined;
|
|
41
41
|
}, {
|
|
42
42
|
name: string;
|
|
43
|
-
parents?: string[] | undefined;
|
|
44
43
|
timeout?: string | undefined;
|
|
44
|
+
parents?: string[] | undefined;
|
|
45
45
|
retries?: number | undefined;
|
|
46
46
|
rate_limits?: {
|
|
47
47
|
key: string;
|
package/util/retrier.js
CHANGED
|
@@ -16,8 +16,8 @@ exports.retrier = void 0;
|
|
|
16
16
|
const sleep_1 = __importDefault(require("./sleep"));
|
|
17
17
|
const DEFAULT_RETRY_INTERVAL = 5; // seconds
|
|
18
18
|
const DEFAULT_RETRY_COUNT = 5;
|
|
19
|
-
function retrier(
|
|
20
|
-
return __awaiter(this,
|
|
19
|
+
function retrier(fn_1, logger_1) {
|
|
20
|
+
return __awaiter(this, arguments, void 0, function* (fn, logger, retries = DEFAULT_RETRY_COUNT, interval = DEFAULT_RETRY_INTERVAL) {
|
|
21
21
|
let lastError;
|
|
22
22
|
// eslint-disable-next-line no-plusplus
|
|
23
23
|
for (let i = 0; i < retries; i++) {
|
package/workflow.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
|
|
|
18
18
|
}>, "many">>;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
20
|
name: string;
|
|
21
|
-
parents?: string[] | undefined;
|
|
22
21
|
timeout?: string | undefined;
|
|
22
|
+
parents?: string[] | undefined;
|
|
23
23
|
retries?: number | undefined;
|
|
24
24
|
rate_limits?: {
|
|
25
25
|
key: string;
|
|
@@ -27,8 +27,8 @@ declare const StepsSchema: z.ZodArray<z.ZodObject<{
|
|
|
27
27
|
}[] | undefined;
|
|
28
28
|
}, {
|
|
29
29
|
name: string;
|
|
30
|
-
parents?: string[] | undefined;
|
|
31
30
|
timeout?: string | undefined;
|
|
31
|
+
parents?: string[] | undefined;
|
|
32
32
|
retries?: number | undefined;
|
|
33
33
|
rate_limits?: {
|
|
34
34
|
key: string;
|
|
@@ -96,8 +96,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
96
96
|
}>, "many">>;
|
|
97
97
|
}, "strip", z.ZodTypeAny, {
|
|
98
98
|
name: string;
|
|
99
|
-
parents?: string[] | undefined;
|
|
100
99
|
timeout?: string | undefined;
|
|
100
|
+
parents?: string[] | undefined;
|
|
101
101
|
retries?: number | undefined;
|
|
102
102
|
rate_limits?: {
|
|
103
103
|
key: string;
|
|
@@ -105,8 +105,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
105
105
|
}[] | undefined;
|
|
106
106
|
}, {
|
|
107
107
|
name: string;
|
|
108
|
-
parents?: string[] | undefined;
|
|
109
108
|
timeout?: string | undefined;
|
|
109
|
+
parents?: string[] | undefined;
|
|
110
110
|
retries?: number | undefined;
|
|
111
111
|
rate_limits?: {
|
|
112
112
|
key: string;
|
|
@@ -130,8 +130,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
130
130
|
}>, "many">>;
|
|
131
131
|
}, "strip", z.ZodTypeAny, {
|
|
132
132
|
name: string;
|
|
133
|
-
parents?: string[] | undefined;
|
|
134
133
|
timeout?: string | undefined;
|
|
134
|
+
parents?: string[] | undefined;
|
|
135
135
|
retries?: number | undefined;
|
|
136
136
|
rate_limits?: {
|
|
137
137
|
key: string;
|
|
@@ -139,8 +139,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
139
139
|
}[] | undefined;
|
|
140
140
|
}, {
|
|
141
141
|
name: string;
|
|
142
|
-
parents?: string[] | undefined;
|
|
143
142
|
timeout?: string | undefined;
|
|
143
|
+
parents?: string[] | undefined;
|
|
144
144
|
retries?: number | undefined;
|
|
145
145
|
rate_limits?: {
|
|
146
146
|
key: string;
|
|
@@ -151,8 +151,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
151
151
|
description: string;
|
|
152
152
|
steps: {
|
|
153
153
|
name: string;
|
|
154
|
-
parents?: string[] | undefined;
|
|
155
154
|
timeout?: string | undefined;
|
|
155
|
+
parents?: string[] | undefined;
|
|
156
156
|
retries?: number | undefined;
|
|
157
157
|
rate_limits?: {
|
|
158
158
|
key: string;
|
|
@@ -172,8 +172,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
172
172
|
timeout?: string | undefined;
|
|
173
173
|
onFailure?: {
|
|
174
174
|
name: string;
|
|
175
|
-
parents?: string[] | undefined;
|
|
176
175
|
timeout?: string | undefined;
|
|
176
|
+
parents?: string[] | undefined;
|
|
177
177
|
retries?: number | undefined;
|
|
178
178
|
rate_limits?: {
|
|
179
179
|
key: string;
|
|
@@ -184,8 +184,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
184
184
|
description: string;
|
|
185
185
|
steps: {
|
|
186
186
|
name: string;
|
|
187
|
-
parents?: string[] | undefined;
|
|
188
187
|
timeout?: string | undefined;
|
|
188
|
+
parents?: string[] | undefined;
|
|
189
189
|
retries?: number | undefined;
|
|
190
190
|
rate_limits?: {
|
|
191
191
|
key: string;
|
|
@@ -205,8 +205,8 @@ export declare const CreateWorkflowSchema: z.ZodObject<{
|
|
|
205
205
|
timeout?: string | undefined;
|
|
206
206
|
onFailure?: {
|
|
207
207
|
name: string;
|
|
208
|
-
parents?: string[] | undefined;
|
|
209
208
|
timeout?: string | undefined;
|
|
209
|
+
parents?: string[] | undefined;
|
|
210
210
|
retries?: number | undefined;
|
|
211
211
|
rate_limits?: {
|
|
212
212
|
key: string;
|