@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.
- 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/cjs/tools.cjs +5 -186
- package/dist/cjs/tools.d.ts +2 -7
- 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 +78 -72
- package/dist/esm/solution/index.js +1 -1
- package/dist/esm/tools.d.ts +2 -7
- package/dist/esm/tools.js +2 -183
- package/package.json +783 -3
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { DatasetFileClient } from '@chatbotkit/sdk/dataset/file/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new DatasetFileClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const fileList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List files')
|
|
14
|
+
.option('-s, --stream', 'Stream files')
|
|
15
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
16
|
+
.action(async (datasetId, options) => {
|
|
17
|
+
const { stream } = options;
|
|
18
|
+
const client = getClient();
|
|
19
|
+
if (stream) {
|
|
20
|
+
for await (const file of client.list(datasetId).stream()) {
|
|
21
|
+
print(file);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const { items } = await client.list(datasetId);
|
|
26
|
+
for (const file of items) {
|
|
27
|
+
print(file);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export const fileAttach = new Command()
|
|
32
|
+
.name('attach')
|
|
33
|
+
.description('Attach file to dataset')
|
|
34
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
35
|
+
.argument('<fileId>', 'File ID')
|
|
36
|
+
.action(async (datasetId, fileId) => {
|
|
37
|
+
const client = getClient();
|
|
38
|
+
const result = await client.attach(datasetId, fileId, {});
|
|
39
|
+
print(result);
|
|
40
|
+
});
|
|
41
|
+
export const fileDetach = new Command()
|
|
42
|
+
.name('detach')
|
|
43
|
+
.description('Detach file from dataset')
|
|
44
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
45
|
+
.argument('<fileId>', 'File ID')
|
|
46
|
+
.action(async (datasetId, fileId) => {
|
|
47
|
+
const client = getClient();
|
|
48
|
+
const result = await client.detach(datasetId, fileId, {});
|
|
49
|
+
print(result);
|
|
50
|
+
});
|
|
51
|
+
export const fileSync = new Command()
|
|
52
|
+
.name('sync')
|
|
53
|
+
.description('Sync file')
|
|
54
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
55
|
+
.argument('<fileId>', 'File ID')
|
|
56
|
+
.action(async (datasetId, fileId) => {
|
|
57
|
+
const client = getClient();
|
|
58
|
+
const result = await client.sync(datasetId, fileId, {});
|
|
59
|
+
print(result);
|
|
60
|
+
});
|
|
61
|
+
const commands = {
|
|
62
|
+
list: fileList,
|
|
63
|
+
attach: fileAttach,
|
|
64
|
+
detach: fileDetach,
|
|
65
|
+
sync: fileSync,
|
|
66
|
+
};
|
|
67
|
+
export const command = new Command()
|
|
68
|
+
.name('file')
|
|
69
|
+
.description('File tools for ChatBotKit');
|
|
70
|
+
for (const cmd of Object.values(commands)) {
|
|
71
|
+
command.addCommand(cmd);
|
|
72
|
+
}
|
|
73
|
+
export default command;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { getRUNAS_USERID, getSECRET } from '../../../env.js';
|
|
2
2
|
import { print } from '../../../output.js';
|
|
3
|
+
import file from './file/index.js';
|
|
4
|
+
import record from './record/index.js';
|
|
3
5
|
import { DatasetClient } from '@chatbotkit/sdk/dataset/index.js';
|
|
4
6
|
import { Command } from 'commander';
|
|
5
7
|
function getClient() {
|
|
@@ -48,6 +50,8 @@ const commands = {
|
|
|
48
50
|
list: datasetList,
|
|
49
51
|
fetch: datasetFetch,
|
|
50
52
|
delete: datasetDelete,
|
|
53
|
+
file,
|
|
54
|
+
record,
|
|
51
55
|
};
|
|
52
56
|
export const command = new Command()
|
|
53
57
|
.name('dataset')
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { DatasetRecordClient } from '@chatbotkit/sdk/dataset/record/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new DatasetRecordClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const recordList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List records')
|
|
14
|
+
.option('-s, --stream', 'Stream records')
|
|
15
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
16
|
+
.action(async (datasetId, options) => {
|
|
17
|
+
const { stream } = options;
|
|
18
|
+
const client = getClient();
|
|
19
|
+
if (stream) {
|
|
20
|
+
for await (const record of client.list(datasetId).stream()) {
|
|
21
|
+
print(record);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const { items } = await client.list(datasetId);
|
|
26
|
+
for (const record of items) {
|
|
27
|
+
print(record);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
export const recordFetch = new Command()
|
|
32
|
+
.name('fetch')
|
|
33
|
+
.description('Fetch record')
|
|
34
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
35
|
+
.argument('<recordId>', 'Record ID')
|
|
36
|
+
.action(async (datasetId, recordId) => {
|
|
37
|
+
const client = getClient();
|
|
38
|
+
const record = await client.fetch(datasetId, recordId);
|
|
39
|
+
print(record);
|
|
40
|
+
});
|
|
41
|
+
export const recordDelete = new Command()
|
|
42
|
+
.name('delete')
|
|
43
|
+
.description('Delete record')
|
|
44
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
45
|
+
.argument('<recordId>', 'Record ID')
|
|
46
|
+
.action(async (datasetId, recordId) => {
|
|
47
|
+
const client = getClient();
|
|
48
|
+
await client.delete(datasetId, recordId);
|
|
49
|
+
});
|
|
50
|
+
export const recordExport = new Command()
|
|
51
|
+
.name('export')
|
|
52
|
+
.description('Export records')
|
|
53
|
+
.option('-s, --stream', 'Stream exports')
|
|
54
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
55
|
+
.action(async (datasetId, options) => {
|
|
56
|
+
const { stream } = options;
|
|
57
|
+
const client = getClient();
|
|
58
|
+
if (stream) {
|
|
59
|
+
for await (const record of client.export(datasetId).stream()) {
|
|
60
|
+
print(record);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
const result = await client.export(datasetId);
|
|
65
|
+
print(result);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
const commands = {
|
|
69
|
+
list: recordList,
|
|
70
|
+
fetch: recordFetch,
|
|
71
|
+
delete: recordDelete,
|
|
72
|
+
export: recordExport,
|
|
73
|
+
};
|
|
74
|
+
export const command = new Command()
|
|
75
|
+
.name('record')
|
|
76
|
+
.description('Record tools for ChatBotKit');
|
|
77
|
+
for (const cmd of Object.values(commands)) {
|
|
78
|
+
command.addCommand(cmd);
|
|
79
|
+
}
|
|
80
|
+
export default command;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../env.js';
|
|
2
|
+
import { print } from '../../../output.js';
|
|
3
|
+
import { FileClient } from '@chatbotkit/sdk/file/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new FileClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const fileList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List files')
|
|
14
|
+
.option('-s, --stream', 'Stream files')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const file of client.list().stream()) {
|
|
20
|
+
print(file);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const file of items) {
|
|
26
|
+
print(file);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const fileFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch file')
|
|
33
|
+
.argument('<fileId>', 'File ID')
|
|
34
|
+
.action(async (fileId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const file = await client.fetch(fileId);
|
|
37
|
+
print(file);
|
|
38
|
+
});
|
|
39
|
+
export const fileDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete file')
|
|
42
|
+
.argument('<fileId>', 'File ID')
|
|
43
|
+
.action(async (fileId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(fileId);
|
|
46
|
+
});
|
|
47
|
+
export const fileSync = new Command()
|
|
48
|
+
.name('sync')
|
|
49
|
+
.description('Sync file')
|
|
50
|
+
.argument('<fileId>', 'File ID')
|
|
51
|
+
.action(async (fileId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.sync(fileId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: fileList,
|
|
58
|
+
fetch: fileFetch,
|
|
59
|
+
delete: fileDelete,
|
|
60
|
+
sync: fileSync,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('file')
|
|
64
|
+
.description('File tools for ChatBotKit');
|
|
65
|
+
for (const cmd of Object.values(commands)) {
|
|
66
|
+
command.addCommand(cmd);
|
|
67
|
+
}
|
|
68
|
+
export default command;
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import { config as printConfig } from '../../output.js';
|
|
2
|
+
import blueprint from './blueprint/index.js';
|
|
3
|
+
import bot from './bot/index.js';
|
|
4
|
+
import contact from './contact/index.js';
|
|
2
5
|
import conversation from './conversation/index.js';
|
|
3
6
|
import dataset from './dataset/index.js';
|
|
7
|
+
import file from './file/index.js';
|
|
8
|
+
import integration from './integration/index.js';
|
|
9
|
+
import memory from './memory/index.js';
|
|
4
10
|
import partner from './partner/index.js';
|
|
11
|
+
import secret from './secret/index.js';
|
|
5
12
|
import skillset from './skillset/index.js';
|
|
13
|
+
import team from './team/index.js';
|
|
6
14
|
import { Command, Option } from 'commander';
|
|
7
15
|
const commands = {
|
|
16
|
+
blueprint,
|
|
17
|
+
bot,
|
|
18
|
+
contact,
|
|
8
19
|
conversation,
|
|
9
20
|
dataset,
|
|
10
|
-
|
|
21
|
+
file,
|
|
22
|
+
integration,
|
|
23
|
+
memory,
|
|
11
24
|
partner,
|
|
25
|
+
secret,
|
|
26
|
+
skillset,
|
|
27
|
+
team,
|
|
12
28
|
};
|
|
13
29
|
export const command = new Command()
|
|
14
30
|
.name('api')
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { DiscordIntegrationClient } from '@chatbotkit/sdk/integration/discord/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new DiscordIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const discordList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List discord integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream discord integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const discord of client.list().stream()) {
|
|
20
|
+
print(discord);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const discord of items) {
|
|
26
|
+
print(discord);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const discordFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch discord integration')
|
|
33
|
+
.argument('<discordId>', 'Discord ID')
|
|
34
|
+
.action(async (discordId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const discord = await client.fetch(discordId);
|
|
37
|
+
print(discord);
|
|
38
|
+
});
|
|
39
|
+
export const discordDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete discord integration')
|
|
42
|
+
.argument('<discordId>', 'Discord ID')
|
|
43
|
+
.action(async (discordId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(discordId);
|
|
46
|
+
});
|
|
47
|
+
export const discordSetup = new Command()
|
|
48
|
+
.name('setup')
|
|
49
|
+
.description('Setup discord integration')
|
|
50
|
+
.argument('<discordId>', 'Discord ID')
|
|
51
|
+
.action(async (discordId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.setup(discordId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: discordList,
|
|
58
|
+
fetch: discordFetch,
|
|
59
|
+
delete: discordDelete,
|
|
60
|
+
setup: discordSetup,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('discord')
|
|
64
|
+
.description('Discord 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 { EmailIntegrationClient } from '@chatbotkit/sdk/integration/email/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new EmailIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const emailList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List email integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream email integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const email of client.list().stream()) {
|
|
20
|
+
print(email);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const email of items) {
|
|
26
|
+
print(email);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const emailFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch email integration')
|
|
33
|
+
.argument('<emailId>', 'Email ID')
|
|
34
|
+
.action(async (emailId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const email = await client.fetch(emailId);
|
|
37
|
+
print(email);
|
|
38
|
+
});
|
|
39
|
+
export const emailDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete email integration')
|
|
42
|
+
.argument('<emailId>', 'Email ID')
|
|
43
|
+
.action(async (emailId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(emailId);
|
|
46
|
+
});
|
|
47
|
+
export const emailSetup = new Command()
|
|
48
|
+
.name('setup')
|
|
49
|
+
.description('Setup email integration')
|
|
50
|
+
.argument('<emailId>', 'Email ID')
|
|
51
|
+
.action(async (emailId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.setup(emailId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: emailList,
|
|
58
|
+
fetch: emailFetch,
|
|
59
|
+
delete: emailDelete,
|
|
60
|
+
setup: emailSetup,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('email')
|
|
64
|
+
.description('Email 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 { ExtractIntegrationClient } from '@chatbotkit/sdk/integration/extract/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new ExtractIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const extractList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List extract integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream extract integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const extract of client.list().stream()) {
|
|
20
|
+
print(extract);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const extract of items) {
|
|
26
|
+
print(extract);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const extractFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch extract integration')
|
|
33
|
+
.argument('<extractId>', 'Extract ID')
|
|
34
|
+
.action(async (extractId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const extract = await client.fetch(extractId);
|
|
37
|
+
print(extract);
|
|
38
|
+
});
|
|
39
|
+
export const extractDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete extract integration')
|
|
42
|
+
.argument('<extractId>', 'Extract ID')
|
|
43
|
+
.action(async (extractId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(extractId);
|
|
46
|
+
});
|
|
47
|
+
const commands = {
|
|
48
|
+
list: extractList,
|
|
49
|
+
fetch: extractFetch,
|
|
50
|
+
delete: extractDelete,
|
|
51
|
+
};
|
|
52
|
+
export const command = new Command()
|
|
53
|
+
.name('extract')
|
|
54
|
+
.description('Extract integration tools for ChatBotKit');
|
|
55
|
+
for (const cmd of Object.values(commands)) {
|
|
56
|
+
command.addCommand(cmd);
|
|
57
|
+
}
|
|
58
|
+
export default command;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import discord from './discord/index.js';
|
|
2
|
+
import email from './email/index.js';
|
|
3
|
+
import extract from './extract/index.js';
|
|
4
|
+
import instagram from './instagram/index.js';
|
|
5
|
+
import mcpserver from './mcpserver/index.js';
|
|
6
|
+
import messenger from './messenger/index.js';
|
|
7
|
+
import notion from './notion/index.js';
|
|
8
|
+
import sitemap from './sitemap/index.js';
|
|
9
|
+
import slack from './slack/index.js';
|
|
10
|
+
import support from './support/index.js';
|
|
11
|
+
import telegram from './telegram/index.js';
|
|
12
|
+
import trigger from './trigger/index.js';
|
|
13
|
+
import twilio from './twilio/index.js';
|
|
14
|
+
import whatsapp from './whatsapp/index.js';
|
|
15
|
+
import widget from './widget/index.js';
|
|
16
|
+
import { Command } from 'commander';
|
|
17
|
+
const commands = {
|
|
18
|
+
widget,
|
|
19
|
+
slack,
|
|
20
|
+
discord,
|
|
21
|
+
whatsapp,
|
|
22
|
+
messenger,
|
|
23
|
+
instagram,
|
|
24
|
+
telegram,
|
|
25
|
+
trigger,
|
|
26
|
+
email,
|
|
27
|
+
sitemap,
|
|
28
|
+
notion,
|
|
29
|
+
support,
|
|
30
|
+
extract,
|
|
31
|
+
mcpserver,
|
|
32
|
+
twilio,
|
|
33
|
+
};
|
|
34
|
+
export const command = new Command()
|
|
35
|
+
.name('integration')
|
|
36
|
+
.description('Integration tools for ChatBotKit');
|
|
37
|
+
for (const cmd of Object.values(commands)) {
|
|
38
|
+
command.addCommand(cmd);
|
|
39
|
+
}
|
|
40
|
+
export default command;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getRUNAS_USERID, getSECRET } from '../../../../env.js';
|
|
2
|
+
import { print } from '../../../../output.js';
|
|
3
|
+
import { InstagramIntegrationClient } from '@chatbotkit/sdk/integration/instagram/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
function getClient() {
|
|
6
|
+
return new InstagramIntegrationClient({
|
|
7
|
+
secret: getSECRET(),
|
|
8
|
+
runAsUserId: getRUNAS_USERID(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export const instagramList = new Command()
|
|
12
|
+
.name('list')
|
|
13
|
+
.description('List instagram integrations')
|
|
14
|
+
.option('-s, --stream', 'Stream instagram integrations')
|
|
15
|
+
.action(async (str, options) => {
|
|
16
|
+
const { stream } = options;
|
|
17
|
+
const client = getClient();
|
|
18
|
+
if (stream) {
|
|
19
|
+
for await (const instagram of client.list().stream()) {
|
|
20
|
+
print(instagram);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const { items } = await client.list();
|
|
25
|
+
for (const instagram of items) {
|
|
26
|
+
print(instagram);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
export const instagramFetch = new Command()
|
|
31
|
+
.name('fetch')
|
|
32
|
+
.description('Fetch instagram integration')
|
|
33
|
+
.argument('<instagramId>', 'Instagram ID')
|
|
34
|
+
.action(async (instagramId) => {
|
|
35
|
+
const client = getClient();
|
|
36
|
+
const instagram = await client.fetch(instagramId);
|
|
37
|
+
print(instagram);
|
|
38
|
+
});
|
|
39
|
+
export const instagramDelete = new Command()
|
|
40
|
+
.name('delete')
|
|
41
|
+
.description('Delete instagram integration')
|
|
42
|
+
.argument('<instagramId>', 'Instagram ID')
|
|
43
|
+
.action(async (instagramId) => {
|
|
44
|
+
const client = getClient();
|
|
45
|
+
await client.delete(instagramId);
|
|
46
|
+
});
|
|
47
|
+
export const instagramSetup = new Command()
|
|
48
|
+
.name('setup')
|
|
49
|
+
.description('Setup instagram integration')
|
|
50
|
+
.argument('<instagramId>', 'Instagram ID')
|
|
51
|
+
.action(async (instagramId) => {
|
|
52
|
+
const client = getClient();
|
|
53
|
+
const result = await client.setup(instagramId);
|
|
54
|
+
print(result);
|
|
55
|
+
});
|
|
56
|
+
const commands = {
|
|
57
|
+
list: instagramList,
|
|
58
|
+
fetch: instagramFetch,
|
|
59
|
+
delete: instagramDelete,
|
|
60
|
+
setup: instagramSetup,
|
|
61
|
+
};
|
|
62
|
+
export const command = new Command()
|
|
63
|
+
.name('instagram')
|
|
64
|
+
.description('Instagram integration tools for ChatBotKit');
|
|
65
|
+
for (const cmd of Object.values(commands)) {
|
|
66
|
+
command.addCommand(cmd);
|
|
67
|
+
}
|
|
68
|
+
export default command;
|