@knowledge-stack/ksapi 1.146.0 → 1.147.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.
@@ -161,6 +161,7 @@ docs/IdpType.md
161
161
  docs/ImageTaxonomy.md
162
162
  docs/InformationStatistics.md
163
163
  docs/IngestDocumentResponse.md
164
+ docs/IngestZipResponse.md
164
165
  docs/IngestionMode.md
165
166
  docs/Input.md
166
167
  docs/InputOrigin.md
@@ -399,6 +400,7 @@ docs/XlsxCellAnchorInput.md
399
400
  docs/XlsxCellAnchorInputOrDocxParagraphAnchorInput.md
400
401
  docs/XlsxCellAnchorOutput.md
401
402
  docs/XlsxCellAnchorOutputOrDocxParagraphAnchorOutput.md
403
+ docs/ZipFileResult.md
402
404
  package.json
403
405
  src/apis/AdminKbApi.ts
404
406
  src/apis/AdminWorkflowsApi.ts
@@ -581,6 +583,7 @@ src/models/IdpType.ts
581
583
  src/models/ImageTaxonomy.ts
582
584
  src/models/InformationStatistics.ts
583
585
  src/models/IngestDocumentResponse.ts
586
+ src/models/IngestZipResponse.ts
584
587
  src/models/IngestionMode.ts
585
588
  src/models/Input.ts
586
589
  src/models/InputOrigin.ts
@@ -799,6 +802,7 @@ src/models/XlsxCellAnchorInput.ts
799
802
  src/models/XlsxCellAnchorInputOrDocxParagraphAnchorInput.ts
800
803
  src/models/XlsxCellAnchorOutput.ts
801
804
  src/models/XlsxCellAnchorOutputOrDocxParagraphAnchorOutput.ts
805
+ src/models/ZipFileResult.ts
802
806
  src/models/index.ts
803
807
  src/runtime.ts
804
808
  tsconfig.esm.json
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @knowledge-stack/ksapi@1.146.0
1
+ # @knowledge-stack/ksapi@1.147.1
2
2
 
3
3
  A TypeScript SDK client for the localhost API.
4
4
 
@@ -142,6 +142,7 @@ All URIs are relative to *http://localhost:8000*
142
142
  *DocumentsApi* | [**getDocument**](docs/DocumentsApi.md#getdocument) | **GET** /v1/documents/{document_id} | Get Document Handler
143
143
  *DocumentsApi* | [**ingestDocument**](docs/DocumentsApi.md#ingestdocument) | **POST** /v1/documents/ingest | Ingest Document Handler
144
144
  *DocumentsApi* | [**ingestDocumentVersion**](docs/DocumentsApi.md#ingestdocumentversion) | **POST** /v1/documents/{document_id}/ingest | Ingest Document Version Handler
145
+ *DocumentsApi* | [**ingestZip**](docs/DocumentsApi.md#ingestzip) | **POST** /v1/documents/ingest-zip | Ingest Zip Handler
145
146
  *DocumentsApi* | [**listDocuments**](docs/DocumentsApi.md#listdocuments) | **GET** /v1/documents | List Documents Handler
146
147
  *DocumentsApi* | [**updateDocument**](docs/DocumentsApi.md#updatedocumentoperation) | **PATCH** /v1/documents/{document_id} | Update Document Handler
147
148
  *FeaturesApi* | [**getFeatures**](docs/FeaturesApi.md#getfeatures) | **GET** /v1/features | Get Features Handler
@@ -430,6 +431,7 @@ All URIs are relative to *http://localhost:8000*
430
431
  - [ImageTaxonomy](docs/ImageTaxonomy.md)
431
432
  - [InformationStatistics](docs/InformationStatistics.md)
432
433
  - [IngestDocumentResponse](docs/IngestDocumentResponse.md)
434
+ - [IngestZipResponse](docs/IngestZipResponse.md)
433
435
  - [IngestionMode](docs/IngestionMode.md)
434
436
  - [Input](docs/Input.md)
435
437
  - [InputOrigin](docs/InputOrigin.md)
@@ -648,6 +650,7 @@ All URIs are relative to *http://localhost:8000*
648
650
  - [XlsxCellAnchorInputOrDocxParagraphAnchorInput](docs/XlsxCellAnchorInputOrDocxParagraphAnchorInput.md)
649
651
  - [XlsxCellAnchorOutput](docs/XlsxCellAnchorOutput.md)
650
652
  - [XlsxCellAnchorOutputOrDocxParagraphAnchorOutput](docs/XlsxCellAnchorOutputOrDocxParagraphAnchorOutput.md)
653
+ - [ZipFileResult](docs/ZipFileResult.md)
651
654
 
652
655
  ### Authorization
653
656
 
@@ -673,7 +676,7 @@ and is automatically generated by the
673
676
  [OpenAPI Generator](https://openapi-generator.tech) project:
674
677
 
675
678
  - API version: `0.1.0`
676
- - Package version: `1.146.0`
679
+ - Package version: `1.147.1`
677
680
  - Generator version: `7.21.0`
678
681
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
679
682
 
@@ -10,7 +10,7 @@
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, IngestionMode, PaginatedResponseDocumentResponse, PathOrder, SortDirection, UpdateDocumentRequest } from '../models/index';
13
+ import type { ChunkType, CreateDocumentRequest, DocumentDownloadResponse, DocumentResponse, DocumentType, DownloadArtifact, ImageTaxonomy, IngestDocumentResponse, IngestZipResponse, IngestionMode, PaginatedResponseDocumentResponse, PathOrder, SortDirection, UpdateDocumentRequest } from '../models/index';
14
14
  export interface CreateDocumentOperationRequest {
15
15
  createDocumentRequest: CreateDocumentRequest;
16
16
  }
@@ -46,6 +46,11 @@ export interface IngestDocumentVersionRequest {
46
46
  workflowRunId?: string | null;
47
47
  workflowDefinitionId?: string | null;
48
48
  }
49
+ export interface IngestZipRequest {
50
+ file: Blob;
51
+ pathPartId: string;
52
+ ingestionMode?: IngestionMode;
53
+ }
49
54
  export interface ListDocumentsRequest {
50
55
  parentPathPartId?: string | null;
51
56
  sortOrder?: PathOrder;
@@ -230,6 +235,31 @@ export interface DocumentsApiInterface {
230
235
  * Ingest Document Version Handler
231
236
  */
232
237
  ingestDocumentVersion(requestParameters: IngestDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
238
+ /**
239
+ * Creates request options for ingestZip without sending the request
240
+ * @param {Blob} file
241
+ * @param {string} pathPartId Parent path part ID (must be a FOLDER type)
242
+ * @param {IngestionMode} [ingestionMode]
243
+ * @throws {RequiredError}
244
+ * @memberof DocumentsApiInterface
245
+ */
246
+ ingestZipRequestOpts(requestParameters: IngestZipRequest): Promise<runtime.RequestOpts>;
247
+ /**
248
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
249
+ * @summary Ingest Zip Handler
250
+ * @param {Blob} file
251
+ * @param {string} pathPartId Parent path part ID (must be a FOLDER type)
252
+ * @param {IngestionMode} [ingestionMode]
253
+ * @param {*} [options] Override http request option.
254
+ * @throws {RequiredError}
255
+ * @memberof DocumentsApiInterface
256
+ */
257
+ ingestZipRaw(requestParameters: IngestZipRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestZipResponse>>;
258
+ /**
259
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
260
+ * Ingest Zip Handler
261
+ */
262
+ ingestZip(requestParameters: IngestZipRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestZipResponse>;
233
263
  /**
234
264
  * Creates request options for listDocuments without sending the request
235
265
  * @param {string} [parentPathPartId] Parent PathPart ID (defaults to root)
@@ -383,6 +413,20 @@ export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsAp
383
413
  * Ingest Document Version Handler
384
414
  */
385
415
  ingestDocumentVersion(requestParameters: IngestDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
416
+ /**
417
+ * Creates request options for ingestZip without sending the request
418
+ */
419
+ ingestZipRequestOpts(requestParameters: IngestZipRequest): Promise<runtime.RequestOpts>;
420
+ /**
421
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
422
+ * Ingest Zip Handler
423
+ */
424
+ ingestZipRaw(requestParameters: IngestZipRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestZipResponse>>;
425
+ /**
426
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
427
+ * Ingest Zip Handler
428
+ */
429
+ ingestZip(requestParameters: IngestZipRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestZipResponse>;
386
430
  /**
387
431
  * Creates request options for listDocuments without sending the request
388
432
  */
@@ -439,6 +439,81 @@ class DocumentsApi extends runtime.BaseAPI {
439
439
  return yield response.value();
440
440
  });
441
441
  }
442
+ /**
443
+ * Creates request options for ingestZip without sending the request
444
+ */
445
+ ingestZipRequestOpts(requestParameters) {
446
+ return __awaiter(this, void 0, void 0, function* () {
447
+ if (requestParameters['file'] == null) {
448
+ throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling ingestZip().');
449
+ }
450
+ if (requestParameters['pathPartId'] == null) {
451
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling ingestZip().');
452
+ }
453
+ const queryParameters = {};
454
+ const headerParameters = {};
455
+ if (this.configuration && this.configuration.accessToken) {
456
+ const token = this.configuration.accessToken;
457
+ const tokenString = yield token("bearerAuth", []);
458
+ if (tokenString) {
459
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
460
+ }
461
+ }
462
+ const consumes = [
463
+ { contentType: 'multipart/form-data' },
464
+ ];
465
+ // @ts-ignore: canConsumeForm may be unused
466
+ const canConsumeForm = runtime.canConsumeForm(consumes);
467
+ let formParams;
468
+ let useForm = false;
469
+ // use FormData to transmit files using content-type "multipart/form-data"
470
+ useForm = canConsumeForm;
471
+ if (useForm) {
472
+ formParams = new FormData();
473
+ }
474
+ else {
475
+ formParams = new URLSearchParams();
476
+ }
477
+ if (requestParameters['file'] != null) {
478
+ formParams.append('file', requestParameters['file']);
479
+ }
480
+ if (requestParameters['pathPartId'] != null) {
481
+ formParams.append('path_part_id', requestParameters['pathPartId']);
482
+ }
483
+ if (requestParameters['ingestionMode'] != null) {
484
+ formParams.append('ingestion_mode', requestParameters['ingestionMode']);
485
+ }
486
+ let urlPath = `/v1/documents/ingest-zip`;
487
+ return {
488
+ path: urlPath,
489
+ method: 'POST',
490
+ headers: headerParameters,
491
+ query: queryParameters,
492
+ body: formParams,
493
+ };
494
+ });
495
+ }
496
+ /**
497
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
498
+ * Ingest Zip Handler
499
+ */
500
+ ingestZipRaw(requestParameters, initOverrides) {
501
+ return __awaiter(this, void 0, void 0, function* () {
502
+ const requestOptions = yield this.ingestZipRequestOpts(requestParameters);
503
+ const response = yield this.request(requestOptions, initOverrides);
504
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.IngestZipResponseFromJSON)(jsonValue));
505
+ });
506
+ }
507
+ /**
508
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
509
+ * Ingest Zip Handler
510
+ */
511
+ ingestZip(requestParameters, initOverrides) {
512
+ return __awaiter(this, void 0, void 0, function* () {
513
+ const response = yield this.ingestZipRaw(requestParameters, initOverrides);
514
+ return yield response.value();
515
+ });
516
+ }
442
517
  /**
443
518
  * Creates request options for listDocuments without sending the request
444
519
  */
@@ -10,7 +10,7 @@
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, IngestionMode, PaginatedResponseDocumentResponse, PathOrder, SortDirection, UpdateDocumentRequest } from '../models/index';
13
+ import type { ChunkType, CreateDocumentRequest, DocumentDownloadResponse, DocumentResponse, DocumentType, DownloadArtifact, ImageTaxonomy, IngestDocumentResponse, IngestZipResponse, IngestionMode, PaginatedResponseDocumentResponse, PathOrder, SortDirection, UpdateDocumentRequest } from '../models/index';
14
14
  export interface CreateDocumentOperationRequest {
15
15
  createDocumentRequest: CreateDocumentRequest;
16
16
  }
@@ -46,6 +46,11 @@ export interface IngestDocumentVersionRequest {
46
46
  workflowRunId?: string | null;
47
47
  workflowDefinitionId?: string | null;
48
48
  }
49
+ export interface IngestZipRequest {
50
+ file: Blob;
51
+ pathPartId: string;
52
+ ingestionMode?: IngestionMode;
53
+ }
49
54
  export interface ListDocumentsRequest {
50
55
  parentPathPartId?: string | null;
51
56
  sortOrder?: PathOrder;
@@ -230,6 +235,31 @@ export interface DocumentsApiInterface {
230
235
  * Ingest Document Version Handler
231
236
  */
232
237
  ingestDocumentVersion(requestParameters: IngestDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
238
+ /**
239
+ * Creates request options for ingestZip without sending the request
240
+ * @param {Blob} file
241
+ * @param {string} pathPartId Parent path part ID (must be a FOLDER type)
242
+ * @param {IngestionMode} [ingestionMode]
243
+ * @throws {RequiredError}
244
+ * @memberof DocumentsApiInterface
245
+ */
246
+ ingestZipRequestOpts(requestParameters: IngestZipRequest): Promise<runtime.RequestOpts>;
247
+ /**
248
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
249
+ * @summary Ingest Zip Handler
250
+ * @param {Blob} file
251
+ * @param {string} pathPartId Parent path part ID (must be a FOLDER type)
252
+ * @param {IngestionMode} [ingestionMode]
253
+ * @param {*} [options] Override http request option.
254
+ * @throws {RequiredError}
255
+ * @memberof DocumentsApiInterface
256
+ */
257
+ ingestZipRaw(requestParameters: IngestZipRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestZipResponse>>;
258
+ /**
259
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
260
+ * Ingest Zip Handler
261
+ */
262
+ ingestZip(requestParameters: IngestZipRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestZipResponse>;
233
263
  /**
234
264
  * Creates request options for listDocuments without sending the request
235
265
  * @param {string} [parentPathPartId] Parent PathPart ID (defaults to root)
@@ -383,6 +413,20 @@ export declare class DocumentsApi extends runtime.BaseAPI implements DocumentsAp
383
413
  * Ingest Document Version Handler
384
414
  */
385
415
  ingestDocumentVersion(requestParameters: IngestDocumentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestDocumentResponse>;
416
+ /**
417
+ * Creates request options for ingestZip without sending the request
418
+ */
419
+ ingestZipRequestOpts(requestParameters: IngestZipRequest): Promise<runtime.RequestOpts>;
420
+ /**
421
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
422
+ * Ingest Zip Handler
423
+ */
424
+ ingestZipRaw(requestParameters: IngestZipRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<IngestZipResponse>>;
425
+ /**
426
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
427
+ * Ingest Zip Handler
428
+ */
429
+ ingestZip(requestParameters: IngestZipRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<IngestZipResponse>;
386
430
  /**
387
431
  * Creates request options for listDocuments without sending the request
388
432
  */
@@ -21,7 +21,7 @@ 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, PaginatedResponseDocumentResponseFromJSON, UpdateDocumentRequestToJSON, } from '../models/index';
24
+ import { CreateDocumentRequestToJSON, DocumentDownloadResponseFromJSON, DocumentResponseFromJSON, IngestDocumentResponseFromJSON, IngestZipResponseFromJSON, PaginatedResponseDocumentResponseFromJSON, UpdateDocumentRequestToJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
@@ -403,6 +403,81 @@ export class DocumentsApi extends runtime.BaseAPI {
403
403
  return yield response.value();
404
404
  });
405
405
  }
406
+ /**
407
+ * Creates request options for ingestZip without sending the request
408
+ */
409
+ ingestZipRequestOpts(requestParameters) {
410
+ return __awaiter(this, void 0, void 0, function* () {
411
+ if (requestParameters['file'] == null) {
412
+ throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling ingestZip().');
413
+ }
414
+ if (requestParameters['pathPartId'] == null) {
415
+ throw new runtime.RequiredError('pathPartId', 'Required parameter "pathPartId" was null or undefined when calling ingestZip().');
416
+ }
417
+ const queryParameters = {};
418
+ const headerParameters = {};
419
+ if (this.configuration && this.configuration.accessToken) {
420
+ const token = this.configuration.accessToken;
421
+ const tokenString = yield token("bearerAuth", []);
422
+ if (tokenString) {
423
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
424
+ }
425
+ }
426
+ const consumes = [
427
+ { contentType: 'multipart/form-data' },
428
+ ];
429
+ // @ts-ignore: canConsumeForm may be unused
430
+ const canConsumeForm = runtime.canConsumeForm(consumes);
431
+ let formParams;
432
+ let useForm = false;
433
+ // use FormData to transmit files using content-type "multipart/form-data"
434
+ useForm = canConsumeForm;
435
+ if (useForm) {
436
+ formParams = new FormData();
437
+ }
438
+ else {
439
+ formParams = new URLSearchParams();
440
+ }
441
+ if (requestParameters['file'] != null) {
442
+ formParams.append('file', requestParameters['file']);
443
+ }
444
+ if (requestParameters['pathPartId'] != null) {
445
+ formParams.append('path_part_id', requestParameters['pathPartId']);
446
+ }
447
+ if (requestParameters['ingestionMode'] != null) {
448
+ formParams.append('ingestion_mode', requestParameters['ingestionMode']);
449
+ }
450
+ let urlPath = `/v1/documents/ingest-zip`;
451
+ return {
452
+ path: urlPath,
453
+ method: 'POST',
454
+ headers: headerParameters,
455
+ query: queryParameters,
456
+ body: formParams,
457
+ };
458
+ });
459
+ }
460
+ /**
461
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
462
+ * Ingest Zip Handler
463
+ */
464
+ ingestZipRaw(requestParameters, initOverrides) {
465
+ return __awaiter(this, void 0, void 0, function* () {
466
+ const requestOptions = yield this.ingestZipRequestOpts(requestParameters);
467
+ const response = yield this.request(requestOptions, initOverrides);
468
+ return new runtime.JSONApiResponse(response, (jsonValue) => IngestZipResponseFromJSON(jsonValue));
469
+ });
470
+ }
471
+ /**
472
+ * Upload a ZIP archive and ingest each member file individually. Directory structure inside the ZIP is preserved as FOLDER PathParts under the target folder. Returns 202 with per-file outcomes — each file that ingests successfully has its own Temporal workflow ID to poll for status. Whole-archive failures (not a ZIP, zip-bomb, >500 files) return 400 before any DB writes. Per-file failures (unsupported type, oversized) are included in the response with ``error`` set; other files continue processing.
473
+ * Ingest Zip Handler
474
+ */
475
+ ingestZip(requestParameters, initOverrides) {
476
+ return __awaiter(this, void 0, void 0, function* () {
477
+ const response = yield this.ingestZipRaw(requestParameters, initOverrides);
478
+ return yield response.value();
479
+ });
480
+ }
406
481
  /**
407
482
  * Creates request options for listDocuments without sending the request
408
483
  */
@@ -0,0 +1,72 @@
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
+ import type { ZipFileResult } from './ZipFileResult';
13
+ /**
14
+ * Aggregate response from a ZIP ingestion batch.
15
+ * @export
16
+ * @interface IngestZipResponse
17
+ */
18
+ export interface IngestZipResponse {
19
+ /**
20
+ *
21
+ * @type {Array<ZipFileResult>}
22
+ * @memberof IngestZipResponse
23
+ */
24
+ files: Array<ZipFileResult>;
25
+ /**
26
+ *
27
+ * @type {number}
28
+ * @memberof IngestZipResponse
29
+ */
30
+ totalFound: number;
31
+ /**
32
+ *
33
+ * @type {number}
34
+ * @memberof IngestZipResponse
35
+ */
36
+ succeeded: number;
37
+ /**
38
+ *
39
+ * @type {number}
40
+ * @memberof IngestZipResponse
41
+ */
42
+ skipped: number;
43
+ /**
44
+ *
45
+ * @type {number}
46
+ * @memberof IngestZipResponse
47
+ */
48
+ failed: number;
49
+ }
50
+ export declare const IngestZipResponsePropertyValidationAttributesMap: {
51
+ [property: string]: {
52
+ maxLength?: number;
53
+ minLength?: number;
54
+ pattern?: string;
55
+ maximum?: number;
56
+ exclusiveMaximum?: boolean;
57
+ minimum?: number;
58
+ exclusiveMinimum?: boolean;
59
+ multipleOf?: number;
60
+ maxItems?: number;
61
+ minItems?: number;
62
+ uniqueItems?: boolean;
63
+ };
64
+ };
65
+ /**
66
+ * Check if a given object implements the IngestZipResponse interface.
67
+ */
68
+ export declare function instanceOfIngestZipResponse(value: object): value is IngestZipResponse;
69
+ export declare function IngestZipResponseFromJSON(json: any): IngestZipResponse;
70
+ export declare function IngestZipResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): IngestZipResponse;
71
+ export declare function IngestZipResponseToJSON(json: any): IngestZipResponse;
72
+ export declare function IngestZipResponseToJSONTyped(value?: IngestZipResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,61 @@
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
+ import { ZipFileResultFromJSON, ZipFileResultToJSON, } from './ZipFileResult';
15
+ export const IngestZipResponsePropertyValidationAttributesMap = {};
16
+ /**
17
+ * Check if a given object implements the IngestZipResponse interface.
18
+ */
19
+ export function instanceOfIngestZipResponse(value) {
20
+ if (!('files' in value) || value['files'] === undefined)
21
+ return false;
22
+ if (!('totalFound' in value) || value['totalFound'] === undefined)
23
+ return false;
24
+ if (!('succeeded' in value) || value['succeeded'] === undefined)
25
+ return false;
26
+ if (!('skipped' in value) || value['skipped'] === undefined)
27
+ return false;
28
+ if (!('failed' in value) || value['failed'] === undefined)
29
+ return false;
30
+ return true;
31
+ }
32
+ export function IngestZipResponseFromJSON(json) {
33
+ return IngestZipResponseFromJSONTyped(json, false);
34
+ }
35
+ export function IngestZipResponseFromJSONTyped(json, ignoreDiscriminator) {
36
+ if (json == null) {
37
+ return json;
38
+ }
39
+ return {
40
+ 'files': (json['files'].map(ZipFileResultFromJSON)),
41
+ 'totalFound': json['total_found'],
42
+ 'succeeded': json['succeeded'],
43
+ 'skipped': json['skipped'],
44
+ 'failed': json['failed'],
45
+ };
46
+ }
47
+ export function IngestZipResponseToJSON(json) {
48
+ return IngestZipResponseToJSONTyped(json, false);
49
+ }
50
+ export function IngestZipResponseToJSONTyped(value, ignoreDiscriminator = false) {
51
+ if (value == null) {
52
+ return value;
53
+ }
54
+ return {
55
+ 'files': (value['files'].map(ZipFileResultToJSON)),
56
+ 'total_found': value['totalFound'],
57
+ 'succeeded': value['succeeded'],
58
+ 'skipped': value['skipped'],
59
+ 'failed': value['failed'],
60
+ };
61
+ }
@@ -0,0 +1,77 @@
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
+ * Per-file outcome from a ZIP ingestion batch.
14
+ * @export
15
+ * @interface ZipFileResult
16
+ */
17
+ export interface ZipFileResult {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ZipFileResult
22
+ */
23
+ zipPath: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof ZipFileResult
28
+ */
29
+ documentId?: string | null;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof ZipFileResult
34
+ */
35
+ documentVersionId?: string | null;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof ZipFileResult
40
+ */
41
+ workflowId?: string | null;
42
+ /**
43
+ *
44
+ * @type {boolean}
45
+ * @memberof ZipFileResult
46
+ */
47
+ skipped?: boolean;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof ZipFileResult
52
+ */
53
+ error?: string | null;
54
+ }
55
+ export declare const ZipFileResultPropertyValidationAttributesMap: {
56
+ [property: string]: {
57
+ maxLength?: number;
58
+ minLength?: number;
59
+ pattern?: string;
60
+ maximum?: number;
61
+ exclusiveMaximum?: boolean;
62
+ minimum?: number;
63
+ exclusiveMinimum?: boolean;
64
+ multipleOf?: number;
65
+ maxItems?: number;
66
+ minItems?: number;
67
+ uniqueItems?: boolean;
68
+ };
69
+ };
70
+ /**
71
+ * Check if a given object implements the ZipFileResult interface.
72
+ */
73
+ export declare function instanceOfZipFileResult(value: object): value is ZipFileResult;
74
+ export declare function ZipFileResultFromJSON(json: any): ZipFileResult;
75
+ export declare function ZipFileResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipFileResult;
76
+ export declare function ZipFileResultToJSON(json: any): ZipFileResult;
77
+ export declare function ZipFileResultToJSONTyped(value?: ZipFileResult | null, ignoreDiscriminator?: boolean): any;