@builderbot/cli 1.0.26-alpha.0 → 1.0.27-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 +16 -15
- package/dist/index.cjs +51 -46
- package/dist/interactive/index.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://builderbot.vercel.app/">
|
|
3
|
+
<h2 align="center">@builderbot/cli</h2>
|
|
4
|
+
</a>
|
|
5
|
+
</p>
|
|
2
6
|
|
|
3
|
-
- [x] Revisar version de NODE
|
|
4
|
-
- [x] Revisar OS
|
|
5
|
-
- [x] Obtener Package Manager
|
|
6
|
-
- [x] Revisar las libreria de WhatsappWeb para obtener version reciente
|
|
7
|
-
- [x] Opcion interactiva de limpiar session
|
|
8
|
-
- [x] Opcion de generar `json` con la configuracion
|
|
9
|
-
- [x] Agregar `rollup` para limpiar el codigo
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
## Documentation
|
|
12
9
|
|
|
13
|
-
|
|
10
|
+
Visit [builderbot](https://builderbot.vercel.app/) to view the full documentation.
|
|
14
11
|
|
|
15
|
-
> Forma parte de este proyecto.
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
## Official Course
|
|
14
|
+
|
|
15
|
+
If you want to discover all the functions and features offered by the library you can take the course.
|
|
16
|
+
[View Course](https://app.codigoencasa.com/courses/builderbot?refCode=LEIFER)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
## Contact Us
|
|
20
|
+
- [💻 Discord](https://link.codigoencasa.com/DISCORD)
|
|
21
|
+
- [👌 𝕏 (Twitter)](https://twitter.com/leifermendez)
|
package/dist/index.cjs
CHANGED
|
@@ -238,10 +238,10 @@ const checkGit = () => {
|
|
|
238
238
|
};
|
|
239
239
|
|
|
240
240
|
const PROVIDER_LIST = [
|
|
241
|
-
{ value: 'baileys', label: 'Baileys', hint: '
|
|
242
|
-
{ value: 'venom', label: 'Venom', hint: '
|
|
243
|
-
{ value: 'wppconnect', label: 'WPPConnect', hint: '
|
|
244
|
-
// { value: 'wweb', label: 'Whatsapp-web.js', hint: '
|
|
241
|
+
{ value: 'baileys', label: 'Baileys', hint: 'opensource' },
|
|
242
|
+
{ value: 'venom', label: 'Venom', hint: 'opensource' },
|
|
243
|
+
{ value: 'wppconnect', label: 'WPPConnect', hint: 'opensource' },
|
|
244
|
+
// { value: 'wweb', label: 'Whatsapp-web.js', hint: 'opensource' },
|
|
245
245
|
{ value: 'twilio', label: 'Twilio' },
|
|
246
246
|
{ value: 'meta', label: 'Meta' },
|
|
247
247
|
];
|
|
@@ -9012,10 +9012,10 @@ var prompts$1 = /*@__PURE__*/getDefaultExportFromCjs(prompts);
|
|
|
9012
9012
|
const bannerDone$1 = () => {
|
|
9013
9013
|
console.log(``);
|
|
9014
9014
|
console.log(color.cyan([
|
|
9015
|
-
`[
|
|
9016
|
-
`[😉]
|
|
9017
|
-
`[⭐]
|
|
9018
|
-
`[🚀]
|
|
9015
|
+
`[Acknowledgements]: This is an OpenSource project, if you intend to collaborate you can do so:`,
|
|
9016
|
+
`[😉] Buying a coffee https://www.buymeacoffee.com/leifermendez`,
|
|
9017
|
+
`[⭐] Giving a star https://github.com/codigoencasa/bot-whatsapp`,
|
|
9018
|
+
`[🚀] Making improvements in the code`,
|
|
9019
9019
|
].join('\n')));
|
|
9020
9020
|
console.log(``);
|
|
9021
9021
|
};
|
|
@@ -9029,8 +9029,8 @@ const startInteractiveLegacy = async () => {
|
|
|
9029
9029
|
await nextSteps();
|
|
9030
9030
|
}
|
|
9031
9031
|
catch (e) {
|
|
9032
|
-
console.error(color.bgRed(`
|
|
9033
|
-
console.error(color.bgRed(`
|
|
9032
|
+
console.error(color.bgRed(`Oops! 🙄 something is not right.`));
|
|
9033
|
+
console.error(color.bgRed(`Check the minimum requirements in the documentation`));
|
|
9034
9034
|
}
|
|
9035
9035
|
};
|
|
9036
9036
|
const nextSteps = async () => {
|
|
@@ -9038,29 +9038,29 @@ const nextSteps = async () => {
|
|
|
9038
9038
|
{
|
|
9039
9039
|
type: 'text',
|
|
9040
9040
|
name: 'outDir',
|
|
9041
|
-
message: '
|
|
9041
|
+
message: 'Do you want to create a bot? (Y/n)',
|
|
9042
9042
|
},
|
|
9043
9043
|
{
|
|
9044
9044
|
type: 'multiselect',
|
|
9045
9045
|
name: 'providerWs',
|
|
9046
|
-
message: '
|
|
9046
|
+
message: 'Which WhatsApp provider do you want to use?',
|
|
9047
9047
|
choices: PROVIDER_LIST.map((c) => ({ title: c.label, value: c.value })),
|
|
9048
9048
|
max: 1,
|
|
9049
|
-
hint: '
|
|
9049
|
+
hint: 'Space to select',
|
|
9050
9050
|
instructions: '↑/↓',
|
|
9051
9051
|
},
|
|
9052
9052
|
{
|
|
9053
9053
|
type: 'multiselect',
|
|
9054
9054
|
name: 'providerDb',
|
|
9055
|
-
message: '
|
|
9055
|
+
message: 'Which database do you want to use?',
|
|
9056
9056
|
choices: PROVIDER_DATA.map((c) => ({ title: c.label, value: c.value })),
|
|
9057
9057
|
max: 1,
|
|
9058
|
-
hint: '
|
|
9058
|
+
hint: 'Space to select',
|
|
9059
9059
|
instructions: '↑/↓',
|
|
9060
9060
|
},
|
|
9061
9061
|
];
|
|
9062
9062
|
const onCancel = () => {
|
|
9063
|
-
console.log('
|
|
9063
|
+
console.log('Process canceled!');
|
|
9064
9064
|
return true;
|
|
9065
9065
|
};
|
|
9066
9066
|
const response = await prompts$1(questions, { onCancel });
|
|
@@ -9082,7 +9082,7 @@ const nextSteps = async () => {
|
|
|
9082
9082
|
throw new Error('Path does not exist: ' + indexOfPath);
|
|
9083
9083
|
await copyBaseApp(indexOfPath, require$$1.join(process.cwd(), templateName));
|
|
9084
9084
|
console.log(``);
|
|
9085
|
-
console.log(color.bgMagenta(`⚡⚡⚡
|
|
9085
|
+
console.log(color.bgMagenta(`⚡⚡⚡ INSTRUCTIONS ⚡⚡⚡`));
|
|
9086
9086
|
console.log(color.yellow(`cd ${templateName}`));
|
|
9087
9087
|
console.log(color.yellow(`npm install`));
|
|
9088
9088
|
console.log(color.yellow(`npm start`));
|
|
@@ -9094,7 +9094,7 @@ const nextSteps = async () => {
|
|
|
9094
9094
|
const vendorProvider = async () => {
|
|
9095
9095
|
const [answer] = providerWs;
|
|
9096
9096
|
if (!providerWs.length) {
|
|
9097
|
-
console.log(color.red(`
|
|
9097
|
+
console.log(color.red(`You must select a WhatsApp provider. Press [Space] to select`));
|
|
9098
9098
|
process.exit(1);
|
|
9099
9099
|
}
|
|
9100
9100
|
return answer;
|
|
@@ -9102,7 +9102,7 @@ const nextSteps = async () => {
|
|
|
9102
9102
|
const dbProvider = async () => {
|
|
9103
9103
|
const [answer] = providerDb;
|
|
9104
9104
|
if (!providerDb.length) {
|
|
9105
|
-
console.log(color.red(`
|
|
9105
|
+
console.log(color.red(`You must select a database provider. Press [Space] to select`));
|
|
9106
9106
|
process.exit(1);
|
|
9107
9107
|
}
|
|
9108
9108
|
return answer;
|
|
@@ -9117,30 +9117,35 @@ const nextSteps = async () => {
|
|
|
9117
9117
|
const handleLegacyCli = async () => {
|
|
9118
9118
|
await startInteractiveLegacy();
|
|
9119
9119
|
};
|
|
9120
|
-
const bannerDone = (templateName = '') => {
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
color.yellow(` npm
|
|
9124
|
-
|
|
9120
|
+
const bannerDone = (templateName = '', language) => {
|
|
9121
|
+
const notes = [color.yellow(` cd ${templateName} `), color.yellow(` npm install `)];
|
|
9122
|
+
if (language === 'ts') {
|
|
9123
|
+
notes.push(color.yellow(` npm run dev `));
|
|
9124
|
+
}
|
|
9125
|
+
else {
|
|
9126
|
+
notes.push(color.yellow(` npm start `));
|
|
9127
|
+
}
|
|
9128
|
+
const doneNote = [
|
|
9125
9129
|
``,
|
|
9126
|
-
`📄
|
|
9130
|
+
`📄 Documentation:`,
|
|
9127
9131
|
` https://builderbot.vercel.app`,
|
|
9128
9132
|
``,
|
|
9129
|
-
`🤖
|
|
9133
|
+
`🤖 Issues? Join:`,
|
|
9130
9134
|
` https://link.codigoencasa.com/DISCORD`,
|
|
9131
|
-
]
|
|
9135
|
+
];
|
|
9136
|
+
le([...notes, ...doneNote].join('\n'), 'Instructions:');
|
|
9132
9137
|
};
|
|
9133
9138
|
const systemRequirements = async () => {
|
|
9134
9139
|
const stepCheckGit = await checkGit();
|
|
9135
9140
|
if (!stepCheckGit.pass) {
|
|
9136
9141
|
le(stepCheckGit.message);
|
|
9137
|
-
ue('
|
|
9142
|
+
ue('Operation canceled');
|
|
9138
9143
|
return process.exit(0);
|
|
9139
9144
|
}
|
|
9140
9145
|
const stepCheckNode = await checkNodeVersion();
|
|
9141
9146
|
if (!stepCheckNode.pass) {
|
|
9142
9147
|
le(stepCheckNode.message);
|
|
9143
|
-
ue('
|
|
9148
|
+
ue('Operation canceled');
|
|
9144
9149
|
return process.exit(0);
|
|
9145
9150
|
}
|
|
9146
9151
|
};
|
|
@@ -9161,58 +9166,58 @@ const startInteractive = async () => {
|
|
|
9161
9166
|
try {
|
|
9162
9167
|
console.clear();
|
|
9163
9168
|
console.log('');
|
|
9164
|
-
oe(`
|
|
9169
|
+
oe(` Let's create a ${color.bgCyan(' Chatbot ')} ✨`);
|
|
9165
9170
|
const stepContinue = await se({
|
|
9166
|
-
message: '
|
|
9171
|
+
message: 'Do you want to continue?',
|
|
9167
9172
|
});
|
|
9168
9173
|
if (!stepContinue) {
|
|
9169
|
-
ue('
|
|
9174
|
+
ue('Operation canceled');
|
|
9170
9175
|
return process.exit(0);
|
|
9171
9176
|
}
|
|
9172
9177
|
if (eD(stepContinue)) {
|
|
9173
|
-
ue('
|
|
9178
|
+
ue('Operation canceled');
|
|
9174
9179
|
return process.exit(0);
|
|
9175
9180
|
}
|
|
9176
9181
|
const stepProvider = await ie({
|
|
9177
|
-
message: '
|
|
9182
|
+
message: 'Which WhatsApp provider do you want to use?',
|
|
9178
9183
|
options: PROVIDER_LIST,
|
|
9179
9184
|
});
|
|
9180
9185
|
if (eD(stepProvider)) {
|
|
9181
|
-
ue('
|
|
9186
|
+
ue('Operation canceled');
|
|
9182
9187
|
return process.exit(0);
|
|
9183
9188
|
}
|
|
9184
9189
|
const stepDatabase = await ie({
|
|
9185
|
-
message: '
|
|
9190
|
+
message: 'Which database do you want to use?',
|
|
9186
9191
|
options: PROVIDER_DATA,
|
|
9187
9192
|
});
|
|
9188
9193
|
if (eD(stepDatabase)) {
|
|
9189
|
-
ue('
|
|
9194
|
+
ue('Operation canceled');
|
|
9190
9195
|
return process.exit(0);
|
|
9191
9196
|
}
|
|
9192
9197
|
const stepLanguage = await ie({
|
|
9193
|
-
message: '
|
|
9198
|
+
message: 'Which language do you prefer to use?',
|
|
9194
9199
|
options: AVAILABLE_LANGUAGES,
|
|
9195
9200
|
});
|
|
9196
9201
|
if (eD(stepLanguage)) {
|
|
9197
|
-
ue('
|
|
9202
|
+
ue('Operation canceled');
|
|
9198
9203
|
return process.exit(0);
|
|
9199
9204
|
}
|
|
9200
9205
|
const s = de();
|
|
9201
|
-
s.start('
|
|
9206
|
+
s.start('Checking requirements');
|
|
9202
9207
|
await systemRequirements();
|
|
9203
|
-
s.stop('
|
|
9204
|
-
s.start(`
|
|
9208
|
+
s.stop('Checking requirements');
|
|
9209
|
+
s.start(`Creating project...`);
|
|
9205
9210
|
const NAME_DIR = ['base', stepLanguage, stepProvider, stepDatabase].join('-');
|
|
9206
9211
|
await createApp(NAME_DIR);
|
|
9207
|
-
s.stop(`
|
|
9208
|
-
bannerDone(NAME_DIR);
|
|
9209
|
-
$e(color.
|
|
9212
|
+
s.stop(`Creating project...`);
|
|
9213
|
+
bannerDone(NAME_DIR, stepLanguage);
|
|
9214
|
+
$e(color.bgGreen(' Successfully completed! '));
|
|
9210
9215
|
}
|
|
9211
9216
|
catch (e) {
|
|
9212
9217
|
console.log(e);
|
|
9213
9218
|
if (e?.code === 'ERR_TTY_INIT_FAILED')
|
|
9214
9219
|
return handleLegacyCli();
|
|
9215
|
-
ue([`
|
|
9220
|
+
ue([`Oops! 🙄 something is not right.`, `Check the minimum requirements in the documentation`].join('\n'));
|
|
9216
9221
|
return process.exit(0);
|
|
9217
9222
|
}
|
|
9218
9223
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interactive/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interactive/index.ts"],"names":[],"mappings":"AAqEA,QAAA,MAAM,gBAAgB,QAAa,QAAQ,IAAI,CAoE9C,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builderbot/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"type": "git",
|
|
43
43
|
"url": "https://github.com/codigoencasa/bot-whatsapp/tree/main/packages/cli"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "cbccaedf2373715cb59cf79b7cce71ba47db543a"
|
|
46
46
|
}
|