@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
@@ -20,6 +20,13 @@ 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
32
  * Partial update schema for document version metadata.
@@ -102,6 +109,12 @@ export interface DocumentVersionMetadataUpdate {
102
109
  * @memberof DocumentVersionMetadataUpdate
103
110
  */
104
111
  xlsxKpiCatalog?: Array<{ [key: string]: any; }> | null;
112
+ /**
113
+ *
114
+ * @type {InformationStatistics}
115
+ * @memberof DocumentVersionMetadataUpdate
116
+ */
117
+ informationStatistics?: InformationStatistics;
105
118
  }
106
119
 
107
120
  /**
@@ -133,6 +146,7 @@ export function DocumentVersionMetadataUpdateFromJSONTyped(json: any, ignoreDisc
133
146
  'xlsxParseResultS3': json['xlsx_parse_result_s3'] == null ? undefined : json['xlsx_parse_result_s3'],
134
147
  'xlsxNamedRanges': json['xlsx_named_ranges'] == null ? undefined : json['xlsx_named_ranges'],
135
148
  'xlsxKpiCatalog': json['xlsx_kpi_catalog'] == null ? undefined : json['xlsx_kpi_catalog'],
149
+ 'informationStatistics': json['information_statistics'] == null ? undefined : InformationStatisticsFromJSON(json['information_statistics']),
136
150
  };
137
151
  }
138
152
 
@@ -159,6 +173,7 @@ export function DocumentVersionMetadataUpdateToJSONTyped(value?: DocumentVersion
159
173
  'xlsx_parse_result_s3': value['xlsxParseResultS3'],
160
174
  'xlsx_named_ranges': value['xlsxNamedRanges'],
161
175
  'xlsx_kpi_catalog': value['xlsxKpiCatalog'],
176
+ 'information_statistics': InformationStatisticsToJSON(value['informationStatistics']),
162
177
  };
163
178
  }
164
179
 
@@ -101,7 +101,7 @@ export interface DocumentVersionResponse {
101
101
  * @type {DocumentVersionMetadata}
102
102
  * @memberof DocumentVersionResponse
103
103
  */
104
- metadata?: DocumentVersionMetadata;
104
+ systemMetadata?: DocumentVersionMetadata;
105
105
  }
106
106
 
107
107
  /**
@@ -142,7 +142,7 @@ export function DocumentVersionResponseFromJSONTyped(json: any, ignoreDiscrimina
142
142
  'createdAt': (new Date(json['created_at'])),
143
143
  'updatedAt': (new Date(json['updated_at'])),
144
144
  'assetS3Url': json['asset_s3_url'] == null ? undefined : json['asset_s3_url'],
145
- 'metadata': json['metadata'] == null ? undefined : DocumentVersionMetadataFromJSON(json['metadata']),
145
+ 'systemMetadata': json['system_metadata'] == null ? undefined : DocumentVersionMetadataFromJSON(json['system_metadata']),
146
146
  };
147
147
  }
148
148
 
@@ -168,7 +168,7 @@ export function DocumentVersionResponseToJSONTyped(value?: DocumentVersionRespon
168
168
  'created_at': value['createdAt'].toISOString(),
169
169
  'updated_at': value['updatedAt'].toISOString(),
170
170
  'asset_s3_url': value['assetS3Url'],
171
- 'metadata': DocumentVersionMetadataToJSON(value['metadata']),
171
+ 'system_metadata': DocumentVersionMetadataToJSON(value['systemMetadata']),
172
172
  };
173
173
  }
174
174
 
@@ -0,0 +1,106 @@
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
+ /**
17
+ * Aggregate statistics for a section subtree or document version.
18
+ * @export
19
+ * @interface InformationStatistics
20
+ */
21
+ export interface InformationStatistics {
22
+ /**
23
+ * Count of chunks by type (e.g. {"TEXT": 42, "TABLE": 3})
24
+ * @type {{ [key: string]: number; }}
25
+ * @memberof InformationStatistics
26
+ */
27
+ numChunksByType?: { [key: string]: number; };
28
+ /**
29
+ * Sum of all chunk content tokens in subtree
30
+ * @type {number}
31
+ * @memberof InformationStatistics
32
+ */
33
+ totalTokens?: number;
34
+ /**
35
+ * Count of immediate children (sections + chunks)
36
+ * @type {number}
37
+ * @memberof InformationStatistics
38
+ */
39
+ numDirectChildren?: number;
40
+ /**
41
+ * Max depth to deepest leaf (0 = no children)
42
+ * @type {number}
43
+ * @memberof InformationStatistics
44
+ */
45
+ childrenDepth?: number;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the InformationStatistics interface.
50
+ */
51
+ export function instanceOfInformationStatistics(value: object): value is InformationStatistics {
52
+ return true;
53
+ }
54
+
55
+ export function InformationStatisticsFromJSON(json: any): InformationStatistics {
56
+ return InformationStatisticsFromJSONTyped(json, false);
57
+ }
58
+
59
+ export function InformationStatisticsFromJSONTyped(json: any, ignoreDiscriminator: boolean): InformationStatistics {
60
+ if (json == null) {
61
+ return json;
62
+ }
63
+ return {
64
+
65
+ 'numChunksByType': json['num_chunks_by_type'] == null ? undefined : json['num_chunks_by_type'],
66
+ 'totalTokens': json['total_tokens'] == null ? undefined : json['total_tokens'],
67
+ 'numDirectChildren': json['num_direct_children'] == null ? undefined : json['num_direct_children'],
68
+ 'childrenDepth': json['children_depth'] == null ? undefined : json['children_depth'],
69
+ };
70
+ }
71
+
72
+ export function InformationStatisticsToJSON(json: any): InformationStatistics {
73
+ return InformationStatisticsToJSONTyped(json, false);
74
+ }
75
+
76
+ export function InformationStatisticsToJSONTyped(value?: InformationStatistics | null, ignoreDiscriminator: boolean = false): any {
77
+ if (value == null) {
78
+ return value;
79
+ }
80
+
81
+ return {
82
+
83
+ 'num_chunks_by_type': value['numChunksByType'],
84
+ 'total_tokens': value['totalTokens'],
85
+ 'num_direct_children': value['numDirectChildren'],
86
+ 'children_depth': value['childrenDepth'],
87
+ };
88
+ }
89
+
90
+ export const InformationStatisticsPropertyValidationAttributesMap: {
91
+ [property: string]: {
92
+ maxLength?: number,
93
+ minLength?: number,
94
+ pattern?: string,
95
+ maximum?: number,
96
+ exclusiveMaximum?: boolean,
97
+ minimum?: number,
98
+ exclusiveMinimum?: boolean,
99
+ multipleOf?: number,
100
+ maxItems?: number,
101
+ minItems?: number,
102
+ uniqueItems?: boolean
103
+ }
104
+ } = {
105
+ }
106
+
@@ -84,6 +84,12 @@ export interface ScoredChunkResponse {
84
84
  * @memberof ScoredChunkResponse
85
85
  */
86
86
  chunkMetadata: ChunkMetadataOutput;
87
+ /**
88
+ * Number of tokens in chunk content
89
+ * @type {number}
90
+ * @memberof ScoredChunkResponse
91
+ */
92
+ numTokens?: number | null;
87
93
  /**
88
94
  * Parent PathPart ID
89
95
  * @type {string}
@@ -196,6 +202,7 @@ export function ScoredChunkResponseFromJSONTyped(json: any, ignoreDiscriminator:
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 ScoredChunkResponseToJSONTyped(value?: ScoredChunkResponse | nul
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'],
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { SectionSystemMetadata } from './SectionSystemMetadata';
17
+ import {
18
+ SectionSystemMetadataFromJSON,
19
+ SectionSystemMetadataFromJSONTyped,
20
+ SectionSystemMetadataToJSON,
21
+ SectionSystemMetadataToJSONTyped,
22
+ } from './SectionSystemMetadata';
23
+
16
24
  /**
17
25
  * Section response model.
18
26
  * @export
@@ -73,6 +81,12 @@ export interface SectionResponse {
73
81
  * @memberof SectionResponse
74
82
  */
75
83
  systemManaged: boolean;
84
+ /**
85
+ *
86
+ * @type {SectionSystemMetadata}
87
+ * @memberof SectionResponse
88
+ */
89
+ systemMetadata?: SectionSystemMetadata;
76
90
  /**
77
91
  * Tenant ID
78
92
  * @type {string}
@@ -128,6 +142,7 @@ export function SectionResponseFromJSONTyped(json: any, ignoreDiscriminator: boo
128
142
  'nextSiblingPathId': json['next_sibling_path_id'] == null ? undefined : json['next_sibling_path_id'],
129
143
  'materializedPath': json['materialized_path'],
130
144
  'systemManaged': json['system_managed'],
145
+ 'systemMetadata': json['system_metadata'] == null ? undefined : SectionSystemMetadataFromJSON(json['system_metadata']),
131
146
  'tenantId': json['tenant_id'],
132
147
  'createdAt': (new Date(json['created_at'])),
133
148
  'updatedAt': (new Date(json['updated_at'])),
@@ -154,6 +169,7 @@ export function SectionResponseToJSONTyped(value?: SectionResponse | null, ignor
154
169
  'next_sibling_path_id': value['nextSiblingPathId'],
155
170
  'materialized_path': value['materializedPath'],
156
171
  'system_managed': value['systemManaged'],
172
+ 'system_metadata': SectionSystemMetadataToJSON(value['systemMetadata']),
157
173
  'tenant_id': value['tenantId'],
158
174
  'created_at': value['createdAt'].toISOString(),
159
175
  'updated_at': value['updatedAt'].toISOString(),
@@ -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 { InformationStatistics } from './InformationStatistics';
17
+ import {
18
+ InformationStatisticsFromJSON,
19
+ InformationStatisticsFromJSONTyped,
20
+ InformationStatisticsToJSON,
21
+ InformationStatisticsToJSONTyped,
22
+ } from './InformationStatistics';
23
+
24
+ /**
25
+ * Schema for section.system_metadata JSONB field.
26
+ * @export
27
+ * @interface SectionSystemMetadata
28
+ */
29
+ export interface SectionSystemMetadata {
30
+ /**
31
+ *
32
+ * @type {InformationStatistics}
33
+ * @memberof SectionSystemMetadata
34
+ */
35
+ informationStatistics?: InformationStatistics;
36
+ }
37
+
38
+ /**
39
+ * Check if a given object implements the SectionSystemMetadata interface.
40
+ */
41
+ export function instanceOfSectionSystemMetadata(value: object): value is SectionSystemMetadata {
42
+ return true;
43
+ }
44
+
45
+ export function SectionSystemMetadataFromJSON(json: any): SectionSystemMetadata {
46
+ return SectionSystemMetadataFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function SectionSystemMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SectionSystemMetadata {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'informationStatistics': json['information_statistics'] == null ? undefined : InformationStatisticsFromJSON(json['information_statistics']),
56
+ };
57
+ }
58
+
59
+ export function SectionSystemMetadataToJSON(json: any): SectionSystemMetadata {
60
+ return SectionSystemMetadataToJSONTyped(json, false);
61
+ }
62
+
63
+ export function SectionSystemMetadataToJSONTyped(value?: SectionSystemMetadata | null, ignoreDiscriminator: boolean = false): any {
64
+ if (value == null) {
65
+ return value;
66
+ }
67
+
68
+ return {
69
+
70
+ 'information_statistics': InformationStatisticsToJSON(value['informationStatistics']),
71
+ };
72
+ }
73
+
74
+ export const SectionSystemMetadataPropertyValidationAttributesMap: {
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
+
@@ -33,6 +33,8 @@ export * from './CreateThreadRequest';
33
33
  export * from './DocumentOrigin';
34
34
  export * from './DocumentResponse';
35
35
  export * from './DocumentType';
36
+ export * from './DocumentVersionAction';
37
+ export * from './DocumentVersionActionResponse';
36
38
  export * from './DocumentVersionMetadata';
37
39
  export * from './DocumentVersionMetadataUpdate';
38
40
  export * from './DocumentVersionResponse';
@@ -49,6 +51,7 @@ export * from './HTTPValidationError';
49
51
  export * from './HealthCheckResponse';
50
52
  export * from './IdpType';
51
53
  export * from './ImageTaxonomy';
54
+ export * from './InformationStatistics';
52
55
  export * from './IngestDocumentResponse';
53
56
  export * from './IngestionMode';
54
57
  export * from './InviteResponse';
@@ -93,6 +96,7 @@ export * from './SearchType';
93
96
  export * from './SectionContentItem';
94
97
  export * from './SectionContentItemOrChunkContentItem';
95
98
  export * from './SectionResponse';
99
+ export * from './SectionSystemMetadata';
96
100
  export * from './SignInRequest';
97
101
  export * from './StepInput';
98
102
  export * from './StepKind';