@knowledge-stack/ksapi 1.149.1 → 1.150.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +5 -2
  3. package/dist/apis/DocumentsApi.d.ts +13 -4
  4. package/dist/apis/DocumentsApi.js +11 -2
  5. package/dist/apis/SystemJobsApi.d.ts +39 -1
  6. package/dist/apis/SystemJobsApi.js +48 -0
  7. package/dist/esm/apis/DocumentsApi.d.ts +13 -4
  8. package/dist/esm/apis/DocumentsApi.js +11 -2
  9. package/dist/esm/apis/SystemJobsApi.d.ts +39 -1
  10. package/dist/esm/apis/SystemJobsApi.js +49 -1
  11. package/dist/esm/models/DocumentVersionMetadata.d.ts +6 -0
  12. package/dist/esm/models/DocumentVersionMetadata.js +2 -0
  13. package/dist/esm/models/IngestZipResponse.d.ts +10 -23
  14. package/dist/esm/models/IngestZipResponse.js +5 -17
  15. package/dist/esm/models/ZipIngestionStatusResponse.d.ts +64 -0
  16. package/dist/esm/models/ZipIngestionStatusResponse.js +53 -0
  17. package/dist/esm/models/ZipMemberStatusResponse.d.ts +77 -0
  18. package/dist/esm/models/ZipMemberStatusResponse.js +54 -0
  19. package/dist/esm/models/index.d.ts +2 -0
  20. package/dist/esm/models/index.js +2 -0
  21. package/dist/models/DocumentVersionMetadata.d.ts +6 -0
  22. package/dist/models/DocumentVersionMetadata.js +2 -0
  23. package/dist/models/IngestZipResponse.d.ts +10 -23
  24. package/dist/models/IngestZipResponse.js +5 -17
  25. package/dist/models/ZipIngestionStatusResponse.d.ts +64 -0
  26. package/dist/models/ZipIngestionStatusResponse.js +61 -0
  27. package/dist/models/ZipMemberStatusResponse.d.ts +77 -0
  28. package/dist/models/ZipMemberStatusResponse.js +62 -0
  29. package/dist/models/index.d.ts +2 -0
  30. package/dist/models/index.js +2 -0
  31. package/docs/DocumentVersionMetadata.md +2 -0
  32. package/docs/DocumentsApi.md +12 -3
  33. package/docs/IngestZipResponse.md +4 -10
  34. package/docs/SystemJobsApi.md +76 -0
  35. package/docs/ZipIngestionStatusResponse.md +39 -0
  36. package/docs/ZipMemberStatusResponse.md +45 -0
  37. package/package.json +1 -1
  38. package/src/apis/DocumentsApi.ts +25 -4
  39. package/src/apis/SystemJobsApi.ts +86 -0
  40. package/src/models/DocumentVersionMetadata.ts +8 -0
  41. package/src/models/IngestZipResponse.ts +15 -37
  42. package/src/models/ZipIngestionStatusResponse.ts +113 -0
  43. package/src/models/ZipMemberStatusResponse.ts +123 -0
  44. package/src/models/index.ts +2 -0
@@ -11,41 +11,28 @@
11
11
  */
12
12
  import type { ZipFileResult } from './ZipFileResult';
13
13
  /**
14
- * Aggregate response from a ZIP ingestion batch.
14
+ * Response from dispatching a ZIP archive to async ingestion.
15
+ *
16
+ * ``workflow_id`` is the fan-out workflow to poll at
17
+ * ``GET /v1/system-jobs/zip-ingestions/{workflow_id}`` for per-member outcomes;
18
+ * it is None when the archive held no ingestible members. ``skipped`` are the
19
+ * artifact/error entries resolved synchronously during classification.
15
20
  * @export
16
21
  * @interface IngestZipResponse
17
22
  */
18
23
  export interface IngestZipResponse {
19
24
  /**
20
25
  *
21
- * @type {Array<ZipFileResult>}
22
- * @memberof IngestZipResponse
23
- */
24
- files: Array<ZipFileResult>;
25
- /**
26
- *
27
- * @type {number}
26
+ * @type {string}
28
27
  * @memberof IngestZipResponse
29
28
  */
30
- totalFound: number;
29
+ workflowId: string | null;
31
30
  /**
32
31
  *
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}
32
+ * @type {Array<ZipFileResult>}
46
33
  * @memberof IngestZipResponse
47
34
  */
48
- failed: number;
35
+ skipped: Array<ZipFileResult>;
49
36
  }
50
37
  export declare const IngestZipResponsePropertyValidationAttributesMap: {
51
38
  [property: string]: {
@@ -17,16 +17,10 @@ export const IngestZipResponsePropertyValidationAttributesMap = {};
17
17
  * Check if a given object implements the IngestZipResponse interface.
18
18
  */
19
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)
20
+ if (!('workflowId' in value) || value['workflowId'] === undefined)
25
21
  return false;
26
22
  if (!('skipped' in value) || value['skipped'] === undefined)
27
23
  return false;
28
- if (!('failed' in value) || value['failed'] === undefined)
29
- return false;
30
24
  return true;
31
25
  }
32
26
  export function IngestZipResponseFromJSON(json) {
@@ -37,11 +31,8 @@ export function IngestZipResponseFromJSONTyped(json, ignoreDiscriminator) {
37
31
  return json;
38
32
  }
39
33
  return {
40
- 'files': (json['files'].map(ZipFileResultFromJSON)),
41
- 'totalFound': json['total_found'],
42
- 'succeeded': json['succeeded'],
43
- 'skipped': json['skipped'],
44
- 'failed': json['failed'],
34
+ 'workflowId': json['workflow_id'],
35
+ 'skipped': (json['skipped'].map(ZipFileResultFromJSON)),
45
36
  };
46
37
  }
47
38
  export function IngestZipResponseToJSON(json) {
@@ -52,10 +43,7 @@ export function IngestZipResponseToJSONTyped(value, ignoreDiscriminator = false)
52
43
  return value;
53
44
  }
54
45
  return {
55
- 'files': (value['files'].map(ZipFileResultToJSON)),
56
- 'total_found': value['totalFound'],
57
- 'succeeded': value['succeeded'],
58
- 'skipped': value['skipped'],
59
- 'failed': value['failed'],
46
+ 'workflow_id': value['workflowId'],
47
+ 'skipped': (value['skipped'].map(ZipFileResultToJSON)),
60
48
  };
61
49
  }
@@ -0,0 +1,64 @@
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 { ZipMemberStatusResponse } from './ZipMemberStatusResponse';
13
+ /**
14
+ * Status of a ZIP fan-out: live Temporal state + per-member outcomes.
15
+ *
16
+ * ``files`` reflects progress so far — members that have been dispatched
17
+ * (``workflow_id`` set), failed to dispatch (``error`` set), or were skipped as
18
+ * artifacts. Poll until ``temporal_status`` is terminal (e.g. ``COMPLETED``).
19
+ * @export
20
+ * @interface ZipIngestionStatusResponse
21
+ */
22
+ export interface ZipIngestionStatusResponse {
23
+ /**
24
+ *
25
+ * @type {string}
26
+ * @memberof ZipIngestionStatusResponse
27
+ */
28
+ workflowId: string;
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof ZipIngestionStatusResponse
33
+ */
34
+ temporalStatus: string;
35
+ /**
36
+ *
37
+ * @type {Array<ZipMemberStatusResponse>}
38
+ * @memberof ZipIngestionStatusResponse
39
+ */
40
+ files: Array<ZipMemberStatusResponse>;
41
+ }
42
+ export declare const ZipIngestionStatusResponsePropertyValidationAttributesMap: {
43
+ [property: string]: {
44
+ maxLength?: number;
45
+ minLength?: number;
46
+ pattern?: string;
47
+ maximum?: number;
48
+ exclusiveMaximum?: boolean;
49
+ minimum?: number;
50
+ exclusiveMinimum?: boolean;
51
+ multipleOf?: number;
52
+ maxItems?: number;
53
+ minItems?: number;
54
+ uniqueItems?: boolean;
55
+ };
56
+ };
57
+ /**
58
+ * Check if a given object implements the ZipIngestionStatusResponse interface.
59
+ */
60
+ export declare function instanceOfZipIngestionStatusResponse(value: object): value is ZipIngestionStatusResponse;
61
+ export declare function ZipIngestionStatusResponseFromJSON(json: any): ZipIngestionStatusResponse;
62
+ export declare function ZipIngestionStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipIngestionStatusResponse;
63
+ export declare function ZipIngestionStatusResponseToJSON(json: any): ZipIngestionStatusResponse;
64
+ export declare function ZipIngestionStatusResponseToJSONTyped(value?: ZipIngestionStatusResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,53 @@
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 { ZipMemberStatusResponseFromJSON, ZipMemberStatusResponseToJSON, } from './ZipMemberStatusResponse';
15
+ export const ZipIngestionStatusResponsePropertyValidationAttributesMap = {};
16
+ /**
17
+ * Check if a given object implements the ZipIngestionStatusResponse interface.
18
+ */
19
+ export function instanceOfZipIngestionStatusResponse(value) {
20
+ if (!('workflowId' in value) || value['workflowId'] === undefined)
21
+ return false;
22
+ if (!('temporalStatus' in value) || value['temporalStatus'] === undefined)
23
+ return false;
24
+ if (!('files' in value) || value['files'] === undefined)
25
+ return false;
26
+ return true;
27
+ }
28
+ export function ZipIngestionStatusResponseFromJSON(json) {
29
+ return ZipIngestionStatusResponseFromJSONTyped(json, false);
30
+ }
31
+ export function ZipIngestionStatusResponseFromJSONTyped(json, ignoreDiscriminator) {
32
+ if (json == null) {
33
+ return json;
34
+ }
35
+ return {
36
+ 'workflowId': json['workflow_id'],
37
+ 'temporalStatus': json['temporal_status'],
38
+ 'files': (json['files'].map(ZipMemberStatusResponseFromJSON)),
39
+ };
40
+ }
41
+ export function ZipIngestionStatusResponseToJSON(json) {
42
+ return ZipIngestionStatusResponseToJSONTyped(json, false);
43
+ }
44
+ export function ZipIngestionStatusResponseToJSONTyped(value, ignoreDiscriminator = false) {
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'workflow_id': value['workflowId'],
50
+ 'temporal_status': value['temporalStatus'],
51
+ 'files': (value['files'].map(ZipMemberStatusResponseToJSON)),
52
+ };
53
+ }
@@ -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
+ * One member's outcome within a ZIP fan-out (from the workflow query).
14
+ * @export
15
+ * @interface ZipMemberStatusResponse
16
+ */
17
+ export interface ZipMemberStatusResponse {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof ZipMemberStatusResponse
22
+ */
23
+ zipPath: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof ZipMemberStatusResponse
28
+ */
29
+ documentId?: string | null;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof ZipMemberStatusResponse
34
+ */
35
+ documentVersionId?: string | null;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof ZipMemberStatusResponse
40
+ */
41
+ workflowId?: string | null;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof ZipMemberStatusResponse
46
+ */
47
+ error?: string | null;
48
+ /**
49
+ *
50
+ * @type {boolean}
51
+ * @memberof ZipMemberStatusResponse
52
+ */
53
+ skipped?: boolean;
54
+ }
55
+ export declare const ZipMemberStatusResponsePropertyValidationAttributesMap: {
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 ZipMemberStatusResponse interface.
72
+ */
73
+ export declare function instanceOfZipMemberStatusResponse(value: object): value is ZipMemberStatusResponse;
74
+ export declare function ZipMemberStatusResponseFromJSON(json: any): ZipMemberStatusResponse;
75
+ export declare function ZipMemberStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipMemberStatusResponse;
76
+ export declare function ZipMemberStatusResponseToJSON(json: any): ZipMemberStatusResponse;
77
+ export declare function ZipMemberStatusResponseToJSONTyped(value?: ZipMemberStatusResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,54 @@
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 ZipMemberStatusResponsePropertyValidationAttributesMap = {};
15
+ /**
16
+ * Check if a given object implements the ZipMemberStatusResponse interface.
17
+ */
18
+ export function instanceOfZipMemberStatusResponse(value) {
19
+ if (!('zipPath' in value) || value['zipPath'] === undefined)
20
+ return false;
21
+ return true;
22
+ }
23
+ export function ZipMemberStatusResponseFromJSON(json) {
24
+ return ZipMemberStatusResponseFromJSONTyped(json, false);
25
+ }
26
+ export function ZipMemberStatusResponseFromJSONTyped(json, ignoreDiscriminator) {
27
+ if (json == null) {
28
+ return json;
29
+ }
30
+ return {
31
+ 'zipPath': json['zip_path'],
32
+ 'documentId': json['document_id'] == null ? undefined : json['document_id'],
33
+ 'documentVersionId': json['document_version_id'] == null ? undefined : json['document_version_id'],
34
+ 'workflowId': json['workflow_id'] == null ? undefined : json['workflow_id'],
35
+ 'error': json['error'] == null ? undefined : json['error'],
36
+ 'skipped': json['skipped'] == null ? undefined : json['skipped'],
37
+ };
38
+ }
39
+ export function ZipMemberStatusResponseToJSON(json) {
40
+ return ZipMemberStatusResponseToJSONTyped(json, false);
41
+ }
42
+ export function ZipMemberStatusResponseToJSONTyped(value, ignoreDiscriminator = false) {
43
+ if (value == null) {
44
+ return value;
45
+ }
46
+ return {
47
+ 'zip_path': value['zipPath'],
48
+ 'document_id': value['documentId'],
49
+ 'document_version_id': value['documentVersionId'],
50
+ 'workflow_id': value['workflowId'],
51
+ 'error': value['error'],
52
+ 'skipped': value['skipped'],
53
+ };
54
+ }
@@ -361,3 +361,5 @@ export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
361
361
  export * from './XlsxCellAnchorOutput';
362
362
  export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
363
363
  export * from './ZipFileResult';
364
+ export * from './ZipIngestionStatusResponse';
365
+ export * from './ZipMemberStatusResponse';
@@ -363,3 +363,5 @@ export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
363
363
  export * from './XlsxCellAnchorOutput';
364
364
  export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
365
365
  export * from './ZipFileResult';
366
+ export * from './ZipIngestionStatusResponse';
367
+ export * from './ZipMemberStatusResponse';
@@ -151,6 +151,12 @@ export interface DocumentVersionMetadata {
151
151
  * @memberof DocumentVersionMetadata
152
152
  */
153
153
  fileMd5?: string;
154
+ /**
155
+ * Opt-in create key. A repeat ingest with the same key at the same (parent, name) replays this document instead of colliding — makes a ZIP fan-out member retry idempotent.
156
+ * @type {string}
157
+ * @memberof DocumentVersionMetadata
158
+ */
159
+ idempotencyKey?: string | null;
154
160
  }
155
161
  export declare const DocumentVersionMetadataPropertyValidationAttributesMap: {
156
162
  [property: string]: {
@@ -57,6 +57,7 @@ function DocumentVersionMetadataFromJSONTyped(json, ignoreDiscriminator) {
57
57
  'quotaPageCount': json['quota_page_count'] == null ? undefined : json['quota_page_count'],
58
58
  'quotaIdempotencyKey': json['quota_idempotency_key'] == null ? undefined : json['quota_idempotency_key'],
59
59
  'fileMd5': json['file_md5'] == null ? undefined : json['file_md5'],
60
+ 'idempotencyKey': json['idempotency_key'] == null ? undefined : json['idempotency_key'],
60
61
  };
61
62
  }
62
63
  function DocumentVersionMetadataToJSON(json) {
@@ -87,5 +88,6 @@ function DocumentVersionMetadataToJSONTyped(value, ignoreDiscriminator = false)
87
88
  'quota_page_count': value['quotaPageCount'],
88
89
  'quota_idempotency_key': value['quotaIdempotencyKey'],
89
90
  'file_md5': value['fileMd5'],
91
+ 'idempotency_key': value['idempotencyKey'],
90
92
  };
91
93
  }
@@ -11,41 +11,28 @@
11
11
  */
12
12
  import type { ZipFileResult } from './ZipFileResult';
13
13
  /**
14
- * Aggregate response from a ZIP ingestion batch.
14
+ * Response from dispatching a ZIP archive to async ingestion.
15
+ *
16
+ * ``workflow_id`` is the fan-out workflow to poll at
17
+ * ``GET /v1/system-jobs/zip-ingestions/{workflow_id}`` for per-member outcomes;
18
+ * it is None when the archive held no ingestible members. ``skipped`` are the
19
+ * artifact/error entries resolved synchronously during classification.
15
20
  * @export
16
21
  * @interface IngestZipResponse
17
22
  */
18
23
  export interface IngestZipResponse {
19
24
  /**
20
25
  *
21
- * @type {Array<ZipFileResult>}
22
- * @memberof IngestZipResponse
23
- */
24
- files: Array<ZipFileResult>;
25
- /**
26
- *
27
- * @type {number}
26
+ * @type {string}
28
27
  * @memberof IngestZipResponse
29
28
  */
30
- totalFound: number;
29
+ workflowId: string | null;
31
30
  /**
32
31
  *
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}
32
+ * @type {Array<ZipFileResult>}
46
33
  * @memberof IngestZipResponse
47
34
  */
48
- failed: number;
35
+ skipped: Array<ZipFileResult>;
49
36
  }
50
37
  export declare const IngestZipResponsePropertyValidationAttributesMap: {
51
38
  [property: string]: {
@@ -25,16 +25,10 @@ exports.IngestZipResponsePropertyValidationAttributesMap = {};
25
25
  * Check if a given object implements the IngestZipResponse interface.
26
26
  */
27
27
  function instanceOfIngestZipResponse(value) {
28
- if (!('files' in value) || value['files'] === undefined)
29
- return false;
30
- if (!('totalFound' in value) || value['totalFound'] === undefined)
31
- return false;
32
- if (!('succeeded' in value) || value['succeeded'] === undefined)
28
+ if (!('workflowId' in value) || value['workflowId'] === undefined)
33
29
  return false;
34
30
  if (!('skipped' in value) || value['skipped'] === undefined)
35
31
  return false;
36
- if (!('failed' in value) || value['failed'] === undefined)
37
- return false;
38
32
  return true;
39
33
  }
40
34
  function IngestZipResponseFromJSON(json) {
@@ -45,11 +39,8 @@ function IngestZipResponseFromJSONTyped(json, ignoreDiscriminator) {
45
39
  return json;
46
40
  }
47
41
  return {
48
- 'files': (json['files'].map(ZipFileResult_1.ZipFileResultFromJSON)),
49
- 'totalFound': json['total_found'],
50
- 'succeeded': json['succeeded'],
51
- 'skipped': json['skipped'],
52
- 'failed': json['failed'],
42
+ 'workflowId': json['workflow_id'],
43
+ 'skipped': (json['skipped'].map(ZipFileResult_1.ZipFileResultFromJSON)),
53
44
  };
54
45
  }
55
46
  function IngestZipResponseToJSON(json) {
@@ -60,10 +51,7 @@ function IngestZipResponseToJSONTyped(value, ignoreDiscriminator = false) {
60
51
  return value;
61
52
  }
62
53
  return {
63
- 'files': (value['files'].map(ZipFileResult_1.ZipFileResultToJSON)),
64
- 'total_found': value['totalFound'],
65
- 'succeeded': value['succeeded'],
66
- 'skipped': value['skipped'],
67
- 'failed': value['failed'],
54
+ 'workflow_id': value['workflowId'],
55
+ 'skipped': (value['skipped'].map(ZipFileResult_1.ZipFileResultToJSON)),
68
56
  };
69
57
  }
@@ -0,0 +1,64 @@
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 { ZipMemberStatusResponse } from './ZipMemberStatusResponse';
13
+ /**
14
+ * Status of a ZIP fan-out: live Temporal state + per-member outcomes.
15
+ *
16
+ * ``files`` reflects progress so far — members that have been dispatched
17
+ * (``workflow_id`` set), failed to dispatch (``error`` set), or were skipped as
18
+ * artifacts. Poll until ``temporal_status`` is terminal (e.g. ``COMPLETED``).
19
+ * @export
20
+ * @interface ZipIngestionStatusResponse
21
+ */
22
+ export interface ZipIngestionStatusResponse {
23
+ /**
24
+ *
25
+ * @type {string}
26
+ * @memberof ZipIngestionStatusResponse
27
+ */
28
+ workflowId: string;
29
+ /**
30
+ *
31
+ * @type {string}
32
+ * @memberof ZipIngestionStatusResponse
33
+ */
34
+ temporalStatus: string;
35
+ /**
36
+ *
37
+ * @type {Array<ZipMemberStatusResponse>}
38
+ * @memberof ZipIngestionStatusResponse
39
+ */
40
+ files: Array<ZipMemberStatusResponse>;
41
+ }
42
+ export declare const ZipIngestionStatusResponsePropertyValidationAttributesMap: {
43
+ [property: string]: {
44
+ maxLength?: number;
45
+ minLength?: number;
46
+ pattern?: string;
47
+ maximum?: number;
48
+ exclusiveMaximum?: boolean;
49
+ minimum?: number;
50
+ exclusiveMinimum?: boolean;
51
+ multipleOf?: number;
52
+ maxItems?: number;
53
+ minItems?: number;
54
+ uniqueItems?: boolean;
55
+ };
56
+ };
57
+ /**
58
+ * Check if a given object implements the ZipIngestionStatusResponse interface.
59
+ */
60
+ export declare function instanceOfZipIngestionStatusResponse(value: object): value is ZipIngestionStatusResponse;
61
+ export declare function ZipIngestionStatusResponseFromJSON(json: any): ZipIngestionStatusResponse;
62
+ export declare function ZipIngestionStatusResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ZipIngestionStatusResponse;
63
+ export declare function ZipIngestionStatusResponseToJSON(json: any): ZipIngestionStatusResponse;
64
+ export declare function ZipIngestionStatusResponseToJSONTyped(value?: ZipIngestionStatusResponse | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Knowledge Stack API
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 0.1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ZipIngestionStatusResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfZipIngestionStatusResponse = instanceOfZipIngestionStatusResponse;
18
+ exports.ZipIngestionStatusResponseFromJSON = ZipIngestionStatusResponseFromJSON;
19
+ exports.ZipIngestionStatusResponseFromJSONTyped = ZipIngestionStatusResponseFromJSONTyped;
20
+ exports.ZipIngestionStatusResponseToJSON = ZipIngestionStatusResponseToJSON;
21
+ exports.ZipIngestionStatusResponseToJSONTyped = ZipIngestionStatusResponseToJSONTyped;
22
+ const ZipMemberStatusResponse_1 = require("./ZipMemberStatusResponse");
23
+ exports.ZipIngestionStatusResponsePropertyValidationAttributesMap = {};
24
+ /**
25
+ * Check if a given object implements the ZipIngestionStatusResponse interface.
26
+ */
27
+ function instanceOfZipIngestionStatusResponse(value) {
28
+ if (!('workflowId' in value) || value['workflowId'] === undefined)
29
+ return false;
30
+ if (!('temporalStatus' in value) || value['temporalStatus'] === undefined)
31
+ return false;
32
+ if (!('files' in value) || value['files'] === undefined)
33
+ return false;
34
+ return true;
35
+ }
36
+ function ZipIngestionStatusResponseFromJSON(json) {
37
+ return ZipIngestionStatusResponseFromJSONTyped(json, false);
38
+ }
39
+ function ZipIngestionStatusResponseFromJSONTyped(json, ignoreDiscriminator) {
40
+ if (json == null) {
41
+ return json;
42
+ }
43
+ return {
44
+ 'workflowId': json['workflow_id'],
45
+ 'temporalStatus': json['temporal_status'],
46
+ 'files': (json['files'].map(ZipMemberStatusResponse_1.ZipMemberStatusResponseFromJSON)),
47
+ };
48
+ }
49
+ function ZipIngestionStatusResponseToJSON(json) {
50
+ return ZipIngestionStatusResponseToJSONTyped(json, false);
51
+ }
52
+ function ZipIngestionStatusResponseToJSONTyped(value, ignoreDiscriminator = false) {
53
+ if (value == null) {
54
+ return value;
55
+ }
56
+ return {
57
+ 'workflow_id': value['workflowId'],
58
+ 'temporal_status': value['temporalStatus'],
59
+ 'files': (value['files'].map(ZipMemberStatusResponse_1.ZipMemberStatusResponseToJSON)),
60
+ };
61
+ }