@knowledge-stack/ksapi 1.60.0 → 1.61.1

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 (62) hide show
  1. package/.openapi-generator/FILES +6 -0
  2. package/README.md +7 -2
  3. package/dist/apis/ChunksApi.d.ts +54 -1
  4. package/dist/apis/ChunksApi.js +53 -0
  5. package/dist/apis/DocumentsApi.d.ts +7 -1
  6. package/dist/apis/DocumentsApi.js +6 -0
  7. package/dist/apis/SectionsApi.d.ts +45 -1
  8. package/dist/apis/SectionsApi.js +44 -0
  9. package/dist/esm/apis/ChunksApi.d.ts +54 -1
  10. package/dist/esm/apis/ChunksApi.js +54 -1
  11. package/dist/esm/apis/DocumentsApi.d.ts +7 -1
  12. package/dist/esm/apis/DocumentsApi.js +6 -0
  13. package/dist/esm/apis/SectionsApi.d.ts +45 -1
  14. package/dist/esm/apis/SectionsApi.js +45 -1
  15. package/dist/esm/models/ChunkNeighborsResponse.d.ts +57 -0
  16. package/dist/esm/models/ChunkNeighborsResponse.js +49 -0
  17. package/dist/esm/models/ConversionEngine.d.ts +25 -0
  18. package/dist/esm/models/ConversionEngine.js +43 -0
  19. package/dist/esm/models/DissolveSectionResponse.d.ts +53 -0
  20. package/dist/esm/models/DissolveSectionResponse.js +48 -0
  21. package/dist/esm/models/DocumentVersionMetadata.d.ts +4 -6
  22. package/dist/esm/models/DocumentVersionMetadata.js +0 -2
  23. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +13 -1
  24. package/dist/esm/models/DocumentVersionMetadataUpdate.js +6 -2
  25. package/dist/esm/models/PipelineState.d.ts +7 -0
  26. package/dist/esm/models/PipelineState.js +3 -0
  27. package/dist/esm/models/index.d.ts +3 -0
  28. package/dist/esm/models/index.js +3 -0
  29. package/dist/models/ChunkNeighborsResponse.d.ts +57 -0
  30. package/dist/models/ChunkNeighborsResponse.js +57 -0
  31. package/dist/models/ConversionEngine.d.ts +25 -0
  32. package/dist/models/ConversionEngine.js +51 -0
  33. package/dist/models/DissolveSectionResponse.d.ts +53 -0
  34. package/dist/models/DissolveSectionResponse.js +56 -0
  35. package/dist/models/DocumentVersionMetadata.d.ts +4 -6
  36. package/dist/models/DocumentVersionMetadata.js +0 -2
  37. package/dist/models/DocumentVersionMetadataUpdate.d.ts +13 -1
  38. package/dist/models/DocumentVersionMetadataUpdate.js +6 -2
  39. package/dist/models/PipelineState.d.ts +7 -0
  40. package/dist/models/PipelineState.js +3 -0
  41. package/dist/models/index.d.ts +3 -0
  42. package/dist/models/index.js +3 -0
  43. package/docs/ChunkNeighborsResponse.md +37 -0
  44. package/docs/ChunksApi.md +84 -0
  45. package/docs/ConversionEngine.md +33 -0
  46. package/docs/DissolveSectionResponse.md +37 -0
  47. package/docs/DocumentVersionMetadata.md +1 -3
  48. package/docs/DocumentVersionMetadataUpdate.md +6 -2
  49. package/docs/DocumentsApi.md +8 -2
  50. package/docs/PipelineState.md +2 -0
  51. package/docs/SectionsApi.md +75 -0
  52. package/package.json +1 -1
  53. package/src/apis/ChunksApi.ts +109 -0
  54. package/src/apis/DocumentsApi.ts +17 -0
  55. package/src/apis/SectionsApi.ts +88 -0
  56. package/src/models/ChunkNeighborsResponse.ts +103 -0
  57. package/src/models/ConversionEngine.ts +53 -0
  58. package/src/models/DissolveSectionResponse.ts +92 -0
  59. package/src/models/DocumentVersionMetadata.ts +4 -8
  60. package/src/models/DocumentVersionMetadataUpdate.ts +19 -3
  61. package/src/models/PipelineState.ts +15 -0
  62. package/src/models/index.ts +3 -0
@@ -0,0 +1,103 @@
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 { SectionContentItemOrChunkContentItem } from './SectionContentItemOrChunkContentItem';
17
+ import {
18
+ SectionContentItemOrChunkContentItemFromJSON,
19
+ SectionContentItemOrChunkContentItemFromJSONTyped,
20
+ SectionContentItemOrChunkContentItemToJSON,
21
+ SectionContentItemOrChunkContentItemToJSONTyped,
22
+ } from './SectionContentItemOrChunkContentItem';
23
+
24
+ /**
25
+ * Response for chunk neighbor traversal.
26
+ *
27
+ * Returns items in the same ``SectionOrChunkItem`` discriminated union
28
+ * format used by the document version contents endpoint.
29
+ * @export
30
+ * @interface ChunkNeighborsResponse
31
+ */
32
+ export interface ChunkNeighborsResponse {
33
+ /**
34
+ * Ordered siblings: preceding → anchor → succeeding
35
+ * @type {Array<SectionContentItemOrChunkContentItem>}
36
+ * @memberof ChunkNeighborsResponse
37
+ */
38
+ items: Array<SectionContentItemOrChunkContentItem>;
39
+ /**
40
+ * Index of the anchor chunk in items
41
+ * @type {number}
42
+ * @memberof ChunkNeighborsResponse
43
+ */
44
+ anchorIndex: number;
45
+ }
46
+
47
+ /**
48
+ * Check if a given object implements the ChunkNeighborsResponse interface.
49
+ */
50
+ export function instanceOfChunkNeighborsResponse(value: object): value is ChunkNeighborsResponse {
51
+ if (!('items' in value) || value['items'] === undefined) return false;
52
+ if (!('anchorIndex' in value) || value['anchorIndex'] === undefined) return false;
53
+ return true;
54
+ }
55
+
56
+ export function ChunkNeighborsResponseFromJSON(json: any): ChunkNeighborsResponse {
57
+ return ChunkNeighborsResponseFromJSONTyped(json, false);
58
+ }
59
+
60
+ export function ChunkNeighborsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChunkNeighborsResponse {
61
+ if (json == null) {
62
+ return json;
63
+ }
64
+ return {
65
+
66
+ 'items': ((json['items'] as Array<any>).map(SectionContentItemOrChunkContentItemFromJSON)),
67
+ 'anchorIndex': json['anchor_index'],
68
+ };
69
+ }
70
+
71
+ export function ChunkNeighborsResponseToJSON(json: any): ChunkNeighborsResponse {
72
+ return ChunkNeighborsResponseToJSONTyped(json, false);
73
+ }
74
+
75
+ export function ChunkNeighborsResponseToJSONTyped(value?: ChunkNeighborsResponse | null, ignoreDiscriminator: boolean = false): any {
76
+ if (value == null) {
77
+ return value;
78
+ }
79
+
80
+ return {
81
+
82
+ 'items': ((value['items'] as Array<any>).map(SectionContentItemOrChunkContentItemToJSON)),
83
+ 'anchor_index': value['anchorIndex'],
84
+ };
85
+ }
86
+
87
+ export const ChunkNeighborsResponsePropertyValidationAttributesMap: {
88
+ [property: string]: {
89
+ maxLength?: number,
90
+ minLength?: number,
91
+ pattern?: string,
92
+ maximum?: number,
93
+ exclusiveMaximum?: boolean,
94
+ minimum?: number,
95
+ exclusiveMinimum?: boolean,
96
+ multipleOf?: number,
97
+ maxItems?: number,
98
+ minItems?: number,
99
+ uniqueItems?: boolean
100
+ }
101
+ } = {
102
+ }
103
+
@@ -0,0 +1,53 @@
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
+ * Document conversion engine selection.
18
+ * @export
19
+ */
20
+ export const ConversionEngine = {
21
+ Standard: 'standard',
22
+ HighAccuracy: 'high_accuracy'
23
+ } as const;
24
+ export type ConversionEngine = typeof ConversionEngine[keyof typeof ConversionEngine];
25
+
26
+
27
+ export function instanceOfConversionEngine(value: any): boolean {
28
+ for (const key in ConversionEngine) {
29
+ if (Object.prototype.hasOwnProperty.call(ConversionEngine, key)) {
30
+ if (ConversionEngine[key as keyof typeof ConversionEngine] === value) {
31
+ return true;
32
+ }
33
+ }
34
+ }
35
+ return false;
36
+ }
37
+
38
+ export function ConversionEngineFromJSON(json: any): ConversionEngine {
39
+ return ConversionEngineFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function ConversionEngineFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConversionEngine {
43
+ return json as ConversionEngine;
44
+ }
45
+
46
+ export function ConversionEngineToJSON(value?: ConversionEngine | null): any {
47
+ return value as any;
48
+ }
49
+
50
+ export function ConversionEngineToJSONTyped(value: any, ignoreDiscriminator: boolean): ConversionEngine {
51
+ return value as ConversionEngine;
52
+ }
53
+
@@ -0,0 +1,92 @@
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
+ * Response from dissolving a section into a text chunk.
18
+ * @export
19
+ * @interface DissolveSectionResponse
20
+ */
21
+ export interface DissolveSectionResponse {
22
+ /**
23
+ * ID of the created text chunk
24
+ * @type {string}
25
+ * @memberof DissolveSectionResponse
26
+ */
27
+ textChunkId: string;
28
+ /**
29
+ * Number of children reparented to the parent
30
+ * @type {number}
31
+ * @memberof DissolveSectionResponse
32
+ */
33
+ reparentedChildren: number;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the DissolveSectionResponse interface.
38
+ */
39
+ export function instanceOfDissolveSectionResponse(value: object): value is DissolveSectionResponse {
40
+ if (!('textChunkId' in value) || value['textChunkId'] === undefined) return false;
41
+ if (!('reparentedChildren' in value) || value['reparentedChildren'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function DissolveSectionResponseFromJSON(json: any): DissolveSectionResponse {
46
+ return DissolveSectionResponseFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function DissolveSectionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DissolveSectionResponse {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'textChunkId': json['text_chunk_id'],
56
+ 'reparentedChildren': json['reparented_children'],
57
+ };
58
+ }
59
+
60
+ export function DissolveSectionResponseToJSON(json: any): DissolveSectionResponse {
61
+ return DissolveSectionResponseToJSONTyped(json, false);
62
+ }
63
+
64
+ export function DissolveSectionResponseToJSONTyped(value?: DissolveSectionResponse | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'text_chunk_id': value['textChunkId'],
72
+ 'reparented_children': value['reparentedChildren'],
73
+ };
74
+ }
75
+
76
+ export const DissolveSectionResponsePropertyValidationAttributesMap: {
77
+ [property: string]: {
78
+ maxLength?: number,
79
+ minLength?: number,
80
+ pattern?: string,
81
+ maximum?: number,
82
+ exclusiveMaximum?: boolean,
83
+ minimum?: number,
84
+ exclusiveMinimum?: boolean,
85
+ multipleOf?: number,
86
+ maxItems?: number,
87
+ minItems?: number,
88
+ uniqueItems?: boolean
89
+ }
90
+ } = {
91
+ }
92
+
@@ -35,6 +35,10 @@ import {
35
35
  * and document statistics. Convention-based paths (images, page screenshots)
36
36
  * are derived from document_id/document_version_id via s3_paths helpers,
37
37
  * using a flat S3 layout: documents/{document_id}/{document_version_id}/...
38
+ *
39
+ * Internal conversion artifact paths (standard_pipeline_json_s3, high_accuracy_*_s3) are
40
+ * excluded from API responses via ``Field(exclude=True)`` so we don't
41
+ * expose underlying technology names to external consumers.
38
42
  * @export
39
43
  * @interface DocumentVersionMetadata
40
44
  */
@@ -51,12 +55,6 @@ export interface DocumentVersionMetadata {
51
55
  * @memberof DocumentVersionMetadata
52
56
  */
53
57
  cleanedSourceS3?: string | null;
54
- /**
55
- * S3 URL to the Docling JSON conversion output
56
- * @type {string}
57
- * @memberof DocumentVersionMetadata
58
- */
59
- doclingJsonS3?: string | null;
60
58
  /**
61
59
  * S3 URL to the fast plaintext export of the document
62
60
  * @type {string}
@@ -144,7 +142,6 @@ export function DocumentVersionMetadataFromJSONTyped(json: any, ignoreDiscrimina
144
142
 
145
143
  'sourceS3': json['source_s3'] == null ? undefined : json['source_s3'],
146
144
  'cleanedSourceS3': json['cleaned_source_s3'] == null ? undefined : json['cleaned_source_s3'],
147
- 'doclingJsonS3': json['docling_json_s3'] == null ? undefined : json['docling_json_s3'],
148
145
  'fastPlaintextS3': json['fast_plaintext_s3'] == null ? undefined : json['fast_plaintext_s3'],
149
146
  'hash': json['hash'] == null ? undefined : json['hash'],
150
147
  'pipelineState': json['pipeline_state'] == null ? undefined : PipelineStateFromJSON(json['pipeline_state']),
@@ -172,7 +169,6 @@ export function DocumentVersionMetadataToJSONTyped(value?: DocumentVersionMetada
172
169
 
173
170
  'source_s3': value['sourceS3'],
174
171
  'cleaned_source_s3': value['cleanedSourceS3'],
175
- 'docling_json_s3': value['doclingJsonS3'],
176
172
  'fast_plaintext_s3': value['fastPlaintextS3'],
177
173
  'hash': value['hash'],
178
174
  'pipeline_state': PipelineStateToJSON(value['pipelineState']),
@@ -54,13 +54,25 @@ export interface DocumentVersionMetadataUpdate {
54
54
  * @type {string}
55
55
  * @memberof DocumentVersionMetadataUpdate
56
56
  */
57
- doclingJsonS3?: string | null;
57
+ standardPipelineJsonS3?: string | null;
58
58
  /**
59
59
  *
60
60
  * @type {string}
61
61
  * @memberof DocumentVersionMetadataUpdate
62
62
  */
63
63
  fastPlaintextS3?: string | null;
64
+ /**
65
+ *
66
+ * @type {string}
67
+ * @memberof DocumentVersionMetadataUpdate
68
+ */
69
+ highAccuracyContentListS3?: string | null;
70
+ /**
71
+ *
72
+ * @type {string}
73
+ * @memberof DocumentVersionMetadataUpdate
74
+ */
75
+ highAccuracyMiddleS3?: string | null;
64
76
  /**
65
77
  *
66
78
  * @type {string}
@@ -142,8 +154,10 @@ export function DocumentVersionMetadataUpdateFromJSONTyped(json: any, ignoreDisc
142
154
 
143
155
  'sourceS3': json['source_s3'] == null ? undefined : json['source_s3'],
144
156
  'cleanedSourceS3': json['cleaned_source_s3'] == null ? undefined : json['cleaned_source_s3'],
145
- 'doclingJsonS3': json['docling_json_s3'] == null ? undefined : json['docling_json_s3'],
157
+ 'standardPipelineJsonS3': json['standard_pipeline_json_s3'] == null ? undefined : json['standard_pipeline_json_s3'],
146
158
  'fastPlaintextS3': json['fast_plaintext_s3'] == null ? undefined : json['fast_plaintext_s3'],
159
+ 'highAccuracyContentListS3': json['high_accuracy_content_list_s3'] == null ? undefined : json['high_accuracy_content_list_s3'],
160
+ 'highAccuracyMiddleS3': json['high_accuracy_middle_s3'] == null ? undefined : json['high_accuracy_middle_s3'],
147
161
  'hash': json['hash'] == null ? undefined : json['hash'],
148
162
  'pipelineState': json['pipeline_state'] == null ? undefined : PipelineStateFromJSON(json['pipeline_state']),
149
163
  'totalPages': json['total_pages'] == null ? undefined : json['total_pages'],
@@ -170,8 +184,10 @@ export function DocumentVersionMetadataUpdateToJSONTyped(value?: DocumentVersion
170
184
 
171
185
  'source_s3': value['sourceS3'],
172
186
  'cleaned_source_s3': value['cleanedSourceS3'],
173
- 'docling_json_s3': value['doclingJsonS3'],
187
+ 'standard_pipeline_json_s3': value['standardPipelineJsonS3'],
174
188
  'fast_plaintext_s3': value['fastPlaintextS3'],
189
+ 'high_accuracy_content_list_s3': value['highAccuracyContentListS3'],
190
+ 'high_accuracy_middle_s3': value['highAccuracyMiddleS3'],
175
191
  'hash': value['hash'],
176
192
  'pipeline_state': PipelineStateToJSON(value['pipelineState']),
177
193
  'total_pages': value['totalPages'],
@@ -20,6 +20,13 @@ import {
20
20
  PipelineStatusToJSON,
21
21
  PipelineStatusToJSONTyped,
22
22
  } from './PipelineStatus';
23
+ import type { ConversionEngine } from './ConversionEngine';
24
+ import {
25
+ ConversionEngineFromJSON,
26
+ ConversionEngineFromJSONTyped,
27
+ ConversionEngineToJSON,
28
+ ConversionEngineToJSONTyped,
29
+ } from './ConversionEngine';
23
30
  import type { IngestionMode } from './IngestionMode';
24
31
  import {
25
32
  IngestionModeFromJSON,
@@ -101,6 +108,12 @@ export interface PipelineState {
101
108
  * @memberof PipelineState
102
109
  */
103
110
  chunkType?: ChunkType;
111
+ /**
112
+ *
113
+ * @type {ConversionEngine}
114
+ * @memberof PipelineState
115
+ */
116
+ conversionEngine?: ConversionEngine;
104
117
  }
105
118
 
106
119
 
@@ -133,6 +146,7 @@ export function PipelineStateFromJSONTyped(json: any, ignoreDiscriminator: boole
133
146
  'pageDpi': json['page_dpi'] == null ? undefined : json['page_dpi'],
134
147
  'ingestionMode': json['ingestion_mode'] == null ? undefined : IngestionModeFromJSON(json['ingestion_mode']),
135
148
  'chunkType': json['chunk_type'] == null ? undefined : ChunkTypeFromJSON(json['chunk_type']),
149
+ 'conversionEngine': json['conversion_engine'] == null ? undefined : ConversionEngineFromJSON(json['conversion_engine']),
136
150
  };
137
151
  }
138
152
 
@@ -157,6 +171,7 @@ export function PipelineStateToJSONTyped(value?: PipelineState | null, ignoreDis
157
171
  'page_dpi': value['pageDpi'],
158
172
  'ingestion_mode': IngestionModeToJSON(value['ingestionMode']),
159
173
  'chunk_type': ChunkTypeToJSON(value['chunkType']),
174
+ 'conversion_engine': ConversionEngineToJSON(value['conversionEngine']),
160
175
  };
161
176
  }
162
177
 
@@ -13,11 +13,13 @@ export * from './ChunkDocumentVersionResponse';
13
13
  export * from './ChunkLineageResponse';
14
14
  export * from './ChunkMetadataInput';
15
15
  export * from './ChunkMetadataOutput';
16
+ export * from './ChunkNeighborsResponse';
16
17
  export * from './ChunkResponse';
17
18
  export * from './ChunkSearchRequest';
18
19
  export * from './ChunkType';
19
20
  export * from './Citation';
20
21
  export * from './ClearVersionContentsResponse';
22
+ export * from './ConversionEngine';
21
23
  export * from './CreateApiKeyRequest';
22
24
  export * from './CreateApiKeyResponse';
23
25
  export * from './CreateChunkLineageRequest';
@@ -31,6 +33,7 @@ export * from './CreateTagRequest';
31
33
  export * from './CreateTenantRequest';
32
34
  export * from './CreateThreadMessageRequest';
33
35
  export * from './CreateThreadRequest';
36
+ export * from './DissolveSectionResponse';
34
37
  export * from './DocumentOrigin';
35
38
  export * from './DocumentResponse';
36
39
  export * from './DocumentType';