@knowledge-stack/ksapi 1.151.1 → 1.153.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 +10 -0
- package/README.md +12 -2
- package/dist/apis/DocumentsApi.d.ts +197 -1
- package/dist/apis/DocumentsApi.js +256 -0
- package/dist/esm/apis/DocumentsApi.d.ts +197 -1
- package/dist/esm/apis/DocumentsApi.js +257 -1
- package/dist/esm/models/ChunkMetadata.d.ts +12 -0
- package/dist/esm/models/ChunkMetadata.js +4 -0
- package/dist/esm/models/Citation.d.ts +12 -0
- package/dist/esm/models/Citation.js +4 -0
- package/dist/esm/models/CompleteUploadRequest.d.ts +47 -0
- package/dist/esm/models/CompleteUploadRequest.js +44 -0
- package/dist/esm/models/CreateUploadRequest.d.ts +65 -0
- package/dist/esm/models/CreateUploadRequest.js +56 -0
- package/dist/esm/models/CreateUploadResponse.d.ts +65 -0
- package/dist/esm/models/CreateUploadResponse.js +56 -0
- package/dist/esm/models/DocumentType.d.ts +2 -0
- package/dist/esm/models/DocumentType.js +2 -0
- package/dist/esm/models/EnrichedCitation.d.ts +12 -0
- package/dist/esm/models/EnrichedCitation.js +4 -0
- package/dist/esm/models/IngestionMode.d.ts +1 -0
- package/dist/esm/models/IngestionMode.js +2 -1
- package/dist/esm/models/SubscriptionPlanResponse.d.ts +6 -0
- package/dist/esm/models/SubscriptionPlanResponse.js +4 -0
- package/dist/esm/models/UploadPartResponse.d.ts +59 -0
- package/dist/esm/models/UploadPartResponse.js +52 -0
- package/dist/esm/models/UploadStatusResponse.d.ts +54 -0
- package/dist/esm/models/UploadStatusResponse.js +49 -0
- package/dist/esm/models/UsageMetric.d.ts +1 -0
- package/dist/esm/models/UsageMetric.js +2 -1
- package/dist/esm/models/index.d.ts +5 -0
- package/dist/esm/models/index.js +5 -0
- package/dist/models/ChunkMetadata.d.ts +12 -0
- package/dist/models/ChunkMetadata.js +4 -0
- package/dist/models/Citation.d.ts +12 -0
- package/dist/models/Citation.js +4 -0
- package/dist/models/CompleteUploadRequest.d.ts +47 -0
- package/dist/models/CompleteUploadRequest.js +52 -0
- package/dist/models/CreateUploadRequest.d.ts +65 -0
- package/dist/models/CreateUploadRequest.js +64 -0
- package/dist/models/CreateUploadResponse.d.ts +65 -0
- package/dist/models/CreateUploadResponse.js +64 -0
- package/dist/models/DocumentType.d.ts +2 -0
- package/dist/models/DocumentType.js +2 -0
- package/dist/models/EnrichedCitation.d.ts +12 -0
- package/dist/models/EnrichedCitation.js +4 -0
- package/dist/models/IngestionMode.d.ts +1 -0
- package/dist/models/IngestionMode.js +2 -1
- package/dist/models/SubscriptionPlanResponse.d.ts +6 -0
- package/dist/models/SubscriptionPlanResponse.js +4 -0
- package/dist/models/UploadPartResponse.d.ts +59 -0
- package/dist/models/UploadPartResponse.js +60 -0
- package/dist/models/UploadStatusResponse.d.ts +54 -0
- package/dist/models/UploadStatusResponse.js +57 -0
- package/dist/models/UsageMetric.d.ts +1 -0
- package/dist/models/UsageMetric.js +2 -1
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/docs/ChunkMetadata.md +4 -0
- package/docs/Citation.md +4 -0
- package/docs/CompleteUploadRequest.md +35 -0
- package/docs/CreateUploadRequest.md +41 -0
- package/docs/CreateUploadResponse.md +41 -0
- package/docs/DocumentsApi.md +390 -4
- package/docs/EnrichedCitation.md +4 -0
- package/docs/SubscriptionPlanResponse.md +2 -0
- package/docs/UploadPartResponse.md +39 -0
- package/docs/UploadStatusResponse.md +37 -0
- package/package.json +1 -1
- package/src/apis/DocumentsApi.ts +466 -0
- package/src/models/ChunkMetadata.ts +16 -0
- package/src/models/Citation.ts +16 -0
- package/src/models/CompleteUploadRequest.ts +83 -0
- package/src/models/CreateUploadRequest.ts +110 -0
- package/src/models/CreateUploadResponse.ts +110 -0
- package/src/models/DocumentType.ts +2 -0
- package/src/models/EnrichedCitation.ts +16 -0
- package/src/models/IngestionMode.ts +2 -1
- package/src/models/SubscriptionPlanResponse.ts +9 -0
- package/src/models/UploadPartResponse.ts +101 -0
- package/src/models/UploadStatusResponse.ts +100 -0
- package/src/models/UsageMetric.ts +2 -1
- package/src/models/index.ts +5 -0
package/docs/DocumentsApi.md
CHANGED
|
@@ -4,18 +4,173 @@ All URIs are relative to *http://localhost:8000*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
+
| [**abortDocumentUpload**](DocumentsApi.md#abortdocumentupload) | **DELETE** /v1/documents/uploads | Abort Document Upload Handler |
|
|
8
|
+
| [**completeDocumentUpload**](DocumentsApi.md#completedocumentupload) | **POST** /v1/documents/uploads/complete | Complete Document Upload Handler |
|
|
7
9
|
| [**createDocument**](DocumentsApi.md#createdocumentoperation) | **POST** /v1/documents | Create Document Handler |
|
|
10
|
+
| [**createDocumentUpload**](DocumentsApi.md#createdocumentupload) | **POST** /v1/documents/uploads | Create Document Upload Handler |
|
|
8
11
|
| [**deleteDocument**](DocumentsApi.md#deletedocument) | **DELETE** /v1/documents/{document_id} | Delete Document Handler |
|
|
9
12
|
| [**downloadDocument**](DocumentsApi.md#downloaddocument) | **POST** /v1/documents/{document_id}/download | Download Document Handler |
|
|
10
13
|
| [**getDocument**](DocumentsApi.md#getdocument) | **GET** /v1/documents/{document_id} | Get Document Handler |
|
|
14
|
+
| [**getDocumentUploadStatus**](DocumentsApi.md#getdocumentuploadstatus) | **GET** /v1/documents/uploads/parts | Get Document Upload Status Handler |
|
|
11
15
|
| [**ingestDocument**](DocumentsApi.md#ingestdocument) | **POST** /v1/documents/ingest | Ingest Document Handler |
|
|
12
16
|
| [**ingestDocumentVersion**](DocumentsApi.md#ingestdocumentversion) | **POST** /v1/documents/{document_id}/ingest | Ingest Document Version Handler |
|
|
13
17
|
| [**ingestZip**](DocumentsApi.md#ingestzip) | **POST** /v1/documents/ingest-zip | Ingest Zip Handler |
|
|
14
18
|
| [**listDocuments**](DocumentsApi.md#listdocuments) | **GET** /v1/documents | List Documents Handler |
|
|
15
19
|
| [**updateDocument**](DocumentsApi.md#updatedocumentoperation) | **PATCH** /v1/documents/{document_id} | Update Document Handler |
|
|
20
|
+
| [**uploadDocumentPart**](DocumentsApi.md#uploaddocumentpart) | **PUT** /v1/documents/uploads/parts/{part_number} | Upload Document Part Handler |
|
|
16
21
|
|
|
17
22
|
|
|
18
23
|
|
|
24
|
+
## abortDocumentUpload
|
|
25
|
+
|
|
26
|
+
> abortDocumentUpload(xUploadToken)
|
|
27
|
+
|
|
28
|
+
Abort Document Upload Handler
|
|
29
|
+
|
|
30
|
+
Discard an in-progress resumable upload and its parts.
|
|
31
|
+
|
|
32
|
+
### Example
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
import {
|
|
36
|
+
Configuration,
|
|
37
|
+
DocumentsApi,
|
|
38
|
+
} from '@knowledge-stack/ksapi';
|
|
39
|
+
import type { AbortDocumentUploadRequest } from '@knowledge-stack/ksapi';
|
|
40
|
+
|
|
41
|
+
async function example() {
|
|
42
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
43
|
+
const config = new Configuration({
|
|
44
|
+
// To configure API key authorization: cookieAuth
|
|
45
|
+
apiKey: "YOUR API KEY",
|
|
46
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
47
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
48
|
+
});
|
|
49
|
+
const api = new DocumentsApi(config);
|
|
50
|
+
|
|
51
|
+
const body = {
|
|
52
|
+
// string
|
|
53
|
+
xUploadToken: xUploadToken_example,
|
|
54
|
+
} satisfies AbortDocumentUploadRequest;
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
const data = await api.abortDocumentUpload(body);
|
|
58
|
+
console.log(data);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error(error);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Run the test
|
|
65
|
+
example().catch(console.error);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Parameters
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
| Name | Type | Description | Notes |
|
|
72
|
+
|------------- | ------------- | ------------- | -------------|
|
|
73
|
+
| **xUploadToken** | `string` | | [Defaults to `undefined`] |
|
|
74
|
+
|
|
75
|
+
### Return type
|
|
76
|
+
|
|
77
|
+
`void` (Empty response body)
|
|
78
|
+
|
|
79
|
+
### Authorization
|
|
80
|
+
|
|
81
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
82
|
+
|
|
83
|
+
### HTTP request headers
|
|
84
|
+
|
|
85
|
+
- **Content-Type**: Not defined
|
|
86
|
+
- **Accept**: `application/json`
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### HTTP response details
|
|
90
|
+
| Status code | Description | Response headers |
|
|
91
|
+
|-------------|-------------|------------------|
|
|
92
|
+
| **204** | Successful Response | - |
|
|
93
|
+
| **422** | Validation Error | - |
|
|
94
|
+
| **0** | Error response. | - |
|
|
95
|
+
|
|
96
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
## completeDocumentUpload
|
|
100
|
+
|
|
101
|
+
> IngestDocumentResponse completeDocumentUpload(completeUploadRequest)
|
|
102
|
+
|
|
103
|
+
Complete Document Upload Handler
|
|
104
|
+
|
|
105
|
+
Assemble the uploaded parts, create the document, and start ingestion.
|
|
106
|
+
|
|
107
|
+
### Example
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
import {
|
|
111
|
+
Configuration,
|
|
112
|
+
DocumentsApi,
|
|
113
|
+
} from '@knowledge-stack/ksapi';
|
|
114
|
+
import type { CompleteDocumentUploadRequest } from '@knowledge-stack/ksapi';
|
|
115
|
+
|
|
116
|
+
async function example() {
|
|
117
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
118
|
+
const config = new Configuration({
|
|
119
|
+
// To configure API key authorization: cookieAuth
|
|
120
|
+
apiKey: "YOUR API KEY",
|
|
121
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
122
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
123
|
+
});
|
|
124
|
+
const api = new DocumentsApi(config);
|
|
125
|
+
|
|
126
|
+
const body = {
|
|
127
|
+
// CompleteUploadRequest
|
|
128
|
+
completeUploadRequest: ...,
|
|
129
|
+
} satisfies CompleteDocumentUploadRequest;
|
|
130
|
+
|
|
131
|
+
try {
|
|
132
|
+
const data = await api.completeDocumentUpload(body);
|
|
133
|
+
console.log(data);
|
|
134
|
+
} catch (error) {
|
|
135
|
+
console.error(error);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// Run the test
|
|
140
|
+
example().catch(console.error);
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Parameters
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
| Name | Type | Description | Notes |
|
|
147
|
+
|------------- | ------------- | ------------- | -------------|
|
|
148
|
+
| **completeUploadRequest** | [CompleteUploadRequest](CompleteUploadRequest.md) | | |
|
|
149
|
+
|
|
150
|
+
### Return type
|
|
151
|
+
|
|
152
|
+
[**IngestDocumentResponse**](IngestDocumentResponse.md)
|
|
153
|
+
|
|
154
|
+
### Authorization
|
|
155
|
+
|
|
156
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
157
|
+
|
|
158
|
+
### HTTP request headers
|
|
159
|
+
|
|
160
|
+
- **Content-Type**: `application/json`
|
|
161
|
+
- **Accept**: `application/json`
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### HTTP response details
|
|
165
|
+
| Status code | Description | Response headers |
|
|
166
|
+
|-------------|-------------|------------------|
|
|
167
|
+
| **201** | Successful Response | - |
|
|
168
|
+
| **422** | Validation Error | - |
|
|
169
|
+
| **0** | Error response. | - |
|
|
170
|
+
|
|
171
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
172
|
+
|
|
173
|
+
|
|
19
174
|
## createDocument
|
|
20
175
|
|
|
21
176
|
> DocumentResponse createDocument(createDocumentRequest)
|
|
@@ -91,6 +246,81 @@ example().catch(console.error);
|
|
|
91
246
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
92
247
|
|
|
93
248
|
|
|
249
|
+
## createDocumentUpload
|
|
250
|
+
|
|
251
|
+
> CreateUploadResponse createDocumentUpload(createUploadRequest)
|
|
252
|
+
|
|
253
|
+
Create Document Upload Handler
|
|
254
|
+
|
|
255
|
+
Begin a resumable multipart upload for a large file (audio/video/…). Returns an opaque ``upload_token``. Stream the file as parts to ``PUT /v1/documents/uploads/parts/{part_number}`` (every part except the last at least 5 MiB), then ``POST /v1/documents/uploads/complete``. A dropped part is re-sent alone — ``GET /v1/documents/uploads/parts`` reports what landed.
|
|
256
|
+
|
|
257
|
+
### Example
|
|
258
|
+
|
|
259
|
+
```ts
|
|
260
|
+
import {
|
|
261
|
+
Configuration,
|
|
262
|
+
DocumentsApi,
|
|
263
|
+
} from '@knowledge-stack/ksapi';
|
|
264
|
+
import type { CreateDocumentUploadRequest } from '@knowledge-stack/ksapi';
|
|
265
|
+
|
|
266
|
+
async function example() {
|
|
267
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
268
|
+
const config = new Configuration({
|
|
269
|
+
// To configure API key authorization: cookieAuth
|
|
270
|
+
apiKey: "YOUR API KEY",
|
|
271
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
272
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
273
|
+
});
|
|
274
|
+
const api = new DocumentsApi(config);
|
|
275
|
+
|
|
276
|
+
const body = {
|
|
277
|
+
// CreateUploadRequest
|
|
278
|
+
createUploadRequest: ...,
|
|
279
|
+
} satisfies CreateDocumentUploadRequest;
|
|
280
|
+
|
|
281
|
+
try {
|
|
282
|
+
const data = await api.createDocumentUpload(body);
|
|
283
|
+
console.log(data);
|
|
284
|
+
} catch (error) {
|
|
285
|
+
console.error(error);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Run the test
|
|
290
|
+
example().catch(console.error);
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
### Parameters
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
| Name | Type | Description | Notes |
|
|
297
|
+
|------------- | ------------- | ------------- | -------------|
|
|
298
|
+
| **createUploadRequest** | [CreateUploadRequest](CreateUploadRequest.md) | | |
|
|
299
|
+
|
|
300
|
+
### Return type
|
|
301
|
+
|
|
302
|
+
[**CreateUploadResponse**](CreateUploadResponse.md)
|
|
303
|
+
|
|
304
|
+
### Authorization
|
|
305
|
+
|
|
306
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
307
|
+
|
|
308
|
+
### HTTP request headers
|
|
309
|
+
|
|
310
|
+
- **Content-Type**: `application/json`
|
|
311
|
+
- **Accept**: `application/json`
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
### HTTP response details
|
|
315
|
+
| Status code | Description | Response headers |
|
|
316
|
+
|-------------|-------------|------------------|
|
|
317
|
+
| **201** | Successful Response | - |
|
|
318
|
+
| **422** | Validation Error | - |
|
|
319
|
+
| **0** | Error response. | - |
|
|
320
|
+
|
|
321
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
322
|
+
|
|
323
|
+
|
|
94
324
|
## deleteDocument
|
|
95
325
|
|
|
96
326
|
> deleteDocument(documentId)
|
|
@@ -320,6 +550,81 @@ example().catch(console.error);
|
|
|
320
550
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
321
551
|
|
|
322
552
|
|
|
553
|
+
## getDocumentUploadStatus
|
|
554
|
+
|
|
555
|
+
> UploadStatusResponse getDocumentUploadStatus(xUploadToken)
|
|
556
|
+
|
|
557
|
+
Get Document Upload Status Handler
|
|
558
|
+
|
|
559
|
+
Report which parts S3 already holds so the client resumes the rest.
|
|
560
|
+
|
|
561
|
+
### Example
|
|
562
|
+
|
|
563
|
+
```ts
|
|
564
|
+
import {
|
|
565
|
+
Configuration,
|
|
566
|
+
DocumentsApi,
|
|
567
|
+
} from '@knowledge-stack/ksapi';
|
|
568
|
+
import type { GetDocumentUploadStatusRequest } from '@knowledge-stack/ksapi';
|
|
569
|
+
|
|
570
|
+
async function example() {
|
|
571
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
572
|
+
const config = new Configuration({
|
|
573
|
+
// To configure API key authorization: cookieAuth
|
|
574
|
+
apiKey: "YOUR API KEY",
|
|
575
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
576
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
577
|
+
});
|
|
578
|
+
const api = new DocumentsApi(config);
|
|
579
|
+
|
|
580
|
+
const body = {
|
|
581
|
+
// string
|
|
582
|
+
xUploadToken: xUploadToken_example,
|
|
583
|
+
} satisfies GetDocumentUploadStatusRequest;
|
|
584
|
+
|
|
585
|
+
try {
|
|
586
|
+
const data = await api.getDocumentUploadStatus(body);
|
|
587
|
+
console.log(data);
|
|
588
|
+
} catch (error) {
|
|
589
|
+
console.error(error);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
// Run the test
|
|
594
|
+
example().catch(console.error);
|
|
595
|
+
```
|
|
596
|
+
|
|
597
|
+
### Parameters
|
|
598
|
+
|
|
599
|
+
|
|
600
|
+
| Name | Type | Description | Notes |
|
|
601
|
+
|------------- | ------------- | ------------- | -------------|
|
|
602
|
+
| **xUploadToken** | `string` | | [Defaults to `undefined`] |
|
|
603
|
+
|
|
604
|
+
### Return type
|
|
605
|
+
|
|
606
|
+
[**UploadStatusResponse**](UploadStatusResponse.md)
|
|
607
|
+
|
|
608
|
+
### Authorization
|
|
609
|
+
|
|
610
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
611
|
+
|
|
612
|
+
### HTTP request headers
|
|
613
|
+
|
|
614
|
+
- **Content-Type**: Not defined
|
|
615
|
+
- **Accept**: `application/json`
|
|
616
|
+
|
|
617
|
+
|
|
618
|
+
### HTTP response details
|
|
619
|
+
| Status code | Description | Response headers |
|
|
620
|
+
|-------------|-------------|------------------|
|
|
621
|
+
| **200** | Successful Response | - |
|
|
622
|
+
| **422** | Validation Error | - |
|
|
623
|
+
| **0** | Error response. | - |
|
|
624
|
+
|
|
625
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
626
|
+
|
|
627
|
+
|
|
323
628
|
## ingestDocument
|
|
324
629
|
|
|
325
630
|
> IngestDocumentResponse ingestDocument(file, pathPartId, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, workflowRunId, tagIds, idempotencyKey, workflowDefinitionId)
|
|
@@ -392,7 +697,7 @@ example().catch(console.error);
|
|
|
392
697
|
| **file** | `Blob` | | [Defaults to `undefined`] |
|
|
393
698
|
| **pathPartId** | `string` | Parent path part ID (must be a FOLDER type) | [Defaults to `undefined`] |
|
|
394
699
|
| **name** | `string` | Document name (defaults to filename) | [Optional] [Defaults to `undefined`] |
|
|
395
|
-
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk] |
|
|
700
|
+
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk, media] |
|
|
396
701
|
| **chunkType** | `ChunkType` | | [Optional] [Defaults to `undefined`] [Enum: TEXT, TABLE, IMAGE, HTML, UNKNOWN] |
|
|
397
702
|
| **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
|
|
398
703
|
| **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
|
|
@@ -490,7 +795,7 @@ example().catch(console.error);
|
|
|
490
795
|
|------------- | ------------- | ------------- | -------------|
|
|
491
796
|
| **documentId** | `string` | Document ID | [Defaults to `undefined`] |
|
|
492
797
|
| **file** | `Blob` | | [Defaults to `undefined`] |
|
|
493
|
-
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk] |
|
|
798
|
+
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk, media] |
|
|
494
799
|
| **chunkType** | `ChunkType` | | [Optional] [Defaults to `undefined`] [Enum: TEXT, TABLE, IMAGE, HTML, UNKNOWN] |
|
|
495
800
|
| **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
|
|
496
801
|
| **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
|
|
@@ -578,7 +883,7 @@ example().catch(console.error);
|
|
|
578
883
|
|------------- | ------------- | ------------- | -------------|
|
|
579
884
|
| **file** | `Blob` | | [Defaults to `undefined`] |
|
|
580
885
|
| **pathPartId** | `string` | Parent path part ID (must be a FOLDER type) | [Defaults to `undefined`] |
|
|
581
|
-
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk] |
|
|
886
|
+
| **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk, media] |
|
|
582
887
|
| **tagIds** | `Array<string>` | Tag IDs applied to every ingested member document. | [Optional] |
|
|
583
888
|
|
|
584
889
|
### Return type
|
|
@@ -680,7 +985,7 @@ example().catch(console.error);
|
|
|
680
985
|
| **sortOrder** | `PathOrder` | Sort order for results (default: LOGICAL) | [Optional] [Defaults to `undefined`] [Enum: LOGICAL, NAME, UPDATED_AT, CREATED_AT] |
|
|
681
986
|
| **sortDir** | `SortDirection` | Sort direction; overrides the column\'s natural default | [Optional] [Defaults to `undefined`] [Enum: ASC, DESC] |
|
|
682
987
|
| **ownerId** | `string` | Filter to documents owned by this user | [Optional] [Defaults to `undefined`] |
|
|
683
|
-
| **documentType** | `DocumentType` | Filter to documents of this type | [Optional] [Defaults to `undefined`] [Enum: PDF, DOCX, PLAINTEXT, IMAGE, XLSX, CSV, PPTX, JSON, YAML, CODE, UNKNOWN] |
|
|
988
|
+
| **documentType** | `DocumentType` | Filter to documents of this type | [Optional] [Defaults to `undefined`] [Enum: PDF, DOCX, PLAINTEXT, IMAGE, XLSX, CSV, PPTX, JSON, YAML, CODE, AUDIO, VIDEO, UNKNOWN] |
|
|
684
989
|
| **withTags** | `boolean` | Include tags in the response (default: false) | [Optional] [Defaults to `false`] |
|
|
685
990
|
| **limit** | `number` | Number of items per page | [Optional] [Defaults to `20`] |
|
|
686
991
|
| **offset** | `number` | Number of items to skip | [Optional] [Defaults to `0`] |
|
|
@@ -790,3 +1095,84 @@ example().catch(console.error);
|
|
|
790
1095
|
|
|
791
1096
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
792
1097
|
|
|
1098
|
+
|
|
1099
|
+
## uploadDocumentPart
|
|
1100
|
+
|
|
1101
|
+
> UploadPartResponse uploadDocumentPart(partNumber, xUploadToken, body)
|
|
1102
|
+
|
|
1103
|
+
Upload Document Part Handler
|
|
1104
|
+
|
|
1105
|
+
Upload one part (raw octet-stream body) of a resumable upload.
|
|
1106
|
+
|
|
1107
|
+
### Example
|
|
1108
|
+
|
|
1109
|
+
```ts
|
|
1110
|
+
import {
|
|
1111
|
+
Configuration,
|
|
1112
|
+
DocumentsApi,
|
|
1113
|
+
} from '@knowledge-stack/ksapi';
|
|
1114
|
+
import type { UploadDocumentPartRequest } from '@knowledge-stack/ksapi';
|
|
1115
|
+
|
|
1116
|
+
async function example() {
|
|
1117
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
1118
|
+
const config = new Configuration({
|
|
1119
|
+
// To configure API key authorization: cookieAuth
|
|
1120
|
+
apiKey: "YOUR API KEY",
|
|
1121
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
1122
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
1123
|
+
});
|
|
1124
|
+
const api = new DocumentsApi(config);
|
|
1125
|
+
|
|
1126
|
+
const body = {
|
|
1127
|
+
// number
|
|
1128
|
+
partNumber: 56,
|
|
1129
|
+
// string
|
|
1130
|
+
xUploadToken: xUploadToken_example,
|
|
1131
|
+
// Blob
|
|
1132
|
+
body: BINARY_DATA_HERE,
|
|
1133
|
+
} satisfies UploadDocumentPartRequest;
|
|
1134
|
+
|
|
1135
|
+
try {
|
|
1136
|
+
const data = await api.uploadDocumentPart(body);
|
|
1137
|
+
console.log(data);
|
|
1138
|
+
} catch (error) {
|
|
1139
|
+
console.error(error);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
// Run the test
|
|
1144
|
+
example().catch(console.error);
|
|
1145
|
+
```
|
|
1146
|
+
|
|
1147
|
+
### Parameters
|
|
1148
|
+
|
|
1149
|
+
|
|
1150
|
+
| Name | Type | Description | Notes |
|
|
1151
|
+
|------------- | ------------- | ------------- | -------------|
|
|
1152
|
+
| **partNumber** | `number` | | [Defaults to `undefined`] |
|
|
1153
|
+
| **xUploadToken** | `string` | | [Defaults to `undefined`] |
|
|
1154
|
+
| **body** | `Blob` | | |
|
|
1155
|
+
|
|
1156
|
+
### Return type
|
|
1157
|
+
|
|
1158
|
+
[**UploadPartResponse**](UploadPartResponse.md)
|
|
1159
|
+
|
|
1160
|
+
### Authorization
|
|
1161
|
+
|
|
1162
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
1163
|
+
|
|
1164
|
+
### HTTP request headers
|
|
1165
|
+
|
|
1166
|
+
- **Content-Type**: `application/octet-stream`
|
|
1167
|
+
- **Accept**: `application/json`
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
### HTTP response details
|
|
1171
|
+
| Status code | Description | Response headers |
|
|
1172
|
+
|-------------|-------------|------------------|
|
|
1173
|
+
| **200** | Successful Response | - |
|
|
1174
|
+
| **422** | Validation Error | - |
|
|
1175
|
+
| **0** | Error response. | - |
|
|
1176
|
+
|
|
1177
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1178
|
+
|
package/docs/EnrichedCitation.md
CHANGED
|
@@ -11,6 +11,8 @@ Name | Type
|
|
|
11
11
|
`quote` | string
|
|
12
12
|
`startChar` | number
|
|
13
13
|
`length` | number
|
|
14
|
+
`startMs` | number
|
|
15
|
+
`endMs` | number
|
|
14
16
|
`documentId` | string
|
|
15
17
|
`documentVersionId` | string
|
|
16
18
|
`documentName` | string
|
|
@@ -29,6 +31,8 @@ const example = {
|
|
|
29
31
|
"quote": null,
|
|
30
32
|
"startChar": null,
|
|
31
33
|
"length": null,
|
|
34
|
+
"startMs": null,
|
|
35
|
+
"endMs": null,
|
|
32
36
|
"documentId": null,
|
|
33
37
|
"documentVersionId": null,
|
|
34
38
|
"documentName": null,
|
|
@@ -12,6 +12,7 @@ Name | Type
|
|
|
12
12
|
`ingestedPages` | number
|
|
13
13
|
`messages` | number
|
|
14
14
|
`searches` | number
|
|
15
|
+
`mediaMinutes` | number
|
|
15
16
|
`maxSeats` | number
|
|
16
17
|
`_public` | boolean
|
|
17
18
|
`createdAt` | Date
|
|
@@ -29,6 +30,7 @@ const example = {
|
|
|
29
30
|
"ingestedPages": null,
|
|
30
31
|
"messages": null,
|
|
31
32
|
"searches": null,
|
|
33
|
+
"mediaMinutes": null,
|
|
32
34
|
"maxSeats": null,
|
|
33
35
|
"_public": null,
|
|
34
36
|
"createdAt": null,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# UploadPartResponse
|
|
3
|
+
|
|
4
|
+
Acknowledgement of one stored part.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`partNumber` | number
|
|
11
|
+
`etag` | string
|
|
12
|
+
`size` | number
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { UploadPartResponse } from '@knowledge-stack/ksapi'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"partNumber": null,
|
|
22
|
+
"etag": null,
|
|
23
|
+
"size": null,
|
|
24
|
+
} satisfies UploadPartResponse
|
|
25
|
+
|
|
26
|
+
console.log(example)
|
|
27
|
+
|
|
28
|
+
// Convert the instance to a JSON string
|
|
29
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
30
|
+
console.log(exampleJSON)
|
|
31
|
+
|
|
32
|
+
// Parse the JSON string back to an object
|
|
33
|
+
const exampleParsed = JSON.parse(exampleJSON) as UploadPartResponse
|
|
34
|
+
console.log(exampleParsed)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
38
|
+
|
|
39
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# UploadStatusResponse
|
|
3
|
+
|
|
4
|
+
Parts S3 already holds — resume by re-sending the rest.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`parts` | [Array<UploadPartResponse>](UploadPartResponse.md)
|
|
11
|
+
`uploadedBytes` | number
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { UploadStatusResponse } from '@knowledge-stack/ksapi'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"parts": null,
|
|
21
|
+
"uploadedBytes": null,
|
|
22
|
+
} satisfies UploadStatusResponse
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as UploadStatusResponse
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|