@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
|
@@ -62,6 +62,104 @@ const index_1 = require("../models/index");
|
|
|
62
62
|
*
|
|
63
63
|
*/
|
|
64
64
|
class DocumentsApi extends runtime.BaseAPI {
|
|
65
|
+
/**
|
|
66
|
+
* Creates request options for abortDocumentUpload without sending the request
|
|
67
|
+
*/
|
|
68
|
+
abortDocumentUploadRequestOpts(requestParameters) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
if (requestParameters['xUploadToken'] == null) {
|
|
71
|
+
throw new runtime.RequiredError('xUploadToken', 'Required parameter "xUploadToken" was null or undefined when calling abortDocumentUpload().');
|
|
72
|
+
}
|
|
73
|
+
const queryParameters = {};
|
|
74
|
+
const headerParameters = {};
|
|
75
|
+
if (requestParameters['xUploadToken'] != null) {
|
|
76
|
+
headerParameters['X-Upload-Token'] = String(requestParameters['xUploadToken']);
|
|
77
|
+
}
|
|
78
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
79
|
+
const token = this.configuration.accessToken;
|
|
80
|
+
const tokenString = yield token("bearerAuth", []);
|
|
81
|
+
if (tokenString) {
|
|
82
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
let urlPath = `/v1/documents/uploads`;
|
|
86
|
+
return {
|
|
87
|
+
path: urlPath,
|
|
88
|
+
method: 'DELETE',
|
|
89
|
+
headers: headerParameters,
|
|
90
|
+
query: queryParameters,
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Discard an in-progress resumable upload and its parts.
|
|
96
|
+
* Abort Document Upload Handler
|
|
97
|
+
*/
|
|
98
|
+
abortDocumentUploadRaw(requestParameters, initOverrides) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const requestOptions = yield this.abortDocumentUploadRequestOpts(requestParameters);
|
|
101
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
102
|
+
return new runtime.VoidApiResponse(response);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Discard an in-progress resumable upload and its parts.
|
|
107
|
+
* Abort Document Upload Handler
|
|
108
|
+
*/
|
|
109
|
+
abortDocumentUpload(requestParameters, initOverrides) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
yield this.abortDocumentUploadRaw(requestParameters, initOverrides);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Creates request options for completeDocumentUpload without sending the request
|
|
116
|
+
*/
|
|
117
|
+
completeDocumentUploadRequestOpts(requestParameters) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
if (requestParameters['completeUploadRequest'] == null) {
|
|
120
|
+
throw new runtime.RequiredError('completeUploadRequest', 'Required parameter "completeUploadRequest" was null or undefined when calling completeDocumentUpload().');
|
|
121
|
+
}
|
|
122
|
+
const queryParameters = {};
|
|
123
|
+
const headerParameters = {};
|
|
124
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
125
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
126
|
+
const token = this.configuration.accessToken;
|
|
127
|
+
const tokenString = yield token("bearerAuth", []);
|
|
128
|
+
if (tokenString) {
|
|
129
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
let urlPath = `/v1/documents/uploads/complete`;
|
|
133
|
+
return {
|
|
134
|
+
path: urlPath,
|
|
135
|
+
method: 'POST',
|
|
136
|
+
headers: headerParameters,
|
|
137
|
+
query: queryParameters,
|
|
138
|
+
body: (0, index_1.CompleteUploadRequestToJSON)(requestParameters['completeUploadRequest']),
|
|
139
|
+
};
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
144
|
+
* Complete Document Upload Handler
|
|
145
|
+
*/
|
|
146
|
+
completeDocumentUploadRaw(requestParameters, initOverrides) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
const requestOptions = yield this.completeDocumentUploadRequestOpts(requestParameters);
|
|
149
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
150
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.IngestDocumentResponseFromJSON)(jsonValue));
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
155
|
+
* Complete Document Upload Handler
|
|
156
|
+
*/
|
|
157
|
+
completeDocumentUpload(requestParameters, initOverrides) {
|
|
158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
159
|
+
const response = yield this.completeDocumentUploadRaw(requestParameters, initOverrides);
|
|
160
|
+
return yield response.value();
|
|
161
|
+
});
|
|
162
|
+
}
|
|
65
163
|
/**
|
|
66
164
|
* Creates request options for createDocument without sending the request
|
|
67
165
|
*/
|
|
@@ -111,6 +209,55 @@ class DocumentsApi extends runtime.BaseAPI {
|
|
|
111
209
|
return yield response.value();
|
|
112
210
|
});
|
|
113
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Creates request options for createDocumentUpload without sending the request
|
|
214
|
+
*/
|
|
215
|
+
createDocumentUploadRequestOpts(requestParameters) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
if (requestParameters['createUploadRequest'] == null) {
|
|
218
|
+
throw new runtime.RequiredError('createUploadRequest', 'Required parameter "createUploadRequest" was null or undefined when calling createDocumentUpload().');
|
|
219
|
+
}
|
|
220
|
+
const queryParameters = {};
|
|
221
|
+
const headerParameters = {};
|
|
222
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
223
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
224
|
+
const token = this.configuration.accessToken;
|
|
225
|
+
const tokenString = yield token("bearerAuth", []);
|
|
226
|
+
if (tokenString) {
|
|
227
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
let urlPath = `/v1/documents/uploads`;
|
|
231
|
+
return {
|
|
232
|
+
path: urlPath,
|
|
233
|
+
method: 'POST',
|
|
234
|
+
headers: headerParameters,
|
|
235
|
+
query: queryParameters,
|
|
236
|
+
body: (0, index_1.CreateUploadRequestToJSON)(requestParameters['createUploadRequest']),
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* 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.
|
|
242
|
+
* Create Document Upload Handler
|
|
243
|
+
*/
|
|
244
|
+
createDocumentUploadRaw(requestParameters, initOverrides) {
|
|
245
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
246
|
+
const requestOptions = yield this.createDocumentUploadRequestOpts(requestParameters);
|
|
247
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
248
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateUploadResponseFromJSON)(jsonValue));
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* 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.
|
|
253
|
+
* Create Document Upload Handler
|
|
254
|
+
*/
|
|
255
|
+
createDocumentUpload(requestParameters, initOverrides) {
|
|
256
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
257
|
+
const response = yield this.createDocumentUploadRaw(requestParameters, initOverrides);
|
|
258
|
+
return yield response.value();
|
|
259
|
+
});
|
|
260
|
+
}
|
|
114
261
|
/**
|
|
115
262
|
* Creates request options for deleteDocument without sending the request
|
|
116
263
|
*/
|
|
@@ -258,6 +405,56 @@ class DocumentsApi extends runtime.BaseAPI {
|
|
|
258
405
|
return yield response.value();
|
|
259
406
|
});
|
|
260
407
|
}
|
|
408
|
+
/**
|
|
409
|
+
* Creates request options for getDocumentUploadStatus without sending the request
|
|
410
|
+
*/
|
|
411
|
+
getDocumentUploadStatusRequestOpts(requestParameters) {
|
|
412
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
413
|
+
if (requestParameters['xUploadToken'] == null) {
|
|
414
|
+
throw new runtime.RequiredError('xUploadToken', 'Required parameter "xUploadToken" was null or undefined when calling getDocumentUploadStatus().');
|
|
415
|
+
}
|
|
416
|
+
const queryParameters = {};
|
|
417
|
+
const headerParameters = {};
|
|
418
|
+
if (requestParameters['xUploadToken'] != null) {
|
|
419
|
+
headerParameters['X-Upload-Token'] = String(requestParameters['xUploadToken']);
|
|
420
|
+
}
|
|
421
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
422
|
+
const token = this.configuration.accessToken;
|
|
423
|
+
const tokenString = yield token("bearerAuth", []);
|
|
424
|
+
if (tokenString) {
|
|
425
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
let urlPath = `/v1/documents/uploads/parts`;
|
|
429
|
+
return {
|
|
430
|
+
path: urlPath,
|
|
431
|
+
method: 'GET',
|
|
432
|
+
headers: headerParameters,
|
|
433
|
+
query: queryParameters,
|
|
434
|
+
};
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
439
|
+
* Get Document Upload Status Handler
|
|
440
|
+
*/
|
|
441
|
+
getDocumentUploadStatusRaw(requestParameters, initOverrides) {
|
|
442
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
443
|
+
const requestOptions = yield this.getDocumentUploadStatusRequestOpts(requestParameters);
|
|
444
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
445
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadStatusResponseFromJSON)(jsonValue));
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
450
|
+
* Get Document Upload Status Handler
|
|
451
|
+
*/
|
|
452
|
+
getDocumentUploadStatus(requestParameters, initOverrides) {
|
|
453
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
454
|
+
const response = yield this.getDocumentUploadStatusRaw(requestParameters, initOverrides);
|
|
455
|
+
return yield response.value();
|
|
456
|
+
});
|
|
457
|
+
}
|
|
261
458
|
/**
|
|
262
459
|
* Creates request options for ingestDocument without sending the request
|
|
263
460
|
*/
|
|
@@ -302,6 +499,12 @@ class DocumentsApi extends runtime.BaseAPI {
|
|
|
302
499
|
if (requestParameters['name'] != null) {
|
|
303
500
|
formParams.append('name', requestParameters['name']);
|
|
304
501
|
}
|
|
502
|
+
if (requestParameters['tagIds'] != null) {
|
|
503
|
+
formParams.append('tag_ids', requestParameters['tagIds'].join(runtime.COLLECTION_FORMATS["csv"]));
|
|
504
|
+
}
|
|
505
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
506
|
+
formParams.append('idempotency_key', requestParameters['idempotencyKey']);
|
|
507
|
+
}
|
|
305
508
|
if (requestParameters['ingestionMode'] != null) {
|
|
306
509
|
formParams.append('ingestion_mode', requestParameters['ingestionMode']);
|
|
307
510
|
}
|
|
@@ -317,12 +520,6 @@ class DocumentsApi extends runtime.BaseAPI {
|
|
|
317
520
|
if (requestParameters['workflowRunId'] != null) {
|
|
318
521
|
formParams.append('workflow_run_id', requestParameters['workflowRunId']);
|
|
319
522
|
}
|
|
320
|
-
if (requestParameters['tagIds'] != null) {
|
|
321
|
-
formParams.append('tag_ids', requestParameters['tagIds'].join(runtime.COLLECTION_FORMATS["csv"]));
|
|
322
|
-
}
|
|
323
|
-
if (requestParameters['idempotencyKey'] != null) {
|
|
324
|
-
formParams.append('idempotency_key', requestParameters['idempotencyKey']);
|
|
325
|
-
}
|
|
326
523
|
if (requestParameters['workflowDefinitionId'] != null) {
|
|
327
524
|
formParams.append('workflow_definition_id', requestParameters['workflowDefinitionId']);
|
|
328
525
|
}
|
|
@@ -656,5 +853,64 @@ class DocumentsApi extends runtime.BaseAPI {
|
|
|
656
853
|
return yield response.value();
|
|
657
854
|
});
|
|
658
855
|
}
|
|
856
|
+
/**
|
|
857
|
+
* Creates request options for uploadDocumentPart without sending the request
|
|
858
|
+
*/
|
|
859
|
+
uploadDocumentPartRequestOpts(requestParameters) {
|
|
860
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
861
|
+
if (requestParameters['partNumber'] == null) {
|
|
862
|
+
throw new runtime.RequiredError('partNumber', 'Required parameter "partNumber" was null or undefined when calling uploadDocumentPart().');
|
|
863
|
+
}
|
|
864
|
+
if (requestParameters['xUploadToken'] == null) {
|
|
865
|
+
throw new runtime.RequiredError('xUploadToken', 'Required parameter "xUploadToken" was null or undefined when calling uploadDocumentPart().');
|
|
866
|
+
}
|
|
867
|
+
if (requestParameters['body'] == null) {
|
|
868
|
+
throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling uploadDocumentPart().');
|
|
869
|
+
}
|
|
870
|
+
const queryParameters = {};
|
|
871
|
+
const headerParameters = {};
|
|
872
|
+
headerParameters['Content-Type'] = 'application/octet-stream';
|
|
873
|
+
if (requestParameters['xUploadToken'] != null) {
|
|
874
|
+
headerParameters['X-Upload-Token'] = String(requestParameters['xUploadToken']);
|
|
875
|
+
}
|
|
876
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
877
|
+
const token = this.configuration.accessToken;
|
|
878
|
+
const tokenString = yield token("bearerAuth", []);
|
|
879
|
+
if (tokenString) {
|
|
880
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
let urlPath = `/v1/documents/uploads/parts/{part_number}`;
|
|
884
|
+
urlPath = urlPath.replace(`{${"part_number"}}`, encodeURIComponent(String(requestParameters['partNumber'])));
|
|
885
|
+
return {
|
|
886
|
+
path: urlPath,
|
|
887
|
+
method: 'PUT',
|
|
888
|
+
headers: headerParameters,
|
|
889
|
+
query: queryParameters,
|
|
890
|
+
body: requestParameters['body'],
|
|
891
|
+
};
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
896
|
+
* Upload Document Part Handler
|
|
897
|
+
*/
|
|
898
|
+
uploadDocumentPartRaw(requestParameters, initOverrides) {
|
|
899
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
900
|
+
const requestOptions = yield this.uploadDocumentPartRequestOpts(requestParameters);
|
|
901
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
902
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UploadPartResponseFromJSON)(jsonValue));
|
|
903
|
+
});
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
907
|
+
* Upload Document Part Handler
|
|
908
|
+
*/
|
|
909
|
+
uploadDocumentPart(requestParameters, initOverrides) {
|
|
910
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
911
|
+
const response = yield this.uploadDocumentPartRaw(requestParameters, initOverrides);
|
|
912
|
+
return yield response.value();
|
|
913
|
+
});
|
|
914
|
+
}
|
|
659
915
|
}
|
|
660
916
|
exports.DocumentsApi = DocumentsApi;
|
|
@@ -10,10 +10,19 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { ChunkType, CreateDocumentRequest, DocumentDownloadResponse, DocumentResponse, DocumentType, DownloadArtifact, ImageTaxonomy, IngestDocumentResponse, IngestZipResponse, IngestionMode, PaginatedResponseDocumentResponse, PathOrder, SortDirection, UpdateDocumentRequest } from '../models/index';
|
|
13
|
+
import type { ChunkType, CompleteUploadRequest, CreateDocumentRequest, CreateUploadRequest, CreateUploadResponse, DocumentDownloadResponse, DocumentResponse, DocumentType, DownloadArtifact, ImageTaxonomy, IngestDocumentResponse, IngestZipResponse, IngestionMode, PaginatedResponseDocumentResponse, PathOrder, SortDirection, UpdateDocumentRequest, UploadPartResponse, UploadStatusResponse } from '../models/index';
|
|
14
|
+
export interface AbortDocumentUploadRequest {
|
|
15
|
+
xUploadToken: string;
|
|
16
|
+
}
|
|
17
|
+
export interface CompleteDocumentUploadRequest {
|
|
18
|
+
completeUploadRequest: CompleteUploadRequest;
|
|
19
|
+
}
|
|
14
20
|
export interface CreateDocumentOperationRequest {
|
|
15
21
|
createDocumentRequest: CreateDocumentRequest;
|
|
16
22
|
}
|
|
23
|
+
export interface CreateDocumentUploadRequest {
|
|
24
|
+
createUploadRequest: CreateUploadRequest;
|
|
25
|
+
}
|
|
17
26
|
export interface DeleteDocumentRequest {
|
|
18
27
|
documentId: string;
|
|
19
28
|
}
|
|
@@ -25,17 +34,20 @@ export interface GetDocumentRequest {
|
|
|
25
34
|
documentId: string;
|
|
26
35
|
withTags?: boolean;
|
|
27
36
|
}
|
|
37
|
+
export interface GetDocumentUploadStatusRequest {
|
|
38
|
+
xUploadToken: string;
|
|
39
|
+
}
|
|
28
40
|
export interface IngestDocumentRequest {
|
|
29
41
|
file: Blob;
|
|
30
42
|
pathPartId: string;
|
|
31
43
|
name?: string | null;
|
|
44
|
+
tagIds?: Array<string>;
|
|
45
|
+
idempotencyKey?: string | null;
|
|
32
46
|
ingestionMode?: IngestionMode;
|
|
33
47
|
chunkType?: ChunkType;
|
|
34
48
|
secondaryTaxonomy?: ImageTaxonomy;
|
|
35
49
|
pageDpi?: number;
|
|
36
50
|
workflowRunId?: string | null;
|
|
37
|
-
tagIds?: Array<string>;
|
|
38
|
-
idempotencyKey?: string | null;
|
|
39
51
|
workflowDefinitionId?: string | null;
|
|
40
52
|
}
|
|
41
53
|
export interface IngestDocumentVersionRequest {
|
|
@@ -72,6 +84,11 @@ export interface UpdateDocumentOperationRequest {
|
|
|
72
84
|
documentId: string;
|
|
73
85
|
updateDocumentRequest: UpdateDocumentRequest;
|
|
74
86
|
}
|
|
87
|
+
export interface UploadDocumentPartRequest {
|
|
88
|
+
partNumber: number;
|
|
89
|
+
xUploadToken: string;
|
|
90
|
+
body: Blob;
|
|
91
|
+
}
|
|
75
92
|
/**
|
|
76
93
|
* DocumentsApi - interface
|
|
77
94
|
*
|
|
@@ -79,6 +96,48 @@ export interface UpdateDocumentOperationRequest {
|
|
|
79
96
|
* @interface DocumentsApiInterface
|
|
80
97
|
*/
|
|
81
98
|
export interface DocumentsApiInterface {
|
|
99
|
+
/**
|
|
100
|
+
* Creates request options for abortDocumentUpload without sending the request
|
|
101
|
+
* @param {string} xUploadToken
|
|
102
|
+
* @throws {RequiredError}
|
|
103
|
+
* @memberof DocumentsApiInterface
|
|
104
|
+
*/
|
|
105
|
+
abortDocumentUploadRequestOpts(requestParameters: AbortDocumentUploadRequest): Promise<runtime.RequestOpts>;
|
|
106
|
+
/**
|
|
107
|
+
* Discard an in-progress resumable upload and its parts.
|
|
108
|
+
* @summary Abort Document Upload Handler
|
|
109
|
+
* @param {string} xUploadToken
|
|
110
|
+
* @param {*} [options] Override http request option.
|
|
111
|
+
* @throws {RequiredError}
|
|
112
|
+
* @memberof DocumentsApiInterface
|
|
113
|
+
*/
|
|
114
|
+
abortDocumentUploadRaw(requestParameters: AbortDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
115
|
+
/**
|
|
116
|
+
* Discard an in-progress resumable upload and its parts.
|
|
117
|
+
* Abort Document Upload Handler
|
|
118
|
+
*/
|
|
119
|
+
abortDocumentUpload(requestParameters: AbortDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
120
|
+
/**
|
|
121
|
+
* Creates request options for completeDocumentUpload without sending the request
|
|
122
|
+
* @param {CompleteUploadRequest} completeUploadRequest
|
|
123
|
+
* @throws {RequiredError}
|
|
124
|
+
* @memberof DocumentsApiInterface
|
|
125
|
+
*/
|
|
126
|
+
completeDocumentUploadRequestOpts(requestParameters: CompleteDocumentUploadRequest): Promise<runtime.RequestOpts>;
|
|
127
|
+
/**
|
|
128
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
129
|
+
* @summary Complete Document Upload Handler
|
|
130
|
+
* @param {CompleteUploadRequest} completeUploadRequest
|
|
131
|
+
* @param {*} [options] Override http request option.
|
|
132
|
+
* @throws {RequiredError}
|
|
133
|
+
* @memberof DocumentsApiInterface
|
|
134
|
+
*/
|
|
135
|
+
completeDocumentUploadRaw(requestParameters: CompleteDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>>;
|
|
136
|
+
/**
|
|
137
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
138
|
+
* Complete Document Upload Handler
|
|
139
|
+
*/
|
|
140
|
+
completeDocumentUpload(requestParameters: CompleteDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
|
|
82
141
|
/**
|
|
83
142
|
* Creates request options for createDocument without sending the request
|
|
84
143
|
* @param {CreateDocumentRequest} createDocumentRequest
|
|
@@ -100,6 +159,27 @@ export interface DocumentsApiInterface {
|
|
|
100
159
|
* Create Document Handler
|
|
101
160
|
*/
|
|
102
161
|
createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
162
|
+
/**
|
|
163
|
+
* Creates request options for createDocumentUpload without sending the request
|
|
164
|
+
* @param {CreateUploadRequest} createUploadRequest
|
|
165
|
+
* @throws {RequiredError}
|
|
166
|
+
* @memberof DocumentsApiInterface
|
|
167
|
+
*/
|
|
168
|
+
createDocumentUploadRequestOpts(requestParameters: CreateDocumentUploadRequest): Promise<runtime.RequestOpts>;
|
|
169
|
+
/**
|
|
170
|
+
* 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.
|
|
171
|
+
* @summary Create Document Upload Handler
|
|
172
|
+
* @param {CreateUploadRequest} createUploadRequest
|
|
173
|
+
* @param {*} [options] Override http request option.
|
|
174
|
+
* @throws {RequiredError}
|
|
175
|
+
* @memberof DocumentsApiInterface
|
|
176
|
+
*/
|
|
177
|
+
createDocumentUploadRaw(requestParameters: CreateDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateUploadResponse>>;
|
|
178
|
+
/**
|
|
179
|
+
* 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.
|
|
180
|
+
* Create Document Upload Handler
|
|
181
|
+
*/
|
|
182
|
+
createDocumentUpload(requestParameters: CreateDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateUploadResponse>;
|
|
103
183
|
/**
|
|
104
184
|
* Creates request options for deleteDocument without sending the request
|
|
105
185
|
* @param {string} documentId
|
|
@@ -166,18 +246,39 @@ export interface DocumentsApiInterface {
|
|
|
166
246
|
* Get Document Handler
|
|
167
247
|
*/
|
|
168
248
|
getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
249
|
+
/**
|
|
250
|
+
* Creates request options for getDocumentUploadStatus without sending the request
|
|
251
|
+
* @param {string} xUploadToken
|
|
252
|
+
* @throws {RequiredError}
|
|
253
|
+
* @memberof DocumentsApiInterface
|
|
254
|
+
*/
|
|
255
|
+
getDocumentUploadStatusRequestOpts(requestParameters: GetDocumentUploadStatusRequest): Promise<runtime.RequestOpts>;
|
|
256
|
+
/**
|
|
257
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
258
|
+
* @summary Get Document Upload Status Handler
|
|
259
|
+
* @param {string} xUploadToken
|
|
260
|
+
* @param {*} [options] Override http request option.
|
|
261
|
+
* @throws {RequiredError}
|
|
262
|
+
* @memberof DocumentsApiInterface
|
|
263
|
+
*/
|
|
264
|
+
getDocumentUploadStatusRaw(requestParameters: GetDocumentUploadStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadStatusResponse>>;
|
|
265
|
+
/**
|
|
266
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
267
|
+
* Get Document Upload Status Handler
|
|
268
|
+
*/
|
|
269
|
+
getDocumentUploadStatus(requestParameters: GetDocumentUploadStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadStatusResponse>;
|
|
169
270
|
/**
|
|
170
271
|
* Creates request options for ingestDocument without sending the request
|
|
171
272
|
* @param {Blob} file
|
|
172
273
|
* @param {string} pathPartId Parent path part ID (must be a FOLDER type)
|
|
173
274
|
* @param {string} [name] Document name (defaults to filename)
|
|
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.
|
|
174
277
|
* @param {IngestionMode} [ingestionMode]
|
|
175
278
|
* @param {ChunkType} [chunkType]
|
|
176
279
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
177
280
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
178
281
|
* @param {string} [workflowRunId] Workflow run context for assumed agent uploads.
|
|
179
|
-
* @param {Array<string>} [tagIds] Tag IDs applied to the created document.
|
|
180
|
-
* @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.
|
|
181
282
|
* @param {string} [workflowDefinitionId] Workflow definition context for assumed agent uploads.
|
|
182
283
|
* @throws {RequiredError}
|
|
183
284
|
* @memberof DocumentsApiInterface
|
|
@@ -189,13 +290,13 @@ export interface DocumentsApiInterface {
|
|
|
189
290
|
* @param {Blob} file
|
|
190
291
|
* @param {string} pathPartId Parent path part ID (must be a FOLDER type)
|
|
191
292
|
* @param {string} [name] Document name (defaults to filename)
|
|
293
|
+
* @param {Array<string>} [tagIds] Tag IDs applied to the created document.
|
|
294
|
+
* @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.
|
|
192
295
|
* @param {IngestionMode} [ingestionMode]
|
|
193
296
|
* @param {ChunkType} [chunkType]
|
|
194
297
|
* @param {ImageTaxonomy} [secondaryTaxonomy]
|
|
195
298
|
* @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
|
|
196
299
|
* @param {string} [workflowRunId] Workflow run context for assumed agent uploads.
|
|
197
|
-
* @param {Array<string>} [tagIds] Tag IDs applied to the created document.
|
|
198
|
-
* @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.
|
|
199
300
|
* @param {string} [workflowDefinitionId] Workflow definition context for assumed agent uploads.
|
|
200
301
|
* @param {*} [options] Override http request option.
|
|
201
302
|
* @throws {RequiredError}
|
|
@@ -335,11 +436,64 @@ export interface DocumentsApiInterface {
|
|
|
335
436
|
* Update Document Handler
|
|
336
437
|
*/
|
|
337
438
|
updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
439
|
+
/**
|
|
440
|
+
* Creates request options for uploadDocumentPart without sending the request
|
|
441
|
+
* @param {number} partNumber
|
|
442
|
+
* @param {string} xUploadToken
|
|
443
|
+
* @param {Blob} body
|
|
444
|
+
* @throws {RequiredError}
|
|
445
|
+
* @memberof DocumentsApiInterface
|
|
446
|
+
*/
|
|
447
|
+
uploadDocumentPartRequestOpts(requestParameters: UploadDocumentPartRequest): Promise<runtime.RequestOpts>;
|
|
448
|
+
/**
|
|
449
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
450
|
+
* @summary Upload Document Part Handler
|
|
451
|
+
* @param {number} partNumber
|
|
452
|
+
* @param {string} xUploadToken
|
|
453
|
+
* @param {Blob} body
|
|
454
|
+
* @param {*} [options] Override http request option.
|
|
455
|
+
* @throws {RequiredError}
|
|
456
|
+
* @memberof DocumentsApiInterface
|
|
457
|
+
*/
|
|
458
|
+
uploadDocumentPartRaw(requestParameters: UploadDocumentPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadPartResponse>>;
|
|
459
|
+
/**
|
|
460
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
461
|
+
* Upload Document Part Handler
|
|
462
|
+
*/
|
|
463
|
+
uploadDocumentPart(requestParameters: UploadDocumentPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadPartResponse>;
|
|
338
464
|
}
|
|
339
465
|
/**
|
|
340
466
|
*
|
|
341
467
|
*/
|
|
342
468
|
export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsApiInterface {
|
|
469
|
+
/**
|
|
470
|
+
* Creates request options for abortDocumentUpload without sending the request
|
|
471
|
+
*/
|
|
472
|
+
abortDocumentUploadRequestOpts(requestParameters: AbortDocumentUploadRequest): Promise<runtime.RequestOpts>;
|
|
473
|
+
/**
|
|
474
|
+
* Discard an in-progress resumable upload and its parts.
|
|
475
|
+
* Abort Document Upload Handler
|
|
476
|
+
*/
|
|
477
|
+
abortDocumentUploadRaw(requestParameters: AbortDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
478
|
+
/**
|
|
479
|
+
* Discard an in-progress resumable upload and its parts.
|
|
480
|
+
* Abort Document Upload Handler
|
|
481
|
+
*/
|
|
482
|
+
abortDocumentUpload(requestParameters: AbortDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
483
|
+
/**
|
|
484
|
+
* Creates request options for completeDocumentUpload without sending the request
|
|
485
|
+
*/
|
|
486
|
+
completeDocumentUploadRequestOpts(requestParameters: CompleteDocumentUploadRequest): Promise<runtime.RequestOpts>;
|
|
487
|
+
/**
|
|
488
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
489
|
+
* Complete Document Upload Handler
|
|
490
|
+
*/
|
|
491
|
+
completeDocumentUploadRaw(requestParameters: CompleteDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestDocumentResponse>>;
|
|
492
|
+
/**
|
|
493
|
+
* Assemble the uploaded parts, create the document, and start ingestion.
|
|
494
|
+
* Complete Document Upload Handler
|
|
495
|
+
*/
|
|
496
|
+
completeDocumentUpload(requestParameters: CompleteDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
|
|
343
497
|
/**
|
|
344
498
|
* Creates request options for createDocument without sending the request
|
|
345
499
|
*/
|
|
@@ -354,6 +508,20 @@ export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsAp
|
|
|
354
508
|
* Create Document Handler
|
|
355
509
|
*/
|
|
356
510
|
createDocument(requestParameters: CreateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
511
|
+
/**
|
|
512
|
+
* Creates request options for createDocumentUpload without sending the request
|
|
513
|
+
*/
|
|
514
|
+
createDocumentUploadRequestOpts(requestParameters: CreateDocumentUploadRequest): Promise<runtime.RequestOpts>;
|
|
515
|
+
/**
|
|
516
|
+
* 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.
|
|
517
|
+
* Create Document Upload Handler
|
|
518
|
+
*/
|
|
519
|
+
createDocumentUploadRaw(requestParameters: CreateDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateUploadResponse>>;
|
|
520
|
+
/**
|
|
521
|
+
* 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.
|
|
522
|
+
* Create Document Upload Handler
|
|
523
|
+
*/
|
|
524
|
+
createDocumentUpload(requestParameters: CreateDocumentUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateUploadResponse>;
|
|
357
525
|
/**
|
|
358
526
|
* Creates request options for deleteDocument without sending the request
|
|
359
527
|
*/
|
|
@@ -394,6 +562,20 @@ export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsAp
|
|
|
394
562
|
* Get Document Handler
|
|
395
563
|
*/
|
|
396
564
|
getDocument(requestParameters: GetDocumentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
565
|
+
/**
|
|
566
|
+
* Creates request options for getDocumentUploadStatus without sending the request
|
|
567
|
+
*/
|
|
568
|
+
getDocumentUploadStatusRequestOpts(requestParameters: GetDocumentUploadStatusRequest): Promise<runtime.RequestOpts>;
|
|
569
|
+
/**
|
|
570
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
571
|
+
* Get Document Upload Status Handler
|
|
572
|
+
*/
|
|
573
|
+
getDocumentUploadStatusRaw(requestParameters: GetDocumentUploadStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadStatusResponse>>;
|
|
574
|
+
/**
|
|
575
|
+
* Report which parts S3 already holds so the client resumes the rest.
|
|
576
|
+
* Get Document Upload Status Handler
|
|
577
|
+
*/
|
|
578
|
+
getDocumentUploadStatus(requestParameters: GetDocumentUploadStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadStatusResponse>;
|
|
397
579
|
/**
|
|
398
580
|
* Creates request options for ingestDocument without sending the request
|
|
399
581
|
*/
|
|
@@ -464,4 +646,18 @@ export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsAp
|
|
|
464
646
|
* Update Document Handler
|
|
465
647
|
*/
|
|
466
648
|
updateDocument(requestParameters: UpdateDocumentOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse>;
|
|
649
|
+
/**
|
|
650
|
+
* Creates request options for uploadDocumentPart without sending the request
|
|
651
|
+
*/
|
|
652
|
+
uploadDocumentPartRequestOpts(requestParameters: UploadDocumentPartRequest): Promise<runtime.RequestOpts>;
|
|
653
|
+
/**
|
|
654
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
655
|
+
* Upload Document Part Handler
|
|
656
|
+
*/
|
|
657
|
+
uploadDocumentPartRaw(requestParameters: UploadDocumentPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UploadPartResponse>>;
|
|
658
|
+
/**
|
|
659
|
+
* Upload one part (raw octet-stream body) of a resumable upload.
|
|
660
|
+
* Upload Document Part Handler
|
|
661
|
+
*/
|
|
662
|
+
uploadDocumentPart(requestParameters: UploadDocumentPartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UploadPartResponse>;
|
|
467
663
|
}
|