@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.
- package/.openapi-generator/FILES +28 -0
- package/README.md +20 -2
- package/dist/apis/BulkDeleteApi.d.ts +64 -0
- package/dist/apis/BulkDeleteApi.js +115 -0
- package/dist/apis/BulkMoveApi.d.ts +64 -0
- package/dist/apis/BulkMoveApi.js +115 -0
- package/dist/apis/TrashApi.d.ts +77 -1
- package/dist/apis/TrashApi.js +98 -0
- package/dist/apis/UserPermissionsApi.d.ts +77 -1
- package/dist/apis/UserPermissionsApi.js +98 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +2 -0
- package/dist/esm/apis/BulkDeleteApi.d.ts +64 -0
- package/dist/esm/apis/BulkDeleteApi.js +78 -0
- package/dist/esm/apis/BulkMoveApi.d.ts +64 -0
- package/dist/esm/apis/BulkMoveApi.js +78 -0
- package/dist/esm/apis/TrashApi.d.ts +77 -1
- package/dist/esm/apis/TrashApi.js +99 -1
- package/dist/esm/apis/UserPermissionsApi.d.ts +77 -1
- package/dist/esm/apis/UserPermissionsApi.js +99 -1
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +2 -0
- package/dist/esm/models/BulkDeleteRequest.d.ts +53 -0
- package/dist/esm/models/BulkDeleteRequest.js +44 -0
- package/dist/esm/models/BulkFailureReason.d.ts +37 -0
- package/dist/esm/models/BulkFailureReason.js +55 -0
- package/dist/esm/models/BulkGrantItem.d.ts +66 -0
- package/dist/esm/models/BulkGrantItem.js +55 -0
- package/dist/esm/models/BulkGrantItemFailure.d.ts +60 -0
- package/dist/esm/models/BulkGrantItemFailure.js +53 -0
- package/dist/esm/models/BulkGrantRequest.d.ts +54 -0
- package/dist/esm/models/BulkGrantRequest.js +47 -0
- package/dist/esm/models/BulkGrantResponse.d.ts +55 -0
- package/dist/esm/models/BulkGrantResponse.js +46 -0
- package/dist/esm/models/BulkGrantSuccess.d.ts +72 -0
- package/dist/esm/models/BulkGrantSuccess.js +61 -0
- package/dist/esm/models/BulkItemFailure.d.ts +54 -0
- package/dist/esm/models/BulkItemFailure.js +49 -0
- package/dist/esm/models/BulkMoveRequest.d.ts +59 -0
- package/dist/esm/models/BulkMoveRequest.js +48 -0
- package/dist/esm/models/BulkOperationResponse.d.ts +54 -0
- package/dist/esm/models/BulkOperationResponse.js +45 -0
- package/dist/esm/models/BulkRevokeRequest.d.ts +53 -0
- package/dist/esm/models/BulkRevokeRequest.js +46 -0
- package/dist/esm/models/BulkTrashRequest.d.ts +47 -0
- package/dist/esm/models/BulkTrashRequest.js +42 -0
- package/dist/esm/models/CreateUploadRequest.d.ts +6 -0
- package/dist/esm/models/CreateUploadRequest.js +2 -0
- package/dist/esm/models/DocumentVersionMetadata.d.ts +18 -0
- package/dist/esm/models/DocumentVersionMetadata.js +6 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.d.ts +18 -0
- package/dist/esm/models/DocumentVersionMetadataUpdate.js +6 -0
- package/dist/esm/models/ErrorResponse.d.ts +1 -0
- package/dist/esm/models/ErrorResponse.js +1 -0
- package/dist/esm/models/index.d.ts +12 -0
- package/dist/esm/models/index.js +12 -0
- package/dist/models/BulkDeleteRequest.d.ts +53 -0
- package/dist/models/BulkDeleteRequest.js +52 -0
- package/dist/models/BulkFailureReason.d.ts +37 -0
- package/dist/models/BulkFailureReason.js +63 -0
- package/dist/models/BulkGrantItem.d.ts +66 -0
- package/dist/models/BulkGrantItem.js +63 -0
- package/dist/models/BulkGrantItemFailure.d.ts +60 -0
- package/dist/models/BulkGrantItemFailure.js +61 -0
- package/dist/models/BulkGrantRequest.d.ts +54 -0
- package/dist/models/BulkGrantRequest.js +55 -0
- package/dist/models/BulkGrantResponse.d.ts +55 -0
- package/dist/models/BulkGrantResponse.js +54 -0
- package/dist/models/BulkGrantSuccess.d.ts +72 -0
- package/dist/models/BulkGrantSuccess.js +69 -0
- package/dist/models/BulkItemFailure.d.ts +54 -0
- package/dist/models/BulkItemFailure.js +57 -0
- package/dist/models/BulkMoveRequest.d.ts +59 -0
- package/dist/models/BulkMoveRequest.js +56 -0
- package/dist/models/BulkOperationResponse.d.ts +54 -0
- package/dist/models/BulkOperationResponse.js +53 -0
- package/dist/models/BulkRevokeRequest.d.ts +53 -0
- package/dist/models/BulkRevokeRequest.js +54 -0
- package/dist/models/BulkTrashRequest.d.ts +47 -0
- package/dist/models/BulkTrashRequest.js +50 -0
- package/dist/models/CreateUploadRequest.d.ts +6 -0
- package/dist/models/CreateUploadRequest.js +2 -0
- package/dist/models/DocumentVersionMetadata.d.ts +18 -0
- package/dist/models/DocumentVersionMetadata.js +6 -0
- package/dist/models/DocumentVersionMetadataUpdate.d.ts +18 -0
- package/dist/models/DocumentVersionMetadataUpdate.js +6 -0
- package/dist/models/ErrorResponse.d.ts +1 -0
- package/dist/models/ErrorResponse.js +1 -0
- package/dist/models/index.d.ts +12 -0
- package/dist/models/index.js +12 -0
- package/docs/BulkDeleteApi.md +84 -0
- package/docs/BulkDeleteRequest.md +37 -0
- package/docs/BulkFailureReason.md +33 -0
- package/docs/BulkGrantItem.md +41 -0
- package/docs/BulkGrantItemFailure.md +39 -0
- package/docs/BulkGrantRequest.md +37 -0
- package/docs/BulkGrantResponse.md +37 -0
- package/docs/BulkGrantSuccess.md +43 -0
- package/docs/BulkItemFailure.md +37 -0
- package/docs/BulkMoveApi.md +84 -0
- package/docs/BulkMoveRequest.md +39 -0
- package/docs/BulkOperationResponse.md +37 -0
- package/docs/BulkRevokeRequest.md +37 -0
- package/docs/BulkTrashRequest.md +35 -0
- package/docs/CreateUploadRequest.md +2 -0
- package/docs/DocumentVersionMetadata.md +6 -0
- package/docs/DocumentVersionMetadataUpdate.md +6 -0
- package/docs/TrashApi.md +152 -0
- package/docs/UserPermissionsApi.md +152 -0
- package/package.json +1 -1
- package/src/apis/BulkDeleteApi.ts +133 -0
- package/src/apis/BulkMoveApi.ts +133 -0
- package/src/apis/TrashApi.ts +176 -0
- package/src/apis/UserPermissionsApi.ts +182 -0
- package/src/apis/index.ts +2 -0
- package/src/models/BulkDeleteRequest.ts +90 -0
- package/src/models/BulkFailureReason.ts +65 -0
- package/src/models/BulkGrantItem.ts +119 -0
- package/src/models/BulkGrantItemFailure.ts +111 -0
- package/src/models/BulkGrantRequest.ts +99 -0
- package/src/models/BulkGrantResponse.ts +105 -0
- package/src/models/BulkGrantSuccess.ts +129 -0
- package/src/models/BulkItemFailure.ts +102 -0
- package/src/models/BulkMoveRequest.ts +99 -0
- package/src/models/BulkOperationResponse.ts +98 -0
- package/src/models/BulkRevokeRequest.ts +91 -0
- package/src/models/BulkTrashRequest.ts +82 -0
- package/src/models/CreateUploadRequest.ts +8 -0
- package/src/models/DocumentVersionMetadata.ts +24 -0
- package/src/models/DocumentVersionMetadataUpdate.ts +24 -0
- package/src/models/ErrorResponse.ts +1 -0
- package/src/models/index.ts +12 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkGrantItemFailure
|
|
3
|
+
|
|
4
|
+
A grant that could not be created, keyed on its (user, object) pair.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`userId` | string
|
|
11
|
+
`objectId` | string
|
|
12
|
+
`reason` | [BulkFailureReason](BulkFailureReason.md)
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { BulkGrantItemFailure } from '@knowledge-stack/ksapi'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"userId": null,
|
|
22
|
+
"objectId": null,
|
|
23
|
+
"reason": null,
|
|
24
|
+
} satisfies BulkGrantItemFailure
|
|
25
|
+
|
|
26
|
+
console.log(example)
|
|
27
|
+
|
|
28
|
+
// Convert the instance to a JSON string
|
|
29
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
30
|
+
console.log(exampleJSON)
|
|
31
|
+
|
|
32
|
+
// Parse the JSON string back to an object
|
|
33
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkGrantItemFailure
|
|
34
|
+
console.log(exampleParsed)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
38
|
+
|
|
39
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkGrantRequest
|
|
3
|
+
|
|
4
|
+
Grant many (user, object, capability) permissions in one request.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`tenantId` | string
|
|
11
|
+
`grants` | [Array<BulkGrantItem>](BulkGrantItem.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { BulkGrantRequest } from '@knowledge-stack/ksapi'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"tenantId": null,
|
|
21
|
+
"grants": null,
|
|
22
|
+
} satisfies BulkGrantRequest
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkGrantRequest
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkGrantResponse
|
|
3
|
+
|
|
4
|
+
Per-item outcome of a bulk grant (composite-keyed, unlike other bulks).
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`succeeded` | [Array<BulkGrantSuccess>](BulkGrantSuccess.md)
|
|
11
|
+
`failed` | [Array<BulkGrantItemFailure>](BulkGrantItemFailure.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { BulkGrantResponse } from '@knowledge-stack/ksapi'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"succeeded": null,
|
|
21
|
+
"failed": null,
|
|
22
|
+
} satisfies BulkGrantResponse
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkGrantResponse
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkGrantSuccess
|
|
3
|
+
|
|
4
|
+
A grant that was created, keyed on its (user, object) pair plus new id.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`userId` | string
|
|
11
|
+
`objectId` | string
|
|
12
|
+
`permissionId` | string
|
|
13
|
+
`capability` | [PermissionCapability](PermissionCapability.md)
|
|
14
|
+
`canApprove` | boolean
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { BulkGrantSuccess } from '@knowledge-stack/ksapi'
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"userId": null,
|
|
24
|
+
"objectId": null,
|
|
25
|
+
"permissionId": null,
|
|
26
|
+
"capability": null,
|
|
27
|
+
"canApprove": null,
|
|
28
|
+
} satisfies BulkGrantSuccess
|
|
29
|
+
|
|
30
|
+
console.log(example)
|
|
31
|
+
|
|
32
|
+
// Convert the instance to a JSON string
|
|
33
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
34
|
+
console.log(exampleJSON)
|
|
35
|
+
|
|
36
|
+
// Parse the JSON string back to an object
|
|
37
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkGrantSuccess
|
|
38
|
+
console.log(exampleParsed)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
42
|
+
|
|
43
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkItemFailure
|
|
3
|
+
|
|
4
|
+
A single id that could not be applied, and why.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`id` | string
|
|
11
|
+
`reason` | [BulkFailureReason](BulkFailureReason.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { BulkItemFailure } from '@knowledge-stack/ksapi'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"id": null,
|
|
21
|
+
"reason": null,
|
|
22
|
+
} satisfies BulkItemFailure
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkItemFailure
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# BulkMoveApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost:8000*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**bulkMove**](BulkMoveApi.md#bulkmoveoperation) | **POST** /v1/bulk-move | Bulk Move Handler |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## bulkMove
|
|
12
|
+
|
|
13
|
+
> BulkOperationResponse bulkMove(bulkMoveRequest)
|
|
14
|
+
|
|
15
|
+
Bulk Move Handler
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
Configuration,
|
|
24
|
+
BulkMoveApi,
|
|
25
|
+
} from '@knowledge-stack/ksapi';
|
|
26
|
+
import type { BulkMoveOperationRequest } from '@knowledge-stack/ksapi';
|
|
27
|
+
|
|
28
|
+
async function example() {
|
|
29
|
+
console.log("🚀 Testing @knowledge-stack/ksapi SDK...");
|
|
30
|
+
const config = new Configuration({
|
|
31
|
+
// To configure API key authorization: cookieAuth
|
|
32
|
+
apiKey: "YOUR API KEY",
|
|
33
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
34
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
35
|
+
});
|
|
36
|
+
const api = new BulkMoveApi(config);
|
|
37
|
+
|
|
38
|
+
const body = {
|
|
39
|
+
// BulkMoveRequest
|
|
40
|
+
bulkMoveRequest: ...,
|
|
41
|
+
} satisfies BulkMoveOperationRequest;
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
const data = await api.bulkMove(body);
|
|
45
|
+
console.log(data);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error(error);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Run the test
|
|
52
|
+
example().catch(console.error);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Parameters
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
| Name | Type | Description | Notes |
|
|
59
|
+
|------------- | ------------- | ------------- | -------------|
|
|
60
|
+
| **bulkMoveRequest** | [BulkMoveRequest](BulkMoveRequest.md) | | |
|
|
61
|
+
|
|
62
|
+
### Return type
|
|
63
|
+
|
|
64
|
+
[**BulkOperationResponse**](BulkOperationResponse.md)
|
|
65
|
+
|
|
66
|
+
### Authorization
|
|
67
|
+
|
|
68
|
+
[cookieAuth](../README.md#cookieAuth), [bearerAuth](../README.md#bearerAuth)
|
|
69
|
+
|
|
70
|
+
### HTTP request headers
|
|
71
|
+
|
|
72
|
+
- **Content-Type**: `application/json`
|
|
73
|
+
- **Accept**: `application/json`
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### HTTP response details
|
|
77
|
+
| Status code | Description | Response headers |
|
|
78
|
+
|-------------|-------------|------------------|
|
|
79
|
+
| **200** | Successful Response | - |
|
|
80
|
+
| **422** | Validation Error | - |
|
|
81
|
+
| **0** | Error response. | - |
|
|
82
|
+
|
|
83
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
84
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkMoveRequest
|
|
3
|
+
|
|
4
|
+
Move the selected folders and documents into ``target_folder_id``.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`folderIds` | Array<string>
|
|
11
|
+
`documentIds` | Array<string>
|
|
12
|
+
`targetFolderId` | string
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { BulkMoveRequest } from '@knowledge-stack/ksapi'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"folderIds": null,
|
|
22
|
+
"documentIds": null,
|
|
23
|
+
"targetFolderId": null,
|
|
24
|
+
} satisfies BulkMoveRequest
|
|
25
|
+
|
|
26
|
+
console.log(example)
|
|
27
|
+
|
|
28
|
+
// Convert the instance to a JSON string
|
|
29
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
30
|
+
console.log(exampleJSON)
|
|
31
|
+
|
|
32
|
+
// Parse the JSON string back to an object
|
|
33
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkMoveRequest
|
|
34
|
+
console.log(exampleParsed)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
38
|
+
|
|
39
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkOperationResponse
|
|
3
|
+
|
|
4
|
+
Per-item outcome of a bulk operation keyed on a single PDO id.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`succeeded` | Array<string>
|
|
11
|
+
`failed` | [Array<BulkItemFailure>](BulkItemFailure.md)
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { BulkOperationResponse } from '@knowledge-stack/ksapi'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"succeeded": null,
|
|
21
|
+
"failed": null,
|
|
22
|
+
} satisfies BulkOperationResponse
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkOperationResponse
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkRevokeRequest
|
|
3
|
+
|
|
4
|
+
Revoke many permissions by their own permission-row ids.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`tenantId` | string
|
|
11
|
+
`permissionIds` | Array<string>
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { BulkRevokeRequest } from '@knowledge-stack/ksapi'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"tenantId": null,
|
|
21
|
+
"permissionIds": null,
|
|
22
|
+
} satisfies BulkRevokeRequest
|
|
23
|
+
|
|
24
|
+
console.log(example)
|
|
25
|
+
|
|
26
|
+
// Convert the instance to a JSON string
|
|
27
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
28
|
+
console.log(exampleJSON)
|
|
29
|
+
|
|
30
|
+
// Parse the JSON string back to an object
|
|
31
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkRevokeRequest
|
|
32
|
+
console.log(exampleParsed)
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
36
|
+
|
|
37
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# BulkTrashRequest
|
|
3
|
+
|
|
4
|
+
Restore or permanently delete the selected trashed objects by PDO id.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`objectIds` | Array<string>
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { BulkTrashRequest } from '@knowledge-stack/ksapi'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"objectIds": null,
|
|
20
|
+
} satisfies BulkTrashRequest
|
|
21
|
+
|
|
22
|
+
console.log(example)
|
|
23
|
+
|
|
24
|
+
// Convert the instance to a JSON string
|
|
25
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
26
|
+
console.log(exampleJSON)
|
|
27
|
+
|
|
28
|
+
// Parse the JSON string back to an object
|
|
29
|
+
const exampleParsed = JSON.parse(exampleJSON) as BulkTrashRequest
|
|
30
|
+
console.log(exampleParsed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
34
|
+
|
|
35
|
+
|
|
@@ -11,6 +11,7 @@ Name | Type
|
|
|
11
11
|
`name` | string
|
|
12
12
|
`filename` | string
|
|
13
13
|
`sizeBytes` | number
|
|
14
|
+
`tagIds` | Array<string>
|
|
14
15
|
|
|
15
16
|
## Example
|
|
16
17
|
|
|
@@ -23,6 +24,7 @@ const example = {
|
|
|
23
24
|
"name": null,
|
|
24
25
|
"filename": null,
|
|
25
26
|
"sizeBytes": null,
|
|
27
|
+
"tagIds": null,
|
|
26
28
|
} satisfies CreateUploadRequest
|
|
27
29
|
|
|
28
30
|
console.log(example)
|
|
@@ -17,6 +17,9 @@ Name | Type
|
|
|
17
17
|
`totalPages` | number
|
|
18
18
|
`totalSections` | number
|
|
19
19
|
`totalChunks` | number
|
|
20
|
+
`durationMs` | number
|
|
21
|
+
`language` | string
|
|
22
|
+
`segmentCount` | number
|
|
20
23
|
`totalFormulas` | number
|
|
21
24
|
`xlsxParseResultS3` | string
|
|
22
25
|
`xlsxNamedRanges` | Array<{ [key: string]: any; }>
|
|
@@ -46,6 +49,9 @@ const example = {
|
|
|
46
49
|
"totalPages": null,
|
|
47
50
|
"totalSections": null,
|
|
48
51
|
"totalChunks": null,
|
|
52
|
+
"durationMs": null,
|
|
53
|
+
"language": null,
|
|
54
|
+
"segmentCount": null,
|
|
49
55
|
"totalFormulas": null,
|
|
50
56
|
"xlsxParseResultS3": null,
|
|
51
57
|
"xlsxNamedRanges": null,
|
|
@@ -20,6 +20,9 @@ Name | Type
|
|
|
20
20
|
`totalPages` | number
|
|
21
21
|
`totalSections` | number
|
|
22
22
|
`totalChunks` | number
|
|
23
|
+
`durationMs` | number
|
|
24
|
+
`language` | string
|
|
25
|
+
`segmentCount` | number
|
|
23
26
|
`totalFormulas` | number
|
|
24
27
|
`xlsxParseResultS3` | string
|
|
25
28
|
`xlsxNamedRanges` | Array<{ [key: string]: any; }>
|
|
@@ -51,6 +54,9 @@ const example = {
|
|
|
51
54
|
"totalPages": null,
|
|
52
55
|
"totalSections": null,
|
|
53
56
|
"totalChunks": null,
|
|
57
|
+
"durationMs": null,
|
|
58
|
+
"language": null,
|
|
59
|
+
"segmentCount": null,
|
|
54
60
|
"totalFormulas": null,
|
|
55
61
|
"xlsxParseResultS3": null,
|
|
56
62
|
"xlsxNamedRanges": null,
|
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\'s trash scope lands in ``failed`` as ``not_found``; 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\'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``.
|
|
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)
|