@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,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.blueprintListResources = exports.blueprintClone = exports.blueprintDelete = exports.blueprintFetch = exports.blueprintList = void 0;
|
|
4
|
+
const env_js_1 = require("../../../env.cjs");
|
|
5
|
+
const output_js_1 = require("../../../output.cjs");
|
|
6
|
+
const index_js_1 = require("@chatbotkit/sdk/blueprint/index.js");
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
function getClient() {
|
|
9
|
+
return new index_js_1.BlueprintClient({
|
|
10
|
+
secret: (0, env_js_1.getSECRET)(),
|
|
11
|
+
runAsUserId: (0, env_js_1.getRUNAS_USERID)(),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.blueprintList = new commander_1.Command()
|
|
15
|
+
.name('list')
|
|
16
|
+
.description('List blueprints')
|
|
17
|
+
.option('-s, --stream', 'Stream blueprints')
|
|
18
|
+
.action(async (str, options) => {
|
|
19
|
+
const { stream } = options;
|
|
20
|
+
const client = getClient();
|
|
21
|
+
if (stream) {
|
|
22
|
+
for await (const blueprint of client.list().stream()) {
|
|
23
|
+
(0, output_js_1.print)(blueprint);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const { items } = await client.list();
|
|
28
|
+
for (const blueprint of items) {
|
|
29
|
+
(0, output_js_1.print)(blueprint);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
exports.blueprintFetch = new commander_1.Command()
|
|
34
|
+
.name('fetch')
|
|
35
|
+
.description('Fetch blueprint')
|
|
36
|
+
.argument('<blueprintId>', 'Blueprint ID')
|
|
37
|
+
.action(async (blueprintId) => {
|
|
38
|
+
const client = getClient();
|
|
39
|
+
const blueprint = await client.fetch(blueprintId);
|
|
40
|
+
(0, output_js_1.print)(blueprint);
|
|
41
|
+
});
|
|
42
|
+
exports.blueprintDelete = new commander_1.Command()
|
|
43
|
+
.name('delete')
|
|
44
|
+
.description('Delete blueprint')
|
|
45
|
+
.argument('<blueprintId>', 'Blueprint ID')
|
|
46
|
+
.action(async (blueprintId) => {
|
|
47
|
+
const client = getClient();
|
|
48
|
+
await client.delete(blueprintId);
|
|
49
|
+
});
|
|
50
|
+
exports.blueprintClone = new commander_1.Command()
|
|
51
|
+
.name('clone')
|
|
52
|
+
.description('Clone blueprint')
|
|
53
|
+
.argument('<blueprintId>', 'Blueprint ID')
|
|
54
|
+
.action(async (blueprintId) => {
|
|
55
|
+
const client = getClient();
|
|
56
|
+
const result = await client.clone(blueprintId);
|
|
57
|
+
(0, output_js_1.print)(result);
|
|
58
|
+
});
|
|
59
|
+
exports.blueprintListResources = new commander_1.Command()
|
|
60
|
+
.name('list-resources')
|
|
61
|
+
.description('List blueprint resources')
|
|
62
|
+
.argument('<blueprintId>', 'Blueprint ID')
|
|
63
|
+
.action(async (blueprintId) => {
|
|
64
|
+
const client = getClient();
|
|
65
|
+
const result = await client.listResources(blueprintId);
|
|
66
|
+
(0, output_js_1.print)(result);
|
|
67
|
+
});
|
|
68
|
+
const commands = {
|
|
69
|
+
list: exports.blueprintList,
|
|
70
|
+
fetch: exports.blueprintFetch,
|
|
71
|
+
delete: exports.blueprintDelete,
|
|
72
|
+
clone: exports.blueprintClone,
|
|
73
|
+
listResources: exports.blueprintListResources,
|
|
74
|
+
};
|
|
75
|
+
exports.command = new commander_1.Command()
|
|
76
|
+
.name('blueprint')
|
|
77
|
+
.description('Blueprint tools for ChatBotKit');
|
|
78
|
+
for (const cmd of Object.values(commands)) {
|
|
79
|
+
exports.command.addCommand(cmd);
|
|
80
|
+
}
|
|
81
|
+
exports.default = exports.command;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const blueprintList: Command;
|
|
2
|
+
export const blueprintFetch: Command;
|
|
3
|
+
export const blueprintDelete: Command;
|
|
4
|
+
export const blueprintClone: Command;
|
|
5
|
+
export const blueprintListResources: Command;
|
|
6
|
+
export const command: Command;
|
|
7
|
+
export default command;
|
|
8
|
+
import { Command } from 'commander';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.botDelete = exports.botFetch = exports.botList = void 0;
|
|
4
|
+
const env_js_1 = require("../../../env.cjs");
|
|
5
|
+
const output_js_1 = require("../../../output.cjs");
|
|
6
|
+
const index_js_1 = require("@chatbotkit/sdk/bot/index.js");
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
function getClient() {
|
|
9
|
+
return new index_js_1.BotClient({
|
|
10
|
+
secret: (0, env_js_1.getSECRET)(),
|
|
11
|
+
runAsUserId: (0, env_js_1.getRUNAS_USERID)(),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.botList = new commander_1.Command()
|
|
15
|
+
.name('list')
|
|
16
|
+
.description('List bots')
|
|
17
|
+
.option('-s, --stream', 'Stream bots')
|
|
18
|
+
.action(async (str, options) => {
|
|
19
|
+
const { stream } = options;
|
|
20
|
+
const client = getClient();
|
|
21
|
+
if (stream) {
|
|
22
|
+
for await (const bot of client.list().stream()) {
|
|
23
|
+
(0, output_js_1.print)(bot);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const { items } = await client.list();
|
|
28
|
+
for (const bot of items) {
|
|
29
|
+
(0, output_js_1.print)(bot);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
exports.botFetch = new commander_1.Command()
|
|
34
|
+
.name('fetch')
|
|
35
|
+
.description('Fetch bot')
|
|
36
|
+
.argument('<botId>', 'Bot ID')
|
|
37
|
+
.action(async (botId) => {
|
|
38
|
+
const client = getClient();
|
|
39
|
+
const bot = await client.fetch(botId);
|
|
40
|
+
(0, output_js_1.print)(bot);
|
|
41
|
+
});
|
|
42
|
+
exports.botDelete = new commander_1.Command()
|
|
43
|
+
.name('delete')
|
|
44
|
+
.description('Delete bot')
|
|
45
|
+
.argument('<botId>', 'Bot ID')
|
|
46
|
+
.action(async (botId) => {
|
|
47
|
+
const client = getClient();
|
|
48
|
+
await client.delete(botId);
|
|
49
|
+
});
|
|
50
|
+
const commands = {
|
|
51
|
+
list: exports.botList,
|
|
52
|
+
fetch: exports.botFetch,
|
|
53
|
+
delete: exports.botDelete,
|
|
54
|
+
};
|
|
55
|
+
exports.command = new commander_1.Command()
|
|
56
|
+
.name('bot')
|
|
57
|
+
.description('Bot tools for ChatBotKit');
|
|
58
|
+
for (const cmd of Object.values(commands)) {
|
|
59
|
+
exports.command.addCommand(cmd);
|
|
60
|
+
}
|
|
61
|
+
exports.default = exports.command;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.contactDelete = exports.contactFetch = exports.contactList = void 0;
|
|
4
|
+
const env_js_1 = require("../../../env.cjs");
|
|
5
|
+
const output_js_1 = require("../../../output.cjs");
|
|
6
|
+
const index_js_1 = require("@chatbotkit/sdk/contact/index.js");
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
function getClient() {
|
|
9
|
+
return new index_js_1.ContactClient({
|
|
10
|
+
secret: (0, env_js_1.getSECRET)(),
|
|
11
|
+
runAsUserId: (0, env_js_1.getRUNAS_USERID)(),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.contactList = new commander_1.Command()
|
|
15
|
+
.name('list')
|
|
16
|
+
.description('List contacts')
|
|
17
|
+
.option('-s, --stream', 'Stream contacts')
|
|
18
|
+
.action(async (str, options) => {
|
|
19
|
+
const { stream } = options;
|
|
20
|
+
const client = getClient();
|
|
21
|
+
if (stream) {
|
|
22
|
+
for await (const contact of client.list().stream()) {
|
|
23
|
+
(0, output_js_1.print)(contact);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const { items } = await client.list();
|
|
28
|
+
for (const contact of items) {
|
|
29
|
+
(0, output_js_1.print)(contact);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
exports.contactFetch = new commander_1.Command()
|
|
34
|
+
.name('fetch')
|
|
35
|
+
.description('Fetch contact')
|
|
36
|
+
.argument('<contactId>', 'Contact ID')
|
|
37
|
+
.action(async (contactId) => {
|
|
38
|
+
const client = getClient();
|
|
39
|
+
const contact = await client.fetch(contactId);
|
|
40
|
+
(0, output_js_1.print)(contact);
|
|
41
|
+
});
|
|
42
|
+
exports.contactDelete = new commander_1.Command()
|
|
43
|
+
.name('delete')
|
|
44
|
+
.description('Delete contact')
|
|
45
|
+
.argument('<contactId>', 'Contact ID')
|
|
46
|
+
.action(async (contactId) => {
|
|
47
|
+
const client = getClient();
|
|
48
|
+
await client.delete(contactId);
|
|
49
|
+
});
|
|
50
|
+
const commands = {
|
|
51
|
+
list: exports.contactList,
|
|
52
|
+
fetch: exports.contactFetch,
|
|
53
|
+
delete: exports.contactDelete,
|
|
54
|
+
};
|
|
55
|
+
exports.command = new commander_1.Command()
|
|
56
|
+
.name('contact')
|
|
57
|
+
.description('Contact tools for ChatBotKit');
|
|
58
|
+
for (const cmd of Object.values(commands)) {
|
|
59
|
+
exports.command.addCommand(cmd);
|
|
60
|
+
}
|
|
61
|
+
exports.default = exports.command;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.fileSync = exports.fileDetach = exports.fileAttach = exports.fileList = void 0;
|
|
4
|
+
const env_js_1 = require("../../../../env.cjs");
|
|
5
|
+
const output_js_1 = require("../../../../output.cjs");
|
|
6
|
+
const index_js_1 = require("@chatbotkit/sdk/dataset/file/index.js");
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
function getClient() {
|
|
9
|
+
return new index_js_1.DatasetFileClient({
|
|
10
|
+
secret: (0, env_js_1.getSECRET)(),
|
|
11
|
+
runAsUserId: (0, env_js_1.getRUNAS_USERID)(),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.fileList = new commander_1.Command()
|
|
15
|
+
.name('list')
|
|
16
|
+
.description('List files')
|
|
17
|
+
.option('-s, --stream', 'Stream files')
|
|
18
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
19
|
+
.action(async (datasetId, options) => {
|
|
20
|
+
const { stream } = options;
|
|
21
|
+
const client = getClient();
|
|
22
|
+
if (stream) {
|
|
23
|
+
for await (const file of client.list(datasetId).stream()) {
|
|
24
|
+
(0, output_js_1.print)(file);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const { items } = await client.list(datasetId);
|
|
29
|
+
for (const file of items) {
|
|
30
|
+
(0, output_js_1.print)(file);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
exports.fileAttach = new commander_1.Command()
|
|
35
|
+
.name('attach')
|
|
36
|
+
.description('Attach file to dataset')
|
|
37
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
38
|
+
.argument('<fileId>', 'File ID')
|
|
39
|
+
.action(async (datasetId, fileId) => {
|
|
40
|
+
const client = getClient();
|
|
41
|
+
const result = await client.attach(datasetId, fileId, {});
|
|
42
|
+
(0, output_js_1.print)(result);
|
|
43
|
+
});
|
|
44
|
+
exports.fileDetach = new commander_1.Command()
|
|
45
|
+
.name('detach')
|
|
46
|
+
.description('Detach file from dataset')
|
|
47
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
48
|
+
.argument('<fileId>', 'File ID')
|
|
49
|
+
.action(async (datasetId, fileId) => {
|
|
50
|
+
const client = getClient();
|
|
51
|
+
const result = await client.detach(datasetId, fileId, {});
|
|
52
|
+
(0, output_js_1.print)(result);
|
|
53
|
+
});
|
|
54
|
+
exports.fileSync = new commander_1.Command()
|
|
55
|
+
.name('sync')
|
|
56
|
+
.description('Sync file')
|
|
57
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
58
|
+
.argument('<fileId>', 'File ID')
|
|
59
|
+
.action(async (datasetId, fileId) => {
|
|
60
|
+
const client = getClient();
|
|
61
|
+
const result = await client.sync(datasetId, fileId, {});
|
|
62
|
+
(0, output_js_1.print)(result);
|
|
63
|
+
});
|
|
64
|
+
const commands = {
|
|
65
|
+
list: exports.fileList,
|
|
66
|
+
attach: exports.fileAttach,
|
|
67
|
+
detach: exports.fileDetach,
|
|
68
|
+
sync: exports.fileSync,
|
|
69
|
+
};
|
|
70
|
+
exports.command = new commander_1.Command()
|
|
71
|
+
.name('file')
|
|
72
|
+
.description('File tools for ChatBotKit');
|
|
73
|
+
for (const cmd of Object.values(commands)) {
|
|
74
|
+
exports.command.addCommand(cmd);
|
|
75
|
+
}
|
|
76
|
+
exports.default = exports.command;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.command = exports.datasetDelete = exports.datasetFetch = exports.datasetList = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const env_js_1 = require("../../../env.cjs");
|
|
5
6
|
const output_js_1 = require("../../../output.cjs");
|
|
6
|
-
const index_js_1 = require("
|
|
7
|
+
const index_js_1 = tslib_1.__importDefault(require("./file/index.cjs"));
|
|
8
|
+
const index_js_2 = tslib_1.__importDefault(require("./record/index.cjs"));
|
|
9
|
+
const index_js_3 = require("@chatbotkit/sdk/dataset/index.js");
|
|
7
10
|
const commander_1 = require("commander");
|
|
8
11
|
function getClient() {
|
|
9
|
-
return new
|
|
12
|
+
return new index_js_3.DatasetClient({
|
|
10
13
|
secret: (0, env_js_1.getSECRET)(),
|
|
11
14
|
runAsUserId: (0, env_js_1.getRUNAS_USERID)(),
|
|
12
15
|
});
|
|
@@ -51,6 +54,8 @@ const commands = {
|
|
|
51
54
|
list: exports.datasetList,
|
|
52
55
|
fetch: exports.datasetFetch,
|
|
53
56
|
delete: exports.datasetDelete,
|
|
57
|
+
file: index_js_1.default,
|
|
58
|
+
record: index_js_2.default,
|
|
54
59
|
};
|
|
55
60
|
exports.command = new commander_1.Command()
|
|
56
61
|
.name('dataset')
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.recordExport = exports.recordDelete = exports.recordFetch = exports.recordList = void 0;
|
|
4
|
+
const env_js_1 = require("../../../../env.cjs");
|
|
5
|
+
const output_js_1 = require("../../../../output.cjs");
|
|
6
|
+
const index_js_1 = require("@chatbotkit/sdk/dataset/record/index.js");
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
function getClient() {
|
|
9
|
+
return new index_js_1.DatasetRecordClient({
|
|
10
|
+
secret: (0, env_js_1.getSECRET)(),
|
|
11
|
+
runAsUserId: (0, env_js_1.getRUNAS_USERID)(),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.recordList = new commander_1.Command()
|
|
15
|
+
.name('list')
|
|
16
|
+
.description('List records')
|
|
17
|
+
.option('-s, --stream', 'Stream records')
|
|
18
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
19
|
+
.action(async (datasetId, options) => {
|
|
20
|
+
const { stream } = options;
|
|
21
|
+
const client = getClient();
|
|
22
|
+
if (stream) {
|
|
23
|
+
for await (const record of client.list(datasetId).stream()) {
|
|
24
|
+
(0, output_js_1.print)(record);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const { items } = await client.list(datasetId);
|
|
29
|
+
for (const record of items) {
|
|
30
|
+
(0, output_js_1.print)(record);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
exports.recordFetch = new commander_1.Command()
|
|
35
|
+
.name('fetch')
|
|
36
|
+
.description('Fetch record')
|
|
37
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
38
|
+
.argument('<recordId>', 'Record ID')
|
|
39
|
+
.action(async (datasetId, recordId) => {
|
|
40
|
+
const client = getClient();
|
|
41
|
+
const record = await client.fetch(datasetId, recordId);
|
|
42
|
+
(0, output_js_1.print)(record);
|
|
43
|
+
});
|
|
44
|
+
exports.recordDelete = new commander_1.Command()
|
|
45
|
+
.name('delete')
|
|
46
|
+
.description('Delete record')
|
|
47
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
48
|
+
.argument('<recordId>', 'Record ID')
|
|
49
|
+
.action(async (datasetId, recordId) => {
|
|
50
|
+
const client = getClient();
|
|
51
|
+
await client.delete(datasetId, recordId);
|
|
52
|
+
});
|
|
53
|
+
exports.recordExport = new commander_1.Command()
|
|
54
|
+
.name('export')
|
|
55
|
+
.description('Export records')
|
|
56
|
+
.option('-s, --stream', 'Stream exports')
|
|
57
|
+
.argument('<datasetId>', 'Dataset ID')
|
|
58
|
+
.action(async (datasetId, options) => {
|
|
59
|
+
const { stream } = options;
|
|
60
|
+
const client = getClient();
|
|
61
|
+
if (stream) {
|
|
62
|
+
for await (const record of client.export(datasetId).stream()) {
|
|
63
|
+
(0, output_js_1.print)(record);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
const result = await client.export(datasetId);
|
|
68
|
+
(0, output_js_1.print)(result);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const commands = {
|
|
72
|
+
list: exports.recordList,
|
|
73
|
+
fetch: exports.recordFetch,
|
|
74
|
+
delete: exports.recordDelete,
|
|
75
|
+
export: exports.recordExport,
|
|
76
|
+
};
|
|
77
|
+
exports.command = new commander_1.Command()
|
|
78
|
+
.name('record')
|
|
79
|
+
.description('Record tools for ChatBotKit');
|
|
80
|
+
for (const cmd of Object.values(commands)) {
|
|
81
|
+
exports.command.addCommand(cmd);
|
|
82
|
+
}
|
|
83
|
+
exports.default = exports.command;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.fileSync = exports.fileDelete = exports.fileFetch = exports.fileList = void 0;
|
|
4
|
+
const env_js_1 = require("../../../env.cjs");
|
|
5
|
+
const output_js_1 = require("../../../output.cjs");
|
|
6
|
+
const index_js_1 = require("@chatbotkit/sdk/file/index.js");
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
function getClient() {
|
|
9
|
+
return new index_js_1.FileClient({
|
|
10
|
+
secret: (0, env_js_1.getSECRET)(),
|
|
11
|
+
runAsUserId: (0, env_js_1.getRUNAS_USERID)(),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.fileList = new commander_1.Command()
|
|
15
|
+
.name('list')
|
|
16
|
+
.description('List files')
|
|
17
|
+
.option('-s, --stream', 'Stream files')
|
|
18
|
+
.action(async (str, options) => {
|
|
19
|
+
const { stream } = options;
|
|
20
|
+
const client = getClient();
|
|
21
|
+
if (stream) {
|
|
22
|
+
for await (const file of client.list().stream()) {
|
|
23
|
+
(0, output_js_1.print)(file);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const { items } = await client.list();
|
|
28
|
+
for (const file of items) {
|
|
29
|
+
(0, output_js_1.print)(file);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
exports.fileFetch = new commander_1.Command()
|
|
34
|
+
.name('fetch')
|
|
35
|
+
.description('Fetch file')
|
|
36
|
+
.argument('<fileId>', 'File ID')
|
|
37
|
+
.action(async (fileId) => {
|
|
38
|
+
const client = getClient();
|
|
39
|
+
const file = await client.fetch(fileId);
|
|
40
|
+
(0, output_js_1.print)(file);
|
|
41
|
+
});
|
|
42
|
+
exports.fileDelete = new commander_1.Command()
|
|
43
|
+
.name('delete')
|
|
44
|
+
.description('Delete file')
|
|
45
|
+
.argument('<fileId>', 'File ID')
|
|
46
|
+
.action(async (fileId) => {
|
|
47
|
+
const client = getClient();
|
|
48
|
+
await client.delete(fileId);
|
|
49
|
+
});
|
|
50
|
+
exports.fileSync = new commander_1.Command()
|
|
51
|
+
.name('sync')
|
|
52
|
+
.description('Sync file')
|
|
53
|
+
.argument('<fileId>', 'File ID')
|
|
54
|
+
.action(async (fileId) => {
|
|
55
|
+
const client = getClient();
|
|
56
|
+
const result = await client.sync(fileId);
|
|
57
|
+
(0, output_js_1.print)(result);
|
|
58
|
+
});
|
|
59
|
+
const commands = {
|
|
60
|
+
list: exports.fileList,
|
|
61
|
+
fetch: exports.fileFetch,
|
|
62
|
+
delete: exports.fileDelete,
|
|
63
|
+
sync: exports.fileSync,
|
|
64
|
+
};
|
|
65
|
+
exports.command = new commander_1.Command()
|
|
66
|
+
.name('file')
|
|
67
|
+
.description('File tools for ChatBotKit');
|
|
68
|
+
for (const cmd of Object.values(commands)) {
|
|
69
|
+
exports.command.addCommand(cmd);
|
|
70
|
+
}
|
|
71
|
+
exports.default = exports.command;
|
|
@@ -3,16 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.command = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const output_js_1 = require("../../output.cjs");
|
|
6
|
-
const index_js_1 = tslib_1.__importDefault(require("./
|
|
7
|
-
const index_js_2 = tslib_1.__importDefault(require("./
|
|
8
|
-
const index_js_3 = tslib_1.__importDefault(require("./
|
|
9
|
-
const index_js_4 = tslib_1.__importDefault(require("./
|
|
6
|
+
const index_js_1 = tslib_1.__importDefault(require("./blueprint/index.cjs"));
|
|
7
|
+
const index_js_2 = tslib_1.__importDefault(require("./bot/index.cjs"));
|
|
8
|
+
const index_js_3 = tslib_1.__importDefault(require("./contact/index.cjs"));
|
|
9
|
+
const index_js_4 = tslib_1.__importDefault(require("./conversation/index.cjs"));
|
|
10
|
+
const index_js_5 = tslib_1.__importDefault(require("./dataset/index.cjs"));
|
|
11
|
+
const index_js_6 = tslib_1.__importDefault(require("./file/index.cjs"));
|
|
12
|
+
const index_js_7 = tslib_1.__importDefault(require("./integration/index.cjs"));
|
|
13
|
+
const index_js_8 = tslib_1.__importDefault(require("./memory/index.cjs"));
|
|
14
|
+
const index_js_9 = tslib_1.__importDefault(require("./partner/index.cjs"));
|
|
15
|
+
const index_js_10 = tslib_1.__importDefault(require("./secret/index.cjs"));
|
|
16
|
+
const index_js_11 = tslib_1.__importDefault(require("./skillset/index.cjs"));
|
|
17
|
+
const index_js_12 = tslib_1.__importDefault(require("./team/index.cjs"));
|
|
10
18
|
const commander_1 = require("commander");
|
|
11
19
|
const commands = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
blueprint: index_js_1.default,
|
|
21
|
+
bot: index_js_2.default,
|
|
22
|
+
contact: index_js_3.default,
|
|
23
|
+
conversation: index_js_4.default,
|
|
24
|
+
dataset: index_js_5.default,
|
|
25
|
+
file: index_js_6.default,
|
|
26
|
+
integration: index_js_7.default,
|
|
27
|
+
memory: index_js_8.default,
|
|
28
|
+
partner: index_js_9.default,
|
|
29
|
+
secret: index_js_10.default,
|
|
30
|
+
skillset: index_js_11.default,
|
|
31
|
+
team: index_js_12.default,
|
|
16
32
|
};
|
|
17
33
|
exports.command = new commander_1.Command()
|
|
18
34
|
.name('api')
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = exports.discordSetup = exports.discordDelete = exports.discordFetch = exports.discordList = void 0;
|
|
4
|
+
const env_js_1 = require("../../../../env.cjs");
|
|
5
|
+
const output_js_1 = require("../../../../output.cjs");
|
|
6
|
+
const index_js_1 = require("@chatbotkit/sdk/integration/discord/index.js");
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
function getClient() {
|
|
9
|
+
return new index_js_1.DiscordIntegrationClient({
|
|
10
|
+
secret: (0, env_js_1.getSECRET)(),
|
|
11
|
+
runAsUserId: (0, env_js_1.getRUNAS_USERID)(),
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.discordList = new commander_1.Command()
|
|
15
|
+
.name('list')
|
|
16
|
+
.description('List discord integrations')
|
|
17
|
+
.option('-s, --stream', 'Stream discord integrations')
|
|
18
|
+
.action(async (str, options) => {
|
|
19
|
+
const { stream } = options;
|
|
20
|
+
const client = getClient();
|
|
21
|
+
if (stream) {
|
|
22
|
+
for await (const discord of client.list().stream()) {
|
|
23
|
+
(0, output_js_1.print)(discord);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const { items } = await client.list();
|
|
28
|
+
for (const discord of items) {
|
|
29
|
+
(0, output_js_1.print)(discord);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
exports.discordFetch = new commander_1.Command()
|
|
34
|
+
.name('fetch')
|
|
35
|
+
.description('Fetch discord integration')
|
|
36
|
+
.argument('<discordId>', 'Discord ID')
|
|
37
|
+
.action(async (discordId) => {
|
|
38
|
+
const client = getClient();
|
|
39
|
+
const discord = await client.fetch(discordId);
|
|
40
|
+
(0, output_js_1.print)(discord);
|
|
41
|
+
});
|
|
42
|
+
exports.discordDelete = new commander_1.Command()
|
|
43
|
+
.name('delete')
|
|
44
|
+
.description('Delete discord integration')
|
|
45
|
+
.argument('<discordId>', 'Discord ID')
|
|
46
|
+
.action(async (discordId) => {
|
|
47
|
+
const client = getClient();
|
|
48
|
+
await client.delete(discordId);
|
|
49
|
+
});
|
|
50
|
+
exports.discordSetup = new commander_1.Command()
|
|
51
|
+
.name('setup')
|
|
52
|
+
.description('Setup discord integration')
|
|
53
|
+
.argument('<discordId>', 'Discord ID')
|
|
54
|
+
.action(async (discordId) => {
|
|
55
|
+
const client = getClient();
|
|
56
|
+
const result = await client.setup(discordId);
|
|
57
|
+
(0, output_js_1.print)(result);
|
|
58
|
+
});
|
|
59
|
+
const commands = {
|
|
60
|
+
list: exports.discordList,
|
|
61
|
+
fetch: exports.discordFetch,
|
|
62
|
+
delete: exports.discordDelete,
|
|
63
|
+
setup: exports.discordSetup,
|
|
64
|
+
};
|
|
65
|
+
exports.command = new commander_1.Command()
|
|
66
|
+
.name('discord')
|
|
67
|
+
.description('Discord integration tools for ChatBotKit');
|
|
68
|
+
for (const cmd of Object.values(commands)) {
|
|
69
|
+
exports.command.addCommand(cmd);
|
|
70
|
+
}
|
|
71
|
+
exports.default = exports.command;
|