@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 CHANGED
@@ -1,20 +1,21 @@
1
- # @builderbot/cli
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
- **Comunidad**
10
+ Visit [builderbot](https://builderbot.vercel.app/) to view the full documentation.
14
11
 
15
- > Forma parte de este proyecto.
16
12
 
17
- - [Discord](https://link.codigoencasa.com/DISCORD)
18
- - [Twitter](https://twitter.com/leifermendez)
19
- - [Youtube](https://www.youtube.com/watch?v=5lEMCeWEJ8o&list=PL_WGMLcL4jzWPhdhcUyhbFU6bC0oJd2BR)
20
- - [Telegram](https://t.me/leifermendez)
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: 'gratis' },
242
- { value: 'venom', label: 'Venom', hint: 'gratis' },
243
- { value: 'wppconnect', label: 'WPPConnect', hint: 'gratis' },
244
- // { value: 'wweb', label: 'Whatsapp-web.js', hint: 'gratis' },
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
- `[Agradecimientos]: Este es un proyecto OpenSource, si tienes intenciones de colaborar puedes hacerlo:`,
9016
- `[😉] Comprando un cafe https://www.buymeacoffee.com/leifermendez`,
9017
- `[⭐] Dar estrella https://github.com/codigoencasa/bot-whatsapp`,
9018
- `[🚀] Realizando mejoras en el codigo`,
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(`Ups! 🙄 algo no va bien.`));
9033
- console.error(color.bgRed(`Revisa los requerimientos minimos en la documentacion`));
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: 'Quieres crear un bot? (Y/n)',
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: '¿Cuál proveedor de whatsapp quieres utilizar?',
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: 'Espacio para seleccionar',
9049
+ hint: 'Space to select',
9050
9050
  instructions: '↑/↓',
9051
9051
  },
9052
9052
  {
9053
9053
  type: 'multiselect',
9054
9054
  name: 'providerDb',
9055
- message: '¿Cuál base de datos quieres utilizar?',
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: 'Espacio para seleccionar',
9058
+ hint: 'Space to select',
9059
9059
  instructions: '↑/↓',
9060
9060
  },
9061
9061
  ];
9062
9062
  const onCancel = () => {
9063
- console.log('¡Proceso cancelado!');
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(`⚡⚡⚡ INSTRUCCIONES ⚡⚡⚡`));
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(`Debes seleccionar un proveedor de whatsapp. Tecla [Space] para seleccionar`));
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(`Debes seleccionar un proveedor de base de datos. Tecla [Space] para seleccionar`));
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
- le([
9122
- color.yellow(` cd ${templateName} `),
9123
- color.yellow(` npm install `),
9124
- color.yellow(` npm start `),
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
- `📄 Documentación y Curso:`,
9130
+ `📄 Documentation:`,
9127
9131
  ` https://builderbot.vercel.app`,
9128
9132
  ``,
9129
- `🤖 ¿Problemas? Únete:`,
9133
+ `🤖 Issues? Join:`,
9130
9134
  ` https://link.codigoencasa.com/DISCORD`,
9131
- ].join('\n'), 'Instrucciones:');
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('Operacion cancelada');
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('Operacion cancelada');
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(`Vamos a crear un ${color.bgBlue(' Chatbot ')} ✨`);
9169
+ oe(` Let's create a ${color.bgCyan(' Chatbot ')} ✨`);
9165
9170
  const stepContinue = await se({
9166
- message: '¿Quieres continuar?',
9171
+ message: 'Do you want to continue?',
9167
9172
  });
9168
9173
  if (!stepContinue) {
9169
- ue('Operacion cancelada');
9174
+ ue('Operation canceled');
9170
9175
  return process.exit(0);
9171
9176
  }
9172
9177
  if (eD(stepContinue)) {
9173
- ue('Operacion cancelada');
9178
+ ue('Operation canceled');
9174
9179
  return process.exit(0);
9175
9180
  }
9176
9181
  const stepProvider = await ie({
9177
- message: '¿Cuál proveedor de whatsapp quieres utilizar?',
9182
+ message: 'Which WhatsApp provider do you want to use?',
9178
9183
  options: PROVIDER_LIST,
9179
9184
  });
9180
9185
  if (eD(stepProvider)) {
9181
- ue('Operacion cancelada');
9186
+ ue('Operation canceled');
9182
9187
  return process.exit(0);
9183
9188
  }
9184
9189
  const stepDatabase = await ie({
9185
- message: '¿Cuál base de datos quieres utilizar?',
9190
+ message: 'Which database do you want to use?',
9186
9191
  options: PROVIDER_DATA,
9187
9192
  });
9188
9193
  if (eD(stepDatabase)) {
9189
- ue('Operacion cancelada');
9194
+ ue('Operation canceled');
9190
9195
  return process.exit(0);
9191
9196
  }
9192
9197
  const stepLanguage = await ie({
9193
- message: '¿Que lenguaje prefieres usar?',
9198
+ message: 'Which language do you prefer to use?',
9194
9199
  options: AVAILABLE_LANGUAGES,
9195
9200
  });
9196
9201
  if (eD(stepLanguage)) {
9197
- ue('Operacion cancelada');
9202
+ ue('Operation canceled');
9198
9203
  return process.exit(0);
9199
9204
  }
9200
9205
  const s = de();
9201
- s.start('Comprobando requerimientos');
9206
+ s.start('Checking requirements');
9202
9207
  await systemRequirements();
9203
- s.stop('Comprobando requerimientos');
9204
- s.start(`Creando proyecto`);
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(`Creando proyecto`);
9208
- bannerDone(NAME_DIR);
9209
- $e(color.inverse('Finalizado correctamente!'));
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([`Ups! 🙄 algo no va bien.`, `Revisa los requerimientos mínimos en la documentación`].join('\n'));
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":"AAiEA,QAAA,MAAM,gBAAgB,QAAa,QAAQ,IAAI,CAoE9C,CAAA;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
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.26-alpha.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": "9afa7ea9410c77ade9761283d0940b4b8c4f077e"
45
+ "gitHead": "cbccaedf2373715cb59cf79b7cce71ba47db543a"
46
46
  }