@knowledge-stack/ksapi 1.154.1 → 1.155.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
@@ -15,6 +15,10 @@
15
15
 
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
+ BulkGrantRequest,
19
+ BulkGrantResponse,
20
+ BulkOperationResponse,
21
+ BulkRevokeRequest,
18
22
  CreatePermissionRequest,
19
23
  ErrorResponse,
20
24
  HTTPValidationError,
@@ -26,6 +30,14 @@ import type {
26
30
  UserPermissionOrder,
27
31
  } from '../models/index';
28
32
  import {
33
+ BulkGrantRequestFromJSON,
34
+ BulkGrantRequestToJSON,
35
+ BulkGrantResponseFromJSON,
36
+ BulkGrantResponseToJSON,
37
+ BulkOperationResponseFromJSON,
38
+ BulkOperationResponseToJSON,
39
+ BulkRevokeRequestFromJSON,
40
+ BulkRevokeRequestToJSON,
29
41
  CreatePermissionRequestFromJSON,
30
42
  CreatePermissionRequestToJSON,
31
43
  ErrorResponseFromJSON,
@@ -46,6 +58,14 @@ import {
46
58
  UserPermissionOrderToJSON,
47
59
  } from '../models/index';
48
60
 
61
+ export interface BulkGrantUserPermissionsRequest {
62
+ bulkGrantRequest: BulkGrantRequest;
63
+ }
64
+
65
+ export interface BulkRevokeUserPermissionsRequest {
66
+ bulkRevokeRequest: BulkRevokeRequest;
67
+ }
68
+
49
69
  export interface CreateUserPermissionRequest {
50
70
  createPermissionRequest: CreatePermissionRequest;
51
71
  }
@@ -78,6 +98,54 @@ export interface UpdateUserPermissionRequest {
78
98
  * @interface UserPermissionsApiInterface
79
99
  */
80
100
  export interface UserPermissionsApiInterface {
101
+ /**
102
+ * Creates request options for bulkGrantUserPermissions without sending the request
103
+ * @param {BulkGrantRequest} bulkGrantRequest
104
+ * @throws {RequiredError}
105
+ * @memberof UserPermissionsApiInterface
106
+ */
107
+ bulkGrantUserPermissionsRequestOpts(requestParameters: BulkGrantUserPermissionsRequest): Promise<runtime.RequestOpts>;
108
+
109
+ /**
110
+ * Grant many (user, object, capability) permissions (admin/owner only). Each grant is applied in its own transaction, reporting a per-item outcome keyed on the (user_id, object_id) pair: a missing/trashed object or a user not in the tenant is ``not_found``, hitting the per-user cap is ``permission_limit``, and an already-covered grant is ``subsumed``.
111
+ * @summary Bulk Grant User Permissions Handler
112
+ * @param {BulkGrantRequest} bulkGrantRequest
113
+ * @param {*} [options] Override http request option.
114
+ * @throws {RequiredError}
115
+ * @memberof UserPermissionsApiInterface
116
+ */
117
+ bulkGrantUserPermissionsRaw(requestParameters: BulkGrantUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkGrantResponse>>;
118
+
119
+ /**
120
+ * Grant many (user, object, capability) permissions (admin/owner only). Each grant is applied in its own transaction, reporting a per-item outcome keyed on the (user_id, object_id) pair: a missing/trashed object or a user not in the tenant is ``not_found``, hitting the per-user cap is ``permission_limit``, and an already-covered grant is ``subsumed``.
121
+ * Bulk Grant User Permissions Handler
122
+ */
123
+ bulkGrantUserPermissions(requestParameters: BulkGrantUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkGrantResponse>;
124
+
125
+ /**
126
+ * Creates request options for bulkRevokeUserPermissions without sending the request
127
+ * @param {BulkRevokeRequest} bulkRevokeRequest
128
+ * @throws {RequiredError}
129
+ * @memberof UserPermissionsApiInterface
130
+ */
131
+ bulkRevokeUserPermissionsRequestOpts(requestParameters: BulkRevokeUserPermissionsRequest): Promise<runtime.RequestOpts>;
132
+
133
+ /**
134
+ * Revoke many permissions by their ids (admin/owner only), per item. A permission id not found in the tenant lands in ``failed`` as ``not_found``.
135
+ * @summary Bulk Revoke User Permissions Handler
136
+ * @param {BulkRevokeRequest} bulkRevokeRequest
137
+ * @param {*} [options] Override http request option.
138
+ * @throws {RequiredError}
139
+ * @memberof UserPermissionsApiInterface
140
+ */
141
+ bulkRevokeUserPermissionsRaw(requestParameters: BulkRevokeUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>>;
142
+
143
+ /**
144
+ * Revoke many permissions by their ids (admin/owner only), per item. A permission id not found in the tenant lands in ``failed`` as ``not_found``.
145
+ * Bulk Revoke User Permissions Handler
146
+ */
147
+ bulkRevokeUserPermissions(requestParameters: BulkRevokeUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
148
+
81
149
  /**
82
150
  * Creates request options for createUserPermission without sending the request
83
151
  * @param {CreatePermissionRequest} createPermissionRequest
@@ -199,6 +267,120 @@ export interface UserPermissionsApiInterface {
199
267
  */
200
268
  export class UserPermissionsApi extends runtime.BaseAPI implements UserPermissionsApiInterface {
201
269
 
270
+ /**
271
+ * Creates request options for bulkGrantUserPermissions without sending the request
272
+ */
273
+ async bulkGrantUserPermissionsRequestOpts(requestParameters: BulkGrantUserPermissionsRequest): Promise<runtime.RequestOpts> {
274
+ if (requestParameters['bulkGrantRequest'] == null) {
275
+ throw new runtime.RequiredError(
276
+ 'bulkGrantRequest',
277
+ 'Required parameter "bulkGrantRequest" was null or undefined when calling bulkGrantUserPermissions().'
278
+ );
279
+ }
280
+
281
+ const queryParameters: any = {};
282
+
283
+ const headerParameters: runtime.HTTPHeaders = {};
284
+
285
+ headerParameters['Content-Type'] = 'application/json';
286
+
287
+ if (this.configuration && this.configuration.accessToken) {
288
+ const token = this.configuration.accessToken;
289
+ const tokenString = await token("bearerAuth", []);
290
+
291
+ if (tokenString) {
292
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
293
+ }
294
+ }
295
+
296
+ let urlPath = `/v1/user-permissions/bulk`;
297
+
298
+ return {
299
+ path: urlPath,
300
+ method: 'POST',
301
+ headers: headerParameters,
302
+ query: queryParameters,
303
+ body: BulkGrantRequestToJSON(requestParameters['bulkGrantRequest']),
304
+ };
305
+ }
306
+
307
+ /**
308
+ * Grant many (user, object, capability) permissions (admin/owner only). Each grant is applied in its own transaction, reporting a per-item outcome keyed on the (user_id, object_id) pair: a missing/trashed object or a user not in the tenant is ``not_found``, hitting the per-user cap is ``permission_limit``, and an already-covered grant is ``subsumed``.
309
+ * Bulk Grant User Permissions Handler
310
+ */
311
+ async bulkGrantUserPermissionsRaw(requestParameters: BulkGrantUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkGrantResponse>> {
312
+ const requestOptions = await this.bulkGrantUserPermissionsRequestOpts(requestParameters);
313
+ const response = await this.request(requestOptions, initOverrides);
314
+
315
+ return new runtime.JSONApiResponse(response, (jsonValue) => BulkGrantResponseFromJSON(jsonValue));
316
+ }
317
+
318
+ /**
319
+ * Grant many (user, object, capability) permissions (admin/owner only). Each grant is applied in its own transaction, reporting a per-item outcome keyed on the (user_id, object_id) pair: a missing/trashed object or a user not in the tenant is ``not_found``, hitting the per-user cap is ``permission_limit``, and an already-covered grant is ``subsumed``.
320
+ * Bulk Grant User Permissions Handler
321
+ */
322
+ async bulkGrantUserPermissions(requestParameters: BulkGrantUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkGrantResponse> {
323
+ const response = await this.bulkGrantUserPermissionsRaw(requestParameters, initOverrides);
324
+ return await response.value();
325
+ }
326
+
327
+ /**
328
+ * Creates request options for bulkRevokeUserPermissions without sending the request
329
+ */
330
+ async bulkRevokeUserPermissionsRequestOpts(requestParameters: BulkRevokeUserPermissionsRequest): Promise<runtime.RequestOpts> {
331
+ if (requestParameters['bulkRevokeRequest'] == null) {
332
+ throw new runtime.RequiredError(
333
+ 'bulkRevokeRequest',
334
+ 'Required parameter "bulkRevokeRequest" was null or undefined when calling bulkRevokeUserPermissions().'
335
+ );
336
+ }
337
+
338
+ const queryParameters: any = {};
339
+
340
+ const headerParameters: runtime.HTTPHeaders = {};
341
+
342
+ headerParameters['Content-Type'] = 'application/json';
343
+
344
+ if (this.configuration && this.configuration.accessToken) {
345
+ const token = this.configuration.accessToken;
346
+ const tokenString = await token("bearerAuth", []);
347
+
348
+ if (tokenString) {
349
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
350
+ }
351
+ }
352
+
353
+ let urlPath = `/v1/user-permissions/bulk-delete`;
354
+
355
+ return {
356
+ path: urlPath,
357
+ method: 'POST',
358
+ headers: headerParameters,
359
+ query: queryParameters,
360
+ body: BulkRevokeRequestToJSON(requestParameters['bulkRevokeRequest']),
361
+ };
362
+ }
363
+
364
+ /**
365
+ * Revoke many permissions by their ids (admin/owner only), per item. A permission id not found in the tenant lands in ``failed`` as ``not_found``.
366
+ * Bulk Revoke User Permissions Handler
367
+ */
368
+ async bulkRevokeUserPermissionsRaw(requestParameters: BulkRevokeUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>> {
369
+ const requestOptions = await this.bulkRevokeUserPermissionsRequestOpts(requestParameters);
370
+ const response = await this.request(requestOptions, initOverrides);
371
+
372
+ return new runtime.JSONApiResponse(response, (jsonValue) => BulkOperationResponseFromJSON(jsonValue));
373
+ }
374
+
375
+ /**
376
+ * Revoke many permissions by their ids (admin/owner only), per item. A permission id not found in the tenant lands in ``failed`` as ``not_found``.
377
+ * Bulk Revoke User Permissions Handler
378
+ */
379
+ async bulkRevokeUserPermissions(requestParameters: BulkRevokeUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse> {
380
+ const response = await this.bulkRevokeUserPermissionsRaw(requestParameters, initOverrides);
381
+ return await response.value();
382
+ }
383
+
202
384
  /**
203
385
  * Creates request options for createUserPermission without sending the request
204
386
  */
package/src/apis/index.ts CHANGED
@@ -7,7 +7,9 @@ export * from './ApiConnectionsApi';
7
7
  export * from './ApiKeysApi';
8
8
  export * from './AuditEventsApi';
9
9
  export * from './AuthApi';
10
+ export * from './BulkDeleteApi';
10
11
  export * from './BulkDownloadApi';
12
+ export * from './BulkMoveApi';
11
13
  export * from './ChunkLineagesApi';
12
14
  export * from './ChunksApi';
13
15
  export * from './DataSourcesApi';
@@ -0,0 +1,90 @@
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
+ * Soft-delete the selected folders and documents to Trash.
18
+ * @export
19
+ * @interface BulkDeleteRequest
20
+ */
21
+ export interface BulkDeleteRequest {
22
+ /**
23
+ *
24
+ * @type {Array<string>}
25
+ * @memberof BulkDeleteRequest
26
+ */
27
+ folderIds?: Array<string>;
28
+ /**
29
+ *
30
+ * @type {Array<string>}
31
+ * @memberof BulkDeleteRequest
32
+ */
33
+ documentIds?: Array<string>;
34
+ }
35
+ export const BulkDeleteRequestPropertyValidationAttributesMap: {
36
+ [property: string]: {
37
+ maxLength?: number,
38
+ minLength?: number,
39
+ pattern?: string,
40
+ maximum?: number,
41
+ exclusiveMaximum?: boolean,
42
+ minimum?: number,
43
+ exclusiveMinimum?: boolean,
44
+ multipleOf?: number,
45
+ maxItems?: number,
46
+ minItems?: number,
47
+ uniqueItems?: boolean
48
+ }
49
+ } = {
50
+ }
51
+
52
+
53
+ /**
54
+ * Check if a given object implements the BulkDeleteRequest interface.
55
+ */
56
+ export function instanceOfBulkDeleteRequest(value: object): value is BulkDeleteRequest {
57
+ return true;
58
+ }
59
+
60
+ export function BulkDeleteRequestFromJSON(json: any): BulkDeleteRequest {
61
+ return BulkDeleteRequestFromJSONTyped(json, false);
62
+ }
63
+
64
+ export function BulkDeleteRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkDeleteRequest {
65
+ if (json == null) {
66
+ return json;
67
+ }
68
+ return {
69
+
70
+ 'folderIds': json['folder_ids'] == null ? undefined : json['folder_ids'],
71
+ 'documentIds': json['document_ids'] == null ? undefined : json['document_ids'],
72
+ };
73
+ }
74
+
75
+ export function BulkDeleteRequestToJSON(json: any): BulkDeleteRequest {
76
+ return BulkDeleteRequestToJSONTyped(json, false);
77
+ }
78
+
79
+ export function BulkDeleteRequestToJSONTyped(value?: BulkDeleteRequest | null, ignoreDiscriminator: boolean = false): any {
80
+ if (value == null) {
81
+ return value;
82
+ }
83
+
84
+ return {
85
+
86
+ 'folder_ids': value['folderIds'],
87
+ 'document_ids': value['documentIds'],
88
+ };
89
+ }
90
+
@@ -0,0 +1,65 @@
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
+
16
+ /**
17
+ * Why a single item in a bulk operation was not applied.
18
+ *
19
+ * Every value is produced by a specific, pre-checked gate — an *unexpected*
20
+ * per-item error is deliberately not caught (it surfaces as a 500) rather than
21
+ * hidden behind a vague catch-all.
22
+ * @export
23
+ */
24
+ export const BulkFailureReason = {
25
+ NotFound: 'not_found',
26
+ Forbidden: 'forbidden',
27
+ SystemManaged: 'system_managed',
28
+ Subsumed: 'subsumed',
29
+ Cycle: 'cycle',
30
+ Sealed: 'sealed',
31
+ CheckedOut: 'checked_out',
32
+ NameConflict: 'name_conflict',
33
+ InProgressWorkflow: 'in_progress_workflow',
34
+ PermissionLimit: 'permission_limit'
35
+ } as const;
36
+ export type BulkFailureReason = typeof BulkFailureReason[keyof typeof BulkFailureReason];
37
+
38
+
39
+ export function instanceOfBulkFailureReason(value: any): boolean {
40
+ for (const key in BulkFailureReason) {
41
+ if (Object.prototype.hasOwnProperty.call(BulkFailureReason, key)) {
42
+ if (BulkFailureReason[key as keyof typeof BulkFailureReason] === value) {
43
+ return true;
44
+ }
45
+ }
46
+ }
47
+ return false;
48
+ }
49
+
50
+ export function BulkFailureReasonFromJSON(json: any): BulkFailureReason {
51
+ return BulkFailureReasonFromJSONTyped(json, false);
52
+ }
53
+
54
+ export function BulkFailureReasonFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkFailureReason {
55
+ return json as BulkFailureReason;
56
+ }
57
+
58
+ export function BulkFailureReasonToJSON(value?: BulkFailureReason | null): any {
59
+ return value as any;
60
+ }
61
+
62
+ export function BulkFailureReasonToJSONTyped(value: any, ignoreDiscriminator: boolean): BulkFailureReason {
63
+ return value as BulkFailureReason;
64
+ }
65
+
@@ -0,0 +1,119 @@
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
+ * One requested grant: a capability on an object (PDO id) for a user.
26
+ * @export
27
+ * @interface BulkGrantItem
28
+ */
29
+ export interface BulkGrantItem {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof BulkGrantItem
34
+ */
35
+ userId: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof BulkGrantItem
40
+ */
41
+ objectId: string;
42
+ /**
43
+ *
44
+ * @type {PermissionCapability}
45
+ * @memberof BulkGrantItem
46
+ */
47
+ capability: PermissionCapability;
48
+ /**
49
+ *
50
+ * @type {boolean}
51
+ * @memberof BulkGrantItem
52
+ */
53
+ canApprove?: boolean;
54
+ }
55
+
56
+
57
+ export const BulkGrantItemPropertyValidationAttributesMap: {
58
+ [property: string]: {
59
+ maxLength?: number,
60
+ minLength?: number,
61
+ pattern?: string,
62
+ maximum?: number,
63
+ exclusiveMaximum?: boolean,
64
+ minimum?: number,
65
+ exclusiveMinimum?: boolean,
66
+ multipleOf?: number,
67
+ maxItems?: number,
68
+ minItems?: number,
69
+ uniqueItems?: boolean
70
+ }
71
+ } = {
72
+ }
73
+
74
+
75
+ /**
76
+ * Check if a given object implements the BulkGrantItem interface.
77
+ */
78
+ export function instanceOfBulkGrantItem(value: object): value is BulkGrantItem {
79
+ if (!('userId' in value) || value['userId'] === undefined) return false;
80
+ if (!('objectId' in value) || value['objectId'] === undefined) return false;
81
+ if (!('capability' in value) || value['capability'] === undefined) return false;
82
+ return true;
83
+ }
84
+
85
+ export function BulkGrantItemFromJSON(json: any): BulkGrantItem {
86
+ return BulkGrantItemFromJSONTyped(json, false);
87
+ }
88
+
89
+ export function BulkGrantItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkGrantItem {
90
+ if (json == null) {
91
+ return json;
92
+ }
93
+ return {
94
+
95
+ 'userId': json['user_id'],
96
+ 'objectId': json['object_id'],
97
+ 'capability': PermissionCapabilityFromJSON(json['capability']),
98
+ 'canApprove': json['can_approve'] == null ? undefined : json['can_approve'],
99
+ };
100
+ }
101
+
102
+ export function BulkGrantItemToJSON(json: any): BulkGrantItem {
103
+ return BulkGrantItemToJSONTyped(json, false);
104
+ }
105
+
106
+ export function BulkGrantItemToJSONTyped(value?: BulkGrantItem | null, ignoreDiscriminator: boolean = false): any {
107
+ if (value == null) {
108
+ return value;
109
+ }
110
+
111
+ return {
112
+
113
+ 'user_id': value['userId'],
114
+ 'object_id': value['objectId'],
115
+ 'capability': PermissionCapabilityToJSON(value['capability']),
116
+ 'can_approve': value['canApprove'],
117
+ };
118
+ }
119
+
@@ -0,0 +1,111 @@
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 grant that could not be created, keyed on its (user, object) pair.
26
+ * @export
27
+ * @interface BulkGrantItemFailure
28
+ */
29
+ export interface BulkGrantItemFailure {
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof BulkGrantItemFailure
34
+ */
35
+ userId: string;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof BulkGrantItemFailure
40
+ */
41
+ objectId: string;
42
+ /**
43
+ *
44
+ * @type {BulkFailureReason}
45
+ * @memberof BulkGrantItemFailure
46
+ */
47
+ reason: BulkFailureReason;
48
+ }
49
+
50
+
51
+ export const BulkGrantItemFailurePropertyValidationAttributesMap: {
52
+ [property: string]: {
53
+ maxLength?: number,
54
+ minLength?: number,
55
+ pattern?: string,
56
+ maximum?: number,
57
+ exclusiveMaximum?: boolean,
58
+ minimum?: number,
59
+ exclusiveMinimum?: boolean,
60
+ multipleOf?: number,
61
+ maxItems?: number,
62
+ minItems?: number,
63
+ uniqueItems?: boolean
64
+ }
65
+ } = {
66
+ }
67
+
68
+
69
+ /**
70
+ * Check if a given object implements the BulkGrantItemFailure interface.
71
+ */
72
+ export function instanceOfBulkGrantItemFailure(value: object): value is BulkGrantItemFailure {
73
+ if (!('userId' in value) || value['userId'] === undefined) return false;
74
+ if (!('objectId' in value) || value['objectId'] === undefined) return false;
75
+ if (!('reason' in value) || value['reason'] === undefined) return false;
76
+ return true;
77
+ }
78
+
79
+ export function BulkGrantItemFailureFromJSON(json: any): BulkGrantItemFailure {
80
+ return BulkGrantItemFailureFromJSONTyped(json, false);
81
+ }
82
+
83
+ export function BulkGrantItemFailureFromJSONTyped(json: any, ignoreDiscriminator: boolean): BulkGrantItemFailure {
84
+ if (json == null) {
85
+ return json;
86
+ }
87
+ return {
88
+
89
+ 'userId': json['user_id'],
90
+ 'objectId': json['object_id'],
91
+ 'reason': BulkFailureReasonFromJSON(json['reason']),
92
+ };
93
+ }
94
+
95
+ export function BulkGrantItemFailureToJSON(json: any): BulkGrantItemFailure {
96
+ return BulkGrantItemFailureToJSONTyped(json, false);
97
+ }
98
+
99
+ export function BulkGrantItemFailureToJSONTyped(value?: BulkGrantItemFailure | null, ignoreDiscriminator: boolean = false): any {
100
+ if (value == null) {
101
+ return value;
102
+ }
103
+
104
+ return {
105
+
106
+ 'user_id': value['userId'],
107
+ 'object_id': value['objectId'],
108
+ 'reason': BulkFailureReasonToJSON(value['reason']),
109
+ };
110
+ }
111
+