@chatbotkit/cli 1.26.1 → 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.
Files changed (122) hide show
  1. package/dist/cjs/command/api/blueprint/index.cjs +81 -0
  2. package/dist/cjs/command/api/blueprint/index.d.ts +8 -0
  3. package/dist/cjs/command/api/bot/index.cjs +61 -0
  4. package/dist/cjs/command/api/bot/index.d.ts +6 -0
  5. package/dist/cjs/command/api/contact/index.cjs +61 -0
  6. package/dist/cjs/command/api/contact/index.d.ts +6 -0
  7. package/dist/cjs/command/api/dataset/file/index.cjs +76 -0
  8. package/dist/cjs/command/api/dataset/file/index.d.ts +7 -0
  9. package/dist/cjs/command/api/dataset/index.cjs +7 -2
  10. package/dist/cjs/command/api/dataset/record/index.cjs +83 -0
  11. package/dist/cjs/command/api/dataset/record/index.d.ts +7 -0
  12. package/dist/cjs/command/api/file/index.cjs +71 -0
  13. package/dist/cjs/command/api/file/index.d.ts +7 -0
  14. package/dist/cjs/command/api/index.cjs +24 -8
  15. package/dist/cjs/command/api/integration/discord/index.cjs +71 -0
  16. package/dist/cjs/command/api/integration/discord/index.d.ts +7 -0
  17. package/dist/cjs/command/api/integration/email/index.cjs +71 -0
  18. package/dist/cjs/command/api/integration/email/index.d.ts +7 -0
  19. package/dist/cjs/command/api/integration/extract/index.cjs +61 -0
  20. package/dist/cjs/command/api/integration/extract/index.d.ts +6 -0
  21. package/dist/cjs/command/api/integration/index.cjs +44 -0
  22. package/dist/cjs/command/api/integration/index.d.ts +3 -0
  23. package/dist/cjs/command/api/integration/instagram/index.cjs +71 -0
  24. package/dist/cjs/command/api/integration/instagram/index.d.ts +7 -0
  25. package/dist/cjs/command/api/integration/mcpserver/index.cjs +61 -0
  26. package/dist/cjs/command/api/integration/mcpserver/index.d.ts +6 -0
  27. package/dist/cjs/command/api/integration/messenger/index.cjs +71 -0
  28. package/dist/cjs/command/api/integration/messenger/index.d.ts +7 -0
  29. package/dist/cjs/command/api/integration/notion/index.cjs +71 -0
  30. package/dist/cjs/command/api/integration/notion/index.d.ts +7 -0
  31. package/dist/cjs/command/api/integration/sitemap/index.cjs +71 -0
  32. package/dist/cjs/command/api/integration/sitemap/index.d.ts +7 -0
  33. package/dist/cjs/command/api/integration/slack/index.cjs +71 -0
  34. package/dist/cjs/command/api/integration/slack/index.d.ts +7 -0
  35. package/dist/cjs/command/api/integration/support/index.cjs +61 -0
  36. package/dist/cjs/command/api/integration/support/index.d.ts +6 -0
  37. package/dist/cjs/command/api/integration/telegram/index.cjs +71 -0
  38. package/dist/cjs/command/api/integration/telegram/index.d.ts +7 -0
  39. package/dist/cjs/command/api/integration/trigger/index.cjs +71 -0
  40. package/dist/cjs/command/api/integration/trigger/index.d.ts +7 -0
  41. package/dist/cjs/command/api/integration/twilio/index.cjs +71 -0
  42. package/dist/cjs/command/api/integration/twilio/index.d.ts +7 -0
  43. package/dist/cjs/command/api/integration/whatsapp/index.cjs +71 -0
  44. package/dist/cjs/command/api/integration/whatsapp/index.d.ts +7 -0
  45. package/dist/cjs/command/api/integration/widget/index.cjs +71 -0
  46. package/dist/cjs/command/api/integration/widget/index.d.ts +7 -0
  47. package/dist/cjs/command/api/memory/index.cjs +79 -0
  48. package/dist/cjs/command/api/memory/index.d.ts +7 -0
  49. package/dist/cjs/command/api/secret/index.cjs +81 -0
  50. package/dist/cjs/command/api/secret/index.d.ts +8 -0
  51. package/dist/cjs/command/api/skillset/ability/index.cjs +83 -0
  52. package/dist/cjs/command/api/skillset/ability/index.d.ts +7 -0
  53. package/dist/cjs/command/api/skillset/index.cjs +5 -2
  54. package/dist/cjs/command/api/team/index.cjs +42 -0
  55. package/dist/cjs/command/api/team/index.d.ts +4 -0
  56. package/dist/cjs/input.cjs +28 -0
  57. package/dist/cjs/input.d.ts +5 -0
  58. package/dist/cjs/solution/index.cjs +1 -1
  59. package/dist/cjs/tools.cjs +5 -186
  60. package/dist/cjs/tools.d.ts +2 -7
  61. package/dist/esm/command/api/blueprint/index.d.ts +8 -0
  62. package/dist/esm/command/api/blueprint/index.js +78 -0
  63. package/dist/esm/command/api/bot/index.d.ts +6 -0
  64. package/dist/esm/command/api/bot/index.js +58 -0
  65. package/dist/esm/command/api/contact/index.d.ts +6 -0
  66. package/dist/esm/command/api/contact/index.js +58 -0
  67. package/dist/esm/command/api/dataset/file/index.d.ts +7 -0
  68. package/dist/esm/command/api/dataset/file/index.js +73 -0
  69. package/dist/esm/command/api/dataset/index.js +4 -0
  70. package/dist/esm/command/api/dataset/record/index.d.ts +7 -0
  71. package/dist/esm/command/api/dataset/record/index.js +80 -0
  72. package/dist/esm/command/api/file/index.d.ts +7 -0
  73. package/dist/esm/command/api/file/index.js +68 -0
  74. package/dist/esm/command/api/index.js +17 -1
  75. package/dist/esm/command/api/integration/discord/index.d.ts +7 -0
  76. package/dist/esm/command/api/integration/discord/index.js +68 -0
  77. package/dist/esm/command/api/integration/email/index.d.ts +7 -0
  78. package/dist/esm/command/api/integration/email/index.js +68 -0
  79. package/dist/esm/command/api/integration/extract/index.d.ts +6 -0
  80. package/dist/esm/command/api/integration/extract/index.js +58 -0
  81. package/dist/esm/command/api/integration/index.d.ts +3 -0
  82. package/dist/esm/command/api/integration/index.js +40 -0
  83. package/dist/esm/command/api/integration/instagram/index.d.ts +7 -0
  84. package/dist/esm/command/api/integration/instagram/index.js +68 -0
  85. package/dist/esm/command/api/integration/mcpserver/index.d.ts +6 -0
  86. package/dist/esm/command/api/integration/mcpserver/index.js +58 -0
  87. package/dist/esm/command/api/integration/messenger/index.d.ts +7 -0
  88. package/dist/esm/command/api/integration/messenger/index.js +68 -0
  89. package/dist/esm/command/api/integration/notion/index.d.ts +7 -0
  90. package/dist/esm/command/api/integration/notion/index.js +68 -0
  91. package/dist/esm/command/api/integration/sitemap/index.d.ts +7 -0
  92. package/dist/esm/command/api/integration/sitemap/index.js +68 -0
  93. package/dist/esm/command/api/integration/slack/index.d.ts +7 -0
  94. package/dist/esm/command/api/integration/slack/index.js +68 -0
  95. package/dist/esm/command/api/integration/support/index.d.ts +6 -0
  96. package/dist/esm/command/api/integration/support/index.js +58 -0
  97. package/dist/esm/command/api/integration/telegram/index.d.ts +7 -0
  98. package/dist/esm/command/api/integration/telegram/index.js +68 -0
  99. package/dist/esm/command/api/integration/trigger/index.d.ts +7 -0
  100. package/dist/esm/command/api/integration/trigger/index.js +68 -0
  101. package/dist/esm/command/api/integration/twilio/index.d.ts +7 -0
  102. package/dist/esm/command/api/integration/twilio/index.js +68 -0
  103. package/dist/esm/command/api/integration/whatsapp/index.d.ts +7 -0
  104. package/dist/esm/command/api/integration/whatsapp/index.js +68 -0
  105. package/dist/esm/command/api/integration/widget/index.d.ts +7 -0
  106. package/dist/esm/command/api/integration/widget/index.js +68 -0
  107. package/dist/esm/command/api/memory/index.d.ts +7 -0
  108. package/dist/esm/command/api/memory/index.js +76 -0
  109. package/dist/esm/command/api/secret/index.d.ts +8 -0
  110. package/dist/esm/command/api/secret/index.js +78 -0
  111. package/dist/esm/command/api/skillset/ability/index.d.ts +7 -0
  112. package/dist/esm/command/api/skillset/ability/index.js +80 -0
  113. package/dist/esm/command/api/skillset/index.js +2 -0
  114. package/dist/esm/command/api/team/index.d.ts +4 -0
  115. package/dist/esm/command/api/team/index.js +39 -0
  116. package/dist/esm/input.d.ts +5 -0
  117. package/dist/esm/input.js +27 -0
  118. package/dist/esm/solution/index.d.ts +78 -72
  119. package/dist/esm/solution/index.js +1 -1
  120. package/dist/esm/tools.d.ts +2 -7
  121. package/dist/esm/tools.js +2 -183
  122. package/package.json +783 -3
@@ -0,0 +1,58 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
2
+ import { print } from '../../../../output.js';
3
+ import { McpServerIntegrationClient } from '@chatbotkit/sdk/integration/mcpserver/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new McpServerIntegrationClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const mcpserverList = new Command()
12
+ .name('list')
13
+ .description('List MCP server integrations')
14
+ .option('-s, --stream', 'Stream MCP server integrations')
15
+ .action(async (str, options) => {
16
+ const { stream } = options;
17
+ const client = getClient();
18
+ if (stream) {
19
+ for await (const mcpserver of client.list().stream()) {
20
+ print(mcpserver);
21
+ }
22
+ }
23
+ else {
24
+ const { items } = await client.list();
25
+ for (const mcpserver of items) {
26
+ print(mcpserver);
27
+ }
28
+ }
29
+ });
30
+ export const mcpserverFetch = new Command()
31
+ .name('fetch')
32
+ .description('Fetch MCP server integration')
33
+ .argument('<mcpserverId>', 'MCP Server ID')
34
+ .action(async (mcpserverId) => {
35
+ const client = getClient();
36
+ const mcpserver = await client.fetch(mcpserverId);
37
+ print(mcpserver);
38
+ });
39
+ export const mcpserverDelete = new Command()
40
+ .name('delete')
41
+ .description('Delete MCP server integration')
42
+ .argument('<mcpserverId>', 'MCP Server ID')
43
+ .action(async (mcpserverId) => {
44
+ const client = getClient();
45
+ await client.delete(mcpserverId);
46
+ });
47
+ const commands = {
48
+ list: mcpserverList,
49
+ fetch: mcpserverFetch,
50
+ delete: mcpserverDelete,
51
+ };
52
+ export const command = new Command()
53
+ .name('mcpserver')
54
+ .description('MCP Server integration tools for ChatBotKit');
55
+ for (const cmd of Object.values(commands)) {
56
+ command.addCommand(cmd);
57
+ }
58
+ export default command;
@@ -0,0 +1,7 @@
1
+ export const messengerList: Command;
2
+ export const messengerFetch: Command;
3
+ export const messengerDelete: Command;
4
+ export const messengerSetup: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -0,0 +1,68 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
2
+ import { print } from '../../../../output.js';
3
+ import { MessengerIntegrationClient } from '@chatbotkit/sdk/integration/messenger/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new MessengerIntegrationClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const messengerList = new Command()
12
+ .name('list')
13
+ .description('List messenger integrations')
14
+ .option('-s, --stream', 'Stream messenger integrations')
15
+ .action(async (str, options) => {
16
+ const { stream } = options;
17
+ const client = getClient();
18
+ if (stream) {
19
+ for await (const messenger of client.list().stream()) {
20
+ print(messenger);
21
+ }
22
+ }
23
+ else {
24
+ const { items } = await client.list();
25
+ for (const messenger of items) {
26
+ print(messenger);
27
+ }
28
+ }
29
+ });
30
+ export const messengerFetch = new Command()
31
+ .name('fetch')
32
+ .description('Fetch messenger integration')
33
+ .argument('<messengerId>', 'Messenger ID')
34
+ .action(async (messengerId) => {
35
+ const client = getClient();
36
+ const messenger = await client.fetch(messengerId);
37
+ print(messenger);
38
+ });
39
+ export const messengerDelete = new Command()
40
+ .name('delete')
41
+ .description('Delete messenger integration')
42
+ .argument('<messengerId>', 'Messenger ID')
43
+ .action(async (messengerId) => {
44
+ const client = getClient();
45
+ await client.delete(messengerId);
46
+ });
47
+ export const messengerSetup = new Command()
48
+ .name('setup')
49
+ .description('Setup messenger integration')
50
+ .argument('<messengerId>', 'Messenger ID')
51
+ .action(async (messengerId) => {
52
+ const client = getClient();
53
+ const result = await client.setup(messengerId);
54
+ print(result);
55
+ });
56
+ const commands = {
57
+ list: messengerList,
58
+ fetch: messengerFetch,
59
+ delete: messengerDelete,
60
+ setup: messengerSetup,
61
+ };
62
+ export const command = new Command()
63
+ .name('messenger')
64
+ .description('Messenger integration tools for ChatBotKit');
65
+ for (const cmd of Object.values(commands)) {
66
+ command.addCommand(cmd);
67
+ }
68
+ export default command;
@@ -0,0 +1,7 @@
1
+ export const notionList: Command;
2
+ export const notionFetch: Command;
3
+ export const notionDelete: Command;
4
+ export const notionSync: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -0,0 +1,68 @@
1
+ import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
2
+ import { print } from '../../../../output.js';
3
+ import { NotionIntegrationClient } from '@chatbotkit/sdk/integration/notion/index.js';
4
+ import { Command } from 'commander';
5
+ function getClient() {
6
+ return new NotionIntegrationClient({
7
+ secret: getSECRET(),
8
+ runAsUserId: getRUNAS_USERID(),
9
+ });
10
+ }
11
+ export const notionList = new Command()
12
+ .name('list')
13
+ .description('List notion integrations')
14
+ .option('-s, --stream', 'Stream notion integrations')
15
+ .action(async (str, options) => {
16
+ const { stream } = options;
17
+ const client = getClient();
18
+ if (stream) {
19
+ for await (const notion of client.list().stream()) {
20
+ print(notion);
21
+ }
22
+ }
23
+ else {
24
+ const { items } = await client.list();
25
+ for (const notion of items) {
26
+ print(notion);
27
+ }
28
+ }
29
+ });
30
+ export const notionFetch = new Command()
31
+ .name('fetch')
32
+ .description('Fetch notion integration')
33
+ .argument('<notionId>', 'Notion ID')
34
+ .action(async (notionId) => {
35
+ const client = getClient();
36
+ const notion = await client.fetch(notionId);
37
+ print(notion);
38
+ });
39
+ export const notionDelete = new Command()
40
+ .name('delete')
41
+ .description('Delete notion integration')
42
+ .argument('<notionId>', 'Notion ID')
43
+ .action(async (notionId) => {
44
+ const client = getClient();
45
+ await client.delete(notionId);
46
+ });
47
+ export const notionSync = new Command()
48
+ .name('sync')
49
+ .description('Sync notion integration')
50
+ .argument('<notionId>', 'Notion ID')
51
+ .action(async (notionId) => {
52
+ const client = getClient();
53
+ const result = await client.sync(notionId);
54
+ print(result);
55
+ });
56
+ const commands = {
57
+ list: notionList,
58
+ fetch: notionFetch,
59
+ delete: notionDelete,
60
+ sync: notionSync,
61
+ };
62
+ export const command = new Command()
63
+ .name('notion')
64
+ .description('Notion integration tools for ChatBotKit');
65
+ for (const cmd of Object.values(commands)) {
66
+ command.addCommand(cmd);
67
+ }
68
+ export default command;
@@ -0,0 +1,7 @@
1
+ export const sitemapList: Command;
2
+ export const sitemapFetch: Command;
3
+ export const sitemapDelete: Command;
4
+ export const sitemapSync: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -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,7 @@
1
+ export const slackList: Command;
2
+ export const slackFetch: Command;
3
+ export const slackDelete: Command;
4
+ export const slackSetup: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -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,6 @@
1
+ export const supportList: Command;
2
+ export const supportFetch: Command;
3
+ export const supportDelete: Command;
4
+ export const command: Command;
5
+ export default command;
6
+ import { Command } from 'commander';
@@ -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,7 @@
1
+ export const telegramList: Command;
2
+ export const telegramFetch: Command;
3
+ export const telegramDelete: Command;
4
+ export const telegramSetup: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -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,7 @@
1
+ export const triggerList: Command;
2
+ export const triggerFetch: Command;
3
+ export const triggerDelete: Command;
4
+ export const triggerInvoke: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -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,7 @@
1
+ export const twilioList: Command;
2
+ export const twilioFetch: Command;
3
+ export const twilioDelete: Command;
4
+ export const twilioSetup: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';
@@ -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,7 @@
1
+ export const whatsappList: Command;
2
+ export const whatsappFetch: Command;
3
+ export const whatsappDelete: Command;
4
+ export const whatsappSetup: Command;
5
+ export const command: Command;
6
+ export default command;
7
+ import { Command } from 'commander';