xonecode 0.35.0 → 0.36.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 (93) hide show
  1. package/THIRD_PARTY_NOTICES.md +30 -0
  2. package/apps/web/dist/assets/{EditorDeFichero-CGZ6uZPa.js → EditorDeFichero-B9EyiuM6.js} +1 -1
  3. package/apps/web/dist/assets/index-C6MsC7A5.js +506 -0
  4. package/apps/web/dist/assets/index-DRNhZyYF.css +1 -0
  5. package/apps/web/dist/assets/{php-DTPkbJvq.js → php-DCP5mtTp.js} +1 -1
  6. package/apps/web/dist/assets/{ruby-D1wBOK7G.js → ruby-B41ayseU.js} +1 -1
  7. package/apps/web/dist/index.html +2 -2
  8. package/dist/agent/config/settingsEnDisco.js +30 -0
  9. package/dist/agent/config/settingsEnDisco.js.map +1 -1
  10. package/dist/agent/dispositivos/instalacionEnMaquina.js +13 -0
  11. package/dist/agent/dispositivos/instalacionEnMaquina.js.map +1 -1
  12. package/dist/agent/motores/trueforge/sesionTrueforge.js +39 -1
  13. package/dist/agent/motores/trueforge/sesionTrueforge.js.map +1 -1
  14. package/dist/agent/remoto/ngrokEnMaquina.js +113 -0
  15. package/dist/agent/remoto/ngrokEnMaquina.js.map +1 -0
  16. package/dist/agent/remoto/puenteWebSocket.js +175 -0
  17. package/dist/agent/remoto/puenteWebSocket.js.map +1 -0
  18. package/dist/agent/remoto/tunelNgrok.js +245 -0
  19. package/dist/agent/remoto/tunelNgrok.js.map +1 -0
  20. package/dist/core/dispositivos.js +53 -0
  21. package/dist/core/dispositivos.js.map +1 -1
  22. package/dist/core/idiomaDeLaRespuesta.js +38 -0
  23. package/dist/core/idiomaDeLaRespuesta.js.map +1 -0
  24. package/dist/core/panorama.js +93 -0
  25. package/dist/core/panorama.js.map +1 -0
  26. package/dist/core/ports.js +100 -0
  27. package/dist/core/ports.js.map +1 -1
  28. package/dist/core/remoto.js +117 -0
  29. package/dist/core/remoto.js.map +1 -0
  30. package/dist/core/settings.js +83 -0
  31. package/dist/core/settings.js.map +1 -1
  32. package/dist/core/tunel.js +92 -0
  33. package/dist/core/tunel.js.map +1 -0
  34. package/dist/web/servidor/arranque.js +597 -72
  35. package/dist/web/servidor/arranque.js.map +1 -1
  36. package/dist/web/servidor/consolaWeb.js +52 -2
  37. package/dist/web/servidor/consolaWeb.js.map +1 -1
  38. package/dist/web/servidor/puenteRemoto.js +272 -0
  39. package/dist/web/servidor/puenteRemoto.js.map +1 -0
  40. package/dist/web/servidor/transporte.js.map +1 -1
  41. package/dist/web/servidor/vestibulo.js +39 -1
  42. package/dist/web/servidor/vestibulo.js.map +1 -1
  43. package/node_modules/@xone/xonecode-remoto/dist/base64url.d.ts +2 -0
  44. package/node_modules/@xone/xonecode-remoto/dist/base64url.js +19 -0
  45. package/node_modules/@xone/xonecode-remoto/dist/cifrado.d.ts +25 -0
  46. package/node_modules/@xone/xonecode-remoto/dist/cifrado.js +75 -0
  47. package/node_modules/@xone/xonecode-remoto/dist/contenido.d.ts +121 -0
  48. package/node_modules/@xone/xonecode-remoto/dist/contenido.js +191 -0
  49. package/node_modules/@xone/xonecode-remoto/dist/index.d.ts +6 -0
  50. package/node_modules/@xone/xonecode-remoto/dist/index.js +6 -0
  51. package/node_modules/@xone/xonecode-remoto/dist/servidor/salas.d.ts +46 -0
  52. package/node_modules/@xone/xonecode-remoto/dist/servidor/salas.js +128 -0
  53. package/node_modules/@xone/xonecode-remoto/dist/servidor/servidor.d.ts +31 -0
  54. package/node_modules/@xone/xonecode-remoto/dist/servidor/servidor.js +198 -0
  55. package/node_modules/@xone/xonecode-remoto/dist/sobre.d.ts +53 -0
  56. package/node_modules/@xone/xonecode-remoto/dist/sobre.js +69 -0
  57. package/node_modules/@xone/xonecode-remoto/dist/url.d.ts +12 -0
  58. package/node_modules/@xone/xonecode-remoto/dist/url.js +35 -0
  59. package/node_modules/@xone/xonecode-remoto/dist/version.d.ts +2 -0
  60. package/node_modules/@xone/xonecode-remoto/dist/version.js +2 -0
  61. package/node_modules/@xone/xonecode-remoto/package.json +41 -0
  62. package/node_modules/@xone/xonecode-remoto/web/assets/index-Bfa2gK3J.css +1 -0
  63. package/node_modules/@xone/xonecode-remoto/web/assets/index-qBo9eRDN.js +77 -0
  64. package/node_modules/@xone/xonecode-remoto/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
  65. package/node_modules/@xone/xonecode-remoto/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
  66. package/node_modules/@xone/xonecode-remoto/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
  67. package/node_modules/@xone/xonecode-remoto/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
  68. package/node_modules/@xone/xonecode-remoto/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
  69. package/node_modules/@xone/xonecode-remoto/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
  70. package/node_modules/@xone/xonecode-remoto/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
  71. package/node_modules/@xone/xonecode-remoto/web/index.html +14 -0
  72. package/node_modules/ws/LICENSE +20 -0
  73. package/node_modules/ws/README.md +548 -0
  74. package/node_modules/ws/browser.js +8 -0
  75. package/node_modules/ws/index.js +22 -0
  76. package/node_modules/ws/lib/buffer-util.js +131 -0
  77. package/node_modules/ws/lib/constants.js +19 -0
  78. package/node_modules/ws/lib/event-target.js +292 -0
  79. package/node_modules/ws/lib/extension.js +203 -0
  80. package/node_modules/ws/lib/limiter.js +55 -0
  81. package/node_modules/ws/lib/permessage-deflate.js +530 -0
  82. package/node_modules/ws/lib/receiver.js +743 -0
  83. package/node_modules/ws/lib/sender.js +607 -0
  84. package/node_modules/ws/lib/stream.js +161 -0
  85. package/node_modules/ws/lib/subprotocol.js +62 -0
  86. package/node_modules/ws/lib/validation.js +152 -0
  87. package/node_modules/ws/lib/websocket-server.js +562 -0
  88. package/node_modules/ws/lib/websocket.js +1407 -0
  89. package/node_modules/ws/package.json +74 -0
  90. package/node_modules/ws/wrapper.mjs +21 -0
  91. package/package.json +6 -1
  92. package/apps/web/dist/assets/index-BBQH-l_3.css +0 -1
  93. package/apps/web/dist/assets/index-DqYXrrxo.js +0 -499
@@ -0,0 +1,92 @@
1
+ /**
2
+ * El túnel de ngrok para la sesión remota: las reglas SIN efectos. Quien lanza el proceso es
3
+ * `agent/remoto/`; aquí solo se lee su log, se compone la dirección del puente y se dicen
4
+ * los fallos con texto FIJO nuestro.
5
+ *
6
+ * **Nada de lo que ngrok escribe cruza el cable.** Su salida lleva la ruta de la configuración,
7
+ * el correo de la cuenta y, en un error de autenticación, el authtoken tecleado: por eso el
8
+ * motivo de un fallo se decide por su CÓDIGO (`ERR_NGROK_xxx`) y lo que se enseña es una
9
+ * entrada de `MOTIVOS_DEL_TUNEL`, nunca la línea. Las líneas de los tests son salida real de
10
+ * ngrok v3 (`src/core/__oro__/ngrok-v3*.jsonl`), con la ruta, el correo y el token redactados.
11
+ */
12
+ /** Texto fijo por causa. Es lo ÚNICO que sale de un fallo del túnel hacia el cable. */
13
+ export const MOTIVOS_DEL_TUNEL = {
14
+ noInstalado: "ngrok no está instalado en esta máquina.",
15
+ autenticacion: "ngrok no acepta el authtoken (falta o no es válido).",
16
+ dominio: "ngrok no deja usar ese dominio: no es de tu cuenta, o tu plan no admite dominios propios.",
17
+ otraSesion: "Ya hay otro ngrok de tu cuenta abierto (en esta máquina o en otra): ciérralo y vuelve a encender.",
18
+ sinDireccion: "ngrok no dio una dirección pública a tiempo.",
19
+ seCerro: "ngrok se cerró.",
20
+ paqueteViejo: "El paquete de la sesión remota instalado no trae el puente: actualízalo.",
21
+ otro: "ngrok falló y no se pudo abrir el túnel.",
22
+ puente: "No se pudo arrancar el puente local de la sesión remota.",
23
+ authtokenSinForma: "Eso no tiene la forma de un authtoken de ngrok.",
24
+ authtokenNoGuardado: "ngrok no pudo guardar el authtoken.",
25
+ };
26
+ /**
27
+ * La dirección pública que ngrok anuncia al levantar el túnel: la línea JSON de `msg:
28
+ * "started tunnel"` (con `--log stdout --log-format json`) trae un `url`. Cualquier otra línea,
29
+ * o un túnel que no sea https, es `undefined`. No se lee de la API local (4040), que se mueve
30
+ * si el puerto está ocupado.
31
+ */
32
+ export function urlPublicaDeLinea(linea) {
33
+ if (!linea.startsWith("{"))
34
+ return undefined;
35
+ let o;
36
+ try {
37
+ o = JSON.parse(linea);
38
+ }
39
+ catch {
40
+ return undefined;
41
+ }
42
+ if (typeof o !== "object" || o === null)
43
+ return undefined;
44
+ const { msg, url } = o;
45
+ if (msg !== "started tunnel" || typeof url !== "string")
46
+ return undefined;
47
+ return url.startsWith("https://") ? url : undefined;
48
+ }
49
+ /** `https://host` → `wss://host/ws`: el puente de la sesión remota atiende el WebSocket en `/ws`. */
50
+ export function servidorDeTunel(https) {
51
+ const url = new URL(https);
52
+ if (url.protocol !== "https:")
53
+ throw new Error("la dirección del túnel tiene que ser https");
54
+ return `wss://${url.host}/ws`;
55
+ }
56
+ const ETIQUETA = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/;
57
+ /** Un nombre de host con al menos un punto: sin esquema, ruta, puerto ni espacios. */
58
+ export function motivoDeDominioInaceptable(dominio) {
59
+ if (typeof dominio !== "string" || dominio === "")
60
+ return "el dominio está vacío";
61
+ if (dominio.length > 253)
62
+ return "el dominio es demasiado largo";
63
+ const etiquetas = dominio.toLowerCase().split(".");
64
+ if (etiquetas.length < 2)
65
+ return "el dominio tiene que ser un nombre completo, como mi-app.ngrok.app";
66
+ if (!etiquetas.every((e) => e.length <= 63 && ETIQUETA.test(e))) {
67
+ return "el dominio es solo el nombre de host: sin https://, sin ruta, sin puerto";
68
+ }
69
+ return undefined;
70
+ }
71
+ // Medido: 105 es el authtoken que no parece uno, 313 el dominio que el plan o la cuenta no
72
+ // permite. Los demás de cada grupo son los de la documentación de ngrok para el mismo fallo.
73
+ // 108 (límite de sesiones simultáneas) y 334 (el endpoint ya está en línea) NO son ni token ni
74
+ // dominio: es otro ngrok de la cuenta abierto —un huérfano de un cierre en seco, por ejemplo—.
75
+ const CODIGOS_DE_AUTENTICACION = new Set(["105", "106", "107", "4018"]);
76
+ const CODIGOS_DE_DOMINIO = new Set(["313", "314", "337"]);
77
+ const CODIGOS_DE_OTRA_SESION = new Set(["108", "334"]);
78
+ /** Por qué se cerró ngrok, mirando solo el CÓDIGO `ERR_NGROK_xxx` de sus líneas, nunca su texto. */
79
+ export function motivoDeSalidaDeNgrok(lineas) {
80
+ for (const linea of lineas) {
81
+ for (const m of linea.matchAll(/ERR_NGROK_(\d+)/g)) {
82
+ if (CODIGOS_DE_AUTENTICACION.has(m[1]))
83
+ return "autenticacion";
84
+ if (CODIGOS_DE_DOMINIO.has(m[1]))
85
+ return "dominio";
86
+ if (CODIGOS_DE_OTRA_SESION.has(m[1]))
87
+ return "otraSesion";
88
+ }
89
+ }
90
+ return "otro";
91
+ }
92
+ //# sourceMappingURL=tunel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tunel.js","sourceRoot":"","sources":["../../src/core/tunel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,uFAAuF;AACvF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,0CAA0C;IACvD,aAAa,EAAE,sDAAsD;IACrE,OAAO,EAAE,2FAA2F;IACpG,UAAU,EAAE,mGAAmG;IAC/G,YAAY,EAAE,8CAA8C;IAC5D,OAAO,EAAE,iBAAiB;IAC1B,YAAY,EAAE,0EAA0E;IACxF,IAAI,EAAE,0CAA0C;IAChD,MAAM,EAAE,0DAA0D;IAClE,iBAAiB,EAAE,iDAAiD;IACpE,mBAAmB,EAAE,qCAAqC;CAClD,CAAC;AAIX;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC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