@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
@@ -627,7 +627,7 @@ example().catch(console.error);
627
627
 
628
628
  ## ingestDocument
629
629
 
630
- > IngestDocumentResponse ingestDocument(file, pathPartId, name, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, workflowRunId, tagIds, idempotencyKey, workflowDefinitionId)
630
+ > IngestDocumentResponse ingestDocument(file, pathPartId, name, tagIds, idempotencyKey, ingestionMode, chunkType, secondaryTaxonomy, pageDpi, workflowRunId, workflowDefinitionId)
631
631
 
632
632
  Ingest Document Handler
633
633
 
@@ -659,6 +659,10 @@ async function example() {
659
659
  pathPartId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
660
660
  // string | Document name (defaults to filename) (optional)
661
661
  name: name_example,
662
+ // Array<string> | Tag IDs applied to the created document. (optional)
663
+ tagIds: ...,
664
+ // string | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. (optional)
665
+ idempotencyKey: idempotencyKey_example,
662
666
  // IngestionMode (optional)
663
667
  ingestionMode: ...,
664
668
  // ChunkType (optional)
@@ -669,10 +673,6 @@ async function example() {
669
673
  pageDpi: 56,
670
674
  // string | Workflow run context for assumed agent uploads. (optional)
671
675
  workflowRunId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
672
- // Array<string> | Tag IDs applied to the created document. (optional)
673
- tagIds: ...,
674
- // string | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. (optional)
675
- idempotencyKey: idempotencyKey_example,
676
676
  // string | Workflow definition context for assumed agent uploads. (optional)
677
677
  workflowDefinitionId: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
678
678
  } satisfies IngestDocumentRequest;
@@ -697,13 +697,13 @@ example().catch(console.error);
697
697
  | **file** | `Blob` | | [Defaults to `undefined`] |
698
698
  | **pathPartId** | `string` | Parent path part ID (must be a FOLDER type) | [Defaults to `undefined`] |
699
699
  | **name** | `string` | Document name (defaults to filename) | [Optional] [Defaults to `undefined`] |
700
+ | **tagIds** | `Array<string>` | Tag IDs applied to the created document. | [Optional] |
701
+ | **idempotencyKey** | `string` | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. | [Optional] [Defaults to `undefined`] |
700
702
  | **ingestionMode** | `IngestionMode` | | [Optional] [Defaults to `undefined`] [Enum: high_accuracy, standard, single_chunk, media] |
701
703
  | **chunkType** | `ChunkType` | | [Optional] [Defaults to `undefined`] [Enum: TEXT, TABLE, IMAGE, HTML, UNKNOWN] |
702
704
  | **secondaryTaxonomy** | `ImageTaxonomy` | | [Optional] [Defaults to `undefined`] [Enum: picture, flowchart] |
703
705
  | **pageDpi** | `number` | DPI for PDF page screenshots (default 72, min 36, max 216). | [Optional] [Defaults to `72`] |
704
706
  | **workflowRunId** | `string` | Workflow run context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
705
- | **tagIds** | `Array<string>` | Tag IDs applied to the created document. | [Optional] |
706
- | **idempotencyKey** | `string` | Opt-in key: a repeat with the same key at the same (parent, name) replays the existing document instead of a 409. | [Optional] [Defaults to `undefined`] |
707
707
  | **workflowDefinitionId** | `string` | Workflow definition context for assumed agent uploads. | [Optional] [Defaults to `undefined`] |
708
708
 
709
709
  ### Return type
package/docs/TrashApi.md CHANGED
@@ -4,12 +4,164 @@ All URIs are relative to *http://localhost:8000*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
+ | [**bulkPermanentlyDeleteTrash**](TrashApi.md#bulkpermanentlydeletetrash) | **POST** /v1/trash/bulk-delete | Bulk Permanently Delete Trash Handler |
8
+ | [**bulkRestoreTrash**](TrashApi.md#bulkrestoretrash) | **POST** /v1/trash/bulk-restore | Bulk Restore Trash Handler |
7
9
  | [**listTrash**](TrashApi.md#listtrash) | **GET** /v1/trash | List Trash Handler |
8
10
  | [**permanentlyDeleteTrashItem**](TrashApi.md#permanentlydeletetrashitem) | **DELETE** /v1/trash/{path_part_id} | Permanently Delete Trash Item Handler |
9
11
  | [**restoreTrashItem**](TrashApi.md#restoretrashitem) | **POST** /v1/trash/{path_part_id}/restore | Restore Trash Item Handler |
10
12
 
11
13
 
12
14
 
15
+ ## bulkPermanentlyDeleteTrash
16
+
17
+ > BulkOperationResponse bulkPermanentlyDeleteTrash(bulkTrashRequest)
18
+
19
+ Bulk Permanently Delete Trash Handler
20
+
21
+ Permanently delete the selected trashed objects (by PDO id), per item. An object not visible in the caller\&#39;s trash scope lands in &#x60;&#x60;failed&#x60;&#x60; as &#x60;&#x60;not_found&#x60;&#x60;; the rest are hard-deleted and their Qdrant points purged.
22
+
23
+ ### Example
24
+
25
+ ```ts
26
+ import {
27
+ Configuration,
28
+ TrashApi,
29
+ } from '@knowledge-stack/ksapi';
30
+ import type { BulkPermanentlyDeleteTrashRequest } from '@knowledge-stack/ksapi';
31
+
32
+ async function example() {
33
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
34
+ const config = new Configuration({
35
+ // To configure API key authorization: cookieAuth
36
+ apiKey: "YOUR API KEY",
37
+ // Configure HTTP bearer authorization: bearerAuth
38
+ accessToken: "YOUR BEARER TOKEN",
39
+ });
40
+ const api = new TrashApi(config);
41
+
42
+ const body = {
43
+ // BulkTrashRequest
44
+ bulkTrashRequest: ...,
45
+ } satisfies BulkPermanentlyDeleteTrashRequest;
46
+
47
+ try {
48
+ const data = await api.bulkPermanentlyDeleteTrash(body);
49
+ console.log(data);
50
+ } catch (error) {
51
+ console.error(error);
52
+ }
53
+ }
54
+
55
+ // Run the test
56
+ example().catch(console.error);
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+
62
+ | Name | Type | Description | Notes |
63
+ |------------- | ------------- | ------------- | -------------|
64
+ | **bulkTrashRequest** | [BulkTrashRequest](BulkTrashRequest.md) | | |
65
+
66
+ ### Return type
67
+
68
+ [**BulkOperationResponse**](BulkOperationResponse.md)
69
+
70
+ ### Authorization
71
+
72
+ [cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
73
+
74
+ ### HTTP request headers
75
+
76
+ - **Content-Type**: `application/json`
77
+ - **Accept**: `application/json`
78
+
79
+
80
+ ### HTTP response details
81
+ | Status code | Description | Response headers |
82
+ |-------------|-------------|------------------|
83
+ | **200** | Successful Response | - |
84
+ | **422** | Validation Error | - |
85
+ | **0** | Error response. | - |
86
+
87
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
88
+
89
+
90
+ ## bulkRestoreTrash
91
+
92
+ > BulkOperationResponse bulkRestoreTrash(bulkTrashRequest)
93
+
94
+ Bulk Restore Trash Handler
95
+
96
+ Restore the selected trashed objects (by PDO id), reporting per item. An object not visible in the caller\&#39;s trash scope lands in &#x60;&#x60;failed&#x60;&#x60; as &#x60;&#x60;not_found&#x60;&#x60;; a live name collision at the original location that auto-rename cannot resolve lands as &#x60;&#x60;name_conflict&#x60;&#x60;.
97
+
98
+ ### Example
99
+
100
+ ```ts
101
+ import {
102
+ Configuration,
103
+ TrashApi,
104
+ } from '@knowledge-stack/ksapi';
105
+ import type { BulkRestoreTrashRequest } from '@knowledge-stack/ksapi';
106
+
107
+ async function example() {
108
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
109
+ const config = new Configuration({
110
+ // To configure API key authorization: cookieAuth
111
+ apiKey: "YOUR API KEY",
112
+ // Configure HTTP bearer authorization: bearerAuth
113
+ accessToken: "YOUR BEARER TOKEN",
114
+ });
115
+ const api = new TrashApi(config);
116
+
117
+ const body = {
118
+ // BulkTrashRequest
119
+ bulkTrashRequest: ...,
120
+ } satisfies BulkRestoreTrashRequest;
121
+
122
+ try {
123
+ const data = await api.bulkRestoreTrash(body);
124
+ console.log(data);
125
+ } catch (error) {
126
+ console.error(error);
127
+ }
128
+ }
129
+
130
+ // Run the test
131
+ example().catch(console.error);
132
+ ```
133
+
134
+ ### Parameters
135
+
136
+
137
+ | Name | Type | Description | Notes |
138
+ |------------- | ------------- | ------------- | -------------|
139
+ | **bulkTrashRequest** | [BulkTrashRequest](BulkTrashRequest.md) | | |
140
+
141
+ ### Return type
142
+
143
+ [**BulkOperationResponse**](BulkOperationResponse.md)
144
+
145
+ ### Authorization
146
+
147
+ [cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
148
+
149
+ ### HTTP request headers
150
+
151
+ - **Content-Type**: `application/json`
152
+ - **Accept**: `application/json`
153
+
154
+
155
+ ### HTTP response details
156
+ | Status code | Description | Response headers |
157
+ |-------------|-------------|------------------|
158
+ | **200** | Successful Response | - |
159
+ | **422** | Validation Error | - |
160
+ | **0** | Error response. | - |
161
+
162
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
163
+
164
+
13
165
  ## listTrash
14
166
 
15
167
  > PaginatedResponseTrashItemResponse listTrash(sortOrder, sortDir, deletedBy, partType, ownerId, limit, offset, createdAfter, createdBefore, updatedAfter, updatedBefore)
@@ -4,6 +4,8 @@ All URIs are relative to *http://localhost:8000*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
+ | [**bulkGrantUserPermissions**](UserPermissionsApi.md#bulkgrantuserpermissions) | **POST** /v1/user-permissions/bulk | Bulk Grant User Permissions Handler |
8
+ | [**bulkRevokeUserPermissions**](UserPermissionsApi.md#bulkrevokeuserpermissions) | **POST** /v1/user-permissions/bulk-delete | Bulk Revoke User Permissions Handler |
7
9
  | [**createUserPermission**](UserPermissionsApi.md#createuserpermission) | **POST** /v1/user-permissions | Create User Permission Handler |
8
10
  | [**deleteUserPermission**](UserPermissionsApi.md#deleteuserpermission) | **DELETE** /v1/user-permissions/{permission_id} | Delete User Permission Handler |
9
11
  | [**listUserPermissions**](UserPermissionsApi.md#listuserpermissions) | **GET** /v1/user-permissions | List User Permissions Handler |
@@ -11,6 +13,156 @@ All URIs are relative to *http://localhost:8000*
11
13
 
12
14
 
13
15
 
16
+ ## bulkGrantUserPermissions
17
+
18
+ > BulkGrantResponse bulkGrantUserPermissions(bulkGrantRequest)
19
+
20
+ Bulk Grant User Permissions Handler
21
+
22
+ 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 &#x60;&#x60;not_found&#x60;&#x60;, hitting the per-user cap is &#x60;&#x60;permission_limit&#x60;&#x60;, and an already-covered grant is &#x60;&#x60;subsumed&#x60;&#x60;.
23
+
24
+ ### Example
25
+
26
+ ```ts
27
+ import {
28
+ Configuration,
29
+ UserPermissionsApi,
30
+ } from '@knowledge-stack/ksapi';
31
+ import type { BulkGrantUserPermissionsRequest } from '@knowledge-stack/ksapi';
32
+
33
+ async function example() {
34
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
35
+ const config = new Configuration({
36
+ // To configure API key authorization: cookieAuth
37
+ apiKey: "YOUR API KEY",
38
+ // Configure HTTP bearer authorization: bearerAuth
39
+ accessToken: "YOUR BEARER TOKEN",
40
+ });
41
+ const api = new UserPermissionsApi(config);
42
+
43
+ const body = {
44
+ // BulkGrantRequest
45
+ bulkGrantRequest: ...,
46
+ } satisfies BulkGrantUserPermissionsRequest;
47
+
48
+ try {
49
+ const data = await api.bulkGrantUserPermissions(body);
50
+ console.log(data);
51
+ } catch (error) {
52
+ console.error(error);
53
+ }
54
+ }
55
+
56
+ // Run the test
57
+ example().catch(console.error);
58
+ ```
59
+
60
+ ### Parameters
61
+
62
+
63
+ | Name | Type | Description | Notes |
64
+ |------------- | ------------- | ------------- | -------------|
65
+ | **bulkGrantRequest** | [BulkGrantRequest](BulkGrantRequest.md) | | |
66
+
67
+ ### Return type
68
+
69
+ [**BulkGrantResponse**](BulkGrantResponse.md)
70
+
71
+ ### Authorization
72
+
73
+ [cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
74
+
75
+ ### HTTP request headers
76
+
77
+ - **Content-Type**: `application/json`
78
+ - **Accept**: `application/json`
79
+
80
+
81
+ ### HTTP response details
82
+ | Status code | Description | Response headers |
83
+ |-------------|-------------|------------------|
84
+ | **200** | Successful Response | - |
85
+ | **422** | Validation Error | - |
86
+ | **0** | Error response. | - |
87
+
88
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
89
+
90
+
91
+ ## bulkRevokeUserPermissions
92
+
93
+ > BulkOperationResponse bulkRevokeUserPermissions(bulkRevokeRequest)
94
+
95
+ Bulk Revoke User Permissions Handler
96
+
97
+ Revoke many permissions by their ids (admin/owner only), per item. A permission id not found in the tenant lands in &#x60;&#x60;failed&#x60;&#x60; as &#x60;&#x60;not_found&#x60;&#x60;.
98
+
99
+ ### Example
100
+
101
+ ```ts
102
+ import {
103
+ Configuration,
104
+ UserPermissionsApi,
105
+ } from '@knowledge-stack/ksapi';
106
+ import type { BulkRevokeUserPermissionsRequest } from '@knowledge-stack/ksapi';
107
+
108
+ async function example() {
109
+ console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
110
+ const config = new Configuration({
111
+ // To configure API key authorization: cookieAuth
112
+ apiKey: "YOUR API KEY",
113
+ // Configure HTTP bearer authorization: bearerAuth
114
+ accessToken: "YOUR BEARER TOKEN",
115
+ });
116
+ const api = new UserPermissionsApi(config);
117
+
118
+ const body = {
119
+ // BulkRevokeRequest
120
+ bulkRevokeRequest: ...,
121
+ } satisfies BulkRevokeUserPermissionsRequest;
122
+
123
+ try {
124
+ const data = await api.bulkRevokeUserPermissions(body);
125
+ console.log(data);
126
+ } catch (error) {
127
+ console.error(error);
128
+ }
129
+ }
130
+
131
+ // Run the test
132
+ example().catch(console.error);
133
+ ```
134
+
135
+ ### Parameters
136
+
137
+
138
+ | Name | Type | Description | Notes |
139
+ |------------- | ------------- | ------------- | -------------|
140
+ | **bulkRevokeRequest** | [BulkRevokeRequest](BulkRevokeRequest.md) | | |
141
+
142
+ ### Return type
143
+
144
+ [**BulkOperationResponse**](BulkOperationResponse.md)
145
+
146
+ ### Authorization
147
+
148
+ [cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
149
+
150
+ ### HTTP request headers
151
+
152
+ - **Content-Type**: `application/json`
153
+ - **Accept**: `application/json`
154
+
155
+
156
+ ### HTTP response details
157
+ | Status code | Description | Response headers |
158
+ |-------------|-------------|------------------|
159
+ | **200** | Successful Response | - |
160
+ | **422** | Validation Error | - |
161
+ | **0** | Error response. | - |
162
+
163
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
164
+
165
+
14
166
  ## createUserPermission
15
167
 
16
168
  > PermissionResponse createUserPermission(createPermissionRequest)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowledge-stack/ksapi",
3
- "version": "1.153.0",
3
+ "version": "1.155.0",
4
4
  "description": "OpenAPI client for @knowledge-stack/ksapi",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -0,0 +1,133 @@
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
+ import * as runtime from '../runtime';
17
+ import type {
18
+ BulkDeleteRequest,
19
+ BulkOperationResponse,
20
+ ErrorResponse,
21
+ HTTPValidationError,
22
+ } from '../models/index';
23
+ import {
24
+ BulkDeleteRequestFromJSON,
25
+ BulkDeleteRequestToJSON,
26
+ BulkOperationResponseFromJSON,
27
+ BulkOperationResponseToJSON,
28
+ ErrorResponseFromJSON,
29
+ ErrorResponseToJSON,
30
+ HTTPValidationErrorFromJSON,
31
+ HTTPValidationErrorToJSON,
32
+ } from '../models/index';
33
+
34
+ export interface BulkDeleteOperationRequest {
35
+ bulkDeleteRequest: BulkDeleteRequest;
36
+ }
37
+
38
+ /**
39
+ * BulkDeleteApi - interface
40
+ *
41
+ * @export
42
+ * @interface BulkDeleteApiInterface
43
+ */
44
+ export interface BulkDeleteApiInterface {
45
+ /**
46
+ * Creates request options for bulkDelete without sending the request
47
+ * @param {BulkDeleteRequest} bulkDeleteRequest
48
+ * @throws {RequiredError}
49
+ * @memberof BulkDeleteApiInterface
50
+ */
51
+ bulkDeleteRequestOpts(requestParameters: BulkDeleteOperationRequest): Promise<runtime.RequestOpts>;
52
+
53
+ /**
54
+ * Move the selected folders and documents to Trash, reporting per item. Each id is soft-deleted in its own transaction: items the caller may not delete, that are approval-sealed, held by another user, contain an in-progress run, or sit inside another selected folder land in ``failed`` with a reason while the rest succeed. Over the selection cap returns ``400``.
55
+ * @summary Bulk Delete Handler
56
+ * @param {BulkDeleteRequest} bulkDeleteRequest
57
+ * @param {*} [options] Override http request option.
58
+ * @throws {RequiredError}
59
+ * @memberof BulkDeleteApiInterface
60
+ */
61
+ bulkDeleteRaw(requestParameters: BulkDeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>>;
62
+
63
+ /**
64
+ * Move the selected folders and documents to Trash, reporting per item. Each id is soft-deleted in its own transaction: items the caller may not delete, that are approval-sealed, held by another user, contain an in-progress run, or sit inside another selected folder land in ``failed`` with a reason while the rest succeed. Over the selection cap returns ``400``.
65
+ * Bulk Delete Handler
66
+ */
67
+ bulkDelete(requestParameters: BulkDeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
68
+
69
+ }
70
+
71
+ /**
72
+ *
73
+ */
74
+ export class BulkDeleteApi extends runtime.BaseAPI implements BulkDeleteApiInterface {
75
+
76
+ /**
77
+ * Creates request options for bulkDelete without sending the request
78
+ */
79
+ async bulkDeleteRequestOpts(requestParameters: BulkDeleteOperationRequest): Promise<runtime.RequestOpts> {
80
+ if (requestParameters['bulkDeleteRequest'] == null) {
81
+ throw new runtime.RequiredError(
82
+ 'bulkDeleteRequest',
83
+ 'Required parameter "bulkDeleteRequest" was null or undefined when calling bulkDelete().'
84
+ );
85
+ }
86
+
87
+ const queryParameters: any = {};
88
+
89
+ const headerParameters: runtime.HTTPHeaders = {};
90
+
91
+ headerParameters['Content-Type'] = 'application/json';
92
+
93
+ if (this.configuration && this.configuration.accessToken) {
94
+ const token = this.configuration.accessToken;
95
+ const tokenString = await token("bearerAuth", []);
96
+
97
+ if (tokenString) {
98
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
99
+ }
100
+ }
101
+
102
+ let urlPath = `/v1/bulk-delete`;
103
+
104
+ return {
105
+ path: urlPath,
106
+ method: 'POST',
107
+ headers: headerParameters,
108
+ query: queryParameters,
109
+ body: BulkDeleteRequestToJSON(requestParameters['bulkDeleteRequest']),
110
+ };
111
+ }
112
+
113
+ /**
114
+ * Move the selected folders and documents to Trash, reporting per item. Each id is soft-deleted in its own transaction: items the caller may not delete, that are approval-sealed, held by another user, contain an in-progress run, or sit inside another selected folder land in ``failed`` with a reason while the rest succeed. Over the selection cap returns ``400``.
115
+ * Bulk Delete Handler
116
+ */
117
+ async bulkDeleteRaw(requestParameters: BulkDeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>> {
118
+ const requestOptions = await this.bulkDeleteRequestOpts(requestParameters);
119
+ const response = await this.request(requestOptions, initOverrides);
120
+
121
+ return new runtime.JSONApiResponse(response, (jsonValue) => BulkOperationResponseFromJSON(jsonValue));
122
+ }
123
+
124
+ /**
125
+ * Move the selected folders and documents to Trash, reporting per item. Each id is soft-deleted in its own transaction: items the caller may not delete, that are approval-sealed, held by another user, contain an in-progress run, or sit inside another selected folder land in ``failed`` with a reason while the rest succeed. Over the selection cap returns ``400``.
126
+ * Bulk Delete Handler
127
+ */
128
+ async bulkDelete(requestParameters: BulkDeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse> {
129
+ const response = await this.bulkDeleteRaw(requestParameters, initOverrides);
130
+ return await response.value();
131
+ }
132
+
133
+ }
@@ -0,0 +1,133 @@
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
+ import * as runtime from '../runtime';
17
+ import type {
18
+ BulkMoveRequest,
19
+ BulkOperationResponse,
20
+ ErrorResponse,
21
+ HTTPValidationError,
22
+ } from '../models/index';
23
+ import {
24
+ BulkMoveRequestFromJSON,
25
+ BulkMoveRequestToJSON,
26
+ BulkOperationResponseFromJSON,
27
+ BulkOperationResponseToJSON,
28
+ ErrorResponseFromJSON,
29
+ ErrorResponseToJSON,
30
+ HTTPValidationErrorFromJSON,
31
+ HTTPValidationErrorToJSON,
32
+ } from '../models/index';
33
+
34
+ export interface BulkMoveOperationRequest {
35
+ bulkMoveRequest: BulkMoveRequest;
36
+ }
37
+
38
+ /**
39
+ * BulkMoveApi - interface
40
+ *
41
+ * @export
42
+ * @interface BulkMoveApiInterface
43
+ */
44
+ export interface BulkMoveApiInterface {
45
+ /**
46
+ * Creates request options for bulkMove without sending the request
47
+ * @param {BulkMoveRequest} bulkMoveRequest
48
+ * @throws {RequiredError}
49
+ * @memberof BulkMoveApiInterface
50
+ */
51
+ bulkMoveRequestOpts(requestParameters: BulkMoveOperationRequest): Promise<runtime.RequestOpts>;
52
+
53
+ /**
54
+ * 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.
55
+ * @summary Bulk Move Handler
56
+ * @param {BulkMoveRequest} bulkMoveRequest
57
+ * @param {*} [options] Override http request option.
58
+ * @throws {RequiredError}
59
+ * @memberof BulkMoveApiInterface
60
+ */
61
+ bulkMoveRaw(requestParameters: BulkMoveOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>>;
62
+
63
+ /**
64
+ * 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.
65
+ * Bulk Move Handler
66
+ */
67
+ bulkMove(requestParameters: BulkMoveOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse>;
68
+
69
+ }
70
+
71
+ /**
72
+ *
73
+ */
74
+ export class BulkMoveApi extends runtime.BaseAPI implements BulkMoveApiInterface {
75
+
76
+ /**
77
+ * Creates request options for bulkMove without sending the request
78
+ */
79
+ async bulkMoveRequestOpts(requestParameters: BulkMoveOperationRequest): Promise<runtime.RequestOpts> {
80
+ if (requestParameters['bulkMoveRequest'] == null) {
81
+ throw new runtime.RequiredError(
82
+ 'bulkMoveRequest',
83
+ 'Required parameter "bulkMoveRequest" was null or undefined when calling bulkMove().'
84
+ );
85
+ }
86
+
87
+ const queryParameters: any = {};
88
+
89
+ const headerParameters: runtime.HTTPHeaders = {};
90
+
91
+ headerParameters['Content-Type'] = 'application/json';
92
+
93
+ if (this.configuration && this.configuration.accessToken) {
94
+ const token = this.configuration.accessToken;
95
+ const tokenString = await token("bearerAuth", []);
96
+
97
+ if (tokenString) {
98
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
99
+ }
100
+ }
101
+
102
+ let urlPath = `/v1/bulk-move`;
103
+
104
+ return {
105
+ path: urlPath,
106
+ method: 'POST',
107
+ headers: headerParameters,
108
+ query: queryParameters,
109
+ body: BulkMoveRequestToJSON(requestParameters['bulkMoveRequest']),
110
+ };
111
+ }
112
+
113
+ /**
114
+ * 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.
115
+ * Bulk Move Handler
116
+ */
117
+ async bulkMoveRaw(requestParameters: BulkMoveOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<BulkOperationResponse>> {
118
+ const requestOptions = await this.bulkMoveRequestOpts(requestParameters);
119
+ const response = await this.request(requestOptions, initOverrides);
120
+
121
+ return new runtime.JSONApiResponse(response, (jsonValue) => BulkOperationResponseFromJSON(jsonValue));
122
+ }
123
+
124
+ /**
125
+ * 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.
126
+ * Bulk Move Handler
127
+ */
128
+ async bulkMove(requestParameters: BulkMoveOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BulkOperationResponse> {
129
+ const response = await this.bulkMoveRaw(requestParameters, initOverrides);
130
+ return await response.value();
131
+ }
132
+
133
+ }