@chatbotkit/sdk 1.14.4 → 1.15.1
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/conversation/v1.d.ts +10 -2
- package/dist/cjs/integration/email/index.cjs +30 -0
- package/dist/cjs/integration/email/index.d.ts +11 -0
- package/dist/cjs/integration/email/v1.cjs +54 -0
- package/dist/cjs/integration/email/v1.d.ts +65 -0
- package/dist/cjs/integration/index.cjs +22 -18
- package/dist/cjs/integration/index.d.ts +4 -0
- package/dist/cjs/integration/messenger/v1.d.ts +1 -0
- package/dist/cjs/integration/telegram/v1.d.ts +1 -0
- package/dist/cjs/integration/trigger/index.cjs +33 -0
- package/dist/cjs/integration/trigger/index.d.ts +12 -0
- package/dist/cjs/integration/trigger/v1.cjs +64 -0
- package/dist/cjs/integration/trigger/v1.d.ts +70 -0
- package/dist/cjs/integration/whatsapp/v1.d.ts +1 -0
- package/dist/esm/conversation/v1.d.ts +10 -2
- package/dist/esm/integration/email/index.d.ts +11 -0
- package/dist/esm/integration/email/index.js +26 -0
- package/dist/esm/integration/email/v1.d.ts +65 -0
- package/dist/esm/integration/email/v1.js +45 -0
- package/dist/esm/integration/index.d.ts +4 -0
- package/dist/esm/integration/index.js +4 -0
- package/dist/esm/integration/messenger/v1.d.ts +1 -0
- package/dist/esm/integration/telegram/v1.d.ts +1 -0
- package/dist/esm/integration/trigger/index.d.ts +12 -0
- package/dist/esm/integration/trigger/index.js +29 -0
- package/dist/esm/integration/trigger/v1.d.ts +70 -0
- package/dist/esm/integration/trigger/v1.js +54 -0
- package/dist/esm/integration/whatsapp/v1.d.ts +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +101 -1
|
@@ -126,13 +126,17 @@ export type ConversationCompleteMessageStreamResult = {
|
|
|
126
126
|
type: 'result';
|
|
127
127
|
data: ConversationCompleteMessageResponse;
|
|
128
128
|
};
|
|
129
|
+
export type ConversationCompleteMessageStreamMessage = {
|
|
130
|
+
type: 'message';
|
|
131
|
+
data: Message;
|
|
132
|
+
};
|
|
129
133
|
export type ConversationCompleteMessageStreamToken = {
|
|
130
134
|
type: 'token';
|
|
131
135
|
data: {
|
|
132
136
|
token: string;
|
|
133
137
|
};
|
|
134
138
|
};
|
|
135
|
-
export type ConversationCompleteMessageStreamType = ConversationCompleteMessageStreamResult | ConversationCompleteMessageStreamToken;
|
|
139
|
+
export type ConversationCompleteMessageStreamType = ConversationCompleteMessageStreamResult | ConversationCompleteMessageStreamMessage | ConversationCompleteMessageStreamToken;
|
|
136
140
|
export type ConversationSendMessageRequest = {
|
|
137
141
|
text?: string;
|
|
138
142
|
entities?: Entity[];
|
|
@@ -158,13 +162,17 @@ export type ConversationReceiveMessageStreamResult = {
|
|
|
158
162
|
type: 'result';
|
|
159
163
|
data: ConversationReceiveMessageResponse;
|
|
160
164
|
};
|
|
165
|
+
export type ConversationReceiveMessageStreamMessage = {
|
|
166
|
+
type: 'message';
|
|
167
|
+
data: Message;
|
|
168
|
+
};
|
|
161
169
|
export type ConversationReceiveMessageStreamToken = {
|
|
162
170
|
type: 'token';
|
|
163
171
|
data: {
|
|
164
172
|
token: string;
|
|
165
173
|
};
|
|
166
174
|
};
|
|
167
|
-
export type ConversationReceiveMessageStreamType = ConversationReceiveMessageStreamResult | ConversationReceiveMessageStreamToken;
|
|
175
|
+
export type ConversationReceiveMessageStreamType = ConversationReceiveMessageStreamResult | ConversationReceiveMessageStreamMessage | ConversationReceiveMessageStreamToken;
|
|
168
176
|
export type ConversationUpvoteRequest = {
|
|
169
177
|
value?: number;
|
|
170
178
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EmailIntegrationClient = void 0;
|
|
4
|
+
const client_js_1 = require("../../client.cjs");
|
|
5
|
+
const v1_js_1 = require("./v1.cjs");
|
|
6
|
+
class EmailIntegrationClient extends client_js_1.ChatBotKitClient {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
}
|
|
10
|
+
list(request) {
|
|
11
|
+
return (0, v1_js_1.listEmailIntegrations)(this, request);
|
|
12
|
+
}
|
|
13
|
+
fetch(emailId) {
|
|
14
|
+
return (0, v1_js_1.fetchEmailIntegration)(this, emailId);
|
|
15
|
+
}
|
|
16
|
+
create(request) {
|
|
17
|
+
return (0, v1_js_1.createEmailIntegration)(this, request);
|
|
18
|
+
}
|
|
19
|
+
update(emailId, request) {
|
|
20
|
+
return (0, v1_js_1.updateEmailIntegration)(this, emailId, request);
|
|
21
|
+
}
|
|
22
|
+
delete(emailId) {
|
|
23
|
+
return (0, v1_js_1.deleteEmailIntegration)(this, emailId);
|
|
24
|
+
}
|
|
25
|
+
setup(emailId) {
|
|
26
|
+
return (0, v1_js_1.setupEmailIntegration)(this, emailId);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.EmailIntegrationClient = EmailIntegrationClient;
|
|
30
|
+
exports.default = EmailIntegrationClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class EmailIntegrationClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import('./v1.cjs').EmailIntegrationListRequest): ResponsePromise<import('./v1.cjs').EmailIntegrationListResponse, import('./v1.cjs').EmailIntegrationListStreamType>;
|
|
3
|
+
fetch(emailId: string): Promise<import('./v1.cjs').EmailIntegrationFetchResponse>;
|
|
4
|
+
create(request: import('./v1.cjs').EmailIntegrationCreateRequest): Promise<import('./v1.cjs').EmailIntegrationCreateResponse>;
|
|
5
|
+
update(emailId: string, request: import('./v1.cjs').EmailIntegrationUpdateRequest): Promise<import('./v1.cjs').EmailIntegrationUpdateResponse>;
|
|
6
|
+
delete(emailId: string): Promise<import('./v1.cjs').EmailIntegrationDeleteResponse>;
|
|
7
|
+
setup(emailId: string): Promise<import('./v1.cjs').EmailIntegrationSetupResponse>;
|
|
8
|
+
}
|
|
9
|
+
export default EmailIntegrationClient;
|
|
10
|
+
export type ResponsePromise<T, U> = import('../../client.cjs').ResponsePromise<T, U>;
|
|
11
|
+
import { ChatBotKitClient } from '../../client.cjs';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupEmailIntegration = exports.deleteEmailIntegration = exports.updateEmailIntegration = exports.createEmailIntegration = exports.fetchEmailIntegration = exports.listEmailIntegrations = void 0;
|
|
4
|
+
const v1_js_1 = require("../../model/v1.cjs");
|
|
5
|
+
function listEmailIntegrations(client, request) {
|
|
6
|
+
let url = `/api/v1/integration/email/list`;
|
|
7
|
+
const response = client.clientFetch(url, { query: request });
|
|
8
|
+
return response;
|
|
9
|
+
}
|
|
10
|
+
exports.listEmailIntegrations = listEmailIntegrations;
|
|
11
|
+
async function fetchEmailIntegration(client, emailId) {
|
|
12
|
+
const url = `/api/v1/integration/email/${emailId}/fetch`;
|
|
13
|
+
const response = await client.clientFetch(url);
|
|
14
|
+
return response;
|
|
15
|
+
}
|
|
16
|
+
exports.fetchEmailIntegration = fetchEmailIntegration;
|
|
17
|
+
async function createEmailIntegration(client, request) {
|
|
18
|
+
const url = `/api/v1/integration/email/create`;
|
|
19
|
+
const response = await client.clientFetch(url, {
|
|
20
|
+
record: {
|
|
21
|
+
...request,
|
|
22
|
+
model: request.model ? (0, v1_js_1.buildModelString)(request.model) : undefined,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
return response;
|
|
26
|
+
}
|
|
27
|
+
exports.createEmailIntegration = createEmailIntegration;
|
|
28
|
+
async function updateEmailIntegration(client, emailId, request) {
|
|
29
|
+
const url = `/api/v1/integration/email/${emailId}/update`;
|
|
30
|
+
const response = await client.clientFetch(url, {
|
|
31
|
+
record: {
|
|
32
|
+
...request,
|
|
33
|
+
model: request.model ? (0, v1_js_1.buildModelString)(request.model) : undefined,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
exports.updateEmailIntegration = updateEmailIntegration;
|
|
39
|
+
async function deleteEmailIntegration(client, emailId) {
|
|
40
|
+
const url = `/api/v1/integration/email/${emailId}/delete`;
|
|
41
|
+
const response = await client.clientFetch(url, {
|
|
42
|
+
record: {},
|
|
43
|
+
});
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
exports.deleteEmailIntegration = deleteEmailIntegration;
|
|
47
|
+
async function setupEmailIntegration(client, emailId) {
|
|
48
|
+
const url = `/api/v1/integration/email/${emailId}/setup`;
|
|
49
|
+
const response = await client.clientFetch(url, {
|
|
50
|
+
record: {},
|
|
51
|
+
});
|
|
52
|
+
return response;
|
|
53
|
+
}
|
|
54
|
+
exports.setupEmailIntegration = setupEmailIntegration;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export function listEmailIntegrations(client: ChatBotKitClient, request?: EmailIntegrationListRequest): ResponsePromise<EmailIntegrationListResponse, EmailIntegrationListStreamType>;
|
|
2
|
+
export function fetchEmailIntegration(client: ChatBotKitClient, emailId: string): Promise<EmailIntegrationFetchResponse>;
|
|
3
|
+
export function createEmailIntegration(client: ChatBotKitClient, request: EmailIntegrationCreateRequest): Promise<EmailIntegrationCreateResponse>;
|
|
4
|
+
export function updateEmailIntegration(client: ChatBotKitClient, emailId: string, request: EmailIntegrationUpdateRequest): Promise<EmailIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteEmailIntegration(client: ChatBotKitClient, emailId: string): Promise<EmailIntegrationDeleteResponse>;
|
|
6
|
+
export function setupEmailIntegration(client: ChatBotKitClient, emailId: string): Promise<EmailIntegrationSetupResponse>;
|
|
7
|
+
export type ChatBotKitClient = import('../../client.cjs').ChatBotKitClient;
|
|
8
|
+
export type ResponsePromise<T, U> = import('../../client.cjs').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 EmailIntegrationOptions = BotRefOrConfig & {
|
|
22
|
+
name?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
contactCollection?: boolean;
|
|
25
|
+
sessionDuration?: number;
|
|
26
|
+
meta?: Record<string, any>;
|
|
27
|
+
};
|
|
28
|
+
export type EmailIntegrationInstance = EmailIntegrationOptions & {
|
|
29
|
+
id: string;
|
|
30
|
+
createdAt: number;
|
|
31
|
+
updatedAt: number;
|
|
32
|
+
};
|
|
33
|
+
export type EmailIntegrationListRequest = {
|
|
34
|
+
cursor?: string;
|
|
35
|
+
order?: 'desc' | 'asc';
|
|
36
|
+
take?: number;
|
|
37
|
+
meta?: Record<string, string>;
|
|
38
|
+
};
|
|
39
|
+
export type EmailIntegrationListResponse = {
|
|
40
|
+
items: EmailIntegrationInstance[];
|
|
41
|
+
};
|
|
42
|
+
export type EmailIntegrationListStreamItem = {
|
|
43
|
+
type: 'item';
|
|
44
|
+
data: EmailIntegrationInstance;
|
|
45
|
+
};
|
|
46
|
+
export type EmailIntegrationListStreamType = EmailIntegrationListStreamItem;
|
|
47
|
+
export type EmailIntegrationFetchResponse = EmailIntegrationInstance & {};
|
|
48
|
+
export type EmailIntegrationCreateRequest = EmailIntegrationOptions & {
|
|
49
|
+
model?: import('../../model/v1.cjs').Model;
|
|
50
|
+
};
|
|
51
|
+
export type EmailIntegrationCreateResponse = {
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
54
|
+
export type EmailIntegrationUpdateRequest = EmailIntegrationOptions & {
|
|
55
|
+
model?: import('../../model/v1.cjs').Model;
|
|
56
|
+
};
|
|
57
|
+
export type EmailIntegrationUpdateResponse = {
|
|
58
|
+
id: string;
|
|
59
|
+
};
|
|
60
|
+
export type EmailIntegrationDeleteResponse = {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
63
|
+
export type EmailIntegrationSetupResponse = {
|
|
64
|
+
id: string;
|
|
65
|
+
};
|
|
@@ -3,28 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.IntegrationClient = void 0;
|
|
4
4
|
const client_js_1 = require("../client.cjs");
|
|
5
5
|
const index_js_1 = require("./discord/index.cjs");
|
|
6
|
-
const index_js_2 = require("./
|
|
7
|
-
const index_js_3 = require("./
|
|
8
|
-
const index_js_4 = require("./
|
|
9
|
-
const index_js_5 = require("./
|
|
10
|
-
const index_js_6 = require("./
|
|
11
|
-
const index_js_7 = require("./
|
|
12
|
-
const index_js_8 = require("./
|
|
13
|
-
const index_js_9 = require("./
|
|
14
|
-
const index_js_10 = require("./
|
|
6
|
+
const index_js_2 = require("./email/index.cjs");
|
|
7
|
+
const index_js_3 = require("./extract/index.cjs");
|
|
8
|
+
const index_js_4 = require("./messenger/index.cjs");
|
|
9
|
+
const index_js_5 = require("./notion/index.cjs");
|
|
10
|
+
const index_js_6 = require("./sitemap/index.cjs");
|
|
11
|
+
const index_js_7 = require("./slack/index.cjs");
|
|
12
|
+
const index_js_8 = require("./support/index.cjs");
|
|
13
|
+
const index_js_9 = require("./telegram/index.cjs");
|
|
14
|
+
const index_js_10 = require("./trigger/index.cjs");
|
|
15
|
+
const index_js_11 = require("./whatsapp/index.cjs");
|
|
16
|
+
const index_js_12 = require("./widget/index.cjs");
|
|
15
17
|
class IntegrationClient extends client_js_1.ChatBotKitClient {
|
|
16
18
|
constructor(options) {
|
|
17
19
|
super(options);
|
|
18
|
-
this.widget = new
|
|
19
|
-
this.slack = new
|
|
20
|
+
this.widget = new index_js_12.WidgetIntegrationClient(options);
|
|
21
|
+
this.slack = new index_js_7.SlackIntegrationClient(options);
|
|
20
22
|
this.discord = new index_js_1.DiscordIntegrationClient(options);
|
|
21
|
-
this.whatsapp = new
|
|
22
|
-
this.messenger = new
|
|
23
|
-
this.telegram = new
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
this.
|
|
27
|
-
this.
|
|
23
|
+
this.whatsapp = new index_js_11.WhatsAppIntegrationClient(options);
|
|
24
|
+
this.messenger = new index_js_4.MessengerIntegrationClient(options);
|
|
25
|
+
this.telegram = new index_js_9.TelegramIntegrationClient(options);
|
|
26
|
+
this.trigger = new index_js_10.TriggerIntegrationClient(options);
|
|
27
|
+
this.email = new index_js_2.EmailIntegrationClient(options);
|
|
28
|
+
this.sitemap = new index_js_6.SitemapIntegrationClient(options);
|
|
29
|
+
this.notion = new index_js_5.NotionIntegrationClient(options);
|
|
30
|
+
this.support = new index_js_8.SupportIntegrationClient(options);
|
|
31
|
+
this.extract = new index_js_3.ExtractIntegrationClient(options);
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
exports.IntegrationClient = IntegrationClient;
|
|
@@ -5,6 +5,8 @@ export class IntegrationClient extends ChatBotKitClient {
|
|
|
5
5
|
whatsapp: WhatsAppIntegrationClient;
|
|
6
6
|
messenger: MessengerIntegrationClient;
|
|
7
7
|
telegram: TelegramIntegrationClient;
|
|
8
|
+
trigger: TriggerIntegrationClient;
|
|
9
|
+
email: EmailIntegrationClient;
|
|
8
10
|
sitemap: SitemapIntegrationClient;
|
|
9
11
|
notion: NotionIntegrationClient;
|
|
10
12
|
support: SupportIntegrationClient;
|
|
@@ -18,6 +20,8 @@ import { DiscordIntegrationClient } from './discord/index.cjs';
|
|
|
18
20
|
import { WhatsAppIntegrationClient } from './whatsapp/index.cjs';
|
|
19
21
|
import { MessengerIntegrationClient } from './messenger/index.cjs';
|
|
20
22
|
import { TelegramIntegrationClient } from './telegram/index.cjs';
|
|
23
|
+
import { TriggerIntegrationClient } from './trigger/index.cjs';
|
|
24
|
+
import { EmailIntegrationClient } from './email/index.cjs';
|
|
21
25
|
import { SitemapIntegrationClient } from './sitemap/index.cjs';
|
|
22
26
|
import { NotionIntegrationClient } from './notion/index.cjs';
|
|
23
27
|
import { SupportIntegrationClient } from './support/index.cjs';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TriggerIntegrationClient = void 0;
|
|
4
|
+
const client_js_1 = require("../../client.cjs");
|
|
5
|
+
const v1_js_1 = require("./v1.cjs");
|
|
6
|
+
class TriggerIntegrationClient extends client_js_1.ChatBotKitClient {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
}
|
|
10
|
+
list(request) {
|
|
11
|
+
return (0, v1_js_1.listTriggerIntegrations)(this, request);
|
|
12
|
+
}
|
|
13
|
+
fetch(triggerId) {
|
|
14
|
+
return (0, v1_js_1.fetchTriggerIntegration)(this, triggerId);
|
|
15
|
+
}
|
|
16
|
+
create(request) {
|
|
17
|
+
return (0, v1_js_1.createTriggerIntegration)(this, request);
|
|
18
|
+
}
|
|
19
|
+
update(triggerId, request) {
|
|
20
|
+
return (0, v1_js_1.updateTriggerIntegration)(this, triggerId, request);
|
|
21
|
+
}
|
|
22
|
+
delete(triggerId) {
|
|
23
|
+
return (0, v1_js_1.deleteTriggerIntegration)(this, triggerId);
|
|
24
|
+
}
|
|
25
|
+
setup(triggerId) {
|
|
26
|
+
return (0, v1_js_1.setupTriggerIntegration)(this, triggerId);
|
|
27
|
+
}
|
|
28
|
+
invoke(triggerId, request) {
|
|
29
|
+
return (0, v1_js_1.invokeTriggerIntegration)(this, triggerId, request);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.TriggerIntegrationClient = TriggerIntegrationClient;
|
|
33
|
+
exports.default = TriggerIntegrationClient;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export class TriggerIntegrationClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import('./v1.js').TriggerIntegrationListRequest): ResponsePromise<import('./v1.cjs').TriggerIntegrationListResponse, import('./v1.cjs').TriggerIntegrationListStreamType>;
|
|
3
|
+
fetch(triggerId: string): Promise<import('./v1.cjs').TriggerIntegrationFetchResponse>;
|
|
4
|
+
create(request: import('./v1.cjs').TriggerIntegrationCreateRequest): Promise<import('./v1.cjs').TriggerIntegrationCreateResponse>;
|
|
5
|
+
update(triggerId: string, request: import('./v1.cjs').TriggerIntegrationUpdateRequest): Promise<import('./v1.cjs').TriggerIntegrationUpdateResponse>;
|
|
6
|
+
delete(triggerId: string): Promise<import('./v1.cjs').TriggerIntegrationDeleteResponse>;
|
|
7
|
+
setup(triggerId: string): Promise<import('./v1.cjs').TriggerIntegrationSetupResponse>;
|
|
8
|
+
invoke(triggerId: string, request: import('./v1.cjs').TriggerIntegrationInvokeRequest): Promise<import('./v1.cjs').TriggerIntegrationInvokeResponse>;
|
|
9
|
+
}
|
|
10
|
+
export default TriggerIntegrationClient;
|
|
11
|
+
export type ResponsePromise<T, U> = import('../../client.cjs').ResponsePromise<T, U>;
|
|
12
|
+
import { ChatBotKitClient } from '../../client.cjs';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invokeTriggerIntegration = exports.setupTriggerIntegration = exports.deleteTriggerIntegration = exports.updateTriggerIntegration = exports.createTriggerIntegration = exports.fetchTriggerIntegration = exports.listTriggerIntegrations = void 0;
|
|
4
|
+
const v1_js_1 = require("../../model/v1.cjs");
|
|
5
|
+
function listTriggerIntegrations(client, request) {
|
|
6
|
+
let url = `/api/v1/integration/trigger/list`;
|
|
7
|
+
const response = client.clientFetch(url, { query: request });
|
|
8
|
+
return response;
|
|
9
|
+
}
|
|
10
|
+
exports.listTriggerIntegrations = listTriggerIntegrations;
|
|
11
|
+
async function fetchTriggerIntegration(client, triggerId) {
|
|
12
|
+
const url = `/api/v1/integration/trigger/${triggerId}/fetch`;
|
|
13
|
+
const response = await client.clientFetch(url);
|
|
14
|
+
return response;
|
|
15
|
+
}
|
|
16
|
+
exports.fetchTriggerIntegration = fetchTriggerIntegration;
|
|
17
|
+
async function createTriggerIntegration(client, request) {
|
|
18
|
+
const url = `/api/v1/integration/trigger/create`;
|
|
19
|
+
const response = await client.clientFetch(url, {
|
|
20
|
+
record: {
|
|
21
|
+
...request,
|
|
22
|
+
model: request.model ? (0, v1_js_1.buildModelString)(request.model) : undefined,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
return response;
|
|
26
|
+
}
|
|
27
|
+
exports.createTriggerIntegration = createTriggerIntegration;
|
|
28
|
+
async function updateTriggerIntegration(client, triggerId, request) {
|
|
29
|
+
const url = `/api/v1/integration/trigger/${triggerId}/update`;
|
|
30
|
+
const response = await client.clientFetch(url, {
|
|
31
|
+
record: {
|
|
32
|
+
...request,
|
|
33
|
+
model: request.model ? (0, v1_js_1.buildModelString)(request.model) : undefined,
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
return response;
|
|
37
|
+
}
|
|
38
|
+
exports.updateTriggerIntegration = updateTriggerIntegration;
|
|
39
|
+
async function deleteTriggerIntegration(client, triggerId) {
|
|
40
|
+
const url = `/api/v1/integration/trigger/${triggerId}/delete`;
|
|
41
|
+
const response = await client.clientFetch(url, {
|
|
42
|
+
record: {},
|
|
43
|
+
});
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
exports.deleteTriggerIntegration = deleteTriggerIntegration;
|
|
47
|
+
async function setupTriggerIntegration(client, triggerId) {
|
|
48
|
+
const url = `/api/v1/integration/trigger/${triggerId}/setup`;
|
|
49
|
+
const response = await client.clientFetch(url, {
|
|
50
|
+
record: {},
|
|
51
|
+
});
|
|
52
|
+
return response;
|
|
53
|
+
}
|
|
54
|
+
exports.setupTriggerIntegration = setupTriggerIntegration;
|
|
55
|
+
async function invokeTriggerIntegration(client, triggerId, request) {
|
|
56
|
+
const url = `/api/v1/integration/trigger/${triggerId}/invoke`;
|
|
57
|
+
const response = await client.clientFetch(url, {
|
|
58
|
+
record: {
|
|
59
|
+
...request,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
return response;
|
|
63
|
+
}
|
|
64
|
+
exports.invokeTriggerIntegration = invokeTriggerIntegration;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export function listTriggerIntegrations(client: ChatBotKitClient, request?: TriggerIntegrationListRequest): ResponsePromise<TriggerIntegrationListResponse, TriggerIntegrationListStreamType>;
|
|
2
|
+
export function fetchTriggerIntegration(client: ChatBotKitClient, triggerId: string): Promise<TriggerIntegrationFetchResponse>;
|
|
3
|
+
export function createTriggerIntegration(client: ChatBotKitClient, request: TriggerIntegrationCreateRequest): Promise<TriggerIntegrationCreateResponse>;
|
|
4
|
+
export function updateTriggerIntegration(client: ChatBotKitClient, triggerId: string, request: TriggerIntegrationUpdateRequest): Promise<TriggerIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteTriggerIntegration(client: ChatBotKitClient, triggerId: string): Promise<TriggerIntegrationDeleteResponse>;
|
|
6
|
+
export function setupTriggerIntegration(client: ChatBotKitClient, triggerId: string): Promise<TriggerIntegrationSetupResponse>;
|
|
7
|
+
export function invokeTriggerIntegration(client: ChatBotKitClient, triggerId: string, request: TriggerIntegrationInvokeRequest): Promise<TriggerIntegrationInvokeResponse>;
|
|
8
|
+
export type ChatBotKitClient = import('../../client.cjs').ChatBotKitClient;
|
|
9
|
+
export type ResponsePromise<T, U> = import('../../client.cjs').ResponsePromise<T, U>;
|
|
10
|
+
export type BotRef = {
|
|
11
|
+
botId?: string;
|
|
12
|
+
};
|
|
13
|
+
export type BotConfig = {
|
|
14
|
+
backstory?: string;
|
|
15
|
+
model?: string;
|
|
16
|
+
datasetId?: string;
|
|
17
|
+
skillsetId?: string;
|
|
18
|
+
privacy?: boolean;
|
|
19
|
+
moderation?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type BotRefOrConfig = BotRef | BotConfig;
|
|
22
|
+
export type TriggerIntegrationOptions = BotRefOrConfig & {
|
|
23
|
+
name?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
authenticate?: boolean;
|
|
26
|
+
sessionDuration?: number;
|
|
27
|
+
meta?: Record<string, any>;
|
|
28
|
+
};
|
|
29
|
+
export type TriggerIntegrationInstance = TriggerIntegrationOptions & {
|
|
30
|
+
id: string;
|
|
31
|
+
createdAt: number;
|
|
32
|
+
updatedAt: number;
|
|
33
|
+
};
|
|
34
|
+
export type TriggerIntegrationListRequest = {
|
|
35
|
+
cursor?: string;
|
|
36
|
+
order?: 'desc' | 'asc';
|
|
37
|
+
take?: number;
|
|
38
|
+
meta?: Record<string, string>;
|
|
39
|
+
};
|
|
40
|
+
export type TriggerIntegrationListResponse = {
|
|
41
|
+
items: TriggerIntegrationInstance[];
|
|
42
|
+
};
|
|
43
|
+
export type TriggerIntegrationListStreamItem = {
|
|
44
|
+
type: 'item';
|
|
45
|
+
data: TriggerIntegrationInstance;
|
|
46
|
+
};
|
|
47
|
+
export type TriggerIntegrationListStreamType = TriggerIntegrationListStreamItem;
|
|
48
|
+
export type TriggerIntegrationFetchResponse = TriggerIntegrationInstance & {};
|
|
49
|
+
export type TriggerIntegrationCreateRequest = TriggerIntegrationOptions & {
|
|
50
|
+
model?: import('../../model/v1.cjs').Model;
|
|
51
|
+
};
|
|
52
|
+
export type TriggerIntegrationCreateResponse = {
|
|
53
|
+
id: string;
|
|
54
|
+
};
|
|
55
|
+
export type TriggerIntegrationUpdateRequest = TriggerIntegrationOptions & {
|
|
56
|
+
model?: import('../../model/v1.cjs').Model;
|
|
57
|
+
};
|
|
58
|
+
export type TriggerIntegrationUpdateResponse = {
|
|
59
|
+
id: string;
|
|
60
|
+
};
|
|
61
|
+
export type TriggerIntegrationDeleteResponse = {
|
|
62
|
+
id: string;
|
|
63
|
+
};
|
|
64
|
+
export type TriggerIntegrationSetupResponse = {
|
|
65
|
+
id: string;
|
|
66
|
+
};
|
|
67
|
+
export type TriggerIntegrationInvokeRequest = object;
|
|
68
|
+
export type TriggerIntegrationInvokeResponse = {
|
|
69
|
+
id: string;
|
|
70
|
+
};
|
|
@@ -126,13 +126,17 @@ export type ConversationCompleteMessageStreamResult = {
|
|
|
126
126
|
type: 'result';
|
|
127
127
|
data: ConversationCompleteMessageResponse;
|
|
128
128
|
};
|
|
129
|
+
export type ConversationCompleteMessageStreamMessage = {
|
|
130
|
+
type: 'message';
|
|
131
|
+
data: Message;
|
|
132
|
+
};
|
|
129
133
|
export type ConversationCompleteMessageStreamToken = {
|
|
130
134
|
type: 'token';
|
|
131
135
|
data: {
|
|
132
136
|
token: string;
|
|
133
137
|
};
|
|
134
138
|
};
|
|
135
|
-
export type ConversationCompleteMessageStreamType = ConversationCompleteMessageStreamResult | ConversationCompleteMessageStreamToken;
|
|
139
|
+
export type ConversationCompleteMessageStreamType = ConversationCompleteMessageStreamResult | ConversationCompleteMessageStreamMessage | ConversationCompleteMessageStreamToken;
|
|
136
140
|
export type ConversationSendMessageRequest = {
|
|
137
141
|
text?: string;
|
|
138
142
|
entities?: Entity[];
|
|
@@ -158,13 +162,17 @@ export type ConversationReceiveMessageStreamResult = {
|
|
|
158
162
|
type: 'result';
|
|
159
163
|
data: ConversationReceiveMessageResponse;
|
|
160
164
|
};
|
|
165
|
+
export type ConversationReceiveMessageStreamMessage = {
|
|
166
|
+
type: 'message';
|
|
167
|
+
data: Message;
|
|
168
|
+
};
|
|
161
169
|
export type ConversationReceiveMessageStreamToken = {
|
|
162
170
|
type: 'token';
|
|
163
171
|
data: {
|
|
164
172
|
token: string;
|
|
165
173
|
};
|
|
166
174
|
};
|
|
167
|
-
export type ConversationReceiveMessageStreamType = ConversationReceiveMessageStreamResult | ConversationReceiveMessageStreamToken;
|
|
175
|
+
export type ConversationReceiveMessageStreamType = ConversationReceiveMessageStreamResult | ConversationReceiveMessageStreamMessage | ConversationReceiveMessageStreamToken;
|
|
168
176
|
export type ConversationUpvoteRequest = {
|
|
169
177
|
value?: number;
|
|
170
178
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class EmailIntegrationClient extends ChatBotKitClient {
|
|
2
|
+
list(request?: import("./v1.js").EmailIntegrationListRequest | undefined): ResponsePromise<import('./v1.js').EmailIntegrationListResponse, import('./v1.js').EmailIntegrationListStreamType>;
|
|
3
|
+
fetch(emailId: string): Promise<import('./v1.js').EmailIntegrationFetchResponse>;
|
|
4
|
+
create(request: import('./v1.js').EmailIntegrationCreateRequest): Promise<import('./v1.js').EmailIntegrationCreateResponse>;
|
|
5
|
+
update(emailId: string, request: import('./v1.js').EmailIntegrationUpdateRequest): Promise<import('./v1.js').EmailIntegrationUpdateResponse>;
|
|
6
|
+
delete(emailId: string): Promise<import('./v1.js').EmailIntegrationDeleteResponse>;
|
|
7
|
+
setup(emailId: string): Promise<import('./v1.js').EmailIntegrationSetupResponse>;
|
|
8
|
+
}
|
|
9
|
+
export default EmailIntegrationClient;
|
|
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 { createEmailIntegration, deleteEmailIntegration, fetchEmailIntegration, listEmailIntegrations, setupEmailIntegration, updateEmailIntegration, } from './v1.js';
|
|
3
|
+
export class EmailIntegrationClient extends ChatBotKitClient {
|
|
4
|
+
constructor(options) {
|
|
5
|
+
super(options);
|
|
6
|
+
}
|
|
7
|
+
list(request) {
|
|
8
|
+
return listEmailIntegrations(this, request);
|
|
9
|
+
}
|
|
10
|
+
fetch(emailId) {
|
|
11
|
+
return fetchEmailIntegration(this, emailId);
|
|
12
|
+
}
|
|
13
|
+
create(request) {
|
|
14
|
+
return createEmailIntegration(this, request);
|
|
15
|
+
}
|
|
16
|
+
update(emailId, request) {
|
|
17
|
+
return updateEmailIntegration(this, emailId, request);
|
|
18
|
+
}
|
|
19
|
+
delete(emailId) {
|
|
20
|
+
return deleteEmailIntegration(this, emailId);
|
|
21
|
+
}
|
|
22
|
+
setup(emailId) {
|
|
23
|
+
return setupEmailIntegration(this, emailId);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export default EmailIntegrationClient;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export function listEmailIntegrations(client: ChatBotKitClient, request?: EmailIntegrationListRequest | undefined): ResponsePromise<EmailIntegrationListResponse, EmailIntegrationListStreamType>;
|
|
2
|
+
export function fetchEmailIntegration(client: ChatBotKitClient, emailId: string): Promise<EmailIntegrationFetchResponse>;
|
|
3
|
+
export function createEmailIntegration(client: ChatBotKitClient, request: EmailIntegrationCreateRequest): Promise<EmailIntegrationCreateResponse>;
|
|
4
|
+
export function updateEmailIntegration(client: ChatBotKitClient, emailId: string, request: EmailIntegrationUpdateRequest): Promise<EmailIntegrationUpdateResponse>;
|
|
5
|
+
export function deleteEmailIntegration(client: ChatBotKitClient, emailId: string): Promise<EmailIntegrationDeleteResponse>;
|
|
6
|
+
export function setupEmailIntegration(client: ChatBotKitClient, emailId: string): Promise<EmailIntegrationSetupResponse>;
|
|
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 EmailIntegrationOptions = BotRefOrConfig & {
|
|
22
|
+
name?: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
contactCollection?: boolean;
|
|
25
|
+
sessionDuration?: number;
|
|
26
|
+
meta?: Record<string, any>;
|
|
27
|
+
};
|
|
28
|
+
export type EmailIntegrationInstance = EmailIntegrationOptions & {
|
|
29
|
+
id: string;
|
|
30
|
+
createdAt: number;
|
|
31
|
+
updatedAt: number;
|
|
32
|
+
};
|
|
33
|
+
export type EmailIntegrationListRequest = {
|
|
34
|
+
cursor?: string;
|
|
35
|
+
order?: 'desc' | 'asc';
|
|
36
|
+
take?: number;
|
|
37
|
+
meta?: Record<string, string>;
|
|
38
|
+
};
|
|
39
|
+
export type EmailIntegrationListResponse = {
|
|
40
|
+
items: EmailIntegrationInstance[];
|
|
41
|
+
};
|
|
42
|
+
export type EmailIntegrationListStreamItem = {
|
|
43
|
+
type: 'item';
|
|
44
|
+
data: EmailIntegrationInstance;
|
|
45
|
+
};
|
|
46
|
+
export type EmailIntegrationListStreamType = EmailIntegrationListStreamItem;
|
|
47
|
+
export type EmailIntegrationFetchResponse = EmailIntegrationInstance & {};
|
|
48
|
+
export type EmailIntegrationCreateRequest = EmailIntegrationOptions & {
|
|
49
|
+
model?: import('../../model/v1.js').Model;
|
|
50
|
+
};
|
|
51
|
+
export type EmailIntegrationCreateResponse = {
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
54
|
+
export type EmailIntegrationUpdateRequest = EmailIntegrationOptions & {
|
|
55
|
+
model?: import('../../model/v1.js').Model;
|
|
56
|
+
};
|
|
57
|
+
export type EmailIntegrationUpdateResponse = {
|
|
58
|
+
id: string;
|
|
59
|
+
};
|
|
60
|
+
export type EmailIntegrationDeleteResponse = {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
63
|
+
export type EmailIntegrationSetupResponse = {
|
|
64
|
+
id: string;
|
|
65
|
+
};
|