@chatbotkit/sdk 1.9.1 → 1.10.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/bot/v1.d.ts +1 -0
- package/dist/cjs/conversation/message/v1.d.ts +1 -1
- package/dist/cjs/dataset/v1.d.ts +3 -1
- package/dist/cjs/integration/discord/index.cjs +30 -0
- package/dist/cjs/integration/discord/index.d.ts +11 -0
- package/dist/cjs/integration/discord/v1.cjs +54 -0
- package/dist/cjs/integration/discord/v1.d.ts +68 -0
- package/dist/cjs/integration/extract/index.cjs +27 -0
- package/dist/cjs/integration/extract/index.d.ts +10 -0
- package/dist/cjs/integration/extract/v1.cjs +43 -0
- package/dist/cjs/integration/extract/v1.d.ts +49 -0
- package/dist/cjs/integration/index.cjs +20 -6
- package/dist/cjs/integration/index.d.ts +16 -2
- package/dist/cjs/integration/messenger/index.cjs +30 -0
- package/dist/cjs/integration/messenger/index.d.ts +11 -0
- package/dist/cjs/integration/messenger/v1.cjs +54 -0
- package/dist/cjs/integration/messenger/v1.d.ts +66 -0
- package/dist/cjs/integration/notion/index.cjs +30 -0
- package/dist/cjs/integration/notion/index.d.ts +11 -0
- package/dist/cjs/integration/notion/v1.cjs +51 -0
- package/dist/cjs/integration/notion/v1.d.ts +53 -0
- package/dist/cjs/integration/slack/index.cjs +30 -0
- package/dist/cjs/integration/slack/index.d.ts +11 -0
- package/dist/cjs/integration/slack/v1.cjs +54 -0
- package/dist/cjs/integration/slack/v1.d.ts +67 -0
- package/dist/cjs/integration/support/index.cjs +27 -0
- package/dist/cjs/integration/support/index.d.ts +10 -0
- package/dist/cjs/integration/support/v1.cjs +43 -0
- package/dist/cjs/integration/support/v1.d.ts +49 -0
- package/dist/cjs/integration/telegram/index.cjs +30 -0
- package/dist/cjs/integration/telegram/index.d.ts +11 -0
- package/dist/cjs/integration/telegram/v1.cjs +54 -0
- package/dist/cjs/integration/telegram/v1.d.ts +65 -0
- 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 +21 -0
- package/dist/cjs/skillset/v1.d.ts +1 -0
- package/dist/cjs/usage/index.cjs +2 -0
- package/dist/cjs/usage/index.d.ts +2 -0
- package/dist/cjs/usage/series/index.cjs +15 -0
- package/dist/cjs/usage/series/index.d.ts +5 -0
- package/dist/cjs/usage/series/v1.cjs +9 -0
- package/dist/cjs/usage/series/v1.d.ts +18 -0
- package/dist/cjs/usage/v1.d.ts +1 -0
- package/dist/esm/bot/v1.d.ts +1 -0
- package/dist/esm/conversation/message/v1.d.ts +1 -1
- package/dist/esm/dataset/v1.d.ts +3 -1
- package/dist/esm/integration/discord/index.d.ts +11 -0
- package/dist/esm/integration/discord/index.js +26 -0
- package/dist/esm/integration/discord/v1.d.ts +68 -0
- package/dist/esm/integration/discord/v1.js +45 -0
- package/dist/esm/integration/extract/index.d.ts +10 -0
- package/dist/esm/integration/extract/index.js +23 -0
- package/dist/esm/integration/extract/v1.d.ts +49 -0
- package/dist/esm/integration/extract/v1.js +35 -0
- package/dist/esm/integration/index.d.ts +16 -2
- package/dist/esm/integration/index.js +15 -1
- package/dist/esm/integration/messenger/index.d.ts +11 -0
- package/dist/esm/integration/messenger/index.js +26 -0
- package/dist/esm/integration/messenger/v1.d.ts +66 -0
- package/dist/esm/integration/messenger/v1.js +45 -0
- package/dist/esm/integration/notion/index.d.ts +11 -0
- package/dist/esm/integration/notion/index.js +26 -0
- package/dist/esm/integration/notion/v1.d.ts +53 -0
- package/dist/esm/integration/notion/v1.js +42 -0
- package/dist/esm/integration/slack/index.d.ts +11 -0
- package/dist/esm/integration/slack/index.js +26 -0
- package/dist/esm/integration/slack/v1.d.ts +67 -0
- package/dist/esm/integration/slack/v1.js +45 -0
- package/dist/esm/integration/support/index.d.ts +10 -0
- package/dist/esm/integration/support/index.js +23 -0
- package/dist/esm/integration/support/v1.d.ts +49 -0
- package/dist/esm/integration/support/v1.js +35 -0
- package/dist/esm/integration/telegram/index.d.ts +11 -0
- package/dist/esm/integration/telegram/index.js +26 -0
- package/dist/esm/integration/telegram/v1.d.ts +65 -0
- package/dist/esm/integration/telegram/v1.js +45 -0
- package/dist/esm/integration/whatsapp/v1.d.ts +1 -0
- package/dist/esm/integration/widget/v1.d.ts +21 -0
- package/dist/esm/skillset/v1.d.ts +1 -0
- package/dist/esm/usage/index.d.ts +2 -0
- package/dist/esm/usage/index.js +2 -0
- package/dist/esm/usage/series/index.d.ts +5 -0
- package/dist/esm/usage/series/index.js +11 -0
- package/dist/esm/usage/series/v1.d.ts +18 -0
- package/dist/esm/usage/series/v1.js +5 -0
- package/dist/esm/usage/v1.d.ts +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +401 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export function listNotionIntegrations(client: ChatBotKitClient, request?: NotionIntegrationListRequest | undefined): ResponsePromise<NotionIntegrationListResponse, NotionIntegrationListStreamType>;
|
|
2
|
+
export function fetchNotionIntegration(client: ChatBotKitClient, notionId: string): Promise<NotionIntegrationFetchResponse>;
|
|
3
|
+
export function createNotionIntegration(client: ChatBotKitClient, request: NotionIntegrationCreateRequest): Promise<NotionIntegrationCreateResponse>;
|
|
4
|
+
export function updateNotionIntegration(client: ChatBotKitClient, notionId: string, request: NotionIntegrationUpdateRequest): Promise<NotionIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteNotionIntegration(client: ChatBotKitClient, notionId: string): Promise<NotionIntegrationDeleteResponse>;
|
|
6
|
+
export function syncNotionIntegration(client: ChatBotKitClient, notionId: string): Promise<NotionIntegrationSyncResponse>;
|
|
7
|
+
export type ChatBotKitClient = import('../../client.js').ChatBotKitClient;
|
|
8
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
9
|
+
export type NotionIntegrationOptions = {
|
|
10
|
+
name?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
datasetId?: string;
|
|
13
|
+
token?: string;
|
|
14
|
+
syncSchedule?: string;
|
|
15
|
+
expiresIn?: number;
|
|
16
|
+
meta?: Record<string, any>;
|
|
17
|
+
};
|
|
18
|
+
export type NotionInegrationInstance = NotionIntegrationOptions & {
|
|
19
|
+
id: string;
|
|
20
|
+
createdAt: number;
|
|
21
|
+
updatedAt: number;
|
|
22
|
+
};
|
|
23
|
+
export type NotionIntegrationListRequest = {
|
|
24
|
+
cursor?: string;
|
|
25
|
+
order?: 'desc' | 'asc';
|
|
26
|
+
take?: number;
|
|
27
|
+
meta?: Record<string, string>;
|
|
28
|
+
};
|
|
29
|
+
export type NotionIntegrationListResponse = {
|
|
30
|
+
items: NotionInegrationInstance[];
|
|
31
|
+
};
|
|
32
|
+
export type NotionIntegrationListStreamItem = {
|
|
33
|
+
type: 'item';
|
|
34
|
+
data: NotionInegrationInstance;
|
|
35
|
+
};
|
|
36
|
+
export type NotionIntegrationListStreamType = NotionIntegrationListStreamItem;
|
|
37
|
+
export type NotionIntegrationFetchResponse = NotionInegrationInstance & {};
|
|
38
|
+
export type NotionIntegrationCreateRequest = NotionIntegrationOptions & {
|
|
39
|
+
datasetId: string;
|
|
40
|
+
};
|
|
41
|
+
export type NotionIntegrationCreateResponse = {
|
|
42
|
+
id: string;
|
|
43
|
+
};
|
|
44
|
+
export type NotionIntegrationUpdateRequest = NotionIntegrationOptions & {};
|
|
45
|
+
export type NotionIntegrationUpdateResponse = {
|
|
46
|
+
id: string;
|
|
47
|
+
};
|
|
48
|
+
export type NotionIntegrationDeleteResponse = {
|
|
49
|
+
id: string;
|
|
50
|
+
};
|
|
51
|
+
export type NotionIntegrationSyncResponse = {
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export function listNotionIntegrations(client, request) {
|
|
2
|
+
let url = `/api/v1/integration/notion/list`;
|
|
3
|
+
const response = client.clientFetch(url, { query: request });
|
|
4
|
+
return response;
|
|
5
|
+
}
|
|
6
|
+
export async function fetchNotionIntegration(client, notionId) {
|
|
7
|
+
const url = `/api/v1/integration/notion/${notionId}/fetch`;
|
|
8
|
+
const response = await client.clientFetch(url);
|
|
9
|
+
return response;
|
|
10
|
+
}
|
|
11
|
+
export async function createNotionIntegration(client, request) {
|
|
12
|
+
const url = `/api/v1/integration/notion/create`;
|
|
13
|
+
const response = await client.clientFetch(url, {
|
|
14
|
+
record: {
|
|
15
|
+
...request,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return response;
|
|
19
|
+
}
|
|
20
|
+
export async function updateNotionIntegration(client, notionId, request) {
|
|
21
|
+
const url = `/api/v1/integration/notion/${notionId}/update`;
|
|
22
|
+
const response = await client.clientFetch(url, {
|
|
23
|
+
record: {
|
|
24
|
+
...request,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
export async function deleteNotionIntegration(client, notionId) {
|
|
30
|
+
const url = `/api/v1/integration/notion/${notionId}/delete`;
|
|
31
|
+
const response = await client.clientFetch(url, {
|
|
32
|
+
record: {},
|
|
33
|
+
});
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
36
|
+
export async function syncNotionIntegration(client, notionId) {
|
|
37
|
+
const url = `/api/v1/integration/notion/${notionId}/sync`;
|
|
38
|
+
const response = await client.clientFetch(url, {
|
|
39
|
+
record: {},
|
|
40
|
+
});
|
|
41
|
+
return response;
|
|
42
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class SlackIntegrationClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import("./v1.js").SlackIntegrationListRequest | undefined): ResponsePromise<import('./v1.js').SlackIntegrationListResponse, import('./v1.js').SlackIntegrationListStreamType>;
|
|
3
|
+
fetch(slackId: string): Promise<import('./v1.js').SlackIntegrationFetchResponse>;
|
|
4
|
+
create(request: import('./v1.js').SlackIntegrationCreateRequest): Promise<import('./v1.js').SlackIntegrationCreateResponse>;
|
|
5
|
+
update(slackId: string, request: import('./v1.js').SlackIntegrationUpdateRequest): Promise<import('./v1.js').SlackIntegrationUpdateResponse>;
|
|
6
|
+
delete(slackId: string): Promise<import('./v1.js').SlackIntegrationDeleteResponse>;
|
|
7
|
+
setup(slackId: string): Promise<import('./v1.js').SlackIntegrationSetupResponse>;
|
|
8
|
+
}
|
|
9
|
+
export default SlackIntegrationClient;
|
|
10
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
11
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
2
|
+
import { createSlackIntegration, deleteSlackIntegration, fetchSlackIntegration, listSlackIntegrations, setupSlackIntegration, updateSlackIntegration, } from './v1.js';
|
|
3
|
+
export class SlackIntegrationClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(request) {
|
|
8
|
+
return listSlackIntegrations(this, request);
|
|
9
|
+
}
|
|
10
|
+
fetch(slackId) {
|
|
11
|
+
return fetchSlackIntegration(this, slackId);
|
|
12
|
+
}
|
|
13
|
+
create(request) {
|
|
14
|
+
return createSlackIntegration(this, request);
|
|
15
|
+
}
|
|
16
|
+
update(slackId, request) {
|
|
17
|
+
return updateSlackIntegration(this, slackId, request);
|
|
18
|
+
}
|
|
19
|
+
delete(slackId) {
|
|
20
|
+
return deleteSlackIntegration(this, slackId);
|
|
21
|
+
}
|
|
22
|
+
setup(slackId) {
|
|
23
|
+
return setupSlackIntegration(this, slackId);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export default SlackIntegrationClient;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export function listSlackIntegrations(client: ChatBotKitClient, request?: SlackIntegrationListRequest | undefined): ResponsePromise<SlackIntegrationListResponse, SlackIntegrationListStreamType>;
|
|
2
|
+
export function fetchSlackIntegration(client: ChatBotKitClient, slackId: string): Promise<SlackIntegrationFetchResponse>;
|
|
3
|
+
export function createSlackIntegration(client: ChatBotKitClient, request: SlackIntegrationCreateRequest): Promise<SlackIntegrationCreateResponse>;
|
|
4
|
+
export function updateSlackIntegration(client: ChatBotKitClient, slackId: string, request: SlackIntegrationUpdateRequest): Promise<SlackIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteSlackIntegration(client: ChatBotKitClient, slackId: string): Promise<SlackIntegrationDeleteResponse>;
|
|
6
|
+
export function setupSlackIntegration(client: ChatBotKitClient, slackId: string): Promise<SlackIntegrationSetupResponse>;
|
|
7
|
+
export type ChatBotKitClient = import('../../client.js').ChatBotKitClient;
|
|
8
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
9
|
+
export type BotRef = {
|
|
10
|
+
botId?: string;
|
|
11
|
+
};
|
|
12
|
+
export type BotConfig = {
|
|
13
|
+
backstory?: string;
|
|
14
|
+
model?: string;
|
|
15
|
+
datasetId?: string;
|
|
16
|
+
skillsetId?: string;
|
|
17
|
+
privacy?: boolean;
|
|
18
|
+
moderation?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type BotRefOrConfig = BotRef | BotConfig;
|
|
21
|
+
export type SlackIntegrationOptions = BotRefOrConfig & {
|
|
22
|
+
name?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
signingSecret?: string;
|
|
25
|
+
botToken?: string;
|
|
26
|
+
visibleMessages?: number;
|
|
27
|
+
sessionDuration?: number;
|
|
28
|
+
meta?: Record<string, any>;
|
|
29
|
+
};
|
|
30
|
+
export type SlackIntegrationInstance = SlackIntegrationOptions & {
|
|
31
|
+
id: string;
|
|
32
|
+
createdAt: number;
|
|
33
|
+
updatedAt: number;
|
|
34
|
+
};
|
|
35
|
+
export type SlackIntegrationListRequest = {
|
|
36
|
+
cursor?: string;
|
|
37
|
+
order?: 'desc' | 'asc';
|
|
38
|
+
take?: number;
|
|
39
|
+
meta?: Record<string, string>;
|
|
40
|
+
};
|
|
41
|
+
export type SlackIntegrationListResponse = {
|
|
42
|
+
items: SlackIntegrationInstance[];
|
|
43
|
+
};
|
|
44
|
+
export type SlackIntegrationListStreamItem = {
|
|
45
|
+
type: 'item';
|
|
46
|
+
data: SlackIntegrationInstance;
|
|
47
|
+
};
|
|
48
|
+
export type SlackIntegrationListStreamType = SlackIntegrationListStreamItem;
|
|
49
|
+
export type SlackIntegrationFetchResponse = SlackIntegrationInstance & {};
|
|
50
|
+
export type SlackIntegrationCreateRequest = SlackIntegrationOptions & {
|
|
51
|
+
model?: import('../../model/v1.js').Model;
|
|
52
|
+
};
|
|
53
|
+
export type SlackIntegrationCreateResponse = {
|
|
54
|
+
id: string;
|
|
55
|
+
};
|
|
56
|
+
export type SlackIntegrationUpdateRequest = SlackIntegrationOptions & {
|
|
57
|
+
model?: import('../../model/v1.js').Model;
|
|
58
|
+
};
|
|
59
|
+
export type SlackIntegrationUpdateResponse = {
|
|
60
|
+
id: string;
|
|
61
|
+
};
|
|
62
|
+
export type SlackIntegrationDeleteResponse = {
|
|
63
|
+
id: string;
|
|
64
|
+
};
|
|
65
|
+
export type SlackIntegrationSetupResponse = {
|
|
66
|
+
id: string;
|
|
67
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { buildModelString } from '../../model/v1.js';
|
|
2
|
+
export function listSlackIntegrations(client, request) {
|
|
3
|
+
let url = `/api/v1/integration/slack/list`;
|
|
4
|
+
const response = client.clientFetch(url, { query: request });
|
|
5
|
+
return response;
|
|
6
|
+
}
|
|
7
|
+
export async function fetchSlackIntegration(client, slackId) {
|
|
8
|
+
const url = `/api/v1/integration/slack/${slackId}/fetch`;
|
|
9
|
+
const response = await client.clientFetch(url);
|
|
10
|
+
return response;
|
|
11
|
+
}
|
|
12
|
+
export async function createSlackIntegration(client, request) {
|
|
13
|
+
const url = `/api/v1/integration/slack/create`;
|
|
14
|
+
const response = await client.clientFetch(url, {
|
|
15
|
+
record: {
|
|
16
|
+
...request,
|
|
17
|
+
model: request.model ? buildModelString(request.model) : undefined,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
return response;
|
|
21
|
+
}
|
|
22
|
+
export async function updateSlackIntegration(client, slackId, request) {
|
|
23
|
+
const url = `/api/v1/integration/slack/${slackId}/update`;
|
|
24
|
+
const response = await client.clientFetch(url, {
|
|
25
|
+
record: {
|
|
26
|
+
...request,
|
|
27
|
+
model: request.model ? buildModelString(request.model) : undefined,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return response;
|
|
31
|
+
}
|
|
32
|
+
export async function deleteSlackIntegration(client, slackId) {
|
|
33
|
+
const url = `/api/v1/integration/slack/${slackId}/delete`;
|
|
34
|
+
const response = await client.clientFetch(url, {
|
|
35
|
+
record: {},
|
|
36
|
+
});
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
39
|
+
export async function setupSlackIntegration(client, slackId) {
|
|
40
|
+
const url = `/api/v1/integration/slack/${slackId}/setup`;
|
|
41
|
+
const response = await client.clientFetch(url, {
|
|
42
|
+
record: {},
|
|
43
|
+
});
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class SupportIntegrationClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import("./v1.js").SupportIntegrationListRequest | undefined): ResponsePromise<import('./v1.js').SupportIntegrationListResponse, import('./v1.js').SupportIntegrationListStreamType>;
|
|
3
|
+
fetch(supportId: string): Promise<import('./v1.js').SupportIntegrationFetchResponse>;
|
|
4
|
+
create(request: import('./v1.js').SupportIntegrationCreateRequest): Promise<import('./v1.js').SupportIntegrationCreateResponse>;
|
|
5
|
+
update(supportId: string, request: import('./v1.js').SupportIntegrationUpdateRequest): Promise<import('./v1.js').SupportIntegrationUpdateResponse>;
|
|
6
|
+
delete(supportId: string): Promise<import('./v1.js').SupportIntegrationDeleteResponse>;
|
|
7
|
+
}
|
|
8
|
+
export default SupportIntegrationClient;
|
|
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 { createSupportIntegration, deleteSupportIntegration, fetchSupportIntegration, listSupportIntegrations, updateSupportIntegration, } from './v1.js';
|
|
3
|
+
export class SupportIntegrationClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(request) {
|
|
8
|
+
return listSupportIntegrations(this, request);
|
|
9
|
+
}
|
|
10
|
+
fetch(supportId) {
|
|
11
|
+
return fetchSupportIntegration(this, supportId);
|
|
12
|
+
}
|
|
13
|
+
create(request) {
|
|
14
|
+
return createSupportIntegration(this, request);
|
|
15
|
+
}
|
|
16
|
+
update(supportId, request) {
|
|
17
|
+
return updateSupportIntegration(this, supportId, request);
|
|
18
|
+
}
|
|
19
|
+
delete(supportId) {
|
|
20
|
+
return deleteSupportIntegration(this, supportId);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export default SupportIntegrationClient;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function listSupportIntegrations(client: ChatBotKitClient, request?: SupportIntegrationListRequest | undefined): ResponsePromise<SupportIntegrationListResponse, SupportIntegrationListStreamType>;
|
|
2
|
+
export function fetchSupportIntegration(client: ChatBotKitClient, supportId: string): Promise<SupportIntegrationFetchResponse>;
|
|
3
|
+
export function createSupportIntegration(client: ChatBotKitClient, request: SupportIntegrationCreateRequest): Promise<SupportIntegrationCreateResponse>;
|
|
4
|
+
export function updateSupportIntegration(client: ChatBotKitClient, supportId: string, request: SupportIntegrationUpdateRequest): Promise<SupportIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteSupportIntegration(client: ChatBotKitClient, supportId: string): Promise<SupportIntegrationDeleteResponse>;
|
|
6
|
+
export type ChatBotKitClient = import('../../client.js').ChatBotKitClient;
|
|
7
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
8
|
+
export type SupportIntegrationOptions = {
|
|
9
|
+
name?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
botId?: string;
|
|
12
|
+
email?: string;
|
|
13
|
+
syncSchedule?: string;
|
|
14
|
+
expiresIn?: number;
|
|
15
|
+
meta?: Record<string, any>;
|
|
16
|
+
};
|
|
17
|
+
export type SupportInegrationInstance = SupportIntegrationOptions & {
|
|
18
|
+
id: string;
|
|
19
|
+
createdAt: number;
|
|
20
|
+
updatedAt: number;
|
|
21
|
+
};
|
|
22
|
+
export type SupportIntegrationListRequest = {
|
|
23
|
+
cursor?: string;
|
|
24
|
+
order?: 'desc' | 'asc';
|
|
25
|
+
take?: number;
|
|
26
|
+
meta?: Record<string, string>;
|
|
27
|
+
};
|
|
28
|
+
export type SupportIntegrationListResponse = {
|
|
29
|
+
items: SupportInegrationInstance[];
|
|
30
|
+
};
|
|
31
|
+
export type SupportIntegrationListStreamItem = {
|
|
32
|
+
type: 'item';
|
|
33
|
+
data: SupportInegrationInstance;
|
|
34
|
+
};
|
|
35
|
+
export type SupportIntegrationListStreamType = SupportIntegrationListStreamItem;
|
|
36
|
+
export type SupportIntegrationFetchResponse = SupportInegrationInstance & {};
|
|
37
|
+
export type SupportIntegrationCreateRequest = SupportIntegrationOptions & {
|
|
38
|
+
botId: string;
|
|
39
|
+
};
|
|
40
|
+
export type SupportIntegrationCreateResponse = {
|
|
41
|
+
id: string;
|
|
42
|
+
};
|
|
43
|
+
export type SupportIntegrationUpdateRequest = SupportIntegrationOptions & {};
|
|
44
|
+
export type SupportIntegrationUpdateResponse = {
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
export type SupportIntegrationDeleteResponse = {
|
|
48
|
+
id: string;
|
|
49
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function listSupportIntegrations(client, request) {
|
|
2
|
+
let url = `/api/v1/integration/support/list`;
|
|
3
|
+
const response = client.clientFetch(url, { query: request });
|
|
4
|
+
return response;
|
|
5
|
+
}
|
|
6
|
+
export async function fetchSupportIntegration(client, supportId) {
|
|
7
|
+
const url = `/api/v1/integration/support/${supportId}/fetch`;
|
|
8
|
+
const response = await client.clientFetch(url);
|
|
9
|
+
return response;
|
|
10
|
+
}
|
|
11
|
+
export async function createSupportIntegration(client, request) {
|
|
12
|
+
const url = `/api/v1/integration/support/create`;
|
|
13
|
+
const response = await client.clientFetch(url, {
|
|
14
|
+
record: {
|
|
15
|
+
...request,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return response;
|
|
19
|
+
}
|
|
20
|
+
export async function updateSupportIntegration(client, supportId, request) {
|
|
21
|
+
const url = `/api/v1/integration/support/${supportId}/update`;
|
|
22
|
+
const response = await client.clientFetch(url, {
|
|
23
|
+
record: {
|
|
24
|
+
...request,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
export async function deleteSupportIntegration(client, supportId) {
|
|
30
|
+
const url = `/api/v1/integration/support/${supportId}/delete`;
|
|
31
|
+
const response = await client.clientFetch(url, {
|
|
32
|
+
record: {},
|
|
33
|
+
});
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class TelegramIntegrationClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import("./v1.js").TelegramIntegrationListRequest | undefined): ResponsePromise<import('./v1.js').TelegramIntegrationListResponse, import('./v1.js').TelegramIntegrationListStreamType>;
|
|
3
|
+
fetch(telegramId: string): Promise<import('./v1.js').TelegramIntegrationFetchResponse>;
|
|
4
|
+
create(request: import('./v1.js').TelegramIntegrationCreateRequest): Promise<import('./v1.js').TelegramIntegrationCreateResponse>;
|
|
5
|
+
update(telegramId: string, request: import('./v1.js').TelegramIntegrationUpdateRequest): Promise<import('./v1.js').TelegramIntegrationUpdateResponse>;
|
|
6
|
+
delete(telegramId: string): Promise<import('./v1.js').TelegramIntegrationDeleteResponse>;
|
|
7
|
+
setup(telegramId: string): Promise<import('./v1.js').TelegramIntegrationSetupResponse>;
|
|
8
|
+
}
|
|
9
|
+
export default TelegramIntegrationClient;
|
|
10
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
11
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
2
|
+
import { createTelegramIntegration, deleteTelegramIntegration, fetchTelegramIntegration, listTelegramIntegrations, setupTelegramIntegration, updateTelegramIntegration, } from './v1.js';
|
|
3
|
+
export class TelegramIntegrationClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(request) {
|
|
8
|
+
return listTelegramIntegrations(this, request);
|
|
9
|
+
}
|
|
10
|
+
fetch(telegramId) {
|
|
11
|
+
return fetchTelegramIntegration(this, telegramId);
|
|
12
|
+
}
|
|
13
|
+
create(request) {
|
|
14
|
+
return createTelegramIntegration(this, request);
|
|
15
|
+
}
|
|
16
|
+
update(telegramId, request) {
|
|
17
|
+
return updateTelegramIntegration(this, telegramId, request);
|
|
18
|
+
}
|
|
19
|
+
delete(telegramId) {
|
|
20
|
+
return deleteTelegramIntegration(this, telegramId);
|
|
21
|
+
}
|
|
22
|
+
setup(telegramId) {
|
|
23
|
+
return setupTelegramIntegration(this, telegramId);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export default TelegramIntegrationClient;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export function listTelegramIntegrations(client: ChatBotKitClient, request?: TelegramIntegrationListRequest | undefined): ResponsePromise<TelegramIntegrationListResponse, TelegramIntegrationListStreamType>;
|
|
2
|
+
export function fetchTelegramIntegration(client: ChatBotKitClient, telegramId: string): Promise<TelegramIntegrationFetchResponse>;
|
|
3
|
+
export function createTelegramIntegration(client: ChatBotKitClient, request: TelegramIntegrationCreateRequest): Promise<TelegramIntegrationCreateResponse>;
|
|
4
|
+
export function updateTelegramIntegration(client: ChatBotKitClient, telegramId: string, request: TelegramIntegrationUpdateRequest): Promise<TelegramIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteTelegramIntegration(client: ChatBotKitClient, telegramId: string): Promise<TelegramIntegrationDeleteResponse>;
|
|
6
|
+
export function setupTelegramIntegration(client: ChatBotKitClient, telegramId: string): Promise<TelegramIntegrationSetupResponse>;
|
|
7
|
+
export type ChatBotKitClient = import('../../client.js').ChatBotKitClient;
|
|
8
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
9
|
+
export type BotRef = {
|
|
10
|
+
botId?: string;
|
|
11
|
+
};
|
|
12
|
+
export type BotConfig = {
|
|
13
|
+
backstory?: string;
|
|
14
|
+
model?: string;
|
|
15
|
+
datasetId?: string;
|
|
16
|
+
skillsetId?: string;
|
|
17
|
+
privacy?: boolean;
|
|
18
|
+
moderation?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type BotRefOrConfig = BotRef | BotConfig;
|
|
21
|
+
export type TelegramIntegrationOptions = BotRefOrConfig & {
|
|
22
|
+
name?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
botToken?: string;
|
|
25
|
+
sessionDuration?: number;
|
|
26
|
+
meta?: Record<string, any>;
|
|
27
|
+
};
|
|
28
|
+
export type TelegramIntegrationInstance = TelegramIntegrationOptions & {
|
|
29
|
+
id: string;
|
|
30
|
+
createdAt: number;
|
|
31
|
+
updatedAt: number;
|
|
32
|
+
};
|
|
33
|
+
export type TelegramIntegrationListRequest = {
|
|
34
|
+
cursor?: string;
|
|
35
|
+
order?: 'desc' | 'asc';
|
|
36
|
+
take?: number;
|
|
37
|
+
meta?: Record<string, string>;
|
|
38
|
+
};
|
|
39
|
+
export type TelegramIntegrationListResponse = {
|
|
40
|
+
items: TelegramIntegrationInstance[];
|
|
41
|
+
};
|
|
42
|
+
export type TelegramIntegrationListStreamItem = {
|
|
43
|
+
type: 'item';
|
|
44
|
+
data: TelegramIntegrationInstance;
|
|
45
|
+
};
|
|
46
|
+
export type TelegramIntegrationListStreamType = TelegramIntegrationListStreamItem;
|
|
47
|
+
export type TelegramIntegrationFetchResponse = TelegramIntegrationInstance & {};
|
|
48
|
+
export type TelegramIntegrationCreateRequest = TelegramIntegrationOptions & {
|
|
49
|
+
model?: import('../../model/v1.js').Model;
|
|
50
|
+
};
|
|
51
|
+
export type TelegramIntegrationCreateResponse = {
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
54
|
+
export type TelegramIntegrationUpdateRequest = TelegramIntegrationOptions & {
|
|
55
|
+
model?: import('../../model/v1.js').Model;
|
|
56
|
+
};
|
|
57
|
+
export type TelegramIntegrationUpdateResponse = {
|
|
58
|
+
id: string;
|
|
59
|
+
};
|
|
60
|
+
export type TelegramIntegrationDeleteResponse = {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
63
|
+
export type TelegramIntegrationSetupResponse = {
|
|
64
|
+
id: string;
|
|
65
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { buildModelString } from '../../model/v1.js';
|
|
2
|
+
export function listTelegramIntegrations(client, request) {
|
|
3
|
+
let url = `/api/v1/integration/telegram/list`;
|
|
4
|
+
const response = client.clientFetch(url, { query: request });
|
|
5
|
+
return response;
|
|
6
|
+
}
|
|
7
|
+
export async function fetchTelegramIntegration(client, telegramId) {
|
|
8
|
+
const url = `/api/v1/integration/telegram/${telegramId}/fetch`;
|
|
9
|
+
const response = await client.clientFetch(url);
|
|
10
|
+
return response;
|
|
11
|
+
}
|
|
12
|
+
export async function createTelegramIntegration(client, request) {
|
|
13
|
+
const url = `/api/v1/integration/telegram/create`;
|
|
14
|
+
const response = await client.clientFetch(url, {
|
|
15
|
+
record: {
|
|
16
|
+
...request,
|
|
17
|
+
model: request.model ? buildModelString(request.model) : undefined,
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
return response;
|
|
21
|
+
}
|
|
22
|
+
export async function updateTelegramIntegration(client, telegramId, request) {
|
|
23
|
+
const url = `/api/v1/integration/telegram/${telegramId}/update`;
|
|
24
|
+
const response = await client.clientFetch(url, {
|
|
25
|
+
record: {
|
|
26
|
+
...request,
|
|
27
|
+
model: request.model ? buildModelString(request.model) : undefined,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return response;
|
|
31
|
+
}
|
|
32
|
+
export async function deleteTelegramIntegration(client, telegramId) {
|
|
33
|
+
const url = `/api/v1/integration/telegram/${telegramId}/delete`;
|
|
34
|
+
const response = await client.clientFetch(url, {
|
|
35
|
+
record: {},
|
|
36
|
+
});
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
39
|
+
export async function setupTelegramIntegration(client, telegramId) {
|
|
40
|
+
const url = `/api/v1/integration/telegram/${telegramId}/setup`;
|
|
41
|
+
const response = await client.clientFetch(url, {
|
|
42
|
+
record: {},
|
|
43
|
+
});
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
@@ -8,6 +8,27 @@ export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T,
|
|
|
8
8
|
export type WidgetIntegrationOptions = {
|
|
9
9
|
name?: string;
|
|
10
10
|
description?: string;
|
|
11
|
+
theme?: string;
|
|
12
|
+
layout?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
intro?: string;
|
|
15
|
+
initial?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
language?: string;
|
|
18
|
+
origin?: string;
|
|
19
|
+
stream?: boolean;
|
|
20
|
+
verbose?: boolean;
|
|
21
|
+
tools?: boolean;
|
|
22
|
+
unfurl?: boolean;
|
|
23
|
+
autoScroll?: boolean;
|
|
24
|
+
startFirst?: boolean;
|
|
25
|
+
contactCollection?: boolean;
|
|
26
|
+
exportConversation?: boolean;
|
|
27
|
+
restartConversation?: boolean;
|
|
28
|
+
maxsimize?: boolean;
|
|
29
|
+
messagePeek?: boolean;
|
|
30
|
+
poweredBy?: boolean;
|
|
31
|
+
sessionDuration?: number;
|
|
11
32
|
meta?: Record<string, any>;
|
|
12
33
|
};
|
|
13
34
|
export type WidgetInegrationInstance = WidgetIntegrationOptions & {
|
|
@@ -8,6 +8,7 @@ export type ResponsePromise<T, U> = import('../client.js').ResponsePromise<T, U>
|
|
|
8
8
|
export type SkillsetOptions = {
|
|
9
9
|
name?: string;
|
|
10
10
|
description?: string;
|
|
11
|
+
visibility?: 'public' | 'private';
|
|
11
12
|
meta?: Record<string, any>;
|
|
12
13
|
};
|
|
13
14
|
export type SkillsetInstance = SkillsetOptions & {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export class UsageClient extends ChatBotKitClient {
|
|
2
|
+
series: UsageSeriesClient;
|
|
2
3
|
fetch(): Promise<import('./v1.js').UsageFetchResponse>;
|
|
3
4
|
}
|
|
4
5
|
export default UsageClient;
|
|
5
6
|
import { ChatBotKitClient } from '../client.js';
|
|
7
|
+
import { UsageSeriesClient } from './series/index.js';
|
package/dist/esm/usage/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { ChatBotKitClient } from '../client.js';
|
|
2
|
+
import { UsageSeriesClient } from './series/index.js';
|
|
2
3
|
import { fetchUsage } from './v1.js';
|
|
3
4
|
export class UsageClient extends ChatBotKitClient {
|
|
4
5
|
constructor(options) {
|
|
5
6
|
super(options);
|
|
7
|
+
this.series = new UsageSeriesClient(options);
|
|
6
8
|
}
|
|
7
9
|
fetch() {
|
|
8
10
|
return fetchUsage(this);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ChatBotKitClient } from '../../client.js';
|
|
2
|
+
import { fetchUsageSeries } from './v1.js';
|
|
3
|
+
export class UsageSeriesClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
fetch() {
|
|
8
|
+
return fetchUsageSeries(this);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export default UsageSeriesClient;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function fetchUsageSeries(client: ChatBotKitClient): Promise<UsageSeriesFetchResponse>;
|
|
2
|
+
export type ChatBotKitClient = import('../../client.js').ChatBotKitClient;
|
|
3
|
+
export type UsageSeriesOptions = {
|
|
4
|
+
tokens: {
|
|
5
|
+
date: number;
|
|
6
|
+
total: number;
|
|
7
|
+
}[];
|
|
8
|
+
conversations: {
|
|
9
|
+
date: number;
|
|
10
|
+
total: number;
|
|
11
|
+
}[];
|
|
12
|
+
messages: {
|
|
13
|
+
date: number;
|
|
14
|
+
total: number;
|
|
15
|
+
}[];
|
|
16
|
+
};
|
|
17
|
+
export type UsageSeriesInstance = UsageSeriesOptions & {};
|
|
18
|
+
export type UsageSeriesFetchResponse = UsageSeriesInstance & {};
|
package/dist/esm/usage/v1.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type ChatBotKitClient = import('../client.js').ChatBotKitClient;
|
|
|
3
3
|
export type UsageOptions = {
|
|
4
4
|
tokens: number;
|
|
5
5
|
conversations: number;
|
|
6
|
+
messages: number;
|
|
6
7
|
};
|
|
7
8
|
export type UsageInstance = UsageOptions & {};
|
|
8
9
|
export type UsageFetchResponse = UsageInstance & {};
|