@knowledge-stack/ksapi 1.81.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.
Files changed (97) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +12 -2
  3. package/dist/apis/WorkflowDefinitionsApi.d.ts +4 -1
  4. package/dist/apis/WorkflowDefinitionsApi.js +2 -0
  5. package/dist/apis/WorkflowRunsApi.d.ts +233 -1
  6. package/dist/apis/WorkflowRunsApi.js +236 -0
  7. package/dist/esm/apis/WorkflowDefinitionsApi.d.ts +4 -1
  8. package/dist/esm/apis/WorkflowDefinitionsApi.js +2 -0
  9. package/dist/esm/apis/WorkflowRunsApi.d.ts +233 -1
  10. package/dist/esm/apis/WorkflowRunsApi.js +237 -1
  11. package/dist/esm/models/CreateWorkflowDefinitionRequest.d.ts +14 -1
  12. package/dist/esm/models/CreateWorkflowDefinitionRequest.js +3 -4
  13. package/dist/esm/models/InstructionSnapshot.d.ts +71 -0
  14. package/dist/esm/models/InstructionSnapshot.js +57 -0
  15. package/dist/esm/models/InvokeWorkflowRequest.d.ts +6 -0
  16. package/dist/esm/models/InvokeWorkflowRequest.js +6 -0
  17. package/dist/esm/models/PathPartApprovalDecision.d.ts +30 -0
  18. package/dist/esm/models/PathPartApprovalDecision.js +48 -0
  19. package/dist/esm/models/PathPartApprovalResponse.d.ts +111 -0
  20. package/dist/esm/models/PathPartApprovalResponse.js +85 -0
  21. package/dist/esm/models/RejectFileRequest.d.ts +47 -0
  22. package/dist/esm/models/RejectFileRequest.js +49 -0
  23. package/dist/esm/models/RunLockResponse.d.ts +59 -0
  24. package/dist/esm/models/RunLockResponse.js +52 -0
  25. package/dist/esm/models/UpdateWorkflowDefinitionRequest.d.ts +12 -1
  26. package/dist/esm/models/UpdateWorkflowDefinitionRequest.js +2 -0
  27. package/dist/esm/models/WorkflowDefinitionResponse.d.ts +6 -0
  28. package/dist/esm/models/WorkflowDefinitionResponse.js +4 -0
  29. package/dist/esm/models/WorkflowRunResponse.d.ts +17 -0
  30. package/dist/esm/models/WorkflowRunResponse.js +8 -0
  31. package/dist/esm/models/WorkflowRunSnapshot.d.ts +3 -2
  32. package/dist/esm/models/WorkflowRunSnapshot.js +3 -2
  33. package/dist/esm/models/WorkflowRunStatus.d.ts +20 -2
  34. package/dist/esm/models/WorkflowRunStatus.js +20 -2
  35. package/dist/esm/models/WorkflowRunnerType.d.ts +1 -0
  36. package/dist/esm/models/WorkflowRunnerType.js +2 -1
  37. package/dist/esm/models/index.d.ts +5 -0
  38. package/dist/esm/models/index.js +5 -0
  39. package/dist/models/CreateWorkflowDefinitionRequest.d.ts +14 -1
  40. package/dist/models/CreateWorkflowDefinitionRequest.js +3 -4
  41. package/dist/models/InstructionSnapshot.d.ts +71 -0
  42. package/dist/models/InstructionSnapshot.js +65 -0
  43. package/dist/models/InvokeWorkflowRequest.d.ts +6 -0
  44. package/dist/models/InvokeWorkflowRequest.js +6 -0
  45. package/dist/models/PathPartApprovalDecision.d.ts +30 -0
  46. package/dist/models/PathPartApprovalDecision.js +56 -0
  47. package/dist/models/PathPartApprovalResponse.d.ts +111 -0
  48. package/dist/models/PathPartApprovalResponse.js +93 -0
  49. package/dist/models/RejectFileRequest.d.ts +47 -0
  50. package/dist/models/RejectFileRequest.js +57 -0
  51. package/dist/models/RunLockResponse.d.ts +59 -0
  52. package/dist/models/RunLockResponse.js +60 -0
  53. package/dist/models/UpdateWorkflowDefinitionRequest.d.ts +12 -1
  54. package/dist/models/UpdateWorkflowDefinitionRequest.js +2 -0
  55. package/dist/models/WorkflowDefinitionResponse.d.ts +6 -0
  56. package/dist/models/WorkflowDefinitionResponse.js +4 -0
  57. package/dist/models/WorkflowRunResponse.d.ts +17 -0
  58. package/dist/models/WorkflowRunResponse.js +8 -0
  59. package/dist/models/WorkflowRunSnapshot.d.ts +3 -2
  60. package/dist/models/WorkflowRunSnapshot.js +3 -2
  61. package/dist/models/WorkflowRunStatus.d.ts +20 -2
  62. package/dist/models/WorkflowRunStatus.js +20 -2
  63. package/dist/models/WorkflowRunnerType.d.ts +1 -0
  64. package/dist/models/WorkflowRunnerType.js +2 -1
  65. package/dist/models/index.d.ts +5 -0
  66. package/dist/models/index.js +5 -0
  67. package/docs/CreateWorkflowDefinitionRequest.md +3 -1
  68. package/docs/InstructionSnapshot.md +41 -0
  69. package/docs/InvokeWorkflowRequest.md +2 -0
  70. package/docs/PathPartApprovalDecision.md +33 -0
  71. package/docs/PathPartApprovalResponse.md +55 -0
  72. package/docs/RejectFileRequest.md +35 -0
  73. package/docs/RunLockResponse.md +39 -0
  74. package/docs/UpdateWorkflowDefinitionRequest.md +3 -1
  75. package/docs/WorkflowDefinitionResponse.md +2 -0
  76. package/docs/WorkflowDefinitionsApi.md +2 -0
  77. package/docs/WorkflowRunResponse.md +5 -1
  78. package/docs/WorkflowRunSnapshot.md +1 -1
  79. package/docs/WorkflowRunStatus.md +1 -1
  80. package/docs/WorkflowRunsApi.md +387 -0
  81. package/package.json +1 -1
  82. package/src/apis/WorkflowDefinitionsApi.ts +4 -1
  83. package/src/apis/WorkflowRunsApi.ts +479 -0
  84. package/src/models/CreateWorkflowDefinitionRequest.ts +17 -4
  85. package/src/models/InstructionSnapshot.ts +125 -0
  86. package/src/models/InvokeWorkflowRequest.ts +12 -0
  87. package/src/models/PathPartApprovalDecision.ts +58 -0
  88. package/src/models/PathPartApprovalResponse.ts +186 -0
  89. package/src/models/RejectFileRequest.ts +87 -0
  90. package/src/models/RunLockResponse.ts +101 -0
  91. package/src/models/UpdateWorkflowDefinitionRequest.ts +14 -1
  92. package/src/models/WorkflowDefinitionResponse.ts +9 -0
  93. package/src/models/WorkflowRunResponse.ts +23 -0
  94. package/src/models/WorkflowRunSnapshot.ts +11 -4
  95. package/src/models/WorkflowRunStatus.ts +20 -2
  96. package/src/models/WorkflowRunnerType.ts +2 -1
  97. package/src/models/index.ts +5 -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
  */
@@ -30,6 +30,13 @@ import {
30
30
 
31
31
  /**
32
32
  * Create a new workflow definition.
33
+ *
34
+ * ``instruction_path_part_ids`` semantics depend on ``runner_type``:
35
+ *
36
+ * - ``KS_INTERNAL``: must be empty (``[]``); the server auto-provisions a
37
+ * single ``instruction.md`` and stores ``[doc.path_part_id]``.
38
+ * - ``SELF_HOSTED``: caller-supplied list of one-or-more document
39
+ * PathPart IDs. Must contain at least one entry.
33
40
  * @export
34
41
  * @interface CreateWorkflowDefinitionRequest
35
42
  */
@@ -75,7 +82,7 @@ export interface CreateWorkflowDefinitionRequest {
75
82
  * @type {Array<string>}
76
83
  * @memberof CreateWorkflowDefinitionRequest
77
84
  */
78
- instructionPathPartIds: Array<string>;
85
+ instructionPathPartIds?: Array<string>;
79
86
  /**
80
87
  *
81
88
  * @type {Array<string>}
@@ -88,6 +95,12 @@ export interface CreateWorkflowDefinitionRequest {
88
95
  * @memberof CreateWorkflowDefinitionRequest
89
96
  */
90
97
  templatePathPartId?: string | null;
98
+ /**
99
+ *
100
+ * @type {boolean}
101
+ * @memberof CreateWorkflowDefinitionRequest
102
+ */
103
+ approvalRequired?: boolean;
91
104
  }
92
105
 
93
106
 
@@ -122,7 +135,6 @@ export const CreateWorkflowDefinitionRequestPropertyValidationAttributesMap: {
122
135
  },
123
136
  instructionPathPartIds: {
124
137
  maxItems: 20,
125
- minItems: 1,
126
138
  uniqueItems: false,
127
139
  },
128
140
  outputPathPartIds: {
@@ -140,7 +152,6 @@ export function instanceOfCreateWorkflowDefinitionRequest(value: object): value
140
152
  if (!('name' in value) || value['name'] === undefined) return false;
141
153
  if (!('runnerType' in value) || value['runnerType'] === undefined) return false;
142
154
  if (!('sourcePathPartIds' in value) || value['sourcePathPartIds'] === undefined) return false;
143
- if (!('instructionPathPartIds' in value) || value['instructionPathPartIds'] === undefined) return false;
144
155
  if (!('outputPathPartIds' in value) || value['outputPathPartIds'] === undefined) return false;
145
156
  return true;
146
157
  }
@@ -161,9 +172,10 @@ export function CreateWorkflowDefinitionRequestFromJSONTyped(json: any, ignoreDi
161
172
  'runnerConfig': json['runner_config'] == null ? undefined : SelfHostedRunnerConfigFromJSON(json['runner_config']),
162
173
  'maxRunDurationSeconds': json['max_run_duration_seconds'] == null ? undefined : json['max_run_duration_seconds'],
163
174
  'sourcePathPartIds': json['source_path_part_ids'],
164
- 'instructionPathPartIds': json['instruction_path_part_ids'],
175
+ 'instructionPathPartIds': json['instruction_path_part_ids'] == null ? undefined : json['instruction_path_part_ids'],
165
176
  'outputPathPartIds': json['output_path_part_ids'],
166
177
  'templatePathPartId': json['template_path_part_id'] == null ? undefined : json['template_path_part_id'],
178
+ 'approvalRequired': json['approval_required'] == null ? undefined : json['approval_required'],
167
179
  };
168
180
  }
169
181
 
@@ -187,6 +199,7 @@ export function CreateWorkflowDefinitionRequestToJSONTyped(value?: CreateWorkflo
187
199
  'instruction_path_part_ids': value['instructionPathPartIds'],
188
200
  'output_path_part_ids': value['outputPathPartIds'],
189
201
  'template_path_part_id': value['templatePathPartId'],
202
+ 'approval_required': value['approvalRequired'],
190
203
  };
191
204
  }
192
205