@knowledge-stack/ksapi 1.154.1 → 1.156.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 (132) hide show
  1. package/.openapi-generator/FILES +28 -0
  2. package/README.md +20 -2
  3. package/dist/apis/BulkDeleteApi.d.ts +64 -0
  4. package/dist/apis/BulkDeleteApi.js +115 -0
  5. package/dist/apis/BulkMoveApi.d.ts +64 -0
  6. package/dist/apis/BulkMoveApi.js +115 -0
  7. package/dist/apis/TrashApi.d.ts +77 -1
  8. package/dist/apis/TrashApi.js +98 -0
  9. package/dist/apis/UserPermissionsApi.d.ts +77 -1
  10. package/dist/apis/UserPermissionsApi.js +98 -0
  11. package/dist/apis/index.d.ts +2 -0
  12. package/dist/apis/index.js +2 -0
  13. package/dist/esm/apis/BulkDeleteApi.d.ts +64 -0
  14. package/dist/esm/apis/BulkDeleteApi.js +78 -0
  15. package/dist/esm/apis/BulkMoveApi.d.ts +64 -0
  16. package/dist/esm/apis/BulkMoveApi.js +78 -0
  17. package/dist/esm/apis/TrashApi.d.ts +77 -1
  18. package/dist/esm/apis/TrashApi.js +99 -1
  19. package/dist/esm/apis/UserPermissionsApi.d.ts +77 -1
  20. package/dist/esm/apis/UserPermissionsApi.js +99 -1
  21. package/dist/esm/apis/index.d.ts +2 -0
  22. package/dist/esm/apis/index.js +2 -0
  23. package/dist/esm/models/BulkDeleteRequest.d.ts +53 -0
  24. package/dist/esm/models/BulkDeleteRequest.js +44 -0
  25. package/dist/esm/models/BulkFailureReason.d.ts +37 -0
  26. package/dist/esm/models/BulkFailureReason.js +55 -0
  27. package/dist/esm/models/BulkGrantItem.d.ts +66 -0
  28. package/dist/esm/models/BulkGrantItem.js +55 -0
  29. package/dist/esm/models/BulkGrantItemFailure.d.ts +60 -0
  30. package/dist/esm/models/BulkGrantItemFailure.js +53 -0
  31. package/dist/esm/models/BulkGrantRequest.d.ts +54 -0
  32. package/dist/esm/models/BulkGrantRequest.js +47 -0
  33. package/dist/esm/models/BulkGrantResponse.d.ts +55 -0
  34. package/dist/esm/models/BulkGrantResponse.js +46 -0
  35. package/dist/esm/models/BulkGrantSuccess.d.ts +72 -0
  36. package/dist/esm/models/BulkGrantSuccess.js +61 -0
  37. package/dist/esm/models/BulkItemFailure.d.ts +54 -0
  38. package/dist/esm/models/BulkItemFailure.js +49 -0
  39. package/dist/esm/models/BulkMoveRequest.d.ts +59 -0
  40. package/dist/esm/models/BulkMoveRequest.js +48 -0
  41. package/dist/esm/models/BulkOperationResponse.d.ts +54 -0
  42. package/dist/esm/models/BulkOperationResponse.js +45 -0
  43. package/dist/esm/models/BulkRevokeRequest.d.ts +53 -0
  44. package/dist/esm/models/BulkRevokeRequest.js +46 -0
  45. package/dist/esm/models/BulkTrashRequest.d.ts +47 -0
  46. package/dist/esm/models/BulkTrashRequest.js +42 -0
  47. package/dist/esm/models/CreateUploadRequest.d.ts +6 -0
  48. package/dist/esm/models/CreateUploadRequest.js +2 -0
  49. package/dist/esm/models/DocumentVersionMetadata.d.ts +18 -0
  50. package/dist/esm/models/DocumentVersionMetadata.js +6 -0
  51. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +18 -0
  52. package/dist/esm/models/DocumentVersionMetadataUpdate.js +6 -0
  53. package/dist/esm/models/ErrorResponse.d.ts +1 -0
  54. package/dist/esm/models/ErrorResponse.js +1 -0
  55. package/dist/esm/models/index.d.ts +12 -0
  56. package/dist/esm/models/index.js +12 -0
  57. package/dist/models/BulkDeleteRequest.d.ts +53 -0
  58. package/dist/models/BulkDeleteRequest.js +52 -0
  59. package/dist/models/BulkFailureReason.d.ts +37 -0
  60. package/dist/models/BulkFailureReason.js +63 -0
  61. package/dist/models/BulkGrantItem.d.ts +66 -0
  62. package/dist/models/BulkGrantItem.js +63 -0
  63. package/dist/models/BulkGrantItemFailure.d.ts +60 -0
  64. package/dist/models/BulkGrantItemFailure.js +61 -0
  65. package/dist/models/BulkGrantRequest.d.ts +54 -0
  66. package/dist/models/BulkGrantRequest.js +55 -0
  67. package/dist/models/BulkGrantResponse.d.ts +55 -0
  68. package/dist/models/BulkGrantResponse.js +54 -0
  69. package/dist/models/BulkGrantSuccess.d.ts +72 -0
  70. package/dist/models/BulkGrantSuccess.js +69 -0
  71. package/dist/models/BulkItemFailure.d.ts +54 -0
  72. package/dist/models/BulkItemFailure.js +57 -0
  73. package/dist/models/BulkMoveRequest.d.ts +59 -0
  74. package/dist/models/BulkMoveRequest.js +56 -0
  75. package/dist/models/BulkOperationResponse.d.ts +54 -0
  76. package/dist/models/BulkOperationResponse.js +53 -0
  77. package/dist/models/BulkRevokeRequest.d.ts +53 -0
  78. package/dist/models/BulkRevokeRequest.js +54 -0
  79. package/dist/models/BulkTrashRequest.d.ts +47 -0
  80. package/dist/models/BulkTrashRequest.js +50 -0
  81. package/dist/models/CreateUploadRequest.d.ts +6 -0
  82. package/dist/models/CreateUploadRequest.js +2 -0
  83. package/dist/models/DocumentVersionMetadata.d.ts +18 -0
  84. package/dist/models/DocumentVersionMetadata.js +6 -0
  85. package/dist/models/DocumentVersionMetadataUpdate.d.ts +18 -0
  86. package/dist/models/DocumentVersionMetadataUpdate.js +6 -0
  87. package/dist/models/ErrorResponse.d.ts +1 -0
  88. package/dist/models/ErrorResponse.js +1 -0
  89. package/dist/models/index.d.ts +12 -0
  90. package/dist/models/index.js +12 -0
  91. package/docs/BulkDeleteApi.md +84 -0
  92. package/docs/BulkDeleteRequest.md +37 -0
  93. package/docs/BulkFailureReason.md +33 -0
  94. package/docs/BulkGrantItem.md +41 -0
  95. package/docs/BulkGrantItemFailure.md +39 -0
  96. package/docs/BulkGrantRequest.md +37 -0
  97. package/docs/BulkGrantResponse.md +37 -0
  98. package/docs/BulkGrantSuccess.md +43 -0
  99. package/docs/BulkItemFailure.md +37 -0
  100. package/docs/BulkMoveApi.md +84 -0
  101. package/docs/BulkMoveRequest.md +39 -0
  102. package/docs/BulkOperationResponse.md +37 -0
  103. package/docs/BulkRevokeRequest.md +37 -0
  104. package/docs/BulkTrashRequest.md +35 -0
  105. package/docs/CreateUploadRequest.md +2 -0
  106. package/docs/DocumentVersionMetadata.md +6 -0
  107. package/docs/DocumentVersionMetadataUpdate.md +6 -0
  108. package/docs/TrashApi.md +152 -0
  109. package/docs/UserPermissionsApi.md +152 -0
  110. package/package.json +1 -1
  111. package/src/apis/BulkDeleteApi.ts +133 -0
  112. package/src/apis/BulkMoveApi.ts +133 -0
  113. package/src/apis/TrashApi.ts +176 -0
  114. package/src/apis/UserPermissionsApi.ts +182 -0
  115. package/src/apis/index.ts +2 -0
  116. package/src/models/BulkDeleteRequest.ts +90 -0
  117. package/src/models/BulkFailureReason.ts +65 -0
  118. package/src/models/BulkGrantItem.ts +119 -0
  119. package/src/models/BulkGrantItemFailure.ts +111 -0
  120. package/src/models/BulkGrantRequest.ts +99 -0
  121. package/src/models/BulkGrantResponse.ts +105 -0
  122. package/src/models/BulkGrantSuccess.ts +129 -0
  123. package/src/models/BulkItemFailure.ts +102 -0
  124. package/src/models/BulkMoveRequest.ts +99 -0
  125. package/src/models/BulkOperationResponse.ts +98 -0
  126. package/src/models/BulkRevokeRequest.ts +91 -0
  127. package/src/models/BulkTrashRequest.ts +82 -0
  128. package/src/models/CreateUploadRequest.ts +8 -0
  129. package/src/models/DocumentVersionMetadata.ts +24 -0
  130. package/src/models/DocumentVersionMetadataUpdate.ts +24 -0
  131. package/src/models/ErrorResponse.ts +1 -0
  132. package/src/models/index.ts +12 -0
@@ -0,0 +1,53 @@
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.BulkOperationResponsePropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfBulkOperationResponse = instanceOfBulkOperationResponse;
18
+ exports.BulkOperationResponseFromJSON = BulkOperationResponseFromJSON;
19
+ exports.BulkOperationResponseFromJSONTyped = BulkOperationResponseFromJSONTyped;
20
+ exports.BulkOperationResponseToJSON = BulkOperationResponseToJSON;
21
+ exports.BulkOperationResponseToJSONTyped = BulkOperationResponseToJSONTyped;
22
+ const BulkItemFailure_1 = require("./BulkItemFailure");
23
+ exports.BulkOperationResponsePropertyValidationAttributesMap = {};
24
+ /**
25
+ * Check if a given object implements the BulkOperationResponse interface.
26
+ */
27
+ function instanceOfBulkOperationResponse(value) {
28
+ return true;
29
+ }
30
+ function BulkOperationResponseFromJSON(json) {
31
+ return BulkOperationResponseFromJSONTyped(json, false);
32
+ }
33
+ function BulkOperationResponseFromJSONTyped(json, ignoreDiscriminator) {
34
+ if (json == null) {
35
+ return json;
36
+ }
37
+ return {
38
+ 'succeeded': json['succeeded'] == null ? undefined : json['succeeded'],
39
+ 'failed': json['failed'] == null ? undefined : (json['failed'].map(BulkItemFailure_1.BulkItemFailureFromJSON)),
40
+ };
41
+ }
42
+ function BulkOperationResponseToJSON(json) {
43
+ return BulkOperationResponseToJSONTyped(json, false);
44
+ }
45
+ function BulkOperationResponseToJSONTyped(value, ignoreDiscriminator = false) {
46
+ if (value == null) {
47
+ return value;
48
+ }
49
+ return {
50
+ 'succeeded': value['succeeded'],
51
+ 'failed': value['failed'] == null ? undefined : (value['failed'].map(BulkItemFailure_1.BulkItemFailureToJSON)),
52
+ };
53
+ }
@@ -0,0 +1,53 @@
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
+ * Revoke many permissions by their own permission-row ids.
14
+ * @export
15
+ * @interface BulkRevokeRequest
16
+ */
17
+ export interface BulkRevokeRequest {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof BulkRevokeRequest
22
+ */
23
+ tenantId: string;
24
+ /**
25
+ *
26
+ * @type {Array<string>}
27
+ * @memberof BulkRevokeRequest
28
+ */
29
+ permissionIds?: Array<string>;
30
+ }
31
+ export declare const BulkRevokeRequestPropertyValidationAttributesMap: {
32
+ [property: string]: {
33
+ maxLength?: number;
34
+ minLength?: number;
35
+ pattern?: string;
36
+ maximum?: number;
37
+ exclusiveMaximum?: boolean;
38
+ minimum?: number;
39
+ exclusiveMinimum?: boolean;
40
+ multipleOf?: number;
41
+ maxItems?: number;
42
+ minItems?: number;
43
+ uniqueItems?: boolean;
44
+ };
45
+ };
46
+ /**
47
+ * Check if a given object implements the BulkRevokeRequest interface.
48
+ */
49
+ export declare function instanceOfBulkRevokeRequest(value: object): value is BulkRevokeRequest;
50
+ export declare function BulkRevokeRequestFromJSON(json: any): BulkRevokeRequest;
51
+ export declare function BulkRevokeRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkRevokeRequest;
52
+ export declare function BulkRevokeRequestToJSON(json: any): BulkRevokeRequest;
53
+ export declare function BulkRevokeRequestToJSONTyped(value?: BulkRevokeRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,54 @@
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.BulkRevokeRequestPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfBulkRevokeRequest = instanceOfBulkRevokeRequest;
18
+ exports.BulkRevokeRequestFromJSON = BulkRevokeRequestFromJSON;
19
+ exports.BulkRevokeRequestFromJSONTyped = BulkRevokeRequestFromJSONTyped;
20
+ exports.BulkRevokeRequestToJSON = BulkRevokeRequestToJSON;
21
+ exports.BulkRevokeRequestToJSONTyped = BulkRevokeRequestToJSONTyped;
22
+ exports.BulkRevokeRequestPropertyValidationAttributesMap = {};
23
+ /**
24
+ * Check if a given object implements the BulkRevokeRequest interface.
25
+ */
26
+ function instanceOfBulkRevokeRequest(value) {
27
+ if (!('tenantId' in value) || value['tenantId'] === undefined)
28
+ return false;
29
+ return true;
30
+ }
31
+ function BulkRevokeRequestFromJSON(json) {
32
+ return BulkRevokeRequestFromJSONTyped(json, false);
33
+ }
34
+ function BulkRevokeRequestFromJSONTyped(json, ignoreDiscriminator) {
35
+ if (json == null) {
36
+ return json;
37
+ }
38
+ return {
39
+ 'tenantId': json['tenant_id'],
40
+ 'permissionIds': json['permission_ids'] == null ? undefined : json['permission_ids'],
41
+ };
42
+ }
43
+ function BulkRevokeRequestToJSON(json) {
44
+ return BulkRevokeRequestToJSONTyped(json, false);
45
+ }
46
+ function BulkRevokeRequestToJSONTyped(value, ignoreDiscriminator = false) {
47
+ if (value == null) {
48
+ return value;
49
+ }
50
+ return {
51
+ 'tenant_id': value['tenantId'],
52
+ 'permission_ids': value['permissionIds'],
53
+ };
54
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Knowledge Stack API
3
+ * Knowledge Stack backend API for authentication and knowledge management. ## Integrating (RPA / machine clients) **Base URL.** Knowledge Stack is self-hosted — point at your own deployment host (see `servers`). The `localhost` entry is for local development only. **Authentication.** Send `Authorization: Bearer <api-key>` on every request. Mint an API key once via `POST /v1/api-keys` from a signed-in browser session; the raw `sk-user-...` secret is returned **only** at creation, so store it then. A key inherits its owning user\'s live tenant role and path permissions — create RPA keys from a least-privilege user, and set `expires_at` for rotation. The `ks_uat` cookie scheme is browser-only and cannot be used by headless clients. **Async work is polled, not pushed.** There are no outbound webhooks. - `POST /v1/documents/ingest` returns `201` immediately with a `workflow_id`; poll `GET /v1/system-jobs/document_versions/{workflow_id}` until `status` is terminal (anything other than `pending`/`processing`). The `Location` response header points at this poll resource. - `POST /v1/workflow-runs/{run_id}/start` returns `202`; poll `GET /v1/workflow-runs/{run_id}` until `execution_state` is `COMPLETED` or `FAILED`. The `Location` header points at the run resource. - `POST /v1/agent/ask` is **synchronous** — it blocks until the agent finishes and returns the answer inline. Use a generous HTTP timeout. **Pagination.** List endpoints accept `limit`/`offset` and return `{items, total, limit, offset}`. **Errors.** Every non-2xx body is `{detail, code, request_id}`. `code` is a stable value from a closed set (see the `ErrorResponse` schema\'s `code` enum) — branch on it rather than parsing `detail`. Quota rejections return `429` with a `Retry-After` header; transient lock contention returns a retryable `503`. Quote `request_id` (also the `x-request-id` response header) to support. **Idempotency.** `POST /v1/workflow-runs` accepts an `idempotency_key` to dedupe retried run creation. `agent/ask` charges one message *before* running and does not refund a client-cancelled call.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ * Restore or permanently delete the selected trashed objects by PDO id.
14
+ * @export
15
+ * @interface BulkTrashRequest
16
+ */
17
+ export interface BulkTrashRequest {
18
+ /**
19
+ *
20
+ * @type {Array<string>}
21
+ * @memberof BulkTrashRequest
22
+ */
23
+ objectIds?: Array<string>;
24
+ }
25
+ export declare const BulkTrashRequestPropertyValidationAttributesMap: {
26
+ [property: string]: {
27
+ maxLength?: number;
28
+ minLength?: number;
29
+ pattern?: string;
30
+ maximum?: number;
31
+ exclusiveMaximum?: boolean;
32
+ minimum?: number;
33
+ exclusiveMinimum?: boolean;
34
+ multipleOf?: number;
35
+ maxItems?: number;
36
+ minItems?: number;
37
+ uniqueItems?: boolean;
38
+ };
39
+ };
40
+ /**
41
+ * Check if a given object implements the BulkTrashRequest interface.
42
+ */
43
+ export declare function instanceOfBulkTrashRequest(value: object): value is BulkTrashRequest;
44
+ export declare function BulkTrashRequestFromJSON(json: any): BulkTrashRequest;
45
+ export declare function BulkTrashRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkTrashRequest;
46
+ export declare function BulkTrashRequestToJSON(json: any): BulkTrashRequest;
47
+ export declare function BulkTrashRequestToJSONTyped(value?: BulkTrashRequest | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,50 @@
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.BulkTrashRequestPropertyValidationAttributesMap = void 0;
17
+ exports.instanceOfBulkTrashRequest = instanceOfBulkTrashRequest;
18
+ exports.BulkTrashRequestFromJSON = BulkTrashRequestFromJSON;
19
+ exports.BulkTrashRequestFromJSONTyped = BulkTrashRequestFromJSONTyped;
20
+ exports.BulkTrashRequestToJSON = BulkTrashRequestToJSON;
21
+ exports.BulkTrashRequestToJSONTyped = BulkTrashRequestToJSONTyped;
22
+ exports.BulkTrashRequestPropertyValidationAttributesMap = {};
23
+ /**
24
+ * Check if a given object implements the BulkTrashRequest interface.
25
+ */
26
+ function instanceOfBulkTrashRequest(value) {
27
+ return true;
28
+ }
29
+ function BulkTrashRequestFromJSON(json) {
30
+ return BulkTrashRequestFromJSONTyped(json, false);
31
+ }
32
+ function BulkTrashRequestFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'objectIds': json['object_ids'] == null ? undefined : json['object_ids'],
38
+ };
39
+ }
40
+ function BulkTrashRequestToJSON(json) {
41
+ return BulkTrashRequestToJSONTyped(json, false);
42
+ }
43
+ function BulkTrashRequestToJSONTyped(value, ignoreDiscriminator = false) {
44
+ if (value == null) {
45
+ return value;
46
+ }
47
+ return {
48
+ 'object_ids': value['objectIds'],
49
+ };
50
+ }
@@ -39,6 +39,12 @@ export interface CreateUploadRequest {
39
39
  * @memberof CreateUploadRequest
40
40
  */
41
41
  sizeBytes: number;
42
+ /**
43
+ * Tags applied to the document on completion (mirrors the buffered ingest endpoints so a mixed submit tags recordings too)
44
+ * @type {Array<string>}
45
+ * @memberof CreateUploadRequest
46
+ */
47
+ tagIds?: Array<string>;
42
48
  }
43
49
  export declare const CreateUploadRequestPropertyValidationAttributesMap: {
44
50
  [property: string]: {
@@ -46,6 +46,7 @@ function CreateUploadRequestFromJSONTyped(json, ignoreDiscriminator) {
46
46
  'name': json['name'],
47
47
  'filename': json['filename'],
48
48
  'sizeBytes': json['size_bytes'],
49
+ 'tagIds': json['tag_ids'] == null ? undefined : json['tag_ids'],
49
50
  };
50
51
  }
51
52
  function CreateUploadRequestToJSON(json) {
@@ -60,5 +61,6 @@ function CreateUploadRequestToJSONTyped(value, ignoreDiscriminator = false) {
60
61
  'name': value['name'],
61
62
  'filename': value['filename'],
62
63
  'size_bytes': value['sizeBytes'],
64
+ 'tag_ids': value['tagIds'],
63
65
  };
64
66
  }
@@ -87,6 +87,24 @@ export interface DocumentVersionMetadata {
87
87
  * @memberof DocumentVersionMetadata
88
88
  */
89
89
  totalChunks?: number | null;
90
+ /**
91
+ * Media (audio/video) duration in milliseconds; null for non-media
92
+ * @type {number}
93
+ * @memberof DocumentVersionMetadata
94
+ */
95
+ durationMs?: number | null;
96
+ /**
97
+ * ASR-detected language of the media transcript, as returned by the ASR provider; null for non-media or when the provider omits it
98
+ * @type {string}
99
+ * @memberof DocumentVersionMetadata
100
+ */
101
+ language?: string | null;
102
+ /**
103
+ * Number of transcript segments produced by ASR; null for non-media
104
+ * @type {number}
105
+ * @memberof DocumentVersionMetadata
106
+ */
107
+ segmentCount?: number | null;
90
108
  /**
91
109
  * Total formula cells in the workbook (XLSX only)
92
110
  * @type {number}
@@ -47,6 +47,9 @@ function DocumentVersionMetadataFromJSONTyped(json, ignoreDiscriminator) {
47
47
  'totalPages': json['total_pages'] == null ? undefined : json['total_pages'],
48
48
  'totalSections': json['total_sections'] == null ? undefined : json['total_sections'],
49
49
  'totalChunks': json['total_chunks'] == null ? undefined : json['total_chunks'],
50
+ 'durationMs': json['duration_ms'] == null ? undefined : json['duration_ms'],
51
+ 'language': json['language'] == null ? undefined : json['language'],
52
+ 'segmentCount': json['segment_count'] == null ? undefined : json['segment_count'],
50
53
  'totalFormulas': json['total_formulas'] == null ? undefined : json['total_formulas'],
51
54
  'xlsxParseResultS3': json['xlsx_parse_result_s3'] == null ? undefined : json['xlsx_parse_result_s3'],
52
55
  'xlsxNamedRanges': json['xlsx_named_ranges'] == null ? undefined : json['xlsx_named_ranges'],
@@ -78,6 +81,9 @@ function DocumentVersionMetadataToJSONTyped(value, ignoreDiscriminator = false)
78
81
  'total_pages': value['totalPages'],
79
82
  'total_sections': value['totalSections'],
80
83
  'total_chunks': value['totalChunks'],
84
+ 'duration_ms': value['durationMs'],
85
+ 'language': value['language'],
86
+ 'segment_count': value['segmentCount'],
81
87
  'total_formulas': value['totalFormulas'],
82
88
  'xlsx_parse_result_s3': value['xlsxParseResultS3'],
83
89
  'xlsx_named_ranges': value['xlsxNamedRanges'],
@@ -99,6 +99,24 @@ export interface DocumentVersionMetadataUpdate {
99
99
  * @memberof DocumentVersionMetadataUpdate
100
100
  */
101
101
  totalChunks?: number | null;
102
+ /**
103
+ *
104
+ * @type {number}
105
+ * @memberof DocumentVersionMetadataUpdate
106
+ */
107
+ durationMs?: number | null;
108
+ /**
109
+ *
110
+ * @type {string}
111
+ * @memberof DocumentVersionMetadataUpdate
112
+ */
113
+ language?: string | null;
114
+ /**
115
+ *
116
+ * @type {number}
117
+ * @memberof DocumentVersionMetadataUpdate
118
+ */
119
+ segmentCount?: number | null;
102
120
  /**
103
121
  *
104
122
  * @type {number}
@@ -50,6 +50,9 @@ function DocumentVersionMetadataUpdateFromJSONTyped(json, ignoreDiscriminator) {
50
50
  'totalPages': json['total_pages'] == null ? undefined : json['total_pages'],
51
51
  'totalSections': json['total_sections'] == null ? undefined : json['total_sections'],
52
52
  'totalChunks': json['total_chunks'] == null ? undefined : json['total_chunks'],
53
+ 'durationMs': json['duration_ms'] == null ? undefined : json['duration_ms'],
54
+ 'language': json['language'] == null ? undefined : json['language'],
55
+ 'segmentCount': json['segment_count'] == null ? undefined : json['segment_count'],
53
56
  'totalFormulas': json['total_formulas'] == null ? undefined : json['total_formulas'],
54
57
  'xlsxParseResultS3': json['xlsx_parse_result_s3'] == null ? undefined : json['xlsx_parse_result_s3'],
55
58
  'xlsxNamedRanges': json['xlsx_named_ranges'] == null ? undefined : json['xlsx_named_ranges'],
@@ -83,6 +86,9 @@ function DocumentVersionMetadataUpdateToJSONTyped(value, ignoreDiscriminator = f
83
86
  'total_pages': value['totalPages'],
84
87
  'total_sections': value['totalSections'],
85
88
  'total_chunks': value['totalChunks'],
89
+ 'duration_ms': value['durationMs'],
90
+ 'language': value['language'],
91
+ 'segment_count': value['segmentCount'],
86
92
  'total_formulas': value['totalFormulas'],
87
93
  'xlsx_parse_result_s3': value['xlsxParseResultS3'],
88
94
  'xlsx_named_ranges': value['xlsxNamedRanges'],
@@ -40,6 +40,7 @@ export interface ErrorResponse {
40
40
  export declare const ErrorResponseCodeEnum: {
41
41
  readonly Error: 'error';
42
42
  readonly BadRequest: 'bad_request';
43
+ readonly PermissionLimit: 'permission_limit';
43
44
  readonly Unauthorized: 'unauthorized';
44
45
  readonly Forbidden: 'forbidden';
45
46
  readonly NotFound: 'not_found';
@@ -25,6 +25,7 @@ exports.ErrorResponseToJSONTyped = ErrorResponseToJSONTyped;
25
25
  exports.ErrorResponseCodeEnum = {
26
26
  Error: 'error',
27
27
  BadRequest: 'bad_request',
28
+ PermissionLimit: 'permission_limit',
28
29
  Unauthorized: 'unauthorized',
29
30
  Forbidden: 'forbidden',
30
31
  NotFound: 'not_found',
@@ -17,10 +17,22 @@ export * from './AskResponse';
17
17
  export * from './BlockChangeType';
18
18
  export * from './BlockKind';
19
19
  export * from './BrandingLogoType';
20
+ export * from './BulkDeleteRequest';
20
21
  export * from './BulkDownloadRequest';
22
+ export * from './BulkFailureReason';
23
+ export * from './BulkGrantItem';
24
+ export * from './BulkGrantItemFailure';
25
+ export * from './BulkGrantRequest';
26
+ export * from './BulkGrantResponse';
27
+ export * from './BulkGrantSuccess';
28
+ export * from './BulkItemFailure';
21
29
  export * from './BulkModelTablesRequest';
22
30
  export * from './BulkModelTablesResponse';
31
+ export * from './BulkMoveRequest';
32
+ export * from './BulkOperationResponse';
33
+ export * from './BulkRevokeRequest';
23
34
  export * from './BulkTagRequest';
35
+ export * from './BulkTrashRequest';
24
36
  export * from './CatalogColumnResponse';
25
37
  export * from './CatalogTableResponse';
26
38
  export * from './CellChange';
@@ -35,10 +35,22 @@ __exportStar(require("./AskResponse"), exports);
35
35
  __exportStar(require("./BlockChangeType"), exports);
36
36
  __exportStar(require("./BlockKind"), exports);
37
37
  __exportStar(require("./BrandingLogoType"), exports);
38
+ __exportStar(require("./BulkDeleteRequest"), exports);
38
39
  __exportStar(require("./BulkDownloadRequest"), exports);
40
+ __exportStar(require("./BulkFailureReason"), exports);
41
+ __exportStar(require("./BulkGrantItem"), exports);
42
+ __exportStar(require("./BulkGrantItemFailure"), exports);
43
+ __exportStar(require("./BulkGrantRequest"), exports);
44
+ __exportStar(require("./BulkGrantResponse"), exports);
45
+ __exportStar(require("./BulkGrantSuccess"), exports);
46
+ __exportStar(require("./BulkItemFailure"), exports);
39
47
  __exportStar(require("./BulkModelTablesRequest"), exports);
40
48
  __exportStar(require("./BulkModelTablesResponse"), exports);
49
+ __exportStar(require("./BulkMoveRequest"), exports);
50
+ __exportStar(require("./BulkOperationResponse"), exports);
51
+ __exportStar(require("./BulkRevokeRequest"), exports);
41
52
  __exportStar(require("./BulkTagRequest"), exports);
53
+ __exportStar(require("./BulkTrashRequest"), exports);
42
54
  __exportStar(require("./CatalogColumnResponse"), exports);
43
55
  __exportStar(require("./CatalogTableResponse"), exports);
44
56
  __exportStar(require("./CellChange"), exports);
@@ -0,0 +1,84 @@
1
+ # BulkDeleteApi
2
+
3
+ All URIs are relative to *http://localhost:8000*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**bulkDelete**](BulkDeleteApi.md#bulkdeleteoperation) | **POST** /v1/bulk-delete | Bulk Delete Handler |
8
+
9
+
10
+
11
+ ## bulkDelete
12
+
13
+ > BulkOperationResponse bulkDelete(bulkDeleteRequest)
14
+
15
+ Bulk Delete Handler
16
+
17
+ Move the selected folders and documents to Trash, reporting per item. Each id is soft-deleted in its own transaction: items the caller may not delete, that are approval-sealed, held by another user, contain an in-progress run, or sit inside another selected folder land in &#x60;&#x60;failed&#x60;&#x60; with a reason while the rest succeed. Over the selection cap returns &#x60;&#x60;400&#x60;&#x60;.
18
+
19
+ ### Example
20
+
21
+ ```ts
22
+ import {
23
+ Configuration,
24
+ BulkDeleteApi,
25
+ } from '@knowledge-stack/ksapi';
26
+ import type { BulkDeleteOperationRequest } from '@knowledge-stack/ksapi';
27
+
28
+ async function example() {
29
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
30
+ const config = new Configuration({
31
+ // To configure API key authorization: cookieAuth
32
+ apiKey: "YOUR API KEY",
33
+ // Configure HTTP bearer authorization: bearerAuth
34
+ accessToken: "YOUR BEARER TOKEN",
35
+ });
36
+ const api = new BulkDeleteApi(config);
37
+
38
+ const body = {
39
+ // BulkDeleteRequest
40
+ bulkDeleteRequest: ...,
41
+ } satisfies BulkDeleteOperationRequest;
42
+
43
+ try {
44
+ const data = await api.bulkDelete(body);
45
+ console.log(data);
46
+ } catch (error) {
47
+ console.error(error);
48
+ }
49
+ }
50
+
51
+ // Run the test
52
+ example().catch(console.error);
53
+ ```
54
+
55
+ ### Parameters
56
+
57
+
58
+ | Name | Type | Description | Notes |
59
+ |------------- | ------------- | ------------- | -------------|
60
+ | **bulkDeleteRequest** | [BulkDeleteRequest](BulkDeleteRequest.md) | | |
61
+
62
+ ### Return type
63
+
64
+ [**BulkOperationResponse**](BulkOperationResponse.md)
65
+
66
+ ### Authorization
67
+
68
+ [cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
69
+
70
+ ### HTTP request headers
71
+
72
+ - **Content-Type**: `application/json`
73
+ - **Accept**: `application/json`
74
+
75
+
76
+ ### HTTP response details
77
+ | Status code | Description | Response headers |
78
+ |-------------|-------------|------------------|
79
+ | **200** | Successful Response | - |
80
+ | **422** | Validation Error | - |
81
+ | **0** | Error response. | - |
82
+
83
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
84
+
@@ -0,0 +1,37 @@
1
+
2
+ # BulkDeleteRequest
3
+
4
+ Soft-delete the selected folders and documents to Trash.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `folderIds` | Array&lt;string&gt;
11
+ `documentIds` | Array&lt;string&gt;
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import type { BulkDeleteRequest } from '@knowledge-stack/ksapi'
17
+
18
+ // TODO: Update the object below with actual values
19
+ const example = {
20
+ "folderIds": null,
21
+ "documentIds": null,
22
+ } satisfies BulkDeleteRequest
23
+
24
+ console.log(example)
25
+
26
+ // Convert the instance to a JSON string
27
+ const exampleJSON: string = JSON.stringify(example)
28
+ console.log(exampleJSON)
29
+
30
+ // Parse the JSON string back to an object
31
+ const exampleParsed = JSON.parse(exampleJSON) as BulkDeleteRequest
32
+ console.log(exampleParsed)
33
+ ```
34
+
35
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
36
+
37
+
@@ -0,0 +1,33 @@
1
+
2
+ # BulkFailureReason
3
+
4
+ Why a single item in a bulk operation was not applied. Every value is produced by a specific, pre-checked gate — an *unexpected* per-item error is deliberately not caught (it surfaces as a 500) rather than hidden behind a vague catch-all.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import type { BulkFailureReason } from '@knowledge-stack/ksapi'
15
+
16
+ // TODO: Update the object below with actual values
17
+ const example = {
18
+ } satisfies BulkFailureReason
19
+
20
+ console.log(example)
21
+
22
+ // Convert the instance to a JSON string
23
+ const exampleJSON: string = JSON.stringify(example)
24
+ console.log(exampleJSON)
25
+
26
+ // Parse the JSON string back to an object
27
+ const exampleParsed = JSON.parse(exampleJSON) as BulkFailureReason
28
+ console.log(exampleParsed)
29
+ ```
30
+
31
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
32
+
33
+
@@ -0,0 +1,41 @@
1
+
2
+ # BulkGrantItem
3
+
4
+ One requested grant: a capability on an object (PDO id) for a user.
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `userId` | string
11
+ `objectId` | string
12
+ `capability` | [PermissionCapability](PermissionCapability.md)
13
+ `canApprove` | boolean
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import type { BulkGrantItem } from '@knowledge-stack/ksapi'
19
+
20
+ // TODO: Update the object below with actual values
21
+ const example = {
22
+ "userId": null,
23
+ "objectId": null,
24
+ "capability": null,
25
+ "canApprove": null,
26
+ } satisfies BulkGrantItem
27
+
28
+ console.log(example)
29
+
30
+ // Convert the instance to a JSON string
31
+ const exampleJSON: string = JSON.stringify(example)
32
+ console.log(exampleJSON)
33
+
34
+ // Parse the JSON string back to an object
35
+ const exampleParsed = JSON.parse(exampleJSON) as BulkGrantItem
36
+ console.log(exampleParsed)
37
+ ```
38
+
39
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
40
+
41
+