@chatbotkit/cli 1.26.2 → 1.26.3
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/command/api/blueprint/index.cjs +81 -0
- package/dist/cjs/command/api/blueprint/index.d.ts +8 -0
- package/dist/cjs/command/api/bot/index.cjs +61 -0
- package/dist/cjs/command/api/bot/index.d.ts +6 -0
- package/dist/cjs/command/api/contact/index.cjs +61 -0
- package/dist/cjs/command/api/contact/index.d.ts +6 -0
- package/dist/cjs/command/api/dataset/file/index.cjs +76 -0
- package/dist/cjs/command/api/dataset/file/index.d.ts +7 -0
- package/dist/cjs/command/api/dataset/index.cjs +7 -2
- package/dist/cjs/command/api/dataset/record/index.cjs +83 -0
- package/dist/cjs/command/api/dataset/record/index.d.ts +7 -0
- package/dist/cjs/command/api/file/index.cjs +71 -0
- package/dist/cjs/command/api/file/index.d.ts +7 -0
- package/dist/cjs/command/api/index.cjs +24 -8
- package/dist/cjs/command/api/integration/discord/index.cjs +71 -0
- package/dist/cjs/command/api/integration/discord/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/email/index.cjs +71 -0
- package/dist/cjs/command/api/integration/email/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/extract/index.cjs +61 -0
- package/dist/cjs/command/api/integration/extract/index.d.ts +6 -0
- package/dist/cjs/command/api/integration/index.cjs +44 -0
- package/dist/cjs/command/api/integration/index.d.ts +3 -0
- package/dist/cjs/command/api/integration/instagram/index.cjs +71 -0
- package/dist/cjs/command/api/integration/instagram/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/mcpserver/index.cjs +61 -0
- package/dist/cjs/command/api/integration/mcpserver/index.d.ts +6 -0
- package/dist/cjs/command/api/integration/messenger/index.cjs +71 -0
- package/dist/cjs/command/api/integration/messenger/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/notion/index.cjs +71 -0
- package/dist/cjs/command/api/integration/notion/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/sitemap/index.cjs +71 -0
- package/dist/cjs/command/api/integration/sitemap/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/slack/index.cjs +71 -0
- package/dist/cjs/command/api/integration/slack/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/support/index.cjs +61 -0
- package/dist/cjs/command/api/integration/support/index.d.ts +6 -0
- package/dist/cjs/command/api/integration/telegram/index.cjs +71 -0
- package/dist/cjs/command/api/integration/telegram/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/trigger/index.cjs +71 -0
- package/dist/cjs/command/api/integration/trigger/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/twilio/index.cjs +71 -0
- package/dist/cjs/command/api/integration/twilio/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/whatsapp/index.cjs +71 -0
- package/dist/cjs/command/api/integration/whatsapp/index.d.ts +7 -0
- package/dist/cjs/command/api/integration/widget/index.cjs +71 -0
- package/dist/cjs/command/api/integration/widget/index.d.ts +7 -0
- package/dist/cjs/command/api/memory/index.cjs +79 -0
- package/dist/cjs/command/api/memory/index.d.ts +7 -0
- package/dist/cjs/command/api/secret/index.cjs +81 -0
- package/dist/cjs/command/api/secret/index.d.ts +8 -0
- package/dist/cjs/command/api/skillset/ability/index.cjs +83 -0
- package/dist/cjs/command/api/skillset/ability/index.d.ts +7 -0
- package/dist/cjs/command/api/skillset/index.cjs +5 -2
- package/dist/cjs/command/api/team/index.cjs +42 -0
- package/dist/cjs/command/api/team/index.d.ts +4 -0
- package/dist/cjs/input.cjs +28 -0
- package/dist/cjs/input.d.ts +5 -0
- package/dist/cjs/solution/index.cjs +1 -1
- package/dist/esm/command/api/blueprint/index.d.ts +8 -0
- package/dist/esm/command/api/blueprint/index.js +78 -0
- package/dist/esm/command/api/bot/index.d.ts +6 -0
- package/dist/esm/command/api/bot/index.js +58 -0
- package/dist/esm/command/api/contact/index.d.ts +6 -0
- package/dist/esm/command/api/contact/index.js +58 -0
- package/dist/esm/command/api/dataset/file/index.d.ts +7 -0
- package/dist/esm/command/api/dataset/file/index.js +73 -0
- package/dist/esm/command/api/dataset/index.js +4 -0
- package/dist/esm/command/api/dataset/record/index.d.ts +7 -0
- package/dist/esm/command/api/dataset/record/index.js +80 -0
- package/dist/esm/command/api/file/index.d.ts +7 -0
- package/dist/esm/command/api/file/index.js +68 -0
- package/dist/esm/command/api/index.js +17 -1
- package/dist/esm/command/api/integration/discord/index.d.ts +7 -0
- package/dist/esm/command/api/integration/discord/index.js +68 -0
- package/dist/esm/command/api/integration/email/index.d.ts +7 -0
- package/dist/esm/command/api/integration/email/index.js +68 -0
- package/dist/esm/command/api/integration/extract/index.d.ts +6 -0
- package/dist/esm/command/api/integration/extract/index.js +58 -0
- package/dist/esm/command/api/integration/index.d.ts +3 -0
- package/dist/esm/command/api/integration/index.js +40 -0
- package/dist/esm/command/api/integration/instagram/index.d.ts +7 -0
- package/dist/esm/command/api/integration/instagram/index.js +68 -0
- package/dist/esm/command/api/integration/mcpserver/index.d.ts +6 -0
- package/dist/esm/command/api/integration/mcpserver/index.js +58 -0
- package/dist/esm/command/api/integration/messenger/index.d.ts +7 -0
- package/dist/esm/command/api/integration/messenger/index.js +68 -0
- package/dist/esm/command/api/integration/notion/index.d.ts +7 -0
- package/dist/esm/command/api/integration/notion/index.js +68 -0
- package/dist/esm/command/api/integration/sitemap/index.d.ts +7 -0
- package/dist/esm/command/api/integration/sitemap/index.js +68 -0
- package/dist/esm/command/api/integration/slack/index.d.ts +7 -0
- package/dist/esm/command/api/integration/slack/index.js +68 -0
- package/dist/esm/command/api/integration/support/index.d.ts +6 -0
- package/dist/esm/command/api/integration/support/index.js +58 -0
- package/dist/esm/command/api/integration/telegram/index.d.ts +7 -0
- package/dist/esm/command/api/integration/telegram/index.js +68 -0
- package/dist/esm/command/api/integration/trigger/index.d.ts +7 -0
- package/dist/esm/command/api/integration/trigger/index.js +68 -0
- package/dist/esm/command/api/integration/twilio/index.d.ts +7 -0
- package/dist/esm/command/api/integration/twilio/index.js +68 -0
- package/dist/esm/command/api/integration/whatsapp/index.d.ts +7 -0
- package/dist/esm/command/api/integration/whatsapp/index.js +68 -0
- package/dist/esm/command/api/integration/widget/index.d.ts +7 -0
- package/dist/esm/command/api/integration/widget/index.js +68 -0
- package/dist/esm/command/api/memory/index.d.ts +7 -0
- package/dist/esm/command/api/memory/index.js +76 -0
- package/dist/esm/command/api/secret/index.d.ts +8 -0
- package/dist/esm/command/api/secret/index.js +78 -0
- package/dist/esm/command/api/skillset/ability/index.d.ts +7 -0
- package/dist/esm/command/api/skillset/ability/index.js +80 -0
- package/dist/esm/command/api/skillset/index.js +2 -0
- package/dist/esm/command/api/team/index.d.ts +4 -0
- package/dist/esm/command/api/team/index.js +39 -0
- package/dist/esm/input.d.ts +5 -0
- package/dist/esm/input.js +27 -0
- package/dist/esm/solution/index.d.ts +74 -68
- package/dist/esm/solution/index.js +1 -1
- package/package.json +804 -26
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { SitemapIntegrationClient } from '@chatbotkit/sdk/integration/sitemap/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new SitemapIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const sitemapList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List sitemap integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream sitemap integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const sitemap of client.list().stream()) {
|
|
20
|
+
print(sitemap);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const sitemap of items) {
|
|
26
|
+
print(sitemap);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const sitemapFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch sitemap integration')
|
|
33
|
+
.argument('<sitemapId>', 'Sitemap ID')
|
|
34
|
+
.action(async (sitemapId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const sitemap = await client.fetch(sitemapId);
|
|
37
|
+
print(sitemap);
|
|
38
|
+
});
|
|
39
|
+
export const sitemapDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete sitemap integration')
|
|
42
|
+
.argument('<sitemapId>', 'Sitemap ID')
|
|
43
|
+
.action(async (sitemapId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(sitemapId);
|
|
46
|
+
});
|
|
47
|
+
export const sitemapSync = new Command()
|
|
48
|
+
.name('sync')
|
|
49
|
+
.description('Sync sitemap integration')
|
|
50
|
+
.argument('<sitemapId>', 'Sitemap ID')
|
|
51
|
+
.action(async (sitemapId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.sync(sitemapId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: sitemapList,
|
|
58
|
+
fetch: sitemapFetch,
|
|
59
|
+
delete: sitemapDelete,
|
|
60
|
+
sync: sitemapSync,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('sitemap')
|
|
64
|
+
.description('Sitemap integration tools for ChatBotKit');
|
|
65
|
+
for (const cmd of Object.values(commands)) {
|
|
66
|
+
command.addCommand(cmd);
|
|
67
|
+
}
|
|
68
|
+
export default command;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { SlackIntegrationClient } from '@chatbotkit/sdk/integration/slack/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new SlackIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const slackList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List slack integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream slack integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const slack of client.list().stream()) {
|
|
20
|
+
print(slack);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const slack of items) {
|
|
26
|
+
print(slack);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const slackFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch slack integration')
|
|
33
|
+
.argument('<slackId>', 'Slack ID')
|
|
34
|
+
.action(async (slackId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const slack = await client.fetch(slackId);
|
|
37
|
+
print(slack);
|
|
38
|
+
});
|
|
39
|
+
export const slackDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete slack integration')
|
|
42
|
+
.argument('<slackId>', 'Slack ID')
|
|
43
|
+
.action(async (slackId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(slackId);
|
|
46
|
+
});
|
|
47
|
+
export const slackSetup = new Command()
|
|
48
|
+
.name('setup')
|
|
49
|
+
.description('Setup slack integration')
|
|
50
|
+
.argument('<slackId>', 'Slack ID')
|
|
51
|
+
.action(async (slackId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.setup(slackId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: slackList,
|
|
58
|
+
fetch: slackFetch,
|
|
59
|
+
delete: slackDelete,
|
|
60
|
+
setup: slackSetup,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('slack')
|
|
64
|
+
.description('Slack integration tools for ChatBotKit');
|
|
65
|
+
for (const cmd of Object.values(commands)) {
|
|
66
|
+
command.addCommand(cmd);
|
|
67
|
+
}
|
|
68
|
+
export default command;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { SupportIntegrationClient } from '@chatbotkit/sdk/integration/support/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new SupportIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const supportList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List support integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream support integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const support of client.list().stream()) {
|
|
20
|
+
print(support);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const support of items) {
|
|
26
|
+
print(support);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const supportFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch support integration')
|
|
33
|
+
.argument('<supportId>', 'Support ID')
|
|
34
|
+
.action(async (supportId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const support = await client.fetch(supportId);
|
|
37
|
+
print(support);
|
|
38
|
+
});
|
|
39
|
+
export const supportDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete support integration')
|
|
42
|
+
.argument('<supportId>', 'Support ID')
|
|
43
|
+
.action(async (supportId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(supportId);
|
|
46
|
+
});
|
|
47
|
+
const commands = {
|
|
48
|
+
list: supportList,
|
|
49
|
+
fetch: supportFetch,
|
|
50
|
+
delete: supportDelete,
|
|
51
|
+
};
|
|
52
|
+
export const command = new Command()
|
|
53
|
+
.name('support')
|
|
54
|
+
.description('Support integration tools for ChatBotKit');
|
|
55
|
+
for (const cmd of Object.values(commands)) {
|
|
56
|
+
command.addCommand(cmd);
|
|
57
|
+
}
|
|
58
|
+
export default command;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { TelegramIntegrationClient } from '@chatbotkit/sdk/integration/telegram/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new TelegramIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const telegramList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List telegram integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream telegram integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const telegram of client.list().stream()) {
|
|
20
|
+
print(telegram);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const telegram of items) {
|
|
26
|
+
print(telegram);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const telegramFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch telegram integration')
|
|
33
|
+
.argument('<telegramId>', 'Telegram ID')
|
|
34
|
+
.action(async (telegramId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const telegram = await client.fetch(telegramId);
|
|
37
|
+
print(telegram);
|
|
38
|
+
});
|
|
39
|
+
export const telegramDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete telegram integration')
|
|
42
|
+
.argument('<telegramId>', 'Telegram ID')
|
|
43
|
+
.action(async (telegramId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(telegramId);
|
|
46
|
+
});
|
|
47
|
+
export const telegramSetup = new Command()
|
|
48
|
+
.name('setup')
|
|
49
|
+
.description('Setup telegram integration')
|
|
50
|
+
.argument('<telegramId>', 'Telegram ID')
|
|
51
|
+
.action(async (telegramId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.setup(telegramId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: telegramList,
|
|
58
|
+
fetch: telegramFetch,
|
|
59
|
+
delete: telegramDelete,
|
|
60
|
+
setup: telegramSetup,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('telegram')
|
|
64
|
+
.description('Telegram integration tools for ChatBotKit');
|
|
65
|
+
for (const cmd of Object.values(commands)) {
|
|
66
|
+
command.addCommand(cmd);
|
|
67
|
+
}
|
|
68
|
+
export default command;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { TriggerIntegrationClient } from '@chatbotkit/sdk/integration/trigger/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new TriggerIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const triggerList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List trigger integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream trigger integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const trigger of client.list().stream()) {
|
|
20
|
+
print(trigger);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const trigger of items) {
|
|
26
|
+
print(trigger);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const triggerFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch trigger integration')
|
|
33
|
+
.argument('<triggerId>', 'Trigger ID')
|
|
34
|
+
.action(async (triggerId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const trigger = await client.fetch(triggerId);
|
|
37
|
+
print(trigger);
|
|
38
|
+
});
|
|
39
|
+
export const triggerDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete trigger integration')
|
|
42
|
+
.argument('<triggerId>', 'Trigger ID')
|
|
43
|
+
.action(async (triggerId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(triggerId);
|
|
46
|
+
});
|
|
47
|
+
export const triggerInvoke = new Command()
|
|
48
|
+
.name('invoke')
|
|
49
|
+
.description('Invoke trigger integration')
|
|
50
|
+
.argument('<triggerId>', 'Trigger ID')
|
|
51
|
+
.action(async (triggerId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.invoke(triggerId, {});
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: triggerList,
|
|
58
|
+
fetch: triggerFetch,
|
|
59
|
+
delete: triggerDelete,
|
|
60
|
+
invoke: triggerInvoke,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('trigger')
|
|
64
|
+
.description('Trigger integration tools for ChatBotKit');
|
|
65
|
+
for (const cmd of Object.values(commands)) {
|
|
66
|
+
command.addCommand(cmd);
|
|
67
|
+
}
|
|
68
|
+
export default command;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { TwilioIntegrationClient } from '@chatbotkit/sdk/integration/twilio/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new TwilioIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const twilioList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List twilio integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream twilio integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const twilio of client.list().stream()) {
|
|
20
|
+
print(twilio);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const twilio of items) {
|
|
26
|
+
print(twilio);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const twilioFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch twilio integration')
|
|
33
|
+
.argument('<twilioId>', 'Twilio ID')
|
|
34
|
+
.action(async (twilioId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const twilio = await client.fetch(twilioId);
|
|
37
|
+
print(twilio);
|
|
38
|
+
});
|
|
39
|
+
export const twilioDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete twilio integration')
|
|
42
|
+
.argument('<twilioId>', 'Twilio ID')
|
|
43
|
+
.action(async (twilioId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(twilioId);
|
|
46
|
+
});
|
|
47
|
+
export const twilioSetup = new Command()
|
|
48
|
+
.name('setup')
|
|
49
|
+
.description('Setup twilio integration')
|
|
50
|
+
.argument('<twilioId>', 'Twilio ID')
|
|
51
|
+
.action(async (twilioId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.setup(twilioId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: twilioList,
|
|
58
|
+
fetch: twilioFetch,
|
|
59
|
+
delete: twilioDelete,
|
|
60
|
+
setup: twilioSetup,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('twilio')
|
|
64
|
+
.description('Twilio integration tools for ChatBotKit');
|
|
65
|
+
for (const cmd of Object.values(commands)) {
|
|
66
|
+
command.addCommand(cmd);
|
|
67
|
+
}
|
|
68
|
+
export default command;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { WhatsAppIntegrationClient } from '@chatbotkit/sdk/integration/whatsapp/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new WhatsAppIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const whatsappList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List whatsapp integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream whatsapp integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const whatsapp of client.list().stream()) {
|
|
20
|
+
print(whatsapp);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const whatsapp of items) {
|
|
26
|
+
print(whatsapp);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const whatsappFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch whatsapp integration')
|
|
33
|
+
.argument('<whatsappId>', 'WhatsApp ID')
|
|
34
|
+
.action(async (whatsappId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const whatsapp = await client.fetch(whatsappId);
|
|
37
|
+
print(whatsapp);
|
|
38
|
+
});
|
|
39
|
+
export const whatsappDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete whatsapp integration')
|
|
42
|
+
.argument('<whatsappId>', 'WhatsApp ID')
|
|
43
|
+
.action(async (whatsappId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(whatsappId);
|
|
46
|
+
});
|
|
47
|
+
export const whatsappSetup = new Command()
|
|
48
|
+
.name('setup')
|
|
49
|
+
.description('Setup whatsapp integration')
|
|
50
|
+
.argument('<whatsappId>', 'WhatsApp ID')
|
|
51
|
+
.action(async (whatsappId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.setup(whatsappId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: whatsappList,
|
|
58
|
+
fetch: whatsappFetch,
|
|
59
|
+
delete: whatsappDelete,
|
|
60
|
+
setup: whatsappSetup,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('whatsapp')
|
|
64
|
+
.description('WhatsApp integration tools for ChatBotKit');
|
|
65
|
+
for (const cmd of Object.values(commands)) {
|
|
66
|
+
command.addCommand(cmd);
|
|
67
|
+
}
|
|
68
|
+
export default command;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { WidgetIntegrationClient } from '@chatbotkit/sdk/integration/widget/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new WidgetIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const widgetList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List widget integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream widget integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const widget of client.list().stream()) {
|
|
20
|
+
print(widget);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const widget of items) {
|
|
26
|
+
print(widget);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const widgetFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch widget integration')
|
|
33
|
+
.argument('<widgetId>', 'Widget ID')
|
|
34
|
+
.action(async (widgetId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const widget = await client.fetch(widgetId);
|
|
37
|
+
print(widget);
|
|
38
|
+
});
|
|
39
|
+
export const widgetDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete widget integration')
|
|
42
|
+
.argument('<widgetId>', 'Widget ID')
|
|
43
|
+
.action(async (widgetId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(widgetId);
|
|
46
|
+
});
|
|
47
|
+
export const widgetSetup = new Command()
|
|
48
|
+
.name('setup')
|
|
49
|
+
.description('Setup widget integration')
|
|
50
|
+
.argument('<widgetId>', 'Widget ID')
|
|
51
|
+
.action(async (widgetId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.setup(widgetId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: widgetList,
|
|
58
|
+
fetch: widgetFetch,
|
|
59
|
+
delete: widgetDelete,
|
|
60
|
+
setup: widgetSetup,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('widget')
|
|
64
|
+
.description('Widget integration tools for ChatBotKit');
|
|
65
|
+
for (const cmd of Object.values(commands)) {
|
|
66
|
+
command.addCommand(cmd);
|
|
67
|
+
}
|
|
68
|
+
export default command;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../env.js';
|
|
2
|
+
import { print } from '../../../output.js';
|
|
3
|
+
import { MemoryClient } from '@chatbotkit/sdk/memory/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new MemoryClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const memoryList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List memories')
|
|
14
|
+
.option('-s, --stream', 'Stream memories')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const memory of client.list().stream()) {
|
|
20
|
+
print(memory);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const memory of items) {
|
|
26
|
+
print(memory);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const memoryFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch memory')
|
|
33
|
+
.argument('<memoryId>', 'Memory ID')
|
|
34
|
+
.action(async (memoryId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const memory = await client.fetch(memoryId);
|
|
37
|
+
print(memory);
|
|
38
|
+
});
|
|
39
|
+
export const memoryDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete memory')
|
|
42
|
+
.argument('<memoryId>', 'Memory ID')
|
|
43
|
+
.action(async (memoryId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(memoryId);
|
|
46
|
+
});
|
|
47
|
+
export const memoryExport = new Command()
|
|
48
|
+
.name('export')
|
|
49
|
+
.description('Export memories')
|
|
50
|
+
.option('-s, --stream', 'Stream exports')
|
|
51
|
+
.action(async (str, options) => {
|
|
52
|
+
const { stream } = options;
|
|
53
|
+
const client = getClient();
|
|
54
|
+
if (stream) {
|
|
55
|
+
for await (const memory of client.export().stream()) {
|
|
56
|
+
print(memory);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
const result = await client.export();
|
|
61
|
+
print(result);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
const commands = {
|
|
65
|
+
list: memoryList,
|
|
66
|
+
fetch: memoryFetch,
|
|
67
|
+
delete: memoryDelete,
|
|
68
|
+
export: memoryExport,
|
|
69
|
+
};
|
|
70
|
+
export const command = new Command()
|
|
71
|
+
.name('memory')
|
|
72
|
+
.description('Memory tools for ChatBotKit');
|
|
73
|
+
for (const cmd of Object.values(commands)) {
|
|
74
|
+
command.addCommand(cmd);
|
|
75
|
+
}
|
|
76
|
+
export default command;
|