@wix/cli 1.1.86 → 1.1.88

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 (198) hide show
  1. package/build/DevCommand-4HINBFWU.js +103975 -0
  2. package/build/DevCommand-4HINBFWU.js.map +1 -0
  3. package/build/{DevCommand-NPY7LRXR.js → DevCommand-FFXBYLFS.js} +32 -26
  4. package/build/{DevCommand-NPY7LRXR.js.map → DevCommand-FFXBYLFS.js.map} +1 -1
  5. package/build/{DevCommand-LK2J4SHX.js → DevCommand-PUJFPAHB.js} +23 -20
  6. package/build/{DevCommand-LK2J4SHX.js.map → DevCommand-PUJFPAHB.js.map} +1 -1
  7. package/build/EnvPullCommand-H2NK2LZS.js +467 -0
  8. package/build/EnvPullCommand-H2NK2LZS.js.map +1 -0
  9. package/build/EnvRemoveCommand-2LQGQ7J3.js +83 -0
  10. package/build/EnvRemoveCommand-2LQGQ7J3.js.map +1 -0
  11. package/build/EnvSetCommand-NGJYYHGO.js +85 -0
  12. package/build/EnvSetCommand-NGJYYHGO.js.map +1 -0
  13. package/build/{InstallCommand-HETKQTOF.js → InstallCommand-KYNDZCDN.js} +24 -21
  14. package/build/{InstallCommand-HETKQTOF.js.map → InstallCommand-KYNDZCDN.js.map} +1 -1
  15. package/build/{LoginCommand-WCUDINVD.js → LoginCommand-6D4MUZAQ.js} +14 -12
  16. package/build/{LoginCommand-WCUDINVD.js.map → LoginCommand-6D4MUZAQ.js.map} +1 -1
  17. package/build/{LogoutCommand-LKLIYJ4J.js → LogoutCommand-7R5FPYOM.js} +10 -8
  18. package/build/{LogoutCommand-LKLIYJ4J.js.map → LogoutCommand-7R5FPYOM.js.map} +1 -1
  19. package/build/{PreviewCommand-3BMR7D7L.js → PreviewCommand-JOLUOQVW.js} +28 -25
  20. package/build/{PreviewCommand-3BMR7D7L.js.map → PreviewCommand-JOLUOQVW.js.map} +1 -1
  21. package/build/{PreviewCommand-C4T25Z3E.js → PreviewCommand-JR4LJXI2.js} +22 -19
  22. package/build/{PreviewCommand-C4T25Z3E.js.map → PreviewCommand-JR4LJXI2.js.map} +1 -1
  23. package/build/PreviewCommand-STITNXGG.js +32 -0
  24. package/build/{PublishCommand-O5NP2HRQ.js → PublishCommand-XYOTQFZB.js} +22 -19
  25. package/build/{PublishCommand-O5NP2HRQ.js.map → PublishCommand-XYOTQFZB.js.map} +1 -1
  26. package/build/ReleaseCommand-5VNRVOUP.js +41 -0
  27. package/build/ReleaseCommand-5VNRVOUP.js.map +1 -0
  28. package/build/{UninstallCommand-CBFAJV2F.js → UninstallCommand-5XOY2RI4.js} +24 -21
  29. package/build/{UninstallCommand-CBFAJV2F.js.map → UninstallCommand-5XOY2RI4.js.map} +1 -1
  30. package/build/{WhoamiCommand-LPJGYXSP.js → WhoamiCommand-JN32SHH5.js} +5 -4
  31. package/build/{WhoamiCommand-LPJGYXSP.js.map → WhoamiCommand-JN32SHH5.js.map} +1 -1
  32. package/build/{chunk-RVGOK65D.js → chunk-2EVNRLYY.js} +13 -9
  33. package/build/{chunk-RVGOK65D.js.map → chunk-2EVNRLYY.js.map} +1 -1
  34. package/build/chunk-2PNYIXMP.js +653 -0
  35. package/build/chunk-2PNYIXMP.js.map +1 -0
  36. package/build/{chunk-FTL2KYZQ.js → chunk-3A3KLMDB.js} +2 -2
  37. package/build/{chunk-T5F7W3A3.js → chunk-3NC6D6VA.js} +11 -11
  38. package/build/{chunk-E2POOOG2.js → chunk-3OG3PDAA.js} +51 -2
  39. package/build/{chunk-E2POOOG2.js.map → chunk-3OG3PDAA.js.map} +1 -1
  40. package/build/{chunk-QQCYRUA6.js → chunk-3WOTB46G.js} +43 -7
  41. package/build/{chunk-QQCYRUA6.js.map → chunk-3WOTB46G.js.map} +1 -1
  42. package/build/chunk-4NN2C4CS.js +3207 -0
  43. package/build/chunk-4NN2C4CS.js.map +1 -0
  44. package/build/{chunk-JUZMIMAT.js → chunk-56VD6Y4X.js} +6 -4
  45. package/build/{chunk-JUZMIMAT.js.map → chunk-56VD6Y4X.js.map} +1 -1
  46. package/build/chunk-65JTHDMM.js +3782 -0
  47. package/build/chunk-65JTHDMM.js.map +1 -0
  48. package/build/{chunk-AGKBY3K2.js → chunk-6EQYJQAS.js} +4 -4
  49. package/build/{chunk-AGKBY3K2.js.map → chunk-6EQYJQAS.js.map} +1 -1
  50. package/build/chunk-6VPGAPW3.js +72 -0
  51. package/build/chunk-6VPGAPW3.js.map +1 -0
  52. package/build/{chunk-7Y2EFSBJ.js → chunk-6Y53QK4T.js} +9 -7
  53. package/build/{chunk-7Y2EFSBJ.js.map → chunk-6Y53QK4T.js.map} +1 -1
  54. package/build/chunk-7HULOMX3.js +4760 -0
  55. package/build/chunk-7HULOMX3.js.map +1 -0
  56. package/build/chunk-7ICFZQAL.js +14 -0
  57. package/build/chunk-7ICFZQAL.js.map +1 -0
  58. package/build/{chunk-YLK75XXM.js → chunk-7ZP5YH44.js} +2 -2
  59. package/build/chunk-AFVZOQLU.js +122 -0
  60. package/build/chunk-AFVZOQLU.js.map +1 -0
  61. package/build/{chunk-UIA2B5XZ.js → chunk-AKKEMPVY.js} +4 -4
  62. package/build/{chunk-NOH6CVSC.js → chunk-BTGGUTXE.js} +8 -8
  63. package/build/{chunk-P5ZYMUV4.js → chunk-CEA5QOGH.js} +5 -5
  64. package/build/chunk-COXRYL76.js +21 -0
  65. package/build/chunk-COXRYL76.js.map +1 -0
  66. package/build/{chunk-N4QBC52K.js → chunk-CQILISSC.js} +4 -27
  67. package/build/chunk-CQILISSC.js.map +1 -0
  68. package/build/{chunk-Q35JN7B7.js → chunk-DN2XHTKB.js} +4 -4
  69. package/build/{chunk-RVMEYUY7.js → chunk-E4DQ4CV7.js} +2 -2
  70. package/build/{chunk-46OKYX3T.js → chunk-E5NGKLMX.js} +6 -6
  71. package/build/{chunk-LUAAKCVP.js → chunk-GRNUBSF6.js} +13 -13
  72. package/build/chunk-GT3LT63J.js +911 -0
  73. package/build/chunk-GT3LT63J.js.map +1 -0
  74. package/build/chunk-I5FDTDYQ.js +34 -0
  75. package/build/chunk-I5FDTDYQ.js.map +1 -0
  76. package/build/{chunk-OVWRYWLC.js → chunk-JVB5YDKN.js} +5 -5
  77. package/build/{chunk-74KZJOZH.js → chunk-L6RIG3CB.js} +15 -15
  78. package/build/chunk-LDZEOWUV.js +1623 -0
  79. package/build/chunk-LDZEOWUV.js.map +1 -0
  80. package/build/{chunk-K4AB7LGX.js → chunk-LNV5QH54.js} +2 -2
  81. package/build/{chunk-JHHGNLIV.js → chunk-LPD4XGYD.js} +4 -13
  82. package/build/chunk-LPD4XGYD.js.map +1 -0
  83. package/build/{chunk-YMJB5UO3.js → chunk-LX7XE5RU.js} +6 -6
  84. package/build/chunk-LXXFDRYM.js +92 -0
  85. package/build/chunk-LXXFDRYM.js.map +1 -0
  86. package/build/{chunk-UF2OSZ32.js → chunk-MIQ6XUKB.js} +17 -13
  87. package/build/{chunk-UF2OSZ32.js.map → chunk-MIQ6XUKB.js.map} +1 -1
  88. package/build/{chunk-Z4YQ7YWC.js → chunk-MVF7XNIR.js} +4 -4
  89. package/build/chunk-MWHZITF4.js +59 -0
  90. package/build/chunk-MWHZITF4.js.map +1 -0
  91. package/build/chunk-N2SIUTTQ.js +20 -0
  92. package/build/chunk-N2SIUTTQ.js.map +1 -0
  93. package/build/{chunk-GYIDIRSX.js → chunk-N6QOJTN4.js} +2 -2
  94. package/build/{chunk-KT2FHEZR.js → chunk-O7ATXO65.js} +3 -3
  95. package/build/{chunk-Z7JQD6EN.js → chunk-QHSB6VG6.js} +61 -20
  96. package/build/chunk-QHSB6VG6.js.map +1 -0
  97. package/build/{chunk-XBFMXGMY.js → chunk-QKHIYABF.js} +193 -142
  98. package/build/chunk-QKHIYABF.js.map +1 -0
  99. package/build/{chunk-6VFQIFXS.js → chunk-QMOKPF6L.js} +5 -5
  100. package/build/{chunk-O2XYQA7P.js → chunk-RLO4PTKH.js} +95 -991
  101. package/build/chunk-RLO4PTKH.js.map +1 -0
  102. package/build/{chunk-GO2GZJCK.js → chunk-SF2XPDVG.js} +2 -51
  103. package/build/chunk-SF2XPDVG.js.map +1 -0
  104. package/build/{chunk-UTFSE4KU.js → chunk-VLSMAOUU.js} +3 -3
  105. package/build/{chunk-QEBMMR2W.js → chunk-Y3LK6RU3.js} +3 -3
  106. package/build/{chunk-MXAPWPGN.js → chunk-YEJSNYOF.js} +2 -2
  107. package/build/{chunk-APJVRHWV.js → chunk-YFYFHJE6.js} +2 -2
  108. package/build/{chunk-J3OSZVAR.js → chunk-YOOITXIO.js} +4 -4
  109. package/build/{chunk-RA6PTMIG.js → chunk-YQGCHGIX.js} +5 -5
  110. package/build/{chunk-CJHPYBMK.js → chunk-Z7H3PAZ6.js} +2 -2
  111. package/build/{chunk-M3K72MEX.js → chunk-ZKCONC7A.js} +9 -3
  112. package/build/{chunk-M3K72MEX.js.map → chunk-ZKCONC7A.js.map} +1 -1
  113. package/build/{chunk-6RXRVNVZ.js → chunk-ZU656JEZ.js} +2 -1
  114. package/build/{dev-XNYFRZT2.js → dev-45ZJIDEB.js} +45 -39
  115. package/build/{dev-XNYFRZT2.js.map → dev-45ZJIDEB.js.map} +1 -1
  116. package/build/execa-KAGZAUR3.js +21 -0
  117. package/build/index.js +411 -4174
  118. package/build/index.js.map +1 -1
  119. package/build/{install-T2VL2EW7.js → install-Q5MSHIUE.js} +25 -23
  120. package/build/{install-T2VL2EW7.js.map → install-Q5MSHIUE.js.map} +1 -1
  121. package/build/preview-QJNHO37L.js +63 -0
  122. package/build/preview-QJNHO37L.js.map +1 -0
  123. package/build/{publish-X4C2MV4G.js → publish-GU77GYHO.js} +33 -31
  124. package/build/{publish-X4C2MV4G.js.map → publish-GU77GYHO.js.map} +1 -1
  125. package/build/release-5X3AWGDM.js +74 -0
  126. package/build/release-5X3AWGDM.js.map +1 -0
  127. package/build/render-command-74EMINJ2.js +31 -0
  128. package/build/{render-command-6ZOFWK7J.js → render-command-CDNKBZGT.js} +18 -16
  129. package/build/{render-command-6ZOFWK7J.js.map → render-command-CDNKBZGT.js.map} +1 -1
  130. package/build/{render-command-TUP2HHMC.js → render-command-EX7WIAL6.js} +13 -11
  131. package/build/{render-command-TUP2HHMC.js.map → render-command-EX7WIAL6.js.map} +1 -1
  132. package/build/{render-command-3IKISL4W.js → render-command-FXWYI3JH.js} +14 -12
  133. package/build/{render-command-3IKISL4W.js.map → render-command-FXWYI3JH.js.map} +1 -1
  134. package/build/{render-command-XJNWHPDB.js → render-command-UCUAHYDD.js} +17 -15
  135. package/build/{render-command-XJNWHPDB.js.map → render-command-UCUAHYDD.js.map} +1 -1
  136. package/build/run-command-YWXKESR5.js +23 -0
  137. package/build/src-4XDLKJ2O.js +29 -0
  138. package/build/{src-OISHTUJS.js → src-5YDYDX7K.js} +9 -8
  139. package/build/{src-OISHTUJS.js.map → src-5YDYDX7K.js.map} +1 -1
  140. package/build/{src-BTBURERG.js → src-676RR5RU.js} +17 -16
  141. package/build/{src-BTBURERG.js.map → src-676RR5RU.js.map} +1 -1
  142. package/build/src-75E36S6D.js +18 -0
  143. package/build/src-75E36S6D.js.map +1 -0
  144. package/build/src-CRLV3UTK.js +259 -0
  145. package/build/src-CRLV3UTK.js.map +1 -0
  146. package/build/{src-IM374B5V.js → src-GJHLNFJ3.js} +10 -8
  147. package/build/src-GJHLNFJ3.js.map +1 -0
  148. package/build/{src-XPBBV4BR.js → src-KLB3VOCG.js} +20 -19
  149. package/build/{src-XPBBV4BR.js.map → src-KLB3VOCG.js.map} +1 -1
  150. package/build/{src-SRRWPZCM.js → src-YH6G7Q5Z.js} +2 -2
  151. package/build/src-YH6G7Q5Z.js.map +1 -0
  152. package/build/sync-types-MB2TQNHN.js +34 -0
  153. package/build/sync-types-MB2TQNHN.js.map +1 -0
  154. package/build/{uninstall-TTKVW5BW.js → uninstall-TKOBVVM2.js} +25 -23
  155. package/build/{uninstall-TTKVW5BW.js.map → uninstall-TKOBVVM2.js.map} +1 -1
  156. package/package.json +2 -2
  157. package/build/chunk-GO2GZJCK.js.map +0 -1
  158. package/build/chunk-JHHGNLIV.js.map +0 -1
  159. package/build/chunk-N4QBC52K.js.map +0 -1
  160. package/build/chunk-O2XYQA7P.js.map +0 -1
  161. package/build/chunk-XBFMXGMY.js.map +0 -1
  162. package/build/chunk-Z7JQD6EN.js.map +0 -1
  163. package/build/run-command-3YWR7KR7.js +0 -21
  164. package/build/src-5V4GOPPO.js +0 -21
  165. package/build/src-5V4GOPPO.js.map +0 -1
  166. package/build/src-WA6BLDHT.js +0 -16
  167. package/build/sync-types-KIFWC5MO.js +0 -32
  168. /package/build/{run-command-3YWR7KR7.js.map → PreviewCommand-STITNXGG.js.map} +0 -0
  169. /package/build/{chunk-FTL2KYZQ.js.map → chunk-3A3KLMDB.js.map} +0 -0
  170. /package/build/{chunk-T5F7W3A3.js.map → chunk-3NC6D6VA.js.map} +0 -0
  171. /package/build/{chunk-YLK75XXM.js.map → chunk-7ZP5YH44.js.map} +0 -0
  172. /package/build/{chunk-UIA2B5XZ.js.map → chunk-AKKEMPVY.js.map} +0 -0
  173. /package/build/{chunk-NOH6CVSC.js.map → chunk-BTGGUTXE.js.map} +0 -0
  174. /package/build/{chunk-P5ZYMUV4.js.map → chunk-CEA5QOGH.js.map} +0 -0
  175. /package/build/{chunk-Q35JN7B7.js.map → chunk-DN2XHTKB.js.map} +0 -0
  176. /package/build/{chunk-RVMEYUY7.js.map → chunk-E4DQ4CV7.js.map} +0 -0
  177. /package/build/{chunk-46OKYX3T.js.map → chunk-E5NGKLMX.js.map} +0 -0
  178. /package/build/{chunk-LUAAKCVP.js.map → chunk-GRNUBSF6.js.map} +0 -0
  179. /package/build/{chunk-OVWRYWLC.js.map → chunk-JVB5YDKN.js.map} +0 -0
  180. /package/build/{chunk-74KZJOZH.js.map → chunk-L6RIG3CB.js.map} +0 -0
  181. /package/build/{chunk-K4AB7LGX.js.map → chunk-LNV5QH54.js.map} +0 -0
  182. /package/build/{chunk-YMJB5UO3.js.map → chunk-LX7XE5RU.js.map} +0 -0
  183. /package/build/{chunk-Z4YQ7YWC.js.map → chunk-MVF7XNIR.js.map} +0 -0
  184. /package/build/{chunk-GYIDIRSX.js.map → chunk-N6QOJTN4.js.map} +0 -0
  185. /package/build/{chunk-KT2FHEZR.js.map → chunk-O7ATXO65.js.map} +0 -0
  186. /package/build/{chunk-6VFQIFXS.js.map → chunk-QMOKPF6L.js.map} +0 -0
  187. /package/build/{chunk-UTFSE4KU.js.map → chunk-VLSMAOUU.js.map} +0 -0
  188. /package/build/{chunk-QEBMMR2W.js.map → chunk-Y3LK6RU3.js.map} +0 -0
  189. /package/build/{chunk-MXAPWPGN.js.map → chunk-YEJSNYOF.js.map} +0 -0
  190. /package/build/{chunk-APJVRHWV.js.map → chunk-YFYFHJE6.js.map} +0 -0
  191. /package/build/{chunk-J3OSZVAR.js.map → chunk-YOOITXIO.js.map} +0 -0
  192. /package/build/{chunk-RA6PTMIG.js.map → chunk-YQGCHGIX.js.map} +0 -0
  193. /package/build/{chunk-CJHPYBMK.js.map → chunk-Z7H3PAZ6.js.map} +0 -0
  194. /package/build/{chunk-6RXRVNVZ.js.map → chunk-ZU656JEZ.js.map} +0 -0
  195. /package/build/{src-IM374B5V.js.map → execa-KAGZAUR3.js.map} +0 -0
  196. /package/build/{src-SRRWPZCM.js.map → render-command-74EMINJ2.js.map} +0 -0
  197. /package/build/{src-WA6BLDHT.js.map → run-command-YWXKESR5.js.map} +0 -0
  198. /package/build/{sync-types-KIFWC5MO.js.map → src-4XDLKJ2O.js.map} +0 -0
@@ -0,0 +1,911 @@
1
+ import { createRequire as _createRequire } from 'node:module';
2
+ const require = _createRequire(import.meta.url);
3
+ import {
4
+ wixCliAppsFlowTunnelCreationStatusSrc11Evid5233
5
+ } from "./chunk-N2SIUTTQ.js";
6
+ import {
7
+ execa
8
+ } from "./chunk-3OG3PDAA.js";
9
+ import {
10
+ useHttpClient
11
+ } from "./chunk-I5FDTDYQ.js";
12
+ import {
13
+ pRetry,
14
+ resolveUrl,
15
+ serializer,
16
+ toURLSearchParams
17
+ } from "./chunk-2EVNRLYY.js";
18
+ import {
19
+ useBiLogger
20
+ } from "./chunk-3WOTB46G.js";
21
+ import {
22
+ require_react
23
+ } from "./chunk-SO6EZMEL.js";
24
+ import {
25
+ getTestOverrides
26
+ } from "./chunk-MWHZITF4.js";
27
+ import {
28
+ pathExists
29
+ } from "./chunk-LPD4XGYD.js";
30
+ import {
31
+ z
32
+ } from "./chunk-SF2XPDVG.js";
33
+ import {
34
+ CliError,
35
+ CliErrorCode
36
+ } from "./chunk-ZKCONC7A.js";
37
+ import {
38
+ __commonJS,
39
+ __dirname,
40
+ __require,
41
+ __toESM,
42
+ init_esm_shims
43
+ } from "./chunk-PYIAC2GK.js";
44
+
45
+ // ../../node_modules/cloudflared/lib/constants.js
46
+ var require_constants = __commonJS({
47
+ "../../node_modules/cloudflared/lib/constants.js"(exports, module) {
48
+ "use strict";
49
+ init_esm_shims();
50
+ var __create = Object.create;
51
+ var __defProp = Object.defineProperty;
52
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
53
+ var __getOwnPropNames = Object.getOwnPropertyNames;
54
+ var __getProtoOf = Object.getPrototypeOf;
55
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
56
+ var __export = (target, all) => {
57
+ for (var name in all)
58
+ __defProp(target, name, { get: all[name], enumerable: true });
59
+ };
60
+ var __copyProps = (to, from, except, desc) => {
61
+ if (from && typeof from === "object" || typeof from === "function") {
62
+ for (let key of __getOwnPropNames(from))
63
+ if (!__hasOwnProp.call(to, key) && key !== except)
64
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
65
+ }
66
+ return to;
67
+ };
68
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
69
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
70
+ var constants_exports = {};
71
+ __export(constants_exports, {
72
+ CLOUDFLARED_VERSION: () => CLOUDFLARED_VERSION,
73
+ DEFAULT_CLOUDFLARED_BIN: () => DEFAULT_CLOUDFLARED_BIN,
74
+ RELEASE_BASE: () => RELEASE_BASE,
75
+ bin: () => bin3,
76
+ use: () => use
77
+ });
78
+ module.exports = __toCommonJS(constants_exports);
79
+ var import_node_path2 = __toESM2(__require("node:path"));
80
+ var DEFAULT_CLOUDFLARED_BIN = import_node_path2.default.join(__dirname, "..", "bin", process.platform === "win32" ? "cloudflared.exe" : "cloudflared");
81
+ var bin3 = process.env.CLOUDFLARED_BIN || DEFAULT_CLOUDFLARED_BIN;
82
+ function use(executable) {
83
+ bin3 = executable;
84
+ }
85
+ var CLOUDFLARED_VERSION = process.env.CLOUDFLARED_VERSION || "latest";
86
+ var RELEASE_BASE = "https://github.com/cloudflare/cloudflared/releases/";
87
+ }
88
+ });
89
+
90
+ // ../../node_modules/cloudflared/lib/error.js
91
+ var require_error = __commonJS({
92
+ "../../node_modules/cloudflared/lib/error.js"(exports, module) {
93
+ "use strict";
94
+ init_esm_shims();
95
+ var __defProp = Object.defineProperty;
96
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
97
+ var __getOwnPropNames = Object.getOwnPropertyNames;
98
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
99
+ var __export = (target, all) => {
100
+ for (var name in all)
101
+ __defProp(target, name, { get: all[name], enumerable: true });
102
+ };
103
+ var __copyProps = (to, from, except, desc) => {
104
+ if (from && typeof from === "object" || typeof from === "function") {
105
+ for (let key of __getOwnPropNames(from))
106
+ if (!__hasOwnProp.call(to, key) && key !== except)
107
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
108
+ }
109
+ return to;
110
+ };
111
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
112
+ var error_exports = {};
113
+ __export(error_exports, {
114
+ UnsupportedError: () => UnsupportedError
115
+ });
116
+ module.exports = __toCommonJS(error_exports);
117
+ var UnsupportedError = class extends Error {
118
+ constructor(message) {
119
+ super(message);
120
+ }
121
+ };
122
+ }
123
+ });
124
+
125
+ // ../../node_modules/cloudflared/lib/install.js
126
+ var require_install = __commonJS({
127
+ "../../node_modules/cloudflared/lib/install.js"(exports, module) {
128
+ "use strict";
129
+ init_esm_shims();
130
+ var __create = Object.create;
131
+ var __defProp = Object.defineProperty;
132
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
133
+ var __getOwnPropNames = Object.getOwnPropertyNames;
134
+ var __getProtoOf = Object.getPrototypeOf;
135
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
136
+ var __export = (target, all) => {
137
+ for (var name in all)
138
+ __defProp(target, name, { get: all[name], enumerable: true });
139
+ };
140
+ var __copyProps = (to, from, except, desc) => {
141
+ if (from && typeof from === "object" || typeof from === "function") {
142
+ for (let key of __getOwnPropNames(from))
143
+ if (!__hasOwnProp.call(to, key) && key !== except)
144
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
145
+ }
146
+ return to;
147
+ };
148
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
149
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
150
+ var install_exports = {};
151
+ __export(install_exports, {
152
+ install: () => install3,
153
+ install_linux: () => install_linux,
154
+ install_macos: () => install_macos,
155
+ install_windows: () => install_windows
156
+ });
157
+ module.exports = __toCommonJS(install_exports);
158
+ var import_node_fs = __toESM2(__require("node:fs"));
159
+ var import_node_path2 = __toESM2(__require("node:path"));
160
+ var import_node_https = __toESM2(__require("node:https"));
161
+ var import_node_child_process = __require("node:child_process");
162
+ var import_constants = require_constants();
163
+ var import_error = require_error();
164
+ var LINUX_URL = {
165
+ arm64: "cloudflared-linux-arm64",
166
+ arm: "cloudflared-linux-arm",
167
+ x64: "cloudflared-linux-amd64",
168
+ ia32: "cloudflared-linux-386"
169
+ };
170
+ var MACOS_URL = {
171
+ arm64: "cloudflared-darwin-amd64.tgz",
172
+ x64: "cloudflared-darwin-amd64.tgz"
173
+ };
174
+ var WINDOWS_URL = {
175
+ x64: "cloudflared-windows-amd64.exe",
176
+ ia32: "cloudflared-windows-386.exe"
177
+ };
178
+ function resolve_base(version) {
179
+ if (version === "latest") {
180
+ return `${import_constants.RELEASE_BASE}latest/download/`;
181
+ }
182
+ return `${import_constants.RELEASE_BASE}download/${version}/`;
183
+ }
184
+ async function install3(to, version = import_constants.CLOUDFLARED_VERSION) {
185
+ if (process.platform === "linux") {
186
+ return install_linux(to, version);
187
+ } else if (process.platform === "darwin") {
188
+ return install_macos(to, version);
189
+ } else if (process.platform === "win32") {
190
+ return install_windows(to, version);
191
+ } else {
192
+ throw new import_error.UnsupportedError("Unsupported platform: " + process.platform);
193
+ }
194
+ }
195
+ async function install_linux(to, version = import_constants.CLOUDFLARED_VERSION) {
196
+ const file = LINUX_URL[process.arch];
197
+ if (file === void 0) {
198
+ throw new import_error.UnsupportedError("Unsupported architecture: " + process.arch);
199
+ }
200
+ await download(resolve_base(version) + file, to);
201
+ import_node_fs.default.chmodSync(to, "755");
202
+ return to;
203
+ }
204
+ async function install_macos(to, version = import_constants.CLOUDFLARED_VERSION) {
205
+ const file = MACOS_URL[process.arch];
206
+ if (file === void 0) {
207
+ throw new import_error.UnsupportedError("Unsupported architecture: " + process.arch);
208
+ }
209
+ await download(resolve_base(version) + file, `${to}.tgz`);
210
+ process.env.VERBOSE && console.log(`Extracting to ${to}`);
211
+ (0, import_node_child_process.execSync)(`tar -xzf ${import_node_path2.default.basename(`${to}.tgz`)}`, { cwd: import_node_path2.default.dirname(to) });
212
+ import_node_fs.default.unlinkSync(`${to}.tgz`);
213
+ import_node_fs.default.renameSync(`${import_node_path2.default.dirname(to)}/cloudflared`, to);
214
+ return to;
215
+ }
216
+ async function install_windows(to, version = import_constants.CLOUDFLARED_VERSION) {
217
+ const file = WINDOWS_URL[process.arch];
218
+ if (file === void 0) {
219
+ throw new import_error.UnsupportedError("Unsupported architecture: " + process.arch);
220
+ }
221
+ await download(resolve_base(version) + file, to);
222
+ return to;
223
+ }
224
+ function download(url, to, redirect = 0) {
225
+ if (redirect === 0) {
226
+ process.env.VERBOSE && console.log(`Downloading ${url} to ${to}`);
227
+ } else {
228
+ process.env.VERBOSE && console.log(`Redirecting to ${url}`);
229
+ }
230
+ if (!import_node_fs.default.existsSync(import_node_path2.default.dirname(to))) {
231
+ import_node_fs.default.mkdirSync(import_node_path2.default.dirname(to), { recursive: true });
232
+ }
233
+ return new Promise((resolve, reject) => {
234
+ const request = import_node_https.default.get(url, (res) => {
235
+ const redirect_code = [301, 302, 303, 307, 308];
236
+ if (redirect_code.includes(res.statusCode) && res.headers.location !== void 0) {
237
+ request.destroy();
238
+ const redirection = res.headers.location;
239
+ resolve(download(redirection, to, redirect + 1));
240
+ return;
241
+ }
242
+ if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
243
+ const file = import_node_fs.default.createWriteStream(to);
244
+ file.on("finish", () => {
245
+ file.close(() => resolve(to));
246
+ });
247
+ file.on("error", (err) => {
248
+ import_node_fs.default.unlink(to, () => reject(err));
249
+ });
250
+ res.pipe(file);
251
+ } else {
252
+ request.destroy();
253
+ reject(new Error(`HTTP response with status code: ${res.statusCode}`));
254
+ }
255
+ });
256
+ request.on("error", (err) => {
257
+ reject(err);
258
+ });
259
+ request.end();
260
+ });
261
+ }
262
+ }
263
+ });
264
+
265
+ // ../../node_modules/cloudflared/lib/regex.js
266
+ var require_regex = __commonJS({
267
+ "../../node_modules/cloudflared/lib/regex.js"(exports, module) {
268
+ "use strict";
269
+ init_esm_shims();
270
+ var __defProp = Object.defineProperty;
271
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
272
+ var __getOwnPropNames = Object.getOwnPropertyNames;
273
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
274
+ var __export = (target, all) => {
275
+ for (var name in all)
276
+ __defProp(target, name, { get: all[name], enumerable: true });
277
+ };
278
+ var __copyProps = (to, from, except, desc) => {
279
+ if (from && typeof from === "object" || typeof from === "function") {
280
+ for (let key of __getOwnPropNames(from))
281
+ if (!__hasOwnProp.call(to, key) && key !== except)
282
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
283
+ }
284
+ return to;
285
+ };
286
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
287
+ var regex_exports = {};
288
+ __export(regex_exports, {
289
+ config_regex: () => config_regex,
290
+ conn_regex: () => conn_regex,
291
+ connectorID_regex: () => connectorID_regex,
292
+ disconnect_regex: () => disconnect_regex,
293
+ index_regex: () => index_regex,
294
+ ip_regex: () => ip_regex,
295
+ location_regex: () => location_regex,
296
+ metrics_regex: () => metrics_regex,
297
+ tunnelID_regex: () => tunnelID_regex
298
+ });
299
+ module.exports = __toCommonJS(regex_exports);
300
+ var conn_regex = /connection[= ]([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;
301
+ var ip_regex = /ip=([0-9.]+)/;
302
+ var location_regex = /location=([A-Za-z0-9]+)/;
303
+ var index_regex = /connIndex=(\d)/;
304
+ var disconnect_regex = /Unregistered tunnel connection connIndex=(\d)/i;
305
+ var tunnelID_regex = /tunnelID=([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;
306
+ var connectorID_regex = /Connector ID: ([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12})/i;
307
+ var metrics_regex = /metrics server on ([0-9.:]+\/metrics)/;
308
+ var config_regex = /config="(.+[^\\])"/;
309
+ }
310
+ });
311
+
312
+ // ../../node_modules/cloudflared/lib/tunnel.js
313
+ var require_tunnel = __commonJS({
314
+ "../../node_modules/cloudflared/lib/tunnel.js"(exports, module) {
315
+ "use strict";
316
+ init_esm_shims();
317
+ var __defProp = Object.defineProperty;
318
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
319
+ var __getOwnPropNames = Object.getOwnPropertyNames;
320
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
321
+ var __export = (target, all) => {
322
+ for (var name in all)
323
+ __defProp(target, name, { get: all[name], enumerable: true });
324
+ };
325
+ var __copyProps = (to, from, except, desc) => {
326
+ if (from && typeof from === "object" || typeof from === "function") {
327
+ for (let key of __getOwnPropNames(from))
328
+ if (!__hasOwnProp.call(to, key) && key !== except)
329
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
330
+ }
331
+ return to;
332
+ };
333
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
334
+ var tunnel_exports = {};
335
+ __export(tunnel_exports, {
336
+ tunnel: () => tunnel2
337
+ });
338
+ module.exports = __toCommonJS(tunnel_exports);
339
+ var import_node_child_process = __require("node:child_process");
340
+ var import_constants = require_constants();
341
+ var import_regex = require_regex();
342
+ function tunnel2(options = {}) {
343
+ const args = ["tunnel"];
344
+ for (const [key, value] of Object.entries(options)) {
345
+ if (typeof value === "string") {
346
+ args.push(`${key}`, value);
347
+ } else if (typeof value === "number") {
348
+ args.push(`${key}`, value.toString());
349
+ } else if (value === null) {
350
+ args.push(`${key}`);
351
+ }
352
+ }
353
+ if (args.length === 1) {
354
+ args.push("--url", "localhost:8080");
355
+ }
356
+ const child = (0, import_node_child_process.spawn)(import_constants.bin, args, { stdio: ["ignore", "pipe", "pipe"] });
357
+ if (process.env.VERBOSE) {
358
+ child.stdout.pipe(process.stdout);
359
+ child.stderr.pipe(process.stderr);
360
+ }
361
+ const url_regex = /\|\s+(https?:\/\/[^\s]+)/;
362
+ let url_resolver = () => void 0;
363
+ let url_rejector = () => void 0;
364
+ const url = new Promise((...pair) => [url_resolver, url_rejector] = pair);
365
+ const connection_resolvers = [];
366
+ const connection_rejectors = [];
367
+ const connections = [];
368
+ for (let i = 0; i < 1; i++) {
369
+ connections.push(new Promise((...pair) => [connection_resolvers[i], connection_rejectors[i]] = pair));
370
+ }
371
+ const parser = (data) => {
372
+ var _a;
373
+ const str = data.toString();
374
+ const url_match = str.match(url_regex);
375
+ url_match && url_resolver(url_match[1]);
376
+ const conn_match = str.match(import_regex.conn_regex);
377
+ const ip_match = str.match(import_regex.ip_regex);
378
+ const location_match = str.match(import_regex.location_regex);
379
+ const index_match = str.match(import_regex.index_regex);
380
+ if (conn_match && ip_match && location_match && index_match) {
381
+ const [, id] = conn_match;
382
+ const [, ip] = ip_match;
383
+ const [, location] = location_match;
384
+ const [, idx] = index_match;
385
+ (_a = connection_resolvers[+idx]) == null ? void 0 : _a.call(connection_resolvers, { id, ip, location });
386
+ }
387
+ };
388
+ child.stdout.on("data", parser).on("error", url_rejector);
389
+ child.stderr.on("data", parser).on("error", url_rejector);
390
+ const stop = () => child.kill("SIGINT");
391
+ return { url, connections, child, stop };
392
+ }
393
+ }
394
+ });
395
+
396
+ // ../../node_modules/cloudflared/lib/service.js
397
+ var require_service = __commonJS({
398
+ "../../node_modules/cloudflared/lib/service.js"(exports, module) {
399
+ "use strict";
400
+ init_esm_shims();
401
+ var __create = Object.create;
402
+ var __defProp = Object.defineProperty;
403
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
404
+ var __getOwnPropNames = Object.getOwnPropertyNames;
405
+ var __getProtoOf = Object.getPrototypeOf;
406
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
407
+ var __export = (target, all) => {
408
+ for (var name in all)
409
+ __defProp(target, name, { get: all[name], enumerable: true });
410
+ };
411
+ var __copyProps = (to, from, except, desc) => {
412
+ if (from && typeof from === "object" || typeof from === "function") {
413
+ for (let key of __getOwnPropNames(from))
414
+ if (!__hasOwnProp.call(to, key) && key !== except)
415
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
416
+ }
417
+ return to;
418
+ };
419
+ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
420
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
421
+ var service_exports = {};
422
+ __export(service_exports, {
423
+ AlreadyInstalledError: () => AlreadyInstalledError2,
424
+ LINUX_SERVICE_PATH: () => LINUX_SERVICE_PATH,
425
+ MACOS_SERVICE_PATH: () => MACOS_SERVICE_PATH2,
426
+ NotInstalledError: () => NotInstalledError2,
427
+ clean: () => clean,
428
+ current: () => current,
429
+ err: () => err,
430
+ exists: () => exists,
431
+ identifier: () => identifier2,
432
+ install: () => install3,
433
+ journal: () => journal,
434
+ log: () => log,
435
+ service: () => service2,
436
+ service_name: () => service_name,
437
+ uninstall: () => uninstall
438
+ });
439
+ module.exports = __toCommonJS(service_exports);
440
+ var import_node_os = __toESM2(__require("node:os"));
441
+ var import_node_fs = __toESM2(__require("node:fs"));
442
+ var import_node_child_process = __require("node:child_process");
443
+ var import_constants = require_constants();
444
+ var import_regex = require_regex();
445
+ var identifier2 = "com.cloudflare.cloudflared";
446
+ var service_name = "cloudflared.service";
447
+ var MACOS_SERVICE_PATH2 = {
448
+ PLIST: is_root() ? `/Library/LaunchDaemons/${identifier2}.plist` : `${import_node_os.default.homedir()}/Library/LaunchAgents/${identifier2}.plist`,
449
+ OUT: is_root() ? `/Library/Logs/${identifier2}.out.log` : `${import_node_os.default.homedir()}/Library/Logs/${identifier2}.out.log`,
450
+ ERR: is_root() ? `/Library/Logs/${identifier2}.err.log` : `${import_node_os.default.homedir()}/Library/Logs/${identifier2}.err.log`
451
+ };
452
+ var LINUX_SERVICE_PATH = {
453
+ SYSTEMD: `/etc/systemd/system/${service_name}`,
454
+ SERVICE: "/etc/init.d/cloudflared",
455
+ SERVICE_OUT: "/var/log/cloudflared.log",
456
+ SERVICE_ERR: "/var/log/cloudflared.err"
457
+ };
458
+ var service2 = { install: install3, uninstall, exists, log, err, current, clean, journal };
459
+ var AlreadyInstalledError2 = class extends Error {
460
+ constructor() {
461
+ super("service is already installed");
462
+ }
463
+ };
464
+ var NotInstalledError2 = class extends Error {
465
+ constructor() {
466
+ super("service is not installed");
467
+ }
468
+ };
469
+ function install3(token) {
470
+ if (!["darwin", "linux"].includes(process.platform)) {
471
+ throw new Error(`Not Implemented on platform ${process.platform}`);
472
+ }
473
+ if (exists()) {
474
+ throw new AlreadyInstalledError2();
475
+ }
476
+ const args = ["service", "install"];
477
+ if (token) {
478
+ args.push(token);
479
+ }
480
+ const result = (0, import_node_child_process.spawnSync)(import_constants.bin, args);
481
+ if (result.status !== 0) {
482
+ throw new Error(`service install failed: ${result.stderr.toString()}`);
483
+ }
484
+ }
485
+ function uninstall() {
486
+ if (!["darwin", "linux"].includes(process.platform)) {
487
+ throw new Error(`Not Implemented on platform ${process.platform}`);
488
+ }
489
+ if (!exists()) {
490
+ throw new NotInstalledError2();
491
+ }
492
+ const result = (0, import_node_child_process.spawnSync)(import_constants.bin, ["service", "uninstall"]);
493
+ if (result.status !== 0) {
494
+ throw new Error(`service uninstall failed: ${result.stderr.toString()}`);
495
+ }
496
+ if (process.platform === "darwin") {
497
+ import_node_fs.default.rmSync(MACOS_SERVICE_PATH2.OUT);
498
+ import_node_fs.default.rmSync(MACOS_SERVICE_PATH2.ERR);
499
+ } else if (process.platform === "linux" && !is_systemd()) {
500
+ import_node_fs.default.rmSync(LINUX_SERVICE_PATH.SERVICE_OUT);
501
+ import_node_fs.default.rmSync(LINUX_SERVICE_PATH.SERVICE_ERR);
502
+ }
503
+ }
504
+ function log() {
505
+ if (!exists()) {
506
+ throw new NotInstalledError2();
507
+ }
508
+ if (process.platform === "darwin") {
509
+ return import_node_fs.default.readFileSync(MACOS_SERVICE_PATH2.OUT, "utf8");
510
+ }
511
+ if (process.platform === "linux" && !is_systemd()) {
512
+ return import_node_fs.default.readFileSync(LINUX_SERVICE_PATH.SERVICE_OUT, "utf8");
513
+ }
514
+ throw new Error(`Not Implemented on platform ${process.platform}`);
515
+ }
516
+ function err() {
517
+ if (!exists()) {
518
+ throw new NotInstalledError2();
519
+ }
520
+ if (process.platform === "darwin") {
521
+ return import_node_fs.default.readFileSync(MACOS_SERVICE_PATH2.ERR, "utf8");
522
+ }
523
+ if (process.platform === "linux" && !is_systemd()) {
524
+ return import_node_fs.default.readFileSync(LINUX_SERVICE_PATH.SERVICE_ERR, "utf8");
525
+ }
526
+ throw new Error(`Not Implemented on platform ${process.platform}`);
527
+ }
528
+ function journal(n = 300) {
529
+ if (process.platform === "linux" && is_systemd()) {
530
+ const args = ["-u", service_name, "-o", "cat", "-n", n.toString()];
531
+ return (0, import_node_child_process.spawnSync)("journalctl", args).stdout.toString();
532
+ }
533
+ throw new Error(`Not Implemented on platform ${process.platform}`);
534
+ }
535
+ function current() {
536
+ var _a, _b, _c, _d;
537
+ if (!["darwin", "linux"].includes(process.platform)) {
538
+ throw new Error(`Not Implemented on platform ${process.platform}`);
539
+ }
540
+ if (!exists()) {
541
+ throw new NotInstalledError2();
542
+ }
543
+ const log2 = is_systemd() ? journal() : err();
544
+ let tunnelID = "";
545
+ let connectorID = "";
546
+ const connections = [];
547
+ let metrics = "";
548
+ let config = {};
549
+ for (const line of log2.split("\n")) {
550
+ try {
551
+ if (line.match(import_regex.tunnelID_regex)) {
552
+ tunnelID = ((_a = line.match(import_regex.tunnelID_regex)) == null ? void 0 : _a[1]) ?? "";
553
+ } else if (line.match(import_regex.connectorID_regex)) {
554
+ connectorID = ((_b = line.match(import_regex.connectorID_regex)) == null ? void 0 : _b[1]) ?? "";
555
+ } else if (line.match(import_regex.conn_regex) && line.match(import_regex.location_regex) && line.match(import_regex.ip_regex) && line.match(import_regex.index_regex)) {
556
+ const [, id] = line.match(import_regex.conn_regex) ?? [];
557
+ const [, location] = line.match(import_regex.location_regex) ?? [];
558
+ const [, ip] = line.match(import_regex.ip_regex) ?? [];
559
+ const [, idx] = line.match(import_regex.index_regex) ?? [];
560
+ connections[parseInt(idx)] = { id, ip, location };
561
+ } else if (line.match(import_regex.disconnect_regex)) {
562
+ const [, idx] = line.match(import_regex.disconnect_regex) ?? [];
563
+ if (parseInt(idx) in connections) {
564
+ connections[parseInt(idx)] = { id: "", ip: "", location: "" };
565
+ }
566
+ } else if (line.match(import_regex.metrics_regex)) {
567
+ metrics = ((_c = line.match(import_regex.metrics_regex)) == null ? void 0 : _c[1]) ?? "";
568
+ } else if (line.match(import_regex.config_regex)) {
569
+ config = JSON.parse(((_d = line.match(import_regex.config_regex)) == null ? void 0 : _d[1].replace(/\\/g, "")) ?? "{}");
570
+ }
571
+ } catch (err2) {
572
+ if (process.env.VERBOSE) {
573
+ console.error("log parsing failed", err2);
574
+ }
575
+ }
576
+ }
577
+ return { tunnelID, connectorID, connections, metrics, config };
578
+ }
579
+ function clean() {
580
+ if (process.platform !== "darwin") {
581
+ throw new Error(`Not Implemented on platform ${process.platform}`);
582
+ }
583
+ if (exists()) {
584
+ throw new AlreadyInstalledError2();
585
+ }
586
+ import_node_fs.default.rmSync(MACOS_SERVICE_PATH2.OUT, { force: true });
587
+ import_node_fs.default.rmSync(MACOS_SERVICE_PATH2.ERR, { force: true });
588
+ }
589
+ function exists() {
590
+ if (process.platform === "darwin") {
591
+ return import_node_fs.default.existsSync(MACOS_SERVICE_PATH2.PLIST);
592
+ } else if (process.platform === "linux") {
593
+ return is_systemd() ? import_node_fs.default.existsSync(LINUX_SERVICE_PATH.SYSTEMD) : import_node_fs.default.existsSync(LINUX_SERVICE_PATH.SERVICE);
594
+ }
595
+ throw new Error(`Not Implemented on platform ${process.platform}`);
596
+ }
597
+ function is_root() {
598
+ var _a;
599
+ return ((_a = process.getuid) == null ? void 0 : _a.call(process)) === 0;
600
+ }
601
+ function is_systemd() {
602
+ return process.platform === "linux" && import_node_fs.default.existsSync("/run/systemd/system");
603
+ }
604
+ }
605
+ });
606
+
607
+ // ../../node_modules/cloudflared/lib/lib.js
608
+ var require_lib = __commonJS({
609
+ "../../node_modules/cloudflared/lib/lib.js"(exports, module) {
610
+ "use strict";
611
+ init_esm_shims();
612
+ var __defProp = Object.defineProperty;
613
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
614
+ var __getOwnPropNames = Object.getOwnPropertyNames;
615
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
616
+ var __export = (target, all) => {
617
+ for (var name in all)
618
+ __defProp(target, name, { get: all[name], enumerable: true });
619
+ };
620
+ var __copyProps = (to, from, except, desc) => {
621
+ if (from && typeof from === "object" || typeof from === "function") {
622
+ for (let key of __getOwnPropNames(from))
623
+ if (!__hasOwnProp.call(to, key) && key !== except)
624
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
625
+ }
626
+ return to;
627
+ };
628
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
629
+ var lib_exports = {};
630
+ __export(lib_exports, {
631
+ AlreadyInstalledError: () => import_service.AlreadyInstalledError,
632
+ MACOS_SERVICE_PATH: () => import_service.MACOS_SERVICE_PATH,
633
+ NotInstalledError: () => import_service.NotInstalledError,
634
+ bin: () => import_constants.bin,
635
+ identifier: () => import_service.identifier,
636
+ install: () => import_install.install,
637
+ service: () => import_service.service,
638
+ tunnel: () => import_tunnel3.tunnel
639
+ });
640
+ module.exports = __toCommonJS(lib_exports);
641
+ var import_constants = require_constants();
642
+ var import_install = require_install();
643
+ var import_tunnel3 = require_tunnel();
644
+ var import_service = require_service();
645
+ }
646
+ });
647
+
648
+ // ../cli-tunnel/src/tunnel.ts
649
+ init_esm_shims();
650
+ import { dirname } from "node:path";
651
+ var import_cloudflared = __toESM(require_lib(), 1);
652
+ async function launchTunnel(port, tunnelClient) {
653
+ const { localTunnel } = getTestOverrides();
654
+ if (!localTunnel && !await pathExists(import_cloudflared.bin)) {
655
+ try {
656
+ await (0, import_cloudflared.install)(import_cloudflared.bin);
657
+ } catch (e) {
658
+ const err = e;
659
+ if (e instanceof Error && err.code === "EACCES") {
660
+ throw new CliError({
661
+ code: CliErrorCode.FailedInstallCloudflareNoAccess({
662
+ path: dirname(err.path)
663
+ }),
664
+ cause: e
665
+ });
666
+ }
667
+ throw e;
668
+ }
669
+ }
670
+ const tunnel2 = await tunnelClient.createTunnel({ port });
671
+ const domain = `http${localTunnel ? "" : "s"}://${tunnel2.domain}`;
672
+ const createTunnelPromise = new Promise((resolve, reject) => {
673
+ const tunnelProcess = localTunnel ? execa("echo", [tunnel2.domain, tunnel2.token], { detached: true }) : execa(import_cloudflared.bin, ["tunnel", "run", "--token", tunnel2.token]);
674
+ const close = () => {
675
+ tunnelProcess.kill();
676
+ };
677
+ const listener = async (data) => {
678
+ const output = data.toString();
679
+ const match = output.match(tunnel2.domain)?.[0];
680
+ if (match) {
681
+ resolve({
682
+ domain,
683
+ close
684
+ });
685
+ }
686
+ };
687
+ tunnelProcess.stderr?.on("data", listener);
688
+ tunnelProcess.stdout?.on("data", listener);
689
+ tunnelProcess.on("error", (err) => {
690
+ reject(err);
691
+ });
692
+ });
693
+ return {
694
+ domain,
695
+ close: async () => {
696
+ const tunnel3 = await createTunnelPromise;
697
+ return tunnel3.close();
698
+ }
699
+ };
700
+ }
701
+
702
+ // ../cli-tunnel/src/client.ts
703
+ init_esm_shims();
704
+
705
+ // ../../node_modules/@wix/ambassador-apps-hosting-v1-deployment/build/es/http.impl.js
706
+ init_esm_shims();
707
+ var _createTunnelRequest = {};
708
+ var _createTunnelResponse = {};
709
+ var _deleteTunnelRequest = {};
710
+ var _deleteTunnelResponse = {};
711
+ function resolveWixAppsHostingV1BackendServiceUrl(opts) {
712
+ var domainToMappings = {
713
+ "bo._base_domain_": [
714
+ {
715
+ srcPath: "/_serverless/wix-app-backend-manager",
716
+ destPath: ""
717
+ }
718
+ ],
719
+ "wixbo.ai": [
720
+ {
721
+ srcPath: "/_serverless/wix-app-backend-manager",
722
+ destPath: ""
723
+ }
724
+ ],
725
+ "wix-bo.com": [
726
+ {
727
+ srcPath: "/_serverless/wix-app-backend-manager",
728
+ destPath: ""
729
+ }
730
+ ],
731
+ "manage._base_domain_": [
732
+ {
733
+ srcPath: "/_serverless/wix-app-backend-manager",
734
+ destPath: ""
735
+ }
736
+ ]
737
+ };
738
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
739
+ }
740
+ function createTunnel(payload) {
741
+ var _a = serializer(_createTunnelRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
742
+ var fromRes = serializer(_createTunnelResponse, {}).fromJSON;
743
+ function __createTunnel(_a2) {
744
+ var host = _a2.host;
745
+ var serializedData = toReq(payload);
746
+ var metadata = {
747
+ entityFqdn: "wix.apps.hosting.v1.deployment",
748
+ method: "POST",
749
+ methodFqn: "wix.apps.hosting.v1.BackendService.CreateTunnel",
750
+ url: resolveWixAppsHostingV1BackendServiceUrl({
751
+ protoPath: "/v1/tunnel",
752
+ data: serializedData,
753
+ host
754
+ }),
755
+ data: serializedData,
756
+ transformResponse: fromRes
757
+ };
758
+ return metadata;
759
+ }
760
+ __createTunnel.fromReq = fromReq;
761
+ __createTunnel.__isAmbassador = true;
762
+ return __createTunnel;
763
+ }
764
+ function deleteTunnel(payload) {
765
+ var _a = serializer(_deleteTunnelRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
766
+ var fromRes = serializer(_deleteTunnelResponse, {}).fromJSON;
767
+ function __deleteTunnel(_a2) {
768
+ var host = _a2.host;
769
+ var serializedData = toReq(payload);
770
+ var metadata = {
771
+ entityFqdn: "wix.apps.hosting.v1.deployment",
772
+ method: "DELETE",
773
+ methodFqn: "wix.apps.hosting.v1.BackendService.DeleteTunnel",
774
+ url: resolveWixAppsHostingV1BackendServiceUrl({
775
+ protoPath: "/v1/tunnel",
776
+ data: serializedData,
777
+ host
778
+ }),
779
+ params: toURLSearchParams(serializedData),
780
+ transformResponse: fromRes
781
+ };
782
+ return metadata;
783
+ }
784
+ __deleteTunnel.fromReq = fromReq;
785
+ __deleteTunnel.__isAmbassador = true;
786
+ return __deleteTunnel;
787
+ }
788
+
789
+ // ../cli-tunnel/src/schemas.ts
790
+ init_esm_shims();
791
+ var createTunnelSchema = z.object({
792
+ id: z.string(),
793
+ token: z.string(),
794
+ domain: z.string()
795
+ });
796
+
797
+ // ../cli-tunnel/src/client.ts
798
+ var TunnelClient = class {
799
+ constructor(httpClient) {
800
+ this.httpClient = httpClient;
801
+ const { minRetryTimeout } = getTestOverrides();
802
+ this.retryOptions = {
803
+ retries: 3,
804
+ minTimeout: minRetryTimeout,
805
+ maxTimeout: 3 * 1e3
806
+ };
807
+ }
808
+ retryOptions;
809
+ createTunnel = async ({ port }) => {
810
+ try {
811
+ const { data } = await pRetry(
812
+ () => this.httpClient.request(createTunnel({ port })),
813
+ this.retryOptions
814
+ );
815
+ return createTunnelSchema.parse(data);
816
+ } catch (error) {
817
+ throw new CliError({
818
+ code: CliErrorCode.FailedToCreateTunnel(),
819
+ cause: error
820
+ });
821
+ }
822
+ };
823
+ deleteTunnel = async (tunnelId) => {
824
+ try {
825
+ await pRetry(
826
+ () => this.httpClient.request(deleteTunnel({ id: tunnelId })),
827
+ this.retryOptions
828
+ );
829
+ } catch (error) {
830
+ throw new CliError({
831
+ code: CliErrorCode.FailedToDeleteTunnel(),
832
+ cause: error
833
+ });
834
+ }
835
+ };
836
+ };
837
+
838
+ // ../cli-tunnel/src/index.ts
839
+ init_esm_shims();
840
+
841
+ // ../cli-tunnel/src/useTunnel.ts
842
+ init_esm_shims();
843
+ var import_react2 = __toESM(require_react(), 1);
844
+
845
+ // ../cli-tunnel/src/bi/events.ts
846
+ init_esm_shims();
847
+ var wixCliTunnelBiEvents = (biLogger) => ({
848
+ tunnel: () => {
849
+ const startTimestamp = Date.now();
850
+ return {
851
+ finish: ({
852
+ isSuccess,
853
+ failureReason
854
+ }) => {
855
+ void biLogger.report(
856
+ wixCliAppsFlowTunnelCreationStatusSrc11Evid5233({
857
+ isSuccess,
858
+ failureReason,
859
+ tunnelCreationTime: Date.now() - startTimestamp
860
+ })
861
+ );
862
+ }
863
+ };
864
+ }
865
+ });
866
+
867
+ // ../cli-tunnel/src/useTunnelClient.ts
868
+ init_esm_shims();
869
+ var import_react = __toESM(require_react(), 1);
870
+ function useTunnelClient() {
871
+ const httpClient = useHttpClient({ type: "backoffice" });
872
+ return (0, import_react.useMemo)(() => new TunnelClient(httpClient), [httpClient]);
873
+ }
874
+
875
+ // ../cli-tunnel/src/useTunnel.ts
876
+ function useTunnel() {
877
+ const connectionRef = (0, import_react2.useRef)();
878
+ const tunnelClient = useTunnelClient();
879
+ const biLogger = useBiLogger();
880
+ (0, import_react2.useEffect)(() => {
881
+ return () => {
882
+ connectionRef.current?.close();
883
+ };
884
+ }, []);
885
+ return (0, import_react2.useCallback)(
886
+ async (port) => {
887
+ const biEvents = wixCliTunnelBiEvents(biLogger);
888
+ const tunnelCreationBi = biEvents.tunnel();
889
+ try {
890
+ const tunnel2 = await launchTunnel(port, tunnelClient);
891
+ connectionRef.current = tunnel2;
892
+ tunnelCreationBi.finish({ isSuccess: true });
893
+ return { url: tunnel2.domain };
894
+ } catch (ex) {
895
+ tunnelCreationBi.finish({
896
+ isSuccess: false,
897
+ failureReason: ex instanceof Error ? ex.message : "Unknown error"
898
+ });
899
+ throw ex;
900
+ }
901
+ },
902
+ [tunnelClient, biLogger]
903
+ );
904
+ }
905
+
906
+ export {
907
+ launchTunnel,
908
+ TunnelClient,
909
+ useTunnel
910
+ };
911
+ //# sourceMappingURL=chunk-GT3LT63J.js.map