@knowledge-stack/ksapi 1.82.0 → 1.83.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/.openapi-generator/FILES +8 -0
- package/README.md +11 -2
- package/dist/apis/WorkflowRunsApi.d.ts +233 -1
- package/dist/apis/WorkflowRunsApi.js +236 -0
- package/dist/esm/apis/WorkflowRunsApi.d.ts +233 -1
- package/dist/esm/apis/WorkflowRunsApi.js +237 -1
- package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +6 -0
- package/dist/esm/models/CreateWorkflowDefinitionRequest.js +2 -0
- package/dist/esm/models/PathPartApprovalDecision.d.ts +30 -0
- package/dist/esm/models/PathPartApprovalDecision.js +48 -0
- package/dist/esm/models/PathPartApprovalResponse.d.ts +111 -0
- package/dist/esm/models/PathPartApprovalResponse.js +85 -0
- package/dist/esm/models/RejectFileRequest.d.ts +47 -0
- package/dist/esm/models/RejectFileRequest.js +49 -0
- package/dist/esm/models/RunLockResponse.d.ts +59 -0
- package/dist/esm/models/RunLockResponse.js +52 -0
- package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +6 -0
- package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +2 -0
- package/dist/esm/models/WorkflowDefinitionResponse.d.ts +6 -0
- package/dist/esm/models/WorkflowDefinitionResponse.js +4 -0
- package/dist/esm/models/WorkflowRunStatus.d.ts +20 -2
- package/dist/esm/models/WorkflowRunStatus.js +20 -2
- package/dist/esm/models/index.d.ts +4 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/models/CreateWorkflowDefinitionRequest.d.ts +6 -0
- package/dist/models/CreateWorkflowDefinitionRequest.js +2 -0
- package/dist/models/PathPartApprovalDecision.d.ts +30 -0
- package/dist/models/PathPartApprovalDecision.js +56 -0
- package/dist/models/PathPartApprovalResponse.d.ts +111 -0
- package/dist/models/PathPartApprovalResponse.js +93 -0
- package/dist/models/RejectFileRequest.d.ts +47 -0
- package/dist/models/RejectFileRequest.js +57 -0
- package/dist/models/RunLockResponse.d.ts +59 -0
- package/dist/models/RunLockResponse.js +60 -0
- package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +6 -0
- package/dist/models/UpdateWorkflowDefinitionRequest.js +2 -0
- package/dist/models/WorkflowDefinitionResponse.d.ts +6 -0
- package/dist/models/WorkflowDefinitionResponse.js +4 -0
- package/dist/models/WorkflowRunStatus.d.ts +20 -2
- package/dist/models/WorkflowRunStatus.js +20 -2
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/docs/CreateWorkflowDefinitionRequest.md +2 -0
- package/docs/PathPartApprovalDecision.md +33 -0
- package/docs/PathPartApprovalResponse.md +55 -0
- package/docs/RejectFileRequest.md +35 -0
- package/docs/RunLockResponse.md +39 -0
- package/docs/UpdateWorkflowDefinitionRequest.md +2 -0
- package/docs/WorkflowDefinitionResponse.md +2 -0
- package/docs/WorkflowRunStatus.md +1 -1
- package/docs/WorkflowRunsApi.md +387 -0
- package/package.json +1 -1
- package/src/apis/WorkflowRunsApi.ts +479 -0
- package/src/models/CreateWorkflowDefinitionRequest.ts +8 -0
- package/src/models/PathPartApprovalDecision.ts +58 -0
- package/src/models/PathPartApprovalResponse.ts +186 -0
- package/src/models/RejectFileRequest.ts +87 -0
- package/src/models/RunLockResponse.ts +101 -0
- package/src/models/UpdateWorkflowDefinitionRequest.ts +8 -0
- package/src/models/WorkflowDefinitionResponse.ts +9 -0
- package/src/models/WorkflowRunStatus.ts +20 -2
- package/src/models/index.ts +4 -0
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
HTTPValidationError,
|
|
19
|
+
PathPartApprovalResponse,
|
|
20
|
+
RejectFileRequest,
|
|
21
|
+
RunLockResponse,
|
|
19
22
|
WorkflowCallbackResponse,
|
|
20
23
|
WorkflowRunCallbackRequest,
|
|
21
24
|
WorkflowRunResponse,
|
|
@@ -23,6 +26,12 @@ import type {
|
|
|
23
26
|
import {
|
|
24
27
|
HTTPValidationErrorFromJSON,
|
|
25
28
|
HTTPValidationErrorToJSON,
|
|
29
|
+
PathPartApprovalResponseFromJSON,
|
|
30
|
+
PathPartApprovalResponseToJSON,
|
|
31
|
+
RejectFileRequestFromJSON,
|
|
32
|
+
RejectFileRequestToJSON,
|
|
33
|
+
RunLockResponseFromJSON,
|
|
34
|
+
RunLockResponseToJSON,
|
|
26
35
|
WorkflowCallbackResponseFromJSON,
|
|
27
36
|
WorkflowCallbackResponseToJSON,
|
|
28
37
|
WorkflowRunCallbackRequestFromJSON,
|
|
@@ -31,6 +40,19 @@ import {
|
|
|
31
40
|
WorkflowRunResponseToJSON,
|
|
32
41
|
} from '../models/index';
|
|
33
42
|
|
|
43
|
+
export interface AcquireWorkflowRunLockRequest {
|
|
44
|
+
runId: string;
|
|
45
|
+
authorization?: string | null;
|
|
46
|
+
ksUat?: string | null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface ApproveWorkflowRunFileRequest {
|
|
50
|
+
runId: string;
|
|
51
|
+
pathPartId: string;
|
|
52
|
+
authorization?: string | null;
|
|
53
|
+
ksUat?: string | null;
|
|
54
|
+
}
|
|
55
|
+
|
|
34
56
|
export interface DeleteWorkflowRunRequest {
|
|
35
57
|
runId: string;
|
|
36
58
|
authorization?: string | null;
|
|
@@ -43,6 +65,27 @@ export interface GetWorkflowRunRequest {
|
|
|
43
65
|
ksUat?: string | null;
|
|
44
66
|
}
|
|
45
67
|
|
|
68
|
+
export interface RejectWorkflowRunFileRequest {
|
|
69
|
+
runId: string;
|
|
70
|
+
pathPartId: string;
|
|
71
|
+
rejectFileRequest: RejectFileRequest;
|
|
72
|
+
authorization?: string | null;
|
|
73
|
+
ksUat?: string | null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface ReleaseWorkflowRunLockRequest {
|
|
77
|
+
runId: string;
|
|
78
|
+
authorization?: string | null;
|
|
79
|
+
ksUat?: string | null;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface UnapproveWorkflowRunFileRequest {
|
|
83
|
+
runId: string;
|
|
84
|
+
pathPartId: string;
|
|
85
|
+
authorization?: string | null;
|
|
86
|
+
ksUat?: string | null;
|
|
87
|
+
}
|
|
88
|
+
|
|
46
89
|
export interface WorkflowRunCallbackOperationRequest {
|
|
47
90
|
runId: string;
|
|
48
91
|
workflowRunCallbackRequest: WorkflowRunCallbackRequest;
|
|
@@ -55,6 +98,64 @@ export interface WorkflowRunCallbackOperationRequest {
|
|
|
55
98
|
* @interface WorkflowRunsApiInterface
|
|
56
99
|
*/
|
|
57
100
|
export interface WorkflowRunsApiInterface {
|
|
101
|
+
/**
|
|
102
|
+
* Creates request options for acquireWorkflowRunLock without sending the request
|
|
103
|
+
* @param {string} runId
|
|
104
|
+
* @param {string} [authorization]
|
|
105
|
+
* @param {string} [ksUat]
|
|
106
|
+
* @throws {RequiredError}
|
|
107
|
+
* @memberof WorkflowRunsApiInterface
|
|
108
|
+
*/
|
|
109
|
+
acquireWorkflowRunLockRequestOpts(requestParameters: AcquireWorkflowRunLockRequest): Promise<runtime.RequestOpts>;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Acquire (or renew) the reviewer lock on ``run_id``. The current holder may re-POST to refresh ``lock_acquired_at``. A different user receives 409 until the lock is released or auto-swept.
|
|
113
|
+
* @summary Acquire Workflow Run Lock Handler
|
|
114
|
+
* @param {string} runId
|
|
115
|
+
* @param {string} [authorization]
|
|
116
|
+
* @param {string} [ksUat]
|
|
117
|
+
* @param {*} [options] Override http request option.
|
|
118
|
+
* @throws {RequiredError}
|
|
119
|
+
* @memberof WorkflowRunsApiInterface
|
|
120
|
+
*/
|
|
121
|
+
acquireWorkflowRunLockRaw(requestParameters: AcquireWorkflowRunLockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RunLockResponse>>;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Acquire (or renew) the reviewer lock on ``run_id``. The current holder may re-POST to refresh ``lock_acquired_at``. A different user receives 409 until the lock is released or auto-swept.
|
|
125
|
+
* Acquire Workflow Run Lock Handler
|
|
126
|
+
*/
|
|
127
|
+
acquireWorkflowRunLock(requestParameters: AcquireWorkflowRunLockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RunLockResponse>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Creates request options for approveWorkflowRunFile without sending the request
|
|
131
|
+
* @param {string} runId
|
|
132
|
+
* @param {string} pathPartId
|
|
133
|
+
* @param {string} [authorization]
|
|
134
|
+
* @param {string} [ksUat]
|
|
135
|
+
* @throws {RequiredError}
|
|
136
|
+
* @memberof WorkflowRunsApiInterface
|
|
137
|
+
*/
|
|
138
|
+
approveWorkflowRunFileRequestOpts(requestParameters: ApproveWorkflowRunFileRequest): Promise<runtime.RequestOpts>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Approve a single generated file. Caller must hold the run lock.
|
|
142
|
+
* @summary Approve Workflow Run File Handler
|
|
143
|
+
* @param {string} runId
|
|
144
|
+
* @param {string} pathPartId
|
|
145
|
+
* @param {string} [authorization]
|
|
146
|
+
* @param {string} [ksUat]
|
|
147
|
+
* @param {*} [options] Override http request option.
|
|
148
|
+
* @throws {RequiredError}
|
|
149
|
+
* @memberof WorkflowRunsApiInterface
|
|
150
|
+
*/
|
|
151
|
+
approveWorkflowRunFileRaw(requestParameters: ApproveWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartApprovalResponse>>;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Approve a single generated file. Caller must hold the run lock.
|
|
155
|
+
* Approve Workflow Run File Handler
|
|
156
|
+
*/
|
|
157
|
+
approveWorkflowRunFile(requestParameters: ApproveWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartApprovalResponse>;
|
|
158
|
+
|
|
58
159
|
/**
|
|
59
160
|
* Creates request options for deleteWorkflowRun without sending the request
|
|
60
161
|
* @param {string} runId
|
|
@@ -109,6 +210,96 @@ export interface WorkflowRunsApiInterface {
|
|
|
109
210
|
*/
|
|
110
211
|
getWorkflowRun(requestParameters: GetWorkflowRunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowRunResponse>;
|
|
111
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Creates request options for rejectWorkflowRunFile without sending the request
|
|
215
|
+
* @param {string} runId
|
|
216
|
+
* @param {string} pathPartId
|
|
217
|
+
* @param {RejectFileRequest} rejectFileRequest
|
|
218
|
+
* @param {string} [authorization]
|
|
219
|
+
* @param {string} [ksUat]
|
|
220
|
+
* @throws {RequiredError}
|
|
221
|
+
* @memberof WorkflowRunsApiInterface
|
|
222
|
+
*/
|
|
223
|
+
rejectWorkflowRunFileRequestOpts(requestParameters: RejectWorkflowRunFileRequest): Promise<runtime.RequestOpts>;
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Reject a single generated file with a reason. Caller must hold the run lock.
|
|
227
|
+
* @summary Reject Workflow Run File Handler
|
|
228
|
+
* @param {string} runId
|
|
229
|
+
* @param {string} pathPartId
|
|
230
|
+
* @param {RejectFileRequest} rejectFileRequest
|
|
231
|
+
* @param {string} [authorization]
|
|
232
|
+
* @param {string} [ksUat]
|
|
233
|
+
* @param {*} [options] Override http request option.
|
|
234
|
+
* @throws {RequiredError}
|
|
235
|
+
* @memberof WorkflowRunsApiInterface
|
|
236
|
+
*/
|
|
237
|
+
rejectWorkflowRunFileRaw(requestParameters: RejectWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartApprovalResponse>>;
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Reject a single generated file with a reason. Caller must hold the run lock.
|
|
241
|
+
* Reject Workflow Run File Handler
|
|
242
|
+
*/
|
|
243
|
+
rejectWorkflowRunFile(requestParameters: RejectWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartApprovalResponse>;
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Creates request options for releaseWorkflowRunLock without sending the request
|
|
247
|
+
* @param {string} runId
|
|
248
|
+
* @param {string} [authorization]
|
|
249
|
+
* @param {string} [ksUat]
|
|
250
|
+
* @throws {RequiredError}
|
|
251
|
+
* @memberof WorkflowRunsApiInterface
|
|
252
|
+
*/
|
|
253
|
+
releaseWorkflowRunLockRequestOpts(requestParameters: ReleaseWorkflowRunLockRequest): Promise<runtime.RequestOpts>;
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Release the reviewer lock; only the holder may call this. DELETE /lock is idempotent: returns 204 even if no lock is held.
|
|
257
|
+
* @summary Release Workflow Run Lock Handler
|
|
258
|
+
* @param {string} runId
|
|
259
|
+
* @param {string} [authorization]
|
|
260
|
+
* @param {string} [ksUat]
|
|
261
|
+
* @param {*} [options] Override http request option.
|
|
262
|
+
* @throws {RequiredError}
|
|
263
|
+
* @memberof WorkflowRunsApiInterface
|
|
264
|
+
*/
|
|
265
|
+
releaseWorkflowRunLockRaw(requestParameters: ReleaseWorkflowRunLockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Release the reviewer lock; only the holder may call this. DELETE /lock is idempotent: returns 204 even if no lock is held.
|
|
269
|
+
* Release Workflow Run Lock Handler
|
|
270
|
+
*/
|
|
271
|
+
releaseWorkflowRunLock(requestParameters: ReleaseWorkflowRunLockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Creates request options for unapproveWorkflowRunFile without sending the request
|
|
275
|
+
* @param {string} runId
|
|
276
|
+
* @param {string} pathPartId
|
|
277
|
+
* @param {string} [authorization]
|
|
278
|
+
* @param {string} [ksUat]
|
|
279
|
+
* @throws {RequiredError}
|
|
280
|
+
* @memberof WorkflowRunsApiInterface
|
|
281
|
+
*/
|
|
282
|
+
unapproveWorkflowRunFileRequestOpts(requestParameters: UnapproveWorkflowRunFileRequest): Promise<runtime.RequestOpts>;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Revert an approved file to ``pending``. Does NOT require the reviewer lock — anyone with ``can_write`` on the run path may unapprove (pilot plan §11.7).
|
|
286
|
+
* @summary Unapprove Workflow Run File Handler
|
|
287
|
+
* @param {string} runId
|
|
288
|
+
* @param {string} pathPartId
|
|
289
|
+
* @param {string} [authorization]
|
|
290
|
+
* @param {string} [ksUat]
|
|
291
|
+
* @param {*} [options] Override http request option.
|
|
292
|
+
* @throws {RequiredError}
|
|
293
|
+
* @memberof WorkflowRunsApiInterface
|
|
294
|
+
*/
|
|
295
|
+
unapproveWorkflowRunFileRaw(requestParameters: UnapproveWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartApprovalResponse>>;
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Revert an approved file to ``pending``. Does NOT require the reviewer lock — anyone with ``can_write`` on the run path may unapprove (pilot plan §11.7).
|
|
299
|
+
* Unapprove Workflow Run File Handler
|
|
300
|
+
*/
|
|
301
|
+
unapproveWorkflowRunFile(requestParameters: UnapproveWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartApprovalResponse>;
|
|
302
|
+
|
|
112
303
|
/**
|
|
113
304
|
* Creates request options for workflowRunCallback without sending the request
|
|
114
305
|
* @param {string} runId
|
|
@@ -141,6 +332,116 @@ export interface WorkflowRunsApiInterface {
|
|
|
141
332
|
*/
|
|
142
333
|
export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiInterface {
|
|
143
334
|
|
|
335
|
+
/**
|
|
336
|
+
* Creates request options for acquireWorkflowRunLock without sending the request
|
|
337
|
+
*/
|
|
338
|
+
async acquireWorkflowRunLockRequestOpts(requestParameters: AcquireWorkflowRunLockRequest): Promise<runtime.RequestOpts> {
|
|
339
|
+
if (requestParameters['runId'] == null) {
|
|
340
|
+
throw new runtime.RequiredError(
|
|
341
|
+
'runId',
|
|
342
|
+
'Required parameter "runId" was null or undefined when calling acquireWorkflowRunLock().'
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const queryParameters: any = {};
|
|
347
|
+
|
|
348
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
349
|
+
|
|
350
|
+
if (requestParameters['authorization'] != null) {
|
|
351
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
let urlPath = `/v1/workflow-runs/{run_id}/lock`;
|
|
356
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
357
|
+
|
|
358
|
+
return {
|
|
359
|
+
path: urlPath,
|
|
360
|
+
method: 'POST',
|
|
361
|
+
headers: headerParameters,
|
|
362
|
+
query: queryParameters,
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Acquire (or renew) the reviewer lock on ``run_id``. The current holder may re-POST to refresh ``lock_acquired_at``. A different user receives 409 until the lock is released or auto-swept.
|
|
368
|
+
* Acquire Workflow Run Lock Handler
|
|
369
|
+
*/
|
|
370
|
+
async acquireWorkflowRunLockRaw(requestParameters: AcquireWorkflowRunLockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RunLockResponse>> {
|
|
371
|
+
const requestOptions = await this.acquireWorkflowRunLockRequestOpts(requestParameters);
|
|
372
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
373
|
+
|
|
374
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RunLockResponseFromJSON(jsonValue));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Acquire (or renew) the reviewer lock on ``run_id``. The current holder may re-POST to refresh ``lock_acquired_at``. A different user receives 409 until the lock is released or auto-swept.
|
|
379
|
+
* Acquire Workflow Run Lock Handler
|
|
380
|
+
*/
|
|
381
|
+
async acquireWorkflowRunLock(requestParameters: AcquireWorkflowRunLockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RunLockResponse> {
|
|
382
|
+
const response = await this.acquireWorkflowRunLockRaw(requestParameters, initOverrides);
|
|
383
|
+
return await response.value();
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Creates request options for approveWorkflowRunFile without sending the request
|
|
388
|
+
*/
|
|
389
|
+
async approveWorkflowRunFileRequestOpts(requestParameters: ApproveWorkflowRunFileRequest): Promise<runtime.RequestOpts> {
|
|
390
|
+
if (requestParameters['runId'] == null) {
|
|
391
|
+
throw new runtime.RequiredError(
|
|
392
|
+
'runId',
|
|
393
|
+
'Required parameter "runId" was null or undefined when calling approveWorkflowRunFile().'
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
if (requestParameters['pathPartId'] == null) {
|
|
398
|
+
throw new runtime.RequiredError(
|
|
399
|
+
'pathPartId',
|
|
400
|
+
'Required parameter "pathPartId" was null or undefined when calling approveWorkflowRunFile().'
|
|
401
|
+
);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
const queryParameters: any = {};
|
|
405
|
+
|
|
406
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
407
|
+
|
|
408
|
+
if (requestParameters['authorization'] != null) {
|
|
409
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
let urlPath = `/v1/workflow-runs/{run_id}/files/{path_part_id}/approve`;
|
|
414
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
415
|
+
urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
|
|
416
|
+
|
|
417
|
+
return {
|
|
418
|
+
path: urlPath,
|
|
419
|
+
method: 'POST',
|
|
420
|
+
headers: headerParameters,
|
|
421
|
+
query: queryParameters,
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Approve a single generated file. Caller must hold the run lock.
|
|
427
|
+
* Approve Workflow Run File Handler
|
|
428
|
+
*/
|
|
429
|
+
async approveWorkflowRunFileRaw(requestParameters: ApproveWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartApprovalResponse>> {
|
|
430
|
+
const requestOptions = await this.approveWorkflowRunFileRequestOpts(requestParameters);
|
|
431
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
432
|
+
|
|
433
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PathPartApprovalResponseFromJSON(jsonValue));
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Approve a single generated file. Caller must hold the run lock.
|
|
438
|
+
* Approve Workflow Run File Handler
|
|
439
|
+
*/
|
|
440
|
+
async approveWorkflowRunFile(requestParameters: ApproveWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartApprovalResponse> {
|
|
441
|
+
const response = await this.approveWorkflowRunFileRaw(requestParameters, initOverrides);
|
|
442
|
+
return await response.value();
|
|
443
|
+
}
|
|
444
|
+
|
|
144
445
|
/**
|
|
145
446
|
* Creates request options for deleteWorkflowRun without sending the request
|
|
146
447
|
*/
|
|
@@ -238,6 +539,184 @@ export class WorkflowRunsApi extends runtime.BaseAPI implements WorkflowRunsApiI
|
|
|
238
539
|
return await response.value();
|
|
239
540
|
}
|
|
240
541
|
|
|
542
|
+
/**
|
|
543
|
+
* Creates request options for rejectWorkflowRunFile without sending the request
|
|
544
|
+
*/
|
|
545
|
+
async rejectWorkflowRunFileRequestOpts(requestParameters: RejectWorkflowRunFileRequest): Promise<runtime.RequestOpts> {
|
|
546
|
+
if (requestParameters['runId'] == null) {
|
|
547
|
+
throw new runtime.RequiredError(
|
|
548
|
+
'runId',
|
|
549
|
+
'Required parameter "runId" was null or undefined when calling rejectWorkflowRunFile().'
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
if (requestParameters['pathPartId'] == null) {
|
|
554
|
+
throw new runtime.RequiredError(
|
|
555
|
+
'pathPartId',
|
|
556
|
+
'Required parameter "pathPartId" was null or undefined when calling rejectWorkflowRunFile().'
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
if (requestParameters['rejectFileRequest'] == null) {
|
|
561
|
+
throw new runtime.RequiredError(
|
|
562
|
+
'rejectFileRequest',
|
|
563
|
+
'Required parameter "rejectFileRequest" was null or undefined when calling rejectWorkflowRunFile().'
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
const queryParameters: any = {};
|
|
568
|
+
|
|
569
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
570
|
+
|
|
571
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
572
|
+
|
|
573
|
+
if (requestParameters['authorization'] != null) {
|
|
574
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
let urlPath = `/v1/workflow-runs/{run_id}/files/{path_part_id}/reject`;
|
|
579
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
580
|
+
urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
|
|
581
|
+
|
|
582
|
+
return {
|
|
583
|
+
path: urlPath,
|
|
584
|
+
method: 'POST',
|
|
585
|
+
headers: headerParameters,
|
|
586
|
+
query: queryParameters,
|
|
587
|
+
body: RejectFileRequestToJSON(requestParameters['rejectFileRequest']),
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Reject a single generated file with a reason. Caller must hold the run lock.
|
|
593
|
+
* Reject Workflow Run File Handler
|
|
594
|
+
*/
|
|
595
|
+
async rejectWorkflowRunFileRaw(requestParameters: RejectWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartApprovalResponse>> {
|
|
596
|
+
const requestOptions = await this.rejectWorkflowRunFileRequestOpts(requestParameters);
|
|
597
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
598
|
+
|
|
599
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PathPartApprovalResponseFromJSON(jsonValue));
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* Reject a single generated file with a reason. Caller must hold the run lock.
|
|
604
|
+
* Reject Workflow Run File Handler
|
|
605
|
+
*/
|
|
606
|
+
async rejectWorkflowRunFile(requestParameters: RejectWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartApprovalResponse> {
|
|
607
|
+
const response = await this.rejectWorkflowRunFileRaw(requestParameters, initOverrides);
|
|
608
|
+
return await response.value();
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* Creates request options for releaseWorkflowRunLock without sending the request
|
|
613
|
+
*/
|
|
614
|
+
async releaseWorkflowRunLockRequestOpts(requestParameters: ReleaseWorkflowRunLockRequest): Promise<runtime.RequestOpts> {
|
|
615
|
+
if (requestParameters['runId'] == null) {
|
|
616
|
+
throw new runtime.RequiredError(
|
|
617
|
+
'runId',
|
|
618
|
+
'Required parameter "runId" was null or undefined when calling releaseWorkflowRunLock().'
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
const queryParameters: any = {};
|
|
623
|
+
|
|
624
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
625
|
+
|
|
626
|
+
if (requestParameters['authorization'] != null) {
|
|
627
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
let urlPath = `/v1/workflow-runs/{run_id}/lock`;
|
|
632
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
633
|
+
|
|
634
|
+
return {
|
|
635
|
+
path: urlPath,
|
|
636
|
+
method: 'DELETE',
|
|
637
|
+
headers: headerParameters,
|
|
638
|
+
query: queryParameters,
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Release the reviewer lock; only the holder may call this. DELETE /lock is idempotent: returns 204 even if no lock is held.
|
|
644
|
+
* Release Workflow Run Lock Handler
|
|
645
|
+
*/
|
|
646
|
+
async releaseWorkflowRunLockRaw(requestParameters: ReleaseWorkflowRunLockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
647
|
+
const requestOptions = await this.releaseWorkflowRunLockRequestOpts(requestParameters);
|
|
648
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
649
|
+
|
|
650
|
+
return new runtime.VoidApiResponse(response);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Release the reviewer lock; only the holder may call this. DELETE /lock is idempotent: returns 204 even if no lock is held.
|
|
655
|
+
* Release Workflow Run Lock Handler
|
|
656
|
+
*/
|
|
657
|
+
async releaseWorkflowRunLock(requestParameters: ReleaseWorkflowRunLockRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
658
|
+
await this.releaseWorkflowRunLockRaw(requestParameters, initOverrides);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
/**
|
|
662
|
+
* Creates request options for unapproveWorkflowRunFile without sending the request
|
|
663
|
+
*/
|
|
664
|
+
async unapproveWorkflowRunFileRequestOpts(requestParameters: UnapproveWorkflowRunFileRequest): Promise<runtime.RequestOpts> {
|
|
665
|
+
if (requestParameters['runId'] == null) {
|
|
666
|
+
throw new runtime.RequiredError(
|
|
667
|
+
'runId',
|
|
668
|
+
'Required parameter "runId" was null or undefined when calling unapproveWorkflowRunFile().'
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
if (requestParameters['pathPartId'] == null) {
|
|
673
|
+
throw new runtime.RequiredError(
|
|
674
|
+
'pathPartId',
|
|
675
|
+
'Required parameter "pathPartId" was null or undefined when calling unapproveWorkflowRunFile().'
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
const queryParameters: any = {};
|
|
680
|
+
|
|
681
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
682
|
+
|
|
683
|
+
if (requestParameters['authorization'] != null) {
|
|
684
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
let urlPath = `/v1/workflow-runs/{run_id}/files/{path_part_id}/unapprove`;
|
|
689
|
+
urlPath = urlPath.replace(`{${"run_id"}}`, encodeURIComponent(String(requestParameters['runId'])));
|
|
690
|
+
urlPath = urlPath.replace(`{${"path_part_id"}}`, encodeURIComponent(String(requestParameters['pathPartId'])));
|
|
691
|
+
|
|
692
|
+
return {
|
|
693
|
+
path: urlPath,
|
|
694
|
+
method: 'POST',
|
|
695
|
+
headers: headerParameters,
|
|
696
|
+
query: queryParameters,
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* Revert an approved file to ``pending``. Does NOT require the reviewer lock — anyone with ``can_write`` on the run path may unapprove (pilot plan §11.7).
|
|
702
|
+
* Unapprove Workflow Run File Handler
|
|
703
|
+
*/
|
|
704
|
+
async unapproveWorkflowRunFileRaw(requestParameters: UnapproveWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PathPartApprovalResponse>> {
|
|
705
|
+
const requestOptions = await this.unapproveWorkflowRunFileRequestOpts(requestParameters);
|
|
706
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
707
|
+
|
|
708
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PathPartApprovalResponseFromJSON(jsonValue));
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Revert an approved file to ``pending``. Does NOT require the reviewer lock — anyone with ``can_write`` on the run path may unapprove (pilot plan §11.7).
|
|
713
|
+
* Unapprove Workflow Run File Handler
|
|
714
|
+
*/
|
|
715
|
+
async unapproveWorkflowRunFile(requestParameters: UnapproveWorkflowRunFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartApprovalResponse> {
|
|
716
|
+
const response = await this.unapproveWorkflowRunFileRaw(requestParameters, initOverrides);
|
|
717
|
+
return await response.value();
|
|
718
|
+
}
|
|
719
|
+
|
|
241
720
|
/**
|
|
242
721
|
* Creates request options for workflowRunCallback without sending the request
|
|
243
722
|
*/
|
|
@@ -95,6 +95,12 @@ export interface CreateWorkflowDefinitionRequest {
|
|
|
95
95
|
* @memberof CreateWorkflowDefinitionRequest
|
|
96
96
|
*/
|
|
97
97
|
templatePathPartId?: string | null;
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @type {boolean}
|
|
101
|
+
* @memberof CreateWorkflowDefinitionRequest
|
|
102
|
+
*/
|
|
103
|
+
approvalRequired?: boolean;
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
|
|
@@ -169,6 +175,7 @@ export function CreateWorkflowDefinitionRequestFromJSONTyped(json: any, ignoreDi
|
|
|
169
175
|
'instructionPathPartIds': json['instruction_path_part_ids'] == null ? undefined : json['instruction_path_part_ids'],
|
|
170
176
|
'outputPathPartIds': json['output_path_part_ids'],
|
|
171
177
|
'templatePathPartId': json['template_path_part_id'] == null ? undefined : json['template_path_part_id'],
|
|
178
|
+
'approvalRequired': json['approval_required'] == null ? undefined : json['approval_required'],
|
|
172
179
|
};
|
|
173
180
|
}
|
|
174
181
|
|
|
@@ -192,6 +199,7 @@ export function CreateWorkflowDefinitionRequestToJSONTyped(value?: CreateWorkflo
|
|
|
192
199
|
'instruction_path_part_ids': value['instructionPathPartIds'],
|
|
193
200
|
'output_path_part_ids': value['outputPathPartIds'],
|
|
194
201
|
'template_path_part_id': value['templatePathPartId'],
|
|
202
|
+
'approval_required': value['approvalRequired'],
|
|
195
203
|
};
|
|
196
204
|
}
|
|
197
205
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Knowledge Stack API
|
|
5
|
+
* Knowledge Stack backend API for authentication and knowledge management
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 0.1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Per-file review status within a run (SeaHonor pilot).
|
|
18
|
+
*
|
|
19
|
+
* Now retained as the audit-history record (one row per (run, file));
|
|
20
|
+
* the current state of truth is ``path_part.approval_state``. The
|
|
21
|
+
* service dual-writes both.
|
|
22
|
+
* @export
|
|
23
|
+
*/
|
|
24
|
+
export const PathPartApprovalDecision = {
|
|
25
|
+
Pending: 'pending',
|
|
26
|
+
Approved: 'approved',
|
|
27
|
+
Rejected: 'rejected'
|
|
28
|
+
} as const;
|
|
29
|
+
export type PathPartApprovalDecision = typeof PathPartApprovalDecision[keyof typeof PathPartApprovalDecision];
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export function instanceOfPathPartApprovalDecision(value: any): boolean {
|
|
33
|
+
for (const key in PathPartApprovalDecision) {
|
|
34
|
+
if (Object.prototype.hasOwnProperty.call(PathPartApprovalDecision, key)) {
|
|
35
|
+
if (PathPartApprovalDecision[key as keyof typeof PathPartApprovalDecision] === value) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function PathPartApprovalDecisionFromJSON(json: any): PathPartApprovalDecision {
|
|
44
|
+
return PathPartApprovalDecisionFromJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function PathPartApprovalDecisionFromJSONTyped(json: any, ignoreDiscriminator: boolean): PathPartApprovalDecision {
|
|
48
|
+
return json as PathPartApprovalDecision;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function PathPartApprovalDecisionToJSON(value?: PathPartApprovalDecision | null): any {
|
|
52
|
+
return value as any;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function PathPartApprovalDecisionToJSONTyped(value: any, ignoreDiscriminator: boolean): PathPartApprovalDecision {
|
|
56
|
+
return value as PathPartApprovalDecision;
|
|
57
|
+
}
|
|
58
|
+
|