@chatbotkit/sdk 1.30.0 → 1.31.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/dist/cjs/space/index.cjs +2 -0
- package/dist/cjs/space/index.d.ts +2 -0
- package/dist/cjs/space/storage/index.cjs +30 -0
- package/dist/cjs/space/storage/index.d.ts +11 -0
- package/dist/cjs/space/storage/v1.cjs +52 -0
- package/dist/cjs/space/storage/v1.d.ts +20 -0
- package/dist/cjs/types/ability.d.ts +522 -36
- package/dist/cjs/types/api/v1.d.ts +420 -4
- package/dist/esm/space/index.d.ts +2 -0
- package/dist/esm/space/index.js +2 -0
- package/dist/esm/space/storage/index.d.ts +11 -0
- package/dist/esm/space/storage/index.js +26 -0
- package/dist/esm/space/storage/v1.d.ts +20 -0
- package/dist/esm/space/storage/v1.js +44 -0
- package/dist/esm/types/ability.d.ts +522 -36
- package/dist/esm/types/api/v1.d.ts +420 -4
- package/package.json +51 -1
package/dist/cjs/space/index.cjs
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SpaceClient = void 0;
|
|
4
4
|
const client_js_1 = require("../client.cjs");
|
|
5
|
+
const index_js_1 = require("./storage/index.cjs");
|
|
5
6
|
const v1_js_1 = require("./v1.cjs");
|
|
6
7
|
class SpaceClient extends client_js_1.ChatBotKitClient {
|
|
7
8
|
constructor(options) {
|
|
8
9
|
super(options);
|
|
10
|
+
this.storage = new index_js_1.SpaceStorageClient(options);
|
|
9
11
|
}
|
|
10
12
|
list(request) {
|
|
11
13
|
return (0, v1_js_1.listSpaces)(this, request);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export class SpaceClient extends ChatBotKitClient {
|
|
2
|
+
storage: SpaceStorageClient;
|
|
2
3
|
list(request?: import("./v1.js").SpaceListRequest): ResponsePromise<import("./v1.js").SpaceListResponse, import("./v1.js").SpaceListStreamType>;
|
|
3
4
|
fetch(spaceId: string): ResponsePromise<import("./v1.js").SpaceFetchResponse, never>;
|
|
4
5
|
create(request: import("./v1.js").SpaceCreateRequest): Promise<import("./v1.js").SpaceCreateResponse>;
|
|
@@ -8,3 +9,4 @@ export class SpaceClient extends ChatBotKitClient {
|
|
|
8
9
|
export default SpaceClient;
|
|
9
10
|
export type ResponsePromise<T, U> = import("../client.js").ResponsePromise<T, U>;
|
|
10
11
|
import { ChatBotKitClient } from '../client.cjs';
|
|
12
|
+
import { SpaceStorageClient } from './storage/index.cjs';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpaceStorageClient = void 0;
|
|
4
|
+
const client_js_1 = require("../../client.cjs");
|
|
5
|
+
const v1_js_1 = require("./v1.cjs");
|
|
6
|
+
class SpaceStorageClient extends client_js_1.ChatBotKitClient {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
}
|
|
10
|
+
list(spaceId, path, request) {
|
|
11
|
+
return (0, v1_js_1.listSpaceStorage)(this, spaceId, path, request);
|
|
12
|
+
}
|
|
13
|
+
download(spaceId, path, request) {
|
|
14
|
+
return (0, v1_js_1.downloadSpaceStorage)(this, spaceId, path, request);
|
|
15
|
+
}
|
|
16
|
+
upload(spaceId, path, request) {
|
|
17
|
+
return (0, v1_js_1.uploadSpaceStorage)(this, spaceId, path, request);
|
|
18
|
+
}
|
|
19
|
+
delete(spaceId, path, request) {
|
|
20
|
+
return (0, v1_js_1.deleteSpaceStorage)(this, spaceId, path, request);
|
|
21
|
+
}
|
|
22
|
+
copy(spaceId, path, request) {
|
|
23
|
+
return (0, v1_js_1.copySpaceStorage)(this, spaceId, path, request);
|
|
24
|
+
}
|
|
25
|
+
move(spaceId, path, request) {
|
|
26
|
+
return (0, v1_js_1.moveSpaceStorage)(this, spaceId, path, request);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.SpaceStorageClient = SpaceStorageClient;
|
|
30
|
+
exports.default = SpaceStorageClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class SpaceStorageClient extends ChatBotKitClient {
|
|
2
|
+
list(spaceId: string, path?: string, request?: import("./v1.js").SpaceStorageListRequest): ResponsePromise<import("./v1.js").SpaceStorageListResponse, never>;
|
|
3
|
+
download(spaceId: string, path: string, request?: import("./v1.js").SpaceStorageDownloadRequest): ResponsePromise<import("./v1.js").SpaceStorageDownloadResponse, never>;
|
|
4
|
+
upload(spaceId: string, path: string, request: import("./v1.js").SpaceStorageUploadRequest): Promise<import("./v1.js").SpaceStorageUploadResponse>;
|
|
5
|
+
delete(spaceId: string, path: string, request?: import("./v1.js").SpaceStorageDeleteRequest): Promise<import("./v1.js").SpaceStorageDeleteResponse>;
|
|
6
|
+
copy(spaceId: string, path: string, request: import("./v1.js").SpaceStorageCopyRequest): Promise<import("./v1.js").SpaceStorageCopyResponse>;
|
|
7
|
+
move(spaceId: string, path: string, request: import("./v1.js").SpaceStorageMoveRequest): Promise<import("./v1.js").SpaceStorageMoveResponse>;
|
|
8
|
+
}
|
|
9
|
+
export default SpaceStorageClient;
|
|
10
|
+
export type ResponsePromise<T, U> = import("../../client.js").ResponsePromise<T, U>;
|
|
11
|
+
import { ChatBotKitClient } from '../../client.cjs';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listSpaceStorage = listSpaceStorage;
|
|
4
|
+
exports.downloadSpaceStorage = downloadSpaceStorage;
|
|
5
|
+
exports.uploadSpaceStorage = uploadSpaceStorage;
|
|
6
|
+
exports.deleteSpaceStorage = deleteSpaceStorage;
|
|
7
|
+
exports.copySpaceStorage = copySpaceStorage;
|
|
8
|
+
exports.moveSpaceStorage = moveSpaceStorage;
|
|
9
|
+
function encodeStoragePath(path) {
|
|
10
|
+
return path.split('/').map(encodeURIComponent).join('/');
|
|
11
|
+
}
|
|
12
|
+
function listSpaceStorage(client, spaceId, path, request) {
|
|
13
|
+
const url = `/api/v1/space/${spaceId}/storage/list${path ? `/${encodeStoragePath(path)}` : ''}`;
|
|
14
|
+
const response = client.clientFetch(url, { query: request });
|
|
15
|
+
return response;
|
|
16
|
+
}
|
|
17
|
+
function downloadSpaceStorage(client, spaceId, path, request) {
|
|
18
|
+
const url = `/api/v1/space/${spaceId}/storage/download/${encodeStoragePath(path)}`;
|
|
19
|
+
const response = client.clientFetch(url, {
|
|
20
|
+
headers: { Accept: 'application/json' },
|
|
21
|
+
query: request,
|
|
22
|
+
});
|
|
23
|
+
return response;
|
|
24
|
+
}
|
|
25
|
+
async function uploadSpaceStorage(client, spaceId, path, request) {
|
|
26
|
+
const url = `/api/v1/space/${spaceId}/storage/upload/${encodeStoragePath(path)}`;
|
|
27
|
+
const response = await client.clientFetch(url, {
|
|
28
|
+
record: { ...request },
|
|
29
|
+
});
|
|
30
|
+
return response;
|
|
31
|
+
}
|
|
32
|
+
async function deleteSpaceStorage(client, spaceId, path, request) {
|
|
33
|
+
const url = `/api/v1/space/${spaceId}/storage/delete/${encodeStoragePath(path)}`;
|
|
34
|
+
const response = await client.clientFetch(url, {
|
|
35
|
+
record: request ? { ...request } : {},
|
|
36
|
+
});
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
39
|
+
async function copySpaceStorage(client, spaceId, path, request) {
|
|
40
|
+
const url = `/api/v1/space/${spaceId}/storage/copy/${encodeStoragePath(path)}`;
|
|
41
|
+
const response = await client.clientFetch(url, {
|
|
42
|
+
record: { ...request },
|
|
43
|
+
});
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
async function moveSpaceStorage(client, spaceId, path, request) {
|
|
47
|
+
const url = `/api/v1/space/${spaceId}/storage/move/${encodeStoragePath(path)}`;
|
|
48
|
+
const response = await client.clientFetch(url, {
|
|
49
|
+
record: { ...request },
|
|
50
|
+
});
|
|
51
|
+
return response;
|
|
52
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function listSpaceStorage(client: ChatBotKitClient, spaceId: string, path?: string, request?: SpaceStorageListRequest): ResponsePromise<SpaceStorageListResponse, never>;
|
|
2
|
+
export function downloadSpaceStorage(client: ChatBotKitClient, spaceId: string, path: string, request?: SpaceStorageDownloadRequest): ResponsePromise<SpaceStorageDownloadResponse, never>;
|
|
3
|
+
export function uploadSpaceStorage(client: ChatBotKitClient, spaceId: string, path: string, request: SpaceStorageUploadRequest): Promise<SpaceStorageUploadResponse>;
|
|
4
|
+
export function deleteSpaceStorage(client: ChatBotKitClient, spaceId: string, path: string, request?: SpaceStorageDeleteRequest): Promise<SpaceStorageDeleteResponse>;
|
|
5
|
+
export function copySpaceStorage(client: ChatBotKitClient, spaceId: string, path: string, request: SpaceStorageCopyRequest): Promise<SpaceStorageCopyResponse>;
|
|
6
|
+
export function moveSpaceStorage(client: ChatBotKitClient, spaceId: string, path: string, request: SpaceStorageMoveRequest): Promise<SpaceStorageMoveResponse>;
|
|
7
|
+
export type ChatBotKitClient = import("../../client.js").ChatBotKitClient;
|
|
8
|
+
export type ResponsePromise<T, U> = import("../../client.js").ResponsePromise<T, U>;
|
|
9
|
+
export type SpaceStorageListRequest = NonNullable<import("../../types/api/v1.js").operations["listSpaceStoragePath"]["parameters"]["query"]>;
|
|
10
|
+
export type SpaceStorageListResponse = import("../../types/api/v1.js").operations["listSpaceStoragePath"]["responses"]["200"]["content"]["application/json"];
|
|
11
|
+
export type SpaceStorageDownloadRequest = NonNullable<import("../../types/api/v1.js").operations["downloadSpaceStoragePath"]["parameters"]["query"]>;
|
|
12
|
+
export type SpaceStorageDownloadResponse = import("../../types/api/v1.js").operations["downloadSpaceStoragePath"]["responses"]["200"]["content"]["application/json"];
|
|
13
|
+
export type SpaceStorageUploadRequest = import("../../types/api/v1.js").operations["uploadSpaceStoragePath"]["requestBody"]["content"]["application/json"];
|
|
14
|
+
export type SpaceStorageUploadResponse = import("../../types/api/v1.js").operations["uploadSpaceStoragePath"]["responses"]["200"]["content"]["application/json"];
|
|
15
|
+
export type SpaceStorageDeleteRequest = NonNullable<import("../../types/api/v1.js").operations["deleteSpaceStoragePath"]["requestBody"]>["content"]["application/json"];
|
|
16
|
+
export type SpaceStorageDeleteResponse = import("../../types/api/v1.js").operations["deleteSpaceStoragePath"]["responses"]["200"]["content"]["application/json"];
|
|
17
|
+
export type SpaceStorageCopyRequest = import("../../types/api/v1.js").operations["copySpaceStoragePath"]["requestBody"]["content"]["application/json"];
|
|
18
|
+
export type SpaceStorageCopyResponse = import("../../types/api/v1.js").operations["copySpaceStoragePath"]["responses"]["200"]["content"]["application/json"];
|
|
19
|
+
export type SpaceStorageMoveRequest = import("../../types/api/v1.js").operations["moveSpaceStoragePath"]["requestBody"]["content"]["application/json"];
|
|
20
|
+
export type SpaceStorageMoveResponse = import("../../types/api/v1.js").operations["moveSpaceStoragePath"]["responses"]["200"]["content"]["application/json"];
|