@chatbotkit/sdk 1.9.1 → 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 +8 -0
- package/dist/cjs/bot/v1.d.ts +1 -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/message/v1.d.ts +1 -1
- package/dist/cjs/dataset/v1.d.ts +3 -1
- package/dist/cjs/index.cjs +28 -22
- package/dist/cjs/index.d.ts +5 -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/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/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 +9 -0
- package/dist/esm/bot/v1.d.ts +1 -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/message/v1.d.ts +1 -1
- package/dist/esm/dataset/v1.d.ts +3 -1
- package/dist/esm/index.d.ts +5 -1
- package/dist/esm/index.js +6 -0
- 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/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/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 +9 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +501 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export function listDiscordIntegrations(client: ChatBotKitClient, request?: DiscordIntegrationListRequest | undefined): ResponsePromise<DiscordIntegrationListResponse, DiscordIntegrationListStreamType>;
|
|
2
|
+
export function fetchDiscordIntegration(client: ChatBotKitClient, discordId: string): Promise<DiscordIntegrationFetchResponse>;
|
|
3
|
+
export function createDiscordIntegration(client: ChatBotKitClient, request: DiscordIntegrationCreateRequest): Promise<DiscordIntegrationCreateResponse>;
|
|
4
|
+
export function updateDiscordIntegration(client: ChatBotKitClient, discordId: string, request: DiscordIntegrationUpdateRequest): Promise<DiscordIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteDiscordIntegration(client: ChatBotKitClient, discordId: string): Promise<DiscordIntegrationDeleteResponse>;
|
|
6
|
+
export function setupDiscordIntegration(client: ChatBotKitClient, discordId: string): Promise<DiscordIntegrationSetupResponse>;
|
|
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 DiscordIntegrationOptions = BotRefOrConfig & {
|
|
22
|
+
name?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
appId?: string;
|
|
25
|
+
botToken?: string;
|
|
26
|
+
publicKey?: string;
|
|
27
|
+
handle?: string;
|
|
28
|
+
sessionDuration?: number;
|
|
29
|
+
meta?: Record<string, any>;
|
|
30
|
+
};
|
|
31
|
+
export type DiscordIntegrationInstance = DiscordIntegrationOptions & {
|
|
32
|
+
id: string;
|
|
33
|
+
createdAt: number;
|
|
34
|
+
updatedAt: number;
|
|
35
|
+
};
|
|
36
|
+
export type DiscordIntegrationListRequest = {
|
|
37
|
+
cursor?: string;
|
|
38
|
+
order?: 'desc' | 'asc';
|
|
39
|
+
take?: number;
|
|
40
|
+
meta?: Record<string, string>;
|
|
41
|
+
};
|
|
42
|
+
export type DiscordIntegrationListResponse = {
|
|
43
|
+
items: DiscordIntegrationInstance[];
|
|
44
|
+
};
|
|
45
|
+
export type DiscordIntegrationListStreamItem = {
|
|
46
|
+
type: 'item';
|
|
47
|
+
data: DiscordIntegrationInstance;
|
|
48
|
+
};
|
|
49
|
+
export type DiscordIntegrationListStreamType = DiscordIntegrationListStreamItem;
|
|
50
|
+
export type DiscordIntegrationFetchResponse = DiscordIntegrationInstance & {};
|
|
51
|
+
export type DiscordIntegrationCreateRequest = DiscordIntegrationOptions & {
|
|
52
|
+
model?: import('../../model/v1.js').Model;
|
|
53
|
+
};
|
|
54
|
+
export type DiscordIntegrationCreateResponse = {
|
|
55
|
+
id: string;
|
|
56
|
+
};
|
|
57
|
+
export type DiscordIntegrationUpdateRequest = DiscordIntegrationOptions & {
|
|
58
|
+
model?: import('../../model/v1.js').Model;
|
|
59
|
+
};
|
|
60
|
+
export type DiscordIntegrationUpdateResponse = {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
63
|
+
export type DiscordIntegrationDeleteResponse = {
|
|
64
|
+
id: string;
|
|
65
|
+
};
|
|
66
|
+
export type DiscordIntegrationSetupResponse = {
|
|
67
|
+
id: string;
|
|
68
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { buildModelString } from '../../model/v1.js';
|
|
2
|
+
export function listDiscordIntegrations(client, request) {
|
|
3
|
+
let url = `/api/v1/integration/discord/list`;
|
|
4
|
+
const response = client.clientFetch(url, { query: request });
|
|
5
|
+
return response;
|
|
6
|
+
}
|
|
7
|
+
export async function fetchDiscordIntegration(client, discordId) {
|
|
8
|
+
const url = `/api/v1/integration/discord/${discordId}/fetch`;
|
|
9
|
+
const response = await client.clientFetch(url);
|
|
10
|
+
return response;
|
|
11
|
+
}
|
|
12
|
+
export async function createDiscordIntegration(client, request) {
|
|
13
|
+
const url = `/api/v1/integration/discord/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 updateDiscordIntegration(client, discordId, request) {
|
|
23
|
+
const url = `/api/v1/integration/discord/${discordId}/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 deleteDiscordIntegration(client, discordId) {
|
|
33
|
+
const url = `/api/v1/integration/discord/${discordId}/delete`;
|
|
34
|
+
const response = await client.clientFetch(url, {
|
|
35
|
+
record: {},
|
|
36
|
+
});
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
39
|
+
export async function setupDiscordIntegration(client, discordId) {
|
|
40
|
+
const url = `/api/v1/integration/discord/${discordId}/setup`;
|
|
41
|
+
const response = await client.clientFetch(url, {
|
|
42
|
+
record: {},
|
|
43
|
+
});
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export class ExtractIntegrationClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import("./v1.js").ExtractIntegrationListRequest | undefined): ResponsePromise<import('./v1.js').ExtractIntegrationListResponse, import('./v1.js').ExtractIntegrationListStreamType>;
|
|
3
|
+
fetch(extractId: string): Promise<import('./v1.js').ExtractIntegrationFetchResponse>;
|
|
4
|
+
create(request: import('./v1.js').ExtractIntegrationCreateRequest): Promise<import('./v1.js').ExtractIntegrationCreateResponse>;
|
|
5
|
+
update(extractId: string, request: import('./v1.js').ExtractIntegrationUpdateRequest): Promise<import('./v1.js').ExtractIntegrationUpdateResponse>;
|
|
6
|
+
delete(extractId: string): Promise<import('./v1.js').ExtractIntegrationDeleteResponse>;
|
|
7
|
+
}
|
|
8
|
+
export default ExtractIntegrationClient;
|
|
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 { createExtractIntegration, deleteExtractIntegration, fetchExtractIntegration, listExtractIntegrations, updateExtractIntegration, } from './v1.js';
|
|
3
|
+
export class ExtractIntegrationClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(request) {
|
|
8
|
+
return listExtractIntegrations(this, request);
|
|
9
|
+
}
|
|
10
|
+
fetch(extractId) {
|
|
11
|
+
return fetchExtractIntegration(this, extractId);
|
|
12
|
+
}
|
|
13
|
+
create(request) {
|
|
14
|
+
return createExtractIntegration(this, request);
|
|
15
|
+
}
|
|
16
|
+
update(extractId, request) {
|
|
17
|
+
return updateExtractIntegration(this, extractId, request);
|
|
18
|
+
}
|
|
19
|
+
delete(extractId) {
|
|
20
|
+
return deleteExtractIntegration(this, extractId);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export default ExtractIntegrationClient;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function listExtractIntegrations(client: ChatBotKitClient, request?: ExtractIntegrationListRequest | undefined): ResponsePromise<ExtractIntegrationListResponse, ExtractIntegrationListStreamType>;
|
|
2
|
+
export function fetchExtractIntegration(client: ChatBotKitClient, extractId: string): Promise<ExtractIntegrationFetchResponse>;
|
|
3
|
+
export function createExtractIntegration(client: ChatBotKitClient, request: ExtractIntegrationCreateRequest): Promise<ExtractIntegrationCreateResponse>;
|
|
4
|
+
export function updateExtractIntegration(client: ChatBotKitClient, extractId: string, request: ExtractIntegrationUpdateRequest): Promise<ExtractIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteExtractIntegration(client: ChatBotKitClient, extractId: string): Promise<ExtractIntegrationDeleteResponse>;
|
|
6
|
+
export type ChatBotKitClient = import('../../client.js').ChatBotKitClient;
|
|
7
|
+
export type ResponsePromise<T, U> = import('../../client.js').ResponsePromise<T, U>;
|
|
8
|
+
export type ExtractIntegrationOptions = {
|
|
9
|
+
name?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
botId?: string;
|
|
12
|
+
schema?: Record<string, any>;
|
|
13
|
+
syncSchedule?: string;
|
|
14
|
+
expiresIn?: number;
|
|
15
|
+
meta?: Record<string, any>;
|
|
16
|
+
};
|
|
17
|
+
export type ExtractInegrationInstance = ExtractIntegrationOptions & {
|
|
18
|
+
id: string;
|
|
19
|
+
createdAt: number;
|
|
20
|
+
updatedAt: number;
|
|
21
|
+
};
|
|
22
|
+
export type ExtractIntegrationListRequest = {
|
|
23
|
+
cursor?: string;
|
|
24
|
+
order?: 'desc' | 'asc';
|
|
25
|
+
take?: number;
|
|
26
|
+
meta?: Record<string, string>;
|
|
27
|
+
};
|
|
28
|
+
export type ExtractIntegrationListResponse = {
|
|
29
|
+
items: ExtractInegrationInstance[];
|
|
30
|
+
};
|
|
31
|
+
export type ExtractIntegrationListStreamItem = {
|
|
32
|
+
type: 'item';
|
|
33
|
+
data: ExtractInegrationInstance;
|
|
34
|
+
};
|
|
35
|
+
export type ExtractIntegrationListStreamType = ExtractIntegrationListStreamItem;
|
|
36
|
+
export type ExtractIntegrationFetchResponse = ExtractInegrationInstance & {};
|
|
37
|
+
export type ExtractIntegrationCreateRequest = ExtractIntegrationOptions & {
|
|
38
|
+
botId: string;
|
|
39
|
+
};
|
|
40
|
+
export type ExtractIntegrationCreateResponse = {
|
|
41
|
+
id: string;
|
|
42
|
+
};
|
|
43
|
+
export type ExtractIntegrationUpdateRequest = ExtractIntegrationOptions & {};
|
|
44
|
+
export type ExtractIntegrationUpdateResponse = {
|
|
45
|
+
id: string;
|
|
46
|
+
};
|
|
47
|
+
export type ExtractIntegrationDeleteResponse = {
|
|
48
|
+
id: string;
|
|
49
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export function listExtractIntegrations(client, request) {
|
|
2
|
+
let url = `/api/v1/integration/extract/list`;
|
|
3
|
+
const response = client.clientFetch(url, { query: request });
|
|
4
|
+
return response;
|
|
5
|
+
}
|
|
6
|
+
export async function fetchExtractIntegration(client, extractId) {
|
|
7
|
+
const url = `/api/v1/integration/extract/${extractId}/fetch`;
|
|
8
|
+
const response = await client.clientFetch(url);
|
|
9
|
+
return response;
|
|
10
|
+
}
|
|
11
|
+
export async function createExtractIntegration(client, request) {
|
|
12
|
+
const url = `/api/v1/integration/extract/create`;
|
|
13
|
+
const response = await client.clientFetch(url, {
|
|
14
|
+
record: {
|
|
15
|
+
...request,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
return response;
|
|
19
|
+
}
|
|
20
|
+
export async function updateExtractIntegration(client, extractId, request) {
|
|
21
|
+
const url = `/api/v1/integration/extract/${extractId}/update`;
|
|
22
|
+
const response = await client.clientFetch(url, {
|
|
23
|
+
record: {
|
|
24
|
+
...request,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
export async function deleteExtractIntegration(client, extractId) {
|
|
30
|
+
const url = `/api/v1/integration/extract/${extractId}/delete`;
|
|
31
|
+
const response = await client.clientFetch(url, {
|
|
32
|
+
record: {},
|
|
33
|
+
});
|
|
34
|
+
return response;
|
|
35
|
+
}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
export class IntegrationClient extends ChatBotKitClient {
|
|
2
2
|
widget: WidgetIntegrationClient;
|
|
3
|
-
|
|
3
|
+
slack: SlackIntegrationClient;
|
|
4
|
+
discord: DiscordIntegrationClient;
|
|
4
5
|
whatsapp: WhatsAppIntegrationClient;
|
|
6
|
+
messenger: MessengerIntegrationClient;
|
|
7
|
+
telegram: TelegramIntegrationClient;
|
|
8
|
+
sitemap: SitemapIntegrationClient;
|
|
9
|
+
notion: NotionIntegrationClient;
|
|
10
|
+
support: SupportIntegrationClient;
|
|
11
|
+
extract: ExtractIntegrationClient;
|
|
5
12
|
}
|
|
6
13
|
export default IntegrationClient;
|
|
7
14
|
import { ChatBotKitClient } from '../client.js';
|
|
8
15
|
import { WidgetIntegrationClient } from './widget/index.js';
|
|
9
|
-
import {
|
|
16
|
+
import { SlackIntegrationClient } from './slack/index.js';
|
|
17
|
+
import { DiscordIntegrationClient } from './discord/index.js';
|
|
10
18
|
import { WhatsAppIntegrationClient } from './whatsapp/index.js';
|
|
19
|
+
import { MessengerIntegrationClient } from './messenger/index.js';
|
|
20
|
+
import { TelegramIntegrationClient } from './telegram/index.js';
|
|
21
|
+
import { SitemapIntegrationClient } from './sitemap/index.js';
|
|
22
|
+
import { NotionIntegrationClient } from './notion/index.js';
|
|
23
|
+
import { SupportIntegrationClient } from './support/index.js';
|
|
24
|
+
import { ExtractIntegrationClient } from './extract/index.js';
|
|
@@ -1,13 +1,27 @@
|
|
|
1
1
|
import { ChatBotKitClient } from '../client.js';
|
|
2
|
+
import { DiscordIntegrationClient } from './discord/index.js';
|
|
3
|
+
import { ExtractIntegrationClient } from './extract/index.js';
|
|
4
|
+
import { MessengerIntegrationClient } from './messenger/index.js';
|
|
5
|
+
import { NotionIntegrationClient } from './notion/index.js';
|
|
2
6
|
import { SitemapIntegrationClient } from './sitemap/index.js';
|
|
7
|
+
import { SlackIntegrationClient } from './slack/index.js';
|
|
8
|
+
import { SupportIntegrationClient } from './support/index.js';
|
|
9
|
+
import { TelegramIntegrationClient } from './telegram/index.js';
|
|
3
10
|
import { WhatsAppIntegrationClient } from './whatsapp/index.js';
|
|
4
11
|
import { WidgetIntegrationClient } from './widget/index.js';
|
|
5
12
|
export class IntegrationClient extends ChatBotKitClient {
|
|
6
13
|
constructor(options) {
|
|
7
14
|
super(options);
|
|
8
15
|
this.widget = new WidgetIntegrationClient(options);
|
|
9
|
-
this.
|
|
16
|
+
this.slack = new SlackIntegrationClient(options);
|
|
17
|
+
this.discord = new DiscordIntegrationClient(options);
|
|
10
18
|
this.whatsapp = new WhatsAppIntegrationClient(options);
|
|
19
|
+
this.messenger = new MessengerIntegrationClient(options);
|
|
20
|
+
this.telegram = new TelegramIntegrationClient(options);
|
|
21
|
+
this.sitemap = new SitemapIntegrationClient(options);
|
|
22
|
+
this.notion = new NotionIntegrationClient(options);
|
|
23
|
+
this.support = new SupportIntegrationClient(options);
|
|
24
|
+
this.extract = new ExtractIntegrationClient(options);
|
|
11
25
|
}
|
|
12
26
|
}
|
|
13
27
|
export default IntegrationClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class MessengerIntegrationClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import("./v1.js").MessengerIntegrationListRequest | undefined): ResponsePromise<import('./v1.js').MessengerIntegrationListResponse, import('./v1.js').MessengerIntegrationListStreamType>;
|
|
3
|
+
fetch(messengerId: string): Promise<import('./v1.js').MessengerIntegrationFetchResponse>;
|
|
4
|
+
create(request: import('./v1.js').MessengerIntegrationCreateRequest): Promise<import('./v1.js').MessengerIntegrationCreateResponse>;
|
|
5
|
+
update(messengerId: string, request: import('./v1.js').MessengerIntegrationUpdateRequest): Promise<import('./v1.js').MessengerIntegrationUpdateResponse>;
|
|
6
|
+
delete(messengerId: string): Promise<import('./v1.js').MessengerIntegrationDeleteResponse>;
|
|
7
|
+
setup(messengerId: string): Promise<import('./v1.js').MessengerIntegrationSetupResponse>;
|
|
8
|
+
}
|
|
9
|
+
export default MessengerIntegrationClient;
|
|
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 { createMessengerIntegration, deleteMessengerIntegration, fetchMessengerIntegration, listMessengerIntegrations, setupMessengerIntegration, updateMessengerIntegration, } from './v1.js';
|
|
3
|
+
export class MessengerIntegrationClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(request) {
|
|
8
|
+
return listMessengerIntegrations(this, request);
|
|
9
|
+
}
|
|
10
|
+
fetch(messengerId) {
|
|
11
|
+
return fetchMessengerIntegration(this, messengerId);
|
|
12
|
+
}
|
|
13
|
+
create(request) {
|
|
14
|
+
return createMessengerIntegration(this, request);
|
|
15
|
+
}
|
|
16
|
+
update(messengerId, request) {
|
|
17
|
+
return updateMessengerIntegration(this, messengerId, request);
|
|
18
|
+
}
|
|
19
|
+
delete(messengerId) {
|
|
20
|
+
return deleteMessengerIntegration(this, messengerId);
|
|
21
|
+
}
|
|
22
|
+
setup(messengerId) {
|
|
23
|
+
return setupMessengerIntegration(this, messengerId);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export default MessengerIntegrationClient;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export function listMessengerIntegrations(client: ChatBotKitClient, request?: MessengerIntegrationListRequest | undefined): ResponsePromise<MessengerIntegrationListResponse, MessengerIntegrationListStreamType>;
|
|
2
|
+
export function fetchMessengerIntegration(client: ChatBotKitClient, messengerId: string): Promise<MessengerIntegrationFetchResponse>;
|
|
3
|
+
export function createMessengerIntegration(client: ChatBotKitClient, request: MessengerIntegrationCreateRequest): Promise<MessengerIntegrationCreateResponse>;
|
|
4
|
+
export function updateMessengerIntegration(client: ChatBotKitClient, messengerId: string, request: MessengerIntegrationUpdateRequest): Promise<MessengerIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteMessengerIntegration(client: ChatBotKitClient, messengerId: string): Promise<MessengerIntegrationDeleteResponse>;
|
|
6
|
+
export function setupMessengerIntegration(client: ChatBotKitClient, messengerId: string): Promise<MessengerIntegrationSetupResponse>;
|
|
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 MessengerIntegrationOptions = BotRefOrConfig & {
|
|
22
|
+
name?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
accessToken?: string;
|
|
25
|
+
sessionDuration?: number;
|
|
26
|
+
meta?: Record<string, any>;
|
|
27
|
+
};
|
|
28
|
+
export type MessengerIntegrationInstance = MessengerIntegrationOptions & {
|
|
29
|
+
id: string;
|
|
30
|
+
createdAt: number;
|
|
31
|
+
updatedAt: number;
|
|
32
|
+
verifyToken: string;
|
|
33
|
+
};
|
|
34
|
+
export type MessengerIntegrationListRequest = {
|
|
35
|
+
cursor?: string;
|
|
36
|
+
order?: 'desc' | 'asc';
|
|
37
|
+
take?: number;
|
|
38
|
+
meta?: Record<string, string>;
|
|
39
|
+
};
|
|
40
|
+
export type MessengerIntegrationListResponse = {
|
|
41
|
+
items: MessengerIntegrationInstance[];
|
|
42
|
+
};
|
|
43
|
+
export type MessengerIntegrationListStreamItem = {
|
|
44
|
+
type: 'item';
|
|
45
|
+
data: MessengerIntegrationInstance;
|
|
46
|
+
};
|
|
47
|
+
export type MessengerIntegrationListStreamType = MessengerIntegrationListStreamItem;
|
|
48
|
+
export type MessengerIntegrationFetchResponse = MessengerIntegrationInstance & {};
|
|
49
|
+
export type MessengerIntegrationCreateRequest = MessengerIntegrationOptions & {
|
|
50
|
+
model?: import('../../model/v1.js').Model;
|
|
51
|
+
};
|
|
52
|
+
export type MessengerIntegrationCreateResponse = {
|
|
53
|
+
id: string;
|
|
54
|
+
};
|
|
55
|
+
export type MessengerIntegrationUpdateRequest = MessengerIntegrationOptions & {
|
|
56
|
+
model?: import('../../model/v1.js').Model;
|
|
57
|
+
};
|
|
58
|
+
export type MessengerIntegrationUpdateResponse = {
|
|
59
|
+
id: string;
|
|
60
|
+
};
|
|
61
|
+
export type MessengerIntegrationDeleteResponse = {
|
|
62
|
+
id: string;
|
|
63
|
+
};
|
|
64
|
+
export type MessengerIntegrationSetupResponse = {
|
|
65
|
+
id: string;
|
|
66
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { buildModelString } from '../../model/v1.js';
|
|
2
|
+
export function listMessengerIntegrations(client, request) {
|
|
3
|
+
let url = `/api/v1/integration/messenger/list`;
|
|
4
|
+
const response = client.clientFetch(url, { query: request });
|
|
5
|
+
return response;
|
|
6
|
+
}
|
|
7
|
+
export async function fetchMessengerIntegration(client, messengerId) {
|
|
8
|
+
const url = `/api/v1/integration/messenger/${messengerId}/fetch`;
|
|
9
|
+
const response = await client.clientFetch(url);
|
|
10
|
+
return response;
|
|
11
|
+
}
|
|
12
|
+
export async function createMessengerIntegration(client, request) {
|
|
13
|
+
const url = `/api/v1/integration/messenger/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 updateMessengerIntegration(client, messengerId, request) {
|
|
23
|
+
const url = `/api/v1/integration/messenger/${messengerId}/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 deleteMessengerIntegration(client, messengerId) {
|
|
33
|
+
const url = `/api/v1/integration/messenger/${messengerId}/delete`;
|
|
34
|
+
const response = await client.clientFetch(url, {
|
|
35
|
+
record: {},
|
|
36
|
+
});
|
|
37
|
+
return response;
|
|
38
|
+
}
|
|
39
|
+
export async function setupMessengerIntegration(client, messengerId) {
|
|
40
|
+
const url = `/api/v1/integration/messenger/${messengerId}/setup`;
|
|
41
|
+
const response = await client.clientFetch(url, {
|
|
42
|
+
record: {},
|
|
43
|
+
});
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class NotionIntegrationClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import("./v1.js").NotionIntegrationListRequest | undefined): ResponsePromise<import('./v1.js').NotionIntegrationListResponse, import('./v1.js').NotionIntegrationListStreamType>;
|
|
3
|
+
fetch(notionId: string): Promise<import('./v1.js').NotionIntegrationFetchResponse>;
|
|
4
|
+
create(request: import('./v1.js').NotionIntegrationCreateRequest): Promise<import('./v1.js').NotionIntegrationCreateResponse>;
|
|
5
|
+
update(notionId: string, request: import('./v1.js').NotionIntegrationUpdateRequest): Promise<import('./v1.js').NotionIntegrationUpdateResponse>;
|
|
6
|
+
delete(notionId: string): Promise<import('./v1.js').NotionIntegrationDeleteResponse>;
|
|
7
|
+
sync(notionId: string): Promise<import('./v1.js').NotionIntegrationSyncResponse>;
|
|
8
|
+
}
|
|
9
|
+
export default NotionIntegrationClient;
|
|
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 { createNotionIntegration, deleteNotionIntegration, fetchNotionIntegration, listNotionIntegrations, syncNotionIntegration, updateNotionIntegration, } from './v1.js';
|
|
3
|
+
export class NotionIntegrationClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(request) {
|
|
8
|
+
return listNotionIntegrations(this, request);
|
|
9
|
+
}
|
|
10
|
+
fetch(notionId) {
|
|
11
|
+
return fetchNotionIntegration(this, notionId);
|
|
12
|
+
}
|
|
13
|
+
create(request) {
|
|
14
|
+
return createNotionIntegration(this, request);
|
|
15
|
+
}
|
|
16
|
+
update(notionId, request) {
|
|
17
|
+
return updateNotionIntegration(this, notionId, request);
|
|
18
|
+
}
|
|
19
|
+
delete(notionId) {
|
|
20
|
+
return deleteNotionIntegration(this, notionId);
|
|
21
|
+
}
|
|
22
|
+
sync(notionId) {
|
|
23
|
+
return syncNotionIntegration(this, notionId);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export default NotionIntegrationClient;
|
|
@@ -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;
|