@knowledge-stack/ksapi 1.7.0 → 1.9.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 (103) hide show
  1. package/.openapi-generator/FILES +14 -0
  2. package/README.md +2 -2
  3. package/dist/apis/ChunksApi.d.ts +175 -0
  4. package/dist/apis/ChunksApi.js +203 -0
  5. package/dist/apis/DocumentVersionsApi.d.ts +36 -1
  6. package/dist/apis/DocumentVersionsApi.js +41 -0
  7. package/dist/apis/FoldersApi.d.ts +38 -1
  8. package/dist/apis/FoldersApi.js +44 -0
  9. package/dist/apis/PathPartsApi.d.ts +4 -6
  10. package/dist/apis/PathPartsApi.js +2 -5
  11. package/dist/apis/index.d.ts +1 -0
  12. package/dist/apis/index.js +1 -0
  13. package/dist/esm/apis/ChunksApi.d.ts +175 -0
  14. package/dist/esm/apis/ChunksApi.js +199 -0
  15. package/dist/esm/apis/DocumentVersionsApi.d.ts +36 -1
  16. package/dist/esm/apis/DocumentVersionsApi.js +42 -1
  17. package/dist/esm/apis/FoldersApi.d.ts +38 -1
  18. package/dist/esm/apis/FoldersApi.js +45 -1
  19. package/dist/esm/apis/PathPartsApi.d.ts +4 -6
  20. package/dist/esm/apis/PathPartsApi.js +2 -5
  21. package/dist/esm/apis/index.d.ts +1 -0
  22. package/dist/esm/apis/index.js +1 -0
  23. package/dist/esm/models/ChunkMetadataInput.d.ts +48 -0
  24. package/dist/esm/models/ChunkMetadataInput.js +43 -0
  25. package/dist/esm/models/ChunkMetadataOutput.d.ts +48 -0
  26. package/dist/esm/models/ChunkMetadataOutput.js +43 -0
  27. package/dist/esm/models/ChunkResponse.d.ts +115 -0
  28. package/dist/esm/models/ChunkResponse.js +86 -0
  29. package/dist/esm/models/ChunkType.d.ts +27 -0
  30. package/dist/esm/models/ChunkType.js +45 -0
  31. package/dist/esm/models/CreateChunkRequest.d.ts +73 -0
  32. package/dist/esm/models/CreateChunkRequest.js +64 -0
  33. package/dist/esm/models/DocumentContentPathPart.d.ts +119 -0
  34. package/dist/esm/models/DocumentContentPathPart.js +83 -0
  35. package/dist/esm/models/FolderDocumentResponse.d.ts +138 -0
  36. package/dist/esm/models/FolderDocumentResponse.js +88 -0
  37. package/dist/esm/models/PaginatedResponseDocumentContentPathPart.d.ts +66 -0
  38. package/dist/esm/models/PaginatedResponseDocumentContentPathPart.js +70 -0
  39. package/dist/esm/models/PaginatedResponseFolderDocumentResponse.d.ts +66 -0
  40. package/dist/esm/models/PaginatedResponseFolderDocumentResponse.js +70 -0
  41. package/dist/esm/models/PasswordResetWithTokenRequest.d.ts +2 -8
  42. package/dist/esm/models/PasswordResetWithTokenRequest.js +3 -7
  43. package/dist/esm/models/Polygon.d.ts +65 -0
  44. package/dist/esm/models/Polygon.js +56 -0
  45. package/dist/esm/models/PolygonReference.d.ts +54 -0
  46. package/dist/esm/models/PolygonReference.js +49 -0
  47. package/dist/esm/models/UpdateChunkContentRequest.d.ts +54 -0
  48. package/dist/esm/models/UpdateChunkContentRequest.js +51 -0
  49. package/dist/esm/models/UpdateChunkMetadataRequest.d.ts +48 -0
  50. package/dist/esm/models/UpdateChunkMetadataRequest.js +45 -0
  51. package/dist/esm/models/index.d.ts +13 -0
  52. package/dist/esm/models/index.js +13 -0
  53. package/dist/models/ChunkMetadataInput.d.ts +48 -0
  54. package/dist/models/ChunkMetadataInput.js +51 -0
  55. package/dist/models/ChunkMetadataOutput.d.ts +48 -0
  56. package/dist/models/ChunkMetadataOutput.js +51 -0
  57. package/dist/models/ChunkResponse.d.ts +115 -0
  58. package/dist/models/ChunkResponse.js +94 -0
  59. package/dist/models/ChunkType.d.ts +27 -0
  60. package/dist/models/ChunkType.js +53 -0
  61. package/dist/models/CreateChunkRequest.d.ts +73 -0
  62. package/dist/models/CreateChunkRequest.js +72 -0
  63. package/dist/models/DocumentContentPathPart.d.ts +119 -0
  64. package/dist/models/DocumentContentPathPart.js +91 -0
  65. package/dist/models/FolderDocumentResponse.d.ts +138 -0
  66. package/dist/models/FolderDocumentResponse.js +96 -0
  67. package/dist/models/PaginatedResponseDocumentContentPathPart.d.ts +66 -0
  68. package/dist/models/PaginatedResponseDocumentContentPathPart.js +78 -0
  69. package/dist/models/PaginatedResponseFolderDocumentResponse.d.ts +66 -0
  70. package/dist/models/PaginatedResponseFolderDocumentResponse.js +78 -0
  71. package/dist/models/PasswordResetWithTokenRequest.d.ts +2 -8
  72. package/dist/models/PasswordResetWithTokenRequest.js +3 -7
  73. package/dist/models/Polygon.d.ts +65 -0
  74. package/dist/models/Polygon.js +64 -0
  75. package/dist/models/PolygonReference.d.ts +54 -0
  76. package/dist/models/PolygonReference.js +57 -0
  77. package/dist/models/UpdateChunkContentRequest.d.ts +54 -0
  78. package/dist/models/UpdateChunkContentRequest.js +59 -0
  79. package/dist/models/UpdateChunkMetadataRequest.d.ts +48 -0
  80. package/dist/models/UpdateChunkMetadataRequest.js +53 -0
  81. package/dist/models/index.d.ts +13 -0
  82. package/dist/models/index.js +13 -0
  83. package/package.json +1 -1
  84. package/src/apis/ChunksApi.ts +381 -0
  85. package/src/apis/DocumentVersionsApi.ts +82 -0
  86. package/src/apis/FoldersApi.ts +88 -0
  87. package/src/apis/PathPartsApi.ts +4 -10
  88. package/src/apis/index.ts +1 -0
  89. package/src/models/ChunkMetadataInput.ts +90 -0
  90. package/src/models/ChunkMetadataOutput.ts +90 -0
  91. package/src/models/ChunkResponse.ts +197 -0
  92. package/src/models/ChunkType.ts +55 -0
  93. package/src/models/CreateChunkRequest.ts +138 -0
  94. package/src/models/DocumentContentPathPart.ts +205 -0
  95. package/src/models/FolderDocumentResponse.ts +234 -0
  96. package/src/models/PaginatedResponseDocumentContentPathPart.ts +130 -0
  97. package/src/models/PaginatedResponseFolderDocumentResponse.ts +130 -0
  98. package/src/models/PasswordResetWithTokenRequest.ts +5 -14
  99. package/src/models/Polygon.ts +110 -0
  100. package/src/models/PolygonReference.ts +100 -0
  101. package/src/models/UpdateChunkContentRequest.ts +104 -0
  102. package/src/models/UpdateChunkMetadataRequest.ts +91 -0
  103. package/src/models/index.ts +13 -0
@@ -17,6 +17,7 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  DocumentVersionResponse,
19
19
  HTTPValidationError,
20
+ PaginatedResponseDocumentContentPathPart,
20
21
  PaginatedResponseDocumentVersionResponse,
21
22
  } from '../models/index';
22
23
  import {
@@ -24,6 +25,8 @@ import {
24
25
  DocumentVersionResponseToJSON,
25
26
  HTTPValidationErrorFromJSON,
26
27
  HTTPValidationErrorToJSON,
28
+ PaginatedResponseDocumentContentPathPartFromJSON,
29
+ PaginatedResponseDocumentContentPathPartToJSON,
27
30
  PaginatedResponseDocumentVersionResponseFromJSON,
28
31
  PaginatedResponseDocumentVersionResponseToJSON,
29
32
  } from '../models/index';
@@ -43,6 +46,14 @@ export interface GetDocumentVersionRequest {
43
46
  ksUat?: string;
44
47
  }
45
48
 
49
+ export interface GetDocumentVersionContentsRequest {
50
+ versionId: string;
51
+ sectionId?: string;
52
+ limit?: number;
53
+ offset?: number;
54
+ ksUat?: string;
55
+ }
56
+
46
57
  export interface ListDocumentVersionsRequest {
47
58
  documentId: string;
48
59
  limit?: number;
@@ -108,6 +119,26 @@ export interface DocumentVersionsApiInterface {
108
119
  */
109
120
  getDocumentVersion(requestParameters: GetDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionResponse>;
110
121
 
122
+ /**
123
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
124
+ * @summary Get Document Version Contents Handler
125
+ * @param {string} versionId DocumentVersion ID
126
+ * @param {string} [sectionId] Optional section ID to scope traversal to a subtree
127
+ * @param {number} [limit] Number of items per page
128
+ * @param {number} [offset] Number of items to skip
129
+ * @param {string} [ksUat]
130
+ * @param {*} [options] Override http request option.
131
+ * @throws {RequiredError}
132
+ * @memberof DocumentVersionsApiInterface
133
+ */
134
+ getDocumentVersionContentsRaw(requestParameters: GetDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentContentPathPart>>;
135
+
136
+ /**
137
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
138
+ * Get Document Version Contents Handler
139
+ */
140
+ getDocumentVersionContents(requestParameters: GetDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentContentPathPart>;
141
+
111
142
  /**
112
143
  * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
113
144
  * @summary List Document Versions Handler
@@ -250,6 +281,57 @@ export class DocumentVersionsApi extends runtime.BaseAPI implements DocumentVers
250
281
  return await response.value();
251
282
  }
252
283
 
284
+ /**
285
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
286
+ * Get Document Version Contents Handler
287
+ */
288
+ async getDocumentVersionContentsRaw(requestParameters: GetDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseDocumentContentPathPart>> {
289
+ if (requestParameters['versionId'] == null) {
290
+ throw new runtime.RequiredError(
291
+ 'versionId',
292
+ 'Required parameter "versionId" was null or undefined when calling getDocumentVersionContents().'
293
+ );
294
+ }
295
+
296
+ const queryParameters: any = {};
297
+
298
+ if (requestParameters['sectionId'] != null) {
299
+ queryParameters['section_id'] = requestParameters['sectionId'];
300
+ }
301
+
302
+ if (requestParameters['limit'] != null) {
303
+ queryParameters['limit'] = requestParameters['limit'];
304
+ }
305
+
306
+ if (requestParameters['offset'] != null) {
307
+ queryParameters['offset'] = requestParameters['offset'];
308
+ }
309
+
310
+ const headerParameters: runtime.HTTPHeaders = {};
311
+
312
+
313
+ let urlPath = `/v1/document_versions/{version_id}/contents`;
314
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
315
+
316
+ const response = await this.request({
317
+ path: urlPath,
318
+ method: 'GET',
319
+ headers: headerParameters,
320
+ query: queryParameters,
321
+ }, initOverrides);
322
+
323
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseDocumentContentPathPartFromJSON(jsonValue));
324
+ }
325
+
326
+ /**
327
+ * List all sections and chunks for a document version in depth-first logical order. Returns a flat paginated list that can be used to reconstruct the section/chunk hierarchy with content. Sections include page_number; chunks include content, chunk_type, and chunk_metadata.
328
+ * Get Document Version Contents Handler
329
+ */
330
+ async getDocumentVersionContents(requestParameters: GetDocumentVersionContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseDocumentContentPathPart> {
331
+ const response = await this.getDocumentVersionContentsRaw(requestParameters, initOverrides);
332
+ return await response.value();
333
+ }
334
+
253
335
  /**
254
336
  * List all versions for a document. Returns versions ordered by version number ascending (v0, v1, v2...).
255
337
  * List Document Versions Handler
@@ -18,6 +18,7 @@ import type {
18
18
  CreateFolderRequest,
19
19
  FolderResponse,
20
20
  HTTPValidationError,
21
+ PaginatedResponseFolderDocumentResponse,
21
22
  PaginatedResponseFolderResponse,
22
23
  PathOrder,
23
24
  UpdateFolderRequest,
@@ -29,6 +30,8 @@ import {
29
30
  FolderResponseToJSON,
30
31
  HTTPValidationErrorFromJSON,
31
32
  HTTPValidationErrorToJSON,
33
+ PaginatedResponseFolderDocumentResponseFromJSON,
34
+ PaginatedResponseFolderDocumentResponseToJSON,
32
35
  PaginatedResponseFolderResponseFromJSON,
33
36
  PaginatedResponseFolderResponseToJSON,
34
37
  PathOrderFromJSON,
@@ -52,6 +55,15 @@ export interface GetFolderRequest {
52
55
  ksUat?: string;
53
56
  }
54
57
 
58
+ export interface ListFolderContentsRequest {
59
+ folderId: string;
60
+ maxDepth?: number;
61
+ sortOrder?: PathOrder;
62
+ limit?: number;
63
+ offset?: number;
64
+ ksUat?: string;
65
+ }
66
+
55
67
  export interface ListFoldersRequest {
56
68
  parentId?: string;
57
69
  sortOrder?: PathOrder;
@@ -124,6 +136,27 @@ export interface FoldersApiInterface {
124
136
  */
125
137
  getFolder(requestParameters: GetFolderRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FolderResponse>;
126
138
 
139
+ /**
140
+ * List all contents (folders and documents) under a folder. Returns enriched responses with: - Folders: basic folder metadata - Documents: full document metadata including document_type, document_origin, active_version This is the preferred way to list folder contents when you need document metadata. For generic path traversal of folders only, use GET /path-parts.
141
+ * @summary List Folder Contents Handler
142
+ * @param {string} folderId
143
+ * @param {number} [maxDepth] Maximum depth to traverse (1&#x3D;direct children, default: 1)
144
+ * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
145
+ * @param {number} [limit] Number of items per page
146
+ * @param {number} [offset] Number of items to skip
147
+ * @param {string} [ksUat]
148
+ * @param {*} [options] Override http request option.
149
+ * @throws {RequiredError}
150
+ * @memberof FoldersApiInterface
151
+ */
152
+ listFolderContentsRaw(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseFolderDocumentResponse>>;
153
+
154
+ /**
155
+ * List all contents (folders and documents) under a folder. Returns enriched responses with: - Folders: basic folder metadata - Documents: full document metadata including document_type, document_origin, active_version This is the preferred way to list folder contents when you need document metadata. For generic path traversal of folders only, use GET /path-parts.
156
+ * List Folder Contents Handler
157
+ */
158
+ listFolderContents(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseFolderDocumentResponse>;
159
+
127
160
  /**
128
161
  * 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.
129
162
  * @summary List Folders Handler
@@ -287,6 +320,61 @@ export class FoldersApi extends runtime.BaseAPI implements FoldersApiInterface {
287
320
  return await response.value();
288
321
  }
289
322
 
323
+ /**
324
+ * List all contents (folders and documents) under a folder. Returns enriched responses with: - Folders: basic folder metadata - Documents: full document metadata including document_type, document_origin, active_version This is the preferred way to list folder contents when you need document metadata. For generic path traversal of folders only, use GET /path-parts.
325
+ * List Folder Contents Handler
326
+ */
327
+ async listFolderContentsRaw(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponseFolderDocumentResponse>> {
328
+ if (requestParameters['folderId'] == null) {
329
+ throw new runtime.RequiredError(
330
+ 'folderId',
331
+ 'Required parameter "folderId" was null or undefined when calling listFolderContents().'
332
+ );
333
+ }
334
+
335
+ const queryParameters: any = {};
336
+
337
+ if (requestParameters['maxDepth'] != null) {
338
+ queryParameters['max_depth'] = requestParameters['maxDepth'];
339
+ }
340
+
341
+ if (requestParameters['sortOrder'] != null) {
342
+ queryParameters['sort_order'] = requestParameters['sortOrder'];
343
+ }
344
+
345
+ if (requestParameters['limit'] != null) {
346
+ queryParameters['limit'] = requestParameters['limit'];
347
+ }
348
+
349
+ if (requestParameters['offset'] != null) {
350
+ queryParameters['offset'] = requestParameters['offset'];
351
+ }
352
+
353
+ const headerParameters: runtime.HTTPHeaders = {};
354
+
355
+
356
+ let urlPath = `/v1/folders/{folder_id}/contents`;
357
+ urlPath = urlPath.replace(`{${"folder_id"}}`, encodeURIComponent(String(requestParameters['folderId'])));
358
+
359
+ const response = await this.request({
360
+ path: urlPath,
361
+ method: 'GET',
362
+ headers: headerParameters,
363
+ query: queryParameters,
364
+ }, initOverrides);
365
+
366
+ return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedResponseFolderDocumentResponseFromJSON(jsonValue));
367
+ }
368
+
369
+ /**
370
+ * List all contents (folders and documents) under a folder. Returns enriched responses with: - Folders: basic folder metadata - Documents: full document metadata including document_type, document_origin, active_version This is the preferred way to list folder contents when you need document metadata. For generic path traversal of folders only, use GET /path-parts.
371
+ * List Folder Contents Handler
372
+ */
373
+ async listFolderContents(requestParameters: ListFolderContentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponseFolderDocumentResponse> {
374
+ const response = await this.listFolderContentsRaw(requestParameters, initOverrides);
375
+ return await response.value();
376
+ }
377
+
290
378
  /**
291
379
  * 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.
292
380
  * List Folders Handler
@@ -38,7 +38,6 @@ export interface GetPathPartRequest {
38
38
 
39
39
  export interface ListPathPartsRequest {
40
40
  parentId?: string;
41
- includeDocuments?: boolean;
42
41
  maxDepth?: number;
43
42
  sortOrder?: PathOrder;
44
43
  limit?: number;
@@ -71,10 +70,9 @@ export interface PathPartsApiInterface {
71
70
  getPathPart(requestParameters: GetPathPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PathPartResponse>;
72
71
 
73
72
  /**
74
- * List path parts under a parent with flexible filtering and traversal. This is a generic endpoint for traversing the path hierarchy. It can return folders, documents, or both depending on the filters provided. - If parent_id is not provided, lists contents of the root folder. - If include_documents is True, includes both FOLDER and DOCUMENT types. Documents act as traversal boundaries (their children are not traversed). - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT.
73
+ * List path parts (folders) under a parent with traversal. This is a generic endpoint for traversing the folder hierarchy. It returns only FOLDER type path parts. - If parent_id is not provided, lists contents of the root folder. - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT. For listing folder contents that includes documents with enriched metadata, use GET /folders/{folder_id}/contents instead.
75
74
  * @summary List Path Parts Handler
76
75
  * @param {string} [parentId] Parent PathPart ID (defaults to root)
77
- * @param {boolean} [includeDocuments] Include documents in results (default: False, folders only)
78
76
  * @param {number} [maxDepth] Maximum depth to traverse (1 &#x3D; direct children, default: 1)
79
77
  * @param {PathOrder} [sortOrder] Sort order for results (default: LOGICAL)
80
78
  * @param {number} [limit] Number of items per page
@@ -87,7 +85,7 @@ export interface PathPartsApiInterface {
87
85
  listPathPartsRaw(requestParameters: ListPathPartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponsePathPartResponse>>;
88
86
 
89
87
  /**
90
- * List path parts under a parent with flexible filtering and traversal. This is a generic endpoint for traversing the path hierarchy. It can return folders, documents, or both depending on the filters provided. - If parent_id is not provided, lists contents of the root folder. - If include_documents is True, includes both FOLDER and DOCUMENT types. Documents act as traversal boundaries (their children are not traversed). - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT.
88
+ * List path parts (folders) under a parent with traversal. This is a generic endpoint for traversing the folder hierarchy. It returns only FOLDER type path parts. - If parent_id is not provided, lists contents of the root folder. - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT. For listing folder contents that includes documents with enriched metadata, use GET /folders/{folder_id}/contents instead.
91
89
  * List Path Parts Handler
92
90
  */
93
91
  listPathParts(requestParameters: ListPathPartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponsePathPartResponse>;
@@ -139,7 +137,7 @@ export class PathPartsApi extends runtime.BaseAPI implements PathPartsApiInterfa
139
137
  }
140
138
 
141
139
  /**
142
- * List path parts under a parent with flexible filtering and traversal. This is a generic endpoint for traversing the path hierarchy. It can return folders, documents, or both depending on the filters provided. - If parent_id is not provided, lists contents of the root folder. - If include_documents is True, includes both FOLDER and DOCUMENT types. Documents act as traversal boundaries (their children are not traversed). - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT.
140
+ * List path parts (folders) under a parent with traversal. This is a generic endpoint for traversing the folder hierarchy. It returns only FOLDER type path parts. - If parent_id is not provided, lists contents of the root folder. - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT. For listing folder contents that includes documents with enriched metadata, use GET /folders/{folder_id}/contents instead.
143
141
  * List Path Parts Handler
144
142
  */
145
143
  async listPathPartsRaw(requestParameters: ListPathPartsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedResponsePathPartResponse>> {
@@ -149,10 +147,6 @@ export class PathPartsApi extends runtime.BaseAPI implements PathPartsApiInterfa
149
147
  queryParameters['parent_id'] = requestParameters['parentId'];
150
148
  }
151
149
 
152
- if (requestParameters['includeDocuments'] != null) {
153
- queryParameters['include_documents'] = requestParameters['includeDocuments'];
154
- }
155
-
156
150
  if (requestParameters['maxDepth'] != null) {
157
151
  queryParameters['max_depth'] = requestParameters['maxDepth'];
158
152
  }
@@ -185,7 +179,7 @@ export class PathPartsApi extends runtime.BaseAPI implements PathPartsApiInterfa
185
179
  }
186
180
 
187
181
  /**
188
- * List path parts under a parent with flexible filtering and traversal. This is a generic endpoint for traversing the path hierarchy. It can return folders, documents, or both depending on the filters provided. - If parent_id is not provided, lists contents of the root folder. - If include_documents is True, includes both FOLDER and DOCUMENT types. Documents act as traversal boundaries (their children are not traversed). - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT.
182
+ * List path parts (folders) under a parent with traversal. This is a generic endpoint for traversing the folder hierarchy. It returns only FOLDER type path parts. - If parent_id is not provided, lists contents of the root folder. - max_depth controls how deep to traverse (1 = direct children only). - sort_order controls the ordering: LOGICAL (linked-list), NAME, UPDATED_AT, CREATED_AT. For listing folder contents that includes documents with enriched metadata, use GET /folders/{folder_id}/contents instead.
189
183
  * List Path Parts Handler
190
184
  */
191
185
  async listPathParts(requestParameters: ListPathPartsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedResponsePathPartResponse> {
package/src/apis/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export * from './AuthApi';
4
+ export * from './ChunksApi';
4
5
  export * from './DefaultApi';
5
6
  export * from './DocumentVersionsApi';
6
7
  export * from './DocumentsApi';
@@ -0,0 +1,90 @@
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 { PolygonReference } from './PolygonReference';
17
+ import {
18
+ PolygonReferenceFromJSON,
19
+ PolygonReferenceFromJSONTyped,
20
+ PolygonReferenceToJSON,
21
+ PolygonReferenceToJSONTyped,
22
+ } from './PolygonReference';
23
+
24
+ /**
25
+ * Metadata for a chunk including source document references.
26
+ * @export
27
+ * @interface ChunkMetadataInput
28
+ */
29
+ export interface ChunkMetadataInput {
30
+ /**
31
+ * List of bounding boxes in the source document for the chunk, potentially from multiple areas of multiple pages.
32
+ * @type {Array<PolygonReference>}
33
+ * @memberof ChunkMetadataInput
34
+ */
35
+ polygons?: Array<PolygonReference>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the ChunkMetadataInput interface.
40
+ */
41
+ export function instanceOfChunkMetadataInput(value: object): value is ChunkMetadataInput {
42
+ return true;
43
+ }
44
+
45
+ export function ChunkMetadataInputFromJSON(json: any): ChunkMetadataInput {
46
+ return ChunkMetadataInputFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ChunkMetadataInputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkMetadataInput {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'polygons': json['polygons'] == null ? undefined : ((json['polygons'] as Array<any>).map(PolygonReferenceFromJSON)),
56
+ };
57
+ }
58
+
59
+ export function ChunkMetadataInputToJSON(json: any): ChunkMetadataInput {
60
+ return ChunkMetadataInputToJSONTyped(json, false);
61
+ }
62
+
63
+ export function ChunkMetadataInputToJSONTyped(value?: ChunkMetadataInput | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'polygons': value['polygons'] == null ? undefined : ((value['polygons'] as Array<any>).map(PolygonReferenceToJSON)),
71
+ };
72
+ }
73
+
74
+ export const ChunkMetadataInputPropertyValidationAttributesMap: {
75
+ [property: string]: {
76
+ maxLength?: number,
77
+ minLength?: number,
78
+ pattern?: string,
79
+ maximum?: number,
80
+ exclusiveMaximum?: boolean,
81
+ minimum?: number,
82
+ exclusiveMinimum?: boolean,
83
+ multipleOf?: number,
84
+ maxItems?: number,
85
+ minItems?: number,
86
+ uniqueItems?: boolean
87
+ }
88
+ } = {
89
+ }
90
+
@@ -0,0 +1,90 @@
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 { PolygonReference } from './PolygonReference';
17
+ import {
18
+ PolygonReferenceFromJSON,
19
+ PolygonReferenceFromJSONTyped,
20
+ PolygonReferenceToJSON,
21
+ PolygonReferenceToJSONTyped,
22
+ } from './PolygonReference';
23
+
24
+ /**
25
+ * Metadata for a chunk including source document references.
26
+ * @export
27
+ * @interface ChunkMetadataOutput
28
+ */
29
+ export interface ChunkMetadataOutput {
30
+ /**
31
+ * List of bounding boxes in the source document for the chunk, potentially from multiple areas of multiple pages.
32
+ * @type {Array<PolygonReference>}
33
+ * @memberof ChunkMetadataOutput
34
+ */
35
+ polygons?: Array<PolygonReference>;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the ChunkMetadataOutput interface.
40
+ */
41
+ export function instanceOfChunkMetadataOutput(value: object): value is ChunkMetadataOutput {
42
+ return true;
43
+ }
44
+
45
+ export function ChunkMetadataOutputFromJSON(json: any): ChunkMetadataOutput {
46
+ return ChunkMetadataOutputFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function ChunkMetadataOutputFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkMetadataOutput {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'polygons': json['polygons'] == null ? undefined : ((json['polygons'] as Array<any>).map(PolygonReferenceFromJSON)),
56
+ };
57
+ }
58
+
59
+ export function ChunkMetadataOutputToJSON(json: any): ChunkMetadataOutput {
60
+ return ChunkMetadataOutputToJSONTyped(json, false);
61
+ }
62
+
63
+ export function ChunkMetadataOutputToJSONTyped(value?: ChunkMetadataOutput | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'polygons': value['polygons'] == null ? undefined : ((value['polygons'] as Array<any>).map(PolygonReferenceToJSON)),
71
+ };
72
+ }
73
+
74
+ export const ChunkMetadataOutputPropertyValidationAttributesMap: {
75
+ [property: string]: {
76
+ maxLength?: number,
77
+ minLength?: number,
78
+ pattern?: string,
79
+ maximum?: number,
80
+ exclusiveMaximum?: boolean,
81
+ minimum?: number,
82
+ exclusiveMinimum?: boolean,
83
+ multipleOf?: number,
84
+ maxItems?: number,
85
+ minItems?: number,
86
+ uniqueItems?: boolean
87
+ }
88
+ } = {
89
+ }
90
+
@@ -0,0 +1,197 @@
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 { ChunkMetadataOutput } from './ChunkMetadataOutput';
17
+ import {
18
+ ChunkMetadataOutputFromJSON,
19
+ ChunkMetadataOutputFromJSONTyped,
20
+ ChunkMetadataOutputToJSON,
21
+ ChunkMetadataOutputToJSONTyped,
22
+ } from './ChunkMetadataOutput';
23
+ import type { ChunkType } from './ChunkType';
24
+ import {
25
+ ChunkTypeFromJSON,
26
+ ChunkTypeFromJSONTyped,
27
+ ChunkTypeToJSON,
28
+ ChunkTypeToJSONTyped,
29
+ } from './ChunkType';
30
+
31
+ /**
32
+ * Chunk response model.
33
+ * @export
34
+ * @interface ChunkResponse
35
+ */
36
+ export interface ChunkResponse {
37
+ /**
38
+ * Chunk ID
39
+ * @type {string}
40
+ * @memberof ChunkResponse
41
+ */
42
+ id: string;
43
+ /**
44
+ * PathPart ID
45
+ * @type {string}
46
+ * @memberof ChunkResponse
47
+ */
48
+ pathPartId: string;
49
+ /**
50
+ * ChunkContent ID
51
+ * @type {string}
52
+ * @memberof ChunkResponse
53
+ */
54
+ contentId: string;
55
+ /**
56
+ * Chunk text content
57
+ * @type {string}
58
+ * @memberof ChunkResponse
59
+ */
60
+ content: string;
61
+ /**
62
+ * Type of chunk content
63
+ * @type {ChunkType}
64
+ * @memberof ChunkResponse
65
+ */
66
+ chunkType: ChunkType;
67
+ /**
68
+ * Chunk metadata
69
+ * @type {ChunkMetadataOutput}
70
+ * @memberof ChunkResponse
71
+ */
72
+ chunkMetadata: ChunkMetadataOutput;
73
+ /**
74
+ * Parent PathPart ID
75
+ * @type {string}
76
+ * @memberof ChunkResponse
77
+ */
78
+ parentId: string;
79
+ /**
80
+ * Previous sibling PathPart ID
81
+ * @type {string}
82
+ * @memberof ChunkResponse
83
+ */
84
+ prevSiblingPathId?: string;
85
+ /**
86
+ * Next sibling PathPart ID
87
+ * @type {string}
88
+ * @memberof ChunkResponse
89
+ */
90
+ nextSiblingId?: string;
91
+ /**
92
+ * Tenant ID
93
+ * @type {string}
94
+ * @memberof ChunkResponse
95
+ */
96
+ tenantId: string;
97
+ /**
98
+ * Creation timestamp
99
+ * @type {Date}
100
+ * @memberof ChunkResponse
101
+ */
102
+ createdAt: Date;
103
+ /**
104
+ * Last update timestamp
105
+ * @type {Date}
106
+ * @memberof ChunkResponse
107
+ */
108
+ updatedAt: Date;
109
+ }
110
+
111
+
112
+
113
+ /**
114
+ * Check if a given object implements the ChunkResponse interface.
115
+ */
116
+ export function instanceOfChunkResponse(value: object): value is ChunkResponse {
117
+ if (!('id' in value) || value['id'] === undefined) return false;
118
+ if (!('pathPartId' in value) || value['pathPartId'] === undefined) return false;
119
+ if (!('contentId' in value) || value['contentId'] === undefined) return false;
120
+ if (!('content' in value) || value['content'] === undefined) return false;
121
+ if (!('chunkType' in value) || value['chunkType'] === undefined) return false;
122
+ if (!('chunkMetadata' in value) || value['chunkMetadata'] === undefined) return false;
123
+ if (!('parentId' in value) || value['parentId'] === undefined) return false;
124
+ if (!('tenantId' in value) || value['tenantId'] === undefined) return false;
125
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
126
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
127
+ return true;
128
+ }
129
+
130
+ export function ChunkResponseFromJSON(json: any): ChunkResponse {
131
+ return ChunkResponseFromJSONTyped(json, false);
132
+ }
133
+
134
+ export function ChunkResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkResponse {
135
+ if (json == null) {
136
+ return json;
137
+ }
138
+ return {
139
+
140
+ 'id': json['id'],
141
+ 'pathPartId': json['path_part_id'],
142
+ 'contentId': json['content_id'],
143
+ 'content': json['content'],
144
+ 'chunkType': ChunkTypeFromJSON(json['chunk_type']),
145
+ 'chunkMetadata': ChunkMetadataOutputFromJSON(json['chunk_metadata']),
146
+ 'parentId': json['parent_id'],
147
+ 'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
148
+ 'nextSiblingId': json['next_sibling_id'] == null ? undefined : json['next_sibling_id'],
149
+ 'tenantId': json['tenant_id'],
150
+ 'createdAt': (new Date(json['created_at'])),
151
+ 'updatedAt': (new Date(json['updated_at'])),
152
+ };
153
+ }
154
+
155
+ export function ChunkResponseToJSON(json: any): ChunkResponse {
156
+ return ChunkResponseToJSONTyped(json, false);
157
+ }
158
+
159
+ export function ChunkResponseToJSONTyped(value?: ChunkResponse | null, ignoreDiscriminator: boolean = false): any {
160
+ if (value == null) {
161
+ return value;
162
+ }
163
+
164
+ return {
165
+
166
+ 'id': value['id'],
167
+ 'path_part_id': value['pathPartId'],
168
+ 'content_id': value['contentId'],
169
+ 'content': value['content'],
170
+ 'chunk_type': ChunkTypeToJSON(value['chunkType']),
171
+ 'chunk_metadata': ChunkMetadataOutputToJSON(value['chunkMetadata']),
172
+ 'parent_id': value['parentId'],
173
+ 'prev_sibling_path_id': value['prevSiblingPathId'],
174
+ 'next_sibling_id': value['nextSiblingId'],
175
+ 'tenant_id': value['tenantId'],
176
+ 'created_at': value['createdAt'].toISOString(),
177
+ 'updated_at': value['updatedAt'].toISOString(),
178
+ };
179
+ }
180
+
181
+ export const ChunkResponsePropertyValidationAttributesMap: {
182
+ [property: string]: {
183
+ maxLength?: number,
184
+ minLength?: number,
185
+ pattern?: string,
186
+ maximum?: number,
187
+ exclusiveMaximum?: boolean,
188
+ minimum?: number,
189
+ exclusiveMinimum?: boolean,
190
+ multipleOf?: number,
191
+ maxItems?: number,
192
+ minItems?: number,
193
+ uniqueItems?: boolean
194
+ }
195
+ } = {
196
+ }
197
+