@knowledge-stack/ksapi 1.15.0 → 1.17.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 (123) hide show
  1. package/.openapi-generator/FILES +11 -0
  2. package/README.md +2 -2
  3. package/dist/apis/DocumentVersionsApi.d.ts +32 -1
  4. package/dist/apis/DocumentVersionsApi.js +37 -0
  5. package/dist/apis/DocumentsApi.d.ts +44 -11
  6. package/dist/apis/DocumentsApi.js +65 -6
  7. package/dist/apis/FoldersApi.d.ts +10 -10
  8. package/dist/apis/FoldersApi.js +6 -6
  9. package/dist/apis/TenantsApi.d.ts +4 -4
  10. package/dist/apis/TenantsApi.js +2 -2
  11. package/dist/apis/WorkflowsApi.d.ts +117 -0
  12. package/dist/apis/WorkflowsApi.js +137 -0
  13. package/dist/apis/index.d.ts +1 -0
  14. package/dist/apis/index.js +1 -0
  15. package/dist/esm/apis/DocumentVersionsApi.d.ts +32 -1
  16. package/dist/esm/apis/DocumentVersionsApi.js +38 -1
  17. package/dist/esm/apis/DocumentsApi.d.ts +44 -11
  18. package/dist/esm/apis/DocumentsApi.js +66 -7
  19. package/dist/esm/apis/FoldersApi.d.ts +10 -10
  20. package/dist/esm/apis/FoldersApi.js +6 -6
  21. package/dist/esm/apis/TenantsApi.d.ts +4 -4
  22. package/dist/esm/apis/TenantsApi.js +2 -2
  23. package/dist/esm/apis/WorkflowsApi.d.ts +117 -0
  24. package/dist/esm/apis/WorkflowsApi.js +133 -0
  25. package/dist/esm/apis/index.d.ts +1 -0
  26. package/dist/esm/apis/index.js +1 -0
  27. package/dist/esm/models/CreateDocumentRequest.d.ts +2 -2
  28. package/dist/esm/models/CreateDocumentRequest.js +3 -3
  29. package/dist/esm/models/CreateFolderRequest.d.ts +2 -2
  30. package/dist/esm/models/CreateFolderRequest.js +3 -3
  31. package/dist/esm/models/DocumentResponse.d.ts +2 -2
  32. package/dist/esm/models/DocumentResponse.js +3 -3
  33. package/dist/esm/models/DocumentVersionMetadata.d.ts +89 -0
  34. package/dist/esm/models/DocumentVersionMetadata.js +55 -0
  35. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +87 -0
  36. package/dist/esm/models/DocumentVersionMetadataUpdate.js +55 -0
  37. package/dist/esm/models/DocumentVersionResponse.d.ts +13 -0
  38. package/dist/esm/models/DocumentVersionResponse.js +5 -0
  39. package/dist/esm/models/FolderResponse.d.ts +2 -2
  40. package/dist/esm/models/FolderResponse.js +3 -3
  41. package/dist/esm/models/IngestDocumentResponse.d.ts +59 -0
  42. package/dist/esm/models/IngestDocumentResponse.js +52 -0
  43. package/dist/esm/models/PaginatedResponseWorkflowSummaryResponse.d.ts +66 -0
  44. package/dist/esm/models/PaginatedResponseWorkflowSummaryResponse.js +70 -0
  45. package/dist/esm/models/PipelineState.d.ts +78 -0
  46. package/dist/esm/models/PipelineState.js +57 -0
  47. package/dist/esm/models/PipelineStatus.d.ts +28 -0
  48. package/dist/esm/models/PipelineStatus.js +46 -0
  49. package/dist/esm/models/UpdateDocumentRequest.d.ts +2 -2
  50. package/dist/esm/models/UpdateDocumentRequest.js +2 -2
  51. package/dist/esm/models/UpdateFolderRequest.d.ts +2 -2
  52. package/dist/esm/models/UpdateFolderRequest.js +2 -2
  53. package/dist/esm/models/WorkflowAction.d.ts +25 -0
  54. package/dist/esm/models/WorkflowAction.js +43 -0
  55. package/dist/esm/models/WorkflowActionResponse.d.ts +59 -0
  56. package/dist/esm/models/WorkflowActionResponse.js +52 -0
  57. package/dist/esm/models/WorkflowDetailResponse.d.ts +132 -0
  58. package/dist/esm/models/WorkflowDetailResponse.js +93 -0
  59. package/dist/esm/models/WorkflowSummaryResponse.d.ts +90 -0
  60. package/dist/esm/models/WorkflowSummaryResponse.js +69 -0
  61. package/dist/esm/models/index.d.ts +10 -0
  62. package/dist/esm/models/index.js +10 -0
  63. package/dist/models/CreateDocumentRequest.d.ts +2 -2
  64. package/dist/models/CreateDocumentRequest.js +3 -3
  65. package/dist/models/CreateFolderRequest.d.ts +2 -2
  66. package/dist/models/CreateFolderRequest.js +3 -3
  67. package/dist/models/DocumentResponse.d.ts +2 -2
  68. package/dist/models/DocumentResponse.js +3 -3
  69. package/dist/models/DocumentVersionMetadata.d.ts +89 -0
  70. package/dist/models/DocumentVersionMetadata.js +63 -0
  71. package/dist/models/DocumentVersionMetadataUpdate.d.ts +87 -0
  72. package/dist/models/DocumentVersionMetadataUpdate.js +63 -0
  73. package/dist/models/DocumentVersionResponse.d.ts +13 -0
  74. package/dist/models/DocumentVersionResponse.js +5 -0
  75. package/dist/models/FolderResponse.d.ts +2 -2
  76. package/dist/models/FolderResponse.js +3 -3
  77. package/dist/models/IngestDocumentResponse.d.ts +59 -0
  78. package/dist/models/IngestDocumentResponse.js +60 -0
  79. package/dist/models/PaginatedResponseWorkflowSummaryResponse.d.ts +66 -0
  80. package/dist/models/PaginatedResponseWorkflowSummaryResponse.js +78 -0
  81. package/dist/models/PipelineState.d.ts +78 -0
  82. package/dist/models/PipelineState.js +65 -0
  83. package/dist/models/PipelineStatus.d.ts +28 -0
  84. package/dist/models/PipelineStatus.js +54 -0
  85. package/dist/models/UpdateDocumentRequest.d.ts +2 -2
  86. package/dist/models/UpdateDocumentRequest.js +2 -2
  87. package/dist/models/UpdateFolderRequest.d.ts +2 -2
  88. package/dist/models/UpdateFolderRequest.js +2 -2
  89. package/dist/models/WorkflowAction.d.ts +25 -0
  90. package/dist/models/WorkflowAction.js +51 -0
  91. package/dist/models/WorkflowActionResponse.d.ts +59 -0
  92. package/dist/models/WorkflowActionResponse.js +60 -0
  93. package/dist/models/WorkflowDetailResponse.d.ts +132 -0
  94. package/dist/models/WorkflowDetailResponse.js +101 -0
  95. package/dist/models/WorkflowSummaryResponse.d.ts +90 -0
  96. package/dist/models/WorkflowSummaryResponse.js +77 -0
  97. package/dist/models/index.d.ts +10 -0
  98. package/dist/models/index.js +10 -0
  99. package/package.json +1 -1
  100. package/src/apis/DocumentVersionsApi.ts +76 -0
  101. package/src/apis/DocumentsApi.ts +115 -12
  102. package/src/apis/FoldersApi.ts +12 -12
  103. package/src/apis/TenantsApi.ts +4 -4
  104. package/src/apis/WorkflowsApi.ts +249 -0
  105. package/src/apis/index.ts +1 -0
  106. package/src/models/CreateDocumentRequest.ts +5 -5
  107. package/src/models/CreateFolderRequest.ts +5 -5
  108. package/src/models/DocumentResponse.ts +5 -5
  109. package/src/models/DocumentVersionMetadata.ts +143 -0
  110. package/src/models/DocumentVersionMetadataUpdate.ts +141 -0
  111. package/src/models/DocumentVersionResponse.ts +24 -0
  112. package/src/models/FolderResponse.ts +5 -5
  113. package/src/models/IngestDocumentResponse.ts +101 -0
  114. package/src/models/PaginatedResponseWorkflowSummaryResponse.ts +130 -0
  115. package/src/models/PipelineState.ts +134 -0
  116. package/src/models/PipelineStatus.ts +56 -0
  117. package/src/models/UpdateDocumentRequest.ts +4 -4
  118. package/src/models/UpdateFolderRequest.ts +4 -4
  119. package/src/models/WorkflowAction.ts +53 -0
  120. package/src/models/WorkflowActionResponse.ts +101 -0
  121. package/src/models/WorkflowDetailResponse.ts +215 -0
  122. package/src/models/WorkflowSummaryResponse.ts +154 -0
  123. package/src/models/index.ts +10 -0
@@ -19,6 +19,7 @@ src/apis/ThreadMessagesApi.ts
19
19
  src/apis/ThreadsApi.ts
20
20
  src/apis/UserPermissionsApi.ts
21
21
  src/apis/UsersApi.ts
22
+ src/apis/WorkflowsApi.ts
22
23
  src/apis/index.ts
23
24
  src/index.ts
24
25
  src/models/ChunkLineageResponse.ts
@@ -42,6 +43,8 @@ src/models/DocumentContentPathPart.ts
42
43
  src/models/DocumentOrigin.ts
43
44
  src/models/DocumentResponse.ts
44
45
  src/models/DocumentType.ts
46
+ src/models/DocumentVersionMetadata.ts
47
+ src/models/DocumentVersionMetadataUpdate.ts
45
48
  src/models/DocumentVersionResponse.ts
46
49
  src/models/EmailSentResponse.ts
47
50
  src/models/EmailVerificationRequest.ts
@@ -51,6 +54,7 @@ src/models/FolderResponse.ts
51
54
  src/models/HTTPValidationError.ts
52
55
  src/models/HealthCheckResponse.ts
53
56
  src/models/IdpType.ts
57
+ src/models/IngestDocumentResponse.ts
54
58
  src/models/InviteResponse.ts
55
59
  src/models/InviteStatus.ts
56
60
  src/models/InviteUserRequest.ts
@@ -72,6 +76,7 @@ src/models/PaginatedResponseTenantResponse.ts
72
76
  src/models/PaginatedResponseTenantUserInTenantResponse.ts
73
77
  src/models/PaginatedResponseThreadMessageResponse.ts
74
78
  src/models/PaginatedResponseThreadResponse.ts
79
+ src/models/PaginatedResponseWorkflowSummaryResponse.ts
75
80
  src/models/PartType.ts
76
81
  src/models/PasswordResetRequest.ts
77
82
  src/models/PasswordResetWithTokenRequest.ts
@@ -79,6 +84,8 @@ src/models/PathOrder.ts
79
84
  src/models/PathPartResponse.ts
80
85
  src/models/PermissionCapability.ts
81
86
  src/models/PermissionResponse.ts
87
+ src/models/PipelineState.ts
88
+ src/models/PipelineStatus.ts
82
89
  src/models/Polygon.ts
83
90
  src/models/PolygonReference.ts
84
91
  src/models/RootResponse.ts
@@ -105,6 +112,10 @@ src/models/UpdateUserRequest.ts
105
112
  src/models/UserResponse.ts
106
113
  src/models/ValidationError.ts
107
114
  src/models/ValidationErrorLocInner.ts
115
+ src/models/WorkflowAction.ts
116
+ src/models/WorkflowActionResponse.ts
117
+ src/models/WorkflowDetailResponse.ts
118
+ src/models/WorkflowSummaryResponse.ts
108
119
  src/models/index.ts
109
120
  src/runtime.ts
110
121
  tsconfig.esm.json
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @knowledge-stack/ksapi@1.15.0
1
+ ## @knowledge-stack/ksapi@1.17.0
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @knowledge-stack/ksapi@1.15.0 --save
39
+ npm install @knowledge-stack/ksapi@1.17.0 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { DocumentVersionResponse, PaginatedResponseDocumentContentPathPart, PaginatedResponseDocumentVersionResponse } from '../models/index';
13
+ import type { DocumentVersionMetadataUpdate, DocumentVersionResponse, PaginatedResponseDocumentContentPathPart, PaginatedResponseDocumentVersionResponse } from '../models/index';
14
14
  export interface CreateDocumentVersionRequest {
15
15
  documentId: string;
16
16
  ksUat?: string;
@@ -36,6 +36,11 @@ export interface ListDocumentVersionsRequest {
36
36
  offset?: number;
37
37
  ksUat?: string;
38
38
  }
39
+ export interface UpdateDocumentVersionMetadataRequest {
40
+ versionId: string;
41
+ documentVersionMetadataUpdate: DocumentVersionMetadataUpdate;
42
+ ksUat?: string;
43
+ }
39
44
  /**
40
45
  * DocumentVersionsApi - interface
41
46
  *
@@ -123,6 +128,22 @@ export interface DocumentVersionsApiInterface {
123
128
  * List Document Versions Handler
124
129
  */
125
130
  listDocumentVersions(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentVersionResponse>;
131
+ /**
132
+ * Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
133
+ * @summary Update Document Version Metadata Handler
134
+ * @param {string} versionId DocumentVersion ID
135
+ * @param {DocumentVersionMetadataUpdate} documentVersionMetadataUpdate
136
+ * @param {string} [ksUat]
137
+ * @param {*} [options] Override http request option.
138
+ * @throws {RequiredError}
139
+ * @memberof DocumentVersionsApiInterface
140
+ */
141
+ updateDocumentVersionMetadataRaw(requestParameters: UpdateDocumentVersionMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
142
+ /**
143
+ * Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
144
+ * Update Document Version Metadata Handler
145
+ */
146
+ updateDocumentVersionMetadata(requestParameters: UpdateDocumentVersionMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
126
147
  }
127
148
  /**
128
149
  *
@@ -178,4 +199,14 @@ export declare class DocumentVersionsApi extends runtime.BaseAPI implements Docu
178
199
  * List Document Versions Handler
179
200
  */
180
201
  listDocumentVersions(requestParameters: ListDocumentVersionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentVersionResponse>;
202
+ /**
203
+ * Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
204
+ * Update Document Version Metadata Handler
205
+ */
206
+ updateDocumentVersionMetadataRaw(requestParameters: UpdateDocumentVersionMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionResponse>>;
207
+ /**
208
+ * Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
209
+ * Update Document Version Metadata Handler
210
+ */
211
+ updateDocumentVersionMetadata(requestParameters: UpdateDocumentVersionMetadataRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
181
212
  }
@@ -205,5 +205,42 @@ class DocumentVersionsApi extends runtime.BaseAPI {
205
205
  return yield response.value();
206
206
  });
207
207
  }
208
+ /**
209
+ * Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
210
+ * Update Document Version Metadata Handler
211
+ */
212
+ updateDocumentVersionMetadataRaw(requestParameters, initOverrides) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ if (requestParameters['versionId'] == null) {
215
+ throw new runtime.RequiredError('versionId', 'Required parameter "versionId" was null or undefined when calling updateDocumentVersionMetadata().');
216
+ }
217
+ if (requestParameters['documentVersionMetadataUpdate'] == null) {
218
+ throw new runtime.RequiredError('documentVersionMetadataUpdate', 'Required parameter "documentVersionMetadataUpdate" was null or undefined when calling updateDocumentVersionMetadata().');
219
+ }
220
+ const queryParameters = {};
221
+ const headerParameters = {};
222
+ headerParameters['Content-Type'] = 'application/json';
223
+ let urlPath = `/v1/document_versions/{version_id}/metadata`;
224
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
225
+ const response = yield this.request({
226
+ path: urlPath,
227
+ method: 'PATCH',
228
+ headers: headerParameters,
229
+ query: queryParameters,
230
+ body: (0, index_1.DocumentVersionMetadataUpdateToJSON)(requestParameters['documentVersionMetadataUpdate']),
231
+ }, initOverrides);
232
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.DocumentVersionResponseFromJSON)(jsonValue));
233
+ });
234
+ }
235
+ /**
236
+ * Merge metadata fields into an existing document version\'s metadata. Only non-null fields in the request body are merged; existing metadata fields not present in the request are preserved.
237
+ * Update Document Version Metadata Handler
238
+ */
239
+ updateDocumentVersionMetadata(requestParameters, initOverrides) {
240
+ return __awaiter(this, void 0, void 0, function* () {
241
+ const response = yield this.updateDocumentVersionMetadataRaw(requestParameters, initOverrides);
242
+ return yield response.value();
243
+ });
244
+ }
208
245
  }
209
246
  exports.DocumentVersionsApi = DocumentVersionsApi;
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { CreateDocumentRequest, DocumentResponse, PaginatedResponseDocumentResponse, PathOrder, UpdateDocumentRequest } from '../models/index';
13
+ import type { CreateDocumentRequest, DocumentResponse, IngestDocumentResponse, PaginatedResponseDocumentResponse, PathOrder, UpdateDocumentRequest } from '../models/index';
14
14
  export interface CreateDocumentOperationRequest {
15
15
  createDocumentRequest: CreateDocumentRequest;
16
16
  ksUat?: string;
@@ -23,8 +23,14 @@ export interface GetDocumentRequest {
23
23
  documentId: string;
24
24
  ksUat?: string;
25
25
  }
26
+ export interface IngestDocumentRequest {
27
+ file: Blob;
28
+ folderId: string;
29
+ ksUat?: string;
30
+ name?: string;
31
+ }
26
32
  export interface ListDocumentsRequest {
27
- parentId?: string;
33
+ parentFolderId?: string;
28
34
  sortOrder?: PathOrder;
29
35
  limit?: number;
30
36
  offset?: number;
@@ -88,9 +94,26 @@ export interface DocumentsApiInterface {
88
94
  */
89
95
  getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
90
96
  /**
91
- * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
97
+ * Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
98
+ * @summary Ingest Document Handler
99
+ * @param {Blob} file
100
+ * @param {string} folderId Parent folder ID
101
+ * @param {string} [ksUat]
102
+ * @param {string} [name] Document name (defaults to filename)
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ * @memberof DocumentsApiInterface
106
+ */
107
+ ingestDocumentRaw(requestParameters: IngestDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>>;
108
+ /**
109
+ * Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
110
+ * Ingest Document Handler
111
+ */
112
+ ingestDocument(requestParameters: IngestDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
113
+ /**
114
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_folder_id is not provided, lists documents in the root folder.
92
115
  * @summary List Documents Handler
93
- * @param {string} [parentId] Parent folder PathPart ID (defaults to root)
116
+ * @param {string} [parentFolderId] Parent folder ID (defaults to root)
94
117
  * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
95
118
  * @param {number} [limit] Number of items per page
96
119
  * @param {number} [offset] Number of items to skip
@@ -101,12 +124,12 @@ export interface DocumentsApiInterface {
101
124
  */
102
125
  listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>>;
103
126
  /**
104
- * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
127
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_folder_id is not provided, lists documents in the root folder.
105
128
  * List Documents Handler
106
129
  */
107
130
  listDocuments(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse>;
108
131
  /**
109
- * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
132
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_folder_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
110
133
  * @summary Update Document Handler
111
134
  * @param {string} documentId
112
135
  * @param {UpdateDocumentRequest} updateDocumentRequest
@@ -117,7 +140,7 @@ export interface DocumentsApiInterface {
117
140
  */
118
141
  updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
119
142
  /**
120
- * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
143
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_folder_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
121
144
  * Update Document Handler
122
145
  */
123
146
  updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
@@ -157,22 +180,32 @@ export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsAp
157
180
  */
158
181
  getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
159
182
  /**
160
- * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
183
+ * Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
184
+ * Ingest Document Handler
185
+ */
186
+ ingestDocumentRaw(requestParameters: IngestDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>>;
187
+ /**
188
+ * Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
189
+ * Ingest Document Handler
190
+ */
191
+ ingestDocument(requestParameters: IngestDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
192
+ /**
193
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_folder_id is not provided, lists documents in the root folder.
161
194
  * List Documents Handler
162
195
  */
163
196
  listDocumentsRaw(requestParameters: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentResponse>>;
164
197
  /**
165
- * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
198
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_folder_id is not provided, lists documents in the root folder.
166
199
  * List Documents Handler
167
200
  */
168
201
  listDocuments(requestParameters?: ListDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentResponse>;
169
202
  /**
170
- * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
203
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_folder_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
171
204
  * Update Document Handler
172
205
  */
173
206
  updateDocumentRaw(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>>;
174
207
  /**
175
- * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
208
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_folder_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
176
209
  * Update Document Handler
177
210
  */
178
211
  updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
@@ -126,14 +126,73 @@ class DocumentsApi extends runtime.BaseAPI {
126
126
  });
127
127
  }
128
128
  /**
129
- * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
129
+ * Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
130
+ * Ingest Document Handler
131
+ */
132
+ ingestDocumentRaw(requestParameters, initOverrides) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ if (requestParameters['file'] == null) {
135
+ throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling ingestDocument().');
136
+ }
137
+ if (requestParameters['folderId'] == null) {
138
+ throw new runtime.RequiredError('folderId', 'Required parameter "folderId" was null or undefined when calling ingestDocument().');
139
+ }
140
+ const queryParameters = {};
141
+ const headerParameters = {};
142
+ const consumes = [
143
+ { contentType: 'multipart/form-data' },
144
+ ];
145
+ // @ts-ignore: canConsumeForm may be unused
146
+ const canConsumeForm = runtime.canConsumeForm(consumes);
147
+ let formParams;
148
+ let useForm = false;
149
+ // use FormData to transmit files using content-type "multipart/form-data"
150
+ useForm = canConsumeForm;
151
+ if (useForm) {
152
+ formParams = new FormData();
153
+ }
154
+ else {
155
+ formParams = new URLSearchParams();
156
+ }
157
+ if (requestParameters['file'] != null) {
158
+ formParams.append('file', requestParameters['file']);
159
+ }
160
+ if (requestParameters['folderId'] != null) {
161
+ formParams.append('folder_id', requestParameters['folderId']);
162
+ }
163
+ if (requestParameters['name'] != null) {
164
+ formParams.append('name', requestParameters['name']);
165
+ }
166
+ let urlPath = `/v1/documents/ingest`;
167
+ const response = yield this.request({
168
+ path: urlPath,
169
+ method: 'POST',
170
+ headers: headerParameters,
171
+ query: queryParameters,
172
+ body: formParams,
173
+ }, initOverrides);
174
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.IngestDocumentResponseFromJSON)(jsonValue));
175
+ });
176
+ }
177
+ /**
178
+ * Upload a file, create document + version, and trigger ingestion workflow. Returns 201 with the Temporal workflow ID. Design decision — S3 upload happens *before* the DB write: We pre-generate document and version UUIDs, upload the source file to S3, and only then persist the DB records. If the DB write fails, an orphaned S3 object is left behind (acceptable storage cost cleaned up by the S3 deletion cronjob). The reverse — a committed DB record pointing to a missing S3 object — would crash downstream pipeline activities that expect the file to exist.
179
+ * Ingest Document Handler
180
+ */
181
+ ingestDocument(requestParameters, initOverrides) {
182
+ return __awaiter(this, void 0, void 0, function* () {
183
+ const response = yield this.ingestDocumentRaw(requestParameters, initOverrides);
184
+ return yield response.value();
185
+ });
186
+ }
187
+ /**
188
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_folder_id is not provided, lists documents in the root folder.
130
189
  * List Documents Handler
131
190
  */
132
191
  listDocumentsRaw(requestParameters, initOverrides) {
133
192
  return __awaiter(this, void 0, void 0, function* () {
134
193
  const queryParameters = {};
135
- if (requestParameters['parentId'] != null) {
136
- queryParameters['parent_id'] = requestParameters['parentId'];
194
+ if (requestParameters['parentFolderId'] != null) {
195
+ queryParameters['parent_folder_id'] = requestParameters['parentFolderId'];
137
196
  }
138
197
  if (requestParameters['sortOrder'] != null) {
139
198
  queryParameters['sort_order'] = requestParameters['sortOrder'];
@@ -156,7 +215,7 @@ class DocumentsApi extends runtime.BaseAPI {
156
215
  });
157
216
  }
158
217
  /**
159
- * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_id is not provided, lists documents in the root folder.
218
+ * List documents in a folder. Returns only direct child documents (depth=1) of the specified parent folder. If parent_folder_id is not provided, lists documents in the root folder.
160
219
  * List Documents Handler
161
220
  */
162
221
  listDocuments() {
@@ -166,7 +225,7 @@ class DocumentsApi extends runtime.BaseAPI {
166
225
  });
167
226
  }
168
227
  /**
169
- * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
228
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_folder_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
170
229
  * Update Document Handler
171
230
  */
172
231
  updateDocumentRaw(requestParameters, initOverrides) {
@@ -193,7 +252,7 @@ class DocumentsApi extends runtime.BaseAPI {
193
252
  });
194
253
  }
195
254
  /**
196
- * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
255
+ * Update a document (rename, move, and/or change active version). To rename: provide `name` field. To move: provide `parent_folder_id` field. To change active version: provide `active_version_id` field. All can be done in a single request.
197
256
  * Update Document Handler
198
257
  */
199
258
  updateDocument(requestParameters, initOverrides) {
@@ -32,7 +32,7 @@ export interface ListFolderContentsRequest {
32
32
  ksUat?: string;
33
33
  }
34
34
  export interface ListFoldersRequest {
35
- parentId?: string;
35
+ parentFolderId?: string;
36
36
  sortOrder?: PathOrder;
37
37
  limit?: number;
38
38
  offset?: number;
@@ -115,9 +115,9 @@ export interface FoldersApiInterface {
115
115
  */
116
116
  listFolderContents(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseFolderDocumentResponse>;
117
117
  /**
118
- * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_id is not provided, lists folders in the root folder.
118
+ * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_folder_id is not provided, lists folders in the root folder.
119
119
  * @summary List Folders Handler
120
- * @param {string} [parentId] Parent folder PathPart ID (defaults to root)
120
+ * @param {string} [parentFolderId] Parent folder ID (defaults to root)
121
121
  * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
122
122
  * @param {number} [limit] Number of items per page
123
123
  * @param {number} [offset] Number of items to skip
@@ -128,12 +128,12 @@ export interface FoldersApiInterface {
128
128
  */
129
129
  listFoldersRaw(requestParameters: ListFoldersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseFolderResponse>>;
130
130
  /**
131
- * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_id is not provided, lists folders in the root folder.
131
+ * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_folder_id is not provided, lists folders in the root folder.
132
132
  * List Folders Handler
133
133
  */
134
134
  listFolders(requestParameters: ListFoldersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseFolderResponse>;
135
135
  /**
136
- * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_id` field. Both can be done in a single request.
136
+ * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_folder_id` field. Both can be done in a single request.
137
137
  * @summary Update Folder Handler
138
138
  * @param {string} folderId
139
139
  * @param {UpdateFolderRequest} updateFolderRequest
@@ -144,7 +144,7 @@ export interface FoldersApiInterface {
144
144
  */
145
145
  updateFolderRaw(requestParameters: UpdateFolderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FolderResponse>>;
146
146
  /**
147
- * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_id` field. Both can be done in a single request.
147
+ * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_folder_id` field. Both can be done in a single request.
148
148
  * Update Folder Handler
149
149
  */
150
150
  updateFolder(requestParameters: UpdateFolderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FolderResponse>;
@@ -194,22 +194,22 @@ export declare class FoldersApi extends runtime.BaseAPI implements FoldersApiInt
194
194
  */
195
195
  listFolderContents(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseFolderDocumentResponse>;
196
196
  /**
197
- * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_id is not provided, lists folders in the root folder.
197
+ * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_folder_id is not provided, lists folders in the root folder.
198
198
  * List Folders Handler
199
199
  */
200
200
  listFoldersRaw(requestParameters: ListFoldersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseFolderResponse>>;
201
201
  /**
202
- * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_id is not provided, lists folders in the root folder.
202
+ * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_folder_id is not provided, lists folders in the root folder.
203
203
  * List Folders Handler
204
204
  */
205
205
  listFolders(requestParameters?: ListFoldersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseFolderResponse>;
206
206
  /**
207
- * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_id` field. Both can be done in a single request.
207
+ * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_folder_id` field. Both can be done in a single request.
208
208
  * Update Folder Handler
209
209
  */
210
210
  updateFolderRaw(requestParameters: UpdateFolderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FolderResponse>>;
211
211
  /**
212
- * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_id` field. Both can be done in a single request.
212
+ * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_folder_id` field. Both can be done in a single request.
213
213
  * Update Folder Handler
214
214
  */
215
215
  updateFolder(requestParameters: UpdateFolderOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FolderResponse>;
@@ -170,14 +170,14 @@ class FoldersApi extends runtime.BaseAPI {
170
170
  });
171
171
  }
172
172
  /**
173
- * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_id is not provided, lists folders in the root folder.
173
+ * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_folder_id is not provided, lists folders in the root folder.
174
174
  * List Folders Handler
175
175
  */
176
176
  listFoldersRaw(requestParameters, initOverrides) {
177
177
  return __awaiter(this, void 0, void 0, function* () {
178
178
  const queryParameters = {};
179
- if (requestParameters['parentId'] != null) {
180
- queryParameters['parent_id'] = requestParameters['parentId'];
179
+ if (requestParameters['parentFolderId'] != null) {
180
+ queryParameters['parent_folder_id'] = requestParameters['parentFolderId'];
181
181
  }
182
182
  if (requestParameters['sortOrder'] != null) {
183
183
  queryParameters['sort_order'] = requestParameters['sortOrder'];
@@ -200,7 +200,7 @@ class FoldersApi extends runtime.BaseAPI {
200
200
  });
201
201
  }
202
202
  /**
203
- * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_id is not provided, lists folders in the root folder.
203
+ * List child folders of a parent folder. Returns only direct child folders (depth=1) of the specified parent. If parent_folder_id is not provided, lists folders in the root folder.
204
204
  * List Folders Handler
205
205
  */
206
206
  listFolders() {
@@ -210,7 +210,7 @@ class FoldersApi extends runtime.BaseAPI {
210
210
  });
211
211
  }
212
212
  /**
213
- * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_id` field. Both can be done in a single request.
213
+ * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_folder_id` field. Both can be done in a single request.
214
214
  * Update Folder Handler
215
215
  */
216
216
  updateFolderRaw(requestParameters, initOverrides) {
@@ -237,7 +237,7 @@ class FoldersApi extends runtime.BaseAPI {
237
237
  });
238
238
  }
239
239
  /**
240
- * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_id` field. Both can be done in a single request.
240
+ * Update a folder (rename and/or move). To rename: provide `name` field. To move: provide `parent_folder_id` field. Both can be done in a single request.
241
241
  * Update Folder Handler
242
242
  */
243
243
  updateFolder(requestParameters, initOverrides) {
@@ -62,7 +62,7 @@ export interface TenantsApiInterface {
62
62
  */
63
63
  createTenant(requestParameters: CreateTenantOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantResponse>;
64
64
  /**
65
- * Delete a tenant. Requires OWNER role in the tenant.
65
+ * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
66
66
  * @summary Delete Tenant
67
67
  * @param {string} tenantId
68
68
  * @param {string} [ksUat]
@@ -72,7 +72,7 @@ export interface TenantsApiInterface {
72
72
  */
73
73
  deleteTenantRaw(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
74
74
  /**
75
- * Delete a tenant. Requires OWNER role in the tenant.
75
+ * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
76
76
  * Delete Tenant
77
77
  */
78
78
  deleteTenant(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -156,12 +156,12 @@ export declare class TenantsApi extends runtime.BaseAPI implements TenantsApiInt
156
156
  */
157
157
  createTenant(requestParameters: CreateTenantOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TenantResponse>;
158
158
  /**
159
- * Delete a tenant. Requires OWNER role in the tenant.
159
+ * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
160
160
  * Delete Tenant
161
161
  */
162
162
  deleteTenantRaw(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
163
163
  /**
164
- * Delete a tenant. Requires OWNER role in the tenant.
164
+ * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
165
165
  * Delete Tenant
166
166
  */
167
167
  deleteTenant(requestParameters: DeleteTenantRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
@@ -63,7 +63,7 @@ class TenantsApi extends runtime.BaseAPI {
63
63
  });
64
64
  }
65
65
  /**
66
- * Delete a tenant. Requires OWNER role in the tenant.
66
+ * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
67
67
  * Delete Tenant
68
68
  */
69
69
  deleteTenantRaw(requestParameters, initOverrides) {
@@ -85,7 +85,7 @@ class TenantsApi extends runtime.BaseAPI {
85
85
  });
86
86
  }
87
87
  /**
88
- * Delete a tenant. Requires OWNER role in the tenant.
88
+ * Delete a tenant. Requires OWNER role in the tenant. Deletes the tenant\'s S3 bucket after the DB transaction commits.
89
89
  * Delete Tenant
90
90
  */
91
91
  deleteTenant(requestParameters, initOverrides) {