@hatchet-dev/typescript-sdk 0.4.0 → 0.4.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.d.ts +16 -0
- package/clients/admin/admin-client.js +27 -0
- package/clients/dispatcher/action-listener.js +25 -25
- package/clients/listener/listener-client.js +1 -0
- package/clients/rest/generated/Api.d.ts +80 -1
- package/clients/rest/generated/Api.js +60 -0
- package/clients/rest/generated/data-contracts.d.ts +56 -1
- package/clients/rest/generated/data-contracts.js +1 -0
- package/package.json +1 -1
|
@@ -3,6 +3,13 @@ import { CreateWorkflowVersionOpts, RateLimitDuration, WorkflowServiceClient } f
|
|
|
3
3
|
import { ClientConfig } from '../hatchet-client/client-config';
|
|
4
4
|
import { Logger } from '../../util/logger';
|
|
5
5
|
import { Api } from '../rest';
|
|
6
|
+
import { WorkflowRunStatus } from '../rest/generated/data-contracts';
|
|
7
|
+
type WorkflowMetricsQuery = {
|
|
8
|
+
workflowId?: string;
|
|
9
|
+
workflowName?: string;
|
|
10
|
+
status?: WorkflowRunStatus;
|
|
11
|
+
groupKey?: string;
|
|
12
|
+
};
|
|
6
13
|
/**
|
|
7
14
|
* AdminClient is a client for interacting with the Hatchet Admin API. This allows you to configure, trigger,
|
|
8
15
|
* and monitor workflows.
|
|
@@ -89,4 +96,13 @@ export declare class AdminClient {
|
|
|
89
96
|
schedule_workflow(name: string, options?: {
|
|
90
97
|
schedules?: Date[];
|
|
91
98
|
}): void;
|
|
99
|
+
/**
|
|
100
|
+
* Get the metrics for a workflow.
|
|
101
|
+
*
|
|
102
|
+
* @param workflowId the ID of the workflow to get metrics for
|
|
103
|
+
* @param workflowName the name of the workflow to get metrics for
|
|
104
|
+
* @param query an object containing query parameters to filter the metrics
|
|
105
|
+
*/
|
|
106
|
+
get_workflow_metrics({ workflowId, workflowName, status, groupKey }: WorkflowMetricsQuery): Promise<import("axios").AxiosResponse<import("../rest/generated/data-contracts").WorkflowMetrics, any>>;
|
|
92
107
|
}
|
|
108
|
+
export {};
|
|
@@ -164,5 +164,32 @@ class AdminClient {
|
|
|
164
164
|
throw new hatchet_error_1.default(e.message);
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Get the metrics for a workflow.
|
|
169
|
+
*
|
|
170
|
+
* @param workflowId the ID of the workflow to get metrics for
|
|
171
|
+
* @param workflowName the name of the workflow to get metrics for
|
|
172
|
+
* @param query an object containing query parameters to filter the metrics
|
|
173
|
+
*/
|
|
174
|
+
get_workflow_metrics({ workflowId, workflowName, status, groupKey }) {
|
|
175
|
+
const params = {
|
|
176
|
+
status,
|
|
177
|
+
groupKey,
|
|
178
|
+
};
|
|
179
|
+
if (workflowName) {
|
|
180
|
+
this.list_workflows().then((res) => {
|
|
181
|
+
var _a;
|
|
182
|
+
const workflow = (_a = res.rows) === null || _a === void 0 ? void 0 : _a.find((row) => row.name === workflowName);
|
|
183
|
+
if (workflow) {
|
|
184
|
+
return this.api.workflowGetMetrics(workflow.metadata.id, params);
|
|
185
|
+
}
|
|
186
|
+
throw new Error(`Workflow ${workflowName} not found`);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
else if (workflowId) {
|
|
190
|
+
return this.api.workflowGetMetrics(workflowId, params);
|
|
191
|
+
}
|
|
192
|
+
throw new Error('Must provide either a workflowId or workflowName');
|
|
193
|
+
}
|
|
167
194
|
}
|
|
168
195
|
exports.AdminClient = AdminClient;
|
|
@@ -38,7 +38,7 @@ const sleep_1 = __importDefault(require("../../util/sleep"));
|
|
|
38
38
|
const hatchet_error_1 = __importDefault(require("../../util/errors/hatchet-error"));
|
|
39
39
|
const logger_1 = require("../../util/logger");
|
|
40
40
|
const DEFAULT_ACTION_LISTENER_RETRY_INTERVAL = 5000; // milliseconds
|
|
41
|
-
const DEFAULT_ACTION_LISTENER_RETRY_COUNT =
|
|
41
|
+
const DEFAULT_ACTION_LISTENER_RETRY_COUNT = 20;
|
|
42
42
|
// eslint-disable-next-line no-shadow
|
|
43
43
|
var ListenStrategy;
|
|
44
44
|
(function (ListenStrategy) {
|
|
@@ -61,9 +61,10 @@ class ActionListener {
|
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
63
|
try {
|
|
64
|
+
const listenClient = yield __await(client.getListenClient());
|
|
64
65
|
try {
|
|
65
|
-
for (var _d = true,
|
|
66
|
-
_c =
|
|
66
|
+
for (var _d = true, listenClient_1 = (e_1 = void 0, __asyncValues(listenClient)), listenClient_1_1; listenClient_1_1 = yield __await(listenClient_1.next()), _a = listenClient_1_1.done, !_a; _d = true) {
|
|
67
|
+
_c = listenClient_1_1.value;
|
|
67
68
|
_d = false;
|
|
68
69
|
const assignedAction = _c;
|
|
69
70
|
const action = Object.assign({}, assignedAction);
|
|
@@ -73,24 +74,25 @@ class ActionListener {
|
|
|
73
74
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
74
75
|
finally {
|
|
75
76
|
try {
|
|
76
|
-
if (!_d && !_a && (_b =
|
|
77
|
+
if (!_d && !_a && (_b = listenClient_1.return)) yield __await(_b.call(listenClient_1));
|
|
77
78
|
}
|
|
78
79
|
finally { if (e_1) throw e_1.error; }
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
catch (e) {
|
|
83
|
+
client.logger.info('Listener error');
|
|
82
84
|
// if this is a HatchetError, we should throw this error
|
|
83
85
|
if (e instanceof hatchet_error_1.default) {
|
|
84
86
|
throw e;
|
|
85
87
|
}
|
|
86
|
-
if (e.code === nice_grpc_1.Status.CANCELLED) {
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
88
|
if ((yield __await(client.getListenStrategy())) === ListenStrategy.LISTEN_STRATEGY_V2 &&
|
|
90
89
|
e.code === nice_grpc_1.Status.UNIMPLEMENTED) {
|
|
91
90
|
client.setListenStrategy(ListenStrategy.LISTEN_STRATEGY_V1);
|
|
92
91
|
}
|
|
93
92
|
client.incrementRetries();
|
|
93
|
+
client.logger.error(`Listener encountered an error: ${e.message}`);
|
|
94
|
+
client.logger.info(`Retrying in ${client.retryInterval}ms...`);
|
|
95
|
+
yield __await((0, sleep_1.default)(client.retryInterval));
|
|
94
96
|
}
|
|
95
97
|
}
|
|
96
98
|
});
|
|
@@ -122,20 +124,7 @@ class ActionListener {
|
|
|
122
124
|
if (this.heartbeatInterval) {
|
|
123
125
|
return;
|
|
124
126
|
}
|
|
125
|
-
|
|
126
|
-
try {
|
|
127
|
-
yield this.client.heartbeat({
|
|
128
|
-
workerId: this.workerId,
|
|
129
|
-
heartbeatAt: new Date(),
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
catch (e) {
|
|
133
|
-
this.logger.error(`Failed to send heartbeat: ${e.message}`);
|
|
134
|
-
if (e.code === nice_grpc_1.Status.UNIMPLEMENTED) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
this.heartbeatInterval = setInterval(() => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
const beat = () => __awaiter(this, void 0, void 0, function* () {
|
|
139
128
|
try {
|
|
140
129
|
yield this.client.heartbeat({
|
|
141
130
|
workerId: this.workerId,
|
|
@@ -150,7 +139,10 @@ class ActionListener {
|
|
|
150
139
|
}
|
|
151
140
|
this.logger.error(`Failed to send heartbeat: ${e.message}`);
|
|
152
141
|
}
|
|
153
|
-
})
|
|
142
|
+
});
|
|
143
|
+
// start with a heartbeat
|
|
144
|
+
beat();
|
|
145
|
+
this.heartbeatInterval = setInterval(beat, 4000);
|
|
154
146
|
});
|
|
155
147
|
}
|
|
156
148
|
closeHeartbeat() {
|
|
@@ -175,20 +167,28 @@ class ActionListener {
|
|
|
175
167
|
}
|
|
176
168
|
try {
|
|
177
169
|
if (this.listenStrategy === ListenStrategy.LISTEN_STRATEGY_V1) {
|
|
178
|
-
|
|
170
|
+
const result = this.client.listen({
|
|
179
171
|
workerId: this.workerId,
|
|
180
172
|
});
|
|
173
|
+
this.logger.info('Connection established using LISTEN_STRATEGY_V1');
|
|
174
|
+
return result;
|
|
181
175
|
}
|
|
182
176
|
const res = this.client.listenV2({
|
|
183
177
|
workerId: this.workerId,
|
|
184
178
|
});
|
|
185
179
|
this.heartbeat();
|
|
180
|
+
this.logger.info('Connection established using LISTEN_STRATEGY_V2');
|
|
186
181
|
return res;
|
|
187
182
|
}
|
|
188
183
|
catch (e) {
|
|
189
184
|
this.retries += 1;
|
|
190
|
-
this.logger.error(`Attempt ${this.retries}: Failed to connect, retrying...`);
|
|
191
|
-
|
|
185
|
+
this.logger.error(`Attempt ${this.retries}: Failed to connect, retrying...`);
|
|
186
|
+
if (e.code === nice_grpc_1.Status.UNAVAILABLE) {
|
|
187
|
+
// Connection lost, reset heartbeat interval and retry connection
|
|
188
|
+
this.closeHeartbeat();
|
|
189
|
+
return this.getListenClient();
|
|
190
|
+
}
|
|
191
|
+
throw e;
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
}
|
|
@@ -91,6 +91,7 @@ const workflowStatusMap = {
|
|
|
91
91
|
[data_contracts_1.WorkflowRunStatus.CANCELLED]: RunEventType.WORKFLOW_RUN_EVENT_TYPE_CANCELLED,
|
|
92
92
|
[data_contracts_1.WorkflowRunStatus.PENDING]: undefined,
|
|
93
93
|
[data_contracts_1.WorkflowRunStatus.RUNNING]: undefined,
|
|
94
|
+
[data_contracts_1.WorkflowRunStatus.QUEUED]: undefined,
|
|
94
95
|
};
|
|
95
96
|
class PollingAsyncListener {
|
|
96
97
|
constructor(workflowRunid, client) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { APIMeta, AcceptInviteRequest, CreateAPITokenRequest, CreateAPITokenResponse, CreatePullRequestFromStepRun, CreateTenantInviteRequest, CreateTenantRequest, EventData, EventKey, EventKeyList, EventList, EventOrderByDirection, EventOrderByField, EventSearch, GetStepRunDiffResponse, LinkGithubRepositoryRequest, ListAPIMetaIntegration, ListAPITokensResponse, ListGithubAppInstallationsResponse, ListGithubBranchesResponse, ListGithubReposResponse, ListPullRequestsResponse, LogLineLevelField, LogLineList, LogLineOrderByDirection, LogLineOrderByField, LogLineSearch, PullRequestState, RejectInviteRequest, ReplayEventRequest, RerunStepRunRequest, StepRun, Tenant, TenantInvite, TenantInviteList, TenantMemberList, TriggerWorkflowRunRequest, UpdateTenantInviteRequest, User, UserLoginRequest, UserRegisterRequest, UserTenantMembershipsList, Worker, WorkerList, Workflow, WorkflowID, WorkflowList, WorkflowRun, WorkflowRunList, WorkflowRunStatusList, WorkflowVersion, WorkflowVersionDefinition } from './data-contracts';
|
|
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';
|
|
2
2
|
import { HttpClient, RequestParams } from './http-client';
|
|
3
3
|
export declare class Api<SecurityDataType = unknown> extends HttpClient<SecurityDataType> {
|
|
4
4
|
/**
|
|
@@ -112,6 +112,36 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
112
112
|
* @request POST:/api/v1/sns/{tenant}/{event}
|
|
113
113
|
*/
|
|
114
114
|
snsUpdate: (tenant: string, event: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
115
|
+
/**
|
|
116
|
+
* @description List SNS integrations
|
|
117
|
+
*
|
|
118
|
+
* @tags SNS
|
|
119
|
+
* @name SnsList
|
|
120
|
+
* @summary List SNS integrations
|
|
121
|
+
* @request GET:/api/v1/tenants/{tenant}/sns
|
|
122
|
+
* @secure
|
|
123
|
+
*/
|
|
124
|
+
snsList: (tenant: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<ListSNSIntegrations, any>>;
|
|
125
|
+
/**
|
|
126
|
+
* @description Create SNS integration
|
|
127
|
+
*
|
|
128
|
+
* @tags SNS
|
|
129
|
+
* @name SnsCreate
|
|
130
|
+
* @summary Create SNS integration
|
|
131
|
+
* @request POST:/api/v1/tenants/{tenant}/sns
|
|
132
|
+
* @secure
|
|
133
|
+
*/
|
|
134
|
+
snsCreate: (tenant: string, data: CreateSNSIntegrationRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<SNSIntegration, any>>;
|
|
135
|
+
/**
|
|
136
|
+
* @description Delete SNS integration
|
|
137
|
+
*
|
|
138
|
+
* @tags SNS
|
|
139
|
+
* @name SnsDelete
|
|
140
|
+
* @summary Delete SNS integration
|
|
141
|
+
* @request DELETE:/api/v1/sns/{sns}
|
|
142
|
+
* @secure
|
|
143
|
+
*/
|
|
144
|
+
snsDelete: (sns: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<void, any>>;
|
|
115
145
|
/**
|
|
116
146
|
* @description Gets the current user
|
|
117
147
|
*
|
|
@@ -122,6 +152,16 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
122
152
|
* @secure
|
|
123
153
|
*/
|
|
124
154
|
userGetCurrent: (params?: RequestParams) => Promise<import("axios").AxiosResponse<User, any>>;
|
|
155
|
+
/**
|
|
156
|
+
* @description Update a user password.
|
|
157
|
+
*
|
|
158
|
+
* @tags User
|
|
159
|
+
* @name UserUpdatePassword
|
|
160
|
+
* @summary Change user password
|
|
161
|
+
* @request POST:/api/v1/users/password
|
|
162
|
+
* @secure
|
|
163
|
+
*/
|
|
164
|
+
userUpdatePassword: (data: UserChangePasswordRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<User, any>>;
|
|
125
165
|
/**
|
|
126
166
|
* @description Registers a user.
|
|
127
167
|
*
|
|
@@ -426,6 +466,21 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
426
466
|
* @secure
|
|
427
467
|
*/
|
|
428
468
|
workflowUpdateLinkGithub: (workflow: string, data: LinkGithubRepositoryRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<Workflow, any>>;
|
|
469
|
+
/**
|
|
470
|
+
* @description Get the metrics for a workflow version
|
|
471
|
+
*
|
|
472
|
+
* @tags Workflow
|
|
473
|
+
* @name WorkflowGetMetrics
|
|
474
|
+
* @summary Get workflow metrics
|
|
475
|
+
* @request GET:/api/v1/workflows/{workflow}/metrics
|
|
476
|
+
* @secure
|
|
477
|
+
*/
|
|
478
|
+
workflowGetMetrics: (workflow: string, query?: {
|
|
479
|
+
/** A status of workflow runs to filter by */
|
|
480
|
+
status?: WorkflowRunStatus;
|
|
481
|
+
/** A group key to filter metrics by */
|
|
482
|
+
groupKey?: string;
|
|
483
|
+
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<WorkflowMetrics, any>>;
|
|
429
484
|
/**
|
|
430
485
|
* @description Create a pull request for a workflow
|
|
431
486
|
*
|
|
@@ -509,6 +564,20 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
509
564
|
* @maxLength 36
|
|
510
565
|
*/
|
|
511
566
|
workflowId?: string;
|
|
567
|
+
/**
|
|
568
|
+
* The parent workflow run id
|
|
569
|
+
* @format uuid
|
|
570
|
+
* @minLength 36
|
|
571
|
+
* @maxLength 36
|
|
572
|
+
*/
|
|
573
|
+
parentWorkflowRunId?: string;
|
|
574
|
+
/**
|
|
575
|
+
* The parent step run id
|
|
576
|
+
* @format uuid
|
|
577
|
+
* @minLength 36
|
|
578
|
+
* @maxLength 36
|
|
579
|
+
*/
|
|
580
|
+
parentStepRunId?: string;
|
|
512
581
|
}, params?: RequestParams) => Promise<import("axios").AxiosResponse<WorkflowRunList, any>>;
|
|
513
582
|
/**
|
|
514
583
|
* @description Get a workflow run for a tenant
|
|
@@ -553,6 +622,16 @@ export declare class Api<SecurityDataType = unknown> extends HttpClient<Security
|
|
|
553
622
|
* @secure
|
|
554
623
|
*/
|
|
555
624
|
stepRunUpdateRerun: (tenant: string, stepRun: string, data: RerunStepRunRequest, params?: RequestParams) => Promise<import("axios").AxiosResponse<StepRun, any>>;
|
|
625
|
+
/**
|
|
626
|
+
* @description Attempts to cancel a step run
|
|
627
|
+
*
|
|
628
|
+
* @tags Step Run
|
|
629
|
+
* @name StepRunUpdateCancel
|
|
630
|
+
* @summary Attempts to cancel a step run
|
|
631
|
+
* @request POST:/api/v1/tenants/{tenant}/step-runs/{step-run}/cancel
|
|
632
|
+
* @secure
|
|
633
|
+
*/
|
|
634
|
+
stepRunUpdateCancel: (tenant: string, stepRun: string, params?: RequestParams) => Promise<import("axios").AxiosResponse<StepRun, any>>;
|
|
556
635
|
/**
|
|
557
636
|
* @description Get the schema for a step run
|
|
558
637
|
*
|
|
@@ -126,6 +126,36 @@ class Api extends http_client_1.HttpClient {
|
|
|
126
126
|
* @request POST:/api/v1/sns/{tenant}/{event}
|
|
127
127
|
*/
|
|
128
128
|
this.snsUpdate = (tenant, event, params = {}) => this.request(Object.assign({ path: `/api/v1/sns/${tenant}/${event}`, method: 'POST' }, params));
|
|
129
|
+
/**
|
|
130
|
+
* @description List SNS integrations
|
|
131
|
+
*
|
|
132
|
+
* @tags SNS
|
|
133
|
+
* @name SnsList
|
|
134
|
+
* @summary List SNS integrations
|
|
135
|
+
* @request GET:/api/v1/tenants/{tenant}/sns
|
|
136
|
+
* @secure
|
|
137
|
+
*/
|
|
138
|
+
this.snsList = (tenant, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/sns`, method: 'GET', secure: true, format: 'json' }, params));
|
|
139
|
+
/**
|
|
140
|
+
* @description Create SNS integration
|
|
141
|
+
*
|
|
142
|
+
* @tags SNS
|
|
143
|
+
* @name SnsCreate
|
|
144
|
+
* @summary Create SNS integration
|
|
145
|
+
* @request POST:/api/v1/tenants/{tenant}/sns
|
|
146
|
+
* @secure
|
|
147
|
+
*/
|
|
148
|
+
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));
|
|
149
|
+
/**
|
|
150
|
+
* @description Delete SNS integration
|
|
151
|
+
*
|
|
152
|
+
* @tags SNS
|
|
153
|
+
* @name SnsDelete
|
|
154
|
+
* @summary Delete SNS integration
|
|
155
|
+
* @request DELETE:/api/v1/sns/{sns}
|
|
156
|
+
* @secure
|
|
157
|
+
*/
|
|
158
|
+
this.snsDelete = (sns, params = {}) => this.request(Object.assign({ path: `/api/v1/sns/${sns}`, method: 'DELETE', secure: true }, params));
|
|
129
159
|
/**
|
|
130
160
|
* @description Gets the current user
|
|
131
161
|
*
|
|
@@ -136,6 +166,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
136
166
|
* @secure
|
|
137
167
|
*/
|
|
138
168
|
this.userGetCurrent = (params = {}) => this.request(Object.assign({ path: `/api/v1/users/current`, method: 'GET', secure: true, format: 'json' }, params));
|
|
169
|
+
/**
|
|
170
|
+
* @description Update a user password.
|
|
171
|
+
*
|
|
172
|
+
* @tags User
|
|
173
|
+
* @name UserUpdatePassword
|
|
174
|
+
* @summary Change user password
|
|
175
|
+
* @request POST:/api/v1/users/password
|
|
176
|
+
* @secure
|
|
177
|
+
*/
|
|
178
|
+
this.userUpdatePassword = (data, params = {}) => this.request(Object.assign({ path: `/api/v1/users/password`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
139
179
|
/**
|
|
140
180
|
* @description Registers a user.
|
|
141
181
|
*
|
|
@@ -393,6 +433,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
393
433
|
* @secure
|
|
394
434
|
*/
|
|
395
435
|
this.workflowUpdateLinkGithub = (workflow, data, params = {}) => this.request(Object.assign({ path: `/api/v1/workflows/${workflow}/link-github`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
436
|
+
/**
|
|
437
|
+
* @description Get the metrics for a workflow version
|
|
438
|
+
*
|
|
439
|
+
* @tags Workflow
|
|
440
|
+
* @name WorkflowGetMetrics
|
|
441
|
+
* @summary Get workflow metrics
|
|
442
|
+
* @request GET:/api/v1/workflows/{workflow}/metrics
|
|
443
|
+
* @secure
|
|
444
|
+
*/
|
|
445
|
+
this.workflowGetMetrics = (workflow, query, params = {}) => this.request(Object.assign({ path: `/api/v1/workflows/${workflow}/metrics`, method: 'GET', query: query, secure: true, format: 'json' }, params));
|
|
396
446
|
/**
|
|
397
447
|
* @description Create a pull request for a workflow
|
|
398
448
|
*
|
|
@@ -473,6 +523,16 @@ class Api extends http_client_1.HttpClient {
|
|
|
473
523
|
* @secure
|
|
474
524
|
*/
|
|
475
525
|
this.stepRunUpdateRerun = (tenant, stepRun, data, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/step-runs/${stepRun}/rerun`, method: 'POST', body: data, secure: true, type: http_client_1.ContentType.Json, format: 'json' }, params));
|
|
526
|
+
/**
|
|
527
|
+
* @description Attempts to cancel a step run
|
|
528
|
+
*
|
|
529
|
+
* @tags Step Run
|
|
530
|
+
* @name StepRunUpdateCancel
|
|
531
|
+
* @summary Attempts to cancel a step run
|
|
532
|
+
* @request POST:/api/v1/tenants/{tenant}/step-runs/{step-run}/cancel
|
|
533
|
+
* @secure
|
|
534
|
+
*/
|
|
535
|
+
this.stepRunUpdateCancel = (tenant, stepRun, params = {}) => this.request(Object.assign({ path: `/api/v1/tenants/${tenant}/step-runs/${stepRun}/cancel`, method: 'POST', secure: true, format: 'json' }, params));
|
|
476
536
|
/**
|
|
477
537
|
* @description Get the schema for a step run
|
|
478
538
|
*
|
|
@@ -98,6 +98,8 @@ export interface User {
|
|
|
98
98
|
email: string;
|
|
99
99
|
/** Whether the user has verified their email address. */
|
|
100
100
|
emailVerified: boolean;
|
|
101
|
+
/** Whether the user has a password set. */
|
|
102
|
+
hasPassword?: boolean;
|
|
101
103
|
}
|
|
102
104
|
export interface UserTenantPublic {
|
|
103
105
|
/**
|
|
@@ -117,6 +119,12 @@ export interface UserLoginRequest {
|
|
|
117
119
|
/** The password of the user. */
|
|
118
120
|
password: string;
|
|
119
121
|
}
|
|
122
|
+
export interface UserChangePasswordRequest {
|
|
123
|
+
/** The password of the user. */
|
|
124
|
+
password: string;
|
|
125
|
+
/** The new password for the user. */
|
|
126
|
+
newPassword: string;
|
|
127
|
+
}
|
|
120
128
|
export interface UserRegisterRequest {
|
|
121
129
|
/** The name of the user. */
|
|
122
130
|
name: string;
|
|
@@ -239,6 +247,11 @@ export interface EventWorkflowRunSummary {
|
|
|
239
247
|
* @format int64
|
|
240
248
|
*/
|
|
241
249
|
running?: number;
|
|
250
|
+
/**
|
|
251
|
+
* The number of queued runs.
|
|
252
|
+
* @format int64
|
|
253
|
+
*/
|
|
254
|
+
queued?: number;
|
|
242
255
|
/**
|
|
243
256
|
* The number of succeeded runs.
|
|
244
257
|
* @format int64
|
|
@@ -403,6 +416,20 @@ export interface WorkflowRun {
|
|
|
403
416
|
startedAt?: string;
|
|
404
417
|
/** @format date-time */
|
|
405
418
|
finishedAt?: string;
|
|
419
|
+
/**
|
|
420
|
+
* @format uuid
|
|
421
|
+
* @minLength 36
|
|
422
|
+
* @maxLength 36
|
|
423
|
+
* @example "bb214807-246e-43a5-a25d-41761d1cff9e"
|
|
424
|
+
*/
|
|
425
|
+
parentId?: string;
|
|
426
|
+
/**
|
|
427
|
+
* @format uuid
|
|
428
|
+
* @minLength 36
|
|
429
|
+
* @maxLength 36
|
|
430
|
+
* @example "bb214807-246e-43a5-a25d-41761d1cff9e"
|
|
431
|
+
*/
|
|
432
|
+
parentStepRunId?: string;
|
|
406
433
|
}
|
|
407
434
|
export interface WorkflowRunList {
|
|
408
435
|
rows?: WorkflowRun[];
|
|
@@ -413,7 +440,8 @@ export declare enum WorkflowRunStatus {
|
|
|
413
440
|
RUNNING = "RUNNING",
|
|
414
441
|
SUCCEEDED = "SUCCEEDED",
|
|
415
442
|
FAILED = "FAILED",
|
|
416
|
-
CANCELLED = "CANCELLED"
|
|
443
|
+
CANCELLED = "CANCELLED",
|
|
444
|
+
QUEUED = "QUEUED"
|
|
417
445
|
}
|
|
418
446
|
export type WorkflowRunStatusList = WorkflowRunStatus[];
|
|
419
447
|
export declare enum JobRunStatus {
|
|
@@ -471,6 +499,7 @@ export interface StepRun {
|
|
|
471
499
|
step?: Step;
|
|
472
500
|
children?: string[];
|
|
473
501
|
parents?: string[];
|
|
502
|
+
childWorkflowRuns?: string[];
|
|
474
503
|
workerId?: string;
|
|
475
504
|
input?: string;
|
|
476
505
|
output?: string;
|
|
@@ -639,3 +668,29 @@ export declare enum LogLineOrderByDirection {
|
|
|
639
668
|
}
|
|
640
669
|
export type LogLineSearch = string;
|
|
641
670
|
export type LogLineLevelField = LogLineLevel[];
|
|
671
|
+
export interface SNSIntegration {
|
|
672
|
+
metadata: APIResourceMeta;
|
|
673
|
+
/**
|
|
674
|
+
* The unique identifier for the tenant that the SNS integration belongs to.
|
|
675
|
+
* @format uuid
|
|
676
|
+
*/
|
|
677
|
+
tenantId: string;
|
|
678
|
+
/** The Amazon Resource Name (ARN) of the SNS topic. */
|
|
679
|
+
topicArn: string;
|
|
680
|
+
/** The URL to send SNS messages to. */
|
|
681
|
+
ingestUrl?: string;
|
|
682
|
+
}
|
|
683
|
+
export interface ListSNSIntegrations {
|
|
684
|
+
pagination: PaginationResponse;
|
|
685
|
+
rows: SNSIntegration[];
|
|
686
|
+
}
|
|
687
|
+
export interface CreateSNSIntegrationRequest {
|
|
688
|
+
/** The Amazon Resource Name (ARN) of the SNS topic. */
|
|
689
|
+
topicArn: string;
|
|
690
|
+
}
|
|
691
|
+
export interface WorkflowMetrics {
|
|
692
|
+
/** The number of runs for a specific group key (passed via filter) */
|
|
693
|
+
groupKeyRunsCount?: number;
|
|
694
|
+
/** The total number of concurrency group keys. */
|
|
695
|
+
groupKeyCount?: number;
|
|
696
|
+
}
|
|
@@ -33,6 +33,7 @@ var WorkflowRunStatus;
|
|
|
33
33
|
WorkflowRunStatus["SUCCEEDED"] = "SUCCEEDED";
|
|
34
34
|
WorkflowRunStatus["FAILED"] = "FAILED";
|
|
35
35
|
WorkflowRunStatus["CANCELLED"] = "CANCELLED";
|
|
36
|
+
WorkflowRunStatus["QUEUED"] = "QUEUED";
|
|
36
37
|
})(WorkflowRunStatus || (exports.WorkflowRunStatus = WorkflowRunStatus = {}));
|
|
37
38
|
var JobRunStatus;
|
|
38
39
|
(function (JobRunStatus) {
|