@knowledge-stack/ksapi 1.141.0 → 1.142.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/README.md +3 -2
- package/dist/apis/WorkflowRunsApi.d.ts +42 -4
- package/dist/apis/WorkflowRunsApi.js +50 -2
- package/dist/esm/apis/WorkflowRunsApi.d.ts +42 -4
- package/dist/esm/apis/WorkflowRunsApi.js +50 -2
- package/docs/WorkflowRunsApi.md +77 -1
- package/package.json +1 -1
- package/src/apis/WorkflowRunsApi.ts +87 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @knowledge-stack/ksapi@1.
|
|
1
|
+
# @knowledge-stack/ksapi@1.142.1
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the localhost API.
|
|
4
4
|
|
|
@@ -276,6 +276,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
276
276
|
*WorkflowRunsApi* | [**getWorkflowRun**](docs/WorkflowRunsApi.md#getworkflowrun) | **GET** /v1/workflow-runs/{run_id} | Get Workflow Run Handler
|
|
277
277
|
*WorkflowRunsApi* | [**getWorkflowRunsSummary**](docs/WorkflowRunsApi.md#getworkflowrunssummary) | **GET** /v1/workflow-runs/summary | Get Workflow Runs Summary Handler
|
|
278
278
|
*WorkflowRunsApi* | [**listWorkflowRunsForTenant**](docs/WorkflowRunsApi.md#listworkflowrunsfortenant) | **GET** /v1/workflow-runs | List Workflow Runs For Tenant Handler
|
|
279
|
+
*WorkflowRunsApi* | [**resumeWorkflowRun**](docs/WorkflowRunsApi.md#resumeworkflowrun) | **POST** /v1/workflow-runs/{run_id}/resume | Resume Workflow Run Handler
|
|
279
280
|
*WorkflowRunsApi* | [**retryWorkflowRun**](docs/WorkflowRunsApi.md#retryworkflowrun) | **POST** /v1/workflow-runs/{run_id}/retry | Retry Workflow Run Handler
|
|
280
281
|
*WorkflowRunsApi* | [**setWorkflowRunApproval**](docs/WorkflowRunsApi.md#setworkflowrunapprovaloperation) | **POST** /v1/workflow-runs/{run_id}/approval | Set Workflow Run Approval Handler
|
|
281
282
|
*WorkflowRunsApi* | [**startWorkflowRun**](docs/WorkflowRunsApi.md#startworkflowrunoperation) | **POST** /v1/workflow-runs/{run_id}/start | Start Workflow Run Handler
|
|
@@ -668,7 +669,7 @@ and is automatically generated by the
|
|
|
668
669
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
669
670
|
|
|
670
671
|
- API version: `0.1.0`
|
|
671
|
-
- Package version: `1.
|
|
672
|
+
- Package version: `1.142.1`
|
|
672
673
|
- Generator version: `7.21.0`
|
|
673
674
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
674
675
|
|
|
@@ -44,6 +44,9 @@ export interface ListWorkflowRunsForTenantRequest {
|
|
|
44
44
|
includeTagIds?: Array<string> | null;
|
|
45
45
|
excludeTagIds?: Array<string> | null;
|
|
46
46
|
}
|
|
47
|
+
export interface ResumeWorkflowRunRequest {
|
|
48
|
+
runId: string;
|
|
49
|
+
}
|
|
47
50
|
export interface RetryWorkflowRunRequest {
|
|
48
51
|
runId: string;
|
|
49
52
|
}
|
|
@@ -212,6 +215,27 @@ export interface WorkflowRunsApiInterface {
|
|
|
212
215
|
* List Workflow Runs For Tenant Handler
|
|
213
216
|
*/
|
|
214
217
|
listWorkflowRunsForTenant(requestParameters: ListWorkflowRunsForTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseWorkflowRunResponse>;
|
|
218
|
+
/**
|
|
219
|
+
* Creates request options for resumeWorkflowRun without sending the request
|
|
220
|
+
* @param {string} runId
|
|
221
|
+
* @throws {RequiredError}
|
|
222
|
+
* @memberof WorkflowRunsApiInterface
|
|
223
|
+
*/
|
|
224
|
+
resumeWorkflowRunRequestOpts(requestParameters: ResumeWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
225
|
+
/**
|
|
226
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
227
|
+
* @summary Resume Workflow Run Handler
|
|
228
|
+
* @param {string} runId
|
|
229
|
+
* @param {*} [options] Override http request option.
|
|
230
|
+
* @throws {RequiredError}
|
|
231
|
+
* @memberof WorkflowRunsApiInterface
|
|
232
|
+
*/
|
|
233
|
+
resumeWorkflowRunRaw(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
234
|
+
/**
|
|
235
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
236
|
+
* Resume Workflow Run Handler
|
|
237
|
+
*/
|
|
238
|
+
resumeWorkflowRun(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
215
239
|
/**
|
|
216
240
|
* Creates request options for retryWorkflowRun without sending the request
|
|
217
241
|
* @param {string} runId
|
|
@@ -220,7 +244,7 @@ export interface WorkflowRunsApiInterface {
|
|
|
220
244
|
*/
|
|
221
245
|
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
222
246
|
/**
|
|
223
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
247
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
224
248
|
* @summary Retry Workflow Run Handler
|
|
225
249
|
* @param {string} runId
|
|
226
250
|
* @param {*} [options] Override http request option.
|
|
@@ -229,7 +253,7 @@ export interface WorkflowRunsApiInterface {
|
|
|
229
253
|
*/
|
|
230
254
|
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
231
255
|
/**
|
|
232
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
256
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
233
257
|
* Retry Workflow Run Handler
|
|
234
258
|
*/
|
|
235
259
|
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
@@ -417,17 +441,31 @@ export declare class WorkflowRunsApi extends runtime.BaseAPI implements Workflow
|
|
|
417
441
|
* List Workflow Runs For Tenant Handler
|
|
418
442
|
*/
|
|
419
443
|
listWorkflowRunsForTenant(requestParameters?: ListWorkflowRunsForTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseWorkflowRunResponse>;
|
|
444
|
+
/**
|
|
445
|
+
* Creates request options for resumeWorkflowRun without sending the request
|
|
446
|
+
*/
|
|
447
|
+
resumeWorkflowRunRequestOpts(requestParameters: ResumeWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
448
|
+
/**
|
|
449
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
450
|
+
* Resume Workflow Run Handler
|
|
451
|
+
*/
|
|
452
|
+
resumeWorkflowRunRaw(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
453
|
+
/**
|
|
454
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
455
|
+
* Resume Workflow Run Handler
|
|
456
|
+
*/
|
|
457
|
+
resumeWorkflowRun(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
420
458
|
/**
|
|
421
459
|
* Creates request options for retryWorkflowRun without sending the request
|
|
422
460
|
*/
|
|
423
461
|
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
424
462
|
/**
|
|
425
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
463
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
426
464
|
* Retry Workflow Run Handler
|
|
427
465
|
*/
|
|
428
466
|
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
429
467
|
/**
|
|
430
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
468
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
431
469
|
* Retry Workflow Run Handler
|
|
432
470
|
*/
|
|
433
471
|
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
@@ -351,6 +351,54 @@ class WorkflowRunsApi extends runtime.BaseAPI {
|
|
|
351
351
|
return yield response.value();
|
|
352
352
|
});
|
|
353
353
|
}
|
|
354
|
+
/**
|
|
355
|
+
* Creates request options for resumeWorkflowRun without sending the request
|
|
356
|
+
*/
|
|
357
|
+
resumeWorkflowRunRequestOpts(requestParameters) {
|
|
358
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
359
|
+
if (requestParameters['runId'] == null) {
|
|
360
|
+
throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling resumeWorkflowRun().');
|
|
361
|
+
}
|
|
362
|
+
const queryParameters = {};
|
|
363
|
+
const headerParameters = {};
|
|
364
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
365
|
+
const token = this.configuration.accessToken;
|
|
366
|
+
const tokenString = yield token("bearerAuth", []);
|
|
367
|
+
if (tokenString) {
|
|
368
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
let urlPath = `/v1/workflow-runs/{run_id}/resume`;
|
|
372
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
373
|
+
return {
|
|
374
|
+
path: urlPath,
|
|
375
|
+
method: 'POST',
|
|
376
|
+
headers: headerParameters,
|
|
377
|
+
query: queryParameters,
|
|
378
|
+
};
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
383
|
+
* Resume Workflow Run Handler
|
|
384
|
+
*/
|
|
385
|
+
resumeWorkflowRunRaw(requestParameters, initOverrides) {
|
|
386
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
387
|
+
const requestOptions = yield this.resumeWorkflowRunRequestOpts(requestParameters);
|
|
388
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
389
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.WorkflowRunResponseFromJSON)(jsonValue));
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
394
|
+
* Resume Workflow Run Handler
|
|
395
|
+
*/
|
|
396
|
+
resumeWorkflowRun(requestParameters, initOverrides) {
|
|
397
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
398
|
+
const response = yield this.resumeWorkflowRunRaw(requestParameters, initOverrides);
|
|
399
|
+
return yield response.value();
|
|
400
|
+
});
|
|
401
|
+
}
|
|
354
402
|
/**
|
|
355
403
|
* Creates request options for retryWorkflowRun without sending the request
|
|
356
404
|
*/
|
|
@@ -379,7 +427,7 @@ class WorkflowRunsApi extends runtime.BaseAPI {
|
|
|
379
427
|
});
|
|
380
428
|
}
|
|
381
429
|
/**
|
|
382
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
430
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
383
431
|
* Retry Workflow Run Handler
|
|
384
432
|
*/
|
|
385
433
|
retryWorkflowRunRaw(requestParameters, initOverrides) {
|
|
@@ -390,7 +438,7 @@ class WorkflowRunsApi extends runtime.BaseAPI {
|
|
|
390
438
|
});
|
|
391
439
|
}
|
|
392
440
|
/**
|
|
393
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
441
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
394
442
|
* Retry Workflow Run Handler
|
|
395
443
|
*/
|
|
396
444
|
retryWorkflowRun(requestParameters, initOverrides) {
|
|
@@ -44,6 +44,9 @@ export interface ListWorkflowRunsForTenantRequest {
|
|
|
44
44
|
includeTagIds?: Array<string> | null;
|
|
45
45
|
excludeTagIds?: Array<string> | null;
|
|
46
46
|
}
|
|
47
|
+
export interface ResumeWorkflowRunRequest {
|
|
48
|
+
runId: string;
|
|
49
|
+
}
|
|
47
50
|
export interface RetryWorkflowRunRequest {
|
|
48
51
|
runId: string;
|
|
49
52
|
}
|
|
@@ -212,6 +215,27 @@ export interface WorkflowRunsApiInterface {
|
|
|
212
215
|
* List Workflow Runs For Tenant Handler
|
|
213
216
|
*/
|
|
214
217
|
listWorkflowRunsForTenant(requestParameters: ListWorkflowRunsForTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseWorkflowRunResponse>;
|
|
218
|
+
/**
|
|
219
|
+
* Creates request options for resumeWorkflowRun without sending the request
|
|
220
|
+
* @param {string} runId
|
|
221
|
+
* @throws {RequiredError}
|
|
222
|
+
* @memberof WorkflowRunsApiInterface
|
|
223
|
+
*/
|
|
224
|
+
resumeWorkflowRunRequestOpts(requestParameters: ResumeWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
225
|
+
/**
|
|
226
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
227
|
+
* @summary Resume Workflow Run Handler
|
|
228
|
+
* @param {string} runId
|
|
229
|
+
* @param {*} [options] Override http request option.
|
|
230
|
+
* @throws {RequiredError}
|
|
231
|
+
* @memberof WorkflowRunsApiInterface
|
|
232
|
+
*/
|
|
233
|
+
resumeWorkflowRunRaw(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
234
|
+
/**
|
|
235
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
236
|
+
* Resume Workflow Run Handler
|
|
237
|
+
*/
|
|
238
|
+
resumeWorkflowRun(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
215
239
|
/**
|
|
216
240
|
* Creates request options for retryWorkflowRun without sending the request
|
|
217
241
|
* @param {string} runId
|
|
@@ -220,7 +244,7 @@ export interface WorkflowRunsApiInterface {
|
|
|
220
244
|
*/
|
|
221
245
|
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
222
246
|
/**
|
|
223
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
247
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
224
248
|
* @summary Retry Workflow Run Handler
|
|
225
249
|
* @param {string} runId
|
|
226
250
|
* @param {*} [options] Override http request option.
|
|
@@ -229,7 +253,7 @@ export interface WorkflowRunsApiInterface {
|
|
|
229
253
|
*/
|
|
230
254
|
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
231
255
|
/**
|
|
232
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
256
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
233
257
|
* Retry Workflow Run Handler
|
|
234
258
|
*/
|
|
235
259
|
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
@@ -417,17 +441,31 @@ export declare class WorkflowRunsApi extends runtime.BaseAPI implements Workflow
|
|
|
417
441
|
* List Workflow Runs For Tenant Handler
|
|
418
442
|
*/
|
|
419
443
|
listWorkflowRunsForTenant(requestParameters?: ListWorkflowRunsForTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseWorkflowRunResponse>;
|
|
444
|
+
/**
|
|
445
|
+
* Creates request options for resumeWorkflowRun without sending the request
|
|
446
|
+
*/
|
|
447
|
+
resumeWorkflowRunRequestOpts(requestParameters: ResumeWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
448
|
+
/**
|
|
449
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
450
|
+
* Resume Workflow Run Handler
|
|
451
|
+
*/
|
|
452
|
+
resumeWorkflowRunRaw(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
453
|
+
/**
|
|
454
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
455
|
+
* Resume Workflow Run Handler
|
|
456
|
+
*/
|
|
457
|
+
resumeWorkflowRun(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
420
458
|
/**
|
|
421
459
|
* Creates request options for retryWorkflowRun without sending the request
|
|
422
460
|
*/
|
|
423
461
|
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
424
462
|
/**
|
|
425
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
463
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
426
464
|
* Retry Workflow Run Handler
|
|
427
465
|
*/
|
|
428
466
|
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
429
467
|
/**
|
|
430
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
468
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
431
469
|
* Retry Workflow Run Handler
|
|
432
470
|
*/
|
|
433
471
|
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
@@ -315,6 +315,54 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
|
|
|
315
315
|
return yield response.value();
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Creates request options for resumeWorkflowRun without sending the request
|
|
320
|
+
*/
|
|
321
|
+
resumeWorkflowRunRequestOpts(requestParameters) {
|
|
322
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
+
if (requestParameters['runId'] == null) {
|
|
324
|
+
throw new runtime.RequiredError('runId', 'Required parameter "runId" was null or undefined when calling resumeWorkflowRun().');
|
|
325
|
+
}
|
|
326
|
+
const queryParameters = {};
|
|
327
|
+
const headerParameters = {};
|
|
328
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
329
|
+
const token = this.configuration.accessToken;
|
|
330
|
+
const tokenString = yield token("bearerAuth", []);
|
|
331
|
+
if (tokenString) {
|
|
332
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
let urlPath = `/v1/workflow-runs/{run_id}/resume`;
|
|
336
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
337
|
+
return {
|
|
338
|
+
path: urlPath,
|
|
339
|
+
method: 'POST',
|
|
340
|
+
headers: headerParameters,
|
|
341
|
+
query: queryParameters,
|
|
342
|
+
};
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
347
|
+
* Resume Workflow Run Handler
|
|
348
|
+
*/
|
|
349
|
+
resumeWorkflowRunRaw(requestParameters, initOverrides) {
|
|
350
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
351
|
+
const requestOptions = yield this.resumeWorkflowRunRequestOpts(requestParameters);
|
|
352
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
353
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowRunResponseFromJSON(jsonValue));
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
358
|
+
* Resume Workflow Run Handler
|
|
359
|
+
*/
|
|
360
|
+
resumeWorkflowRun(requestParameters, initOverrides) {
|
|
361
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
362
|
+
const response = yield this.resumeWorkflowRunRaw(requestParameters, initOverrides);
|
|
363
|
+
return yield response.value();
|
|
364
|
+
});
|
|
365
|
+
}
|
|
318
366
|
/**
|
|
319
367
|
* Creates request options for retryWorkflowRun without sending the request
|
|
320
368
|
*/
|
|
@@ -343,7 +391,7 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
|
|
|
343
391
|
});
|
|
344
392
|
}
|
|
345
393
|
/**
|
|
346
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
394
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
347
395
|
* Retry Workflow Run Handler
|
|
348
396
|
*/
|
|
349
397
|
retryWorkflowRunRaw(requestParameters, initOverrides) {
|
|
@@ -354,7 +402,7 @@ export class WorkflowRunsApi extends runtime.BaseAPI {
|
|
|
354
402
|
});
|
|
355
403
|
}
|
|
356
404
|
/**
|
|
357
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
405
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
358
406
|
* Retry Workflow Run Handler
|
|
359
407
|
*/
|
|
360
408
|
retryWorkflowRun(requestParameters, initOverrides) {
|
package/docs/WorkflowRunsApi.md
CHANGED
|
@@ -9,6 +9,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
9
9
|
| [**getWorkflowRun**](WorkflowRunsApi.md#getworkflowrun) | **GET** /v1/workflow-runs/{run_id} | Get Workflow Run Handler |
|
|
10
10
|
| [**getWorkflowRunsSummary**](WorkflowRunsApi.md#getworkflowrunssummary) | **GET** /v1/workflow-runs/summary | Get Workflow Runs Summary Handler |
|
|
11
11
|
| [**listWorkflowRunsForTenant**](WorkflowRunsApi.md#listworkflowrunsfortenant) | **GET** /v1/workflow-runs | List Workflow Runs For Tenant Handler |
|
|
12
|
+
| [**resumeWorkflowRun**](WorkflowRunsApi.md#resumeworkflowrun) | **POST** /v1/workflow-runs/{run_id}/resume | Resume Workflow Run Handler |
|
|
12
13
|
| [**retryWorkflowRun**](WorkflowRunsApi.md#retryworkflowrun) | **POST** /v1/workflow-runs/{run_id}/retry | Retry Workflow Run Handler |
|
|
13
14
|
| [**setWorkflowRunApproval**](WorkflowRunsApi.md#setworkflowrunapprovaloperation) | **POST** /v1/workflow-runs/{run_id}/approval | Set Workflow Run Approval Handler |
|
|
14
15
|
| [**startWorkflowRun**](WorkflowRunsApi.md#startworkflowrunoperation) | **POST** /v1/workflow-runs/{run_id}/start | Start Workflow Run Handler |
|
|
@@ -443,13 +444,88 @@ example().catch(console.error);
|
|
|
443
444
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
444
445
|
|
|
445
446
|
|
|
447
|
+
## resumeWorkflowRun
|
|
448
|
+
|
|
449
|
+
> WorkflowRunResponse resumeWorkflowRun(runId)
|
|
450
|
+
|
|
451
|
+
Resume Workflow Run Handler
|
|
452
|
+
|
|
453
|
+
Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
454
|
+
|
|
455
|
+
### Example
|
|
456
|
+
|
|
457
|
+
```ts
|
|
458
|
+
import {
|
|
459
|
+
Configuration,
|
|
460
|
+
WorkflowRunsApi,
|
|
461
|
+
} from '@knowledge-stack/ksapi';
|
|
462
|
+
import type { ResumeWorkflowRunRequest } from '@knowledge-stack/ksapi';
|
|
463
|
+
|
|
464
|
+
async function example() {
|
|
465
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
466
|
+
const config = new Configuration({
|
|
467
|
+
// To configure API key authorization: cookieAuth
|
|
468
|
+
apiKey: "YOUR API KEY",
|
|
469
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
470
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
471
|
+
});
|
|
472
|
+
const api = new WorkflowRunsApi(config);
|
|
473
|
+
|
|
474
|
+
const body = {
|
|
475
|
+
// string
|
|
476
|
+
runId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
477
|
+
} satisfies ResumeWorkflowRunRequest;
|
|
478
|
+
|
|
479
|
+
try {
|
|
480
|
+
const data = await api.resumeWorkflowRun(body);
|
|
481
|
+
console.log(data);
|
|
482
|
+
} catch (error) {
|
|
483
|
+
console.error(error);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// Run the test
|
|
488
|
+
example().catch(console.error);
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### Parameters
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
| Name | Type | Description | Notes |
|
|
495
|
+
|------------- | ------------- | ------------- | -------------|
|
|
496
|
+
| **runId** | `string` | | [Defaults to `undefined`] |
|
|
497
|
+
|
|
498
|
+
### Return type
|
|
499
|
+
|
|
500
|
+
[**WorkflowRunResponse**](WorkflowRunResponse.md)
|
|
501
|
+
|
|
502
|
+
### Authorization
|
|
503
|
+
|
|
504
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
505
|
+
|
|
506
|
+
### HTTP request headers
|
|
507
|
+
|
|
508
|
+
- **Content-Type**: Not defined
|
|
509
|
+
- **Accept**: `application/json`
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
### HTTP response details
|
|
513
|
+
| Status code | Description | Response headers |
|
|
514
|
+
|-------------|-------------|------------------|
|
|
515
|
+
| **202** | Successful Response | * Location - Poll this run resource until ``execution_state`` is COMPLETED or FAILED. <br> |
|
|
516
|
+
| **422** | Validation Error | - |
|
|
517
|
+
| **0** | Error response. | - |
|
|
518
|
+
|
|
519
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
520
|
+
|
|
521
|
+
|
|
446
522
|
## retryWorkflowRun
|
|
447
523
|
|
|
448
524
|
> WorkflowRunResponse retryWorkflowRun(runId)
|
|
449
525
|
|
|
450
526
|
Retry Workflow Run Handler
|
|
451
527
|
|
|
452
|
-
Re-run a FAILED run (including a user-stopped one)
|
|
528
|
+
Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
453
529
|
|
|
454
530
|
### Example
|
|
455
531
|
|
package/package.json
CHANGED
|
@@ -102,6 +102,10 @@ export interface ListWorkflowRunsForTenantRequest {
|
|
|
102
102
|
excludeTagIds?: Array<string> | null;
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
export interface ResumeWorkflowRunRequest {
|
|
106
|
+
runId: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
105
109
|
export interface RetryWorkflowRunRequest {
|
|
106
110
|
runId: string;
|
|
107
111
|
}
|
|
@@ -291,6 +295,30 @@ export interface WorkflowRunsApiInterface {
|
|
|
291
295
|
*/
|
|
292
296
|
listWorkflowRunsForTenant(requestParameters: ListWorkflowRunsForTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseWorkflowRunResponse>;
|
|
293
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Creates request options for resumeWorkflowRun without sending the request
|
|
300
|
+
* @param {string} runId
|
|
301
|
+
* @throws {RequiredError}
|
|
302
|
+
* @memberof WorkflowRunsApiInterface
|
|
303
|
+
*/
|
|
304
|
+
resumeWorkflowRunRequestOpts(requestParameters: ResumeWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
308
|
+
* @summary Resume Workflow Run Handler
|
|
309
|
+
* @param {string} runId
|
|
310
|
+
* @param {*} [options] Override http request option.
|
|
311
|
+
* @throws {RequiredError}
|
|
312
|
+
* @memberof WorkflowRunsApiInterface
|
|
313
|
+
*/
|
|
314
|
+
resumeWorkflowRunRaw(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
318
|
+
* Resume Workflow Run Handler
|
|
319
|
+
*/
|
|
320
|
+
resumeWorkflowRun(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
321
|
+
|
|
294
322
|
/**
|
|
295
323
|
* Creates request options for retryWorkflowRun without sending the request
|
|
296
324
|
* @param {string} runId
|
|
@@ -300,7 +328,7 @@ export interface WorkflowRunsApiInterface {
|
|
|
300
328
|
retryWorkflowRunRequestOpts(requestParameters: RetryWorkflowRunRequest): Promise<runtime.RequestOpts>;
|
|
301
329
|
|
|
302
330
|
/**
|
|
303
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
331
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
304
332
|
* @summary Retry Workflow Run Handler
|
|
305
333
|
* @param {string} runId
|
|
306
334
|
* @param {*} [options] Override http request option.
|
|
@@ -310,7 +338,7 @@ export interface WorkflowRunsApiInterface {
|
|
|
310
338
|
retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>>;
|
|
311
339
|
|
|
312
340
|
/**
|
|
313
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
341
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
314
342
|
* Retry Workflow Run Handler
|
|
315
343
|
*/
|
|
316
344
|
retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
@@ -790,6 +818,61 @@ export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiI
|
|
|
790
818
|
return await response.value();
|
|
791
819
|
}
|
|
792
820
|
|
|
821
|
+
/**
|
|
822
|
+
* Creates request options for resumeWorkflowRun without sending the request
|
|
823
|
+
*/
|
|
824
|
+
async resumeWorkflowRunRequestOpts(requestParameters: ResumeWorkflowRunRequest): Promise<runtime.RequestOpts> {
|
|
825
|
+
if (requestParameters['runId'] == null) {
|
|
826
|
+
throw new runtime.RequiredError(
|
|
827
|
+
'runId',
|
|
828
|
+
'Required parameter "runId" was null or undefined when calling resumeWorkflowRun().'
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
const queryParameters: any = {};
|
|
833
|
+
|
|
834
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
835
|
+
|
|
836
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
837
|
+
const token = this.configuration.accessToken;
|
|
838
|
+
const tokenString = await token("bearerAuth", []);
|
|
839
|
+
|
|
840
|
+
if (tokenString) {
|
|
841
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
let urlPath = `/v1/workflow-runs/{run_id}/resume`;
|
|
846
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
847
|
+
|
|
848
|
+
return {
|
|
849
|
+
path: urlPath,
|
|
850
|
+
method: 'POST',
|
|
851
|
+
headers: headerParameters,
|
|
852
|
+
query: queryParameters,
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
858
|
+
* Resume Workflow Run Handler
|
|
859
|
+
*/
|
|
860
|
+
async resumeWorkflowRunRaw(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>> {
|
|
861
|
+
const requestOptions = await this.resumeWorkflowRunRequestOpts(requestParameters);
|
|
862
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
863
|
+
|
|
864
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowRunResponseFromJSON(jsonValue));
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Continue a FAILED run in place instead of restarting it. Unlike ``retry`` (which restarts the agent cold), ``resume`` loads the run\'s surviving thread history — the checkpoint summary and any persisted partial reply — and re-hydrates ``/work/``, so a run that timed out or was stopped near the end finishes from where it left off rather than redoing the work. Same guards as retry: 409 if the run is not FAILED or was never started; triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
869
|
+
* Resume Workflow Run Handler
|
|
870
|
+
*/
|
|
871
|
+
async resumeWorkflowRun(requestParameters: ResumeWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse> {
|
|
872
|
+
const response = await this.resumeWorkflowRunRaw(requestParameters, initOverrides);
|
|
873
|
+
return await response.value();
|
|
874
|
+
}
|
|
875
|
+
|
|
793
876
|
/**
|
|
794
877
|
* Creates request options for retryWorkflowRun without sending the request
|
|
795
878
|
*/
|
|
@@ -826,7 +909,7 @@ export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiI
|
|
|
826
909
|
}
|
|
827
910
|
|
|
828
911
|
/**
|
|
829
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
912
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
830
913
|
* Retry Workflow Run Handler
|
|
831
914
|
*/
|
|
832
915
|
async retryWorkflowRunRaw(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowRunResponse>> {
|
|
@@ -837,7 +920,7 @@ export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiI
|
|
|
837
920
|
}
|
|
838
921
|
|
|
839
922
|
/**
|
|
840
|
-
* Re-run a FAILED run (including a user-stopped one)
|
|
923
|
+
* Re-run a FAILED run (including a user-stopped one) from scratch. Restarts the agent cold: flips ``FAILED -> IN_PROGRESS`` against the run\'s existing snapshot and re-dispatches with empty history. Use ``resume`` to continue from surviving history instead. 409 if the run is not FAILED (NOT_STARTED/PENDING use Start; COMPLETED is cloned) or was never started. Triggerer or OWNER/ADMIN only. Runs in the background — poll ``GET /v1/workflow-runs/{run_id}`` (also given in the ``Location`` header) until ``execution_state`` is COMPLETED or FAILED.
|
|
841
924
|
* Retry Workflow Run Handler
|
|
842
925
|
*/
|
|
843
926
|
async retryWorkflowRun(requestParameters: RetryWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse> {
|