@mbermeo/wa-blaster 0.1.2 → 0.1.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.
Files changed (41) hide show
  1. package/bin/wa-blast.js +15 -1
  2. package/dist/node20/cli/index.jsc +0 -0
  3. package/dist/node20/cli/lib.jsc +0 -0
  4. package/dist/node20/mcp/index.jsc +0 -0
  5. package/dist/node20/src/accountManager.jsc +0 -0
  6. package/dist/node20/src/campaignRunner.jsc +0 -0
  7. package/dist/node20/src/db.jsc +0 -0
  8. package/dist/node20/src/paths.jsc +0 -0
  9. package/dist/node20/src/routes/accounts.jsc +0 -0
  10. package/dist/node20/src/routes/campaigns.jsc +0 -0
  11. package/dist/node20/src/routes/inbound.jsc +0 -0
  12. package/dist/node20/src/server.jsc +0 -0
  13. package/dist/node20/src/utils/csvParser.jsc +0 -0
  14. package/dist/node20/src/utils/templateEngine.jsc +0 -0
  15. package/dist/node22/cli/index.jsc +0 -0
  16. package/dist/node22/cli/lib.jsc +0 -0
  17. package/dist/node22/mcp/index.jsc +0 -0
  18. package/dist/node22/src/accountManager.jsc +0 -0
  19. package/dist/node22/src/campaignRunner.jsc +0 -0
  20. package/dist/node22/src/db.jsc +0 -0
  21. package/dist/node22/src/paths.jsc +0 -0
  22. package/dist/node22/src/routes/accounts.jsc +0 -0
  23. package/dist/node22/src/routes/campaigns.jsc +0 -0
  24. package/dist/node22/src/routes/inbound.jsc +0 -0
  25. package/dist/node22/src/server.jsc +0 -0
  26. package/dist/node22/src/utils/csvParser.jsc +0 -0
  27. package/dist/node22/src/utils/templateEngine.jsc +0 -0
  28. package/dist/node24/cli/index.jsc +0 -0
  29. package/dist/node24/cli/lib.jsc +0 -0
  30. package/dist/node24/mcp/index.jsc +0 -0
  31. package/dist/node24/src/accountManager.jsc +0 -0
  32. package/dist/node24/src/campaignRunner.jsc +0 -0
  33. package/dist/node24/src/db.jsc +0 -0
  34. package/dist/node24/src/paths.jsc +0 -0
  35. package/dist/node24/src/routes/accounts.jsc +0 -0
  36. package/dist/node24/src/routes/campaigns.jsc +0 -0
  37. package/dist/node24/src/routes/inbound.jsc +0 -0
  38. package/dist/node24/src/server.jsc +0 -0
  39. package/dist/node24/src/utils/csvParser.jsc +0 -0
  40. package/dist/node24/src/utils/templateEngine.jsc +0 -0
  41. package/package.json +1 -1
package/bin/wa-blast.js CHANGED
@@ -22,17 +22,31 @@
22
22
  const fs = require('fs');
23
23
  const path = require('path');
24
24
 
25
- // ─── Pre-parseo de --data-dir y --url ────────────────────────────────────────
25
+ // ─── Pre-parseo de flags globales ────────────────────────────────────────────
26
26
  // Minimal, antes de cargar nada más. El CLI/lib reparsea normalmente después.
27
+ //
28
+ // --data-dir <ruta> → process.env.WA_BLAST_HOME (lo lee paths.js al cargar)
29
+ // --url <url> → process.env.WA_BLAST_URL (lo lee cli/lib.js al cargar)
30
+ // --port <n> → si vamos a `serve`, setea PORT del server
31
+ // si no, setea WA_BLAST_URL=http://localhost:<n>
27
32
  (function preApplyGlobalFlags() {
28
33
  const argv = process.argv.slice(2);
34
+ let port;
29
35
  for (let i = 0; i < argv.length - 1; i++) {
30
36
  if (argv[i] === '--data-dir') {
31
37
  process.env.WA_BLAST_HOME = path.resolve(argv[i + 1]);
32
38
  } else if (argv[i] === '--url') {
33
39
  process.env.WA_BLAST_URL = argv[i + 1];
40
+ } else if (argv[i] === '--port') {
41
+ port = argv[i + 1];
34
42
  }
35
43
  }
44
+ if (port) {
45
+ // Para `serve`: el subcomando lee PORT del env
46
+ if (!process.env.PORT) process.env.PORT = port;
47
+ // Para CLI/MCP: lee WA_BLAST_URL si no se pasó --url explícito
48
+ if (!process.env.WA_BLAST_URL) process.env.WA_BLAST_URL = `http://localhost:${port}`;
49
+ }
36
50
  })();
37
51
 
38
52
  // ─── Resolución dev vs compilado + target por versión de Node ───────────────
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mbermeo/wa-blaster",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Sistema de mensajes masivos por WhatsApp con CLI y MCP server para agentes",
5
5
  "main": "bin/wa-blast.js",
6
6
  "bin": {