@knowledge-stack/ksapi 1.152.0 → 1.154.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.
- package/.openapi-generator/FILES +10 -0
- package/README.md +12 -2
- package/dist/apis/DocumentsApi.d.ts +203 -7
- package/dist/apis/DocumentsApi.js +262 -6
- package/dist/esm/apis/DocumentsApi.d.ts +203 -7
- package/dist/esm/apis/DocumentsApi.js +263 -7
- 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 +397 -11
- 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 +480 -14
- 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/src/apis/DocumentsApi.ts
CHANGED
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
ChunkType,
|
|
19
|
+
CompleteUploadRequest,
|
|
19
20
|
CreateDocumentRequest,
|
|
21
|
+
CreateUploadRequest,
|
|
22
|
+
CreateUploadResponse,
|
|
20
23
|
DocumentDownloadResponse,
|
|
21
24
|
DocumentResponse,
|
|
22
25
|
DocumentType,
|
|
@@ -31,12 +34,20 @@ import type {
|
|
|
31
34
|
PathOrder,
|
|
32
35
|
SortDirection,
|
|
33
36
|
UpdateDocumentRequest,
|
|
37
|
+
UploadPartResponse,
|
|
38
|
+
UploadStatusResponse,
|
|
34
39
|
} from '../models/index';
|
|
35
40
|
import {
|
|
36
41
|
ChunkTypeFromJSON,
|
|
37
42
|
ChunkTypeToJSON,
|
|
43
|
+
CompleteUploadRequestFromJSON,
|
|
44
|
+
CompleteUploadRequestToJSON,
|
|
38
45
|
CreateDocumentRequestFromJSON,
|
|
39
46
|
CreateDocumentRequestToJSON,
|
|
47
|
+
CreateUploadRequestFromJSON,
|
|
48
|
+
CreateUploadRequestToJSON,
|
|
49
|
+
CreateUploadResponseFromJSON,
|
|
50
|
+
CreateUploadResponseToJSON,
|
|
40
51
|
DocumentDownloadResponseFromJSON,
|
|
41
52
|
DocumentDownloadResponseToJSON,
|
|
42
53
|
DocumentResponseFromJSON,
|
|
@@ -65,12 +76,28 @@ import {
|
|
|
65
76
|
SortDirectionToJSON,
|
|
66
77
|
UpdateDocumentRequestFromJSON,
|
|
67
78
|
UpdateDocumentRequestToJSON,
|
|
79
|
+
UploadPartResponseFromJSON,
|
|
80
|
+
UploadPartResponseToJSON,
|
|
81
|
+
UploadStatusResponseFromJSON,
|
|
82
|
+
UploadStatusResponseToJSON,
|
|
68
83
|
} from '../models/index';
|
|
69
84
|
|
|
85
|
+
export interface AbortDocumentUploadRequest {
|
|
86
|
+
xUploadToken: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface CompleteDocumentUploadRequest {
|
|
90
|
+
completeUploadRequest: CompleteUploadRequest;
|
|
91
|
+
}
|
|
92
|
+
|
|
70
93
|
export interface CreateDocumentOperationRequest {
|
|
71
94
|
createDocumentRequest: CreateDocumentRequest;
|
|
72
95
|
}
|
|
73
96
|
|
|
97
|
+
export interface CreateDocumentUploadRequest {
|
|
98
|
+
createUploadRequest: CreateUploadRequest;
|
|
99
|
+
}
|
|
100
|
+
|
|
74
101
|
export interface DeleteDocumentRequest {
|
|
75
102
|
documentId: string;
|
|
76
103
|
}
|
|
@@ -85,17 +112,21 @@ export interface GetDocumentRequest {
|
|
|
85
112
|
withTags?: boolean;
|
|
86
113
|
}
|
|
87
114
|
|
|
115
|
+
export interface GetDocumentUploadStatusRequest {
|
|
116
|
+
xUploadToken: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
88
119
|
export interface IngestDocumentRequest {
|
|
89
120
|
file: Blob;
|
|
90
121
|
pathPartId: string;
|
|
91
122
|
name?: string | null;
|
|
123
|
+
tagIds?: Array<string>;
|
|
124
|
+
idempotencyKey?: string | null;
|
|
92
125
|
ingestionMode?: IngestionMode;
|
|
93
126
|
chunkType?: ChunkType;
|
|
94
127
|
secondaryTaxonomy?: ImageTaxonomy;
|
|
95
128
|
pageDpi?: number;
|
|
96
129
|
workflowRunId?: string | null;
|
|
97
|
-
tagIds?: Array<string>;
|
|
98
|
-
idempotencyKey?: string | null;
|
|
99
130
|
workflowDefinitionId?: string | null;
|
|
100
131
|
}
|
|
101
132
|
|
|
@@ -137,6 +168,12 @@ export interface UpdateDocumentOperationRequest {
|
|
|
137
168
|
updateDocumentRequest: UpdateDocumentRequest;
|
|
138
169
|
}
|
|
139
170
|
|
|
171
|
+
export interface UploadDocumentPartRequest {
|
|
172
|
+
partNumber: number;
|
|
173
|
+
xUploadToken: string;
|
|
174
|
+
body: Blob;
|
|
175
|
+
}
|
|
176
|
+
|
|
140
177
|
/**
|
|
141
178
|
* DocumentsApi - interface
|
|
142
179
|
*
|
|
@@ -144,6 +181,54 @@ export interface UpdateDocumentOperationRequest {
|
|
|
144
181
|
* @interface DocumentsApiInterface
|
|
145
182
|
*/
|
|
146
183
|
export interface DocumentsApiInterface {
|
|
184
|
+
/**
|
|
185
|
+
* Creates request options for abortDocumentUpload without sending the request
|
|
186
|
+
* @param {string} xUploadToken
|
|
187
|
+
* @throws {RequiredError}
|
|
188
|
+
* @memberof DocumentsApiInterface
|
|
189
|
+
*/
|
|
190
|
+
abortDocumentUploadRequestOpts(requestParameters: AbortDocumentUploadRequest): Promise<runtime.RequestOpts>;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Discard an in-progress resumable upload and its parts.
|
|
194
|
+
* @summary Abort Document Upload Handler
|
|
195
|
+
* @param {string} xUploadToken
|
|
196
|
+
* @param {*} [options] Override http request option.
|
|
197
|
+
* @throws {RequiredError}
|
|
198
|
+
* @memberof DocumentsApiInterface
|
|
199
|
+
*/
|
|
200
|
+
abortDocumentUploadRaw(requestParameters: AbortDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Discard an in-progress resumable upload and its parts.
|
|
204
|
+
* Abort Document Upload Handler
|
|
205
|
+
*/
|
|
206
|
+
abortDocumentUpload(requestParameters: AbortDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Creates request options for completeDocumentUpload without sending the request
|
|
210
|
+
* @param {CompleteUploadRequest} completeUploadRequest
|
|
211
|
+
* @throws {RequiredError}
|
|
212
|
+
* @memberof DocumentsApiInterface
|
|
213
|
+
*/
|
|
214
|
+
completeDocumentUploadRequestOpts(requestParameters: CompleteDocumentUploadRequest): Promise<runtime.RequestOpts>;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
218
|
+
* @summary Complete Document Upload Handler
|
|
219
|
+
* @param {CompleteUploadRequest} completeUploadRequest
|
|
220
|
+
* @param {*} [options] Override http request option.
|
|
221
|
+
* @throws {RequiredError}
|
|
222
|
+
* @memberof DocumentsApiInterface
|
|
223
|
+
*/
|
|
224
|
+
completeDocumentUploadRaw(requestParameters: CompleteDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>>;
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
228
|
+
* Complete Document Upload Handler
|
|
229
|
+
*/
|
|
230
|
+
completeDocumentUpload(requestParameters: CompleteDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
|
|
231
|
+
|
|
147
232
|
/**
|
|
148
233
|
* Creates request options for createDocument without sending the request
|
|
149
234
|
* @param {CreateDocumentRequest} createDocumentRequest
|
|
@@ -168,6 +253,30 @@ export interface DocumentsApiInterface {
|
|
|
168
253
|
*/
|
|
169
254
|
createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
170
255
|
|
|
256
|
+
/**
|
|
257
|
+
* Creates request options for createDocumentUpload without sending the request
|
|
258
|
+
* @param {CreateUploadRequest} createUploadRequest
|
|
259
|
+
* @throws {RequiredError}
|
|
260
|
+
* @memberof DocumentsApiInterface
|
|
261
|
+
*/
|
|
262
|
+
createDocumentUploadRequestOpts(requestParameters: CreateDocumentUploadRequest): Promise<runtime.RequestOpts>;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* 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.
|
|
266
|
+
* @summary Create Document Upload Handler
|
|
267
|
+
* @param {CreateUploadRequest} createUploadRequest
|
|
268
|
+
* @param {*} [options] Override http request option.
|
|
269
|
+
* @throws {RequiredError}
|
|
270
|
+
* @memberof DocumentsApiInterface
|
|
271
|
+
*/
|
|
272
|
+
createDocumentUploadRaw(requestParameters: CreateDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateUploadResponse>>;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* 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.
|
|
276
|
+
* Create Document Upload Handler
|
|
277
|
+
*/
|
|
278
|
+
createDocumentUpload(requestParameters: CreateDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateUploadResponse>;
|
|
279
|
+
|
|
171
280
|
/**
|
|
172
281
|
* Creates request options for deleteDocument without sending the request
|
|
173
282
|
* @param {string} documentId
|
|
@@ -243,18 +352,42 @@ export interface DocumentsApiInterface {
|
|
|
243
352
|
*/
|
|
244
353
|
getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
245
354
|
|
|
355
|
+
/**
|
|
356
|
+
* Creates request options for getDocumentUploadStatus without sending the request
|
|
357
|
+
* @param {string} xUploadToken
|
|
358
|
+
* @throws {RequiredError}
|
|
359
|
+
* @memberof DocumentsApiInterface
|
|
360
|
+
*/
|
|
361
|
+
getDocumentUploadStatusRequestOpts(requestParameters: GetDocumentUploadStatusRequest): Promise<runtime.RequestOpts>;
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
365
|
+
* @summary Get Document Upload Status Handler
|
|
366
|
+
* @param {string} xUploadToken
|
|
367
|
+
* @param {*} [options] Override http request option.
|
|
368
|
+
* @throws {RequiredError}
|
|
369
|
+
* @memberof DocumentsApiInterface
|
|
370
|
+
*/
|
|
371
|
+
getDocumentUploadStatusRaw(requestParameters: GetDocumentUploadStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadStatusResponse>>;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
375
|
+
* Get Document Upload Status Handler
|
|
376
|
+
*/
|
|
377
|
+
getDocumentUploadStatus(requestParameters: GetDocumentUploadStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadStatusResponse>;
|
|
378
|
+
|
|
246
379
|
/**
|
|
247
380
|
* Creates request options for ingestDocument without sending the request
|
|
248
381
|
* @param {Blob} file
|
|
249
382
|
* @param {string} pathPartId Parent path part ID (must be a FOLDER type)
|
|
250
383
|
* @param {string} [name] Document name (defaults to filename)
|
|
384
|
+
* @param {Array<string>} [tagIds] Tag IDs applied to the created document.
|
|
385
|
+
* @param {string} [idempotencyKey] Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409.
|
|
251
386
|
* @param {IngestionMode} [ingestionMode]
|
|
252
387
|
* @param {ChunkType} [chunkType]
|
|
253
388
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
254
389
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
255
390
|
* @param {string} [workflowRunId] Workflow run context for assumed agent uploads.
|
|
256
|
-
* @param {Array<string>} [tagIds] Tag IDs applied to the created document.
|
|
257
|
-
* @param {string} [idempotencyKey] Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409.
|
|
258
391
|
* @param {string} [workflowDefinitionId] Workflow definition context for assumed agent uploads.
|
|
259
392
|
* @throws {RequiredError}
|
|
260
393
|
* @memberof DocumentsApiInterface
|
|
@@ -267,13 +400,13 @@ export interface DocumentsApiInterface {
|
|
|
267
400
|
* @param {Blob} file
|
|
268
401
|
* @param {string} pathPartId Parent path part ID (must be a FOLDER type)
|
|
269
402
|
* @param {string} [name] Document name (defaults to filename)
|
|
403
|
+
* @param {Array<string>} [tagIds] Tag IDs applied to the created document.
|
|
404
|
+
* @param {string} [idempotencyKey] Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409.
|
|
270
405
|
* @param {IngestionMode} [ingestionMode]
|
|
271
406
|
* @param {ChunkType} [chunkType]
|
|
272
407
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
273
408
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
274
409
|
* @param {string} [workflowRunId] Workflow run context for assumed agent uploads.
|
|
275
|
-
* @param {Array<string>} [tagIds] Tag IDs applied to the created document.
|
|
276
|
-
* @param {string} [idempotencyKey] Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409.
|
|
277
410
|
* @param {string} [workflowDefinitionId] Workflow definition context for assumed agent uploads.
|
|
278
411
|
* @param {*} [options] Override http request option.
|
|
279
412
|
* @throws {RequiredError}
|
|
@@ -427,6 +560,34 @@ export interface DocumentsApiInterface {
|
|
|
427
560
|
*/
|
|
428
561
|
updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
429
562
|
|
|
563
|
+
/**
|
|
564
|
+
* Creates request options for uploadDocumentPart without sending the request
|
|
565
|
+
* @param {number} partNumber
|
|
566
|
+
* @param {string} xUploadToken
|
|
567
|
+
* @param {Blob} body
|
|
568
|
+
* @throws {RequiredError}
|
|
569
|
+
* @memberof DocumentsApiInterface
|
|
570
|
+
*/
|
|
571
|
+
uploadDocumentPartRequestOpts(requestParameters: UploadDocumentPartRequest): Promise<runtime.RequestOpts>;
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
575
|
+
* @summary Upload Document Part Handler
|
|
576
|
+
* @param {number} partNumber
|
|
577
|
+
* @param {string} xUploadToken
|
|
578
|
+
* @param {Blob} body
|
|
579
|
+
* @param {*} [options] Override http request option.
|
|
580
|
+
* @throws {RequiredError}
|
|
581
|
+
* @memberof DocumentsApiInterface
|
|
582
|
+
*/
|
|
583
|
+
uploadDocumentPartRaw(requestParameters: UploadDocumentPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadPartResponse>>;
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
587
|
+
* Upload Document Part Handler
|
|
588
|
+
*/
|
|
589
|
+
uploadDocumentPart(requestParameters: UploadDocumentPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadPartResponse>;
|
|
590
|
+
|
|
430
591
|
}
|
|
431
592
|
|
|
432
593
|
/**
|
|
@@ -434,6 +595,120 @@ export interface DocumentsApiInterface {
|
|
|
434
595
|
*/
|
|
435
596
|
export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterface {
|
|
436
597
|
|
|
598
|
+
/**
|
|
599
|
+
* Creates request options for abortDocumentUpload without sending the request
|
|
600
|
+
*/
|
|
601
|
+
async abortDocumentUploadRequestOpts(requestParameters: AbortDocumentUploadRequest): Promise<runtime.RequestOpts> {
|
|
602
|
+
if (requestParameters['xUploadToken'] == null) {
|
|
603
|
+
throw new runtime.RequiredError(
|
|
604
|
+
'xUploadToken',
|
|
605
|
+
'Required parameter "xUploadToken" was null or undefined when calling abortDocumentUpload().'
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
const queryParameters: any = {};
|
|
610
|
+
|
|
611
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
612
|
+
|
|
613
|
+
if (requestParameters['xUploadToken'] != null) {
|
|
614
|
+
headerParameters['X-Upload-Token'] = String(requestParameters['xUploadToken']);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
618
|
+
const token = this.configuration.accessToken;
|
|
619
|
+
const tokenString = await token("bearerAuth", []);
|
|
620
|
+
|
|
621
|
+
if (tokenString) {
|
|
622
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
let urlPath = `/v1/documents/uploads`;
|
|
627
|
+
|
|
628
|
+
return {
|
|
629
|
+
path: urlPath,
|
|
630
|
+
method: 'DELETE',
|
|
631
|
+
headers: headerParameters,
|
|
632
|
+
query: queryParameters,
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Discard an in-progress resumable upload and its parts.
|
|
638
|
+
* Abort Document Upload Handler
|
|
639
|
+
*/
|
|
640
|
+
async abortDocumentUploadRaw(requestParameters: AbortDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
641
|
+
const requestOptions = await this.abortDocumentUploadRequestOpts(requestParameters);
|
|
642
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
643
|
+
|
|
644
|
+
return new runtime.VoidApiResponse(response);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Discard an in-progress resumable upload and its parts.
|
|
649
|
+
* Abort Document Upload Handler
|
|
650
|
+
*/
|
|
651
|
+
async abortDocumentUpload(requestParameters: AbortDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
652
|
+
await this.abortDocumentUploadRaw(requestParameters, initOverrides);
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Creates request options for completeDocumentUpload without sending the request
|
|
657
|
+
*/
|
|
658
|
+
async completeDocumentUploadRequestOpts(requestParameters: CompleteDocumentUploadRequest): Promise<runtime.RequestOpts> {
|
|
659
|
+
if (requestParameters['completeUploadRequest'] == null) {
|
|
660
|
+
throw new runtime.RequiredError(
|
|
661
|
+
'completeUploadRequest',
|
|
662
|
+
'Required parameter "completeUploadRequest" was null or undefined when calling completeDocumentUpload().'
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
const queryParameters: any = {};
|
|
667
|
+
|
|
668
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
669
|
+
|
|
670
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
671
|
+
|
|
672
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
673
|
+
const token = this.configuration.accessToken;
|
|
674
|
+
const tokenString = await token("bearerAuth", []);
|
|
675
|
+
|
|
676
|
+
if (tokenString) {
|
|
677
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
let urlPath = `/v1/documents/uploads/complete`;
|
|
682
|
+
|
|
683
|
+
return {
|
|
684
|
+
path: urlPath,
|
|
685
|
+
method: 'POST',
|
|
686
|
+
headers: headerParameters,
|
|
687
|
+
query: queryParameters,
|
|
688
|
+
body: CompleteUploadRequestToJSON(requestParameters['completeUploadRequest']),
|
|
689
|
+
};
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/**
|
|
693
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
694
|
+
* Complete Document Upload Handler
|
|
695
|
+
*/
|
|
696
|
+
async completeDocumentUploadRaw(requestParameters: CompleteDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>> {
|
|
697
|
+
const requestOptions = await this.completeDocumentUploadRequestOpts(requestParameters);
|
|
698
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
699
|
+
|
|
700
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => IngestDocumentResponseFromJSON(jsonValue));
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
/**
|
|
704
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
705
|
+
* Complete Document Upload Handler
|
|
706
|
+
*/
|
|
707
|
+
async completeDocumentUpload(requestParameters: CompleteDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse> {
|
|
708
|
+
const response = await this.completeDocumentUploadRaw(requestParameters, initOverrides);
|
|
709
|
+
return await response.value();
|
|
710
|
+
}
|
|
711
|
+
|
|
437
712
|
/**
|
|
438
713
|
* Creates request options for createDocument without sending the request
|
|
439
714
|
*/
|
|
@@ -491,6 +766,63 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
491
766
|
return await response.value();
|
|
492
767
|
}
|
|
493
768
|
|
|
769
|
+
/**
|
|
770
|
+
* Creates request options for createDocumentUpload without sending the request
|
|
771
|
+
*/
|
|
772
|
+
async createDocumentUploadRequestOpts(requestParameters: CreateDocumentUploadRequest): Promise<runtime.RequestOpts> {
|
|
773
|
+
if (requestParameters['createUploadRequest'] == null) {
|
|
774
|
+
throw new runtime.RequiredError(
|
|
775
|
+
'createUploadRequest',
|
|
776
|
+
'Required parameter "createUploadRequest" was null or undefined when calling createDocumentUpload().'
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
const queryParameters: any = {};
|
|
781
|
+
|
|
782
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
783
|
+
|
|
784
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
785
|
+
|
|
786
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
787
|
+
const token = this.configuration.accessToken;
|
|
788
|
+
const tokenString = await token("bearerAuth", []);
|
|
789
|
+
|
|
790
|
+
if (tokenString) {
|
|
791
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
let urlPath = `/v1/documents/uploads`;
|
|
796
|
+
|
|
797
|
+
return {
|
|
798
|
+
path: urlPath,
|
|
799
|
+
method: 'POST',
|
|
800
|
+
headers: headerParameters,
|
|
801
|
+
query: queryParameters,
|
|
802
|
+
body: CreateUploadRequestToJSON(requestParameters['createUploadRequest']),
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
/**
|
|
807
|
+
* 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.
|
|
808
|
+
* Create Document Upload Handler
|
|
809
|
+
*/
|
|
810
|
+
async createDocumentUploadRaw(requestParameters: CreateDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateUploadResponse>> {
|
|
811
|
+
const requestOptions = await this.createDocumentUploadRequestOpts(requestParameters);
|
|
812
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
813
|
+
|
|
814
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CreateUploadResponseFromJSON(jsonValue));
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* 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.
|
|
819
|
+
* Create Document Upload Handler
|
|
820
|
+
*/
|
|
821
|
+
async createDocumentUpload(requestParameters: CreateDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateUploadResponse> {
|
|
822
|
+
const response = await this.createDocumentUploadRaw(requestParameters, initOverrides);
|
|
823
|
+
return await response.value();
|
|
824
|
+
}
|
|
825
|
+
|
|
494
826
|
/**
|
|
495
827
|
* Creates request options for deleteDocument without sending the request
|
|
496
828
|
*/
|
|
@@ -661,6 +993,64 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
661
993
|
return await response.value();
|
|
662
994
|
}
|
|
663
995
|
|
|
996
|
+
/**
|
|
997
|
+
* Creates request options for getDocumentUploadStatus without sending the request
|
|
998
|
+
*/
|
|
999
|
+
async getDocumentUploadStatusRequestOpts(requestParameters: GetDocumentUploadStatusRequest): Promise<runtime.RequestOpts> {
|
|
1000
|
+
if (requestParameters['xUploadToken'] == null) {
|
|
1001
|
+
throw new runtime.RequiredError(
|
|
1002
|
+
'xUploadToken',
|
|
1003
|
+
'Required parameter "xUploadToken" was null or undefined when calling getDocumentUploadStatus().'
|
|
1004
|
+
);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
const queryParameters: any = {};
|
|
1008
|
+
|
|
1009
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1010
|
+
|
|
1011
|
+
if (requestParameters['xUploadToken'] != null) {
|
|
1012
|
+
headerParameters['X-Upload-Token'] = String(requestParameters['xUploadToken']);
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1016
|
+
const token = this.configuration.accessToken;
|
|
1017
|
+
const tokenString = await token("bearerAuth", []);
|
|
1018
|
+
|
|
1019
|
+
if (tokenString) {
|
|
1020
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
let urlPath = `/v1/documents/uploads/parts`;
|
|
1025
|
+
|
|
1026
|
+
return {
|
|
1027
|
+
path: urlPath,
|
|
1028
|
+
method: 'GET',
|
|
1029
|
+
headers: headerParameters,
|
|
1030
|
+
query: queryParameters,
|
|
1031
|
+
};
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
/**
|
|
1035
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
1036
|
+
* Get Document Upload Status Handler
|
|
1037
|
+
*/
|
|
1038
|
+
async getDocumentUploadStatusRaw(requestParameters: GetDocumentUploadStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadStatusResponse>> {
|
|
1039
|
+
const requestOptions = await this.getDocumentUploadStatusRequestOpts(requestParameters);
|
|
1040
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1041
|
+
|
|
1042
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UploadStatusResponseFromJSON(jsonValue));
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
/**
|
|
1046
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
1047
|
+
* Get Document Upload Status Handler
|
|
1048
|
+
*/
|
|
1049
|
+
async getDocumentUploadStatus(requestParameters: GetDocumentUploadStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadStatusResponse> {
|
|
1050
|
+
const response = await this.getDocumentUploadStatusRaw(requestParameters, initOverrides);
|
|
1051
|
+
return await response.value();
|
|
1052
|
+
}
|
|
1053
|
+
|
|
664
1054
|
/**
|
|
665
1055
|
* Creates request options for ingestDocument without sending the request
|
|
666
1056
|
*/
|
|
@@ -719,6 +1109,14 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
719
1109
|
formParams.append('name', requestParameters['name'] as any);
|
|
720
1110
|
}
|
|
721
1111
|
|
|
1112
|
+
if (requestParameters['tagIds'] != null) {
|
|
1113
|
+
formParams.append('tag_ids', requestParameters['tagIds']!.join(runtime.COLLECTION_FORMATS["csv"]));
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
1117
|
+
formParams.append('idempotency_key', requestParameters['idempotencyKey'] as any);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
722
1120
|
if (requestParameters['ingestionMode'] != null) {
|
|
723
1121
|
formParams.append('ingestion_mode', requestParameters['ingestionMode'] as any);
|
|
724
1122
|
}
|
|
@@ -739,14 +1137,6 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
739
1137
|
formParams.append('workflow_run_id', requestParameters['workflowRunId'] as any);
|
|
740
1138
|
}
|
|
741
1139
|
|
|
742
|
-
if (requestParameters['tagIds'] != null) {
|
|
743
|
-
formParams.append('tag_ids', requestParameters['tagIds']!.join(runtime.COLLECTION_FORMATS["csv"]));
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
if (requestParameters['idempotencyKey'] != null) {
|
|
747
|
-
formParams.append('idempotency_key', requestParameters['idempotencyKey'] as any);
|
|
748
|
-
}
|
|
749
|
-
|
|
750
1140
|
if (requestParameters['workflowDefinitionId'] != null) {
|
|
751
1141
|
formParams.append('workflow_definition_id', requestParameters['workflowDefinitionId'] as any);
|
|
752
1142
|
}
|
|
@@ -1144,4 +1534,80 @@ export class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterfa
|
|
|
1144
1534
|
return await response.value();
|
|
1145
1535
|
}
|
|
1146
1536
|
|
|
1537
|
+
/**
|
|
1538
|
+
* Creates request options for uploadDocumentPart without sending the request
|
|
1539
|
+
*/
|
|
1540
|
+
async uploadDocumentPartRequestOpts(requestParameters: UploadDocumentPartRequest): Promise<runtime.RequestOpts> {
|
|
1541
|
+
if (requestParameters['partNumber'] == null) {
|
|
1542
|
+
throw new runtime.RequiredError(
|
|
1543
|
+
'partNumber',
|
|
1544
|
+
'Required parameter "partNumber" was null or undefined when calling uploadDocumentPart().'
|
|
1545
|
+
);
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
if (requestParameters['xUploadToken'] == null) {
|
|
1549
|
+
throw new runtime.RequiredError(
|
|
1550
|
+
'xUploadToken',
|
|
1551
|
+
'Required parameter "xUploadToken" was null or undefined when calling uploadDocumentPart().'
|
|
1552
|
+
);
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
if (requestParameters['body'] == null) {
|
|
1556
|
+
throw new runtime.RequiredError(
|
|
1557
|
+
'body',
|
|
1558
|
+
'Required parameter "body" was null or undefined when calling uploadDocumentPart().'
|
|
1559
|
+
);
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
const queryParameters: any = {};
|
|
1563
|
+
|
|
1564
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
1565
|
+
|
|
1566
|
+
headerParameters['Content-Type'] = 'application/octet-stream';
|
|
1567
|
+
|
|
1568
|
+
if (requestParameters['xUploadToken'] != null) {
|
|
1569
|
+
headerParameters['X-Upload-Token'] = String(requestParameters['xUploadToken']);
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
1573
|
+
const token = this.configuration.accessToken;
|
|
1574
|
+
const tokenString = await token("bearerAuth", []);
|
|
1575
|
+
|
|
1576
|
+
if (tokenString) {
|
|
1577
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
let urlPath = `/v1/documents/uploads/parts/{part_number}`;
|
|
1582
|
+
urlPath = urlPath.replace(`{${"part_number"}}`, encodeURIComponent(String(requestParameters['partNumber'])));
|
|
1583
|
+
|
|
1584
|
+
return {
|
|
1585
|
+
path: urlPath,
|
|
1586
|
+
method: 'PUT',
|
|
1587
|
+
headers: headerParameters,
|
|
1588
|
+
query: queryParameters,
|
|
1589
|
+
body: requestParameters['body'] as any,
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
/**
|
|
1594
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
1595
|
+
* Upload Document Part Handler
|
|
1596
|
+
*/
|
|
1597
|
+
async uploadDocumentPartRaw(requestParameters: UploadDocumentPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadPartResponse>> {
|
|
1598
|
+
const requestOptions = await this.uploadDocumentPartRequestOpts(requestParameters);
|
|
1599
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
1600
|
+
|
|
1601
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UploadPartResponseFromJSON(jsonValue));
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
/**
|
|
1605
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
1606
|
+
* Upload Document Part Handler
|
|
1607
|
+
*/
|
|
1608
|
+
async uploadDocumentPart(requestParameters: UploadDocumentPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadPartResponse> {
|
|
1609
|
+
const response = await this.uploadDocumentPartRaw(requestParameters, initOverrides);
|
|
1610
|
+
return await response.value();
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1147
1613
|
}
|
|
@@ -70,6 +70,18 @@ export interface ChunkMetadata {
|
|
|
70
70
|
* @memberof ChunkMetadata
|
|
71
71
|
*/
|
|
72
72
|
secondaryTaxonomy?: ImageTaxonomy;
|
|
73
|
+
/**
|
|
74
|
+
* Start time of this chunk in the source media (ms from start).
|
|
75
|
+
* @type {number}
|
|
76
|
+
* @memberof ChunkMetadata
|
|
77
|
+
*/
|
|
78
|
+
startMs?: number | null;
|
|
79
|
+
/**
|
|
80
|
+
* End time of this chunk in the source media (ms from start).
|
|
81
|
+
* @type {number}
|
|
82
|
+
* @memberof ChunkMetadata
|
|
83
|
+
*/
|
|
84
|
+
endMs?: number | null;
|
|
73
85
|
/**
|
|
74
86
|
* Worksheet name this chunk was extracted from (XLSX only)
|
|
75
87
|
* @type {string}
|
|
@@ -168,6 +180,8 @@ export function ChunkMetadataFromJSONTyped(json: any, ignoreDiscriminator: boole
|
|
|
168
180
|
'summarizeForEmbedding': json['summarize_for_embedding'] == null ? undefined : json['summarize_for_embedding'],
|
|
169
181
|
'extractedTextS3Uri': json['extracted_text_s3_uri'] == null ? undefined : json['extracted_text_s3_uri'],
|
|
170
182
|
'secondaryTaxonomy': json['secondary_taxonomy'] == null ? undefined : ImageTaxonomyFromJSON(json['secondary_taxonomy']),
|
|
183
|
+
'startMs': json['start_ms'] == null ? undefined : json['start_ms'],
|
|
184
|
+
'endMs': json['end_ms'] == null ? undefined : json['end_ms'],
|
|
171
185
|
'sheetName': json['sheet_name'] == null ? undefined : json['sheet_name'],
|
|
172
186
|
'blockType': json['block_type'] == null ? undefined : json['block_type'],
|
|
173
187
|
'sourceUri': json['source_uri'] == null ? undefined : json['source_uri'],
|
|
@@ -197,6 +211,8 @@ export function ChunkMetadataToJSONTyped(value?: ChunkMetadata | null, ignoreDis
|
|
|
197
211
|
'summarize_for_embedding': value['summarizeForEmbedding'],
|
|
198
212
|
'extracted_text_s3_uri': value['extractedTextS3Uri'],
|
|
199
213
|
'secondary_taxonomy': ImageTaxonomyToJSON(value['secondaryTaxonomy']),
|
|
214
|
+
'start_ms': value['startMs'],
|
|
215
|
+
'end_ms': value['endMs'],
|
|
200
216
|
'sheet_name': value['sheetName'],
|
|
201
217
|
'block_type': value['blockType'],
|
|
202
218
|
'source_uri': value['sourceUri'],
|