@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,99 @@
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
+
15
+ import { mapValues } from '../runtime';
16
+ import type { BulkGrantItem } from './BulkGrantItem';
17
+ import {
18
+ BulkGrantItemFromJSON,
19
+ BulkGrantItemFromJSONTyped,
20
+ BulkGrantItemToJSON,
21
+ BulkGrantItemToJSONTyped,
22
+ } from './BulkGrantItem';
23
+
24
+ /**
25
+ * Grant many (user, object, capability) permissions in one request.
26
+ * @export
27
+ * @interface BulkGrantRequest
28
+ */
29
+ export interface BulkGrantRequest {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof BulkGrantRequest
34
+ */
35
+ tenantId: string;
36
+ /**
37
+ *
38
+ * @type {Array<BulkGrantItem>}
39
+ * @memberof BulkGrantRequest
40
+ */
41
+ grants?: Array<BulkGrantItem>;
42
+ }
43
+ export const BulkGrantRequestPropertyValidationAttributesMap: {
44
+ [property: string]: {
45
+ maxLength?: number,
46
+ minLength?: number,
47
+ pattern?: string,
48
+ maximum?: number,
49
+ exclusiveMaximum?: boolean,
50
+ minimum?: number,
51
+ exclusiveMinimum?: boolean,
52
+ multipleOf?: number,
53
+ maxItems?: number,
54
+ minItems?: number,
55
+ uniqueItems?: boolean
56
+ }
57
+ } = {
58
+ }
59
+
60
+
61
+ /**
62
+ * Check if a given object implements the BulkGrantRequest interface.
63
+ */
64
+ export function instanceOfBulkGrantRequest(value: object): value is BulkGrantRequest {
65
+ if (!('tenantId' in value) || value['tenantId'] === undefined) return false;
66
+ return true;
67
+ }
68
+
69
+ export function BulkGrantRequestFromJSON(json: any): BulkGrantRequest {
70
+ return BulkGrantRequestFromJSONTyped(json, false);
71
+ }
72
+
73
+ export function BulkGrantRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkGrantRequest {
74
+ if (json == null) {
75
+ return json;
76
+ }
77
+ return {
78
+
79
+ 'tenantId': json['tenant_id'],
80
+ 'grants': json['grants'] == null ? undefined : ((json['grants'] as Array<any>).map(BulkGrantItemFromJSON)),
81
+ };
82
+ }
83
+
84
+ export function BulkGrantRequestToJSON(json: any): BulkGrantRequest {
85
+ return BulkGrantRequestToJSONTyped(json, false);
86
+ }
87
+
88
+ export function BulkGrantRequestToJSONTyped(value?: BulkGrantRequest | null, ignoreDiscriminator: boolean = false): any {
89
+ if (value == null) {
90
+ return value;
91
+ }
92
+
93
+ return {
94
+
95
+ 'tenant_id': value['tenantId'],
96
+ 'grants': value['grants'] == null ? undefined : ((value['grants'] as Array<any>).map(BulkGrantItemToJSON)),
97
+ };
98
+ }
99
+
@@ -0,0 +1,105 @@
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
+
15
+ import { mapValues } from '../runtime';
16
+ import type { BulkGrantItemFailure } from './BulkGrantItemFailure';
17
+ import {
18
+ BulkGrantItemFailureFromJSON,
19
+ BulkGrantItemFailureFromJSONTyped,
20
+ BulkGrantItemFailureToJSON,
21
+ BulkGrantItemFailureToJSONTyped,
22
+ } from './BulkGrantItemFailure';
23
+ import type { BulkGrantSuccess } from './BulkGrantSuccess';
24
+ import {
25
+ BulkGrantSuccessFromJSON,
26
+ BulkGrantSuccessFromJSONTyped,
27
+ BulkGrantSuccessToJSON,
28
+ BulkGrantSuccessToJSONTyped,
29
+ } from './BulkGrantSuccess';
30
+
31
+ /**
32
+ * Per-item outcome of a bulk grant (composite-keyed, unlike other bulks).
33
+ * @export
34
+ * @interface BulkGrantResponse
35
+ */
36
+ export interface BulkGrantResponse {
37
+ /**
38
+ *
39
+ * @type {Array<BulkGrantSuccess>}
40
+ * @memberof BulkGrantResponse
41
+ */
42
+ succeeded?: Array<BulkGrantSuccess>;
43
+ /**
44
+ *
45
+ * @type {Array<BulkGrantItemFailure>}
46
+ * @memberof BulkGrantResponse
47
+ */
48
+ failed?: Array<BulkGrantItemFailure>;
49
+ }
50
+ export const BulkGrantResponsePropertyValidationAttributesMap: {
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
+
67
+
68
+ /**
69
+ * Check if a given object implements the BulkGrantResponse interface.
70
+ */
71
+ export function instanceOfBulkGrantResponse(value: object): value is BulkGrantResponse {
72
+ return true;
73
+ }
74
+
75
+ export function BulkGrantResponseFromJSON(json: any): BulkGrantResponse {
76
+ return BulkGrantResponseFromJSONTyped(json, false);
77
+ }
78
+
79
+ export function BulkGrantResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkGrantResponse {
80
+ if (json == null) {
81
+ return json;
82
+ }
83
+ return {
84
+
85
+ 'succeeded': json['succeeded'] == null ? undefined : ((json['succeeded'] as Array<any>).map(BulkGrantSuccessFromJSON)),
86
+ 'failed': json['failed'] == null ? undefined : ((json['failed'] as Array<any>).map(BulkGrantItemFailureFromJSON)),
87
+ };
88
+ }
89
+
90
+ export function BulkGrantResponseToJSON(json: any): BulkGrantResponse {
91
+ return BulkGrantResponseToJSONTyped(json, false);
92
+ }
93
+
94
+ export function BulkGrantResponseToJSONTyped(value?: BulkGrantResponse | null, ignoreDiscriminator: boolean = false): any {
95
+ if (value == null) {
96
+ return value;
97
+ }
98
+
99
+ return {
100
+
101
+ 'succeeded': value['succeeded'] == null ? undefined : ((value['succeeded'] as Array<any>).map(BulkGrantSuccessToJSON)),
102
+ 'failed': value['failed'] == null ? undefined : ((value['failed'] as Array<any>).map(BulkGrantItemFailureToJSON)),
103
+ };
104
+ }
105
+
@@ -0,0 +1,129 @@
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
+
15
+ import { mapValues } from '../runtime';
16
+ import type { PermissionCapability } from './PermissionCapability';
17
+ import {
18
+ PermissionCapabilityFromJSON,
19
+ PermissionCapabilityFromJSONTyped,
20
+ PermissionCapabilityToJSON,
21
+ PermissionCapabilityToJSONTyped,
22
+ } from './PermissionCapability';
23
+
24
+ /**
25
+ * A grant that was created, keyed on its (user, object) pair plus new id.
26
+ * @export
27
+ * @interface BulkGrantSuccess
28
+ */
29
+ export interface BulkGrantSuccess {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof BulkGrantSuccess
34
+ */
35
+ userId: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof BulkGrantSuccess
40
+ */
41
+ objectId: string;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof BulkGrantSuccess
46
+ */
47
+ permissionId: string;
48
+ /**
49
+ *
50
+ * @type {PermissionCapability}
51
+ * @memberof BulkGrantSuccess
52
+ */
53
+ capability: PermissionCapability;
54
+ /**
55
+ *
56
+ * @type {boolean}
57
+ * @memberof BulkGrantSuccess
58
+ */
59
+ canApprove: boolean;
60
+ }
61
+
62
+
63
+ export const BulkGrantSuccessPropertyValidationAttributesMap: {
64
+ [property: string]: {
65
+ maxLength?: number,
66
+ minLength?: number,
67
+ pattern?: string,
68
+ maximum?: number,
69
+ exclusiveMaximum?: boolean,
70
+ minimum?: number,
71
+ exclusiveMinimum?: boolean,
72
+ multipleOf?: number,
73
+ maxItems?: number,
74
+ minItems?: number,
75
+ uniqueItems?: boolean
76
+ }
77
+ } = {
78
+ }
79
+
80
+
81
+ /**
82
+ * Check if a given object implements the BulkGrantSuccess interface.
83
+ */
84
+ export function instanceOfBulkGrantSuccess(value: object): value is BulkGrantSuccess {
85
+ if (!('userId' in value) || value['userId'] === undefined) return false;
86
+ if (!('objectId' in value) || value['objectId'] === undefined) return false;
87
+ if (!('permissionId' in value) || value['permissionId'] === undefined) return false;
88
+ if (!('capability' in value) || value['capability'] === undefined) return false;
89
+ if (!('canApprove' in value) || value['canApprove'] === undefined) return false;
90
+ return true;
91
+ }
92
+
93
+ export function BulkGrantSuccessFromJSON(json: any): BulkGrantSuccess {
94
+ return BulkGrantSuccessFromJSONTyped(json, false);
95
+ }
96
+
97
+ export function BulkGrantSuccessFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkGrantSuccess {
98
+ if (json == null) {
99
+ return json;
100
+ }
101
+ return {
102
+
103
+ 'userId': json['user_id'],
104
+ 'objectId': json['object_id'],
105
+ 'permissionId': json['permission_id'],
106
+ 'capability': PermissionCapabilityFromJSON(json['capability']),
107
+ 'canApprove': json['can_approve'],
108
+ };
109
+ }
110
+
111
+ export function BulkGrantSuccessToJSON(json: any): BulkGrantSuccess {
112
+ return BulkGrantSuccessToJSONTyped(json, false);
113
+ }
114
+
115
+ export function BulkGrantSuccessToJSONTyped(value?: BulkGrantSuccess | null, ignoreDiscriminator: boolean = false): any {
116
+ if (value == null) {
117
+ return value;
118
+ }
119
+
120
+ return {
121
+
122
+ 'user_id': value['userId'],
123
+ 'object_id': value['objectId'],
124
+ 'permission_id': value['permissionId'],
125
+ 'capability': PermissionCapabilityToJSON(value['capability']),
126
+ 'can_approve': value['canApprove'],
127
+ };
128
+ }
129
+
@@ -0,0 +1,102 @@
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
+
15
+ import { mapValues } from '../runtime';
16
+ import type { BulkFailureReason } from './BulkFailureReason';
17
+ import {
18
+ BulkFailureReasonFromJSON,
19
+ BulkFailureReasonFromJSONTyped,
20
+ BulkFailureReasonToJSON,
21
+ BulkFailureReasonToJSONTyped,
22
+ } from './BulkFailureReason';
23
+
24
+ /**
25
+ * A single id that could not be applied, and why.
26
+ * @export
27
+ * @interface BulkItemFailure
28
+ */
29
+ export interface BulkItemFailure {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof BulkItemFailure
34
+ */
35
+ id: string;
36
+ /**
37
+ *
38
+ * @type {BulkFailureReason}
39
+ * @memberof BulkItemFailure
40
+ */
41
+ reason: BulkFailureReason;
42
+ }
43
+
44
+
45
+ export const BulkItemFailurePropertyValidationAttributesMap: {
46
+ [property: string]: {
47
+ maxLength?: number,
48
+ minLength?: number,
49
+ pattern?: string,
50
+ maximum?: number,
51
+ exclusiveMaximum?: boolean,
52
+ minimum?: number,
53
+ exclusiveMinimum?: boolean,
54
+ multipleOf?: number,
55
+ maxItems?: number,
56
+ minItems?: number,
57
+ uniqueItems?: boolean
58
+ }
59
+ } = {
60
+ }
61
+
62
+
63
+ /**
64
+ * Check if a given object implements the BulkItemFailure interface.
65
+ */
66
+ export function instanceOfBulkItemFailure(value: object): value is BulkItemFailure {
67
+ if (!('id' in value) || value['id'] === undefined) return false;
68
+ if (!('reason' in value) || value['reason'] === undefined) return false;
69
+ return true;
70
+ }
71
+
72
+ export function BulkItemFailureFromJSON(json: any): BulkItemFailure {
73
+ return BulkItemFailureFromJSONTyped(json, false);
74
+ }
75
+
76
+ export function BulkItemFailureFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkItemFailure {
77
+ if (json == null) {
78
+ return json;
79
+ }
80
+ return {
81
+
82
+ 'id': json['id'],
83
+ 'reason': BulkFailureReasonFromJSON(json['reason']),
84
+ };
85
+ }
86
+
87
+ export function BulkItemFailureToJSON(json: any): BulkItemFailure {
88
+ return BulkItemFailureToJSONTyped(json, false);
89
+ }
90
+
91
+ export function BulkItemFailureToJSONTyped(value?: BulkItemFailure | null, ignoreDiscriminator: boolean = false): any {
92
+ if (value == null) {
93
+ return value;
94
+ }
95
+
96
+ return {
97
+
98
+ 'id': value['id'],
99
+ 'reason': BulkFailureReasonToJSON(value['reason']),
100
+ };
101
+ }
102
+
@@ -0,0 +1,99 @@
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
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * Move the selected folders and documents into ``target_folder_id``.
18
+ * @export
19
+ * @interface BulkMoveRequest
20
+ */
21
+ export interface BulkMoveRequest {
22
+ /**
23
+ *
24
+ * @type {Array<string>}
25
+ * @memberof BulkMoveRequest
26
+ */
27
+ folderIds?: Array<string>;
28
+ /**
29
+ *
30
+ * @type {Array<string>}
31
+ * @memberof BulkMoveRequest
32
+ */
33
+ documentIds?: Array<string>;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof BulkMoveRequest
38
+ */
39
+ targetFolderId: string;
40
+ }
41
+ export const BulkMoveRequestPropertyValidationAttributesMap: {
42
+ [property: string]: {
43
+ maxLength?: number,
44
+ minLength?: number,
45
+ pattern?: string,
46
+ maximum?: number,
47
+ exclusiveMaximum?: boolean,
48
+ minimum?: number,
49
+ exclusiveMinimum?: boolean,
50
+ multipleOf?: number,
51
+ maxItems?: number,
52
+ minItems?: number,
53
+ uniqueItems?: boolean
54
+ }
55
+ } = {
56
+ }
57
+
58
+
59
+ /**
60
+ * Check if a given object implements the BulkMoveRequest interface.
61
+ */
62
+ export function instanceOfBulkMoveRequest(value: object): value is BulkMoveRequest {
63
+ if (!('targetFolderId' in value) || value['targetFolderId'] === undefined) return false;
64
+ return true;
65
+ }
66
+
67
+ export function BulkMoveRequestFromJSON(json: any): BulkMoveRequest {
68
+ return BulkMoveRequestFromJSONTyped(json, false);
69
+ }
70
+
71
+ export function BulkMoveRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkMoveRequest {
72
+ if (json == null) {
73
+ return json;
74
+ }
75
+ return {
76
+
77
+ 'folderIds': json['folder_ids'] == null ? undefined : json['folder_ids'],
78
+ 'documentIds': json['document_ids'] == null ? undefined : json['document_ids'],
79
+ 'targetFolderId': json['target_folder_id'],
80
+ };
81
+ }
82
+
83
+ export function BulkMoveRequestToJSON(json: any): BulkMoveRequest {
84
+ return BulkMoveRequestToJSONTyped(json, false);
85
+ }
86
+
87
+ export function BulkMoveRequestToJSONTyped(value?: BulkMoveRequest | null, ignoreDiscriminator: boolean = false): any {
88
+ if (value == null) {
89
+ return value;
90
+ }
91
+
92
+ return {
93
+
94
+ 'folder_ids': value['folderIds'],
95
+ 'document_ids': value['documentIds'],
96
+ 'target_folder_id': value['targetFolderId'],
97
+ };
98
+ }
99
+
@@ -0,0 +1,98 @@
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
+
15
+ import { mapValues } from '../runtime';
16
+ import type { BulkItemFailure } from './BulkItemFailure';
17
+ import {
18
+ BulkItemFailureFromJSON,
19
+ BulkItemFailureFromJSONTyped,
20
+ BulkItemFailureToJSON,
21
+ BulkItemFailureToJSONTyped,
22
+ } from './BulkItemFailure';
23
+
24
+ /**
25
+ * Per-item outcome of a bulk operation keyed on a single PDO id.
26
+ * @export
27
+ * @interface BulkOperationResponse
28
+ */
29
+ export interface BulkOperationResponse {
30
+ /**
31
+ *
32
+ * @type {Array<string>}
33
+ * @memberof BulkOperationResponse
34
+ */
35
+ succeeded?: Array<string>;
36
+ /**
37
+ *
38
+ * @type {Array<BulkItemFailure>}
39
+ * @memberof BulkOperationResponse
40
+ */
41
+ failed?: Array<BulkItemFailure>;
42
+ }
43
+ export const BulkOperationResponsePropertyValidationAttributesMap: {
44
+ [property: string]: {
45
+ maxLength?: number,
46
+ minLength?: number,
47
+ pattern?: string,
48
+ maximum?: number,
49
+ exclusiveMaximum?: boolean,
50
+ minimum?: number,
51
+ exclusiveMinimum?: boolean,
52
+ multipleOf?: number,
53
+ maxItems?: number,
54
+ minItems?: number,
55
+ uniqueItems?: boolean
56
+ }
57
+ } = {
58
+ }
59
+
60
+
61
+ /**
62
+ * Check if a given object implements the BulkOperationResponse interface.
63
+ */
64
+ export function instanceOfBulkOperationResponse(value: object): value is BulkOperationResponse {
65
+ return true;
66
+ }
67
+
68
+ export function BulkOperationResponseFromJSON(json: any): BulkOperationResponse {
69
+ return BulkOperationResponseFromJSONTyped(json, false);
70
+ }
71
+
72
+ export function BulkOperationResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkOperationResponse {
73
+ if (json == null) {
74
+ return json;
75
+ }
76
+ return {
77
+
78
+ 'succeeded': json['succeeded'] == null ? undefined : json['succeeded'],
79
+ 'failed': json['failed'] == null ? undefined : ((json['failed'] as Array<any>).map(BulkItemFailureFromJSON)),
80
+ };
81
+ }
82
+
83
+ export function BulkOperationResponseToJSON(json: any): BulkOperationResponse {
84
+ return BulkOperationResponseToJSONTyped(json, false);
85
+ }
86
+
87
+ export function BulkOperationResponseToJSONTyped(value?: BulkOperationResponse | null, ignoreDiscriminator: boolean = false): any {
88
+ if (value == null) {
89
+ return value;
90
+ }
91
+
92
+ return {
93
+
94
+ 'succeeded': value['succeeded'],
95
+ 'failed': value['failed'] == null ? undefined : ((value['failed'] as Array<any>).map(BulkItemFailureToJSON)),
96
+ };
97
+ }
98
+