@knowledge-stack/ksapi 1.153.0 → 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 (138) 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/DocumentsApi.d.ts +6 -6
  8. package/dist/apis/DocumentsApi.js +6 -6
  9. package/dist/apis/TrashApi.d.ts +77 -1
  10. package/dist/apis/TrashApi.js +98 -0
  11. package/dist/apis/UserPermissionsApi.d.ts +77 -1
  12. package/dist/apis/UserPermissionsApi.js +98 -0
  13. package/dist/apis/index.d.ts +2 -0
  14. package/dist/apis/index.js +2 -0
  15. package/dist/esm/apis/BulkDeleteApi.d.ts +64 -0
  16. package/dist/esm/apis/BulkDeleteApi.js +78 -0
  17. package/dist/esm/apis/BulkMoveApi.d.ts +64 -0
  18. package/dist/esm/apis/BulkMoveApi.js +78 -0
  19. package/dist/esm/apis/DocumentsApi.d.ts +6 -6
  20. package/dist/esm/apis/DocumentsApi.js +6 -6
  21. package/dist/esm/apis/TrashApi.d.ts +77 -1
  22. package/dist/esm/apis/TrashApi.js +99 -1
  23. package/dist/esm/apis/UserPermissionsApi.d.ts +77 -1
  24. package/dist/esm/apis/UserPermissionsApi.js +99 -1
  25. package/dist/esm/apis/index.d.ts +2 -0
  26. package/dist/esm/apis/index.js +2 -0
  27. package/dist/esm/models/BulkDeleteRequest.d.ts +53 -0
  28. package/dist/esm/models/BulkDeleteRequest.js +44 -0
  29. package/dist/esm/models/BulkFailureReason.d.ts +37 -0
  30. package/dist/esm/models/BulkFailureReason.js +55 -0
  31. package/dist/esm/models/BulkGrantItem.d.ts +66 -0
  32. package/dist/esm/models/BulkGrantItem.js +55 -0
  33. package/dist/esm/models/BulkGrantItemFailure.d.ts +60 -0
  34. package/dist/esm/models/BulkGrantItemFailure.js +53 -0
  35. package/dist/esm/models/BulkGrantRequest.d.ts +54 -0
  36. package/dist/esm/models/BulkGrantRequest.js +47 -0
  37. package/dist/esm/models/BulkGrantResponse.d.ts +55 -0
  38. package/dist/esm/models/BulkGrantResponse.js +46 -0
  39. package/dist/esm/models/BulkGrantSuccess.d.ts +72 -0
  40. package/dist/esm/models/BulkGrantSuccess.js +61 -0
  41. package/dist/esm/models/BulkItemFailure.d.ts +54 -0
  42. package/dist/esm/models/BulkItemFailure.js +49 -0
  43. package/dist/esm/models/BulkMoveRequest.d.ts +59 -0
  44. package/dist/esm/models/BulkMoveRequest.js +48 -0
  45. package/dist/esm/models/BulkOperationResponse.d.ts +54 -0
  46. package/dist/esm/models/BulkOperationResponse.js +45 -0
  47. package/dist/esm/models/BulkRevokeRequest.d.ts +53 -0
  48. package/dist/esm/models/BulkRevokeRequest.js +46 -0
  49. package/dist/esm/models/BulkTrashRequest.d.ts +47 -0
  50. package/dist/esm/models/BulkTrashRequest.js +42 -0
  51. package/dist/esm/models/CreateUploadRequest.d.ts +6 -0
  52. package/dist/esm/models/CreateUploadRequest.js +2 -0
  53. package/dist/esm/models/DocumentVersionMetadata.d.ts +18 -0
  54. package/dist/esm/models/DocumentVersionMetadata.js +6 -0
  55. package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +18 -0
  56. package/dist/esm/models/DocumentVersionMetadataUpdate.js +6 -0
  57. package/dist/esm/models/ErrorResponse.d.ts +1 -0
  58. package/dist/esm/models/ErrorResponse.js +1 -0
  59. package/dist/esm/models/index.d.ts +12 -0
  60. package/dist/esm/models/index.js +12 -0
  61. package/dist/models/BulkDeleteRequest.d.ts +53 -0
  62. package/dist/models/BulkDeleteRequest.js +52 -0
  63. package/dist/models/BulkFailureReason.d.ts +37 -0
  64. package/dist/models/BulkFailureReason.js +63 -0
  65. package/dist/models/BulkGrantItem.d.ts +66 -0
  66. package/dist/models/BulkGrantItem.js +63 -0
  67. package/dist/models/BulkGrantItemFailure.d.ts +60 -0
  68. package/dist/models/BulkGrantItemFailure.js +61 -0
  69. package/dist/models/BulkGrantRequest.d.ts +54 -0
  70. package/dist/models/BulkGrantRequest.js +55 -0
  71. package/dist/models/BulkGrantResponse.d.ts +55 -0
  72. package/dist/models/BulkGrantResponse.js +54 -0
  73. package/dist/models/BulkGrantSuccess.d.ts +72 -0
  74. package/dist/models/BulkGrantSuccess.js +69 -0
  75. package/dist/models/BulkItemFailure.d.ts +54 -0
  76. package/dist/models/BulkItemFailure.js +57 -0
  77. package/dist/models/BulkMoveRequest.d.ts +59 -0
  78. package/dist/models/BulkMoveRequest.js +56 -0
  79. package/dist/models/BulkOperationResponse.d.ts +54 -0
  80. package/dist/models/BulkOperationResponse.js +53 -0
  81. package/dist/models/BulkRevokeRequest.d.ts +53 -0
  82. package/dist/models/BulkRevokeRequest.js +54 -0
  83. package/dist/models/BulkTrashRequest.d.ts +47 -0
  84. package/dist/models/BulkTrashRequest.js +50 -0
  85. package/dist/models/CreateUploadRequest.d.ts +6 -0
  86. package/dist/models/CreateUploadRequest.js +2 -0
  87. package/dist/models/DocumentVersionMetadata.d.ts +18 -0
  88. package/dist/models/DocumentVersionMetadata.js +6 -0
  89. package/dist/models/DocumentVersionMetadataUpdate.d.ts +18 -0
  90. package/dist/models/DocumentVersionMetadataUpdate.js +6 -0
  91. package/dist/models/ErrorResponse.d.ts +1 -0
  92. package/dist/models/ErrorResponse.js +1 -0
  93. package/dist/models/index.d.ts +12 -0
  94. package/dist/models/index.js +12 -0
  95. package/docs/BulkDeleteApi.md +84 -0
  96. package/docs/BulkDeleteRequest.md +37 -0
  97. package/docs/BulkFailureReason.md +33 -0
  98. package/docs/BulkGrantItem.md +41 -0
  99. package/docs/BulkGrantItemFailure.md +39 -0
  100. package/docs/BulkGrantRequest.md +37 -0
  101. package/docs/BulkGrantResponse.md +37 -0
  102. package/docs/BulkGrantSuccess.md +43 -0
  103. package/docs/BulkItemFailure.md +37 -0
  104. package/docs/BulkMoveApi.md +84 -0
  105. package/docs/BulkMoveRequest.md +39 -0
  106. package/docs/BulkOperationResponse.md +37 -0
  107. package/docs/BulkRevokeRequest.md +37 -0
  108. package/docs/BulkTrashRequest.md +35 -0
  109. package/docs/CreateUploadRequest.md +2 -0
  110. package/docs/DocumentVersionMetadata.md +6 -0
  111. package/docs/DocumentVersionMetadataUpdate.md +6 -0
  112. package/docs/DocumentsApi.md +7 -7
  113. package/docs/TrashApi.md +152 -0
  114. package/docs/UserPermissionsApi.md +152 -0
  115. package/package.json +1 -1
  116. package/src/apis/BulkDeleteApi.ts +133 -0
  117. package/src/apis/BulkMoveApi.ts +133 -0
  118. package/src/apis/DocumentsApi.ts +14 -14
  119. package/src/apis/TrashApi.ts +176 -0
  120. package/src/apis/UserPermissionsApi.ts +182 -0
  121. package/src/apis/index.ts +2 -0
  122. package/src/models/BulkDeleteRequest.ts +90 -0
  123. package/src/models/BulkFailureReason.ts +65 -0
  124. package/src/models/BulkGrantItem.ts +119 -0
  125. package/src/models/BulkGrantItemFailure.ts +111 -0
  126. package/src/models/BulkGrantRequest.ts +99 -0
  127. package/src/models/BulkGrantResponse.ts +105 -0
  128. package/src/models/BulkGrantSuccess.ts +129 -0
  129. package/src/models/BulkItemFailure.ts +102 -0
  130. package/src/models/BulkMoveRequest.ts +99 -0
  131. package/src/models/BulkOperationResponse.ts +98 -0
  132. package/src/models/BulkRevokeRequest.ts +91 -0
  133. package/src/models/BulkTrashRequest.ts +82 -0
  134. package/src/models/CreateUploadRequest.ts +8 -0
  135. package/src/models/DocumentVersionMetadata.ts +24 -0
  136. package/src/models/DocumentVersionMetadataUpdate.ts +24 -0
  137. package/src/models/ErrorResponse.ts +1 -0
  138. package/src/models/index.ts +12 -0
@@ -0,0 +1,78 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { BulkMoveRequestToJSON, BulkOperationResponseFromJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class BulkMoveApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates request options for bulkMove without sending the request
31
+ */
32
+ bulkMoveRequestOpts(requestParameters) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (requestParameters['bulkMoveRequest'] == null) {
35
+ throw new runtime.RequiredError('bulkMoveRequest', 'Required parameter "bulkMoveRequest" was null or undefined when calling bulkMove().');
36
+ }
37
+ const queryParameters = {};
38
+ const headerParameters = {};
39
+ headerParameters['Content-Type'] = 'application/json';
40
+ if (this.configuration && this.configuration.accessToken) {
41
+ const token = this.configuration.accessToken;
42
+ const tokenString = yield token("bearerAuth", []);
43
+ if (tokenString) {
44
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
45
+ }
46
+ }
47
+ let urlPath = `/v1/bulk-move`;
48
+ return {
49
+ path: urlPath,
50
+ method: 'POST',
51
+ headers: headerParameters,
52
+ query: queryParameters,
53
+ body: BulkMoveRequestToJSON(requestParameters['bulkMoveRequest']),
54
+ };
55
+ });
56
+ }
57
+ /**
58
+ * Move the selected folders and documents into ``target_folder_id``. The destination is checked once up front — an invalid target returns ``400`` and a target the caller cannot write returns ``403``, before any item moves. Each source then moves in its own transaction; items the caller may not write, that are sealed, held by another user, that would form a cycle, hit a name collision, or sit inside another selected folder land in ``failed`` with a reason while the rest succeed.
59
+ * Bulk Move Handler
60
+ */
61
+ bulkMoveRaw(requestParameters, initOverrides) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const requestOptions = yield this.bulkMoveRequestOpts(requestParameters);
64
+ const response = yield this.request(requestOptions, initOverrides);
65
+ return new runtime.JSONApiResponse(response, (jsonValue) => BulkOperationResponseFromJSON(jsonValue));
66
+ });
67
+ }
68
+ /**
69
+ * Move the selected folders and documents into ``target_folder_id``. The destination is checked once up front — an invalid target returns ``400`` and a target the caller cannot write returns ``403``, before any item moves. Each source then moves in its own transaction; items the caller may not write, that are sealed, held by another user, that would form a cycle, hit a name collision, or sit inside another selected folder land in ``failed`` with a reason while the rest succeed.
70
+ * Bulk Move Handler
71
+ */
72
+ bulkMove(requestParameters, initOverrides) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const response = yield this.bulkMoveRaw(requestParameters, initOverrides);
75
+ return yield response.value();
76
+ });
77
+ }
78
+ }
@@ -41,13 +41,13 @@ export interface IngestDocumentRequest {
41
41
  file: Blob;
42
42
  pathPartId: string;
43
43
  name?: string | null;
44
+ tagIds?: Array<string>;
45
+ idempotencyKey?: string | null;
44
46
  ingestionMode?: IngestionMode;
45
47
  chunkType?: ChunkType;
46
48
  secondaryTaxonomy?: ImageTaxonomy;
47
49
  pageDpi?: number;
48
50
  workflowRunId?: string | null;
49
- tagIds?: Array<string>;
50
- idempotencyKey?: string | null;
51
51
  workflowDefinitionId?: string | null;
52
52
  }
53
53
  export interface IngestDocumentVersionRequest {
@@ -272,13 +272,13 @@ export interface DocumentsApiInterface {
272
272
  * @param {Blob} file
273
273
  * @param {string} pathPartId Parent path part ID (must be a FOLDER type)
274
274
  * @param {string} [name] Document name (defaults to filename)
275
+ * @param {Array<string>} [tagIds] Tag IDs applied to the created document.
276
+ * @param {string} [idempotencyKey] Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409.
275
277
  * @param {IngestionMode} [ingestionMode]
276
278
  * @param {ChunkType} [chunkType]
277
279
  * @param {ImageTaxonomy} [secondaryTaxonomy]
278
280
  * @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
279
281
  * @param {string} [workflowRunId] Workflow run context for assumed agent uploads.
280
- * @param {Array<string>} [tagIds] Tag IDs applied to the created document.
281
- * @param {string} [idempotencyKey] Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409.
282
282
  * @param {string} [workflowDefinitionId] Workflow definition context for assumed agent uploads.
283
283
  * @throws {RequiredError}
284
284
  * @memberof DocumentsApiInterface
@@ -290,13 +290,13 @@ export interface DocumentsApiInterface {
290
290
  * @param {Blob} file
291
291
  * @param {string} pathPartId Parent path part ID (must be a FOLDER type)
292
292
  * @param {string} [name] Document name (defaults to filename)
293
+ * @param {Array<string>} [tagIds] Tag IDs applied to the created document.
294
+ * @param {string} [idempotencyKey] Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409.
293
295
  * @param {IngestionMode} [ingestionMode]
294
296
  * @param {ChunkType} [chunkType]
295
297
  * @param {ImageTaxonomy} [secondaryTaxonomy]
296
298
  * @param {number} [pageDpi] DPI for PDF page screenshots (default 72, min 36, max 216).
297
299
  * @param {string} [workflowRunId] Workflow run context for assumed agent uploads.
298
- * @param {Array<string>} [tagIds] Tag IDs applied to the created document.
299
- * @param {string} [idempotencyKey] Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409.
300
300
  * @param {string} [workflowDefinitionId] Workflow definition context for assumed agent uploads.
301
301
  * @param {*} [options] Override http request option.
302
302
  * @throws {RequiredError}
@@ -463,6 +463,12 @@ export class DocumentsApi extends runtime.BaseAPI {
463
463
  if (requestParameters['name'] != null) {
464
464
  formParams.append('name', requestParameters['name']);
465
465
  }
466
+ if (requestParameters['tagIds'] != null) {
467
+ formParams.append('tag_ids', requestParameters['tagIds'].join(runtime.COLLECTION_FORMATS["csv"]));
468
+ }
469
+ if (requestParameters['idempotencyKey'] != null) {
470
+ formParams.append('idempotency_key', requestParameters['idempotencyKey']);
471
+ }
466
472
  if (requestParameters['ingestionMode'] != null) {
467
473
  formParams.append('ingestion_mode', requestParameters['ingestionMode']);
468
474
  }
@@ -478,12 +484,6 @@ export class DocumentsApi extends runtime.BaseAPI {
478
484
  if (requestParameters['workflowRunId'] != null) {
479
485
  formParams.append('workflow_run_id', requestParameters['workflowRunId']);
480
486
  }
481
- if (requestParameters['tagIds'] != null) {
482
- formParams.append('tag_ids', requestParameters['tagIds'].join(runtime.COLLECTION_FORMATS["csv"]));
483
- }
484
- if (requestParameters['idempotencyKey'] != null) {
485
- formParams.append('idempotency_key', requestParameters['idempotencyKey']);
486
- }
487
487
  if (requestParameters['workflowDefinitionId'] != null) {
488
488
  formParams.append('workflow_definition_id', requestParameters['workflowDefinitionId']);
489
489
  }
@@ -10,7 +10,13 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { PaginatedResponseTrashItemResponse, PartType, PathOrder, SortDirection } from '../models/index';
13
+ import type { BulkOperationResponse, BulkTrashRequest, PaginatedResponseTrashItemResponse, PartType, PathOrder, SortDirection } from '../models/index';
14
+ export interface BulkPermanentlyDeleteTrashRequest {
15
+ bulkTrashRequest: BulkTrashRequest;
16
+ }
17
+ export interface BulkRestoreTrashRequest {
18
+ bulkTrashRequest: BulkTrashRequest;
19
+ }
14
20
  export interface ListTrashRequest {
15
21
  sortOrder?: PathOrder;
16
22
  sortDir?: SortDirection;
@@ -37,6 +43,48 @@ export interface RestoreTrashItemRequest {
37
43
  * @interface TrashApiInterface
38
44
  */
39
45
  export interface TrashApiInterface {
46
+ /**
47
+ * Creates request options for bulkPermanentlyDeleteTrash without sending the request
48
+ * @param {BulkTrashRequest} bulkTrashRequest
49
+ * @throws {RequiredError}
50
+ * @memberof TrashApiInterface
51
+ */
52
+ bulkPermanentlyDeleteTrashRequestOpts(requestParameters: BulkPermanentlyDeleteTrashRequest): Promise<runtime.RequestOpts>;
53
+ /**
54
+ * Permanently delete the selected trashed objects (by PDO id), per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; the rest are hard-deleted and their Qdrant points purged.
55
+ * @summary Bulk Permanently Delete Trash Handler
56
+ * @param {BulkTrashRequest} bulkTrashRequest
57
+ * @param {*} [options] Override http request option.
58
+ * @throws {RequiredError}
59
+ * @memberof TrashApiInterface
60
+ */
61
+ bulkPermanentlyDeleteTrashRaw(requestParameters: BulkPermanentlyDeleteTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>>;
62
+ /**
63
+ * Permanently delete the selected trashed objects (by PDO id), per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; the rest are hard-deleted and their Qdrant points purged.
64
+ * Bulk Permanently Delete Trash Handler
65
+ */
66
+ bulkPermanentlyDeleteTrash(requestParameters: BulkPermanentlyDeleteTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
67
+ /**
68
+ * Creates request options for bulkRestoreTrash without sending the request
69
+ * @param {BulkTrashRequest} bulkTrashRequest
70
+ * @throws {RequiredError}
71
+ * @memberof TrashApiInterface
72
+ */
73
+ bulkRestoreTrashRequestOpts(requestParameters: BulkRestoreTrashRequest): Promise<runtime.RequestOpts>;
74
+ /**
75
+ * Restore the selected trashed objects (by PDO id), reporting per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; a live name collision at the original location that auto-rename cannot resolve lands as ``name_conflict``.
76
+ * @summary Bulk Restore Trash Handler
77
+ * @param {BulkTrashRequest} bulkTrashRequest
78
+ * @param {*} [options] Override http request option.
79
+ * @throws {RequiredError}
80
+ * @memberof TrashApiInterface
81
+ */
82
+ bulkRestoreTrashRaw(requestParameters: BulkRestoreTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>>;
83
+ /**
84
+ * Restore the selected trashed objects (by PDO id), reporting per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; a live name collision at the original location that auto-rename cannot resolve lands as ``name_conflict``.
85
+ * Bulk Restore Trash Handler
86
+ */
87
+ bulkRestoreTrash(requestParameters: BulkRestoreTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
40
88
  /**
41
89
  * Creates request options for listTrash without sending the request
42
90
  * @param {PathOrder} [sortOrder] Sort order (default: LOGICAL &#x3D; deletion recency)
@@ -125,6 +173,34 @@ export interface TrashApiInterface {
125
173
  *
126
174
  */
127
175
  export declare class TrashApi extends runtime.BaseAPI implements TrashApiInterface {
176
+ /**
177
+ * Creates request options for bulkPermanentlyDeleteTrash without sending the request
178
+ */
179
+ bulkPermanentlyDeleteTrashRequestOpts(requestParameters: BulkPermanentlyDeleteTrashRequest): Promise<runtime.RequestOpts>;
180
+ /**
181
+ * Permanently delete the selected trashed objects (by PDO id), per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; the rest are hard-deleted and their Qdrant points purged.
182
+ * Bulk Permanently Delete Trash Handler
183
+ */
184
+ bulkPermanentlyDeleteTrashRaw(requestParameters: BulkPermanentlyDeleteTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>>;
185
+ /**
186
+ * Permanently delete the selected trashed objects (by PDO id), per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; the rest are hard-deleted and their Qdrant points purged.
187
+ * Bulk Permanently Delete Trash Handler
188
+ */
189
+ bulkPermanentlyDeleteTrash(requestParameters: BulkPermanentlyDeleteTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
190
+ /**
191
+ * Creates request options for bulkRestoreTrash without sending the request
192
+ */
193
+ bulkRestoreTrashRequestOpts(requestParameters: BulkRestoreTrashRequest): Promise<runtime.RequestOpts>;
194
+ /**
195
+ * Restore the selected trashed objects (by PDO id), reporting per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; a live name collision at the original location that auto-rename cannot resolve lands as ``name_conflict``.
196
+ * Bulk Restore Trash Handler
197
+ */
198
+ bulkRestoreTrashRaw(requestParameters: BulkRestoreTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>>;
199
+ /**
200
+ * Restore the selected trashed objects (by PDO id), reporting per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; a live name collision at the original location that auto-rename cannot resolve lands as ``name_conflict``.
201
+ * Bulk Restore Trash Handler
202
+ */
203
+ bulkRestoreTrash(requestParameters: BulkRestoreTrashRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
128
204
  /**
129
205
  * Creates request options for listTrash without sending the request
130
206
  */
@@ -21,11 +21,109 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { PaginatedResponseTrashItemResponseFromJSON, } from '../models/index';
24
+ import { BulkOperationResponseFromJSON, BulkTrashRequestToJSON, PaginatedResponseTrashItemResponseFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class TrashApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates request options for bulkPermanentlyDeleteTrash without sending the request
31
+ */
32
+ bulkPermanentlyDeleteTrashRequestOpts(requestParameters) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (requestParameters['bulkTrashRequest'] == null) {
35
+ throw new runtime.RequiredError('bulkTrashRequest', 'Required parameter "bulkTrashRequest" was null or undefined when calling bulkPermanentlyDeleteTrash().');
36
+ }
37
+ const queryParameters = {};
38
+ const headerParameters = {};
39
+ headerParameters['Content-Type'] = 'application/json';
40
+ if (this.configuration && this.configuration.accessToken) {
41
+ const token = this.configuration.accessToken;
42
+ const tokenString = yield token("bearerAuth", []);
43
+ if (tokenString) {
44
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
45
+ }
46
+ }
47
+ let urlPath = `/v1/trash/bulk-delete`;
48
+ return {
49
+ path: urlPath,
50
+ method: 'POST',
51
+ headers: headerParameters,
52
+ query: queryParameters,
53
+ body: BulkTrashRequestToJSON(requestParameters['bulkTrashRequest']),
54
+ };
55
+ });
56
+ }
57
+ /**
58
+ * Permanently delete the selected trashed objects (by PDO id), per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; the rest are hard-deleted and their Qdrant points purged.
59
+ * Bulk Permanently Delete Trash Handler
60
+ */
61
+ bulkPermanentlyDeleteTrashRaw(requestParameters, initOverrides) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const requestOptions = yield this.bulkPermanentlyDeleteTrashRequestOpts(requestParameters);
64
+ const response = yield this.request(requestOptions, initOverrides);
65
+ return new runtime.JSONApiResponse(response, (jsonValue) => BulkOperationResponseFromJSON(jsonValue));
66
+ });
67
+ }
68
+ /**
69
+ * Permanently delete the selected trashed objects (by PDO id), per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; the rest are hard-deleted and their Qdrant points purged.
70
+ * Bulk Permanently Delete Trash Handler
71
+ */
72
+ bulkPermanentlyDeleteTrash(requestParameters, initOverrides) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const response = yield this.bulkPermanentlyDeleteTrashRaw(requestParameters, initOverrides);
75
+ return yield response.value();
76
+ });
77
+ }
78
+ /**
79
+ * Creates request options for bulkRestoreTrash without sending the request
80
+ */
81
+ bulkRestoreTrashRequestOpts(requestParameters) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ if (requestParameters['bulkTrashRequest'] == null) {
84
+ throw new runtime.RequiredError('bulkTrashRequest', 'Required parameter "bulkTrashRequest" was null or undefined when calling bulkRestoreTrash().');
85
+ }
86
+ const queryParameters = {};
87
+ const headerParameters = {};
88
+ headerParameters['Content-Type'] = 'application/json';
89
+ if (this.configuration && this.configuration.accessToken) {
90
+ const token = this.configuration.accessToken;
91
+ const tokenString = yield token("bearerAuth", []);
92
+ if (tokenString) {
93
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
94
+ }
95
+ }
96
+ let urlPath = `/v1/trash/bulk-restore`;
97
+ return {
98
+ path: urlPath,
99
+ method: 'POST',
100
+ headers: headerParameters,
101
+ query: queryParameters,
102
+ body: BulkTrashRequestToJSON(requestParameters['bulkTrashRequest']),
103
+ };
104
+ });
105
+ }
106
+ /**
107
+ * Restore the selected trashed objects (by PDO id), reporting per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; a live name collision at the original location that auto-rename cannot resolve lands as ``name_conflict``.
108
+ * Bulk Restore Trash Handler
109
+ */
110
+ bulkRestoreTrashRaw(requestParameters, initOverrides) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ const requestOptions = yield this.bulkRestoreTrashRequestOpts(requestParameters);
113
+ const response = yield this.request(requestOptions, initOverrides);
114
+ return new runtime.JSONApiResponse(response, (jsonValue) => BulkOperationResponseFromJSON(jsonValue));
115
+ });
116
+ }
117
+ /**
118
+ * Restore the selected trashed objects (by PDO id), reporting per item. An object not visible in the caller\'s trash scope lands in ``failed`` as ``not_found``; a live name collision at the original location that auto-rename cannot resolve lands as ``name_conflict``.
119
+ * Bulk Restore Trash Handler
120
+ */
121
+ bulkRestoreTrash(requestParameters, initOverrides) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const response = yield this.bulkRestoreTrashRaw(requestParameters, initOverrides);
124
+ return yield response.value();
125
+ });
126
+ }
29
127
  /**
30
128
  * Creates request options for listTrash without sending the request
31
129
  */
@@ -10,7 +10,13 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { CreatePermissionRequest, PaginatedResponsePermissionResponse, PermissionCapability, PermissionResponse, SortDirection, UpdatePermissionRequest, UserPermissionOrder } from '../models/index';
13
+ import type { BulkGrantRequest, BulkGrantResponse, BulkOperationResponse, BulkRevokeRequest, CreatePermissionRequest, PaginatedResponsePermissionResponse, PermissionCapability, PermissionResponse, SortDirection, UpdatePermissionRequest, UserPermissionOrder } from '../models/index';
14
+ export interface BulkGrantUserPermissionsRequest {
15
+ bulkGrantRequest: BulkGrantRequest;
16
+ }
17
+ export interface BulkRevokeUserPermissionsRequest {
18
+ bulkRevokeRequest: BulkRevokeRequest;
19
+ }
14
20
  export interface CreateUserPermissionRequest {
15
21
  createPermissionRequest: CreatePermissionRequest;
16
22
  }
@@ -39,6 +45,48 @@ export interface UpdateUserPermissionRequest {
39
45
  * @interface UserPermissionsApiInterface
40
46
  */
41
47
  export interface UserPermissionsApiInterface {
48
+ /**
49
+ * Creates request options for bulkGrantUserPermissions without sending the request
50
+ * @param {BulkGrantRequest} bulkGrantRequest
51
+ * @throws {RequiredError}
52
+ * @memberof UserPermissionsApiInterface
53
+ */
54
+ bulkGrantUserPermissionsRequestOpts(requestParameters: BulkGrantUserPermissionsRequest): Promise<runtime.RequestOpts>;
55
+ /**
56
+ * 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``.
57
+ * @summary Bulk Grant User Permissions Handler
58
+ * @param {BulkGrantRequest} bulkGrantRequest
59
+ * @param {*} [options] Override http request option.
60
+ * @throws {RequiredError}
61
+ * @memberof UserPermissionsApiInterface
62
+ */
63
+ bulkGrantUserPermissionsRaw(requestParameters: BulkGrantUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkGrantResponse>>;
64
+ /**
65
+ * 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``.
66
+ * Bulk Grant User Permissions Handler
67
+ */
68
+ bulkGrantUserPermissions(requestParameters: BulkGrantUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkGrantResponse>;
69
+ /**
70
+ * Creates request options for bulkRevokeUserPermissions without sending the request
71
+ * @param {BulkRevokeRequest} bulkRevokeRequest
72
+ * @throws {RequiredError}
73
+ * @memberof UserPermissionsApiInterface
74
+ */
75
+ bulkRevokeUserPermissionsRequestOpts(requestParameters: BulkRevokeUserPermissionsRequest): Promise<runtime.RequestOpts>;
76
+ /**
77
+ * 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``.
78
+ * @summary Bulk Revoke User Permissions Handler
79
+ * @param {BulkRevokeRequest} bulkRevokeRequest
80
+ * @param {*} [options] Override http request option.
81
+ * @throws {RequiredError}
82
+ * @memberof UserPermissionsApiInterface
83
+ */
84
+ bulkRevokeUserPermissionsRaw(requestParameters: BulkRevokeUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>>;
85
+ /**
86
+ * 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``.
87
+ * Bulk Revoke User Permissions Handler
88
+ */
89
+ bulkRevokeUserPermissions(requestParameters: BulkRevokeUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
42
90
  /**
43
91
  * Creates request options for createUserPermission without sending the request
44
92
  * @param {CreatePermissionRequest} createPermissionRequest
@@ -146,6 +194,34 @@ export interface UserPermissionsApiInterface {
146
194
  *
147
195
  */
148
196
  export declare class UserPermissionsApi extends runtime.BaseAPI implements UserPermissionsApiInterface {
197
+ /**
198
+ * Creates request options for bulkGrantUserPermissions without sending the request
199
+ */
200
+ bulkGrantUserPermissionsRequestOpts(requestParameters: BulkGrantUserPermissionsRequest): Promise<runtime.RequestOpts>;
201
+ /**
202
+ * 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``.
203
+ * Bulk Grant User Permissions Handler
204
+ */
205
+ bulkGrantUserPermissionsRaw(requestParameters: BulkGrantUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkGrantResponse>>;
206
+ /**
207
+ * 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``.
208
+ * Bulk Grant User Permissions Handler
209
+ */
210
+ bulkGrantUserPermissions(requestParameters: BulkGrantUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkGrantResponse>;
211
+ /**
212
+ * Creates request options for bulkRevokeUserPermissions without sending the request
213
+ */
214
+ bulkRevokeUserPermissionsRequestOpts(requestParameters: BulkRevokeUserPermissionsRequest): Promise<runtime.RequestOpts>;
215
+ /**
216
+ * 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``.
217
+ * Bulk Revoke User Permissions Handler
218
+ */
219
+ bulkRevokeUserPermissionsRaw(requestParameters: BulkRevokeUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>>;
220
+ /**
221
+ * 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``.
222
+ * Bulk Revoke User Permissions Handler
223
+ */
224
+ bulkRevokeUserPermissions(requestParameters: BulkRevokeUserPermissionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
149
225
  /**
150
226
  * Creates request options for createUserPermission without sending the request
151
227
  */
@@ -21,11 +21,109 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { CreatePermissionRequestToJSON, PaginatedResponsePermissionResponseFromJSON, PermissionResponseFromJSON, UpdatePermissionRequestToJSON, } from '../models/index';
24
+ import { BulkGrantRequestToJSON, BulkGrantResponseFromJSON, BulkOperationResponseFromJSON, BulkRevokeRequestToJSON, CreatePermissionRequestToJSON, PaginatedResponsePermissionResponseFromJSON, PermissionResponseFromJSON, UpdatePermissionRequestToJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class UserPermissionsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates request options for bulkGrantUserPermissions without sending the request
31
+ */
32
+ bulkGrantUserPermissionsRequestOpts(requestParameters) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (requestParameters['bulkGrantRequest'] == null) {
35
+ throw new runtime.RequiredError('bulkGrantRequest', 'Required parameter "bulkGrantRequest" was null or undefined when calling bulkGrantUserPermissions().');
36
+ }
37
+ const queryParameters = {};
38
+ const headerParameters = {};
39
+ headerParameters['Content-Type'] = 'application/json';
40
+ if (this.configuration && this.configuration.accessToken) {
41
+ const token = this.configuration.accessToken;
42
+ const tokenString = yield token("bearerAuth", []);
43
+ if (tokenString) {
44
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
45
+ }
46
+ }
47
+ let urlPath = `/v1/user-permissions/bulk`;
48
+ return {
49
+ path: urlPath,
50
+ method: 'POST',
51
+ headers: headerParameters,
52
+ query: queryParameters,
53
+ body: BulkGrantRequestToJSON(requestParameters['bulkGrantRequest']),
54
+ };
55
+ });
56
+ }
57
+ /**
58
+ * 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``.
59
+ * Bulk Grant User Permissions Handler
60
+ */
61
+ bulkGrantUserPermissionsRaw(requestParameters, initOverrides) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const requestOptions = yield this.bulkGrantUserPermissionsRequestOpts(requestParameters);
64
+ const response = yield this.request(requestOptions, initOverrides);
65
+ return new runtime.JSONApiResponse(response, (jsonValue) => BulkGrantResponseFromJSON(jsonValue));
66
+ });
67
+ }
68
+ /**
69
+ * 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``.
70
+ * Bulk Grant User Permissions Handler
71
+ */
72
+ bulkGrantUserPermissions(requestParameters, initOverrides) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const response = yield this.bulkGrantUserPermissionsRaw(requestParameters, initOverrides);
75
+ return yield response.value();
76
+ });
77
+ }
78
+ /**
79
+ * Creates request options for bulkRevokeUserPermissions without sending the request
80
+ */
81
+ bulkRevokeUserPermissionsRequestOpts(requestParameters) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ if (requestParameters['bulkRevokeRequest'] == null) {
84
+ throw new runtime.RequiredError('bulkRevokeRequest', 'Required parameter "bulkRevokeRequest" was null or undefined when calling bulkRevokeUserPermissions().');
85
+ }
86
+ const queryParameters = {};
87
+ const headerParameters = {};
88
+ headerParameters['Content-Type'] = 'application/json';
89
+ if (this.configuration && this.configuration.accessToken) {
90
+ const token = this.configuration.accessToken;
91
+ const tokenString = yield token("bearerAuth", []);
92
+ if (tokenString) {
93
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
94
+ }
95
+ }
96
+ let urlPath = `/v1/user-permissions/bulk-delete`;
97
+ return {
98
+ path: urlPath,
99
+ method: 'POST',
100
+ headers: headerParameters,
101
+ query: queryParameters,
102
+ body: BulkRevokeRequestToJSON(requestParameters['bulkRevokeRequest']),
103
+ };
104
+ });
105
+ }
106
+ /**
107
+ * 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``.
108
+ * Bulk Revoke User Permissions Handler
109
+ */
110
+ bulkRevokeUserPermissionsRaw(requestParameters, initOverrides) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ const requestOptions = yield this.bulkRevokeUserPermissionsRequestOpts(requestParameters);
113
+ const response = yield this.request(requestOptions, initOverrides);
114
+ return new runtime.JSONApiResponse(response, (jsonValue) => BulkOperationResponseFromJSON(jsonValue));
115
+ });
116
+ }
117
+ /**
118
+ * 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``.
119
+ * Bulk Revoke User Permissions Handler
120
+ */
121
+ bulkRevokeUserPermissions(requestParameters, initOverrides) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const response = yield this.bulkRevokeUserPermissionsRaw(requestParameters, initOverrides);
124
+ return yield response.value();
125
+ });
126
+ }
29
127
  /**
30
128
  * Creates request options for createUserPermission without sending the request
31
129
  */
@@ -5,7 +5,9 @@ export * from './ApiConnectionsApi';
5
5
  export * from './ApiKeysApi';
6
6
  export * from './AuditEventsApi';
7
7
  export * from './AuthApi';
8
+ export * from './BulkDeleteApi';
8
9
  export * from './BulkDownloadApi';
10
+ export * from './BulkMoveApi';
9
11
  export * from './ChunkLineagesApi';
10
12
  export * from './ChunksApi';
11
13
  export * from './DataSourcesApi';
@@ -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';