@botonic/cli 0.39.1 → 0.40.1-alpha.0
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/README.md +7 -26
- package/lib/analytics/credentials-handler.d.ts +0 -4
- package/lib/analytics/credentials-handler.js +2 -29
- package/lib/analytics/credentials-handler.js.map +1 -1
- package/lib/botonic-api-service.d.ts +1 -2
- package/lib/botonic-api-service.js +9 -29
- package/lib/botonic-api-service.js.map +1 -1
- package/lib/botonic-examples.js +1 -1
- package/lib/commands/deploy.d.ts +1 -2
- package/lib/commands/deploy.js +3 -28
- package/lib/commands/deploy.js.map +1 -1
- package/lib/commands/login.d.ts +0 -1
- package/lib/commands/login.js +2 -14
- package/lib/commands/login.js.map +1 -1
- package/lib/commands/logout.d.ts +0 -1
- package/lib/commands/logout.js +0 -3
- package/lib/commands/logout.js.map +1 -1
- package/lib/commands/new.d.ts +1 -2
- package/lib/commands/new.js +2 -12
- package/lib/commands/new.js.map +1 -1
- package/lib/commands/serve.d.ts +1 -4
- package/lib/commands/serve.js +6 -104
- package/lib/commands/serve.js.map +1 -1
- package/lib/commands/test.d.ts +0 -1
- package/lib/commands/test.js +0 -6
- package/lib/commands/test.js.map +1 -1
- package/lib/constants.d.ts +2 -6
- package/lib/constants.js +4 -12
- package/lib/constants.js.map +1 -1
- package/lib/interfaces.d.ts +0 -21
- package/lib/util/bot-config.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +3 -15
- package/scripts/postinstall.js +0 -23
- package/lib/analytics/telemetry.d.ts +0 -35
- package/lib/analytics/telemetry.js +0 -97
- package/lib/analytics/telemetry.js.map +0 -1
- package/lib/botonic-playground-service.d.ts +0 -21
- package/lib/botonic-playground-service.js +0 -98
- package/lib/botonic-playground-service.js.map +0 -1
- package/lib/commands/destroy.d.ts +0 -13
- package/lib/commands/destroy.js +0 -39
- package/lib/commands/destroy.js.map +0 -1
package/lib/commands/new.js
CHANGED
|
@@ -4,7 +4,6 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
6
|
const colors_1 = require("colors");
|
|
7
|
-
// import fetchRepoDir from 'fetch-repo-dir'
|
|
8
7
|
const fs_extra_1 = require("fs-extra");
|
|
9
8
|
// eslint-disable-next-line import/named
|
|
10
9
|
const inquirer_1 = require("inquirer");
|
|
@@ -12,7 +11,6 @@ const ora_1 = tslib_1.__importDefault(require("ora"));
|
|
|
12
11
|
const os_1 = require("os");
|
|
13
12
|
const path_1 = tslib_1.__importStar(require("path"));
|
|
14
13
|
const util_1 = require("util");
|
|
15
|
-
const telemetry_1 = require("../analytics/telemetry");
|
|
16
14
|
const botonic_api_service_1 = require("../botonic-api-service");
|
|
17
15
|
const botonic_examples_1 = require("../botonic-examples");
|
|
18
16
|
const download_gzip_1 = require("../util/download-gzip");
|
|
@@ -24,12 +22,10 @@ class Run extends command_1.Command {
|
|
|
24
22
|
super(...arguments);
|
|
25
23
|
this.examples = botonic_examples_1.EXAMPLES;
|
|
26
24
|
this.botonicApiService = new botonic_api_service_1.BotonicAPIService();
|
|
27
|
-
this.telemetry = new telemetry_1.Telemetry();
|
|
28
25
|
}
|
|
29
26
|
/* istanbul ignore next */
|
|
30
27
|
run() {
|
|
31
28
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
this.telemetry.trackCreate();
|
|
33
29
|
try {
|
|
34
30
|
const args = this.parse(Run).args;
|
|
35
31
|
const userProjectDirName = args.name;
|
|
@@ -40,9 +36,6 @@ class Run extends command_1.Command {
|
|
|
40
36
|
`${this.examples.map(p => p.name).join(', ')}`));
|
|
41
37
|
return;
|
|
42
38
|
}
|
|
43
|
-
this.telemetry.trackCreate({
|
|
44
|
-
selected_project_name: selectedProject.name,
|
|
45
|
-
});
|
|
46
39
|
yield this.downloadSelectedProjectIntoPath(selectedProject, userProjectDirName);
|
|
47
40
|
process.chdir(userProjectDirName);
|
|
48
41
|
const devPlatform = (0, os_1.platform)();
|
|
@@ -61,7 +54,6 @@ class Run extends command_1.Command {
|
|
|
61
54
|
}
|
|
62
55
|
catch (e) {
|
|
63
56
|
const error = `botonic new error: ${String(e)}`;
|
|
64
|
-
this.telemetry.trackError(error);
|
|
65
57
|
throw new Error(error);
|
|
66
58
|
}
|
|
67
59
|
});
|
|
@@ -114,25 +106,23 @@ class Run extends command_1.Command {
|
|
|
114
106
|
catch (e) {
|
|
115
107
|
spinnerDownload.fail();
|
|
116
108
|
const error = `Downloading Project: ${selectedProject.name}: ${String(e)}`;
|
|
117
|
-
this.telemetry.trackError(error);
|
|
118
109
|
throw new Error(error);
|
|
119
110
|
}
|
|
120
111
|
});
|
|
121
112
|
}
|
|
122
|
-
installDependencies(
|
|
113
|
+
installDependencies(command = 'npm install') {
|
|
123
114
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
124
115
|
const spinner = (0, ora_1.default)({
|
|
125
116
|
text: 'Installing dependencies...',
|
|
126
117
|
spinner: 'bouncingBar',
|
|
127
118
|
}).start();
|
|
128
119
|
try {
|
|
129
|
-
yield exec(
|
|
120
|
+
yield exec(command);
|
|
130
121
|
spinner.succeed();
|
|
131
122
|
}
|
|
132
123
|
catch (e) {
|
|
133
124
|
spinner.fail();
|
|
134
125
|
const error = `Installing dependencies: ${String(e)}`;
|
|
135
|
-
this.telemetry.trackError(error);
|
|
136
126
|
throw new Error(error);
|
|
137
127
|
}
|
|
138
128
|
});
|
package/lib/commands/new.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":";;;AAAA,4CAAwC;AACxC,iDAAwD;AACxD,mCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":";;;AAAA,4CAAwC;AACxC,iDAAwD;AACxD,mCAAkC;AAClC,uCAAmC;AACnC,wCA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AQ,EAAE,IAAI,EAAE;IACvE;QACE,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,kCAAkC;QAC/C,QAAQ,EAAE,KAAK;KAChB;CACF,CAAA"}
|
package/lib/commands/serve.d.ts
CHANGED
|
@@ -2,10 +2,7 @@ import { Command } from '@oclif/command';
|
|
|
2
2
|
export default class Run extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
|
-
static flags: {
|
|
6
|
-
preview: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
|
|
7
|
-
};
|
|
5
|
+
static flags: {};
|
|
8
6
|
static args: never[];
|
|
9
|
-
private telemetry;
|
|
10
7
|
run(): Promise<void>;
|
|
11
8
|
}
|
package/lib/commands/serve.js
CHANGED
|
@@ -3,108 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
5
|
const colors_1 = tslib_1.__importDefault(require("colors"));
|
|
6
|
-
const concurrently_1 = tslib_1.__importDefault(require("concurrently"));
|
|
7
|
-
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
8
|
-
const kill_port_1 = tslib_1.__importDefault(require("kill-port"));
|
|
9
|
-
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
|
-
const telemetry_1 = require("../analytics/telemetry");
|
|
11
|
-
const botonic_playground_service_1 = require("../botonic-playground-service");
|
|
12
6
|
const system_1 = require("../util/system");
|
|
13
7
|
class Run extends command_1.Command {
|
|
14
|
-
constructor() {
|
|
15
|
-
super(...arguments);
|
|
16
|
-
this.telemetry = new telemetry_1.Telemetry();
|
|
17
|
-
}
|
|
18
8
|
run() {
|
|
19
9
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const apps = ['websocket', 'rest', 'webchat', 'webviews'];
|
|
24
|
-
const BASE_PATH = process.cwd();
|
|
25
|
-
const API_REST_DIR_SRC = path_1.default.resolve(BASE_PATH, './api');
|
|
26
|
-
const API_REST_PORT = 9010;
|
|
27
|
-
const API_WS_DIR_SRC = path_1.default.resolve(BASE_PATH, './api');
|
|
28
|
-
const API_WS_PORT = 9091;
|
|
29
|
-
const WEBCHAT_DIR_SRC = path_1.default.resolve(BASE_PATH, './webchat');
|
|
30
|
-
const WEBCHAT_PORT = 9000;
|
|
31
|
-
const pgs = new botonic_playground_service_1.PlaygroundService(API_REST_PORT);
|
|
32
|
-
try {
|
|
33
|
-
yield pgs.start();
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
console.log("Couldn't start the Playground service: ", e);
|
|
37
|
-
}
|
|
38
|
-
if (apps.includes('websocket')) {
|
|
39
|
-
try {
|
|
40
|
-
yield (0, kill_port_1.default)(API_WS_PORT, 'tcp');
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
console.error(`Error whilst shutting down "api websocket" port (${API_WS_PORT}): ${colors_1.default.red(e.message)}`);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (apps.includes('rest')) {
|
|
47
|
-
try {
|
|
48
|
-
yield (0, kill_port_1.default)(API_REST_PORT, 'tcp');
|
|
49
|
-
}
|
|
50
|
-
catch (e) {
|
|
51
|
-
console.error(`Error whilst shutting down "api rest" port (${API_REST_PORT}): ${colors_1.default.red(e.message)}`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (apps.includes('webchat')) {
|
|
55
|
-
try {
|
|
56
|
-
yield (0, kill_port_1.default)(WEBCHAT_PORT, 'tcp');
|
|
57
|
-
}
|
|
58
|
-
catch (e) {
|
|
59
|
-
console.error(`Error whilst shutting down "webchat" port (${WEBCHAT_PORT}): ${colors_1.default.red(e.message)}`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const WEBCHAT_JOB_SECONDS_DELAY = 10; // Sleep 10s to give rest and ws servers enough time to be up and running
|
|
63
|
-
const jobs = {
|
|
64
|
-
rest: {
|
|
65
|
-
name: 'api.rest',
|
|
66
|
-
command: 'yarn workspace api start:rest',
|
|
67
|
-
prefixColor: 'blueBright.bgBlack',
|
|
68
|
-
runWhen: () => fs_1.default.existsSync(API_REST_DIR_SRC),
|
|
69
|
-
},
|
|
70
|
-
websocket: {
|
|
71
|
-
name: 'api.ws',
|
|
72
|
-
command: 'yarn workspace api start:websocket',
|
|
73
|
-
prefixColor: 'magentaBright.bgBlack',
|
|
74
|
-
runWhen: () => fs_1.default.existsSync(API_WS_DIR_SRC),
|
|
75
|
-
},
|
|
76
|
-
webchat: {
|
|
77
|
-
name: 'webchat',
|
|
78
|
-
command: `sleep ${WEBCHAT_JOB_SECONDS_DELAY}; yarn workspace webchat start --env playgroundCode=${pgs.code || ''}`,
|
|
79
|
-
prefixColor: 'yellowBright.bgBlack',
|
|
80
|
-
runWhen: () => fs_1.default.existsSync(WEBCHAT_DIR_SRC),
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
try {
|
|
84
|
-
yield (0, concurrently_1.default)(Object.keys(jobs)
|
|
85
|
-
.map(n => apps.includes(n) && jobs[n])
|
|
86
|
-
.filter(job => job && job.runWhen()), {
|
|
87
|
-
//prefix: '{name} |',
|
|
88
|
-
timestampFormat: 'HH:mm:ss',
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
console.log(e);
|
|
93
|
-
}
|
|
94
|
-
yield pgs.stop();
|
|
95
|
-
console.log('*****END*****');
|
|
96
|
-
// TODO: Yarn will exit the process before its children, leaving the console
|
|
97
|
-
// in a bad state (see: https://github.com/yarnpkg/yarn/issues/4667)
|
|
98
|
-
// Possible fix by upgrading to Yarn v2
|
|
10
|
+
try {
|
|
11
|
+
console.log(colors_1.default.blue('\nServing Botonic...'));
|
|
12
|
+
(0, system_1.spawnNpmScript)('start');
|
|
99
13
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
console.log(colors_1.default.blue('\nServing Botonic...'));
|
|
103
|
-
(0, system_1.spawnNpmScript)('start');
|
|
104
|
-
}
|
|
105
|
-
catch (e) {
|
|
106
|
-
console.log(e);
|
|
107
|
-
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
console.log(e);
|
|
108
16
|
}
|
|
109
17
|
return Promise.resolve();
|
|
110
18
|
});
|
|
@@ -115,12 +23,6 @@ Run.description = 'Serve your bot in your localhost';
|
|
|
115
23
|
Run.examples = [
|
|
116
24
|
`$ botonic serve\n> Project is running at http://localhost:8080/`,
|
|
117
25
|
];
|
|
118
|
-
Run.flags = {
|
|
119
|
-
preview: command_1.flags.boolean({
|
|
120
|
-
char: 'p',
|
|
121
|
-
description: 'Run preview Botonic 1.0 serve.',
|
|
122
|
-
default: false,
|
|
123
|
-
}),
|
|
124
|
-
};
|
|
26
|
+
Run.flags = {};
|
|
125
27
|
Run.args = [];
|
|
126
28
|
//# sourceMappingURL=serve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../src/commands/serve.ts"],"names":[],"mappings":";;;AAAA,4CAAwC;AACxC,4DAA2B;AAE3B,2CAA+C;AAE/C,MAAqB,GAAI,SAAQ,iBAAO;IAWhC,GAAG;;YACP,IAAI;gBACF,OAAO,CAAC,GAAG,CAAC,gBAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAA;gBAChD,IAAA,uBAAc,EAAC,OAAO,CAAC,CAAA;aACxB;YAAC,OAAO,CAAC,EAAE;gBACV,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;aACf;YACD,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;QAC1B,CAAC;KAAA;;AAnBH,sBAoBC;AAnBQ,eAAW,GAAG,kCAAkC,CAAA;AAEhD,YAAQ,GAAG;IAChB,iEAAiE;CAClE,CAAA;AAEM,SAAK,GAAG,EAAE,CAAA;AAEV,QAAI,GAAG,EAAE,CAAA"}
|
package/lib/commands/test.d.ts
CHANGED
package/lib/commands/test.js
CHANGED
|
@@ -4,15 +4,9 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const command_1 = require("@oclif/command");
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
6
|
const colors_1 = tslib_1.__importDefault(require("colors"));
|
|
7
|
-
const telemetry_1 = require("../analytics/telemetry");
|
|
8
7
|
class Run extends command_1.Command {
|
|
9
|
-
constructor() {
|
|
10
|
-
super(...arguments);
|
|
11
|
-
this.telemetry = new telemetry_1.Telemetry();
|
|
12
|
-
}
|
|
13
8
|
run() {
|
|
14
9
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
this.telemetry.trackTest();
|
|
16
10
|
this.parse(Run);
|
|
17
11
|
(0, child_process_1.exec)('npm run test', (error, _stdout, stderr) => {
|
|
18
12
|
console.log(colors_1.default.blue('\n Executing tests...\n'));
|
package/lib/commands/test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/commands/test.ts"],"names":[],"mappings":";;;AAAA,4CAAwC;AACxC,iDAAoC;AACpC,4DAA2B;AAE3B,
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../src/commands/test.ts"],"names":[],"mappings":";;;AAAA,4CAAwC;AACxC,iDAAoC;AACpC,4DAA2B;AAE3B,MAAqB,GAAI,SAAQ,iBAAO;IAwBhC,GAAG;;YACP,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YACf,IAAA,oBAAI,EAAC,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC9C,OAAO,CAAC,GAAG,CAAC,gBAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAA;gBACnD,IAAI,KAAK,EAAE;oBACT,OAAO,CAAC,KAAK,CAAC,gBAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;oBAC7C,OAAM;iBACP;gBACD,OAAO,CAAC,GAAG,CAAC,gBAAM,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC,CAAA;YACxC,CAAC,CAAC,CAAA;YACF,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;QAC1B,CAAC;KAAA;;AAnCH,sBAoCC;AAnCQ,eAAW,GAAG,8BAA8B,CAAA;AAE5C,YAAQ,GAAG;IAChB;;;;;;;;;;;;;qBAaiB;CAClB,CAAA;AAEM,SAAK,GAAG,EAAE,CAAA;AAEV,QAAI,GAAG,EAAE,CAAA"}
|
package/lib/constants.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
export declare const BOTONIC_NPM_NAMESPACE = "@botonic";
|
|
2
2
|
export declare const BOTONIC_HOME_DIRNAME = ".botonic";
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const GLOBAL_CREDENTIALS_FILENAME = "credentials.json";
|
|
4
4
|
export declare const BOTONIC_PROJECT_PATH: string;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const ANALYTICS_WRITE_KEY = "YD0jpJHNGW12uhLNbgB4wbdTRQ4Cy1Zu";
|
|
5
|
+
export declare const BOT_CREDENTIALS_FILENAME = ".botonic.json";
|
|
7
6
|
export declare const CLOUD_PROVIDERS: Readonly<{
|
|
8
|
-
AWS: "aws";
|
|
9
7
|
HUBTYPE: "hubtype";
|
|
10
8
|
}>;
|
|
11
|
-
export declare const AWS_CLOUD_CONFIG_FILENAME = "aws.config.js";
|
|
12
|
-
export declare const PATH_TO_AWS_CONFIG: string;
|
package/lib/constants.js
CHANGED
|
@@ -1,18 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const process_1 = require("process");
|
|
3
|
+
exports.CLOUD_PROVIDERS = exports.BOT_CREDENTIALS_FILENAME = exports.BOTONIC_PROJECT_PATH = exports.GLOBAL_CREDENTIALS_FILENAME = exports.BOTONIC_HOME_DIRNAME = exports.BOTONIC_NPM_NAMESPACE = void 0;
|
|
6
4
|
exports.BOTONIC_NPM_NAMESPACE = '@botonic';
|
|
7
5
|
exports.BOTONIC_HOME_DIRNAME = '.botonic';
|
|
8
|
-
exports.
|
|
6
|
+
exports.GLOBAL_CREDENTIALS_FILENAME = 'credentials.json';
|
|
9
7
|
exports.BOTONIC_PROJECT_PATH = process.cwd();
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.CLOUD_PROVIDERS = Object.freeze({
|
|
13
|
-
AWS: 'aws',
|
|
14
|
-
HUBTYPE: 'hubtype',
|
|
15
|
-
});
|
|
16
|
-
exports.AWS_CLOUD_CONFIG_FILENAME = 'aws.config.js';
|
|
17
|
-
exports.PATH_TO_AWS_CONFIG = (0, path_1.join)((0, process_1.cwd)(), exports.AWS_CLOUD_CONFIG_FILENAME);
|
|
8
|
+
exports.BOT_CREDENTIALS_FILENAME = '.botonic.json';
|
|
9
|
+
exports.CLOUD_PROVIDERS = Object.freeze({ HUBTYPE: 'hubtype' });
|
|
18
10
|
//# sourceMappingURL=constants.js.map
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,UAAU,CAAA;AAClC,QAAA,oBAAoB,GAAG,UAAU,CAAA;AACjC,QAAA,2BAA2B,GAAG,kBAAkB,CAAA;AAChD,QAAA,oBAAoB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAA;AACpC,QAAA,wBAAwB,GAAG,eAAe,CAAA;AAC1C,QAAA,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAA"}
|
package/lib/interfaces.d.ts
CHANGED
|
@@ -23,13 +23,9 @@ export interface Me {
|
|
|
23
23
|
organization_id: string;
|
|
24
24
|
campaign: string;
|
|
25
25
|
}
|
|
26
|
-
export interface AnalyticsInfo {
|
|
27
|
-
anonymous_id: string;
|
|
28
|
-
}
|
|
29
26
|
export interface GlobalCredentials {
|
|
30
27
|
oauth?: OAuth;
|
|
31
28
|
me?: Me;
|
|
32
|
-
analytics: AnalyticsInfo;
|
|
33
29
|
}
|
|
34
30
|
export interface PaginatedResponse<T> {
|
|
35
31
|
count: number;
|
|
@@ -59,15 +55,6 @@ export interface BotDetail {
|
|
|
59
55
|
is_published: boolean;
|
|
60
56
|
active_users: number;
|
|
61
57
|
}
|
|
62
|
-
export interface PlaygroundSessionInfo {
|
|
63
|
-
id: string;
|
|
64
|
-
created_at: string;
|
|
65
|
-
code: string;
|
|
66
|
-
url: string;
|
|
67
|
-
anonymous_id: string;
|
|
68
|
-
app_name: string;
|
|
69
|
-
is_active: boolean;
|
|
70
|
-
}
|
|
71
58
|
interface ProviderAccountsInfo {
|
|
72
59
|
id: string;
|
|
73
60
|
queue_id: string;
|
|
@@ -95,14 +82,6 @@ interface ProviderAccountsInfo {
|
|
|
95
82
|
export interface BotCredentials {
|
|
96
83
|
bot: BotDetail | null;
|
|
97
84
|
}
|
|
98
|
-
export interface TrackArgs {
|
|
99
|
-
event: string;
|
|
100
|
-
anonymousId: string;
|
|
101
|
-
properties?: any;
|
|
102
|
-
}
|
|
103
|
-
export interface AnalyticsService {
|
|
104
|
-
track: (args: TrackArgs) => void;
|
|
105
|
-
}
|
|
106
85
|
export interface SystemInformation {
|
|
107
86
|
platform: string;
|
|
108
87
|
arch: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bot-config.js","sourceRoot":"","sources":["../../src/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OAAO,QAAQ,CAAA;QACjB,CAAC;KAAA;IAEO,MAAM,CAAO,sBAAsB,CACzC,UAAkB,EAClB,QAA6B,EAC7B,QAAgB,WAAW;;YAE3B,IAAI;gBACF,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAC1C,UAAU,UAAU,YAAY,KAAK,EAAE,CACxC,CAAA;gBACD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;gBACxC,MAAM,gBAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;gBAC9C,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAA;aACrD;YAAC,OAAO,KAAU,EAAE;gBACnB,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAA;aAC5D;YACD,OAAO,QAAQ,CAAA;QACjB,CAAC;KAAA;IAEO,MAAM,CAAO,kBAAkB,CAAC,OAAe;;YACrD,MAAM,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAY,CAAC,IAAI,CAAC,CAAA;YAC9C,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAA;YACtC,OAAO,MAAM,CAAC,IAAI,EAAE,CAAA;QACtB,CAAC;KAAA;CACF;AAnHD,8BAmHC"}
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.40.1-alpha.0","commands":{"deploy":{"id":"deploy","description":"Deploy Botonic project to cloud provider","pluginName":"@botonic/cli","pluginType":"core","aliases":[],"examples":["$ botonic deploy\nBuilding...\nCreating bundle...\nUploading...\n🚀 Bot deployed!\n","$ botonic deploy aws\nDeploying to AWS...\n"],"flags":{"command":{"name":"command","type":"option","char":"c","description":"Command to execute from the package \"scripts\" object"},"email":{"name":"email","type":"option","char":"e","description":"Email from Hubtype Organization"},"password":{"name":"password","type":"option","char":"p","description":"Password from Hubtype Organization"},"botName":{"name":"botName","type":"option","char":"b","description":"Name of the bot from Hubtype where you want to deploy"}},"args":[{"name":"provider","options":["hubtype"]}]},"login":{"id":"login","description":"Log in to Botonic","pluginName":"@botonic/cli","pluginType":"core","aliases":[],"examples":[],"flags":{"path":{"name":"path","type":"option","char":"p","description":"Path to botonic project. Defaults to current dir."}},"args":[]},"logout":{"id":"logout","description":"Log out of Botonic","pluginName":"@botonic/cli","pluginType":"core","aliases":[],"examples":[],"flags":{"path":{"name":"path","type":"option","char":"p","description":"Path to botonic project. Defaults to current dir."}},"args":[]},"new":{"id":"new","description":"Create a new Botonic project","pluginName":"@botonic/cli","pluginType":"core","aliases":[],"examples":["$ botonic new test_bot\nCreating...\n✨ test_bot was successfully created!\n"],"flags":{},"args":[{"name":"name","description":"name of the bot folder","required":true},{"name":"projectName","description":"OPTIONAL name of the bot project","required":false}]},"serve":{"id":"serve","description":"Serve your bot in your localhost","pluginName":"@botonic/cli","pluginType":"core","aliases":[],"examples":["$ botonic serve\n> Project is running at http://localhost:8080/"],"flags":{},"args":[]},"test":{"id":"test","description":"Test your Botonic components","pluginName":"@botonic/cli","pluginType":"core","aliases":[],"examples":["PASS tests/app.test.js\n ✓ TEST: hi.js (10ms)\n ✓ TEST: pizza.js (1ms)\n ✓ TEST: sausage.js (1ms)\n ✓ TEST: bacon.js\n ✓ TEST: pasta.js (1ms)\n ✓ TEST: cheese.js (1ms)\n ✓ TEST: tomato.js\n\nTest Suites: 1 passed, 1 total\nTests: 7 passed, 7 total\nSnapshots: 0 total\nTime: 1.223s\nRan all test suites."],"flags":{},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/cli",
|
|
3
3
|
"description": "Build Chatbots Using React",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.40.1-alpha.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
7
7
|
"botonic": "./bin/run"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
|
-
"cloc": "../../scripts/qa/cloc-package.sh .",
|
|
11
10
|
"prepublishOnly": "npm i && npm run build",
|
|
12
11
|
"build": "rm -rf lib && ../../node_modules/.bin/tsc -p tsconfig.json",
|
|
13
12
|
"build:watch": "rm -rf lib && ../../node_modules/.bin/tsc -w",
|
|
@@ -24,37 +23,26 @@
|
|
|
24
23
|
"@oclif/command": "^1.8.36",
|
|
25
24
|
"@oclif/config": "^1.18.17",
|
|
26
25
|
"@oclif/plugin-help": "^3.3.1",
|
|
27
|
-
"
|
|
28
|
-
"axios": "^1.10.0",
|
|
26
|
+
"axios": "^1.12.2",
|
|
29
27
|
"colors": "^1.4.0",
|
|
30
|
-
"concurrently": "^6.5.1",
|
|
31
|
-
"fetch-repo-dir": "^1.0.6",
|
|
32
28
|
"form-data": "^3.0.2",
|
|
33
29
|
"fs-extra": "^10.1.0",
|
|
34
30
|
"inquirer": "^7.3.3",
|
|
35
|
-
"kill-port": "^1.6.1",
|
|
36
|
-
"localtunnel": "^2.0.2",
|
|
37
31
|
"ora": "^5.4.1",
|
|
38
32
|
"qs": "^6.14.0",
|
|
39
33
|
"tar": "^6.2.1",
|
|
40
|
-
"ts-node": "^10.9.2",
|
|
41
34
|
"tslib": "^2.8.1",
|
|
42
|
-
"uuid": "^10.0.0",
|
|
43
35
|
"zip-a-folder": "3.1.8"
|
|
44
36
|
},
|
|
45
37
|
"devDependencies": {
|
|
46
38
|
"@oclif/dev-cli": "^1.26.10",
|
|
47
|
-
"@types/analytics-node": "^3.1.14",
|
|
48
|
-
"@types/concurrently": "^6.4.0",
|
|
49
39
|
"@types/fs-extra": "^9.0.13",
|
|
50
40
|
"@types/inquirer": "^7.3.3",
|
|
51
|
-
"@types/localtunnel": "^2.0.4",
|
|
52
41
|
"@types/tar": "^6.1.13",
|
|
53
|
-
"@types/uuid": "^10.0.0",
|
|
54
42
|
"globby": "^11.1.0"
|
|
55
43
|
},
|
|
56
44
|
"engines": {
|
|
57
|
-
"node": ">=
|
|
45
|
+
"node": ">=22.19.0",
|
|
58
46
|
"npm": ">=10.0.0"
|
|
59
47
|
},
|
|
60
48
|
"bugs": "https://github.com/hubtype/botonic/issues",
|
package/scripts/postinstall.js
CHANGED
|
@@ -11,26 +11,3 @@
|
|
|
11
11
|
|
|
12
12
|
Build chatbots with React
|
|
13
13
|
`)*/
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
const { Telemetry } = require('../lib/analytics/telemetry')
|
|
17
|
-
const telemetry = new Telemetry()
|
|
18
|
-
telemetry.trackInstallBotonic()
|
|
19
|
-
console.log('\n✨ Botonic was installed successfully.\n')
|
|
20
|
-
console.log(
|
|
21
|
-
'Create your first chatbot with:\n\x1b[1mbotonic new myBot\x1b[0m\n'
|
|
22
|
-
)
|
|
23
|
-
} catch (e) {
|
|
24
|
-
if (process.env.BOTONIC_DISABLE_ANALYTICS !== '1') {
|
|
25
|
-
const Analytics = require('analytics-node')
|
|
26
|
-
var analytics = new Analytics('YD0jpJHNGW12uhLNbgB4wbdTRQ4Cy1Zu', {
|
|
27
|
-
flushAt: 1,
|
|
28
|
-
})
|
|
29
|
-
const { v4 } = require('uuid')
|
|
30
|
-
analytics.track({
|
|
31
|
-
event: 'Installed Botonic CLI',
|
|
32
|
-
anonymousId: v4(),
|
|
33
|
-
properties: { error: `postinstall exception: ${String(e)}` },
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { AnalyticsService } from '../interfaces';
|
|
2
|
-
import { GlobalCredentialsHandler } from './credentials-handler';
|
|
3
|
-
export declare class Telemetry {
|
|
4
|
-
analyticsService: AnalyticsService;
|
|
5
|
-
globalCredentialsHandler: GlobalCredentialsHandler | undefined;
|
|
6
|
-
isAnalyticsEnabled: boolean;
|
|
7
|
-
events: {
|
|
8
|
-
INSTALL_BOTONIC: string;
|
|
9
|
-
LOGIN: string;
|
|
10
|
-
LOGOUT: string;
|
|
11
|
-
CREATE_BOT: string;
|
|
12
|
-
SERVE_BOT: string;
|
|
13
|
-
TEST_BOT: string;
|
|
14
|
-
TRAIN_BOT: string;
|
|
15
|
-
DEPLOY_BOT: string;
|
|
16
|
-
ERROR_BOTONIC_CLI: string;
|
|
17
|
-
DEPLOY_BOT_1_0: string;
|
|
18
|
-
DESTROY_BOT_1_0: string;
|
|
19
|
-
};
|
|
20
|
-
constructor();
|
|
21
|
-
createAnonymousIdIfNotExists(): string | undefined;
|
|
22
|
-
getTelemetryProperties(properties: any): any;
|
|
23
|
-
track(event: string, properties?: {}): void;
|
|
24
|
-
trackLogin(properties?: {}): void;
|
|
25
|
-
trackLogout(properties?: {}): void;
|
|
26
|
-
trackCreate(properties?: {}): void;
|
|
27
|
-
trackServe(properties?: {}): void;
|
|
28
|
-
trackTest(properties?: {}): void;
|
|
29
|
-
trackTrain(properties?: {}): void;
|
|
30
|
-
trackInstallBotonic(properties?: {}): void;
|
|
31
|
-
trackDeploy(properties?: {}): void;
|
|
32
|
-
trackDeploy1_0(properties?: {}): void;
|
|
33
|
-
trackDestroy1_0(properties?: {}): void;
|
|
34
|
-
trackError(type: string, properties?: {}): void;
|
|
35
|
-
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Telemetry = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const analytics_node_1 = tslib_1.__importDefault(require("analytics-node"));
|
|
6
|
-
const constants_1 = require("../constants");
|
|
7
|
-
const environment_info_1 = require("../util/environment-info");
|
|
8
|
-
const credentials_handler_1 = require("./credentials-handler");
|
|
9
|
-
const TRACKING_EVENTS = {
|
|
10
|
-
// BEWARE: Changing these names will screw analytics
|
|
11
|
-
// Despite the event is written in past tense, events are tracked at the very beginning of the action.
|
|
12
|
-
INSTALL_BOTONIC: 'Installed Botonic CLI',
|
|
13
|
-
LOGIN: 'Logged In Botonic CLI',
|
|
14
|
-
LOGOUT: 'Logged Out Botonic CLI',
|
|
15
|
-
CREATE_BOT: 'Created Botonic Bot CLI',
|
|
16
|
-
SERVE_BOT: 'Served Botonic CLI',
|
|
17
|
-
TEST_BOT: 'botonic test',
|
|
18
|
-
TRAIN_BOT: 'Trained with Botonic train',
|
|
19
|
-
DEPLOY_BOT: 'Deployed Botonic CLI',
|
|
20
|
-
ERROR_BOTONIC_CLI: 'Error Botonic CLI',
|
|
21
|
-
DEPLOY_BOT_1_0: 'Deployed Botonic 1.0',
|
|
22
|
-
DESTROY_BOT_1_0: 'Destroyed Botonic 1.0',
|
|
23
|
-
};
|
|
24
|
-
class Telemetry {
|
|
25
|
-
constructor() {
|
|
26
|
-
this.isAnalyticsEnabled = process.env.BOTONIC_DISABLE_ANALYTICS !== '1';
|
|
27
|
-
this.events = TRACKING_EVENTS;
|
|
28
|
-
this.analyticsService = new analytics_node_1.default(constants_1.ANALYTICS_WRITE_KEY, { flushAt: 1 });
|
|
29
|
-
try {
|
|
30
|
-
this.globalCredentialsHandler = new credentials_handler_1.GlobalCredentialsHandler();
|
|
31
|
-
}
|
|
32
|
-
catch (e) {
|
|
33
|
-
this.isAnalyticsEnabled = false;
|
|
34
|
-
this.globalCredentialsHandler = undefined;
|
|
35
|
-
console.error(e);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
createAnonymousIdIfNotExists() {
|
|
39
|
-
if (!this.globalCredentialsHandler)
|
|
40
|
-
return undefined;
|
|
41
|
-
if (!this.globalCredentialsHandler.hasAnonymousId()) {
|
|
42
|
-
return this.globalCredentialsHandler.refreshAnonymousId();
|
|
43
|
-
}
|
|
44
|
-
const credentials = this.globalCredentialsHandler.load();
|
|
45
|
-
return credentials === null || credentials === void 0 ? void 0 : credentials.analytics.anonymous_id;
|
|
46
|
-
}
|
|
47
|
-
getTelemetryProperties(properties) {
|
|
48
|
-
return Object.assign(Object.assign({}, (0, environment_info_1.getSystemInformation)()), properties);
|
|
49
|
-
}
|
|
50
|
-
track(event, properties = {}) {
|
|
51
|
-
if (this.globalCredentialsHandler && this.isAnalyticsEnabled) {
|
|
52
|
-
const anonymousId = this.createAnonymousIdIfNotExists();
|
|
53
|
-
if (!anonymousId)
|
|
54
|
-
return;
|
|
55
|
-
this.analyticsService.track({
|
|
56
|
-
event: event,
|
|
57
|
-
anonymousId: anonymousId,
|
|
58
|
-
properties: this.getTelemetryProperties(properties),
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
trackLogin(properties = {}) {
|
|
63
|
-
this.track(this.events.LOGIN, properties);
|
|
64
|
-
}
|
|
65
|
-
trackLogout(properties = {}) {
|
|
66
|
-
this.track(this.events.LOGOUT, properties);
|
|
67
|
-
}
|
|
68
|
-
trackCreate(properties = {}) {
|
|
69
|
-
this.track(this.events.CREATE_BOT, properties);
|
|
70
|
-
}
|
|
71
|
-
trackServe(properties = {}) {
|
|
72
|
-
this.track(this.events.SERVE_BOT, properties);
|
|
73
|
-
}
|
|
74
|
-
trackTest(properties = {}) {
|
|
75
|
-
this.track(this.events.TEST_BOT, properties);
|
|
76
|
-
}
|
|
77
|
-
trackTrain(properties = {}) {
|
|
78
|
-
this.track(this.events.TRAIN_BOT, properties);
|
|
79
|
-
}
|
|
80
|
-
trackInstallBotonic(properties = {}) {
|
|
81
|
-
this.track(this.events.INSTALL_BOTONIC, properties);
|
|
82
|
-
}
|
|
83
|
-
trackDeploy(properties = {}) {
|
|
84
|
-
this.track(this.events.DEPLOY_BOT, properties);
|
|
85
|
-
}
|
|
86
|
-
trackDeploy1_0(properties = {}) {
|
|
87
|
-
this.track(this.events.DEPLOY_BOT_1_0, properties);
|
|
88
|
-
}
|
|
89
|
-
trackDestroy1_0(properties = {}) {
|
|
90
|
-
this.track(this.events.DESTROY_BOT_1_0, properties);
|
|
91
|
-
}
|
|
92
|
-
trackError(type, properties = {}) {
|
|
93
|
-
this.track(this.events.ERROR_BOTONIC_CLI, Object.assign(Object.assign({}, properties), { error_type: type }));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.Telemetry = Telemetry;
|
|
97
|
-
//# sourceMappingURL=telemetry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/analytics/telemetry.ts"],"names":[],"mappings":";;;;AAAA,4EAAsC;AAEtC,4CAAkD;AAElD,+DAA+D;AAC/D,+DAAgE;AAEhE,MAAM,eAAe,GAAG;IACtB,oDAAoD;IACpD,sGAAsG;IACtG,eAAe,EAAE,uBAAuB;IACxC,KAAK,EAAE,uBAAuB;IAC9B,MAAM,EAAE,wBAAwB;IAChC,UAAU,EAAE,yBAAyB;IACrC,SAAS,EAAE,oBAAoB;IAC/B,QAAQ,EAAE,cAAc;IACxB,SAAS,EAAE,4BAA4B;IACvC,UAAU,EAAE,sBAAsB;IAClC,iBAAiB,EAAE,mBAAmB;IACtC,cAAc,EAAE,sBAAsB;IACtC,eAAe,EAAE,uBAAuB;CACzC,CAAA;AAED,MAAa,SAAS;IAMpB;QAHA,uBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAyB,KAAK,GAAG,CAAA;QAClE,WAAM,GAAG,eAAe,CAAA;QAGtB,IAAI,CAAC,gBAAgB,GAAG,IAAI,wBAAS,CAAC,+BAAmB,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAA;QAC1E,IAAI;YACF,IAAI,CAAC,wBAAwB,GAAG,IAAI,8CAAwB,EAAE,CAAA;SAC/D;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAA;YAC/B,IAAI,CAAC,wBAAwB,GAAG,SAAS,CAAA;YACzC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;SACjB;IACH,CAAC;IAED,4BAA4B;QAC1B,IA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