@chatbotkit/sdk 1.10.0 → 1.12.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/README.md +8 -0
- package/dist/cjs/contact/index.cjs +27 -0
- package/dist/cjs/contact/index.d.ts +10 -0
- package/dist/cjs/contact/v1.cjs +43 -0
- package/dist/cjs/contact/v1.d.ts +49 -0
- package/dist/cjs/conversation/attachment/index.cjs +15 -0
- package/dist/cjs/conversation/attachment/index.d.ts +6 -0
- package/dist/cjs/conversation/attachment/v1.cjs +31 -0
- package/dist/cjs/conversation/attachment/v1.d.ts +11 -0
- package/dist/cjs/conversation/index.cjs +6 -4
- package/dist/cjs/conversation/index.d.ts +7 -5
- package/dist/cjs/index.cjs +28 -22
- package/dist/cjs/index.d.ts +5 -1
- package/dist/cjs/integration/messenger/index.d.ts +1 -1
- package/dist/cjs/integration/messenger/v1.d.ts +1 -0
- package/dist/cjs/integration/telegram/index.d.ts +1 -1
- package/dist/cjs/integration/telegram/v1.d.ts +1 -0
- package/dist/cjs/integration/whatsapp/index.d.ts +1 -1
- package/dist/cjs/integration/whatsapp/v1.d.ts +1 -0
- package/dist/cjs/integration/widget/index.d.ts +1 -1
- package/dist/cjs/integration/widget/v1.d.ts +2 -0
- package/dist/cjs/secret/index.cjs +27 -0
- package/dist/cjs/secret/index.d.ts +10 -0
- package/dist/cjs/secret/v1.cjs +43 -0
- package/dist/cjs/secret/v1.d.ts +49 -0
- package/dist/cjs/usage/v1.d.ts +8 -0
- package/dist/esm/contact/index.d.ts +10 -0
- package/dist/esm/contact/index.js +23 -0
- package/dist/esm/contact/v1.d.ts +49 -0
- package/dist/esm/contact/v1.js +35 -0
- package/dist/esm/conversation/attachment/index.d.ts +6 -0
- package/dist/esm/conversation/attachment/index.js +11 -0
- package/dist/esm/conversation/attachment/v1.d.ts +11 -0
- package/dist/esm/conversation/attachment/v1.js +27 -0
- package/dist/esm/conversation/index.d.ts +2 -0
- package/dist/esm/conversation/index.js +2 -0
- package/dist/esm/index.d.ts +5 -1
- package/dist/esm/index.js +6 -0
- package/dist/esm/integration/messenger/v1.d.ts +1 -0
- package/dist/esm/integration/telegram/v1.d.ts +1 -0
- package/dist/esm/integration/whatsapp/v1.d.ts +1 -0
- package/dist/esm/integration/widget/v1.d.ts +2 -0
- package/dist/esm/secret/index.d.ts +10 -0
- package/dist/esm/secret/index.js +23 -0
- package/dist/esm/secret/v1.d.ts +49 -0
- package/dist/esm/secret/v1.js +35 -0
- package/dist/esm/usage/v1.d.ts +8 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +151 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function listContacts(client: ChatBotKitClient, request?: ContactListRequest | undefined): ResponsePromise<ContactListResponse, ContactListStreamType>;
|
|
2
|
+
export function fetchContact(client: ChatBotKitClient, contactId: string): Promise<ContactFetchResponse>;
|
|
3
|
+
export function createContact(client: ChatBotKitClient, request: ContactCreateRequest): Promise<ContactCreateResponse>;
|
|
4
|
+
export function updateContact(client: ChatBotKitClient, contactId: string, request: ContactUpdateRequest): Promise<ContactUpdateResponse>;
|
|
5
|
+
export function deleteContact(client: ChatBotKitClient, contactId: string): Promise<ContactDeleteResponse>;
|
|
6
|
+
export type ChatBotKitClient = import('../client.js').ChatBotKitClient;
|
|
7
|
+
export type ResponsePromise<T, U> = import('../client.js').ResponsePromise<T, U>;
|
|
8
|
+
export type ContactOptions = {
|
|
9
|
+
name?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
email?: string;
|
|
12
|
+
phone?: string;
|
|
13
|
+
meta?: Record<string, any>;
|
|
14
|
+
};
|
|
15
|
+
export type ContactInstance = ContactOptions & {
|
|
16
|
+
id: string;
|
|
17
|
+
createdAt: number;
|
|
18
|
+
updatedAt: number;
|
|
19
|
+
};
|
|
20
|
+
export type ContactListRequest = {
|
|
21
|
+
cursor?: string;
|
|
22
|
+
order?: 'desc' | 'asc';
|
|
23
|
+
take?: number;
|
|
24
|
+
meta?: Record<string, string>;
|
|
25
|
+
};
|
|
26
|
+
export type ContactListResponse = {
|
|
27
|
+
items: ContactInstance[];
|
|
28
|
+
};
|
|
29
|
+
export type ContactListStreamItemType = {
|
|
30
|
+
type: 'item';
|
|
31
|
+
data: ContactInstance;
|
|
32
|
+
};
|
|
33
|
+
export type ContactListStreamType = ContactListStreamItemType;
|
|
34
|
+
export type ContactFetchResponse = ContactInstance & {};
|
|
35
|
+
export type ContactCreateRequest = ContactOptions & {
|
|
36
|
+
model?: import('../model/v1.js').Model;
|
|
37
|
+
};
|
|
38
|
+
export type ContactCreateResponse = {
|
|
39
|
+
id: string;
|
|
40
|
+
};
|
|
41
|
+
export type ContactUpdateRequest = ContactOptions & {
|
|
42
|
+
model?: import('../model/v1.js').Model;
|
|
43
|
+
};
|
|
44
|
+
export type ContactUpdateResponse = {
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
export type ContactDeleteResponse = {
|
|
48
|
+
id: string;
|
|
49
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function listContacts(client, request) {
|
|
2
|
+
let url = `/api/v1/contact/list`;
|
|
3
|
+
const response = client.clientFetch(url, { query: request });
|
|
4
|
+
return response;
|
|
5
|
+
}
|
|
6
|
+
export async function fetchContact(client, contactId) {
|
|
7
|
+
const url = `/api/v1/contact/${contactId}/fetch`;
|
|
8
|
+
const response = await client.clientFetch(url);
|
|
9
|
+
return response;
|
|
10
|
+
}
|
|
11
|
+
export async function createContact(client, request) {
|
|
12
|
+
const url = `/api/v1/contact/create`;
|
|
13
|
+
const response = await client.clientFetch(url, {
|
|
14
|
+
record: {
|
|
15
|
+
...request,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return response;
|
|
19
|
+
}
|
|
20
|
+
export async function updateContact(client, contactId, request) {
|
|
21
|
+
const url = `/api/v1/contact/${contactId}/update`;
|
|
22
|
+
const response = await client.clientFetch(url, {
|
|
23
|
+
record: {
|
|
24
|
+
...request,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
export async function deleteContact(client, contactId) {
|
|
30
|
+
const url = `/api/v1/contact/${contactId}/delete`;
|
|
31
|
+
const response = await client.clientFetch(url, {
|
|
32
|
+
record: {},
|
|
33
|
+
});
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export class ConversationAttachmentClient extends ChatBotKitClient {
|
|
2
|
+
upload(fileId: string, request: import('./v1.js').ConversationAttachmentUploadRequest): Promise<import('./v1.js').ConversationAttachmentUploadResponse>;
|
|
3
|
+
}
|
|
4
|
+
export default ConversationAttachmentClient;
|
|
5
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
6
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
2
|
+
import { uploadConversationAttachment } from './v1.js';
|
|
3
|
+
export class ConversationAttachmentClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
upload(fileId, request) {
|
|
8
|
+
return uploadConversationAttachment(this, fileId, request);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export default ConversationAttachmentClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function uploadConversationAttachment(client: ChatBotKitClient, attachmentId: string, request: ConversationAttachmentUploadRequest): Promise<ConversationAttachmentUploadResponse>;
|
|
2
|
+
export type ChatBotKitClient = import('../../client.js').ChatBotKitClient;
|
|
3
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
4
|
+
export type ConversationAttachmentUploadRequest = {
|
|
5
|
+
data: string | ArrayBuffer;
|
|
6
|
+
type: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
};
|
|
9
|
+
export type ConversationAttachmentUploadResponse = {
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getBuffer } from '../../buffer.js';
|
|
2
|
+
export async function uploadConversationAttachment(client, attachmentId, request) {
|
|
3
|
+
const url = `/api/v1/Attachment/${attachmentId}/upload`;
|
|
4
|
+
const buffer = getBuffer(request.data);
|
|
5
|
+
const response = await client.clientFetch(url, {
|
|
6
|
+
record: {
|
|
7
|
+
file: {
|
|
8
|
+
size: buffer.byteLength,
|
|
9
|
+
type: request.type,
|
|
10
|
+
name: request.name,
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
const { uploadRequest } = response;
|
|
15
|
+
if (!uploadRequest) {
|
|
16
|
+
throw new Error('Missing upload request');
|
|
17
|
+
}
|
|
18
|
+
await client.clientFetch(uploadRequest.url, {
|
|
19
|
+
method: uploadRequest.method,
|
|
20
|
+
headers: uploadRequest.headers,
|
|
21
|
+
buffer: buffer,
|
|
22
|
+
external: true,
|
|
23
|
+
});
|
|
24
|
+
return {
|
|
25
|
+
id: response.id,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export class ConversationClient extends ChatBotKitClient {
|
|
2
2
|
message: ConversationMessageClient;
|
|
3
3
|
session: ConversationSessionClient;
|
|
4
|
+
attachment: ConversationAttachmentClient;
|
|
4
5
|
list(request?: import("./v1.js").ConversationListRequest | undefined): ResponsePromise<import('./v1.js').ConversationListResponse, import('./v1.js').ConversationListStreamType>;
|
|
5
6
|
fetch(conversationId: string): Promise<import('./v1.js').ConversationFetchResponse>;
|
|
6
7
|
create(request: import('./v1.js').ConversationCreateRequest): Promise<import('./v1.js').ConversationCreateResponse>;
|
|
@@ -18,3 +19,4 @@ export type ResponsePromise<T, U> = import('../client.js').ResponsePromise<T, U>
|
|
|
18
19
|
import { ChatBotKitClient } from '../client.js';
|
|
19
20
|
import { ConversationMessageClient } from './message/index.js';
|
|
20
21
|
import { ConversationSessionClient } from './session/index.js';
|
|
22
|
+
import { ConversationAttachmentClient } from './attachment/index.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChatBotKitClient } from '../client.js';
|
|
2
|
+
import { ConversationAttachmentClient } from './attachment/index.js';
|
|
2
3
|
import { ConversationMessageClient } from './message/index.js';
|
|
3
4
|
import { ConversationSessionClient } from './session/index.js';
|
|
4
5
|
import { completeConversation, completeConversationMessage, createConversation, deleteConversation, downvoteConversation, fetchConversation, listConversations, receiveConversationMessage, sendConversationMessage, updateConversation, upvoteConversation, } from './v1.js';
|
|
@@ -7,6 +8,7 @@ export class ConversationClient extends ChatBotKitClient {
|
|
|
7
8
|
super(options);
|
|
8
9
|
this.message = new ConversationMessageClient(options);
|
|
9
10
|
this.session = new ConversationSessionClient(options);
|
|
11
|
+
this.attachment = new ConversationAttachmentClient(options);
|
|
10
12
|
}
|
|
11
13
|
list(request) {
|
|
12
14
|
return listConversations(this, request);
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export class ChatBotKit extends ChatBotKitClient {
|
|
|
7
7
|
skillset: SkillsetClient;
|
|
8
8
|
integration: IntegrationClient;
|
|
9
9
|
conversation: ConversationClient;
|
|
10
|
+
contact: ContactClient;
|
|
11
|
+
secrets: SecretClient;
|
|
10
12
|
}
|
|
11
13
|
export default ChatBotKit;
|
|
12
14
|
import { BotClient } from './bot/index.js';
|
|
@@ -17,5 +19,7 @@ import { DatasetClient } from './dataset/index.js';
|
|
|
17
19
|
import { SkillsetClient } from './skillset/index.js';
|
|
18
20
|
import { IntegrationClient } from './integration/index.js';
|
|
19
21
|
import { ConversationClient } from './conversation/index.js';
|
|
22
|
+
import { ContactClient } from './contact/index.js';
|
|
23
|
+
import { SecretClient } from './secret/index.js';
|
|
20
24
|
import { ChatBotKitClient } from './client.js';
|
|
21
|
-
export { BotClient, FileClient, MagicClient, PartnerClient, DatasetClient, SkillsetClient, IntegrationClient, ConversationClient };
|
|
25
|
+
export { BotClient, FileClient, MagicClient, PartnerClient, DatasetClient, SkillsetClient, IntegrationClient, ConversationClient, ContactClient, SecretClient };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { BotClient } from './bot/index.js';
|
|
2
2
|
import { ChatBotKitClient } from './client.js';
|
|
3
|
+
import { ContactClient } from './contact/index.js';
|
|
3
4
|
import { ConversationClient } from './conversation/index.js';
|
|
4
5
|
import { DatasetClient } from './dataset/index.js';
|
|
5
6
|
import { FileClient } from './file/index.js';
|
|
6
7
|
import { IntegrationClient } from './integration/index.js';
|
|
7
8
|
import { MagicClient } from './magic/index.js';
|
|
8
9
|
import { PartnerClient } from './partner/index.js';
|
|
10
|
+
import { SecretClient } from './secret/index.js';
|
|
9
11
|
import { SkillsetClient } from './skillset/index.js';
|
|
10
12
|
export { BotClient };
|
|
11
13
|
export { FileClient };
|
|
@@ -15,6 +17,8 @@ export { DatasetClient };
|
|
|
15
17
|
export { SkillsetClient };
|
|
16
18
|
export { IntegrationClient };
|
|
17
19
|
export { ConversationClient };
|
|
20
|
+
export { ContactClient };
|
|
21
|
+
export { SecretClient };
|
|
18
22
|
export class ChatBotKit extends ChatBotKitClient {
|
|
19
23
|
constructor(options) {
|
|
20
24
|
super(options);
|
|
@@ -26,6 +30,8 @@ export class ChatBotKit extends ChatBotKitClient {
|
|
|
26
30
|
this.skillset = new SkillsetClient(options);
|
|
27
31
|
this.integration = new IntegrationClient(options);
|
|
28
32
|
this.conversation = new ConversationClient(options);
|
|
33
|
+
this.contact = new ContactClient(options);
|
|
34
|
+
this.secrets = new SecretClient(options);
|
|
29
35
|
}
|
|
30
36
|
}
|
|
31
37
|
export default ChatBotKit;
|
|
@@ -23,6 +23,7 @@ export type MessengerIntegrationOptions = BotRefOrConfig & {
|
|
|
23
23
|
description?: string;
|
|
24
24
|
accessToken?: string;
|
|
25
25
|
sessionDuration?: number;
|
|
26
|
+
attachments?: boolean;
|
|
26
27
|
meta?: Record<string, any>;
|
|
27
28
|
};
|
|
28
29
|
export type MessengerIntegrationInstance = MessengerIntegrationOptions & {
|
|
@@ -23,6 +23,7 @@ export type TelegramIntegrationOptions = BotRefOrConfig & {
|
|
|
23
23
|
description?: string;
|
|
24
24
|
botToken?: string;
|
|
25
25
|
sessionDuration?: number;
|
|
26
|
+
attachments?: boolean;
|
|
26
27
|
meta?: Record<string, any>;
|
|
27
28
|
};
|
|
28
29
|
export type TelegramIntegrationInstance = TelegramIntegrationOptions & {
|
|
@@ -24,6 +24,7 @@ export type WhatsAppIntegrationOptions = BotRefOrConfig & {
|
|
|
24
24
|
phoneNumberId?: string;
|
|
25
25
|
accessToken?: string;
|
|
26
26
|
sessionDuration?: number;
|
|
27
|
+
attachments?: boolean;
|
|
27
28
|
meta?: Record<string, any>;
|
|
28
29
|
};
|
|
29
30
|
export type WhatsAppIntegrationInstance = WhatsAppIntegrationOptions & {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class SecretClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import("./v1.js").SecretListRequest | undefined): ResponsePromise<import('./v1.js').SecretListResponse, import('./v1.js').SecretListStreamType>;
|
|
3
|
+
fetch(secretId: string): Promise<import('./v1.js').SecretFetchResponse>;
|
|
4
|
+
create(request: import('./v1.js').SecretCreateRequest): Promise<import('./v1.js').SecretCreateResponse>;
|
|
5
|
+
update(secretId: string, request: import('./v1.js').SecretUpdateRequest): Promise<import('./v1.js').SecretUpdateResponse>;
|
|
6
|
+
delete(secretId: string): Promise<import('./v1.js').SecretDeleteResponse>;
|
|
7
|
+
}
|
|
8
|
+
export default SecretClient;
|
|
9
|
+
export type ResponsePromise<T, U> = import('../client.js').ResponsePromise<T, U>;
|
|
10
|
+
import { ChatBotKitClient } from '../client.js';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChatBotKitClient } from '../client.js';
|
|
2
|
+
import { createSecret, deleteSecret, fetchSecret, listSecrets, updateSecret, } from './v1.js';
|
|
3
|
+
export class SecretClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(request) {
|
|
8
|
+
return listSecrets(this, request);
|
|
9
|
+
}
|
|
10
|
+
fetch(secretId) {
|
|
11
|
+
return fetchSecret(this, secretId);
|
|
12
|
+
}
|
|
13
|
+
create(request) {
|
|
14
|
+
return createSecret(this, request);
|
|
15
|
+
}
|
|
16
|
+
update(secretId, request) {
|
|
17
|
+
return updateSecret(this, secretId, request);
|
|
18
|
+
}
|
|
19
|
+
delete(secretId) {
|
|
20
|
+
return deleteSecret(this, secretId);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export default SecretClient;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function listSecrets(client: ChatBotKitClient, request?: SecretListRequest | undefined): ResponsePromise<SecretListResponse, SecretListStreamType>;
|
|
2
|
+
export function fetchSecret(client: ChatBotKitClient, secretId: string): Promise<SecretFetchResponse>;
|
|
3
|
+
export function createSecret(client: ChatBotKitClient, request: SecretCreateRequest): Promise<SecretCreateResponse>;
|
|
4
|
+
export function updateSecret(client: ChatBotKitClient, secretId: string, request: SecretUpdateRequest): Promise<SecretUpdateResponse>;
|
|
5
|
+
export function deleteSecret(client: ChatBotKitClient, secretId: string): Promise<SecretDeleteResponse>;
|
|
6
|
+
export type ChatBotKitClient = import('../client.js').ChatBotKitClient;
|
|
7
|
+
export type ResponsePromise<T, U> = import('../client.js').ResponsePromise<T, U>;
|
|
8
|
+
export type SecretOptions = {
|
|
9
|
+
name?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
type?: 'bearer' | 'plain' | 'basic';
|
|
12
|
+
value?: string;
|
|
13
|
+
meta?: Record<string, any>;
|
|
14
|
+
};
|
|
15
|
+
export type SecretInstance = SecretOptions & {
|
|
16
|
+
id: string;
|
|
17
|
+
createdAt: number;
|
|
18
|
+
updatedAt: number;
|
|
19
|
+
};
|
|
20
|
+
export type SecretListRequest = {
|
|
21
|
+
cursor?: string;
|
|
22
|
+
order?: 'desc' | 'asc';
|
|
23
|
+
take?: number;
|
|
24
|
+
meta?: Record<string, string>;
|
|
25
|
+
};
|
|
26
|
+
export type SecretListResponse = {
|
|
27
|
+
items: SecretInstance[];
|
|
28
|
+
};
|
|
29
|
+
export type SecretListStreamItemType = {
|
|
30
|
+
type: 'item';
|
|
31
|
+
data: SecretInstance;
|
|
32
|
+
};
|
|
33
|
+
export type SecretListStreamType = SecretListStreamItemType;
|
|
34
|
+
export type SecretFetchResponse = SecretInstance & {};
|
|
35
|
+
export type SecretCreateRequest = SecretOptions & {
|
|
36
|
+
model?: import('../model/v1.js').Model;
|
|
37
|
+
};
|
|
38
|
+
export type SecretCreateResponse = {
|
|
39
|
+
id: string;
|
|
40
|
+
};
|
|
41
|
+
export type SecretUpdateRequest = SecretOptions & {
|
|
42
|
+
model?: import('../model/v1.js').Model;
|
|
43
|
+
};
|
|
44
|
+
export type SecretUpdateResponse = {
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
export type SecretDeleteResponse = {
|
|
48
|
+
id: string;
|
|
49
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function listSecrets(client, request) {
|
|
2
|
+
let url = `/api/v1/secret/list`;
|
|
3
|
+
const response = client.clientFetch(url, { query: request });
|
|
4
|
+
return response;
|
|
5
|
+
}
|
|
6
|
+
export async function fetchSecret(client, secretId) {
|
|
7
|
+
const url = `/api/v1/secret/${secretId}/fetch`;
|
|
8
|
+
const response = await client.clientFetch(url);
|
|
9
|
+
return response;
|
|
10
|
+
}
|
|
11
|
+
export async function createSecret(client, request) {
|
|
12
|
+
const url = `/api/v1/secret/create`;
|
|
13
|
+
const response = await client.clientFetch(url, {
|
|
14
|
+
record: {
|
|
15
|
+
...request,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return response;
|
|
19
|
+
}
|
|
20
|
+
export async function updateSecret(client, secretId, request) {
|
|
21
|
+
const url = `/api/v1/secret/${secretId}/update`;
|
|
22
|
+
const response = await client.clientFetch(url, {
|
|
23
|
+
record: {
|
|
24
|
+
...request,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
export async function deleteSecret(client, secretId) {
|
|
30
|
+
const url = `/api/v1/secret/${secretId}/delete`;
|
|
31
|
+
const response = await client.clientFetch(url, {
|
|
32
|
+
record: {},
|
|
33
|
+
});
|
|
34
|
+
return response;
|
|
35
|
+
}
|
package/dist/esm/usage/v1.d.ts
CHANGED
|
@@ -4,6 +4,14 @@ export type UsageOptions = {
|
|
|
4
4
|
tokens: number;
|
|
5
5
|
conversations: number;
|
|
6
6
|
messages: number;
|
|
7
|
+
database: {
|
|
8
|
+
datasets: number;
|
|
9
|
+
records: number;
|
|
10
|
+
skillsets: number;
|
|
11
|
+
abilities: number;
|
|
12
|
+
files: number;
|
|
13
|
+
users: number;
|
|
14
|
+
};
|
|
7
15
|
};
|
|
8
16
|
export type UsageInstance = UsageOptions & {};
|
|
9
17
|
export type UsageFetchResponse = UsageInstance & {};
|