@knowledge-stack/ksapi 1.145.1 → 1.147.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 (39) hide show
  1. package/.openapi-generator/FILES +4 -0
  2. package/README.md +5 -2
  3. package/dist/apis/DocumentsApi.d.ts +45 -1
  4. package/dist/apis/DocumentsApi.js +75 -0
  5. package/dist/esm/apis/DocumentsApi.d.ts +45 -1
  6. package/dist/esm/apis/DocumentsApi.js +76 -1
  7. package/dist/esm/models/ChunkContentItem.d.ts +6 -0
  8. package/dist/esm/models/ChunkContentItem.js +2 -0
  9. package/dist/esm/models/IngestZipResponse.d.ts +72 -0
  10. package/dist/esm/models/IngestZipResponse.js +61 -0
  11. package/dist/esm/models/SectionContentItem.d.ts +12 -0
  12. package/dist/esm/models/SectionContentItem.js +4 -0
  13. package/dist/esm/models/ZipFileResult.d.ts +77 -0
  14. package/dist/esm/models/ZipFileResult.js +54 -0
  15. package/dist/esm/models/index.d.ts +2 -0
  16. package/dist/esm/models/index.js +2 -0
  17. package/dist/models/ChunkContentItem.d.ts +6 -0
  18. package/dist/models/ChunkContentItem.js +2 -0
  19. package/dist/models/IngestZipResponse.d.ts +72 -0
  20. package/dist/models/IngestZipResponse.js +69 -0
  21. package/dist/models/SectionContentItem.d.ts +12 -0
  22. package/dist/models/SectionContentItem.js +4 -0
  23. package/dist/models/ZipFileResult.d.ts +77 -0
  24. package/dist/models/ZipFileResult.js +62 -0
  25. package/dist/models/index.d.ts +2 -0
  26. package/dist/models/index.js +2 -0
  27. package/docs/ChunkContentItem.md +2 -0
  28. package/docs/DocumentsApi.md +82 -0
  29. package/docs/IngestZipResponse.md +43 -0
  30. package/docs/SectionContentItem.md +4 -0
  31. package/docs/SectionContentItemOrChunkContentItem.md +4 -0
  32. package/docs/ZipFileResult.md +45 -0
  33. package/package.json +1 -1
  34. package/src/apis/DocumentsApi.ts +127 -0
  35. package/src/models/ChunkContentItem.ts +8 -0
  36. package/src/models/IngestZipResponse.ts +127 -0
  37. package/src/models/SectionContentItem.ts +16 -0
  38. package/src/models/ZipFileResult.ts +123 -0
  39. package/src/models/index.ts +2 -0
@@ -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;
@@ -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 ZipFileResultPropertyValidationAttributesMap = {};
15
+ /**
16
+ * Check if a given object implements the ZipFileResult interface.
17
+ */
18
+ export function instanceOfZipFileResult(value) {
19
+ if (!('zipPath' in value) || value['zipPath'] === undefined)
20
+ return false;
21
+ return true;
22
+ }
23
+ export function ZipFileResultFromJSON(json) {
24
+ return ZipFileResultFromJSONTyped(json, false);
25
+ }
26
+ export function ZipFileResultFromJSONTyped(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
+ 'skipped': json['skipped'] == null ? undefined : json['skipped'],
36
+ 'error': json['error'] == null ? undefined : json['error'],
37
+ };
38
+ }
39
+ export function ZipFileResultToJSON(json) {
40
+ return ZipFileResultToJSONTyped(json, false);
41
+ }
42
+ export function ZipFileResultToJSONTyped(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
+ 'skipped': value['skipped'],
52
+ 'error': value['error'],
53
+ };
54
+ }
@@ -139,6 +139,7 @@ export * from './IdpType';
139
139
  export * from './ImageTaxonomy';
140
140
  export * from './InformationStatistics';
141
141
  export * from './IngestDocumentResponse';
142
+ export * from './IngestZipResponse';
142
143
  export * from './IngestionMode';
143
144
  export * from './Input';
144
145
  export * from './InputOrigin';
@@ -357,3 +358,4 @@ export * from './XlsxCellAnchorInput';
357
358
  export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
358
359
  export * from './XlsxCellAnchorOutput';
359
360
  export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
361
+ export * from './ZipFileResult';
@@ -141,6 +141,7 @@ export * from './IdpType';
141
141
  export * from './ImageTaxonomy';
142
142
  export * from './InformationStatistics';
143
143
  export * from './IngestDocumentResponse';
144
+ export * from './IngestZipResponse';
144
145
  export * from './IngestionMode';
145
146
  export * from './Input';
146
147
  export * from './InputOrigin';
@@ -359,3 +360,4 @@ export * from './XlsxCellAnchorInput';
359
360
  export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
360
361
  export * from './XlsxCellAnchorOutput';
361
362
  export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
363
+ export * from './ZipFileResult';
@@ -54,6 +54,12 @@ export interface ChunkContentItem {
54
54
  * @memberof ChunkContentItem
55
55
  */
56
56
  depth: number;
57
+ /**
58
+ * 0-based ordinal of this chunk, counting CHUNK rows in DFS order from the traversal root. Usable directly as a read start/end coordinate. Null on endpoints that do not compute traversal ordinals.
59
+ * @type {number}
60
+ * @memberof ChunkContentItem
61
+ */
62
+ chunkStartIndex?: number | null;
57
63
  /**
58
64
  * Chunk content
59
65
  * @type {string}
@@ -71,6 +71,7 @@ function ChunkContentItemFromJSONTyped(json, ignoreDiscriminator) {
71
71
  'parentPathId': json['parent_path_id'],
72
72
  'metadataObjId': json['metadata_obj_id'],
73
73
  'depth': json['depth'],
74
+ 'chunkStartIndex': json['chunk_start_index'] == null ? undefined : json['chunk_start_index'],
74
75
  'content': json['content'] == null ? undefined : json['content'],
75
76
  'chunkType': json['chunk_type'] == null ? undefined : (0, ChunkType_1.ChunkTypeFromJSON)(json['chunk_type']),
76
77
  'chunkMetadata': json['chunk_metadata'] == null ? undefined : (0, ChunkMetadata_1.ChunkMetadataFromJSON)(json['chunk_metadata']),
@@ -95,6 +96,7 @@ function ChunkContentItemToJSONTyped(value, ignoreDiscriminator = false) {
95
96
  'parent_path_id': value['parentPathId'],
96
97
  'metadata_obj_id': value['metadataObjId'],
97
98
  'depth': value['depth'],
99
+ 'chunk_start_index': value['chunkStartIndex'],
98
100
  'content': value['content'],
99
101
  'chunk_type': (0, ChunkType_1.ChunkTypeToJSON)(value['chunkType']),
100
102
  'chunk_metadata': (0, ChunkMetadata_1.ChunkMetadataToJSON)(value['chunkMetadata']),
@@ -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,69 @@
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.IngestZipResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfIngestZipResponse = instanceOfIngestZipResponse;
18
+ exports.IngestZipResponseFromJSON = IngestZipResponseFromJSON;
19
+ exports.IngestZipResponseFromJSONTyped = IngestZipResponseFromJSONTyped;
20
+ exports.IngestZipResponseToJSON = IngestZipResponseToJSON;
21
+ exports.IngestZipResponseToJSONTyped = IngestZipResponseToJSONTyped;
22
+ const ZipFileResult_1 = require("./ZipFileResult");
23
+ exports.IngestZipResponsePropertyValidationAttributesMap = {};
24
+ /**
25
+ * Check if a given object implements the IngestZipResponse interface.
26
+ */
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)
33
+ return false;
34
+ if (!('skipped' in value) || value['skipped'] === undefined)
35
+ return false;
36
+ if (!('failed' in value) || value['failed'] === undefined)
37
+ return false;
38
+ return true;
39
+ }
40
+ function IngestZipResponseFromJSON(json) {
41
+ return IngestZipResponseFromJSONTyped(json, false);
42
+ }
43
+ function IngestZipResponseFromJSONTyped(json, ignoreDiscriminator) {
44
+ if (json == null) {
45
+ return json;
46
+ }
47
+ 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'],
53
+ };
54
+ }
55
+ function IngestZipResponseToJSON(json) {
56
+ return IngestZipResponseToJSONTyped(json, false);
57
+ }
58
+ function IngestZipResponseToJSONTyped(value, ignoreDiscriminator = false) {
59
+ if (value == null) {
60
+ return value;
61
+ }
62
+ 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'],
68
+ };
69
+ }
@@ -52,6 +52,18 @@ export interface SectionContentItem {
52
52
  * @memberof SectionContentItem
53
53
  */
54
54
  depth: number;
55
+ /**
56
+ * 0-based ordinal of the first chunk in this section's subtree, counting CHUNK rows in DFS order from the traversal root. Null when the section has no chunk anywhere below it, and on endpoints that do not compute traversal ordinals.
57
+ * @type {number}
58
+ * @memberof SectionContentItem
59
+ */
60
+ chunkStartIndex?: number | null;
61
+ /**
62
+ * 0-based ordinal of the last chunk in this section's subtree, inclusive. Chunks outside the section — a later sibling, or a chunk attached to an ancestor — are excluded, so the span covers only this section's own content. Null under the same conditions as chunk_start_index.
63
+ * @type {number}
64
+ * @memberof SectionContentItem
65
+ */
66
+ chunkEndIndex?: number | null;
55
67
  /**
56
68
  * Section page number
57
69
  * @type {number}
@@ -69,6 +69,8 @@ function SectionContentItemFromJSONTyped(json, ignoreDiscriminator) {
69
69
  'parentPathId': json['parent_path_id'],
70
70
  'metadataObjId': json['metadata_obj_id'],
71
71
  'depth': json['depth'],
72
+ 'chunkStartIndex': json['chunk_start_index'] == null ? undefined : json['chunk_start_index'],
73
+ 'chunkEndIndex': json['chunk_end_index'] == null ? undefined : json['chunk_end_index'],
72
74
  'pageNumber': json['page_number'] == null ? undefined : json['page_number'],
73
75
  'materializedPath': json['materialized_path'],
74
76
  'systemManaged': json['system_managed'],
@@ -91,6 +93,8 @@ function SectionContentItemToJSONTyped(value, ignoreDiscriminator = false) {
91
93
  'parent_path_id': value['parentPathId'],
92
94
  'metadata_obj_id': value['metadataObjId'],
93
95
  'depth': value['depth'],
96
+ 'chunk_start_index': value['chunkStartIndex'],
97
+ 'chunk_end_index': value['chunkEndIndex'],
94
98
  'page_number': value['pageNumber'],
95
99
  'materialized_path': value['materializedPath'],
96
100
  'system_managed': value['systemManaged'],
@@ -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;
@@ -0,0 +1,62 @@
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.ZipFileResultPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfZipFileResult = instanceOfZipFileResult;
18
+ exports.ZipFileResultFromJSON = ZipFileResultFromJSON;
19
+ exports.ZipFileResultFromJSONTyped = ZipFileResultFromJSONTyped;
20
+ exports.ZipFileResultToJSON = ZipFileResultToJSON;
21
+ exports.ZipFileResultToJSONTyped = ZipFileResultToJSONTyped;
22
+ exports.ZipFileResultPropertyValidationAttributesMap = {};
23
+ /**
24
+ * Check if a given object implements the ZipFileResult interface.
25
+ */
26
+ function instanceOfZipFileResult(value) {
27
+ if (!('zipPath' in value) || value['zipPath'] === undefined)
28
+ return false;
29
+ return true;
30
+ }
31
+ function ZipFileResultFromJSON(json) {
32
+ return ZipFileResultFromJSONTyped(json, false);
33
+ }
34
+ function ZipFileResultFromJSONTyped(json, ignoreDiscriminator) {
35
+ if (json == null) {
36
+ return json;
37
+ }
38
+ return {
39
+ 'zipPath': json['zip_path'],
40
+ 'documentId': json['document_id'] == null ? undefined : json['document_id'],
41
+ 'documentVersionId': json['document_version_id'] == null ? undefined : json['document_version_id'],
42
+ 'workflowId': json['workflow_id'] == null ? undefined : json['workflow_id'],
43
+ 'skipped': json['skipped'] == null ? undefined : json['skipped'],
44
+ 'error': json['error'] == null ? undefined : json['error'],
45
+ };
46
+ }
47
+ function ZipFileResultToJSON(json) {
48
+ return ZipFileResultToJSONTyped(json, false);
49
+ }
50
+ function ZipFileResultToJSONTyped(value, ignoreDiscriminator = false) {
51
+ if (value == null) {
52
+ return value;
53
+ }
54
+ return {
55
+ 'zip_path': value['zipPath'],
56
+ 'document_id': value['documentId'],
57
+ 'document_version_id': value['documentVersionId'],
58
+ 'workflow_id': value['workflowId'],
59
+ 'skipped': value['skipped'],
60
+ 'error': value['error'],
61
+ };
62
+ }
@@ -139,6 +139,7 @@ export * from './IdpType';
139
139
  export * from './ImageTaxonomy';
140
140
  export * from './InformationStatistics';
141
141
  export * from './IngestDocumentResponse';
142
+ export * from './IngestZipResponse';
142
143
  export * from './IngestionMode';
143
144
  export * from './Input';
144
145
  export * from './InputOrigin';
@@ -357,3 +358,4 @@ export * from './XlsxCellAnchorInput';
357
358
  export * from './XlsxCellAnchorInputOrDocxParagraphAnchorInput';
358
359
  export * from './XlsxCellAnchorOutput';
359
360
  export * from './XlsxCellAnchorOutputOrDocxParagraphAnchorOutput';
361
+ export * from './ZipFileResult';
@@ -157,6 +157,7 @@ __exportStar(require("./IdpType"), exports);
157
157
  __exportStar(require("./ImageTaxonomy"), exports);
158
158
  __exportStar(require("./InformationStatistics"), exports);
159
159
  __exportStar(require("./IngestDocumentResponse"), exports);
160
+ __exportStar(require("./IngestZipResponse"), exports);
160
161
  __exportStar(require("./IngestionMode"), exports);
161
162
  __exportStar(require("./Input"), exports);
162
163
  __exportStar(require("./InputOrigin"), exports);
@@ -375,3 +376,4 @@ __exportStar(require("./XlsxCellAnchorInput"), exports);
375
376
  __exportStar(require("./XlsxCellAnchorInputOrDocxParagraphAnchorInput"), exports);
376
377
  __exportStar(require("./XlsxCellAnchorOutput"), exports);
377
378
  __exportStar(require("./XlsxCellAnchorOutputOrDocxParagraphAnchorOutput"), exports);
379
+ __exportStar(require("./ZipFileResult"), exports);
@@ -13,6 +13,7 @@ Name | Type
13
13
  `parentPathId` | string
14
14
  `metadataObjId` | string
15
15
  `depth` | number
16
+ `chunkStartIndex` | number
16
17
  `content` | string
17
18
  `chunkType` | [ChunkType](ChunkType.md)
18
19
  `chunkMetadata` | [ChunkMetadata](ChunkMetadata.md)
@@ -35,6 +36,7 @@ const example = {
35
36
  "parentPathId": null,
36
37
  "metadataObjId": null,
37
38
  "depth": null,
39
+ "chunkStartIndex": null,
38
40
  "content": null,
39
41
  "chunkType": null,
40
42
  "chunkMetadata": null,