@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.
Files changed (83) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +12 -2
  3. package/dist/apis/DocumentsApi.d.ts +203 -7
  4. package/dist/apis/DocumentsApi.js +262 -6
  5. package/dist/esm/apis/DocumentsApi.d.ts +203 -7
  6. package/dist/esm/apis/DocumentsApi.js +263 -7
  7. package/dist/esm/models/ChunkMetadata.d.ts +12 -0
  8. package/dist/esm/models/ChunkMetadata.js +4 -0
  9. package/dist/esm/models/Citation.d.ts +12 -0
  10. package/dist/esm/models/Citation.js +4 -0
  11. package/dist/esm/models/CompleteUploadRequest.d.ts +47 -0
  12. package/dist/esm/models/CompleteUploadRequest.js +44 -0
  13. package/dist/esm/models/CreateUploadRequest.d.ts +65 -0
  14. package/dist/esm/models/CreateUploadRequest.js +56 -0
  15. package/dist/esm/models/CreateUploadResponse.d.ts +65 -0
  16. package/dist/esm/models/CreateUploadResponse.js +56 -0
  17. package/dist/esm/models/DocumentType.d.ts +2 -0
  18. package/dist/esm/models/DocumentType.js +2 -0
  19. package/dist/esm/models/EnrichedCitation.d.ts +12 -0
  20. package/dist/esm/models/EnrichedCitation.js +4 -0
  21. package/dist/esm/models/IngestionMode.d.ts +1 -0
  22. package/dist/esm/models/IngestionMode.js +2 -1
  23. package/dist/esm/models/SubscriptionPlanResponse.d.ts +6 -0
  24. package/dist/esm/models/SubscriptionPlanResponse.js +4 -0
  25. package/dist/esm/models/UploadPartResponse.d.ts +59 -0
  26. package/dist/esm/models/UploadPartResponse.js +52 -0
  27. package/dist/esm/models/UploadStatusResponse.d.ts +54 -0
  28. package/dist/esm/models/UploadStatusResponse.js +49 -0
  29. package/dist/esm/models/UsageMetric.d.ts +1 -0
  30. package/dist/esm/models/UsageMetric.js +2 -1
  31. package/dist/esm/models/index.d.ts +5 -0
  32. package/dist/esm/models/index.js +5 -0
  33. package/dist/models/ChunkMetadata.d.ts +12 -0
  34. package/dist/models/ChunkMetadata.js +4 -0
  35. package/dist/models/Citation.d.ts +12 -0
  36. package/dist/models/Citation.js +4 -0
  37. package/dist/models/CompleteUploadRequest.d.ts +47 -0
  38. package/dist/models/CompleteUploadRequest.js +52 -0
  39. package/dist/models/CreateUploadRequest.d.ts +65 -0
  40. package/dist/models/CreateUploadRequest.js +64 -0
  41. package/dist/models/CreateUploadResponse.d.ts +65 -0
  42. package/dist/models/CreateUploadResponse.js +64 -0
  43. package/dist/models/DocumentType.d.ts +2 -0
  44. package/dist/models/DocumentType.js +2 -0
  45. package/dist/models/EnrichedCitation.d.ts +12 -0
  46. package/dist/models/EnrichedCitation.js +4 -0
  47. package/dist/models/IngestionMode.d.ts +1 -0
  48. package/dist/models/IngestionMode.js +2 -1
  49. package/dist/models/SubscriptionPlanResponse.d.ts +6 -0
  50. package/dist/models/SubscriptionPlanResponse.js +4 -0
  51. package/dist/models/UploadPartResponse.d.ts +59 -0
  52. package/dist/models/UploadPartResponse.js +60 -0
  53. package/dist/models/UploadStatusResponse.d.ts +54 -0
  54. package/dist/models/UploadStatusResponse.js +57 -0
  55. package/dist/models/UsageMetric.d.ts +1 -0
  56. package/dist/models/UsageMetric.js +2 -1
  57. package/dist/models/index.d.ts +5 -0
  58. package/dist/models/index.js +5 -0
  59. package/docs/ChunkMetadata.md +4 -0
  60. package/docs/Citation.md +4 -0
  61. package/docs/CompleteUploadRequest.md +35 -0
  62. package/docs/CreateUploadRequest.md +41 -0
  63. package/docs/CreateUploadResponse.md +41 -0
  64. package/docs/DocumentsApi.md +397 -11
  65. package/docs/EnrichedCitation.md +4 -0
  66. package/docs/SubscriptionPlanResponse.md +2 -0
  67. package/docs/UploadPartResponse.md +39 -0
  68. package/docs/UploadStatusResponse.md +37 -0
  69. package/package.json +1 -1
  70. package/src/apis/DocumentsApi.ts +480 -14
  71. package/src/models/ChunkMetadata.ts +16 -0
  72. package/src/models/Citation.ts +16 -0
  73. package/src/models/CompleteUploadRequest.ts +83 -0
  74. package/src/models/CreateUploadRequest.ts +110 -0
  75. package/src/models/CreateUploadResponse.ts +110 -0
  76. package/src/models/DocumentType.ts +2 -0
  77. package/src/models/EnrichedCitation.ts +16 -0
  78. package/src/models/IngestionMode.ts +2 -1
  79. package/src/models/SubscriptionPlanResponse.ts +9 -0
  80. package/src/models/UploadPartResponse.ts +101 -0
  81. package/src/models/UploadStatusResponse.ts +100 -0
  82. package/src/models/UsageMetric.ts +2 -1
  83. package/src/models/index.ts +5 -0
@@ -21,11 +21,109 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { CreateDocumentRequestToJSON, DocumentDownloadResponseFromJSON, DocumentResponseFromJSON, IngestDocumentResponseFromJSON, IngestZipResponseFromJSON, PaginatedResponseDocumentResponseFromJSON, UpdateDocumentRequestToJSON, } from '../models/index';
24
+ import { CompleteUploadRequestToJSON, CreateDocumentRequestToJSON, CreateUploadRequestToJSON, CreateUploadResponseFromJSON, DocumentDownloadResponseFromJSON, DocumentResponseFromJSON, IngestDocumentResponseFromJSON, IngestZipResponseFromJSON, PaginatedResponseDocumentResponseFromJSON, UpdateDocumentRequestToJSON, UploadPartResponseFromJSON, UploadStatusResponseFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class DocumentsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates request options for abortDocumentUpload without sending the request
31
+ */
32
+ abortDocumentUploadRequestOpts(requestParameters) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (requestParameters['xUploadToken'] == null) {
35
+ throw new runtime.RequiredError('xUploadToken', 'Required parameter "xUploadToken" was null or undefined when calling abortDocumentUpload().');
36
+ }
37
+ const queryParameters = {};
38
+ const headerParameters = {};
39
+ if (requestParameters['xUploadToken'] != null) {
40
+ headerParameters['X-Upload-Token'] = String(requestParameters['xUploadToken']);
41
+ }
42
+ if (this.configuration && this.configuration.accessToken) {
43
+ const token = this.configuration.accessToken;
44
+ const tokenString = yield token("bearerAuth", []);
45
+ if (tokenString) {
46
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
47
+ }
48
+ }
49
+ let urlPath = `/v1/documents/uploads`;
50
+ return {
51
+ path: urlPath,
52
+ method: 'DELETE',
53
+ headers: headerParameters,
54
+ query: queryParameters,
55
+ };
56
+ });
57
+ }
58
+ /**
59
+ * Discard an in-progress resumable upload and its parts.
60
+ * Abort Document Upload Handler
61
+ */
62
+ abortDocumentUploadRaw(requestParameters, initOverrides) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const requestOptions = yield this.abortDocumentUploadRequestOpts(requestParameters);
65
+ const response = yield this.request(requestOptions, initOverrides);
66
+ return new runtime.VoidApiResponse(response);
67
+ });
68
+ }
69
+ /**
70
+ * Discard an in-progress resumable upload and its parts.
71
+ * Abort Document Upload Handler
72
+ */
73
+ abortDocumentUpload(requestParameters, initOverrides) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ yield this.abortDocumentUploadRaw(requestParameters, initOverrides);
76
+ });
77
+ }
78
+ /**
79
+ * Creates request options for completeDocumentUpload without sending the request
80
+ */
81
+ completeDocumentUploadRequestOpts(requestParameters) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ if (requestParameters['completeUploadRequest'] == null) {
84
+ throw new runtime.RequiredError('completeUploadRequest', 'Required parameter "completeUploadRequest" was null or undefined when calling completeDocumentUpload().');
85
+ }
86
+ const queryParameters = {};
87
+ const headerParameters = {};
88
+ headerParameters['Content-Type'] = 'application/json';
89
+ if (this.configuration && this.configuration.accessToken) {
90
+ const token = this.configuration.accessToken;
91
+ const tokenString = yield token("bearerAuth", []);
92
+ if (tokenString) {
93
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
94
+ }
95
+ }
96
+ let urlPath = `/v1/documents/uploads/complete`;
97
+ return {
98
+ path: urlPath,
99
+ method: 'POST',
100
+ headers: headerParameters,
101
+ query: queryParameters,
102
+ body: CompleteUploadRequestToJSON(requestParameters['completeUploadRequest']),
103
+ };
104
+ });
105
+ }
106
+ /**
107
+ * Assemble the uploaded parts, create the document, and start ingestion.
108
+ * Complete Document Upload Handler
109
+ */
110
+ completeDocumentUploadRaw(requestParameters, initOverrides) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ const requestOptions = yield this.completeDocumentUploadRequestOpts(requestParameters);
113
+ const response = yield this.request(requestOptions, initOverrides);
114
+ return new runtime.JSONApiResponse(response, (jsonValue) => IngestDocumentResponseFromJSON(jsonValue));
115
+ });
116
+ }
117
+ /**
118
+ * Assemble the uploaded parts, create the document, and start ingestion.
119
+ * Complete Document Upload Handler
120
+ */
121
+ completeDocumentUpload(requestParameters, initOverrides) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const response = yield this.completeDocumentUploadRaw(requestParameters, initOverrides);
124
+ return yield response.value();
125
+ });
126
+ }
29
127
  /**
30
128
  * Creates request options for createDocument without sending the request
31
129
  */
@@ -75,6 +173,55 @@ export class DocumentsApi extends runtime.BaseAPI {
75
173
  return yield response.value();
76
174
  });
77
175
  }
176
+ /**
177
+ * Creates request options for createDocumentUpload without sending the request
178
+ */
179
+ createDocumentUploadRequestOpts(requestParameters) {
180
+ return __awaiter(this, void 0, void 0, function* () {
181
+ if (requestParameters['createUploadRequest'] == null) {
182
+ throw new runtime.RequiredError('createUploadRequest', 'Required parameter "createUploadRequest" was null or undefined when calling createDocumentUpload().');
183
+ }
184
+ const queryParameters = {};
185
+ const headerParameters = {};
186
+ headerParameters['Content-Type'] = 'application/json';
187
+ if (this.configuration && this.configuration.accessToken) {
188
+ const token = this.configuration.accessToken;
189
+ const tokenString = yield token("bearerAuth", []);
190
+ if (tokenString) {
191
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
192
+ }
193
+ }
194
+ let urlPath = `/v1/documents/uploads`;
195
+ return {
196
+ path: urlPath,
197
+ method: 'POST',
198
+ headers: headerParameters,
199
+ query: queryParameters,
200
+ body: CreateUploadRequestToJSON(requestParameters['createUploadRequest']),
201
+ };
202
+ });
203
+ }
204
+ /**
205
+ * 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.
206
+ * Create Document Upload Handler
207
+ */
208
+ createDocumentUploadRaw(requestParameters, initOverrides) {
209
+ return __awaiter(this, void 0, void 0, function* () {
210
+ const requestOptions = yield this.createDocumentUploadRequestOpts(requestParameters);
211
+ const response = yield this.request(requestOptions, initOverrides);
212
+ return new runtime.JSONApiResponse(response, (jsonValue) => CreateUploadResponseFromJSON(jsonValue));
213
+ });
214
+ }
215
+ /**
216
+ * 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.
217
+ * Create Document Upload Handler
218
+ */
219
+ createDocumentUpload(requestParameters, initOverrides) {
220
+ return __awaiter(this, void 0, void 0, function* () {
221
+ const response = yield this.createDocumentUploadRaw(requestParameters, initOverrides);
222
+ return yield response.value();
223
+ });
224
+ }
78
225
  /**
79
226
  * Creates request options for deleteDocument without sending the request
80
227
  */
@@ -222,6 +369,56 @@ export class DocumentsApi extends runtime.BaseAPI {
222
369
  return yield response.value();
223
370
  });
224
371
  }
372
+ /**
373
+ * Creates request options for getDocumentUploadStatus without sending the request
374
+ */
375
+ getDocumentUploadStatusRequestOpts(requestParameters) {
376
+ return __awaiter(this, void 0, void 0, function* () {
377
+ if (requestParameters['xUploadToken'] == null) {
378
+ throw new runtime.RequiredError('xUploadToken', 'Required parameter "xUploadToken" was null or undefined when calling getDocumentUploadStatus().');
379
+ }
380
+ const queryParameters = {};
381
+ const headerParameters = {};
382
+ if (requestParameters['xUploadToken'] != null) {
383
+ headerParameters['X-Upload-Token'] = String(requestParameters['xUploadToken']);
384
+ }
385
+ if (this.configuration && this.configuration.accessToken) {
386
+ const token = this.configuration.accessToken;
387
+ const tokenString = yield token("bearerAuth", []);
388
+ if (tokenString) {
389
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
390
+ }
391
+ }
392
+ let urlPath = `/v1/documents/uploads/parts`;
393
+ return {
394
+ path: urlPath,
395
+ method: 'GET',
396
+ headers: headerParameters,
397
+ query: queryParameters,
398
+ };
399
+ });
400
+ }
401
+ /**
402
+ * Report which parts S3 already holds so the client resumes the rest.
403
+ * Get Document Upload Status Handler
404
+ */
405
+ getDocumentUploadStatusRaw(requestParameters, initOverrides) {
406
+ return __awaiter(this, void 0, void 0, function* () {
407
+ const requestOptions = yield this.getDocumentUploadStatusRequestOpts(requestParameters);
408
+ const response = yield this.request(requestOptions, initOverrides);
409
+ return new runtime.JSONApiResponse(response, (jsonValue) => UploadStatusResponseFromJSON(jsonValue));
410
+ });
411
+ }
412
+ /**
413
+ * Report which parts S3 already holds so the client resumes the rest.
414
+ * Get Document Upload Status Handler
415
+ */
416
+ getDocumentUploadStatus(requestParameters, initOverrides) {
417
+ return __awaiter(this, void 0, void 0, function* () {
418
+ const response = yield this.getDocumentUploadStatusRaw(requestParameters, initOverrides);
419
+ return yield response.value();
420
+ });
421
+ }
225
422
  /**
226
423
  * Creates request options for ingestDocument without sending the request
227
424
  */
@@ -266,6 +463,12 @@ export class DocumentsApi extends runtime.BaseAPI {
266
463
  if (requestParameters['name'] != null) {
267
464
  formParams.append('name', requestParameters['name']);
268
465
  }
466
+ if (requestParameters['tagIds'] != null) {
467
+ formParams.append('tag_ids', requestParameters['tagIds'].join(runtime.COLLECTION_FORMATS["csv"]));
468
+ }
469
+ if (requestParameters['idempotencyKey'] != null) {
470
+ formParams.append('idempotency_key', requestParameters['idempotencyKey']);
471
+ }
269
472
  if (requestParameters['ingestionMode'] != null) {
270
473
  formParams.append('ingestion_mode', requestParameters['ingestionMode']);
271
474
  }
@@ -281,12 +484,6 @@ export class DocumentsApi extends runtime.BaseAPI {
281
484
  if (requestParameters['workflowRunId'] != null) {
282
485
  formParams.append('workflow_run_id', requestParameters['workflowRunId']);
283
486
  }
284
- if (requestParameters['tagIds'] != null) {
285
- formParams.append('tag_ids', requestParameters['tagIds'].join(runtime.COLLECTION_FORMATS["csv"]));
286
- }
287
- if (requestParameters['idempotencyKey'] != null) {
288
- formParams.append('idempotency_key', requestParameters['idempotencyKey']);
289
- }
290
487
  if (requestParameters['workflowDefinitionId'] != null) {
291
488
  formParams.append('workflow_definition_id', requestParameters['workflowDefinitionId']);
292
489
  }
@@ -620,4 +817,63 @@ export class DocumentsApi extends runtime.BaseAPI {
620
817
  return yield response.value();
621
818
  });
622
819
  }
820
+ /**
821
+ * Creates request options for uploadDocumentPart without sending the request
822
+ */
823
+ uploadDocumentPartRequestOpts(requestParameters) {
824
+ return __awaiter(this, void 0, void 0, function* () {
825
+ if (requestParameters['partNumber'] == null) {
826
+ throw new runtime.RequiredError('partNumber', 'Required parameter "partNumber" was null or undefined when calling uploadDocumentPart().');
827
+ }
828
+ if (requestParameters['xUploadToken'] == null) {
829
+ throw new runtime.RequiredError('xUploadToken', 'Required parameter "xUploadToken" was null or undefined when calling uploadDocumentPart().');
830
+ }
831
+ if (requestParameters['body'] == null) {
832
+ throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling uploadDocumentPart().');
833
+ }
834
+ const queryParameters = {};
835
+ const headerParameters = {};
836
+ headerParameters['Content-Type'] = 'application/octet-stream';
837
+ if (requestParameters['xUploadToken'] != null) {
838
+ headerParameters['X-Upload-Token'] = String(requestParameters['xUploadToken']);
839
+ }
840
+ if (this.configuration && this.configuration.accessToken) {
841
+ const token = this.configuration.accessToken;
842
+ const tokenString = yield token("bearerAuth", []);
843
+ if (tokenString) {
844
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
845
+ }
846
+ }
847
+ let urlPath = `/v1/documents/uploads/parts/{part_number}`;
848
+ urlPath = urlPath.replace(`{${"part_number"}}`, encodeURIComponent(String(requestParameters['partNumber'])));
849
+ return {
850
+ path: urlPath,
851
+ method: 'PUT',
852
+ headers: headerParameters,
853
+ query: queryParameters,
854
+ body: requestParameters['body'],
855
+ };
856
+ });
857
+ }
858
+ /**
859
+ * Upload one part (raw octet-stream body) of a resumable upload.
860
+ * Upload Document Part Handler
861
+ */
862
+ uploadDocumentPartRaw(requestParameters, initOverrides) {
863
+ return __awaiter(this, void 0, void 0, function* () {
864
+ const requestOptions = yield this.uploadDocumentPartRequestOpts(requestParameters);
865
+ const response = yield this.request(requestOptions, initOverrides);
866
+ return new runtime.JSONApiResponse(response, (jsonValue) => UploadPartResponseFromJSON(jsonValue));
867
+ });
868
+ }
869
+ /**
870
+ * Upload one part (raw octet-stream body) of a resumable upload.
871
+ * Upload Document Part Handler
872
+ */
873
+ uploadDocumentPart(requestParameters, initOverrides) {
874
+ return __awaiter(this, void 0, void 0, function* () {
875
+ const response = yield this.uploadDocumentPartRaw(requestParameters, initOverrides);
876
+ return yield response.value();
877
+ });
878
+ }
623
879
  }
@@ -53,6 +53,18 @@ export interface ChunkMetadata {
53
53
  * @memberof ChunkMetadata
54
54
  */
55
55
  secondaryTaxonomy?: ImageTaxonomy;
56
+ /**
57
+ * Start time of this chunk in the source media (ms from start).
58
+ * @type {number}
59
+ * @memberof ChunkMetadata
60
+ */
61
+ startMs?: number | null;
62
+ /**
63
+ * End time of this chunk in the source media (ms from start).
64
+ * @type {number}
65
+ * @memberof ChunkMetadata
66
+ */
67
+ endMs?: number | null;
56
68
  /**
57
69
  * Worksheet name this chunk was extracted from (XLSX only)
58
70
  * @type {string}
@@ -34,6 +34,8 @@ export function ChunkMetadataFromJSONTyped(json, ignoreDiscriminator) {
34
34
  'summarizeForEmbedding': json['summarize_for_embedding'] == null ? undefined : json['summarize_for_embedding'],
35
35
  'extractedTextS3Uri': json['extracted_text_s3_uri'] == null ? undefined : json['extracted_text_s3_uri'],
36
36
  'secondaryTaxonomy': json['secondary_taxonomy'] == null ? undefined : ImageTaxonomyFromJSON(json['secondary_taxonomy']),
37
+ 'startMs': json['start_ms'] == null ? undefined : json['start_ms'],
38
+ 'endMs': json['end_ms'] == null ? undefined : json['end_ms'],
37
39
  'sheetName': json['sheet_name'] == null ? undefined : json['sheet_name'],
38
40
  'blockType': json['block_type'] == null ? undefined : json['block_type'],
39
41
  'sourceUri': json['source_uri'] == null ? undefined : json['source_uri'],
@@ -59,6 +61,8 @@ export function ChunkMetadataToJSONTyped(value, ignoreDiscriminator = false) {
59
61
  'summarize_for_embedding': value['summarizeForEmbedding'],
60
62
  'extracted_text_s3_uri': value['extractedTextS3Uri'],
61
63
  'secondary_taxonomy': ImageTaxonomyToJSON(value['secondaryTaxonomy']),
64
+ 'start_ms': value['startMs'],
65
+ 'end_ms': value['endMs'],
62
66
  'sheet_name': value['sheetName'],
63
67
  'block_type': value['blockType'],
64
68
  'source_uri': value['sourceUri'],
@@ -39,6 +39,18 @@ export interface Citation {
39
39
  * @memberof Citation
40
40
  */
41
41
  length: number;
42
+ /**
43
+ * Start time (ms) of the cited chunk in the source media, for AUDIO/VIDEO — lets the client deep-link playback to the moment. None for non-media chunks.
44
+ * @type {number}
45
+ * @memberof Citation
46
+ */
47
+ startMs?: number | null;
48
+ /**
49
+ * End time (ms) of the cited chunk in the source media (AUDIO/VIDEO); None for non-media chunks.
50
+ * @type {number}
51
+ * @memberof Citation
52
+ */
53
+ endMs?: number | null;
42
54
  }
43
55
  export declare const CitationPropertyValidationAttributesMap: {
44
56
  [property: string]: {
@@ -43,6 +43,8 @@ export function CitationFromJSONTyped(json, ignoreDiscriminator) {
43
43
  'quote': json['quote'],
44
44
  'startChar': json['start_char'],
45
45
  'length': json['length'],
46
+ 'startMs': json['start_ms'] == null ? undefined : json['start_ms'],
47
+ 'endMs': json['end_ms'] == null ? undefined : json['end_ms'],
46
48
  };
47
49
  }
48
50
  export function CitationToJSON(json) {
@@ -57,5 +59,7 @@ export function CitationToJSONTyped(value, ignoreDiscriminator = false) {
57
59
  'quote': value['quote'],
58
60
  'start_char': value['startChar'],
59
61
  'length': value['length'],
62
+ 'start_ms': value['startMs'],
63
+ 'end_ms': value['endMs'],
60
64
  };
61
65
  }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Finalize a resumable upload and start ingestion.
14
+ * @export
15
+ * @interface CompleteUploadRequest
16
+ */
17
+ export interface CompleteUploadRequest {
18
+ /**
19
+ * Token from create-upload
20
+ * @type {string}
21
+ * @memberof CompleteUploadRequest
22
+ */
23
+ uploadToken: string;
24
+ }
25
+ export declare const CompleteUploadRequestPropertyValidationAttributesMap: {
26
+ [property: string]: {
27
+ maxLength?: number;
28
+ minLength?: number;
29
+ pattern?: string;
30
+ maximum?: number;
31
+ exclusiveMaximum?: boolean;
32
+ minimum?: number;
33
+ exclusiveMinimum?: boolean;
34
+ multipleOf?: number;
35
+ maxItems?: number;
36
+ minItems?: number;
37
+ uniqueItems?: boolean;
38
+ };
39
+ };
40
+ /**
41
+ * Check if a given object implements the CompleteUploadRequest interface.
42
+ */
43
+ export declare function instanceOfCompleteUploadRequest(value: object): value is CompleteUploadRequest;
44
+ export declare function CompleteUploadRequestFromJSON(json: any): CompleteUploadRequest;
45
+ export declare function CompleteUploadRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompleteUploadRequest;
46
+ export declare function CompleteUploadRequestToJSON(json: any): CompleteUploadRequest;
47
+ export declare function CompleteUploadRequestToJSONTyped(value?: CompleteUploadRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,44 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ export const CompleteUploadRequestPropertyValidationAttributesMap = {};
15
+ /**
16
+ * Check if a given object implements the CompleteUploadRequest interface.
17
+ */
18
+ export function instanceOfCompleteUploadRequest(value) {
19
+ if (!('uploadToken' in value) || value['uploadToken'] === undefined)
20
+ return false;
21
+ return true;
22
+ }
23
+ export function CompleteUploadRequestFromJSON(json) {
24
+ return CompleteUploadRequestFromJSONTyped(json, false);
25
+ }
26
+ export function CompleteUploadRequestFromJSONTyped(json, ignoreDiscriminator) {
27
+ if (json == null) {
28
+ return json;
29
+ }
30
+ return {
31
+ 'uploadToken': json['upload_token'],
32
+ };
33
+ }
34
+ export function CompleteUploadRequestToJSON(json) {
35
+ return CompleteUploadRequestToJSONTyped(json, false);
36
+ }
37
+ export function CompleteUploadRequestToJSONTyped(value, ignoreDiscriminator = false) {
38
+ if (value == null) {
39
+ return value;
40
+ }
41
+ return {
42
+ 'upload_token': value['uploadToken'],
43
+ };
44
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Begin a resumable upload.
14
+ * @export
15
+ * @interface CreateUploadRequest
16
+ */
17
+ export interface CreateUploadRequest {
18
+ /**
19
+ * Parent folder path part ID (FOLDER)
20
+ * @type {string}
21
+ * @memberof CreateUploadRequest
22
+ */
23
+ parentPathId: string;
24
+ /**
25
+ * Document name
26
+ * @type {string}
27
+ * @memberof CreateUploadRequest
28
+ */
29
+ name: string;
30
+ /**
31
+ * Original filename; its extension selects the type + size cap
32
+ * @type {string}
33
+ * @memberof CreateUploadRequest
34
+ */
35
+ filename: string;
36
+ /**
37
+ * Declared total size; fast-rejected against the type cap
38
+ * @type {number}
39
+ * @memberof CreateUploadRequest
40
+ */
41
+ sizeBytes: number;
42
+ }
43
+ export declare const CreateUploadRequestPropertyValidationAttributesMap: {
44
+ [property: string]: {
45
+ maxLength?: number;
46
+ minLength?: number;
47
+ pattern?: string;
48
+ maximum?: number;
49
+ exclusiveMaximum?: boolean;
50
+ minimum?: number;
51
+ exclusiveMinimum?: boolean;
52
+ multipleOf?: number;
53
+ maxItems?: number;
54
+ minItems?: number;
55
+ uniqueItems?: boolean;
56
+ };
57
+ };
58
+ /**
59
+ * Check if a given object implements the CreateUploadRequest interface.
60
+ */
61
+ export declare function instanceOfCreateUploadRequest(value: object): value is CreateUploadRequest;
62
+ export declare function CreateUploadRequestFromJSON(json: any): CreateUploadRequest;
63
+ export declare function CreateUploadRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateUploadRequest;
64
+ export declare function CreateUploadRequestToJSON(json: any): CreateUploadRequest;
65
+ export declare function CreateUploadRequestToJSONTyped(value?: CreateUploadRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,56 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Knowledge Stack API
5
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ export const CreateUploadRequestPropertyValidationAttributesMap = {};
15
+ /**
16
+ * Check if a given object implements the CreateUploadRequest interface.
17
+ */
18
+ export function instanceOfCreateUploadRequest(value) {
19
+ if (!('parentPathId' in value) || value['parentPathId'] === undefined)
20
+ return false;
21
+ if (!('name' in value) || value['name'] === undefined)
22
+ return false;
23
+ if (!('filename' in value) || value['filename'] === undefined)
24
+ return false;
25
+ if (!('sizeBytes' in value) || value['sizeBytes'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ export function CreateUploadRequestFromJSON(json) {
30
+ return CreateUploadRequestFromJSONTyped(json, false);
31
+ }
32
+ export function CreateUploadRequestFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'parentPathId': json['parent_path_id'],
38
+ 'name': json['name'],
39
+ 'filename': json['filename'],
40
+ 'sizeBytes': json['size_bytes'],
41
+ };
42
+ }
43
+ export function CreateUploadRequestToJSON(json) {
44
+ return CreateUploadRequestToJSONTyped(json, false);
45
+ }
46
+ export function CreateUploadRequestToJSONTyped(value, ignoreDiscriminator = false) {
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'parent_path_id': value['parentPathId'],
52
+ 'name': value['name'],
53
+ 'filename': value['filename'],
54
+ 'size_bytes': value['sizeBytes'],
55
+ };
56
+ }