@knowledge-stack/ksapi 1.91.0 → 1.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/apis/WorkflowRunsApi.d.ts +44 -0
- package/dist/apis/WorkflowRunsApi.js +44 -0
- package/dist/esm/apis/WorkflowRunsApi.d.ts +44 -0
- package/dist/esm/apis/WorkflowRunsApi.js +44 -0
- package/docs/WorkflowRunsApi.md +75 -0
- package/package.json +1 -1
- package/src/apis/WorkflowRunsApi.ts +85 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @knowledge-stack/ksapi@1.
|
|
1
|
+
# @knowledge-stack/ksapi@1.92.0
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the localhost API.
|
|
4
4
|
|
|
@@ -211,6 +211,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
211
211
|
*WorkflowRunsApi* | [**cloneWorkflowRun**](docs/WorkflowRunsApi.md#cloneworkflowrunoperation) | **POST** /v1/workflow-runs/{run_id}/clone | Clone Workflow Run Handler
|
|
212
212
|
*WorkflowRunsApi* | [**deleteWorkflowRun**](docs/WorkflowRunsApi.md#deleteworkflowrun) | **DELETE** /v1/workflow-runs/{run_id} | Delete Workflow Run Handler
|
|
213
213
|
*WorkflowRunsApi* | [**getWorkflowRun**](docs/WorkflowRunsApi.md#getworkflowrun) | **GET** /v1/workflow-runs/{run_id} | Get Workflow Run Handler
|
|
214
|
+
*WorkflowRunsApi* | [**retryWorkflowRun**](docs/WorkflowRunsApi.md#retryworkflowrun) | **POST** /v1/workflow-runs/{run_id}/retry | Retry Workflow Run Handler
|
|
214
215
|
*WorkflowRunsApi* | [**setWorkflowRunApproval**](docs/WorkflowRunsApi.md#setworkflowrunapprovaloperation) | **POST** /v1/workflow-runs/{run_id}/approval | Set Workflow Run Approval Handler
|
|
215
216
|
*WorkflowRunsApi* | [**startWorkflowRun**](docs/WorkflowRunsApi.md#startworkflowrun) | **POST** /v1/workflow-runs/{run_id}/start | Start Workflow Run Handler
|
|
216
217
|
*WorkflowRunsApi* | [**stopWorkflowRun**](docs/WorkflowRunsApi.md#stopworkflowrun) | **POST** /v1/workflow-runs/{run_id}/stop | Stop Workflow Run Handler
|
|
@@ -466,7 +467,7 @@ and is automatically generated by the
|
|
|
466
467
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
467
468
|
|
|
468
469
|
- API version: `0.1.0`
|
|
469
|
-
- Package version: `1.
|
|
470
|
+
- Package version: `1.92.0`
|
|
470
471
|
- Generator version: `7.21.0`
|
|
471
472
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
472
473
|
|
|
@@ -27,6 +27,11 @@ export interface GetWorkflowRunRequest {
|
|
|
27
27
|
authorization?: string | null;
|
|
28
28
|
ksUat?: string | null;
|
|
29
29
|
}
|
|
30
|
+
export interface RetryWorkflowRunRequest {
|
|
31
|
+
runId: string;
|
|
32
|
+
authorization?: string | null;
|
|
33
|
+
ksUat?: string | null;
|
|
34
|
+
}
|
|
30
35
|
export interface SetWorkflowRunApprovalOperationRequest {
|
|
31
36
|
runId: string;
|
|
32
37
|
setWorkflowRunApprovalRequest: SetWorkflowRunApprovalRequest;
|
|
@@ -137,6 +142,31 @@ export interface WorkflowRunsApiInterface {
|
|
|
137
142
|
* Get Workflow Run Handler
|
|
138
143
|
*/
|
|
139
144
|
getWorkflowRun(requestParameters: GetWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
145
|
+
/**
|
|
146
|
+
* Creates request options for retryWorkflowRun without sending the request
|
|
147
|
+
* @param {string} runId
|
|
148
|
+
* @param {string} [authorization]
|
|
149
|
+
* @param {string} [ksUat]
|
|
150
|
+
* @throws {RequiredError}
|
|
151
|
+
* @memberof WorkflowRunsApiInterface
|
|
152
|
+
*/
|
|
153
|
+
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
154
|
+
/**
|
|
155
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
156
|
+
* @summary Retry Workflow Run Handler
|
|
157
|
+
* @param {string} runId
|
|
158
|
+
* @param {string} [authorization]
|
|
159
|
+
* @param {string} [ksUat]
|
|
160
|
+
* @param {*} [options] Override http request option.
|
|
161
|
+
* @throws {RequiredError}
|
|
162
|
+
* @memberof WorkflowRunsApiInterface
|
|
163
|
+
*/
|
|
164
|
+
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
165
|
+
/**
|
|
166
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
167
|
+
* Retry Workflow Run Handler
|
|
168
|
+
*/
|
|
169
|
+
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
140
170
|
/**
|
|
141
171
|
* Creates request options for setWorkflowRunApproval without sending the request
|
|
142
172
|
* @param {string} runId
|
|
@@ -311,6 +341,20 @@ export declare class WorkflowRunsApi extends runtime.BaseAPI implements Workflow
|
|
|
311
341
|
* Get Workflow Run Handler
|
|
312
342
|
*/
|
|
313
343
|
getWorkflowRun(requestParameters: GetWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
344
|
+
/**
|
|
345
|
+
* Creates request options for retryWorkflowRun without sending the request
|
|
346
|
+
*/
|
|
347
|
+
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
348
|
+
/**
|
|
349
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
350
|
+
* Retry Workflow Run Handler
|
|
351
|
+
*/
|
|
352
|
+
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
353
|
+
/**
|
|
354
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
355
|
+
* Retry Workflow Run Handler
|
|
356
|
+
*/
|
|
357
|
+
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
314
358
|
/**
|
|
315
359
|
* Creates request options for setWorkflowRunApproval without sending the request
|
|
316
360
|
*/
|
|
@@ -194,6 +194,50 @@ class WorkflowRunsApi extends runtime.BaseAPI {
|
|
|
194
194
|
return yield response.value();
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Creates request options for retryWorkflowRun without sending the request
|
|
199
|
+
*/
|
|
200
|
+
retryWorkflowRunRequestOpts(requestParameters) {
|
|
201
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
202
|
+
if (requestParameters['runId'] == null) {
|
|
203
|
+
throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling retryWorkflowRun().');
|
|
204
|
+
}
|
|
205
|
+
const queryParameters = {};
|
|
206
|
+
const headerParameters = {};
|
|
207
|
+
if (requestParameters['authorization'] != null) {
|
|
208
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
209
|
+
}
|
|
210
|
+
let urlPath = `/v1/workflow-runs/{run_id}/retry`;
|
|
211
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
212
|
+
return {
|
|
213
|
+
path: urlPath,
|
|
214
|
+
method: 'POST',
|
|
215
|
+
headers: headerParameters,
|
|
216
|
+
query: queryParameters,
|
|
217
|
+
};
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
222
|
+
* Retry Workflow Run Handler
|
|
223
|
+
*/
|
|
224
|
+
retryWorkflowRunRaw(requestParameters, initOverrides) {
|
|
225
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
226
|
+
const requestOptions = yield this.retryWorkflowRunRequestOpts(requestParameters);
|
|
227
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
228
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WorkflowRunResponseFromJSON)(jsonValue));
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
233
|
+
* Retry Workflow Run Handler
|
|
234
|
+
*/
|
|
235
|
+
retryWorkflowRun(requestParameters, initOverrides) {
|
|
236
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
+
const response = yield this.retryWorkflowRunRaw(requestParameters, initOverrides);
|
|
238
|
+
return yield response.value();
|
|
239
|
+
});
|
|
240
|
+
}
|
|
197
241
|
/**
|
|
198
242
|
* Creates request options for setWorkflowRunApproval without sending the request
|
|
199
243
|
*/
|
|
@@ -27,6 +27,11 @@ export interface GetWorkflowRunRequest {
|
|
|
27
27
|
authorization?: string | null;
|
|
28
28
|
ksUat?: string | null;
|
|
29
29
|
}
|
|
30
|
+
export interface RetryWorkflowRunRequest {
|
|
31
|
+
runId: string;
|
|
32
|
+
authorization?: string | null;
|
|
33
|
+
ksUat?: string | null;
|
|
34
|
+
}
|
|
30
35
|
export interface SetWorkflowRunApprovalOperationRequest {
|
|
31
36
|
runId: string;
|
|
32
37
|
setWorkflowRunApprovalRequest: SetWorkflowRunApprovalRequest;
|
|
@@ -137,6 +142,31 @@ export interface WorkflowRunsApiInterface {
|
|
|
137
142
|
* Get Workflow Run Handler
|
|
138
143
|
*/
|
|
139
144
|
getWorkflowRun(requestParameters: GetWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
145
|
+
/**
|
|
146
|
+
* Creates request options for retryWorkflowRun without sending the request
|
|
147
|
+
* @param {string} runId
|
|
148
|
+
* @param {string} [authorization]
|
|
149
|
+
* @param {string} [ksUat]
|
|
150
|
+
* @throws {RequiredError}
|
|
151
|
+
* @memberof WorkflowRunsApiInterface
|
|
152
|
+
*/
|
|
153
|
+
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
154
|
+
/**
|
|
155
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
156
|
+
* @summary Retry Workflow Run Handler
|
|
157
|
+
* @param {string} runId
|
|
158
|
+
* @param {string} [authorization]
|
|
159
|
+
* @param {string} [ksUat]
|
|
160
|
+
* @param {*} [options] Override http request option.
|
|
161
|
+
* @throws {RequiredError}
|
|
162
|
+
* @memberof WorkflowRunsApiInterface
|
|
163
|
+
*/
|
|
164
|
+
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
165
|
+
/**
|
|
166
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
167
|
+
* Retry Workflow Run Handler
|
|
168
|
+
*/
|
|
169
|
+
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
140
170
|
/**
|
|
141
171
|
* Creates request options for setWorkflowRunApproval without sending the request
|
|
142
172
|
* @param {string} runId
|
|
@@ -311,6 +341,20 @@ export declare class WorkflowRunsApi extends runtime.BaseAPI implements Workflow
|
|
|
311
341
|
* Get Workflow Run Handler
|
|
312
342
|
*/
|
|
313
343
|
getWorkflowRun(requestParameters: GetWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
344
|
+
/**
|
|
345
|
+
* Creates request options for retryWorkflowRun without sending the request
|
|
346
|
+
*/
|
|
347
|
+
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
348
|
+
/**
|
|
349
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
350
|
+
* Retry Workflow Run Handler
|
|
351
|
+
*/
|
|
352
|
+
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
353
|
+
/**
|
|
354
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
355
|
+
* Retry Workflow Run Handler
|
|
356
|
+
*/
|
|
357
|
+
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
314
358
|
/**
|
|
315
359
|
* Creates request options for setWorkflowRunApproval without sending the request
|
|
316
360
|
*/
|
|
@@ -158,6 +158,50 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
|
|
|
158
158
|
return yield response.value();
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Creates request options for retryWorkflowRun without sending the request
|
|
163
|
+
*/
|
|
164
|
+
retryWorkflowRunRequestOpts(requestParameters) {
|
|
165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
166
|
+
if (requestParameters['runId'] == null) {
|
|
167
|
+
throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling retryWorkflowRun().');
|
|
168
|
+
}
|
|
169
|
+
const queryParameters = {};
|
|
170
|
+
const headerParameters = {};
|
|
171
|
+
if (requestParameters['authorization'] != null) {
|
|
172
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
173
|
+
}
|
|
174
|
+
let urlPath = `/v1/workflow-runs/{run_id}/retry`;
|
|
175
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
176
|
+
return {
|
|
177
|
+
path: urlPath,
|
|
178
|
+
method: 'POST',
|
|
179
|
+
headers: headerParameters,
|
|
180
|
+
query: queryParameters,
|
|
181
|
+
};
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
186
|
+
* Retry Workflow Run Handler
|
|
187
|
+
*/
|
|
188
|
+
retryWorkflowRunRaw(requestParameters, initOverrides) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
const requestOptions = yield this.retryWorkflowRunRequestOpts(requestParameters);
|
|
191
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
192
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowRunResponseFromJSON(jsonValue));
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
197
|
+
* Retry Workflow Run Handler
|
|
198
|
+
*/
|
|
199
|
+
retryWorkflowRun(requestParameters, initOverrides) {
|
|
200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
const response = yield this.retryWorkflowRunRaw(requestParameters, initOverrides);
|
|
202
|
+
return yield response.value();
|
|
203
|
+
});
|
|
204
|
+
}
|
|
161
205
|
/**
|
|
162
206
|
* Creates request options for setWorkflowRunApproval without sending the request
|
|
163
207
|
*/
|
package/docs/WorkflowRunsApi.md
CHANGED
|
@@ -7,6 +7,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
7
7
|
| [**cloneWorkflowRun**](WorkflowRunsApi.md#cloneworkflowrunoperation) | **POST** /v1/workflow-runs/{run_id}/clone | Clone Workflow Run Handler |
|
|
8
8
|
| [**deleteWorkflowRun**](WorkflowRunsApi.md#deleteworkflowrun) | **DELETE** /v1/workflow-runs/{run_id} | Delete Workflow Run Handler |
|
|
9
9
|
| [**getWorkflowRun**](WorkflowRunsApi.md#getworkflowrun) | **GET** /v1/workflow-runs/{run_id} | Get Workflow Run Handler |
|
|
10
|
+
| [**retryWorkflowRun**](WorkflowRunsApi.md#retryworkflowrun) | **POST** /v1/workflow-runs/{run_id}/retry | Retry Workflow Run Handler |
|
|
10
11
|
| [**setWorkflowRunApproval**](WorkflowRunsApi.md#setworkflowrunapprovaloperation) | **POST** /v1/workflow-runs/{run_id}/approval | Set Workflow Run Approval Handler |
|
|
11
12
|
| [**startWorkflowRun**](WorkflowRunsApi.md#startworkflowrun) | **POST** /v1/workflow-runs/{run_id}/start | Start Workflow Run Handler |
|
|
12
13
|
| [**stopWorkflowRun**](WorkflowRunsApi.md#stopworkflowrun) | **POST** /v1/workflow-runs/{run_id}/stop | Stop Workflow Run Handler |
|
|
@@ -236,6 +237,80 @@ No authorization required
|
|
|
236
237
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
237
238
|
|
|
238
239
|
|
|
240
|
+
## retryWorkflowRun
|
|
241
|
+
|
|
242
|
+
> WorkflowRunResponse retryWorkflowRun(runId, authorization, ksUat)
|
|
243
|
+
|
|
244
|
+
Retry Workflow Run Handler
|
|
245
|
+
|
|
246
|
+
Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
247
|
+
|
|
248
|
+
### Example
|
|
249
|
+
|
|
250
|
+
```ts
|
|
251
|
+
import {
|
|
252
|
+
Configuration,
|
|
253
|
+
WorkflowRunsApi,
|
|
254
|
+
} from '@knowledge-stack/ksapi';
|
|
255
|
+
import type { RetryWorkflowRunRequest } from '@knowledge-stack/ksapi';
|
|
256
|
+
|
|
257
|
+
async function example() {
|
|
258
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
259
|
+
const api = new WorkflowRunsApi();
|
|
260
|
+
|
|
261
|
+
const body = {
|
|
262
|
+
// string
|
|
263
|
+
runId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
264
|
+
// string (optional)
|
|
265
|
+
authorization: authorization_example,
|
|
266
|
+
// string (optional)
|
|
267
|
+
ksUat: ksUat_example,
|
|
268
|
+
} satisfies RetryWorkflowRunRequest;
|
|
269
|
+
|
|
270
|
+
try {
|
|
271
|
+
const data = await api.retryWorkflowRun(body);
|
|
272
|
+
console.log(data);
|
|
273
|
+
} catch (error) {
|
|
274
|
+
console.error(error);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
// Run the test
|
|
279
|
+
example().catch(console.error);
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### Parameters
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
| Name | Type | Description | Notes |
|
|
286
|
+
|------------- | ------------- | ------------- | -------------|
|
|
287
|
+
| **runId** | `string` | | [Defaults to `undefined`] |
|
|
288
|
+
| **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
289
|
+
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
290
|
+
|
|
291
|
+
### Return type
|
|
292
|
+
|
|
293
|
+
[**WorkflowRunResponse**](WorkflowRunResponse.md)
|
|
294
|
+
|
|
295
|
+
### Authorization
|
|
296
|
+
|
|
297
|
+
No authorization required
|
|
298
|
+
|
|
299
|
+
### HTTP request headers
|
|
300
|
+
|
|
301
|
+
- **Content-Type**: Not defined
|
|
302
|
+
- **Accept**: `application/json`
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
### HTTP response details
|
|
306
|
+
| Status code | Description | Response headers |
|
|
307
|
+
|-------------|-------------|------------------|
|
|
308
|
+
| **202** | Successful Response | - |
|
|
309
|
+
| **422** | Validation Error | - |
|
|
310
|
+
|
|
311
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
312
|
+
|
|
313
|
+
|
|
239
314
|
## setWorkflowRunApproval
|
|
240
315
|
|
|
241
316
|
> WorkflowRunResponse setWorkflowRunApproval(runId, setWorkflowRunApprovalRequest, authorization, ksUat)
|
package/package.json
CHANGED
|
@@ -59,6 +59,12 @@ export interface GetWorkflowRunRequest {
|
|
|
59
59
|
ksUat?: string | null;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
export interface RetryWorkflowRunRequest {
|
|
63
|
+
runId: string;
|
|
64
|
+
authorization?: string | null;
|
|
65
|
+
ksUat?: string | null;
|
|
66
|
+
}
|
|
67
|
+
|
|
62
68
|
export interface SetWorkflowRunApprovalOperationRequest {
|
|
63
69
|
runId: string;
|
|
64
70
|
setWorkflowRunApprovalRequest: SetWorkflowRunApprovalRequest;
|
|
@@ -183,6 +189,34 @@ export interface WorkflowRunsApiInterface {
|
|
|
183
189
|
*/
|
|
184
190
|
getWorkflowRun(requestParameters: GetWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
185
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Creates request options for retryWorkflowRun without sending the request
|
|
194
|
+
* @param {string} runId
|
|
195
|
+
* @param {string} [authorization]
|
|
196
|
+
* @param {string} [ksUat]
|
|
197
|
+
* @throws {RequiredError}
|
|
198
|
+
* @memberof WorkflowRunsApiInterface
|
|
199
|
+
*/
|
|
200
|
+
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
204
|
+
* @summary Retry Workflow Run Handler
|
|
205
|
+
* @param {string} runId
|
|
206
|
+
* @param {string} [authorization]
|
|
207
|
+
* @param {string} [ksUat]
|
|
208
|
+
* @param {*} [options] Override http request option.
|
|
209
|
+
* @throws {RequiredError}
|
|
210
|
+
* @memberof WorkflowRunsApiInterface
|
|
211
|
+
*/
|
|
212
|
+
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
216
|
+
* Retry Workflow Run Handler
|
|
217
|
+
*/
|
|
218
|
+
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
219
|
+
|
|
186
220
|
/**
|
|
187
221
|
* Creates request options for setWorkflowRunApproval without sending the request
|
|
188
222
|
* @param {string} runId
|
|
@@ -494,6 +528,57 @@ export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiI
|
|
|
494
528
|
return await response.value();
|
|
495
529
|
}
|
|
496
530
|
|
|
531
|
+
/**
|
|
532
|
+
* Creates request options for retryWorkflowRun without sending the request
|
|
533
|
+
*/
|
|
534
|
+
async retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts> {
|
|
535
|
+
if (requestParameters['runId'] == null) {
|
|
536
|
+
throw new runtime.RequiredError(
|
|
537
|
+
'runId',
|
|
538
|
+
'Required parameter "runId" was null or undefined when calling retryWorkflowRun().'
|
|
539
|
+
);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
const queryParameters: any = {};
|
|
543
|
+
|
|
544
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
545
|
+
|
|
546
|
+
if (requestParameters['authorization'] != null) {
|
|
547
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
let urlPath = `/v1/workflow-runs/{run_id}/retry`;
|
|
552
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
553
|
+
|
|
554
|
+
return {
|
|
555
|
+
path: urlPath,
|
|
556
|
+
method: 'POST',
|
|
557
|
+
headers: headerParameters,
|
|
558
|
+
query: queryParameters,
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
564
|
+
* Retry Workflow Run Handler
|
|
565
|
+
*/
|
|
566
|
+
async retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>> {
|
|
567
|
+
const requestOptions = await this.retryWorkflowRunRequestOpts(requestParameters);
|
|
568
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
569
|
+
|
|
570
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowRunResponseFromJSON(jsonValue));
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Re-run a FAILED run (including a user-stopped one) in place. Flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches the agent. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only.
|
|
575
|
+
* Retry Workflow Run Handler
|
|
576
|
+
*/
|
|
577
|
+
async retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse> {
|
|
578
|
+
const response = await this.retryWorkflowRunRaw(requestParameters, initOverrides);
|
|
579
|
+
return await response.value();
|
|
580
|
+
}
|
|
581
|
+
|
|
497
582
|
/**
|
|
498
583
|
* Creates request options for setWorkflowRunApproval without sending the request
|
|
499
584
|
*/
|