@chatbotkit/sdk 1.10.0 → 1.11.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 CHANGED
@@ -2,6 +2,9 @@
2
2
  [![ChatBotKit](https://img.shields.io/badge/credits-ChatBotKit-blue.svg)](https://chatbotkit.com)
3
3
  [![CBK.AI](https://img.shields.io/badge/credits-CBK.AI-blue.svg)](https://cbk.ai)
4
4
  [![NPM](https://img.shields.io/npm/v/@chatbotkit/sdk.svg)](https://www.npmjs.com/package/@chatbotkit/sdk)
5
+ [![Email](https://img.shields.io/badge/Email-Support-blue?logo=mail.ru)](mailto:support@chatbotkit.com)
6
+ [![Discord](https://img.shields.io/badge/Discord-Support-blue?logo=discord)](https://go.cbk.ai/discord)
7
+ [![Slack](https://img.shields.io/badge/Slack-Support-blue?logo=slack)](https://go.cbk.ai/slack)
5
8
 
6
9
  # ChatBotKit Node SDK
7
10
 
@@ -50,3 +53,8 @@ For an in-depth exploration of the ChatBotKit Node SDK, including insights into
50
53
  ## Contributing
51
54
 
52
55
  Encountered a bug or interested in contributing? Your participation is highly appreciated! Feel free to open an issue or submit a pull request on our [official GitHub repository](https://github.com/chatbotkit/node-sdk).
56
+
57
+ ## Built With ChatBotKit
58
+ - [FormShare](https://formshare.ai/) - Bring your forms to life with generative UI.
59
+ - [PeopleAI](https://people.ai/) - Experience history like never before with our AI chatbots.
60
+ - [AskNotion](https://asknotion.app/) - Create your personal ChatGPT-like chatbot that is trained on your Notion Pages.
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContactClient = void 0;
4
+ const client_js_1 = require("../client.cjs");
5
+ const v1_js_1 = require("./v1.cjs");
6
+ class ContactClient extends client_js_1.ChatBotKitClient {
7
+ constructor(options) {
8
+ super(options);
9
+ }
10
+ list(request) {
11
+ return (0, v1_js_1.listContacts)(this, request);
12
+ }
13
+ fetch(contactId) {
14
+ return (0, v1_js_1.fetchContact)(this, contactId);
15
+ }
16
+ create(request) {
17
+ return (0, v1_js_1.createContact)(this, request);
18
+ }
19
+ update(contactId, request) {
20
+ return (0, v1_js_1.updateContact)(this, contactId, request);
21
+ }
22
+ delete(contactId) {
23
+ return (0, v1_js_1.deleteContact)(this, contactId);
24
+ }
25
+ }
26
+ exports.ContactClient = ContactClient;
27
+ exports.default = ContactClient;
@@ -0,0 +1,10 @@
1
+ export class ContactClient extends ChatBotKitClient {
2
+ list(request?: import('./v1.js').ContactListRequest): ResponsePromise<import('./v1.cjs').ContactListResponse, import('./v1.cjs').ContactListStreamType>;
3
+ fetch(contactId: string): Promise<import('./v1.cjs').ContactFetchResponse>;
4
+ create(request: import('./v1.cjs').ContactCreateRequest): Promise<import('./v1.cjs').ContactCreateResponse>;
5
+ update(contactId: string, request: import('./v1.cjs').ContactUpdateRequest): Promise<import('./v1.cjs').ContactUpdateResponse>;
6
+ delete(contactId: string): Promise<import('./v1.cjs').ContactDeleteResponse>;
7
+ }
8
+ export default ContactClient;
9
+ export type ResponsePromise<T, U> = import('../client.cjs').ResponsePromise<T, U>;
10
+ import { ChatBotKitClient } from '../client.cjs';
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteContact = exports.updateContact = exports.createContact = exports.fetchContact = exports.listContacts = void 0;
4
+ function listContacts(client, request) {
5
+ let url = `/api/v1/contact/list`;
6
+ const response = client.clientFetch(url, { query: request });
7
+ return response;
8
+ }
9
+ exports.listContacts = listContacts;
10
+ async function fetchContact(client, contactId) {
11
+ const url = `/api/v1/contact/${contactId}/fetch`;
12
+ const response = await client.clientFetch(url);
13
+ return response;
14
+ }
15
+ exports.fetchContact = fetchContact;
16
+ async function createContact(client, request) {
17
+ const url = `/api/v1/contact/create`;
18
+ const response = await client.clientFetch(url, {
19
+ record: {
20
+ ...request,
21
+ },
22
+ });
23
+ return response;
24
+ }
25
+ exports.createContact = createContact;
26
+ async function updateContact(client, contactId, request) {
27
+ const url = `/api/v1/contact/${contactId}/update`;
28
+ const response = await client.clientFetch(url, {
29
+ record: {
30
+ ...request,
31
+ },
32
+ });
33
+ return response;
34
+ }
35
+ exports.updateContact = updateContact;
36
+ async function deleteContact(client, contactId) {
37
+ const url = `/api/v1/contact/${contactId}/delete`;
38
+ const response = await client.clientFetch(url, {
39
+ record: {},
40
+ });
41
+ return response;
42
+ }
43
+ exports.deleteContact = deleteContact;
@@ -0,0 +1,49 @@
1
+ export function listContacts(client: ChatBotKitClient, request?: ContactListRequest): 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.cjs').ChatBotKitClient;
7
+ export type ResponsePromise<T, U> = import('../client.cjs').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.cjs').Model;
37
+ };
38
+ export type ContactCreateResponse = {
39
+ id: string;
40
+ };
41
+ export type ContactUpdateRequest = ContactOptions & {
42
+ model?: import('../model/v1.cjs').Model;
43
+ };
44
+ export type ContactUpdateResponse = {
45
+ id: string;
46
+ };
47
+ export type ContactDeleteResponse = {
48
+ id: string;
49
+ };
@@ -1,34 +1,40 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ChatBotKit = exports.ConversationClient = exports.IntegrationClient = exports.SkillsetClient = exports.DatasetClient = exports.PartnerClient = exports.MagicClient = exports.FileClient = exports.BotClient = void 0;
3
+ exports.ChatBotKit = exports.SecretClient = exports.ContactClient = exports.ConversationClient = exports.IntegrationClient = exports.SkillsetClient = exports.DatasetClient = exports.PartnerClient = exports.MagicClient = exports.FileClient = exports.BotClient = void 0;
4
4
  const index_js_1 = require("./bot/index.cjs");
5
5
  Object.defineProperty(exports, "BotClient", { enumerable: true, get: function () { return index_js_1.BotClient; } });
6
6
  const client_js_1 = require("./client.cjs");
7
- const index_js_2 = require("./conversation/index.cjs");
8
- Object.defineProperty(exports, "ConversationClient", { enumerable: true, get: function () { return index_js_2.ConversationClient; } });
9
- const index_js_3 = require("./dataset/index.cjs");
10
- Object.defineProperty(exports, "DatasetClient", { enumerable: true, get: function () { return index_js_3.DatasetClient; } });
11
- const index_js_4 = require("./file/index.cjs");
12
- Object.defineProperty(exports, "FileClient", { enumerable: true, get: function () { return index_js_4.FileClient; } });
13
- const index_js_5 = require("./integration/index.cjs");
14
- Object.defineProperty(exports, "IntegrationClient", { enumerable: true, get: function () { return index_js_5.IntegrationClient; } });
15
- const index_js_6 = require("./magic/index.cjs");
16
- Object.defineProperty(exports, "MagicClient", { enumerable: true, get: function () { return index_js_6.MagicClient; } });
17
- const index_js_7 = require("./partner/index.cjs");
18
- Object.defineProperty(exports, "PartnerClient", { enumerable: true, get: function () { return index_js_7.PartnerClient; } });
19
- const index_js_8 = require("./skillset/index.cjs");
20
- Object.defineProperty(exports, "SkillsetClient", { enumerable: true, get: function () { return index_js_8.SkillsetClient; } });
7
+ const index_js_2 = require("./contact/index.cjs");
8
+ Object.defineProperty(exports, "ContactClient", { enumerable: true, get: function () { return index_js_2.ContactClient; } });
9
+ const index_js_3 = require("./conversation/index.cjs");
10
+ Object.defineProperty(exports, "ConversationClient", { enumerable: true, get: function () { return index_js_3.ConversationClient; } });
11
+ const index_js_4 = require("./dataset/index.cjs");
12
+ Object.defineProperty(exports, "DatasetClient", { enumerable: true, get: function () { return index_js_4.DatasetClient; } });
13
+ const index_js_5 = require("./file/index.cjs");
14
+ Object.defineProperty(exports, "FileClient", { enumerable: true, get: function () { return index_js_5.FileClient; } });
15
+ const index_js_6 = require("./integration/index.cjs");
16
+ Object.defineProperty(exports, "IntegrationClient", { enumerable: true, get: function () { return index_js_6.IntegrationClient; } });
17
+ const index_js_7 = require("./magic/index.cjs");
18
+ Object.defineProperty(exports, "MagicClient", { enumerable: true, get: function () { return index_js_7.MagicClient; } });
19
+ const index_js_8 = require("./partner/index.cjs");
20
+ Object.defineProperty(exports, "PartnerClient", { enumerable: true, get: function () { return index_js_8.PartnerClient; } });
21
+ const index_js_9 = require("./secret/index.cjs");
22
+ Object.defineProperty(exports, "SecretClient", { enumerable: true, get: function () { return index_js_9.SecretClient; } });
23
+ const index_js_10 = require("./skillset/index.cjs");
24
+ Object.defineProperty(exports, "SkillsetClient", { enumerable: true, get: function () { return index_js_10.SkillsetClient; } });
21
25
  class ChatBotKit extends client_js_1.ChatBotKitClient {
22
26
  constructor(options) {
23
27
  super(options);
24
28
  this.bot = new index_js_1.BotClient(options);
25
- this.file = new index_js_4.FileClient(options);
26
- this.magic = new index_js_6.MagicClient(options);
27
- this.partner = new index_js_7.PartnerClient(options);
28
- this.dataset = new index_js_3.DatasetClient(options);
29
- this.skillset = new index_js_8.SkillsetClient(options);
30
- this.integration = new index_js_5.IntegrationClient(options);
31
- this.conversation = new index_js_2.ConversationClient(options);
29
+ this.file = new index_js_5.FileClient(options);
30
+ this.magic = new index_js_7.MagicClient(options);
31
+ this.partner = new index_js_8.PartnerClient(options);
32
+ this.dataset = new index_js_4.DatasetClient(options);
33
+ this.skillset = new index_js_10.SkillsetClient(options);
34
+ this.integration = new index_js_6.IntegrationClient(options);
35
+ this.conversation = new index_js_3.ConversationClient(options);
36
+ this.contact = new index_js_2.ContactClient(options);
37
+ this.secrets = new index_js_9.SecretClient(options);
32
38
  }
33
39
  }
34
40
  exports.ChatBotKit = ChatBotKit;
@@ -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.cjs';
@@ -17,5 +19,7 @@ import { DatasetClient } from './dataset/index.cjs';
17
19
  import { SkillsetClient } from './skillset/index.cjs';
18
20
  import { IntegrationClient } from './integration/index.cjs';
19
21
  import { ConversationClient } from './conversation/index.cjs';
22
+ import { ContactClient } from './contact/index.cjs';
23
+ import { SecretClient } from './secret/index.cjs';
20
24
  import { ChatBotKitClient } from './client.cjs';
21
- export { BotClient, FileClient, MagicClient, PartnerClient, DatasetClient, SkillsetClient, IntegrationClient, ConversationClient };
25
+ export { BotClient, FileClient, MagicClient, PartnerClient, DatasetClient, SkillsetClient, IntegrationClient, ConversationClient, ContactClient, SecretClient };
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecretClient = void 0;
4
+ const client_js_1 = require("../client.cjs");
5
+ const v1_js_1 = require("./v1.cjs");
6
+ class SecretClient extends client_js_1.ChatBotKitClient {
7
+ constructor(options) {
8
+ super(options);
9
+ }
10
+ list(request) {
11
+ return (0, v1_js_1.listSecrets)(this, request);
12
+ }
13
+ fetch(secretId) {
14
+ return (0, v1_js_1.fetchSecret)(this, secretId);
15
+ }
16
+ create(request) {
17
+ return (0, v1_js_1.createSecret)(this, request);
18
+ }
19
+ update(secretId, request) {
20
+ return (0, v1_js_1.updateSecret)(this, secretId, request);
21
+ }
22
+ delete(secretId) {
23
+ return (0, v1_js_1.deleteSecret)(this, secretId);
24
+ }
25
+ }
26
+ exports.SecretClient = SecretClient;
27
+ exports.default = SecretClient;
@@ -0,0 +1,10 @@
1
+ export class SecretClient extends ChatBotKitClient {
2
+ list(request?: import('./v1.js').SecretListRequest): ResponsePromise<import('./v1.cjs').SecretListResponse, import('./v1.cjs').SecretListStreamType>;
3
+ fetch(secretId: string): Promise<import('./v1.cjs').SecretFetchResponse>;
4
+ create(request: import('./v1.cjs').SecretCreateRequest): Promise<import('./v1.cjs').SecretCreateResponse>;
5
+ update(secretId: string, request: import('./v1.cjs').SecretUpdateRequest): Promise<import('./v1.cjs').SecretUpdateResponse>;
6
+ delete(secretId: string): Promise<import('./v1.cjs').SecretDeleteResponse>;
7
+ }
8
+ export default SecretClient;
9
+ export type ResponsePromise<T, U> = import('../client.cjs').ResponsePromise<T, U>;
10
+ import { ChatBotKitClient } from '../client.cjs';
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteSecret = exports.updateSecret = exports.createSecret = exports.fetchSecret = exports.listSecrets = void 0;
4
+ function listSecrets(client, request) {
5
+ let url = `/api/v1/secret/list`;
6
+ const response = client.clientFetch(url, { query: request });
7
+ return response;
8
+ }
9
+ exports.listSecrets = listSecrets;
10
+ async function fetchSecret(client, secretId) {
11
+ const url = `/api/v1/secret/${secretId}/fetch`;
12
+ const response = await client.clientFetch(url);
13
+ return response;
14
+ }
15
+ exports.fetchSecret = fetchSecret;
16
+ async function createSecret(client, request) {
17
+ const url = `/api/v1/secret/create`;
18
+ const response = await client.clientFetch(url, {
19
+ record: {
20
+ ...request,
21
+ },
22
+ });
23
+ return response;
24
+ }
25
+ exports.createSecret = createSecret;
26
+ async function updateSecret(client, secretId, request) {
27
+ const url = `/api/v1/secret/${secretId}/update`;
28
+ const response = await client.clientFetch(url, {
29
+ record: {
30
+ ...request,
31
+ },
32
+ });
33
+ return response;
34
+ }
35
+ exports.updateSecret = updateSecret;
36
+ async function deleteSecret(client, secretId) {
37
+ const url = `/api/v1/secret/${secretId}/delete`;
38
+ const response = await client.clientFetch(url, {
39
+ record: {},
40
+ });
41
+ return response;
42
+ }
43
+ exports.deleteSecret = deleteSecret;
@@ -0,0 +1,49 @@
1
+ export function listSecrets(client: ChatBotKitClient, request?: SecretListRequest): 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.cjs').ChatBotKitClient;
7
+ export type ResponsePromise<T, U> = import('../client.cjs').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.cjs').Model;
37
+ };
38
+ export type SecretCreateResponse = {
39
+ id: string;
40
+ };
41
+ export type SecretUpdateRequest = SecretOptions & {
42
+ model?: import('../model/v1.cjs').Model;
43
+ };
44
+ export type SecretUpdateResponse = {
45
+ id: string;
46
+ };
47
+ export type SecretDeleteResponse = {
48
+ id: string;
49
+ };
@@ -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 & {};
@@ -0,0 +1,10 @@
1
+ export class ContactClient extends ChatBotKitClient {
2
+ list(request?: import("./v1.js").ContactListRequest | undefined): ResponsePromise<import('./v1.js').ContactListResponse, import('./v1.js').ContactListStreamType>;
3
+ fetch(contactId: string): Promise<import('./v1.js').ContactFetchResponse>;
4
+ create(request: import('./v1.js').ContactCreateRequest): Promise<import('./v1.js').ContactCreateResponse>;
5
+ update(contactId: string, request: import('./v1.js').ContactUpdateRequest): Promise<import('./v1.js').ContactUpdateResponse>;
6
+ delete(contactId: string): Promise<import('./v1.js').ContactDeleteResponse>;
7
+ }
8
+ export default ContactClient;
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 { createContact, deleteContact, fetchContact, listContacts, updateContact, } from './v1.js';
3
+ export class ContactClient extends ChatBotKitClient {
4
+ constructor(options) {
5
+ super(options);
6
+ }
7
+ list(request) {
8
+ return listContacts(this, request);
9
+ }
10
+ fetch(contactId) {
11
+ return fetchContact(this, contactId);
12
+ }
13
+ create(request) {
14
+ return createContact(this, request);
15
+ }
16
+ update(contactId, request) {
17
+ return updateContact(this, contactId, request);
18
+ }
19
+ delete(contactId) {
20
+ return deleteContact(this, contactId);
21
+ }
22
+ }
23
+ export default ContactClient;
@@ -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
+ }
@@ -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;
@@ -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
+ };