@knowledge-stack/ksapi 1.57.0 → 1.59.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 (77) hide show
  1. package/.openapi-generator/FILES +12 -2
  2. package/README.md +16 -6
  3. package/dist/apis/FoldersApi.d.ts +63 -4
  4. package/dist/apis/FoldersApi.js +64 -3
  5. package/dist/apis/PathPartsApi.d.ts +45 -1
  6. package/dist/apis/PathPartsApi.js +44 -0
  7. package/dist/apis/SectionsApi.d.ts +44 -0
  8. package/dist/apis/SectionsApi.js +43 -0
  9. package/dist/apis/WorkflowsApi.d.ts +144 -59
  10. package/dist/apis/WorkflowsApi.js +131 -49
  11. package/dist/esm/apis/FoldersApi.d.ts +63 -4
  12. package/dist/esm/apis/FoldersApi.js +64 -3
  13. package/dist/esm/apis/PathPartsApi.d.ts +45 -1
  14. package/dist/esm/apis/PathPartsApi.js +45 -1
  15. package/dist/esm/apis/SectionsApi.d.ts +44 -0
  16. package/dist/esm/apis/SectionsApi.js +43 -0
  17. package/dist/esm/apis/WorkflowsApi.d.ts +144 -59
  18. package/dist/esm/apis/WorkflowsApi.js +132 -50
  19. package/dist/esm/models/AncestryResponse.d.ts +48 -0
  20. package/dist/esm/models/AncestryResponse.js +45 -0
  21. package/dist/esm/models/PathPartAncestorItem.d.ts +96 -0
  22. package/dist/esm/models/PathPartAncestorItem.js +77 -0
  23. package/dist/esm/models/SearchSortOrder.d.ts +26 -0
  24. package/dist/esm/models/SearchSortOrder.js +44 -0
  25. package/dist/esm/models/SearchablePartType.d.ts +25 -0
  26. package/dist/esm/models/SearchablePartType.js +43 -0
  27. package/dist/esm/models/TemporalWorkflowStatusResponse.d.ts +83 -0
  28. package/dist/esm/models/TemporalWorkflowStatusResponse.js +66 -0
  29. package/dist/esm/models/WorkflowActionResponse.d.ts +1 -1
  30. package/dist/esm/models/WorkflowCancelResponse.d.ts +53 -0
  31. package/dist/esm/models/WorkflowCancelResponse.js +48 -0
  32. package/dist/esm/models/index.d.ts +6 -1
  33. package/dist/esm/models/index.js +6 -1
  34. package/dist/models/AncestryResponse.d.ts +48 -0
  35. package/dist/models/AncestryResponse.js +53 -0
  36. package/dist/models/PathPartAncestorItem.d.ts +96 -0
  37. package/dist/models/PathPartAncestorItem.js +85 -0
  38. package/dist/models/SearchSortOrder.d.ts +26 -0
  39. package/dist/models/SearchSortOrder.js +52 -0
  40. package/dist/models/SearchablePartType.d.ts +25 -0
  41. package/dist/models/SearchablePartType.js +51 -0
  42. package/dist/models/TemporalWorkflowStatusResponse.d.ts +83 -0
  43. package/dist/models/TemporalWorkflowStatusResponse.js +74 -0
  44. package/dist/models/WorkflowActionResponse.d.ts +1 -1
  45. package/dist/models/WorkflowCancelResponse.d.ts +53 -0
  46. package/dist/models/WorkflowCancelResponse.js +56 -0
  47. package/dist/models/index.d.ts +6 -1
  48. package/dist/models/index.js +6 -1
  49. package/docs/AncestryResponse.md +35 -0
  50. package/docs/FoldersApi.md +94 -4
  51. package/docs/PathPartAncestorItem.md +51 -0
  52. package/docs/PathPartsApi.md +75 -0
  53. package/docs/{WorkflowAction.md → SearchSortOrder.md} +5 -5
  54. package/docs/SearchablePartType.md +33 -0
  55. package/docs/SectionsApi.md +75 -0
  56. package/docs/TemporalWorkflowStatusResponse.md +47 -0
  57. package/docs/WorkflowActionResponse.md +1 -1
  58. package/docs/WorkflowCancelResponse.md +37 -0
  59. package/docs/WorkflowsApi.md +183 -36
  60. package/package.json +1 -1
  61. package/src/apis/FoldersApi.ts +136 -7
  62. package/src/apis/PathPartsApi.ts +88 -0
  63. package/src/apis/SectionsApi.ts +81 -0
  64. package/src/apis/WorkflowsApi.ts +249 -90
  65. package/src/models/AncestryResponse.ts +91 -0
  66. package/src/models/PathPartAncestorItem.ts +165 -0
  67. package/src/models/SearchSortOrder.ts +54 -0
  68. package/src/models/SearchablePartType.ts +53 -0
  69. package/src/models/TemporalWorkflowStatusResponse.ts +136 -0
  70. package/src/models/WorkflowActionResponse.ts +1 -1
  71. package/src/models/WorkflowCancelResponse.ts +92 -0
  72. package/src/models/index.ts +6 -1
  73. package/dist/esm/models/WorkflowAction.d.ts +0 -25
  74. package/dist/esm/models/WorkflowAction.js +0 -43
  75. package/dist/models/WorkflowAction.d.ts +0 -25
  76. package/dist/models/WorkflowAction.js +0 -51
  77. package/src/models/WorkflowAction.ts +0 -53
@@ -17,8 +17,9 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  HTTPValidationError,
19
19
  PaginatedResponseWorkflowSummaryResponse,
20
- WorkflowAction,
20
+ TemporalWorkflowStatusResponse,
21
21
  WorkflowActionResponse,
22
+ WorkflowCancelResponse,
22
23
  WorkflowDetailResponse,
23
24
  } from '../models/index';
24
25
  import {
@@ -26,30 +27,43 @@ import {
26
27
  HTTPValidationErrorToJSON,
27
28
  PaginatedResponseWorkflowSummaryResponseFromJSON,
28
29
  PaginatedResponseWorkflowSummaryResponseToJSON,
29
- WorkflowActionFromJSON,
30
- WorkflowActionToJSON,
30
+ TemporalWorkflowStatusResponseFromJSON,
31
+ TemporalWorkflowStatusResponseToJSON,
31
32
  WorkflowActionResponseFromJSON,
32
33
  WorkflowActionResponseToJSON,
34
+ WorkflowCancelResponseFromJSON,
35
+ WorkflowCancelResponseToJSON,
33
36
  WorkflowDetailResponseFromJSON,
34
37
  WorkflowDetailResponseToJSON,
35
38
  } from '../models/index';
36
39
 
37
- export interface GetWorkflowRequest {
40
+ export interface CancelTemporalWorkflowRequest {
38
41
  workflowId: string;
39
42
  authorization?: string | null;
40
43
  ksUat?: string | null;
41
44
  }
42
45
 
43
- export interface ListWorkflowsRequest {
44
- limit?: number;
45
- offset?: number;
46
+ export interface DvWorkflowRerunRequest {
47
+ workflowId: string;
46
48
  authorization?: string | null;
47
49
  ksUat?: string | null;
48
50
  }
49
51
 
50
- export interface WorkflowActionRequest {
52
+ export interface GetDvWorkflowRequest {
51
53
  workflowId: string;
52
- action: WorkflowAction;
54
+ authorization?: string | null;
55
+ ksUat?: string | null;
56
+ }
57
+
58
+ export interface GetTemporalWorkflowStatusRequest {
59
+ workflowId: string;
60
+ authorization?: string | null;
61
+ ksUat?: string | null;
62
+ }
63
+
64
+ export interface ListDvWorkflowsRequest {
65
+ limit?: number;
66
+ offset?: number;
53
67
  authorization?: string | null;
54
68
  ksUat?: string | null;
55
69
  }
@@ -62,18 +76,18 @@ export interface WorkflowActionRequest {
62
76
  */
63
77
  export interface WorkflowsApiInterface {
64
78
  /**
65
- * Creates request options for getWorkflow without sending the request
79
+ * Creates request options for cancelTemporalWorkflow without sending the request
66
80
  * @param {string} workflowId
67
81
  * @param {string} [authorization]
68
82
  * @param {string} [ksUat]
69
83
  * @throws {RequiredError}
70
84
  * @memberof WorkflowsApiInterface
71
85
  */
72
- getWorkflowRequestOpts(requestParameters: GetWorkflowRequest): Promise<runtime.RequestOpts>;
86
+ cancelTemporalWorkflowRequestOpts(requestParameters: CancelTemporalWorkflowRequest): Promise<runtime.RequestOpts>;
73
87
 
74
88
  /**
75
- * Get single workflow detail with live Temporal status.
76
- * @summary Get Workflow Handler
89
+ * Cancel any Temporal workflow owned by the caller\'s tenant. No status guard — this is a thin Temporal wrapper. Cancelling an already-terminal workflow is a no-op on the Temporal side.
90
+ * @summary Cancel Temporal Workflow Handler
77
91
  * @param {string} workflowId
78
92
  * @param {string} [authorization]
79
93
  * @param {string} [ksUat]
@@ -81,73 +95,127 @@ export interface WorkflowsApiInterface {
81
95
  * @throws {RequiredError}
82
96
  * @memberof WorkflowsApiInterface
83
97
  */
84
- getWorkflowRaw(requestParameters: GetWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowDetailResponse>>;
98
+ cancelTemporalWorkflowRaw(requestParameters: CancelTemporalWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowCancelResponse>>;
85
99
 
86
100
  /**
87
- * Get single workflow detail with live Temporal status.
88
- * Get Workflow Handler
101
+ * Cancel any Temporal workflow owned by the caller\'s tenant. No status guard — this is a thin Temporal wrapper. Cancelling an already-terminal workflow is a no-op on the Temporal side.
102
+ * Cancel Temporal Workflow Handler
89
103
  */
90
- getWorkflow(requestParameters: GetWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowDetailResponse>;
104
+ cancelTemporalWorkflow(requestParameters: CancelTemporalWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowCancelResponse>;
91
105
 
92
106
  /**
93
- * Creates request options for listWorkflows without sending the request
94
- * @param {number} [limit] Number of items per page
95
- * @param {number} [offset] Number of items to skip
107
+ * Creates request options for dvWorkflowRerun without sending the request
108
+ * @param {string} workflowId
96
109
  * @param {string} [authorization]
97
110
  * @param {string} [ksUat]
98
111
  * @throws {RequiredError}
99
112
  * @memberof WorkflowsApiInterface
100
113
  */
101
- listWorkflowsRequestOpts(requestParameters: ListWorkflowsRequest): Promise<runtime.RequestOpts>;
114
+ dvWorkflowRerunRequestOpts(requestParameters: DvWorkflowRerunRequest): Promise<runtime.RequestOpts>;
102
115
 
103
116
  /**
104
- * List all workflows for the current tenant (paginated, DB-backed).
105
- * @summary List Workflows Handler
106
- * @param {number} [limit] Number of items per page
107
- * @param {number} [offset] Number of items to skip
117
+ * Rerun a workflow. USER role requires ``can_write`` on the document path.
118
+ * @summary Dv Workflow Rerun Handler
119
+ * @param {string} workflowId
108
120
  * @param {string} [authorization]
109
121
  * @param {string} [ksUat]
110
122
  * @param {*} [options] Override http request option.
111
123
  * @throws {RequiredError}
112
124
  * @memberof WorkflowsApiInterface
113
125
  */
114
- listWorkflowsRaw(requestParameters: ListWorkflowsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseWorkflowSummaryResponse>>;
126
+ dvWorkflowRerunRaw(requestParameters: DvWorkflowRerunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowActionResponse>>;
115
127
 
116
128
  /**
117
- * List all workflows for the current tenant (paginated, DB-backed).
118
- * List Workflows Handler
129
+ * Rerun a workflow. USER role requires ``can_write`` on the document path.
130
+ * Dv Workflow Rerun Handler
119
131
  */
120
- listWorkflows(requestParameters: ListWorkflowsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseWorkflowSummaryResponse>;
132
+ dvWorkflowRerun(requestParameters: DvWorkflowRerunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowActionResponse>;
121
133
 
122
134
  /**
123
- * Creates request options for workflowAction without sending the request
135
+ * Creates request options for getDvWorkflow without sending the request
124
136
  * @param {string} workflowId
125
- * @param {WorkflowAction} action Action to perform
126
137
  * @param {string} [authorization]
127
138
  * @param {string} [ksUat]
128
139
  * @throws {RequiredError}
129
140
  * @memberof WorkflowsApiInterface
130
141
  */
131
- workflowActionRequestOpts(requestParameters: WorkflowActionRequest): Promise<runtime.RequestOpts>;
142
+ getDvWorkflowRequestOpts(requestParameters: GetDvWorkflowRequest): Promise<runtime.RequestOpts>;
132
143
 
133
144
  /**
134
- * Cancel or rerun a workflow (OWNER/ADMIN only).
135
- * @summary Workflow Action Handler
145
+ * Get single workflow detail with live Temporal status.
146
+ * @summary Get Dv Workflow Handler
136
147
  * @param {string} workflowId
137
- * @param {WorkflowAction} action Action to perform
138
148
  * @param {string} [authorization]
139
149
  * @param {string} [ksUat]
140
150
  * @param {*} [options] Override http request option.
141
151
  * @throws {RequiredError}
142
152
  * @memberof WorkflowsApiInterface
143
153
  */
144
- workflowActionRaw(requestParameters: WorkflowActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowActionResponse>>;
154
+ getDvWorkflowRaw(requestParameters: GetDvWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowDetailResponse>>;
155
+
156
+ /**
157
+ * Get single workflow detail with live Temporal status.
158
+ * Get Dv Workflow Handler
159
+ */
160
+ getDvWorkflow(requestParameters: GetDvWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowDetailResponse>;
145
161
 
146
162
  /**
147
- * Cancel or rerun a workflow (OWNER/ADMIN only).
148
- * Workflow Action Handler
163
+ * Creates request options for getTemporalWorkflowStatus without sending the request
164
+ * @param {string} workflowId
165
+ * @param {string} [authorization]
166
+ * @param {string} [ksUat]
167
+ * @throws {RequiredError}
168
+ * @memberof WorkflowsApiInterface
149
169
  */
150
- workflowAction(requestParameters: WorkflowActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowActionResponse>;
170
+ getTemporalWorkflowStatusRequestOpts(requestParameters: GetTemporalWorkflowStatusRequest): Promise<runtime.RequestOpts>;
171
+
172
+ /**
173
+ * Get live Temporal status for any workflow owned by the caller\'s tenant.
174
+ * @summary Get Temporal Workflow Status Handler
175
+ * @param {string} workflowId
176
+ * @param {string} [authorization]
177
+ * @param {string} [ksUat]
178
+ * @param {*} [options] Override http request option.
179
+ * @throws {RequiredError}
180
+ * @memberof WorkflowsApiInterface
181
+ */
182
+ getTemporalWorkflowStatusRaw(requestParameters: GetTemporalWorkflowStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TemporalWorkflowStatusResponse>>;
183
+
184
+ /**
185
+ * Get live Temporal status for any workflow owned by the caller\'s tenant.
186
+ * Get Temporal Workflow Status Handler
187
+ */
188
+ getTemporalWorkflowStatus(requestParameters: GetTemporalWorkflowStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TemporalWorkflowStatusResponse>;
189
+
190
+ /**
191
+ * Creates request options for listDvWorkflows without sending the request
192
+ * @param {number} [limit] Number of items per page
193
+ * @param {number} [offset] Number of items to skip
194
+ * @param {string} [authorization]
195
+ * @param {string} [ksUat]
196
+ * @throws {RequiredError}
197
+ * @memberof WorkflowsApiInterface
198
+ */
199
+ listDvWorkflowsRequestOpts(requestParameters: ListDvWorkflowsRequest): Promise<runtime.RequestOpts>;
200
+
201
+ /**
202
+ * List all workflows for the current tenant (paginated, DB-backed). ADMIN/OWNER see all workflows; USER sees only those under permitted paths.
203
+ * @summary List Dv Workflows Handler
204
+ * @param {number} [limit] Number of items per page
205
+ * @param {number} [offset] Number of items to skip
206
+ * @param {string} [authorization]
207
+ * @param {string} [ksUat]
208
+ * @param {*} [options] Override http request option.
209
+ * @throws {RequiredError}
210
+ * @memberof WorkflowsApiInterface
211
+ */
212
+ listDvWorkflowsRaw(requestParameters: ListDvWorkflowsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseWorkflowSummaryResponse>>;
213
+
214
+ /**
215
+ * List all workflows for the current tenant (paginated, DB-backed). ADMIN/OWNER see all workflows; USER sees only those under permitted paths.
216
+ * List Dv Workflows Handler
217
+ */
218
+ listDvWorkflows(requestParameters: ListDvWorkflowsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseWorkflowSummaryResponse>;
151
219
 
152
220
  }
153
221
 
@@ -157,13 +225,13 @@ export interface WorkflowsApiInterface {
157
225
  export class WorkflowsApi extends runtime.BaseAPI implements WorkflowsApiInterface {
158
226
 
159
227
  /**
160
- * Creates request options for getWorkflow without sending the request
228
+ * Creates request options for cancelTemporalWorkflow without sending the request
161
229
  */
162
- async getWorkflowRequestOpts(requestParameters: GetWorkflowRequest): Promise<runtime.RequestOpts> {
230
+ async cancelTemporalWorkflowRequestOpts(requestParameters: CancelTemporalWorkflowRequest): Promise<runtime.RequestOpts> {
163
231
  if (requestParameters['workflowId'] == null) {
164
232
  throw new runtime.RequiredError(
165
233
  'workflowId',
166
- 'Required parameter "workflowId" was null or undefined when calling getWorkflow().'
234
+ 'Required parameter "workflowId" was null or undefined when calling cancelTemporalWorkflow().'
167
235
  );
168
236
  }
169
237
 
@@ -181,46 +249,96 @@ export class WorkflowsApi extends runtime.BaseAPI implements WorkflowsApiInterfa
181
249
 
182
250
  return {
183
251
  path: urlPath,
184
- method: 'GET',
252
+ method: 'DELETE',
185
253
  headers: headerParameters,
186
254
  query: queryParameters,
187
255
  };
188
256
  }
189
257
 
190
258
  /**
191
- * Get single workflow detail with live Temporal status.
192
- * Get Workflow Handler
259
+ * Cancel any Temporal workflow owned by the caller\'s tenant. No status guard — this is a thin Temporal wrapper. Cancelling an already-terminal workflow is a no-op on the Temporal side.
260
+ * Cancel Temporal Workflow Handler
193
261
  */
194
- async getWorkflowRaw(requestParameters: GetWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowDetailResponse>> {
195
- const requestOptions = await this.getWorkflowRequestOpts(requestParameters);
262
+ async cancelTemporalWorkflowRaw(requestParameters: CancelTemporalWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowCancelResponse>> {
263
+ const requestOptions = await this.cancelTemporalWorkflowRequestOpts(requestParameters);
196
264
  const response = await this.request(requestOptions, initOverrides);
197
265
 
198
- return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowDetailResponseFromJSON(jsonValue));
266
+ return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowCancelResponseFromJSON(jsonValue));
199
267
  }
200
268
 
201
269
  /**
202
- * Get single workflow detail with live Temporal status.
203
- * Get Workflow Handler
270
+ * Cancel any Temporal workflow owned by the caller\'s tenant. No status guard — this is a thin Temporal wrapper. Cancelling an already-terminal workflow is a no-op on the Temporal side.
271
+ * Cancel Temporal Workflow Handler
204
272
  */
205
- async getWorkflow(requestParameters: GetWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowDetailResponse> {
206
- const response = await this.getWorkflowRaw(requestParameters, initOverrides);
273
+ async cancelTemporalWorkflow(requestParameters: CancelTemporalWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowCancelResponse> {
274
+ const response = await this.cancelTemporalWorkflowRaw(requestParameters, initOverrides);
207
275
  return await response.value();
208
276
  }
209
277
 
210
278
  /**
211
- * Creates request options for listWorkflows without sending the request
279
+ * Creates request options for dvWorkflowRerun without sending the request
212
280
  */
213
- async listWorkflowsRequestOpts(requestParameters: ListWorkflowsRequest): Promise<runtime.RequestOpts> {
281
+ async dvWorkflowRerunRequestOpts(requestParameters: DvWorkflowRerunRequest): Promise<runtime.RequestOpts> {
282
+ if (requestParameters['workflowId'] == null) {
283
+ throw new runtime.RequiredError(
284
+ 'workflowId',
285
+ 'Required parameter "workflowId" was null or undefined when calling dvWorkflowRerun().'
286
+ );
287
+ }
288
+
214
289
  const queryParameters: any = {};
215
290
 
216
- if (requestParameters['limit'] != null) {
217
- queryParameters['limit'] = requestParameters['limit'];
291
+ const headerParameters: runtime.HTTPHeaders = {};
292
+
293
+ if (requestParameters['authorization'] != null) {
294
+ headerParameters['authorization'] = String(requestParameters['authorization']);
218
295
  }
219
296
 
220
- if (requestParameters['offset'] != null) {
221
- queryParameters['offset'] = requestParameters['offset'];
297
+
298
+ let urlPath = `/v1/workflows/document_versions/{workflow_id}`;
299
+ urlPath = urlPath.replace(`{${"workflow_id"}}`, encodeURIComponent(String(requestParameters['workflowId'])));
300
+
301
+ return {
302
+ path: urlPath,
303
+ method: 'POST',
304
+ headers: headerParameters,
305
+ query: queryParameters,
306
+ };
307
+ }
308
+
309
+ /**
310
+ * Rerun a workflow. USER role requires ``can_write`` on the document path.
311
+ * Dv Workflow Rerun Handler
312
+ */
313
+ async dvWorkflowRerunRaw(requestParameters: DvWorkflowRerunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowActionResponse>> {
314
+ const requestOptions = await this.dvWorkflowRerunRequestOpts(requestParameters);
315
+ const response = await this.request(requestOptions, initOverrides);
316
+
317
+ return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowActionResponseFromJSON(jsonValue));
318
+ }
319
+
320
+ /**
321
+ * Rerun a workflow. USER role requires ``can_write`` on the document path.
322
+ * Dv Workflow Rerun Handler
323
+ */
324
+ async dvWorkflowRerun(requestParameters: DvWorkflowRerunRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowActionResponse> {
325
+ const response = await this.dvWorkflowRerunRaw(requestParameters, initOverrides);
326
+ return await response.value();
327
+ }
328
+
329
+ /**
330
+ * Creates request options for getDvWorkflow without sending the request
331
+ */
332
+ async getDvWorkflowRequestOpts(requestParameters: GetDvWorkflowRequest): Promise<runtime.RequestOpts> {
333
+ if (requestParameters['workflowId'] == null) {
334
+ throw new runtime.RequiredError(
335
+ 'workflowId',
336
+ 'Required parameter "workflowId" was null or undefined when calling getDvWorkflow().'
337
+ );
222
338
  }
223
339
 
340
+ const queryParameters: any = {};
341
+
224
342
  const headerParameters: runtime.HTTPHeaders = {};
225
343
 
226
344
  if (requestParameters['authorization'] != null) {
@@ -228,7 +346,8 @@ export class WorkflowsApi extends runtime.BaseAPI implements WorkflowsApiInterfa
228
346
  }
229
347
 
230
348
 
231
- let urlPath = `/v1/workflows`;
349
+ let urlPath = `/v1/workflows/document_versions/{workflow_id}`;
350
+ urlPath = urlPath.replace(`{${"workflow_id"}}`, encodeURIComponent(String(requestParameters['workflowId'])));
232
351
 
233
352
  return {
234
353
  path: urlPath,
@@ -239,47 +358,88 @@ export class WorkflowsApi extends runtime.BaseAPI implements WorkflowsApiInterfa
239
358
  }
240
359
 
241
360
  /**
242
- * List all workflows for the current tenant (paginated, DB-backed).
243
- * List Workflows Handler
361
+ * Get single workflow detail with live Temporal status.
362
+ * Get Dv Workflow Handler
244
363
  */
245
- async listWorkflowsRaw(requestParameters: ListWorkflowsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseWorkflowSummaryResponse>> {
246
- const requestOptions = await this.listWorkflowsRequestOpts(requestParameters);
364
+ async getDvWorkflowRaw(requestParameters: GetDvWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowDetailResponse>> {
365
+ const requestOptions = await this.getDvWorkflowRequestOpts(requestParameters);
247
366
  const response = await this.request(requestOptions, initOverrides);
248
367
 
249
- return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseWorkflowSummaryResponseFromJSON(jsonValue));
368
+ return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowDetailResponseFromJSON(jsonValue));
250
369
  }
251
370
 
252
371
  /**
253
- * List all workflows for the current tenant (paginated, DB-backed).
254
- * List Workflows Handler
372
+ * Get single workflow detail with live Temporal status.
373
+ * Get Dv Workflow Handler
255
374
  */
256
- async listWorkflows(requestParameters: ListWorkflowsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseWorkflowSummaryResponse> {
257
- const response = await this.listWorkflowsRaw(requestParameters, initOverrides);
375
+ async getDvWorkflow(requestParameters: GetDvWorkflowRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowDetailResponse> {
376
+ const response = await this.getDvWorkflowRaw(requestParameters, initOverrides);
258
377
  return await response.value();
259
378
  }
260
379
 
261
380
  /**
262
- * Creates request options for workflowAction without sending the request
381
+ * Creates request options for getTemporalWorkflowStatus without sending the request
263
382
  */
264
- async workflowActionRequestOpts(requestParameters: WorkflowActionRequest): Promise<runtime.RequestOpts> {
383
+ async getTemporalWorkflowStatusRequestOpts(requestParameters: GetTemporalWorkflowStatusRequest): Promise<runtime.RequestOpts> {
265
384
  if (requestParameters['workflowId'] == null) {
266
385
  throw new runtime.RequiredError(
267
386
  'workflowId',
268
- 'Required parameter "workflowId" was null or undefined when calling workflowAction().'
387
+ 'Required parameter "workflowId" was null or undefined when calling getTemporalWorkflowStatus().'
269
388
  );
270
389
  }
271
390
 
272
- if (requestParameters['action'] == null) {
273
- throw new runtime.RequiredError(
274
- 'action',
275
- 'Required parameter "action" was null or undefined when calling workflowAction().'
276
- );
391
+ const queryParameters: any = {};
392
+
393
+ const headerParameters: runtime.HTTPHeaders = {};
394
+
395
+ if (requestParameters['authorization'] != null) {
396
+ headerParameters['authorization'] = String(requestParameters['authorization']);
277
397
  }
278
398
 
399
+
400
+ let urlPath = `/v1/workflows/{workflow_id}`;
401
+ urlPath = urlPath.replace(`{${"workflow_id"}}`, encodeURIComponent(String(requestParameters['workflowId'])));
402
+
403
+ return {
404
+ path: urlPath,
405
+ method: 'GET',
406
+ headers: headerParameters,
407
+ query: queryParameters,
408
+ };
409
+ }
410
+
411
+ /**
412
+ * Get live Temporal status for any workflow owned by the caller\'s tenant.
413
+ * Get Temporal Workflow Status Handler
414
+ */
415
+ async getTemporalWorkflowStatusRaw(requestParameters: GetTemporalWorkflowStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TemporalWorkflowStatusResponse>> {
416
+ const requestOptions = await this.getTemporalWorkflowStatusRequestOpts(requestParameters);
417
+ const response = await this.request(requestOptions, initOverrides);
418
+
419
+ return new runtime.JSONApiResponse(response, (jsonValue) => TemporalWorkflowStatusResponseFromJSON(jsonValue));
420
+ }
421
+
422
+ /**
423
+ * Get live Temporal status for any workflow owned by the caller\'s tenant.
424
+ * Get Temporal Workflow Status Handler
425
+ */
426
+ async getTemporalWorkflowStatus(requestParameters: GetTemporalWorkflowStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TemporalWorkflowStatusResponse> {
427
+ const response = await this.getTemporalWorkflowStatusRaw(requestParameters, initOverrides);
428
+ return await response.value();
429
+ }
430
+
431
+ /**
432
+ * Creates request options for listDvWorkflows without sending the request
433
+ */
434
+ async listDvWorkflowsRequestOpts(requestParameters: ListDvWorkflowsRequest): Promise<runtime.RequestOpts> {
279
435
  const queryParameters: any = {};
280
436
 
281
- if (requestParameters['action'] != null) {
282
- queryParameters['action'] = requestParameters['action'];
437
+ if (requestParameters['limit'] != null) {
438
+ queryParameters['limit'] = requestParameters['limit'];
439
+ }
440
+
441
+ if (requestParameters['offset'] != null) {
442
+ queryParameters['offset'] = requestParameters['offset'];
283
443
  }
284
444
 
285
445
  const headerParameters: runtime.HTTPHeaders = {};
@@ -289,34 +449,33 @@ export class WorkflowsApi extends runtime.BaseAPI implements WorkflowsApiInterfa
289
449
  }
290
450
 
291
451
 
292
- let urlPath = `/v1/workflows/{workflow_id}`;
293
- urlPath = urlPath.replace(`{${"workflow_id"}}`, encodeURIComponent(String(requestParameters['workflowId'])));
452
+ let urlPath = `/v1/workflows/document_versions`;
294
453
 
295
454
  return {
296
455
  path: urlPath,
297
- method: 'POST',
456
+ method: 'GET',
298
457
  headers: headerParameters,
299
458
  query: queryParameters,
300
459
  };
301
460
  }
302
461
 
303
462
  /**
304
- * Cancel or rerun a workflow (OWNER/ADMIN only).
305
- * Workflow Action Handler
463
+ * List all workflows for the current tenant (paginated, DB-backed). ADMIN/OWNER see all workflows; USER sees only those under permitted paths.
464
+ * List Dv Workflows Handler
306
465
  */
307
- async workflowActionRaw(requestParameters: WorkflowActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WorkflowActionResponse>> {
308
- const requestOptions = await this.workflowActionRequestOpts(requestParameters);
466
+ async listDvWorkflowsRaw(requestParameters: ListDvWorkflowsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseWorkflowSummaryResponse>> {
467
+ const requestOptions = await this.listDvWorkflowsRequestOpts(requestParameters);
309
468
  const response = await this.request(requestOptions, initOverrides);
310
469
 
311
- return new runtime.JSONApiResponse(response, (jsonValue) => WorkflowActionResponseFromJSON(jsonValue));
470
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseWorkflowSummaryResponseFromJSON(jsonValue));
312
471
  }
313
472
 
314
473
  /**
315
- * Cancel or rerun a workflow (OWNER/ADMIN only).
316
- * Workflow Action Handler
474
+ * List all workflows for the current tenant (paginated, DB-backed). ADMIN/OWNER see all workflows; USER sees only those under permitted paths.
475
+ * List Dv Workflows Handler
317
476
  */
318
- async workflowAction(requestParameters: WorkflowActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WorkflowActionResponse> {
319
- const response = await this.workflowActionRaw(requestParameters, initOverrides);
477
+ async listDvWorkflows(requestParameters: ListDvWorkflowsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseWorkflowSummaryResponse> {
478
+ const response = await this.listDvWorkflowsRaw(requestParameters, initOverrides);
320
479
  return await response.value();
321
480
  }
322
481
 
@@ -0,0 +1,91 @@
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
+ import { mapValues } from '../runtime';
16
+ import type { PathPartAncestorItem } from './PathPartAncestorItem';
17
+ import {
18
+ PathPartAncestorItemFromJSON,
19
+ PathPartAncestorItemFromJSONTyped,
20
+ PathPartAncestorItemToJSON,
21
+ PathPartAncestorItemToJSONTyped,
22
+ } from './PathPartAncestorItem';
23
+
24
+ /**
25
+ * Response containing the ancestry chain from root to target (inclusive).
26
+ * @export
27
+ * @interface AncestryResponse
28
+ */
29
+ export interface AncestryResponse {
30
+ /**
31
+ * Ancestors ordered root-to-leaf
32
+ * @type {Array<PathPartAncestorItem>}
33
+ * @memberof AncestryResponse
34
+ */
35
+ ancestors: Array<PathPartAncestorItem>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the AncestryResponse interface.
40
+ */
41
+ export function instanceOfAncestryResponse(value: object): value is AncestryResponse {
42
+ if (!('ancestors' in value) || value['ancestors'] === undefined) return false;
43
+ return true;
44
+ }
45
+
46
+ export function AncestryResponseFromJSON(json: any): AncestryResponse {
47
+ return AncestryResponseFromJSONTyped(json, false);
48
+ }
49
+
50
+ export function AncestryResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AncestryResponse {
51
+ if (json == null) {
52
+ return json;
53
+ }
54
+ return {
55
+
56
+ 'ancestors': ((json['ancestors'] as Array<any>).map(PathPartAncestorItemFromJSON)),
57
+ };
58
+ }
59
+
60
+ export function AncestryResponseToJSON(json: any): AncestryResponse {
61
+ return AncestryResponseToJSONTyped(json, false);
62
+ }
63
+
64
+ export function AncestryResponseToJSONTyped(value?: AncestryResponse | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'ancestors': ((value['ancestors'] as Array<any>).map(PathPartAncestorItemToJSON)),
72
+ };
73
+ }
74
+
75
+ export const AncestryResponsePropertyValidationAttributesMap: {
76
+ [property: string]: {
77
+ maxLength?: number,
78
+ minLength?: number,
79
+ pattern?: string,
80
+ maximum?: number,
81
+ exclusiveMaximum?: boolean,
82
+ minimum?: number,
83
+ exclusiveMinimum?: boolean,
84
+ multipleOf?: number,
85
+ maxItems?: number,
86
+ minItems?: number,
87
+ uniqueItems?: boolean
88
+ }
89
+ } = {
90
+ }
91
+