@knowledge-stack/ksapi 1.60.0 → 1.61.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.
- package/.openapi-generator/FILES +4 -0
- package/README.md +5 -2
- package/dist/apis/DocumentsApi.d.ts +7 -1
- package/dist/apis/DocumentsApi.js +6 -0
- package/dist/apis/SectionsApi.d.ts +45 -1
- package/dist/apis/SectionsApi.js +44 -0
- package/dist/esm/apis/DocumentsApi.d.ts +7 -1
- package/dist/esm/apis/DocumentsApi.js +6 -0
- package/dist/esm/apis/SectionsApi.d.ts +45 -1
- package/dist/esm/apis/SectionsApi.js +45 -1
- package/dist/esm/models/ConversionEngine.d.ts +25 -0
- package/dist/esm/models/ConversionEngine.js +43 -0
- package/dist/esm/models/DissolveSectionResponse.d.ts +53 -0
- package/dist/esm/models/DissolveSectionResponse.js +48 -0
- package/dist/esm/models/DocumentVersionMetadata.d.ts +4 -6
- package/dist/esm/models/DocumentVersionMetadata.js +0 -2
- package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +13 -1
- package/dist/esm/models/DocumentVersionMetadataUpdate.js +6 -2
- package/dist/esm/models/PipelineState.d.ts +7 -0
- package/dist/esm/models/PipelineState.js +3 -0
- package/dist/esm/models/index.d.ts +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/models/ConversionEngine.d.ts +25 -0
- package/dist/models/ConversionEngine.js +51 -0
- package/dist/models/DissolveSectionResponse.d.ts +53 -0
- package/dist/models/DissolveSectionResponse.js +56 -0
- package/dist/models/DocumentVersionMetadata.d.ts +4 -6
- package/dist/models/DocumentVersionMetadata.js +0 -2
- package/dist/models/DocumentVersionMetadataUpdate.d.ts +13 -1
- package/dist/models/DocumentVersionMetadataUpdate.js +6 -2
- package/dist/models/PipelineState.d.ts +7 -0
- package/dist/models/PipelineState.js +3 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +2 -0
- package/docs/ConversionEngine.md +33 -0
- package/docs/DissolveSectionResponse.md +37 -0
- package/docs/DocumentVersionMetadata.md +1 -3
- package/docs/DocumentVersionMetadataUpdate.md +6 -2
- package/docs/DocumentsApi.md +8 -2
- package/docs/PipelineState.md +2 -0
- package/docs/SectionsApi.md +75 -0
- package/package.json +1 -1
- package/src/apis/DocumentsApi.ts +17 -0
- package/src/apis/SectionsApi.ts +88 -0
- package/src/models/ConversionEngine.ts +53 -0
- package/src/models/DissolveSectionResponse.ts +92 -0
- package/src/models/DocumentVersionMetadata.ts +4 -8
- package/src/models/DocumentVersionMetadataUpdate.ts +19 -3
- package/src/models/PipelineState.ts +15 -0
- package/src/models/index.ts +2 -0
package/docs/DocumentsApi.md
CHANGED
|
@@ -241,7 +241,7 @@ No authorization required
|
|
|
241
241
|
|
|
242
242
|
## ingestDocument
|
|
243
243
|
|
|
244
|
-
> IngestDocumentResponse ingestDocument(file, pathPartId, authorization, ksUat, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi)
|
|
244
|
+
> IngestDocumentResponse ingestDocument(file, pathPartId, authorization, ksUat, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, conversionEngine)
|
|
245
245
|
|
|
246
246
|
Ingest Document Handler
|
|
247
247
|
|
|
@@ -279,6 +279,8 @@ async function example() {
|
|
|
279
279
|
secondaryTaxonomy: ...,
|
|
280
280
|
// number | DPI for PDF page screenshots (default 72, min 36, max 216). (optional)
|
|
281
281
|
pageDpi: 56,
|
|
282
|
+
// ConversionEngine (optional)
|
|
283
|
+
conversionEngine: ...,
|
|
282
284
|
} satisfies IngestDocumentRequest;
|
|
283
285
|
|
|
284
286
|
try {
|
|
@@ -307,6 +309,7 @@ example().catch(console.error);
|
|
|
307
309
|
| **chunkType** | `ChunkType` | | [Optional] [Defaults to `undefined`] [Enum: TEXT, TABLE, IMAGE, HTML, UNKNOWN] |
|
|
308
310
|
| **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
|
|
309
311
|
| **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
|
|
312
|
+
| **conversionEngine** | `ConversionEngine` | | [Optional] [Defaults to `undefined`] [Enum: standard, high_accuracy] |
|
|
310
313
|
|
|
311
314
|
### Return type
|
|
312
315
|
|
|
@@ -333,7 +336,7 @@ No authorization required
|
|
|
333
336
|
|
|
334
337
|
## ingestDocumentVersion
|
|
335
338
|
|
|
336
|
-
> IngestDocumentResponse ingestDocumentVersion(documentId, file, authorization, ksUat, ingestionMode, chunkType, secondaryTaxonomy, pageDpi)
|
|
339
|
+
> IngestDocumentResponse ingestDocumentVersion(documentId, file, authorization, ksUat, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, conversionEngine)
|
|
337
340
|
|
|
338
341
|
Ingest Document Version Handler
|
|
339
342
|
|
|
@@ -369,6 +372,8 @@ async function example() {
|
|
|
369
372
|
secondaryTaxonomy: ...,
|
|
370
373
|
// number | DPI for PDF page screenshots (default 72, min 36, max 216). (optional)
|
|
371
374
|
pageDpi: 56,
|
|
375
|
+
// ConversionEngine (optional)
|
|
376
|
+
conversionEngine: ...,
|
|
372
377
|
} satisfies IngestDocumentVersionRequest;
|
|
373
378
|
|
|
374
379
|
try {
|
|
@@ -396,6 +401,7 @@ example().catch(console.error);
|
|
|
396
401
|
| **chunkType** | `ChunkType` | | [Optional] [Defaults to `undefined`] [Enum: TEXT, TABLE, IMAGE, HTML, UNKNOWN] |
|
|
397
402
|
| **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
|
|
398
403
|
| **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
|
|
404
|
+
| **conversionEngine** | `ConversionEngine` | | [Optional] [Defaults to `undefined`] [Enum: standard, high_accuracy] |
|
|
399
405
|
|
|
400
406
|
### Return type
|
|
401
407
|
|
package/docs/PipelineState.md
CHANGED
|
@@ -17,6 +17,7 @@ Name | Type
|
|
|
17
17
|
`pageDpi` | number
|
|
18
18
|
`ingestionMode` | [IngestionMode](IngestionMode.md)
|
|
19
19
|
`chunkType` | [ChunkType](ChunkType.md)
|
|
20
|
+
`conversionEngine` | [ConversionEngine](ConversionEngine.md)
|
|
20
21
|
|
|
21
22
|
## Example
|
|
22
23
|
|
|
@@ -35,6 +36,7 @@ const example = {
|
|
|
35
36
|
"pageDpi": null,
|
|
36
37
|
"ingestionMode": null,
|
|
37
38
|
"chunkType": null,
|
|
39
|
+
"conversionEngine": null,
|
|
38
40
|
} satisfies PipelineState
|
|
39
41
|
|
|
40
42
|
console.log(example)
|
package/docs/SectionsApi.md
CHANGED
|
@@ -6,6 +6,7 @@ All URIs are relative to *http://localhost:8000*
|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
| [**createSection**](SectionsApi.md#createsectionoperation) | **POST** /v1/sections | Create Section Handler |
|
|
8
8
|
| [**deleteSection**](SectionsApi.md#deletesection) | **DELETE** /v1/sections/{section_id} | Delete Section Handler |
|
|
9
|
+
| [**dissolveSection**](SectionsApi.md#dissolvesection) | **POST** /v1/sections/{section_id}/dissolve | Dissolve Section Handler |
|
|
9
10
|
| [**getSection**](SectionsApi.md#getsection) | **GET** /v1/sections/{section_id} | Get Section Handler |
|
|
10
11
|
| [**getSectionsBulk**](SectionsApi.md#getsectionsbulk) | **GET** /v1/sections/bulk | Get Sections Bulk Handler |
|
|
11
12
|
| [**updateSection**](SectionsApi.md#updatesectionoperation) | **PATCH** /v1/sections/{section_id} | Update Section Handler |
|
|
@@ -160,6 +161,80 @@ No authorization required
|
|
|
160
161
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
161
162
|
|
|
162
163
|
|
|
164
|
+
## dissolveSection
|
|
165
|
+
|
|
166
|
+
> DissolveSectionResponse dissolveSection(sectionId, authorization, ksUat)
|
|
167
|
+
|
|
168
|
+
Dissolve Section Handler
|
|
169
|
+
|
|
170
|
+
Dissolve a section: convert it to a text chunk, reparent children, delete the section. The section\'s name becomes the content of a new TEXT chunk. Any children of the section are reparented to the section\'s parent, preserving order. The section itself is then deleted.
|
|
171
|
+
|
|
172
|
+
### Example
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
import {
|
|
176
|
+
Configuration,
|
|
177
|
+
SectionsApi,
|
|
178
|
+
} from '@knowledge-stack/ksapi';
|
|
179
|
+
import type { DissolveSectionRequest } from '@knowledge-stack/ksapi';
|
|
180
|
+
|
|
181
|
+
async function example() {
|
|
182
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
183
|
+
const api = new SectionsApi();
|
|
184
|
+
|
|
185
|
+
const body = {
|
|
186
|
+
// string
|
|
187
|
+
sectionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
188
|
+
// string (optional)
|
|
189
|
+
authorization: authorization_example,
|
|
190
|
+
// string (optional)
|
|
191
|
+
ksUat: ksUat_example,
|
|
192
|
+
} satisfies DissolveSectionRequest;
|
|
193
|
+
|
|
194
|
+
try {
|
|
195
|
+
const data = await api.dissolveSection(body);
|
|
196
|
+
console.log(data);
|
|
197
|
+
} catch (error) {
|
|
198
|
+
console.error(error);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Run the test
|
|
203
|
+
example().catch(console.error);
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Parameters
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
| Name | Type | Description | Notes |
|
|
210
|
+
|------------- | ------------- | ------------- | -------------|
|
|
211
|
+
| **sectionId** | `string` | | [Defaults to `undefined`] |
|
|
212
|
+
| **authorization** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
213
|
+
| **ksUat** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
214
|
+
|
|
215
|
+
### Return type
|
|
216
|
+
|
|
217
|
+
[**DissolveSectionResponse**](DissolveSectionResponse.md)
|
|
218
|
+
|
|
219
|
+
### Authorization
|
|
220
|
+
|
|
221
|
+
No authorization required
|
|
222
|
+
|
|
223
|
+
### HTTP request headers
|
|
224
|
+
|
|
225
|
+
- **Content-Type**: Not defined
|
|
226
|
+
- **Accept**: `application/json`
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
### HTTP response details
|
|
230
|
+
| Status code | Description | Response headers |
|
|
231
|
+
|-------------|-------------|------------------|
|
|
232
|
+
| **200** | Successful Response | - |
|
|
233
|
+
| **422** | Validation Error | - |
|
|
234
|
+
|
|
235
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
236
|
+
|
|
237
|
+
|
|
163
238
|
## getSection
|
|
164
239
|
|
|
165
240
|
> SectionResponse getSection(sectionId, authorization, ksUat)
|
package/package.json
CHANGED
package/src/apis/DocumentsApi.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
ChunkType,
|
|
19
|
+
ConversionEngine,
|
|
19
20
|
CreateDocumentRequest,
|
|
20
21
|
DocumentResponse,
|
|
21
22
|
HTTPValidationError,
|
|
@@ -29,6 +30,8 @@ import type {
|
|
|
29
30
|
import {
|
|
30
31
|
ChunkTypeFromJSON,
|
|
31
32
|
ChunkTypeToJSON,
|
|
33
|
+
ConversionEngineFromJSON,
|
|
34
|
+
ConversionEngineToJSON,
|
|
32
35
|
CreateDocumentRequestFromJSON,
|
|
33
36
|
CreateDocumentRequestToJSON,
|
|
34
37
|
DocumentResponseFromJSON,
|
|
@@ -78,6 +81,7 @@ export interface IngestDocumentRequest {
|
|
|
78
81
|
chunkType?: ChunkType;
|
|
79
82
|
secondaryTaxonomy?: ImageTaxonomy;
|
|
80
83
|
pageDpi?: number;
|
|
84
|
+
conversionEngine?: ConversionEngine;
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
export interface IngestDocumentVersionRequest {
|
|
@@ -89,6 +93,7 @@ export interface IngestDocumentVersionRequest {
|
|
|
89
93
|
chunkType?: ChunkType;
|
|
90
94
|
secondaryTaxonomy?: ImageTaxonomy;
|
|
91
95
|
pageDpi?: number;
|
|
96
|
+
conversionEngine?: ConversionEngine;
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
export interface ListDocumentsRequest {
|
|
@@ -212,6 +217,7 @@ export interface DocumentsApiInterface {
|
|
|
212
217
|
* @param {ChunkType} [chunkType]
|
|
213
218
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
214
219
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
220
|
+
* @param {ConversionEngine} [conversionEngine]
|
|
215
221
|
* @throws {RequiredError}
|
|
216
222
|
* @memberof DocumentsApiInterface
|
|
217
223
|
*/
|
|
@@ -229,6 +235,7 @@ export interface DocumentsApiInterface {
|
|
|
229
235
|
* @param {ChunkType} [chunkType]
|
|
230
236
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
231
237
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
238
|
+
* @param {ConversionEngine} [conversionEngine]
|
|
232
239
|
* @param {*} [options] Override http request option.
|
|
233
240
|
* @throws {RequiredError}
|
|
234
241
|
* @memberof DocumentsApiInterface
|
|
@@ -251,6 +258,7 @@ export interface DocumentsApiInterface {
|
|
|
251
258
|
* @param {ChunkType} [chunkType]
|
|
252
259
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
253
260
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
261
|
+
* @param {ConversionEngine} [conversionEngine]
|
|
254
262
|
* @throws {RequiredError}
|
|
255
263
|
* @memberof DocumentsApiInterface
|
|
256
264
|
*/
|
|
@@ -267,6 +275,7 @@ export interface DocumentsApiInterface {
|
|
|
267
275
|
* @param {ChunkType} [chunkType]
|
|
268
276
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
269
277
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
278
|
+
* @param {ConversionEngine} [conversionEngine]
|
|
270
279
|
* @param {*} [options] Override http request option.
|
|
271
280
|
* @throws {RequiredError}
|
|
272
281
|
* @memberof DocumentsApiInterface
|
|
@@ -580,6 +589,10 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
580
589
|
formParams.append('page_dpi', requestParameters['pageDpi'] as any);
|
|
581
590
|
}
|
|
582
591
|
|
|
592
|
+
if (requestParameters['conversionEngine'] != null) {
|
|
593
|
+
formParams.append('conversion_engine', requestParameters['conversionEngine'] as any);
|
|
594
|
+
}
|
|
595
|
+
|
|
583
596
|
|
|
584
597
|
let urlPath = `/v1/documents/ingest`;
|
|
585
598
|
|
|
@@ -674,6 +687,10 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
674
687
|
formParams.append('page_dpi', requestParameters['pageDpi'] as any);
|
|
675
688
|
}
|
|
676
689
|
|
|
690
|
+
if (requestParameters['conversionEngine'] != null) {
|
|
691
|
+
formParams.append('conversion_engine', requestParameters['conversionEngine'] as any);
|
|
692
|
+
}
|
|
693
|
+
|
|
677
694
|
|
|
678
695
|
let urlPath = `/v1/documents/{document_id}/ingest`;
|
|
679
696
|
urlPath = urlPath.replace(`{${"document_id"}}`, encodeURIComponent(String(requestParameters['documentId'])));
|
package/src/apis/SectionsApi.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
CreateSectionRequest,
|
|
19
|
+
DissolveSectionResponse,
|
|
19
20
|
HTTPValidationError,
|
|
20
21
|
SectionResponse,
|
|
21
22
|
UpdateSectionRequest,
|
|
@@ -23,6 +24,8 @@ import type {
|
|
|
23
24
|
import {
|
|
24
25
|
CreateSectionRequestFromJSON,
|
|
25
26
|
CreateSectionRequestToJSON,
|
|
27
|
+
DissolveSectionResponseFromJSON,
|
|
28
|
+
DissolveSectionResponseToJSON,
|
|
26
29
|
HTTPValidationErrorFromJSON,
|
|
27
30
|
HTTPValidationErrorToJSON,
|
|
28
31
|
SectionResponseFromJSON,
|
|
@@ -43,6 +46,12 @@ export interface DeleteSectionRequest {
|
|
|
43
46
|
ksUat?: string | null;
|
|
44
47
|
}
|
|
45
48
|
|
|
49
|
+
export interface DissolveSectionRequest {
|
|
50
|
+
sectionId: string;
|
|
51
|
+
authorization?: string | null;
|
|
52
|
+
ksUat?: string | null;
|
|
53
|
+
}
|
|
54
|
+
|
|
46
55
|
export interface GetSectionRequest {
|
|
47
56
|
sectionId: string;
|
|
48
57
|
authorization?: string | null;
|
|
@@ -125,6 +134,34 @@ export interface SectionsApiInterface {
|
|
|
125
134
|
*/
|
|
126
135
|
deleteSection(requestParameters: DeleteSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
127
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Creates request options for dissolveSection without sending the request
|
|
139
|
+
* @param {string} sectionId
|
|
140
|
+
* @param {string} [authorization]
|
|
141
|
+
* @param {string} [ksUat]
|
|
142
|
+
* @throws {RequiredError}
|
|
143
|
+
* @memberof SectionsApiInterface
|
|
144
|
+
*/
|
|
145
|
+
dissolveSectionRequestOpts(requestParameters: DissolveSectionRequest): Promise<runtime.RequestOpts>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Dissolve a section: convert it to a text chunk, reparent children, delete the section. The section\'s name becomes the content of a new TEXT chunk. Any children of the section are reparented to the section\'s parent, preserving order. The section itself is then deleted.
|
|
149
|
+
* @summary Dissolve Section Handler
|
|
150
|
+
* @param {string} sectionId
|
|
151
|
+
* @param {string} [authorization]
|
|
152
|
+
* @param {string} [ksUat]
|
|
153
|
+
* @param {*} [options] Override http request option.
|
|
154
|
+
* @throws {RequiredError}
|
|
155
|
+
* @memberof SectionsApiInterface
|
|
156
|
+
*/
|
|
157
|
+
dissolveSectionRaw(requestParameters: DissolveSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DissolveSectionResponse>>;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Dissolve a section: convert it to a text chunk, reparent children, delete the section. The section\'s name becomes the content of a new TEXT chunk. Any children of the section are reparented to the section\'s parent, preserving order. The section itself is then deleted.
|
|
161
|
+
* Dissolve Section Handler
|
|
162
|
+
*/
|
|
163
|
+
dissolveSection(requestParameters: DissolveSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DissolveSectionResponse>;
|
|
164
|
+
|
|
128
165
|
/**
|
|
129
166
|
* Creates request options for getSection without sending the request
|
|
130
167
|
* @param {string} sectionId
|
|
@@ -321,6 +358,57 @@ export class SectionsApi extends runtime.BaseAPI implements SectionsApiInterface
|
|
|
321
358
|
await this.deleteSectionRaw(requestParameters, initOverrides);
|
|
322
359
|
}
|
|
323
360
|
|
|
361
|
+
/**
|
|
362
|
+
* Creates request options for dissolveSection without sending the request
|
|
363
|
+
*/
|
|
364
|
+
async dissolveSectionRequestOpts(requestParameters: DissolveSectionRequest): Promise<runtime.RequestOpts> {
|
|
365
|
+
if (requestParameters['sectionId'] == null) {
|
|
366
|
+
throw new runtime.RequiredError(
|
|
367
|
+
'sectionId',
|
|
368
|
+
'Required parameter "sectionId" was null or undefined when calling dissolveSection().'
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const queryParameters: any = {};
|
|
373
|
+
|
|
374
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
375
|
+
|
|
376
|
+
if (requestParameters['authorization'] != null) {
|
|
377
|
+
headerParameters['authorization'] = String(requestParameters['authorization']);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
let urlPath = `/v1/sections/{section_id}/dissolve`;
|
|
382
|
+
urlPath = urlPath.replace(`{${"section_id"}}`, encodeURIComponent(String(requestParameters['sectionId'])));
|
|
383
|
+
|
|
384
|
+
return {
|
|
385
|
+
path: urlPath,
|
|
386
|
+
method: 'POST',
|
|
387
|
+
headers: headerParameters,
|
|
388
|
+
query: queryParameters,
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Dissolve a section: convert it to a text chunk, reparent children, delete the section. The section\'s name becomes the content of a new TEXT chunk. Any children of the section are reparented to the section\'s parent, preserving order. The section itself is then deleted.
|
|
394
|
+
* Dissolve Section Handler
|
|
395
|
+
*/
|
|
396
|
+
async dissolveSectionRaw(requestParameters: DissolveSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DissolveSectionResponse>> {
|
|
397
|
+
const requestOptions = await this.dissolveSectionRequestOpts(requestParameters);
|
|
398
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
399
|
+
|
|
400
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DissolveSectionResponseFromJSON(jsonValue));
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Dissolve a section: convert it to a text chunk, reparent children, delete the section. The section\'s name becomes the content of a new TEXT chunk. Any children of the section are reparented to the section\'s parent, preserving order. The section itself is then deleted.
|
|
405
|
+
* Dissolve Section Handler
|
|
406
|
+
*/
|
|
407
|
+
async dissolveSection(requestParameters: DissolveSectionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DissolveSectionResponse> {
|
|
408
|
+
const response = await this.dissolveSectionRaw(requestParameters, initOverrides);
|
|
409
|
+
return await response.value();
|
|
410
|
+
}
|
|
411
|
+
|
|
324
412
|
/**
|
|
325
413
|
* Creates request options for getSection without sending the request
|
|
326
414
|
*/
|
|
@@ -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
|
-
|
|
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
|
-
'
|
|
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
|
-
'
|
|
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
|
|
package/src/models/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './ChunkSearchRequest';
|
|
|
18
18
|
export * from './ChunkType';
|
|
19
19
|
export * from './Citation';
|
|
20
20
|
export * from './ClearVersionContentsResponse';
|
|
21
|
+
export * from './ConversionEngine';
|
|
21
22
|
export * from './CreateApiKeyRequest';
|
|
22
23
|
export * from './CreateApiKeyResponse';
|
|
23
24
|
export * from './CreateChunkLineageRequest';
|
|
@@ -31,6 +32,7 @@ export * from './CreateTagRequest';
|
|
|
31
32
|
export * from './CreateTenantRequest';
|
|
32
33
|
export * from './CreateThreadMessageRequest';
|
|
33
34
|
export * from './CreateThreadRequest';
|
|
35
|
+
export * from './DissolveSectionResponse';
|
|
34
36
|
export * from './DocumentOrigin';
|
|
35
37
|
export * from './DocumentResponse';
|
|
36
38
|
export * from './DocumentType';
|