@knowledge-stack/ksapi 1.52.2 → 1.53.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 (80) hide show
  1. package/.openapi-generator/FILES +8 -0
  2. package/README.md +7 -2
  3. package/dist/apis/DocumentVersionsApi.d.ts +48 -1
  4. package/dist/apis/DocumentVersionsApi.js +50 -0
  5. package/dist/esm/apis/DocumentVersionsApi.d.ts +48 -1
  6. package/dist/esm/apis/DocumentVersionsApi.js +51 -1
  7. package/dist/esm/models/ChunkBulkResponse.d.ts +6 -0
  8. package/dist/esm/models/ChunkBulkResponse.js +2 -0
  9. package/dist/esm/models/ChunkResponse.d.ts +6 -0
  10. package/dist/esm/models/ChunkResponse.js +2 -0
  11. package/dist/esm/models/DocumentVersionAction.d.ts +24 -0
  12. package/dist/esm/models/DocumentVersionAction.js +42 -0
  13. package/dist/esm/models/DocumentVersionActionResponse.d.ts +60 -0
  14. package/dist/esm/models/DocumentVersionActionResponse.js +53 -0
  15. package/dist/esm/models/DocumentVersionMetadata.d.ts +8 -1
  16. package/dist/esm/models/DocumentVersionMetadata.js +3 -0
  17. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +7 -0
  18. package/dist/esm/models/DocumentVersionMetadataUpdate.js +3 -0
  19. package/dist/esm/models/DocumentVersionResponse.d.ts +1 -1
  20. package/dist/esm/models/DocumentVersionResponse.js +2 -2
  21. package/dist/esm/models/InformationStatistics.d.ts +67 -0
  22. package/dist/esm/models/InformationStatistics.js +48 -0
  23. package/dist/esm/models/ScoredChunkResponse.d.ts +6 -0
  24. package/dist/esm/models/ScoredChunkResponse.js +2 -0
  25. package/dist/esm/models/SectionResponse.d.ts +7 -0
  26. package/dist/esm/models/SectionResponse.js +3 -0
  27. package/dist/esm/models/SectionSystemMetadata.d.ts +48 -0
  28. package/dist/esm/models/SectionSystemMetadata.js +43 -0
  29. package/dist/esm/models/index.d.ts +4 -0
  30. package/dist/esm/models/index.js +4 -0
  31. package/dist/models/ChunkBulkResponse.d.ts +6 -0
  32. package/dist/models/ChunkBulkResponse.js +2 -0
  33. package/dist/models/ChunkResponse.d.ts +6 -0
  34. package/dist/models/ChunkResponse.js +2 -0
  35. package/dist/models/DocumentVersionAction.d.ts +24 -0
  36. package/dist/models/DocumentVersionAction.js +50 -0
  37. package/dist/models/DocumentVersionActionResponse.d.ts +60 -0
  38. package/dist/models/DocumentVersionActionResponse.js +61 -0
  39. package/dist/models/DocumentVersionMetadata.d.ts +8 -1
  40. package/dist/models/DocumentVersionMetadata.js +3 -0
  41. package/dist/models/DocumentVersionMetadataUpdate.d.ts +7 -0
  42. package/dist/models/DocumentVersionMetadataUpdate.js +3 -0
  43. package/dist/models/DocumentVersionResponse.d.ts +1 -1
  44. package/dist/models/DocumentVersionResponse.js +2 -2
  45. package/dist/models/InformationStatistics.d.ts +67 -0
  46. package/dist/models/InformationStatistics.js +56 -0
  47. package/dist/models/ScoredChunkResponse.d.ts +6 -0
  48. package/dist/models/ScoredChunkResponse.js +2 -0
  49. package/dist/models/SectionResponse.d.ts +7 -0
  50. package/dist/models/SectionResponse.js +3 -0
  51. package/dist/models/SectionSystemMetadata.d.ts +48 -0
  52. package/dist/models/SectionSystemMetadata.js +51 -0
  53. package/dist/models/index.d.ts +4 -0
  54. package/dist/models/index.js +4 -0
  55. package/docs/ChunkBulkResponse.md +2 -0
  56. package/docs/ChunkResponse.md +2 -0
  57. package/docs/DocumentVersionAction.md +33 -0
  58. package/docs/DocumentVersionActionResponse.md +39 -0
  59. package/docs/DocumentVersionMetadata.md +3 -1
  60. package/docs/DocumentVersionMetadataUpdate.md +2 -0
  61. package/docs/DocumentVersionResponse.md +2 -2
  62. package/docs/DocumentVersionsApi.md +78 -0
  63. package/docs/InformationStatistics.md +41 -0
  64. package/docs/ScoredChunkResponse.md +2 -0
  65. package/docs/SectionResponse.md +2 -0
  66. package/docs/SectionSystemMetadata.md +35 -0
  67. package/package.json +1 -1
  68. package/src/apis/DocumentVersionsApi.ts +105 -0
  69. package/src/models/ChunkBulkResponse.ts +8 -0
  70. package/src/models/ChunkResponse.ts +8 -0
  71. package/src/models/DocumentVersionAction.ts +52 -0
  72. package/src/models/DocumentVersionActionResponse.ts +111 -0
  73. package/src/models/DocumentVersionMetadata.ts +16 -1
  74. package/src/models/DocumentVersionMetadataUpdate.ts +15 -0
  75. package/src/models/DocumentVersionResponse.ts +3 -3
  76. package/src/models/InformationStatistics.ts +106 -0
  77. package/src/models/ScoredChunkResponse.ts +8 -0
  78. package/src/models/SectionResponse.ts +16 -0
  79. package/src/models/SectionSystemMetadata.ts +90 -0
  80. package/src/models/index.ts +4 -0
@@ -1,7 +1,7 @@
1
1
 
2
2
  # DocumentVersionMetadata
3
3
 
4
- Schema for document_version.metadata JSONB field. Tracks S3 URLs for generated artifacts, pipeline execution state, and document statistics. Convention-based paths (images, page screenshots) are derived from document_id/document_version_id via s3_paths helpers, using a flat S3 layout: documents/{document_id}/{document_version_id}/...
4
+ Schema for document_version.system_metadata JSONB field. Tracks S3 URLs for generated artifacts, pipeline execution state, and document statistics. Convention-based paths (images, page screenshots) are derived from document_id/document_version_id via s3_paths helpers, using a flat S3 layout: documents/{document_id}/{document_version_id}/...
5
5
 
6
6
  ## Properties
7
7
 
@@ -19,6 +19,7 @@ Name | Type
19
19
  `xlsxParseResultS3` | string
20
20
  `xlsxNamedRanges` | Array<{ [key: string]: any; }>
21
21
  `xlsxKpiCatalog` | Array<{ [key: string]: any; }>
22
+ `informationStatistics` | [InformationStatistics](InformationStatistics.md)
22
23
 
23
24
  ## Example
24
25
 
@@ -39,6 +40,7 @@ const example = {
39
40
  "xlsxParseResultS3": null,
40
41
  "xlsxNamedRanges": null,
41
42
  "xlsxKpiCatalog": null,
43
+ "informationStatistics": null,
42
44
  } satisfies DocumentVersionMetadata
43
45
 
44
46
  console.log(example)
@@ -19,6 +19,7 @@ Name | Type
19
19
  `xlsxParseResultS3` | string
20
20
  `xlsxNamedRanges` | Array<{ [key: string]: any; }>
21
21
  `xlsxKpiCatalog` | Array<{ [key: string]: any; }>
22
+ `informationStatistics` | [InformationStatistics](InformationStatistics.md)
22
23
 
23
24
  ## Example
24
25
 
@@ -39,6 +40,7 @@ const example = {
39
40
  "xlsxParseResultS3": null,
40
41
  "xlsxNamedRanges": null,
41
42
  "xlsxKpiCatalog": null,
43
+ "informationStatistics": null,
42
44
  } satisfies DocumentVersionMetadataUpdate
43
45
 
44
46
  console.log(example)
@@ -18,7 +18,7 @@ Name | Type
18
18
  `createdAt` | Date
19
19
  `updatedAt` | Date
20
20
  `assetS3Url` | string
21
- `metadata` | [DocumentVersionMetadata](DocumentVersionMetadata.md)
21
+ `systemMetadata` | [DocumentVersionMetadata](DocumentVersionMetadata.md)
22
22
 
23
23
  ## Example
24
24
 
@@ -38,7 +38,7 @@ const example = {
38
38
  "createdAt": null,
39
39
  "updatedAt": null,
40
40
  "assetS3Url": null,
41
- "metadata": null,
41
+ "systemMetadata": null,
42
42
  } satisfies DocumentVersionResponse
43
43
 
44
44
  console.log(example)
@@ -7,6 +7,7 @@ All URIs are relative to *http://localhost:8000*
7
7
  | [**clearDocumentVersionContents**](DocumentVersionsApi.md#cleardocumentversioncontents) | **DELETE** /v1/document_versions/{version_id}/contents | Clear Document Version Contents Handler |
8
8
  | [**createDocumentVersion**](DocumentVersionsApi.md#createdocumentversion) | **POST** /v1/documents/{document_id}/versions | Create Document Version Handler |
9
9
  | [**deleteDocumentVersion**](DocumentVersionsApi.md#deletedocumentversion) | **DELETE** /v1/document_versions/{version_id} | Delete Document Version Handler |
10
+ | [**documentVersionAction**](DocumentVersionsApi.md#documentversionaction) | **POST** /v1/document_versions/{version_id} | Document Version Action Handler |
10
11
  | [**getDocumentVersion**](DocumentVersionsApi.md#getdocumentversion) | **GET** /v1/document_versions/{version_id} | Get Document Version Handler |
11
12
  | [**getDocumentVersionContents**](DocumentVersionsApi.md#getdocumentversioncontents) | **GET** /v1/document_versions/{version_id}/contents | Get Document Version Contents Handler |
12
13
  | [**listDocumentVersions**](DocumentVersionsApi.md#listdocumentversions) | **GET** /v1/document_versions | List Document Versions Handler |
@@ -236,6 +237,83 @@ No authorization required
236
237
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
237
238
 
238
239
 
240
+ ## documentVersionAction
241
+
242
+ > DocumentVersionActionResponse documentVersionAction(versionId, action, authorization, ksUat)
243
+
244
+ Document Version Action Handler
245
+
246
+ Perform an action on a document version. Supported actions: - `reembed`: Re-embed all chunks for this version into Qdrant.
247
+
248
+ ### Example
249
+
250
+ ```ts
251
+ import {
252
+ Configuration,
253
+ DocumentVersionsApi,
254
+ } from '@knowledge-stack/ksapi';
255
+ import type { DocumentVersionActionRequest } from '@knowledge-stack/ksapi';
256
+
257
+ async function example() {
258
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
259
+ const api = new DocumentVersionsApi();
260
+
261
+ const body = {
262
+ // string | DocumentVersion ID
263
+ versionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
264
+ // DocumentVersionAction | Action to perform
265
+ action: ...,
266
+ // string (optional)
267
+ authorization: authorization_example,
268
+ // string (optional)
269
+ ksUat: ksUat_example,
270
+ } satisfies DocumentVersionActionRequest;
271
+
272
+ try {
273
+ const data = await api.documentVersionAction(body);
274
+ console.log(data);
275
+ } catch (error) {
276
+ console.error(error);
277
+ }
278
+ }
279
+
280
+ // Run the test
281
+ example().catch(console.error);
282
+ ```
283
+
284
+ ### Parameters
285
+
286
+
287
+ | Name | Type | Description | Notes |
288
+ |------------- | ------------- | ------------- | -------------|
289
+ | **versionId** | `string` | DocumentVersion ID | [Defaults to `undefined`] |
290
+ | **action** | `DocumentVersionAction` | Action to perform | [Defaults to `undefined`] [Enum: reembed] |
291
+ | **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
292
+ | **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
293
+
294
+ ### Return type
295
+
296
+ [**DocumentVersionActionResponse**](DocumentVersionActionResponse.md)
297
+
298
+ ### Authorization
299
+
300
+ No authorization required
301
+
302
+ ### HTTP request headers
303
+
304
+ - **Content-Type**: Not defined
305
+ - **Accept**: `application/json`
306
+
307
+
308
+ ### HTTP response details
309
+ | Status code | Description | Response headers |
310
+ |-------------|-------------|------------------|
311
+ | **200** | Successful Response | - |
312
+ | **422** | Validation Error | - |
313
+
314
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
315
+
316
+
239
317
  ## getDocumentVersion
240
318
 
241
319
  > DocumentVersionResponse getDocumentVersion(versionId, authorization, ksUat)
@@ -0,0 +1,41 @@
1
+
2
+ # InformationStatistics
3
+
4
+ Aggregate statistics for a section subtree or document version.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `numChunksByType` | { [key: string]: number; }
11
+ `totalTokens` | number
12
+ `numDirectChildren` | number
13
+ `childrenDepth` | number
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { InformationStatistics } from '@knowledge-stack/ksapi'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "numChunksByType": null,
23
+ "totalTokens": null,
24
+ "numDirectChildren": null,
25
+ "childrenDepth": null,
26
+ } satisfies InformationStatistics
27
+
28
+ console.log(example)
29
+
30
+ // Convert the instance to a JSON string
31
+ const exampleJSON: string = JSON.stringify(example)
32
+ console.log(exampleJSON)
33
+
34
+ // Parse the JSON string back to an object
35
+ const exampleParsed = JSON.parse(exampleJSON) as InformationStatistics
36
+ console.log(exampleParsed)
37
+ ```
38
+
39
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
40
+
41
+
@@ -13,6 +13,7 @@ Name | Type
13
13
  `content` | string
14
14
  `chunkType` | [ChunkType](ChunkType.md)
15
15
  `chunkMetadata` | [ChunkMetadataOutput](ChunkMetadataOutput.md)
16
+ `numTokens` | number
16
17
  `parentPathId` | string
17
18
  `prevSiblingPathId` | string
18
19
  `nextSiblingPathId` | string
@@ -39,6 +40,7 @@ const example = {
39
40
  "content": null,
40
41
  "chunkType": null,
41
42
  "chunkMetadata": null,
43
+ "numTokens": null,
42
44
  "parentPathId": null,
43
45
  "prevSiblingPathId": null,
44
46
  "nextSiblingPathId": null,
@@ -16,6 +16,7 @@ Name | Type
16
16
  `nextSiblingPathId` | string
17
17
  `materializedPath` | string
18
18
  `systemManaged` | boolean
19
+ `systemMetadata` | [SectionSystemMetadata](SectionSystemMetadata.md)
19
20
  `tenantId` | string
20
21
  `createdAt` | Date
21
22
  `updatedAt` | Date
@@ -36,6 +37,7 @@ const example = {
36
37
  "nextSiblingPathId": null,
37
38
  "materializedPath": null,
38
39
  "systemManaged": null,
40
+ "systemMetadata": null,
39
41
  "tenantId": null,
40
42
  "createdAt": null,
41
43
  "updatedAt": null,
@@ -0,0 +1,35 @@
1
+
2
+ # SectionSystemMetadata
3
+
4
+ Schema for section.system_metadata JSONB field.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `informationStatistics` | [InformationStatistics](InformationStatistics.md)
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { SectionSystemMetadata } from '@knowledge-stack/ksapi'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "informationStatistics": null,
20
+ } satisfies SectionSystemMetadata
21
+
22
+ console.log(example)
23
+
24
+ // Convert the instance to a JSON string
25
+ const exampleJSON: string = JSON.stringify(example)
26
+ console.log(exampleJSON)
27
+
28
+ // Parse the JSON string back to an object
29
+ const exampleParsed = JSON.parse(exampleJSON) as SectionSystemMetadata
30
+ console.log(exampleParsed)
31
+ ```
32
+
33
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
34
+
35
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.52.2",
3
+ "version": "1.53.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -16,6 +16,8 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  ClearVersionContentsResponse,
19
+ DocumentVersionAction,
20
+ DocumentVersionActionResponse,
19
21
  DocumentVersionMetadataUpdate,
20
22
  DocumentVersionResponse,
21
23
  HTTPValidationError,
@@ -25,6 +27,10 @@ import type {
25
27
  import {
26
28
  ClearVersionContentsResponseFromJSON,
27
29
  ClearVersionContentsResponseToJSON,
30
+ DocumentVersionActionFromJSON,
31
+ DocumentVersionActionToJSON,
32
+ DocumentVersionActionResponseFromJSON,
33
+ DocumentVersionActionResponseToJSON,
28
34
  DocumentVersionMetadataUpdateFromJSON,
29
35
  DocumentVersionMetadataUpdateToJSON,
30
36
  DocumentVersionResponseFromJSON,
@@ -55,6 +61,13 @@ export interface DeleteDocumentVersionRequest {
55
61
  ksUat?: string | null;
56
62
  }
57
63
 
64
+ export interface DocumentVersionActionRequest {
65
+ versionId: string;
66
+ action: DocumentVersionAction;
67
+ authorization?: string | null;
68
+ ksUat?: string | null;
69
+ }
70
+
58
71
  export interface GetDocumentVersionRequest {
59
72
  versionId: string;
60
73
  authorization?: string | null;
@@ -176,6 +189,36 @@ export interface DocumentVersionsApiInterface {
176
189
  */
177
190
  deleteDocumentVersion(requestParameters: DeleteDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
178
191
 
192
+ /**
193
+ * Creates request options for documentVersionAction without sending the request
194
+ * @param {string} versionId DocumentVersion ID
195
+ * @param {DocumentVersionAction} action Action to perform
196
+ * @param {string} [authorization]
197
+ * @param {string} [ksUat]
198
+ * @throws {RequiredError}
199
+ * @memberof DocumentVersionsApiInterface
200
+ */
201
+ documentVersionActionRequestOpts(requestParameters: DocumentVersionActionRequest): Promise<runtime.RequestOpts>;
202
+
203
+ /**
204
+ * Perform an action on a document version. Supported actions: - `reembed`: Re-embed all chunks for this version into Qdrant.
205
+ * @summary Document Version Action Handler
206
+ * @param {string} versionId DocumentVersion ID
207
+ * @param {DocumentVersionAction} action Action to perform
208
+ * @param {string} [authorization]
209
+ * @param {string} [ksUat]
210
+ * @param {*} [options] Override http request option.
211
+ * @throws {RequiredError}
212
+ * @memberof DocumentVersionsApiInterface
213
+ */
214
+ documentVersionActionRaw(requestParameters: DocumentVersionActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionActionResponse>>;
215
+
216
+ /**
217
+ * Perform an action on a document version. Supported actions: - `reembed`: Re-embed all chunks for this version into Qdrant.
218
+ * Document Version Action Handler
219
+ */
220
+ documentVersionAction(requestParameters: DocumentVersionActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionActionResponse>;
221
+
179
222
  /**
180
223
  * Creates request options for getDocumentVersion without sending the request
181
224
  * @param {string} versionId DocumentVersion ID
@@ -459,6 +502,68 @@ export class DocumentVersionsApi extends runtime.BaseAPI implements DocumentVers
459
502
  await this.deleteDocumentVersionRaw(requestParameters, initOverrides);
460
503
  }
461
504
 
505
+ /**
506
+ * Creates request options for documentVersionAction without sending the request
507
+ */
508
+ async documentVersionActionRequestOpts(requestParameters: DocumentVersionActionRequest): Promise<runtime.RequestOpts> {
509
+ if (requestParameters['versionId'] == null) {
510
+ throw new runtime.RequiredError(
511
+ 'versionId',
512
+ 'Required parameter "versionId" was null or undefined when calling documentVersionAction().'
513
+ );
514
+ }
515
+
516
+ if (requestParameters['action'] == null) {
517
+ throw new runtime.RequiredError(
518
+ 'action',
519
+ 'Required parameter "action" was null or undefined when calling documentVersionAction().'
520
+ );
521
+ }
522
+
523
+ const queryParameters: any = {};
524
+
525
+ if (requestParameters['action'] != null) {
526
+ queryParameters['action'] = requestParameters['action'];
527
+ }
528
+
529
+ const headerParameters: runtime.HTTPHeaders = {};
530
+
531
+ if (requestParameters['authorization'] != null) {
532
+ headerParameters['authorization'] = String(requestParameters['authorization']);
533
+ }
534
+
535
+
536
+ let urlPath = `/v1/document_versions/{version_id}`;
537
+ urlPath = urlPath.replace(`{${"version_id"}}`, encodeURIComponent(String(requestParameters['versionId'])));
538
+
539
+ return {
540
+ path: urlPath,
541
+ method: 'POST',
542
+ headers: headerParameters,
543
+ query: queryParameters,
544
+ };
545
+ }
546
+
547
+ /**
548
+ * Perform an action on a document version. Supported actions: - `reembed`: Re-embed all chunks for this version into Qdrant.
549
+ * Document Version Action Handler
550
+ */
551
+ async documentVersionActionRaw(requestParameters: DocumentVersionActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentVersionActionResponse>> {
552
+ const requestOptions = await this.documentVersionActionRequestOpts(requestParameters);
553
+ const response = await this.request(requestOptions, initOverrides);
554
+
555
+ return new runtime.JSONApiResponse(response, (jsonValue) => DocumentVersionActionResponseFromJSON(jsonValue));
556
+ }
557
+
558
+ /**
559
+ * Perform an action on a document version. Supported actions: - `reembed`: Re-embed all chunks for this version into Qdrant.
560
+ * Document Version Action Handler
561
+ */
562
+ async documentVersionAction(requestParameters: DocumentVersionActionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentVersionActionResponse> {
563
+ const response = await this.documentVersionActionRaw(requestParameters, initOverrides);
564
+ return await response.value();
565
+ }
566
+
462
567
  /**
463
568
  * Creates request options for getDocumentVersion without sending the request
464
569
  */
@@ -84,6 +84,12 @@ export interface ChunkBulkResponse {
84
84
  * @memberof ChunkBulkResponse
85
85
  */
86
86
  chunkMetadata: ChunkMetadataOutput;
87
+ /**
88
+ * Number of tokens in chunk content
89
+ * @type {number}
90
+ * @memberof ChunkBulkResponse
91
+ */
92
+ numTokens?: number | null;
87
93
  /**
88
94
  * Parent PathPart ID
89
95
  * @type {string}
@@ -196,6 +202,7 @@ export function ChunkBulkResponseFromJSONTyped(json: any, ignoreDiscriminator: b
196
202
  'content': json['content'],
197
203
  'chunkType': ChunkTypeFromJSON(json['chunk_type']),
198
204
  'chunkMetadata': ChunkMetadataOutputFromJSON(json['chunk_metadata']),
205
+ 'numTokens': json['num_tokens'] == null ? undefined : json['num_tokens'],
199
206
  'parentPathId': json['parent_path_id'],
200
207
  'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
201
208
  'nextSiblingPathId': json['next_sibling_path_id'] == null ? undefined : json['next_sibling_path_id'],
@@ -228,6 +235,7 @@ export function ChunkBulkResponseToJSONTyped(value?: ChunkBulkResponse | null, i
228
235
  'content': value['content'],
229
236
  'chunk_type': ChunkTypeToJSON(value['chunkType']),
230
237
  'chunk_metadata': ChunkMetadataOutputToJSON(value['chunkMetadata']),
238
+ 'num_tokens': value['numTokens'],
231
239
  'parent_path_id': value['parentPathId'],
232
240
  'prev_sibling_path_id': value['prevSiblingPathId'],
233
241
  'next_sibling_path_id': value['nextSiblingPathId'],
@@ -84,6 +84,12 @@ export interface ChunkResponse {
84
84
  * @memberof ChunkResponse
85
85
  */
86
86
  chunkMetadata: ChunkMetadataOutput;
87
+ /**
88
+ * Number of tokens in chunk content
89
+ * @type {number}
90
+ * @memberof ChunkResponse
91
+ */
92
+ numTokens?: number | null;
87
93
  /**
88
94
  * Parent PathPart ID
89
95
  * @type {string}
@@ -189,6 +195,7 @@ export function ChunkResponseFromJSONTyped(json: any, ignoreDiscriminator: boole
189
195
  'content': json['content'],
190
196
  'chunkType': ChunkTypeFromJSON(json['chunk_type']),
191
197
  'chunkMetadata': ChunkMetadataOutputFromJSON(json['chunk_metadata']),
198
+ 'numTokens': json['num_tokens'] == null ? undefined : json['num_tokens'],
192
199
  'parentPathId': json['parent_path_id'],
193
200
  'prevSiblingPathId': json['prev_sibling_path_id'] == null ? undefined : json['prev_sibling_path_id'],
194
201
  'nextSiblingPathId': json['next_sibling_path_id'] == null ? undefined : json['next_sibling_path_id'],
@@ -220,6 +227,7 @@ export function ChunkResponseToJSONTyped(value?: ChunkResponse | null, ignoreDis
220
227
  'content': value['content'],
221
228
  'chunk_type': ChunkTypeToJSON(value['chunkType']),
222
229
  'chunk_metadata': ChunkMetadataOutputToJSON(value['chunkMetadata']),
230
+ 'num_tokens': value['numTokens'],
223
231
  'parent_path_id': value['parentPathId'],
224
232
  'prev_sibling_path_id': value['prevSiblingPathId'],
225
233
  'next_sibling_path_id': value['nextSiblingPathId'],
@@ -0,0 +1,52 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ /**
17
+ * Actions that can be performed on a document version.
18
+ * @export
19
+ */
20
+ export const DocumentVersionAction = {
21
+ Reembed: 'reembed'
22
+ } as const;
23
+ export type DocumentVersionAction = typeof DocumentVersionAction[keyof typeof DocumentVersionAction];
24
+
25
+
26
+ export function instanceOfDocumentVersionAction(value: any): boolean {
27
+ for (const key in DocumentVersionAction) {
28
+ if (Object.prototype.hasOwnProperty.call(DocumentVersionAction, key)) {
29
+ if (DocumentVersionAction[key as keyof typeof DocumentVersionAction] === value) {
30
+ return true;
31
+ }
32
+ }
33
+ }
34
+ return false;
35
+ }
36
+
37
+ export function DocumentVersionActionFromJSON(json: any): DocumentVersionAction {
38
+ return DocumentVersionActionFromJSONTyped(json, false);
39
+ }
40
+
41
+ export function DocumentVersionActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentVersionAction {
42
+ return json as DocumentVersionAction;
43
+ }
44
+
45
+ export function DocumentVersionActionToJSON(value?: DocumentVersionAction | null): any {
46
+ return value as any;
47
+ }
48
+
49
+ export function DocumentVersionActionToJSONTyped(value: any, ignoreDiscriminator: boolean): DocumentVersionAction {
50
+ return value as DocumentVersionAction;
51
+ }
52
+
@@ -0,0 +1,111 @@
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 { DocumentVersionAction } from './DocumentVersionAction';
17
+ import {
18
+ DocumentVersionActionFromJSON,
19
+ DocumentVersionActionFromJSONTyped,
20
+ DocumentVersionActionToJSON,
21
+ DocumentVersionActionToJSONTyped,
22
+ } from './DocumentVersionAction';
23
+
24
+ /**
25
+ * Response from a document version action.
26
+ * @export
27
+ * @interface DocumentVersionActionResponse
28
+ */
29
+ export interface DocumentVersionActionResponse {
30
+ /**
31
+ * DocumentVersion ID
32
+ * @type {string}
33
+ * @memberof DocumentVersionActionResponse
34
+ */
35
+ versionId: string;
36
+ /**
37
+ *
38
+ * @type {DocumentVersionAction}
39
+ * @memberof DocumentVersionActionResponse
40
+ */
41
+ action: DocumentVersionAction;
42
+ /**
43
+ * Temporal workflow ID
44
+ * @type {string}
45
+ * @memberof DocumentVersionActionResponse
46
+ */
47
+ workflowId: string;
48
+ }
49
+
50
+
51
+
52
+ /**
53
+ * Check if a given object implements the DocumentVersionActionResponse interface.
54
+ */
55
+ export function instanceOfDocumentVersionActionResponse(value: object): value is DocumentVersionActionResponse {
56
+ if (!('versionId' in value) || value['versionId'] === undefined) return false;
57
+ if (!('action' in value) || value['action'] === undefined) return false;
58
+ if (!('workflowId' in value) || value['workflowId'] === undefined) return false;
59
+ return true;
60
+ }
61
+
62
+ export function DocumentVersionActionResponseFromJSON(json: any): DocumentVersionActionResponse {
63
+ return DocumentVersionActionResponseFromJSONTyped(json, false);
64
+ }
65
+
66
+ export function DocumentVersionActionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentVersionActionResponse {
67
+ if (json == null) {
68
+ return json;
69
+ }
70
+ return {
71
+
72
+ 'versionId': json['version_id'],
73
+ 'action': DocumentVersionActionFromJSON(json['action']),
74
+ 'workflowId': json['workflow_id'],
75
+ };
76
+ }
77
+
78
+ export function DocumentVersionActionResponseToJSON(json: any): DocumentVersionActionResponse {
79
+ return DocumentVersionActionResponseToJSONTyped(json, false);
80
+ }
81
+
82
+ export function DocumentVersionActionResponseToJSONTyped(value?: DocumentVersionActionResponse | null, ignoreDiscriminator: boolean = false): any {
83
+ if (value == null) {
84
+ return value;
85
+ }
86
+
87
+ return {
88
+
89
+ 'version_id': value['versionId'],
90
+ 'action': DocumentVersionActionToJSON(value['action']),
91
+ 'workflow_id': value['workflowId'],
92
+ };
93
+ }
94
+
95
+ export const DocumentVersionActionResponsePropertyValidationAttributesMap: {
96
+ [property: string]: {
97
+ maxLength?: number,
98
+ minLength?: number,
99
+ pattern?: string,
100
+ maximum?: number,
101
+ exclusiveMaximum?: boolean,
102
+ minimum?: number,
103
+ exclusiveMinimum?: boolean,
104
+ multipleOf?: number,
105
+ maxItems?: number,
106
+ minItems?: number,
107
+ uniqueItems?: boolean
108
+ }
109
+ } = {
110
+ }
111
+
@@ -20,9 +20,16 @@ import {
20
20
  PipelineStateToJSON,
21
21
  PipelineStateToJSONTyped,
22
22
  } from './PipelineState';
23
+ import type { InformationStatistics } from './InformationStatistics';
24
+ import {
25
+ InformationStatisticsFromJSON,
26
+ InformationStatisticsFromJSONTyped,
27
+ InformationStatisticsToJSON,
28
+ InformationStatisticsToJSONTyped,
29
+ } from './InformationStatistics';
23
30
 
24
31
  /**
25
- * Schema for document_version.metadata JSONB field.
32
+ * Schema for document_version.system_metadata JSONB field.
26
33
  *
27
34
  * Tracks S3 URLs for generated artifacts, pipeline execution state,
28
35
  * and document statistics. Convention-based paths (images, page screenshots)
@@ -104,6 +111,12 @@ export interface DocumentVersionMetadata {
104
111
  * @memberof DocumentVersionMetadata
105
112
  */
106
113
  xlsxKpiCatalog?: Array<{ [key: string]: any; }> | null;
114
+ /**
115
+ *
116
+ * @type {InformationStatistics}
117
+ * @memberof DocumentVersionMetadata
118
+ */
119
+ informationStatistics?: InformationStatistics;
107
120
  }
108
121
 
109
122
  /**
@@ -135,6 +148,7 @@ export function DocumentVersionMetadataFromJSONTyped(json: any, ignoreDiscrimina
135
148
  'xlsxParseResultS3': json['xlsx_parse_result_s3'] == null ? undefined : json['xlsx_parse_result_s3'],
136
149
  'xlsxNamedRanges': json['xlsx_named_ranges'] == null ? undefined : json['xlsx_named_ranges'],
137
150
  'xlsxKpiCatalog': json['xlsx_kpi_catalog'] == null ? undefined : json['xlsx_kpi_catalog'],
151
+ 'informationStatistics': json['information_statistics'] == null ? undefined : InformationStatisticsFromJSON(json['information_statistics']),
138
152
  };
139
153
  }
140
154
 
@@ -161,6 +175,7 @@ export function DocumentVersionMetadataToJSONTyped(value?: DocumentVersionMetada
161
175
  'xlsx_parse_result_s3': value['xlsxParseResultS3'],
162
176
  'xlsx_named_ranges': value['xlsxNamedRanges'],
163
177
  'xlsx_kpi_catalog': value['xlsxKpiCatalog'],
178
+ 'information_statistics': InformationStatisticsToJSON(value['informationStatistics']),
164
179
  };
165
180
  }
166
181