cf 0.9.0 → 0.9.1

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 (183) hide show
  1. package/dist/{abuse-reports-DnNvw2gG.mjs → abuse-reports-CzDAjFpo.mjs} +1 -1
  2. package/dist/{access-RbqBFrSC.mjs → access-CxyW_sIW.mjs} +1 -1
  3. package/dist/{account-D7xvYqDx.mjs → account-Dd4-tDYJ.mjs} +1 -1
  4. package/dist/{account-tags-CKRh1jra.mjs → account-tags-65fAlHrf.mjs} +1 -1
  5. package/dist/{accounts-2pGhN4s8.mjs → accounts-Bp5KGc6r.mjs} +1 -1
  6. package/dist/{acm-Szq4CoQN.mjs → acm-CHacxa3s.mjs} +1 -1
  7. package/dist/{addressing-CgTTbuCF.mjs → addressing-BnqNmmYN.mjs} +1 -1
  8. package/dist/{agent-memory-C8pT01pR.mjs → agent-memory-D--BQS0W.mjs} +1 -1
  9. package/dist/{ai-Cn0BniR4.mjs → ai-BnVlQDiI.mjs} +1 -1
  10. package/dist/{ai-audit-CCygMmsh.mjs → ai-audit-CfpDKXkD.mjs} +1 -1
  11. package/dist/{ai-gateway-D4tATNRV.mjs → ai-gateway-oG4j_oYN.mjs} +1 -1
  12. package/dist/{ai-search-2xP8FP_W.mjs → ai-search-B2l3B_jn.mjs} +1 -1
  13. package/dist/{ai-security-AUfzagSE.mjs → ai-security-byjIIrfl.mjs} +1 -1
  14. package/dist/{alerting-DbXVpGv3.mjs → alerting-qa8SkXlD.mjs} +1 -1
  15. package/dist/{analytics-UQrIx99t.mjs → analytics-DeIKjC9n.mjs} +1 -1
  16. package/dist/{analytics_engine-B_bMbfxW.mjs → analytics_engine-BnECMIWJ.mjs} +1 -1
  17. package/dist/{api-security-pSJdgmtK.mjs → api-security-MfHbfZyf.mjs} +1 -1
  18. package/dist/{argo-Br60zF3y.mjs → argo-DFerMyXF.mjs} +1 -1
  19. package/dist/{artifacts-D8HMRQmb.mjs → artifacts-CtyEYYDa.mjs} +1 -1
  20. package/dist/{audit-logs-BIHP5-rk.mjs → audit-logs-retFtvow.mjs} +1 -1
  21. package/dist/{auth-C6MhC9EZ.mjs → auth-DuLchM18.mjs} +2 -2
  22. package/dist/{auth-MeSu8lFz.mjs → auth-aazs91XL.mjs} +1 -1
  23. package/dist/{billing-0RNCYBJM.mjs → billing-CxQVqpGZ.mjs} +1 -1
  24. package/dist/{bot-management-uhBRnSPl.mjs → bot-management-Rli7v7tg.mjs} +1 -1
  25. package/dist/{botnet-feed-DEbMknrE.mjs → botnet-feed-Cw6XSEf8.mjs} +1 -1
  26. package/dist/{brand-protection-DY2qPL8d.mjs → brand-protection-CTvnHGfV.mjs} +1 -1
  27. package/dist/{browser-extension-DBsmLCUj.mjs → browser-extension-q79xHrVW.mjs} +1 -1
  28. package/dist/{browser-run-C5pYOwtf.mjs → browser-run-FwtwnBzA.mjs} +1 -1
  29. package/dist/{build-Nivzj54_.mjs → build-Dji9BYmV.mjs} +1 -1
  30. package/dist/{cache-BgRIDcFJ.mjs → cache-Cl7vKJwH.mjs} +1 -1
  31. package/dist/{calls-JrRne0U0.mjs → calls-DtK_ANxq.mjs} +1 -1
  32. package/dist/{certificate-authorities-BJ7W8GGQ.mjs → certificate-authorities-DZP1RzAs.mjs} +1 -1
  33. package/dist/{cf-BUKsENG5.mjs → cf-oSz9pud_.mjs} +1 -1
  34. package/dist/{client-certificates-6xxvcOgI.mjs → client-certificates-BtPU9GsQ.mjs} +1 -1
  35. package/dist/{client-side-security-cU0Z1tql.mjs → client-side-security-DAn-3jwp.mjs} +1 -1
  36. package/dist/{cloud-connector-DFooSAcn.mjs → cloud-connector-BpVcvhjZ.mjs} +1 -1
  37. package/dist/{cloudforce-one-Cp4bQmrG.mjs → cloudforce-one-2PecncfX.mjs} +1 -1
  38. package/dist/{connector-interrupts-BR47snkh.mjs → connector-interrupts-ollUcksZ.mjs} +1 -1
  39. package/dist/{connector-telemetry-events-CTMmX2BA.mjs → connector-telemetry-events-D5_3X7XW.mjs} +1 -1
  40. package/dist/{connector-telemetry-snapshots-5Y7m8Cw8.mjs → connector-telemetry-snapshots-CJ9gLRFR.mjs} +1 -1
  41. package/dist/{connectors-BRCQSsos.mjs → connectors-Bo6ZT8PT.mjs} +1 -1
  42. package/dist/{containers-CfKOM_f5.mjs → containers-Bog7j0Hw.mjs} +1 -1
  43. package/dist/{content-scan-CB4xHGv1.mjs → content-scan-D03UfK2X.mjs} +1 -1
  44. package/dist/{csamScanner-AQo_QTlq.mjs → csamScanner-DgS-7ADh.mjs} +1 -1
  45. package/dist/{ct-alerting-Bai-1Z3k.mjs → ct-alerting-8AKtNnUg.mjs} +1 -1
  46. package/dist/{custom-certificates-D6aQIGu2.mjs → custom-certificates-4y35UC1X.mjs} +1 -1
  47. package/dist/{custom-csrs-D0zBkQT5.mjs → custom-csrs-DwBrLh-H.mjs} +1 -1
  48. package/dist/{custom-hostnames-BiOVGwnR.mjs → custom-hostnames-CDIAnsRa.mjs} +1 -1
  49. package/dist/{custom-nameservers-G2MWpRwY.mjs → custom-nameservers-stk7ymnP.mjs} +1 -1
  50. package/dist/{custom-pages-BINNZTds.mjs → custom-pages-vfDxrXbt.mjs} +1 -1
  51. package/dist/{d1-FmAh7T7l.mjs → d1-Cllm-iTT.mjs} +1 -1
  52. package/dist/{data-security-2fmzF_Me.mjs → data-security-rnoSCEdL.mjs} +1 -1
  53. package/dist/{dcv-delegation-Cmxxgi9V.mjs → dcv-delegation-DCRCOL6l.mjs} +1 -1
  54. package/dist/{deploy-BzFbjH6a.mjs → deploy-DGlmjPTS.mjs} +1 -1
  55. package/dist/{deploy-input-BRMQehgs.mjs → deploy-input-DhCo1I0I.mjs} +1 -1
  56. package/dist/{dev-CWaf-qW4.mjs → dev-BbLV0Ti-.mjs} +1 -1
  57. package/dist/{diagnostics-Ca6r_972.mjs → diagnostics-D5Yo2xqx.mjs} +1 -1
  58. package/dist/{directory-CGNWfVQc.mjs → directory-CCndFkbQ.mjs} +1 -1
  59. package/dist/{dispatch-namespaces-CBo5kuf7.mjs → dispatch-namespaces-C48JQ9EA.mjs} +1 -1
  60. package/dist/{dls-CobKlH4N.mjs → dls-BBq99pjI.mjs} +1 -1
  61. package/dist/{dns-OfJXNYkK.mjs → dns-DdQYtenF.mjs} +1 -1
  62. package/dist/{dns-firewall-DZ2ij-nX.mjs → dns-firewall-DdwVtm12.mjs} +1 -1
  63. package/dist/{durable-objects-Cw_y37WB.mjs → durable-objects-BvxXBht_.mjs} +1 -1
  64. package/dist/{email-auth-DuJHdiwN.mjs → email-auth-DFvXKSkg.mjs} +1 -1
  65. package/dist/{email-routing-CRvIUSFm.mjs → email-routing-QBRPBlyl.mjs} +1 -1
  66. package/dist/{email-security-D-P8ln2L.mjs → email-security-BFagcRPP.mjs} +1 -1
  67. package/dist/{email-sending-BwRN8PMW.mjs → email-sending-Ddhe7xjN.mjs} +1 -1
  68. package/dist/{filters-DczM8qpH.mjs → filters-CGisPGD1.mjs} +1 -1
  69. package/dist/{firewall-BMiETRmM.mjs → firewall-DD8U-Brd.mjs} +1 -1
  70. package/dist/{flagship-CPkQMist.mjs → flagship-FJHc4mFi.mjs} +1 -1
  71. package/dist/{fraud-BhX0QNUl.mjs → fraud-AH47n-wL.mjs} +1 -1
  72. package/dist/{google-tag-gateway-CDtRxao4.mjs → google-tag-gateway-149kbuG_.mjs} +1 -1
  73. package/dist/{healthchecks-D2WwALvQ.mjs → healthchecks-DfEUG007.mjs} +1 -1
  74. package/dist/{hostnames-CGAFkYT1.mjs → hostnames-DQUiD3Vr.mjs} +1 -1
  75. package/dist/{hyperdrive-zLFPWFQj.mjs → hyperdrive-RyQboMWI.mjs} +1 -1
  76. package/dist/{iam-Su_hpatD.mjs → iam-BhHYhMXO.mjs} +1 -1
  77. package/dist/{images-D2ZflvBi.mjs → images-CDViyKtZ.mjs} +1 -1
  78. package/dist/index.mjs +1 -1
  79. package/dist/{intel-DPGzVovJ.mjs → intel-YHZbPlS3.mjs} +1 -1
  80. package/dist/{interactive-CM2G03lr.mjs → interactive-mV8PABm6.mjs} +1 -1
  81. package/dist/{ips-C5-NH1b0.mjs → ips-BpCdldFx.mjs} +1 -1
  82. package/dist/{keyless-certificates-Xx-oAN3Z.mjs → keyless-certificates-oNu5jWKF.mjs} +1 -1
  83. package/dist/{keys-B0FBtlOD.mjs → keys-yYtv7Ztr.mjs} +1 -1
  84. package/dist/{kv-BbZ9st5o.mjs → kv-Bi9B4E0A.mjs} +1 -1
  85. package/dist/{leaked-credential-checks-Vonw4inx.mjs → leaked-credential-checks-DKRjBLcr.mjs} +1 -1
  86. package/dist/{load-balancers-Ct5cyyF9.mjs → load-balancers-jRCN75mX.mjs} +1 -1
  87. package/dist/{local-eEF0NF51.mjs → local-DTyuGwTw.mjs} +1 -1
  88. package/dist/{local-runtime-BNCCOZ8s.mjs → local-runtime-IAXhEugU.mjs} +1 -1
  89. package/dist/{logexplorer-BhsAWxCr.mjs → logexplorer-kO8CULiK.mjs} +1 -1
  90. package/dist/{logo-matches-oHYc8Xaz.mjs → logo-matches-LyDAYPbI.mjs} +1 -1
  91. package/dist/{logos-DS0krPAz.mjs → logos-O9f5bGSB.mjs} +1 -1
  92. package/dist/{logpush-CFQBi88z.mjs → logpush-dtXLu3Ck.mjs} +1 -1
  93. package/dist/{logs-C07M9zn-.mjs → logs-DmWWL5f9.mjs} +1 -1
  94. package/dist/{magic-cloud-networking-ZPEK7O5I.mjs → magic-cloud-networking-XbTa6P52.mjs} +1 -1
  95. package/dist/{magic-network-monitoring-CY3CHSpX.mjs → magic-network-monitoring-CpfkgZMp.mjs} +1 -1
  96. package/dist/{magic-transit-CgPZ8iMn.mjs → magic-transit-DwgZeIj-.mjs} +1 -1
  97. package/dist/{managed-transforms-2XyQ14s3.mjs → managed-transforms-DCmogkxv.mjs} +1 -1
  98. package/dist/{matches-CIaCrdrs.mjs → matches-BAeN8VM1.mjs} +1 -1
  99. package/dist/{mcp-D2afM8MD.mjs → mcp-DKZ2D050.mjs} +1 -1
  100. package/dist/{mesh-DLNLi3UT.mjs → mesh-CzIPtuaM.mjs} +1 -1
  101. package/dist/{moq-BBQVNGo1.mjs → moq-CJpE-eNj.mjs} +1 -1
  102. package/dist/{mtls-certificates-C5j0Gn65.mjs → mtls-certificates-Bbm_1lQI.mjs} +1 -1
  103. package/dist/{network-CmuJqtFJ.mjs → network-D2WRXCDe.mjs} +1 -1
  104. package/dist/{network-interconnects-BlajBQqs.mjs → network-interconnects-Clq4X1U8.mjs} +1 -1
  105. package/dist/{oauth-BjHjJtnn.mjs → oauth-BPizUUqP.mjs} +1 -1
  106. package/dist/{oauth-clients-BSthfZP-.mjs → oauth-clients-hilWfAlm.mjs} +1 -1
  107. package/dist/{oauth-scopes-ByUp5bLU.mjs → oauth-scopes-CmbgsPYd.mjs} +1 -1
  108. package/dist/{observability-B5p3iwrq.mjs → observability-DXYgDdU5.mjs} +1 -1
  109. package/dist/{organization-DQIfNVCT.mjs → organization-D41rIvJa.mjs} +1 -1
  110. package/dist/{organizations-L_ycAy6r.mjs → organizations-eNzfOwlP.mjs} +1 -1
  111. package/dist/{origin-ca-certificates-opIcs3_Q.mjs → origin-ca-certificates-DaiAmw45.mjs} +1 -1
  112. package/dist/{origin-post-quantum-encryption-TSMXzoEL.mjs → origin-post-quantum-encryption-7YztBged.mjs} +1 -1
  113. package/dist/{origin-tls-client-auth-5CtcPUR6.mjs → origin-tls-client-auth-DRwURM8s.mjs} +1 -1
  114. package/dist/{page-rules-DPd1Y3IL.mjs → page-rules-B2Csdc4h.mjs} +1 -1
  115. package/dist/{pages-CskAn5mR.mjs → pages-BAL6Q7OY.mjs} +1 -1
  116. package/dist/{pay-per-crawl-BMa_V40s.mjs → pay-per-crawl-C-1-ZAtn.mjs} +1 -1
  117. package/dist/{pipelines-BbJjj1ZQ.mjs → pipelines-cyQOuFLb.mjs} +1 -1
  118. package/dist/{precursor-DgRWBN9_.mjs → precursor-BrweY39h.mjs} +1 -1
  119. package/dist/{progress-C-oFUtvC.mjs → progress-B84wYh91.mjs} +1 -1
  120. package/dist/{prompt-DM4z101s.mjs → prompt-CDtLWxNv.mjs} +1 -1
  121. package/dist/{queries-DrqcK0ZX.mjs → queries-oM8uGZy5.mjs} +1 -1
  122. package/dist/{queues-CutvMZcc.mjs → queues-CTx04ZNw.mjs} +1 -1
  123. package/dist/{r2-sFI62vhq.mjs → r2-CnlIUn7R.mjs} +1 -1
  124. package/dist/{r2-data-catalog-3vzU6FE1.mjs → r2-data-catalog-DLtf9d6o.mjs} +1 -1
  125. package/dist/{radar-Cu9rsTw_.mjs → radar-CGNgGh8v.mjs} +1 -1
  126. package/dist/{rate-limits-HRZ8zMSl.mjs → rate-limits-B1YjnGue.mjs} +1 -1
  127. package/dist/{raw-fetch-25gXED6c.mjs → raw-fetch-Dz-QBoP_.mjs} +1 -1
  128. package/dist/{realtimekit-msnGHBbf.mjs → realtimekit-BPwzhNS9.mjs} +1 -1
  129. package/dist/{registrar-C0EsXf83.mjs → registrar-BEcb90RX.mjs} +1 -1
  130. package/dist/{registrar-sandbox-CR9Rr7jV.mjs → registrar-sandbox-0i1T3zne.mjs} +1 -1
  131. package/dist/{registry-CJvn75Bq.mjs → registry-DDcSvd8H.mjs} +1 -1
  132. package/dist/{reporting-BB6sqe6r.mjs → reporting-CLbjHlnw.mjs} +1 -1
  133. package/dist/{request-tracers-BrsM3zXZ.mjs → request-tracers-BcKpofP1.mjs} +1 -1
  134. package/dist/{resource-sharing-CusU3kiy.mjs → resource-sharing-Ctdi9D-j.mjs} +1 -1
  135. package/dist/{resource-tagging-wXAcblmz.mjs → resource-tagging-DGEyVTDN.mjs} +1 -1
  136. package/dist/{rules-C2BxykEe.mjs → rules-CmuB5rIN.mjs} +1 -1
  137. package/dist/{rulesets-BHvhAeG_.mjs → rulesets-CGaMq8vG.mjs} +1 -1
  138. package/dist/{rum-Dyno5zj3.mjs → rum-QT6EP4JK.mjs} +1 -1
  139. package/dist/{schema-flags-C1BRprT2.mjs → schema-flags-DHryz6SF.mjs} +1 -1
  140. package/dist/{scim-Bb2xHpIz.mjs → scim-BgGsmHrL.mjs} +1 -1
  141. package/dist/{secrets-store-BMhjbceW.mjs → secrets-store-BCpFhYFv.mjs} +1 -1
  142. package/dist/{security-center-DRC4Mf3R.mjs → security-center-BNm4uPVB.mjs} +1 -1
  143. package/dist/{security-txt-Bh_2gymk.mjs → security-txt-Be2Bif0z.mjs} +1 -1
  144. package/dist/{session-Br-q_UIW.mjs → session-Ckt20hHa.mjs} +1 -1
  145. package/dist/{share-DfTpOxhk.mjs → share-Bz2tFTUP.mjs} +1 -1
  146. package/dist/{shared-BNjZc02w.mjs → shared-BzPQog8H.mjs} +1 -1
  147. package/dist/{smart-shield-rHn-Lckq.mjs → smart-shield-SODkOUyO.mjs} +1 -1
  148. package/dist/{snippets-nSLwH8uJ.mjs → snippets-B5jY8v_7.mjs} +1 -1
  149. package/dist/{spawn-Bj8QRFJ5.mjs → spawn-CHkoow5W.mjs} +1 -1
  150. package/dist/{spectrum-DuhSUTZI.mjs → spectrum-BA0a42eM.mjs} +1 -1
  151. package/dist/{speed-Dgby_e1J.mjs → speed-mmOjxOzo.mjs} +1 -1
  152. package/dist/{src-CgAVPA4I.mjs → src-CHW7s5IS.mjs} +4 -4
  153. package/dist/{ssl-BsxTHasY.mjs → ssl-Yr6kELqg.mjs} +1 -1
  154. package/dist/{state-C1m9nwUm.mjs → state-DZC531l2.mjs} +1 -1
  155. package/dist/{stream-CkEOX5Ko.mjs → stream-Cu0kYWbc.mjs} +1 -1
  156. package/dist/{submit-BjdywxTq.mjs → submit-Dl_27e0n.mjs} +1 -1
  157. package/dist/{tags-CFAw_Sce.mjs → tags-Cdo_Pwtr.mjs} +1 -1
  158. package/dist/{tenant-C66iOy5O.mjs → tenant-EX-ANl6X.mjs} +1 -1
  159. package/dist/{tenant-custom-nameservers-CyJZ_AB0.mjs → tenant-custom-nameservers-BPHUeckw.mjs} +1 -1
  160. package/dist/{triggers-Dv22ZXM4.mjs → triggers-Bf9hbP3h.mjs} +1 -1
  161. package/dist/{tunnel-BatkLdds.mjs → tunnel-CDYkWjnt.mjs} +1 -1
  162. package/dist/{tunnels-CstoXOoq.mjs → tunnels-CgyX8R2J.mjs} +1 -1
  163. package/dist/{turnstile-IoRtama4.mjs → turnstile-BUtzlW-0.mjs} +1 -1
  164. package/dist/{ui-DjQ4AQww.mjs → ui-DIpjthrV.mjs} +1 -1
  165. package/dist/{url-info-Hjhwr2la.mjs → url-info-CJsa1Oc9.mjs} +1 -1
  166. package/dist/{url-normalization-C2BP_Kl0.mjs → url-normalization-BeKkOZz7.mjs} +1 -1
  167. package/dist/{url-scanner-DmYVTdAE.mjs → url-scanner-Cz-yl0_3.mjs} +1 -1
  168. package/dist/{user-CVHm-cnB.mjs → user-BxHjEqpd.mjs} +1 -1
  169. package/dist/{values-Cmlw5wGZ.mjs → values-C43NurfT.mjs} +1 -1
  170. package/dist/{vectorize-BQtIqiNO.mjs → vectorize-CjXfiFH4.mjs} +1 -1
  171. package/dist/{versions-CU6Av1vh.mjs → versions-BFbc90Wu.mjs} +1 -1
  172. package/dist/{waiting-rooms-ku9UsAr9.mjs → waiting-rooms-C5jSQv_r.mjs} +1 -1
  173. package/dist/{web-assets-DmSKaxzf.mjs → web-assets-BzM5vVzy.mjs} +1 -1
  174. package/dist/{web3-DVv4jNul.mjs → web3-Ctv9HGiR.mjs} +1 -1
  175. package/dist/{workers-D8czeT64.mjs → workers-D-YbIedB.mjs} +1 -1
  176. package/dist/{workers-builds-DgrejrUc.mjs → workers-builds-B44wc67O.mjs} +1 -1
  177. package/dist/{workflows-BOi5MTEN.mjs → workflows-rFuQWClt.mjs} +1 -1
  178. package/dist/{zaraz-CGSSFJng.mjs → zaraz-BA6kY-b6.mjs} +1 -1
  179. package/dist/{zero-trust-BmA0VkgF.mjs → zero-trust-DOFLlUz1.mjs} +1 -1
  180. package/dist/{zone-Bx5ElO9U.mjs → zone-B_rgejLV.mjs} +1 -1
  181. package/dist/{zone-tags-izd3WWmy.mjs → zone-tags-BWdza4rH.mjs} +1 -1
  182. package/dist/{zones-_SnlZMiM.mjs → zones-DTWO7Vvn.mjs} +1 -1
  183. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{i as e,r as t,t as n}from"./chunk-vbHwaUoU.mjs";import{i as r}from"./session-Br-q_UIW.mjs";import{A as i,B as a,Dt as o,E as s,Et as c,F as l,G as u,H as d,J as f,K as p,L as m,M as h,N as g,O as _,Ot as v,P as y,Q as b,St as x,T as S,Tt as C,X as w,Y as T,Z as E,_ as D,_t as O,at as k,b as A,bt as ee,ct as te,dt as ne,ft as j,gt as re,ht as ie,it as ae,j as oe,k as M,kt as N,mt as P,nt as se,pt as ce,rt as le,st as ue,ut as de,vt as fe,wt as pe,xt as me,yt as he}from"./chunk-LQW53VED-Xakf_rUn.mjs";import{c as ge}from"./interactive-CM2G03lr.mjs";import{r as _e}from"./build-Nivzj54_.mjs";import{C as ve,S as ye,T as be,_ as xe,b as Se,c as Ce,d as we,f as Te,g as Ee,h as De,l as Oe,m as ke,o as Ae,p as je,s as Me,u as Ne,v as Pe,w as Fe,x as Ie,y as Le}from"./spawn-Bj8QRFJ5.mjs";import{createRequire as Re}from"node:module";import{createReadStream as ze,existsSync as Be,mkdirSync as Ve,readFileSync as He,statSync as Ue,writeFileSync as We}from"node:fs";import Ge from"node:assert";import*as Ke from"node:path";import qe,{dirname as Je,extname as Ye,isAbsolute as Xe,join as Ze,resolve as Qe,sep as $e}from"node:path";import{execSync as et,spawn as tt,spawnSync as nt}from"node:child_process";import{createHash as rt}from"node:crypto";import{Blob as it}from"node:buffer";import{gzipSync as at}from"node:zlib";import ot,{URLSearchParams as st}from"node:url";import{access as ct,readFile as lt,readdir as ut,stat as dt,writeFile as ft}from"node:fs/promises";import pt from"node:readline";import{hash as mt}from"blake3-wasm";import{getFreshSourceMapSupport as ht,getNodeCompat as gt}from"miniflare";var _t=Object.create,vt=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyNames,xt=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty,F=(e,t)=>vt(e,`name`,{value:t,configurable:!0}),Ct=t===void 0?Re(import.meta.url):t,wt=(e,t)=>function(){return t||(0,e[bt(e)[0]])((t={exports:{}}).exports,t),t.exports},Tt=(e,t)=>{for(var n in t)vt(e,n,{get:t[n],enumerable:!0})},Et=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of bt(t))!St.call(e,i)&&i!==n&&vt(e,i,{get:()=>t[i],enumerable:!(r=yt(t,i))||r.enumerable});return e},Dt=(e,t,n)=>(n=e==null?{}:_t(xt(e)),Et(t||!e||!e.__esModule?vt(n,`default`,{value:e,enumerable:!0}):n,e)),I,L,Ot,kt,At,jt,Mt;function Nt(e){I=e.logger,L=e.fetchResult,Ot=e.fetchListResult,kt=e.fetchPagedListResult,e.fetchKVGetValue,At=e.confirm,jt=e.prompt,Mt=e.select}F(Nt,`initDeployHelpersContext`);var Pt=n(((e,n)=>{var r=t(`child_process`).exec,i=t(`child_process`).execSync,a=t(`fs`),o=t(`path`),s=a.access,c=a.accessSync,l=a.constants||a,u=process.platform==`win32`,d=function(e,t){s(e,l.F_OK,function(e){t(!e)})},f=function(e){try{return c(e,l.F_OK),!1}catch{return!0}},p=function(e,t){s(e,l.F_OK|l.X_OK,function(e){t(null,!e)})},m=function(e){try{return c(e,l.F_OK|l.X_OK),!0}catch{return!1}},h=function(e,t,n){d(e,function(i){if(!i){r(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`,function(e,t,r){n(null,!!t)});return}p(e,n)})},g=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e)){n(null,!1);return}r(`where `+t,function(e){e===null?n(null,!0):n(null,!1)})},_=function(e,t){if(f(e))try{return!!i(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`)}catch{return!1}return m(e)},v=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))return!1;try{return!!i(`where `+t,{stdio:[]})}catch{return!1}},y=function(e){return/[^A-Za-z0-9_\/:=-]/.test(e)&&(e=`'`+e.replace(/'/g,`'\\''`)+`'`,e=e.replace(/^(?:'')+/g,``).replace(/\\'''/g,`\\'`)),e};u&&(y=function(e){if(/[\\]/.test(e)){var t=`"`+o.dirname(e)+`"`,n=`"`+o.basename(e)+`"`;return t+`:`+n}return`"`+e+`"`}),n.exports=function e(t,n){var r=y(t);if(!n&&typeof Promise<`u`)return new Promise(function(n,r){e(t,function(e,i){i?n(t):r(e)})});u?g(t,r,n):h(t,r,n)},n.exports.sync=function(e){var t=y(e);return u?v(e,t):_(e,t)}})),Ft=n(((e,t)=>{t.exports=Pt()})),It=T(),Lt=Ft();function Rt(e){if(e.compiled_schema)return He(Qe(e.compiled_schema));let{base_path:t,source_schemas:n}=e,r=(n??[]).map(e=>Qe(t,e));if(!(0,Lt.sync)(`capnp`))throw new N(`The capnp compiler is required to upload capnp schemas, but is not present.`,{telemetryMessage:`capnp compiler missing`});let i=nt(`capnp`,[`compile`,`-o-`,`--src-prefix=${Qe(t??`.`)}`,...r],{maxBuffer:3*1024*1024});if(i.error)throw i.error;if(i.stderr.length)throw Error(i.stderr.toString());return i.stdout}F(Rt,`handleUnsafeCapnp`);var zt={esm:`application/javascript+module`,commonjs:`application/javascript`,"compiled-wasm":`application/wasm`,buffer:`application/octet-stream`,text:`text/plain`,python:`text/x-python`,"python-requirement":`text/x-python-requirement`};function Bt(e){let t=zt[e];if(t===void 0)throw TypeError(`Unsupported module: `+e);return t}F(Bt,`toMimeType`);function Vt(e){let t=Object.keys(zt).find(t=>zt[t]===e);if(t===void 0)throw TypeError(`Unsupported mime type: `+e);return t}F(Vt,`fromMimeType`);function Ht(e,t,n){let r=new It.FormData,{main:i,sourceMaps:a,migrations:o,exports:c,compatibility_date:l,compatibility_flags:u,keepVars:f,keepSecrets:p,keepBindings:m,logpush:h,placement:g,tail_consumers:_,streaming_tail_consumers:v,limits:y,annotations:b,keep_assets:x,assets:S,observability:C,cache:w,package_dependencies:T}=e,E={html_handling:S?.assetConfig?.html_handling,not_found_handling:S?.assetConfig?.not_found_handling,run_worker_first:S?.run_worker_first,_redirects:S?._redirects,_headers:S?._headers};if(S&&!S.routerConfig.has_user_worker)return r.set(`metadata`,JSON.stringify({assets:{jwt:S.jwt,config:E},...b&&{annotations:b},...l&&{compatibility_date:l},...u&&{compatibility_flags:u}})),r;let{modules:D}=e,O=[],k=s(`plain_text`,t),A=s(`json`,t),ee=s(`secret_text`,t),te=s(`kv_namespace`,t),ne=s(`send_email`,t),j=s(`durable_object_namespace`,t),re=s(`workflow`,t),ie=s(`queue`,t),ae=s(`r2_bucket`,t),oe=s(`d1`,t),M=s(`vectorize`,t),se=s(`ai_search_namespace`,t),ce=s(`ai_search`,t),le=s(`websearch`,t)[0],ue=s(`agent_memory`,t),de=s(`hyperdrive`,t),fe=s(`secrets_store_secret`,t),pe=s(`artifacts`,t),me=s(`unsafe_hello_world`,t),he=s(`flagship`,t),ge=s(`ratelimit`,t),_e=s(`vpc_service`,t),ve=s(`vpc_network`,t),ye=s(`service`,t),be=s(`analytics_engine`,t),xe=s(`dispatch_namespace`,t),Se=s(`mtls_certificate`,t),Ce=s(`pipeline`,t),we=s(`worker_loader`,t),Te=s(`logfwdr`,t),Ee=s(`wasm_module`,t),De=s(`browser`,t)[0],Oe=s(`ai`,t)[0],ke=s(`images`,t)[0],Ae=s(`stream`,t)[0],je=s(`media`,t)[0],Me=s(`version_metadata`,t)[0],Ne=s(`assets`,t)[0],Pe=s(`text_blob`,t),Fe=s(`data_blob`,t);s(`inherit`,t).forEach(({binding:e})=>{O.push({name:e,type:`inherit`})}),k.forEach(({binding:e,value:t})=>{O.push({name:e,type:`plain_text`,text:t})}),A.forEach(({binding:e,value:t})=>{O.push({name:e,type:`json`,json:t})}),ee.forEach(({binding:e,value:t})=>{O.push({name:e,type:`secret_text`,text:t})}),te.forEach(({id:e,binding:t,raw:r})=>{if(n?.dryRun&&(e??=P),e===void 0)throw new N(`${t} bindings must have an "id" field`,{telemetryMessage:`kv namespace binding missing id`});e===P?O.push({name:t,type:`inherit`}):O.push({name:t,type:`kv_namespace`,namespace_id:e,raw:r})}),ne.forEach(e=>{let t={name:e.name,type:`send_email`,allowed_sender_addresses:e.allowed_sender_addresses};e.destination_address===void 0?e.allowed_destination_addresses===void 0?O.push(t):O.push({...t,allowed_destination_addresses:e.allowed_destination_addresses}):O.push({...t,destination_address:e.destination_address})}),j.forEach(({name:e,class_name:t,script_name:n,environment:r})=>{O.push({name:e,type:`durable_object_namespace`,class_name:t,...n&&{script_name:n},...r&&{environment:r}})}),re.forEach(({binding:e,name:t,class_name:n,script_name:r,raw:i})=>{O.push({type:`workflow`,name:e,workflow_name:t,class_name:n,script_name:r,raw:i})}),ie.forEach(({binding:e,queue_name:t,delivery_delay:r,raw:i})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "queue" field. Add a "queue" field to the producer in your Worker configuration specifying the name of the Queue to bind to.`,{telemetryMessage:`queue binding missing name`});t===P?O.push({name:e,type:`inherit`}):O.push({type:`queue`,name:e,queue_name:t,delivery_delay:r,raw:i})}),ae.forEach(({binding:e,bucket_name:t,jurisdiction:r,raw:i})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "bucket_name" field. Add a "bucket_name" field to the binding in your Worker configuration specifying the name of the R2 bucket to bind to.`,{telemetryMessage:`r2 bucket binding missing bucket_name`});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`r2_bucket`,bucket_name:t,jurisdiction:r,raw:i})}),oe.forEach(({binding:e,database_id:t,database_internal_env:r,raw:i})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "database_id" field. Add a "database_id" field to the binding in your Worker configuration specifying the ID of the D1 database to bind to.`,{telemetryMessage:`d1 database binding missing database_id`});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`d1`,id:t,internalEnv:r,raw:i})}),M.forEach(({binding:e,index_name:t,raw:n})=>{O.push({name:e,type:`vectorize`,index_name:t,raw:n})}),se.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the AI Search namespace to bind to.`,{telemetryMessage:`ai search namespace binding missing namespace`});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`ai_search_namespace`,namespace:t})}),ce.forEach(({binding:e,instance_name:t})=>{O.push({name:e,type:`ai_search`,instance_name:t})}),le!==void 0&&O.push({name:le.binding,type:`websearch`}),ue.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the namespace to bind to.`,{telemetryMessage:!1});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`agent_memory`,namespace:t})}),de.forEach(({binding:e,id:t})=>{O.push({name:e,type:`hyperdrive`,id:t})}),fe.forEach(({binding:e,store_id:t,secret_name:n})=>{O.push({name:e,type:`secrets_store_secret`,store_id:t,secret_name:n})}),pe.forEach(({binding:e,namespace:t})=>{O.push({name:e,type:`artifacts`,namespace:t})}),me.forEach(({binding:e,enable_timer:t})=>{O.push({name:e,type:`unsafe_hello_world`,enable_timer:t})}),he.forEach(({binding:e,app_id:t})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have an "app_id" field. Add an "app_id" field to the binding in your Worker configuration specifying the Flagship app to bind to.`,{telemetryMessage:`flagship binding missing app id`});O.push(t===P?{name:e,type:`inherit`}:{name:e,type:`flagship`,app_id:t})}),ge.forEach(({name:e,namespace_id:t,simple:n})=>{O.push({name:e,type:`ratelimit`,namespace_id:t,simple:n})}),_e.forEach(({binding:e,service_id:t})=>{O.push({name:e,type:`vpc_service`,service_id:t})}),ve.forEach(({binding:e,tunnel_id:t,network_id:n})=>{O.push({name:e,type:`vpc_network`,...t===void 0?{network_id:n}:{tunnel_id:t}})}),ye.forEach(({binding:e,service:t,environment:n,entrypoint:r,props:i,cross_account_grant:a})=>{O.push({name:e,type:`service`,service:t,cross_account_grant:a,...n&&{environment:n},...r&&{entrypoint:r},...i&&{props:i}})}),be.forEach(({binding:e,dataset:t})=>{O.push({name:e,type:`analytics_engine`,dataset:t})}),xe.forEach(({binding:e,namespace:t,outbound:r})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the dispatch namespace to bind to.`,{telemetryMessage:`dispatch namespace binding missing namespace`});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`dispatch_namespace`,namespace:t,...r&&{outbound:{worker:{service:r.service,environment:r.environment},params:r.parameters?.map(e=>({name:e}))}}})}),Se.forEach(({binding:e,certificate_id:t})=>{O.push({name:e,type:`mtls_certificate`,certificate_id:t})}),Ce.forEach(({binding:e,stream:t,pipeline:n})=>{if(t)O.push({name:e,type:`pipelines`,stream:t});else if(n)O.push({name:e,type:`pipelines`,pipeline:n});else throw Error(`Pipeline binding must specify a stream or pipeline`)}),we.forEach(({binding:e})=>{O.push({name:e,type:`worker_loader`})}),Te.forEach(({name:e,destination:t})=>{O.push({name:e,type:`logfwdr`,destination:t})}),Ee.forEach(({binding:e,source:t})=>{O.push({name:e,type:`wasm_module`,part:e}),r.set(e,new File([`contents`in t?t.contents:He(t.path)],`path`in t?t.path??e:e,{type:`application/wasm`}))}),De!==void 0&&O.push({name:De.binding,type:`browser`,raw:De.raw}),Oe!==void 0&&O.push({name:Oe.binding,staging:Oe.staging,type:`ai`,raw:Oe.raw}),ke!==void 0&&O.push({name:ke.binding,type:`images`,raw:ke.raw}),Ae!==void 0&&O.push({name:Ae.binding,type:`stream`}),je!==void 0&&O.push({name:je.binding,type:`media`}),Me!==void 0&&O.push({name:Me.binding,type:`version_metadata`}),Ne!==void 0&&O.push({name:Ne.binding,type:`assets`}),Pe.forEach(({binding:e,source:t})=>{O.push({name:e,type:`text_blob`,part:e}),e!==`__STATIC_CONTENT_MANIFEST`&&(`contents`in t?r.set(e,new File([t.contents],t.path??e,{type:`text/plain`})):r.set(e,new File([He(t.path)],t.path,{type:`text/plain`})))}),Fe.forEach(({binding:e,source:t})=>{O.push({name:e,type:`data_blob`,part:e}),r.set(e,new File([`contents`in t?t.contents:He(t.path)],`path`in t?t.path??e:e,{type:`application/octet-stream`}))});for(let[e,n]of Object.entries(t??{}))if(d(n.type)&&n.type!==`unsafe_hello_world`){let{type:t,...r}=n;O.push({name:e,type:t.slice(7),...r})}let Ie=`__STATIC_CONTENT_MANIFEST`;if(D?.some(({name:e})=>e===Ie)&&i.type===`esm`){Ge(D!==void 0);let e=new Set(D.map(e=>qe.posix.dirname(e.name)));for(let t of e){if(t===`.`)continue;let e=qe.posix.relative(t,Ie),n=qe.posix.join(t,Ie);D.push({name:n,filePath:n,content:`export { default } from ${JSON.stringify(e)};`,type:`esm`})}}if(i.type===`commonjs`){for(let e of Object.values([...D||[]]))if(e.name===`__STATIC_CONTENT_MANIFEST`)r.set(e.name,new File([e.content],e.name,{type:`text/plain`})),D=D?.filter(t=>t!==e);else if(e.type===`compiled-wasm`||e.type===`text`||e.type===`buffer`){let t=e.name.replace(/[^a-zA-Z0-9_$]/g,`_`);O.push({name:t,type:e.type===`compiled-wasm`?`wasm_module`:e.type===`text`?`text_blob`:`data_blob`,part:t}),r.set(t,new File([e.content],e.name,{type:e.type===`compiled-wasm`?`application/wasm`:e.type===`text`?`text/plain`:`application/octet-stream`})),D=D?.filter(t=>t!==e)}}let Le;if(n?.unsafe?.capnp){let e=Rt(n.unsafe.capnp);Le=`./capnp-${Date.now()}.compiled`,r.set(Le,new File([e],Le,{type:`application/octet-stream`}))}let Re;f&&(Re??=[],Re.push(`plain_text`,`json`)),p&&(Re??=[],Re.push(`secret_text`,`secret_key`)),m&&(Re??=[],Re.push(...m));let ze={...i.type===`commonjs`?{body_part:i.name}:{main_module:i.name},bindings:O,containers:e.containers===void 0?void 0:e.containers.map(e=>({...e.name!==void 0&&{name:e.name},...e.class_name!==void 0&&{class_name:e.class_name}})),...l&&{compatibility_date:l},...u&&{compatibility_flags:u},...o&&{migrations:o},...c&&Object.keys(c).length>0&&{exports:c},capnp_schema:Le,...Re&&{keep_bindings:Re},...h!==void 0&&{logpush:h},...g&&{placement:g},..._&&{tail_consumers:_},...v&&{streaming_tail_consumers:v},...y&&{limits:y},...b&&{annotations:b},...x!==void 0&&{keep_assets:x},...S&&{assets:{jwt:S.jwt,config:E}},...C&&{observability:C},...w&&{cache_options:w},...T?.length&&{package_dependencies:T}};if(n?.unsafe?.metadata!==void 0)for(let e of Object.keys(n.unsafe.metadata))ze[e]=n.unsafe.metadata[e];if(r.set(`metadata`,JSON.stringify(ze)),i.type===`commonjs`&&D&&D.length>0)throw TypeError(`More than one module can only be specified when type = 'esm'`);for(let e of[i].concat(D||[]))r.set(e.name,new File([e.content],e.name,{type:Bt(e.type??i.type??`esm`)}));for(let e of a||[])r.set(e.name,new File([e.content],e.name,{type:`application/source-map`}));return r}F(Ht,`createWorkerUploadForm`);var Ut=e(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1),Wt=class e extends Error{name=`TimeoutError`;constructor(t,n){super(t,n),Error.captureStackTrace?.(this,e)}};const Gt=e=>e.reason??new DOMException(`This operation was aborted.`,`AbortError`);function Kt(e,t){let{milliseconds:n,fallback:r,message:i,customTimers:a={setTimeout,clearTimeout},signal:o}=t,s,c,l=new Promise((t,l)=>{if(typeof n!=`number`||Math.sign(n)!==1)throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(o?.aborted){l(Gt(o));return}if(o&&(c=()=>{l(Gt(o))},o.addEventListener(`abort`,c,{once:!0})),e.then(t,l),n===1/0)return;let u=new Wt;s=a.setTimeout.call(void 0,()=>{if(r){try{t(r())}catch(e){l(e)}return}typeof e.cancel==`function`&&e.cancel(),i===!1?t():i instanceof Error?l(i):(u.message=i??`Promise timed out after ${n} milliseconds`,l(u))},n)}).finally(()=>{l.clear(),c&&o&&o.removeEventListener(`abort`,c)});return l.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},l}function qt(e,t,n){let r=0,i=e.length;for(;i>0;){let a=Math.trunc(i/2),o=r+a;n(e[o],t)<=0?(r=++o,i-=a+1):i=a}return r}var Jt=class{#e=[];enqueue(e,t){let{priority:n=0,id:r}=t??{},i={priority:n,id:r,run:e};if(this.size===0||this.#e[this.size-1].priority>=n){this.#e.push(i);return}let a=qt(this.#e,i,(e,t)=>t.priority-e.priority);this.#e.splice(a,0,i)}setPriority(e,t){let n=this.#e.findIndex(t=>t.id===e);if(n===-1)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#e.splice(n,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#e.length}},Yt=class extends Ut.default{#e;#t;#n=0;#r;#i=!1;#a=!1;#o;#s=0;#c=0;#l;#u;#d;#f;#p=0;#m;#h;#g=1n;#_=new Map;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Jt,...e},!(typeof e.intervalCap==`number`&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??``}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??``}\` (${typeof e.interval})`);if(this.#e=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#t=e.intervalCap===1/0||e.interval===0,this.#r=e.intervalCap,this.#o=e.interval,this.#d=new e.queueClass,this.#f=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#h=e.autoStart===!1,this.#M()}get#v(){return this.#t||this.#n<this.#r}get#y(){return this.#p<this.#m}#b(){this.#p--,this.#p===0&&this.emit(`pendingZero`),this.#E(),this.emit(`next`)}#x(){this.#O(),this.#D(),this.#u=void 0}get#S(){let e=Date.now();if(this.#l===void 0){let t=this.#s-e;if(t<0){if(this.#c>0){let t=e-this.#c;if(t<this.#o)return this.#C(this.#o-t),!0}this.#n=this.#e?this.#p:0}else return this.#C(t),!0}return!1}#C(e){this.#u===void 0&&(this.#u=setTimeout(()=>{this.#x()},e))}#w(){this.#l&&=(clearInterval(this.#l),void 0)}#T(){this.#u&&=(clearTimeout(this.#u),void 0)}#E(){if(this.#d.size===0)return this.#w(),this.emit(`empty`),this.#p===0&&(this.#T(),this.emit(`idle`)),!1;let e=!1;if(!this.#h){let t=!this.#S;if(this.#v&&this.#y){let n=this.#d.dequeue();this.#t||(this.#n++,this.#N()),this.emit(`active`),this.#c=Date.now(),n(),t&&this.#D(),e=!0}}return e}#D(){this.#t||this.#l!==void 0||(this.#l=setInterval(()=>{this.#O()},this.#o),this.#s=Date.now()+this.#o)}#O(){this.#n===0&&this.#p===0&&this.#l&&this.#w(),this.#n=this.#e?this.#p:0,this.#k(),this.#N()}#k(){for(;this.#E(););}get concurrency(){return this.#m}set concurrency(e){if(!(typeof e==`number`&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#m=e,this.#k()}async#A(e){return new Promise((t,n)=>{e.addEventListener(`abort`,()=>{n(e.reason)},{once:!0})})}setPriority(e,t){if(typeof t!=`number`||!Number.isFinite(t))throw TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#d.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#g++).toString(),t={timeout:this.timeout,...t},new Promise((n,r)=>{let i=Symbol(`task-${t.id}`);this.#d.enqueue(async()=>{this.#p++,this.#_.set(i,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});try{try{t.signal?.throwIfAborted()}catch(e){throw this.#t||this.#n--,this.#_.delete(i),e}let r=e({signal:t.signal});t.timeout&&(r=Kt(Promise.resolve(r),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#p} running, ${this.#d.size} waiting)`})),t.signal&&(r=Promise.race([r,this.#A(t.signal)]));let a=await r;n(a),this.emit(`completed`,a)}catch(e){r(e),this.emit(`error`,e)}finally{this.#_.delete(i),queueMicrotask(()=>{this.#b()})}},t),this.emit(`add`),this.#E()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#h?(this.#h=!1,this.#k(),this):this}pause(){this.#h=!0}clear(){this.#d=new this.#f,this.#P()}async onEmpty(){this.#d.size!==0&&await this.#j(`empty`)}async onSizeLessThan(e){this.#d.size<e||await this.#j(`next`,()=>this.#d.size<e)}async onIdle(){this.#p===0&&this.#d.size===0||await this.#j(`idle`)}async onPendingZero(){this.#p!==0&&await this.#j(`pendingZero`)}async onRateLimit(){this.isRateLimited||await this.#j(`rateLimit`)}async onRateLimitCleared(){this.isRateLimited&&await this.#j(`rateLimitCleared`)}async onError(){return new Promise((e,t)=>{let n=e=>{this.off(`error`,n),t(e)};this.on(`error`,n)})}async#j(e,t){return new Promise(n=>{let r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)})}get size(){return this.#d.size}sizeBy(e){return this.#d.filter(e).length}get pending(){return this.#p}get isPaused(){return this.#h}#M(){this.#t||(this.on(`add`,()=>{this.#d.size>0&&this.#N()}),this.on(`next`,()=>{this.#N()}))}#N(){this.#t||this.#a||(this.#a=!0,queueMicrotask(()=>{this.#a=!1,this.#P()}))}#P(){let e=this.#i,t=!this.#t&&this.#n>=this.#r&&this.#d.size>0;t!==e&&(this.#i=t,this.emit(t?`rateLimit`:`rateLimitCleared`))}get isRateLimited(){return this.#i}get isSaturated(){return this.#p===this.#m&&this.#d.size>0||this.isRateLimited&&this.#d.size>0}get runningTasks(){return[...this.#_.values()].map(e=>({...e}))}};const Xt=[`B`,`kB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],Zt=[`B`,`KiB`,`MiB`,`GiB`,`TiB`,`PiB`,`EiB`,`ZiB`,`YiB`],Qt=[`b`,`kbit`,`Mbit`,`Gbit`,`Tbit`,`Pbit`,`Ebit`,`Zbit`,`Ybit`],$t=[`b`,`kibit`,`Mibit`,`Gibit`,`Tibit`,`Pibit`,`Eibit`,`Zibit`,`Yibit`],en=(e,t,n)=>{let r=e;return typeof t==`string`||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function tn(e,t){if(!Number.isFinite(e))throw TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};let n=t.bits?t.binary?$t:Qt:t.binary?Zt:Xt,r=t.space?` `:``;if(t.signed&&e===0)return` 0${r}${n[0]}`;let i=e<0,a=i?`-`:t.signed?`+`:``;i&&(e=-e);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1)return a+en(e,t.locale,o)+r+n[0];let s=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**s,o||(e=e.toPrecision(3));let c=en(Number(e),t.locale,o),l=n[s];return a+c+r+l}var nn=n(((e,t)=>{t.exports={name:`dotenv`,version:`16.3.1`,description:`Loads environment variables from .env file`,main:`lib/main.js`,types:`lib/main.d.ts`,exports:{".":{types:`./lib/main.d.ts`,require:`./lib/main.js`,default:`./lib/main.js`},"./config":`./config.js`,"./config.js":`./config.js`,"./lib/env-options":`./lib/env-options.js`,"./lib/env-options.js":`./lib/env-options.js`,"./lib/cli-options":`./lib/cli-options.js`,"./lib/cli-options.js":`./lib/cli-options.js`,"./package.json":`./package.json`},scripts:{"dts-check":`tsc --project tests/types/tsconfig.json`,lint:`standard`,"lint-readme":`standard-markdown`,pretest:`npm run lint && npm run dts-check`,test:`tap tests/*.js --100 -Rspec`,prerelease:`npm test`,release:`standard-version`},repository:{type:`git`,url:`git://github.com/motdotla/dotenv.git`},funding:`https://github.com/motdotla/dotenv?sponsor=1`,keywords:[`dotenv`,`env`,`.env`,`environment`,`variables`,`config`,`settings`],readmeFilename:`README.md`,license:`BSD-2-Clause`,devDependencies:{"@definitelytyped/dtslint":`^0.0.133`,"@types/node":`^18.11.3`,decache:`^4.6.1`,sinon:`^14.0.1`,standard:`^17.0.0`,"standard-markdown":`^7.1.0`,"standard-version":`^9.5.0`,tap:`^16.3.0`,tar:`^6.1.11`,typescript:`^4.8.4`},engines:{node:`>=12`},browser:{fs:!1}}})),rn=n(((e,n)=>{let r=t(`fs`),i=t(`path`),a=t(`os`),o=t(`crypto`),s=nn().version,c=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function l(e){let t={},n=e.toString();n=n.replace(/\r\n?/gm,`
2
+ import{i as e,r as t,t as n}from"./chunk-vbHwaUoU.mjs";import{i as r}from"./session-Ckt20hHa.mjs";import{A as i,B as a,Dt as o,E as s,Et as c,F as l,G as u,H as d,J as f,K as p,L as m,M as h,N as g,O as _,Ot as v,P as y,Q as b,St as x,T as S,Tt as C,X as w,Y as T,Z as E,_ as D,_t as O,at as k,b as A,bt as ee,ct as te,dt as ne,ft as j,gt as re,ht as ie,it as ae,j as oe,k as M,kt as N,mt as P,nt as se,pt as ce,rt as le,st as ue,ut as de,vt as fe,wt as pe,xt as me,yt as he}from"./chunk-LQW53VED-Xakf_rUn.mjs";import{c as ge}from"./interactive-mV8PABm6.mjs";import{r as _e}from"./build-Dji9BYmV.mjs";import{C as ve,S as ye,T as be,_ as xe,b as Se,c as Ce,d as we,f as Te,g as Ee,h as De,l as Oe,m as ke,o as Ae,p as je,s as Me,u as Ne,v as Pe,w as Fe,x as Ie,y as Le}from"./spawn-CHkoow5W.mjs";import{createRequire as Re}from"node:module";import{createReadStream as ze,existsSync as Be,mkdirSync as Ve,readFileSync as He,statSync as Ue,writeFileSync as We}from"node:fs";import Ge from"node:assert";import*as Ke from"node:path";import qe,{dirname as Je,extname as Ye,isAbsolute as Xe,join as Ze,resolve as Qe,sep as $e}from"node:path";import{execSync as et,spawn as tt,spawnSync as nt}from"node:child_process";import{createHash as rt}from"node:crypto";import{Blob as it}from"node:buffer";import{gzipSync as at}from"node:zlib";import ot,{URLSearchParams as st}from"node:url";import{access as ct,readFile as lt,readdir as ut,stat as dt,writeFile as ft}from"node:fs/promises";import pt from"node:readline";import{hash as mt}from"blake3-wasm";import{getFreshSourceMapSupport as ht,getNodeCompat as gt}from"miniflare";var _t=Object.create,vt=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,bt=Object.getOwnPropertyNames,xt=Object.getPrototypeOf,St=Object.prototype.hasOwnProperty,F=(e,t)=>vt(e,`name`,{value:t,configurable:!0}),Ct=t===void 0?Re(import.meta.url):t,wt=(e,t)=>function(){return t||(0,e[bt(e)[0]])((t={exports:{}}).exports,t),t.exports},Tt=(e,t)=>{for(var n in t)vt(e,n,{get:t[n],enumerable:!0})},Et=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of bt(t))!St.call(e,i)&&i!==n&&vt(e,i,{get:()=>t[i],enumerable:!(r=yt(t,i))||r.enumerable});return e},Dt=(e,t,n)=>(n=e==null?{}:_t(xt(e)),Et(t||!e||!e.__esModule?vt(n,`default`,{value:e,enumerable:!0}):n,e)),I,L,Ot,kt,At,jt,Mt;function Nt(e){I=e.logger,L=e.fetchResult,Ot=e.fetchListResult,kt=e.fetchPagedListResult,e.fetchKVGetValue,At=e.confirm,jt=e.prompt,Mt=e.select}F(Nt,`initDeployHelpersContext`);var Pt=n(((e,n)=>{var r=t(`child_process`).exec,i=t(`child_process`).execSync,a=t(`fs`),o=t(`path`),s=a.access,c=a.accessSync,l=a.constants||a,u=process.platform==`win32`,d=function(e,t){s(e,l.F_OK,function(e){t(!e)})},f=function(e){try{return c(e,l.F_OK),!1}catch{return!0}},p=function(e,t){s(e,l.F_OK|l.X_OK,function(e){t(null,!e)})},m=function(e){try{return c(e,l.F_OK|l.X_OK),!0}catch{return!1}},h=function(e,t,n){d(e,function(i){if(!i){r(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`,function(e,t,r){n(null,!!t)});return}p(e,n)})},g=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e)){n(null,!1);return}r(`where `+t,function(e){e===null?n(null,!0):n(null,!1)})},_=function(e,t){if(f(e))try{return!!i(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`)}catch{return!1}return m(e)},v=function(e,t,n){if(!/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e))return!1;try{return!!i(`where `+t,{stdio:[]})}catch{return!1}},y=function(e){return/[^A-Za-z0-9_\/:=-]/.test(e)&&(e=`'`+e.replace(/'/g,`'\\''`)+`'`,e=e.replace(/^(?:'')+/g,``).replace(/\\'''/g,`\\'`)),e};u&&(y=function(e){if(/[\\]/.test(e)){var t=`"`+o.dirname(e)+`"`,n=`"`+o.basename(e)+`"`;return t+`:`+n}return`"`+e+`"`}),n.exports=function e(t,n){var r=y(t);if(!n&&typeof Promise<`u`)return new Promise(function(n,r){e(t,function(e,i){i?n(t):r(e)})});u?g(t,r,n):h(t,r,n)},n.exports.sync=function(e){var t=y(e);return u?v(e,t):_(e,t)}})),Ft=n(((e,t)=>{t.exports=Pt()})),It=T(),Lt=Ft();function Rt(e){if(e.compiled_schema)return He(Qe(e.compiled_schema));let{base_path:t,source_schemas:n}=e,r=(n??[]).map(e=>Qe(t,e));if(!(0,Lt.sync)(`capnp`))throw new N(`The capnp compiler is required to upload capnp schemas, but is not present.`,{telemetryMessage:`capnp compiler missing`});let i=nt(`capnp`,[`compile`,`-o-`,`--src-prefix=${Qe(t??`.`)}`,...r],{maxBuffer:3*1024*1024});if(i.error)throw i.error;if(i.stderr.length)throw Error(i.stderr.toString());return i.stdout}F(Rt,`handleUnsafeCapnp`);var zt={esm:`application/javascript+module`,commonjs:`application/javascript`,"compiled-wasm":`application/wasm`,buffer:`application/octet-stream`,text:`text/plain`,python:`text/x-python`,"python-requirement":`text/x-python-requirement`};function Bt(e){let t=zt[e];if(t===void 0)throw TypeError(`Unsupported module: `+e);return t}F(Bt,`toMimeType`);function Vt(e){let t=Object.keys(zt).find(t=>zt[t]===e);if(t===void 0)throw TypeError(`Unsupported mime type: `+e);return t}F(Vt,`fromMimeType`);function Ht(e,t,n){let r=new It.FormData,{main:i,sourceMaps:a,migrations:o,exports:c,compatibility_date:l,compatibility_flags:u,keepVars:f,keepSecrets:p,keepBindings:m,logpush:h,placement:g,tail_consumers:_,streaming_tail_consumers:v,limits:y,annotations:b,keep_assets:x,assets:S,observability:C,cache:w,package_dependencies:T}=e,E={html_handling:S?.assetConfig?.html_handling,not_found_handling:S?.assetConfig?.not_found_handling,run_worker_first:S?.run_worker_first,_redirects:S?._redirects,_headers:S?._headers};if(S&&!S.routerConfig.has_user_worker)return r.set(`metadata`,JSON.stringify({assets:{jwt:S.jwt,config:E},...b&&{annotations:b},...l&&{compatibility_date:l},...u&&{compatibility_flags:u}})),r;let{modules:D}=e,O=[],k=s(`plain_text`,t),A=s(`json`,t),ee=s(`secret_text`,t),te=s(`kv_namespace`,t),ne=s(`send_email`,t),j=s(`durable_object_namespace`,t),re=s(`workflow`,t),ie=s(`queue`,t),ae=s(`r2_bucket`,t),oe=s(`d1`,t),M=s(`vectorize`,t),se=s(`ai_search_namespace`,t),ce=s(`ai_search`,t),le=s(`websearch`,t)[0],ue=s(`agent_memory`,t),de=s(`hyperdrive`,t),fe=s(`secrets_store_secret`,t),pe=s(`artifacts`,t),me=s(`unsafe_hello_world`,t),he=s(`flagship`,t),ge=s(`ratelimit`,t),_e=s(`vpc_service`,t),ve=s(`vpc_network`,t),ye=s(`service`,t),be=s(`analytics_engine`,t),xe=s(`dispatch_namespace`,t),Se=s(`mtls_certificate`,t),Ce=s(`pipeline`,t),we=s(`worker_loader`,t),Te=s(`logfwdr`,t),Ee=s(`wasm_module`,t),De=s(`browser`,t)[0],Oe=s(`ai`,t)[0],ke=s(`images`,t)[0],Ae=s(`stream`,t)[0],je=s(`media`,t)[0],Me=s(`version_metadata`,t)[0],Ne=s(`assets`,t)[0],Pe=s(`text_blob`,t),Fe=s(`data_blob`,t);s(`inherit`,t).forEach(({binding:e})=>{O.push({name:e,type:`inherit`})}),k.forEach(({binding:e,value:t})=>{O.push({name:e,type:`plain_text`,text:t})}),A.forEach(({binding:e,value:t})=>{O.push({name:e,type:`json`,json:t})}),ee.forEach(({binding:e,value:t})=>{O.push({name:e,type:`secret_text`,text:t})}),te.forEach(({id:e,binding:t,raw:r})=>{if(n?.dryRun&&(e??=P),e===void 0)throw new N(`${t} bindings must have an "id" field`,{telemetryMessage:`kv namespace binding missing id`});e===P?O.push({name:t,type:`inherit`}):O.push({name:t,type:`kv_namespace`,namespace_id:e,raw:r})}),ne.forEach(e=>{let t={name:e.name,type:`send_email`,allowed_sender_addresses:e.allowed_sender_addresses};e.destination_address===void 0?e.allowed_destination_addresses===void 0?O.push(t):O.push({...t,allowed_destination_addresses:e.allowed_destination_addresses}):O.push({...t,destination_address:e.destination_address})}),j.forEach(({name:e,class_name:t,script_name:n,environment:r})=>{O.push({name:e,type:`durable_object_namespace`,class_name:t,...n&&{script_name:n},...r&&{environment:r}})}),re.forEach(({binding:e,name:t,class_name:n,script_name:r,raw:i})=>{O.push({type:`workflow`,name:e,workflow_name:t,class_name:n,script_name:r,raw:i})}),ie.forEach(({binding:e,queue_name:t,delivery_delay:r,raw:i})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "queue" field. Add a "queue" field to the producer in your Worker configuration specifying the name of the Queue to bind to.`,{telemetryMessage:`queue binding missing name`});t===P?O.push({name:e,type:`inherit`}):O.push({type:`queue`,name:e,queue_name:t,delivery_delay:r,raw:i})}),ae.forEach(({binding:e,bucket_name:t,jurisdiction:r,raw:i})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "bucket_name" field. Add a "bucket_name" field to the binding in your Worker configuration specifying the name of the R2 bucket to bind to.`,{telemetryMessage:`r2 bucket binding missing bucket_name`});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`r2_bucket`,bucket_name:t,jurisdiction:r,raw:i})}),oe.forEach(({binding:e,database_id:t,database_internal_env:r,raw:i})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "database_id" field. Add a "database_id" field to the binding in your Worker configuration specifying the ID of the D1 database to bind to.`,{telemetryMessage:`d1 database binding missing database_id`});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`d1`,id:t,internalEnv:r,raw:i})}),M.forEach(({binding:e,index_name:t,raw:n})=>{O.push({name:e,type:`vectorize`,index_name:t,raw:n})}),se.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the AI Search namespace to bind to.`,{telemetryMessage:`ai search namespace binding missing namespace`});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`ai_search_namespace`,namespace:t})}),ce.forEach(({binding:e,instance_name:t})=>{O.push({name:e,type:`ai_search`,instance_name:t})}),le!==void 0&&O.push({name:le.binding,type:`websearch`}),ue.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the namespace to bind to.`,{telemetryMessage:!1});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`agent_memory`,namespace:t})}),de.forEach(({binding:e,id:t})=>{O.push({name:e,type:`hyperdrive`,id:t})}),fe.forEach(({binding:e,store_id:t,secret_name:n})=>{O.push({name:e,type:`secrets_store_secret`,store_id:t,secret_name:n})}),pe.forEach(({binding:e,namespace:t})=>{O.push({name:e,type:`artifacts`,namespace:t})}),me.forEach(({binding:e,enable_timer:t})=>{O.push({name:e,type:`unsafe_hello_world`,enable_timer:t})}),he.forEach(({binding:e,app_id:t})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have an "app_id" field. Add an "app_id" field to the binding in your Worker configuration specifying the Flagship app to bind to.`,{telemetryMessage:`flagship binding missing app id`});O.push(t===P?{name:e,type:`inherit`}:{name:e,type:`flagship`,app_id:t})}),ge.forEach(({name:e,namespace_id:t,simple:n})=>{O.push({name:e,type:`ratelimit`,namespace_id:t,simple:n})}),_e.forEach(({binding:e,service_id:t})=>{O.push({name:e,type:`vpc_service`,service_id:t})}),ve.forEach(({binding:e,tunnel_id:t,network_id:n})=>{O.push({name:e,type:`vpc_network`,...t===void 0?{network_id:n}:{tunnel_id:t}})}),ye.forEach(({binding:e,service:t,environment:n,entrypoint:r,props:i,cross_account_grant:a})=>{O.push({name:e,type:`service`,service:t,cross_account_grant:a,...n&&{environment:n},...r&&{entrypoint:r},...i&&{props:i}})}),be.forEach(({binding:e,dataset:t})=>{O.push({name:e,type:`analytics_engine`,dataset:t})}),xe.forEach(({binding:e,namespace:t,outbound:r})=>{if(n?.dryRun&&(t??=P),t===void 0)throw new N(`${e} bindings must have a "namespace" field. Add a "namespace" field to the binding in your Worker configuration specifying the dispatch namespace to bind to.`,{telemetryMessage:`dispatch namespace binding missing namespace`});t===P?O.push({name:e,type:`inherit`}):O.push({name:e,type:`dispatch_namespace`,namespace:t,...r&&{outbound:{worker:{service:r.service,environment:r.environment},params:r.parameters?.map(e=>({name:e}))}}})}),Se.forEach(({binding:e,certificate_id:t})=>{O.push({name:e,type:`mtls_certificate`,certificate_id:t})}),Ce.forEach(({binding:e,stream:t,pipeline:n})=>{if(t)O.push({name:e,type:`pipelines`,stream:t});else if(n)O.push({name:e,type:`pipelines`,pipeline:n});else throw Error(`Pipeline binding must specify a stream or pipeline`)}),we.forEach(({binding:e})=>{O.push({name:e,type:`worker_loader`})}),Te.forEach(({name:e,destination:t})=>{O.push({name:e,type:`logfwdr`,destination:t})}),Ee.forEach(({binding:e,source:t})=>{O.push({name:e,type:`wasm_module`,part:e}),r.set(e,new File([`contents`in t?t.contents:He(t.path)],`path`in t?t.path??e:e,{type:`application/wasm`}))}),De!==void 0&&O.push({name:De.binding,type:`browser`,raw:De.raw}),Oe!==void 0&&O.push({name:Oe.binding,staging:Oe.staging,type:`ai`,raw:Oe.raw}),ke!==void 0&&O.push({name:ke.binding,type:`images`,raw:ke.raw}),Ae!==void 0&&O.push({name:Ae.binding,type:`stream`}),je!==void 0&&O.push({name:je.binding,type:`media`}),Me!==void 0&&O.push({name:Me.binding,type:`version_metadata`}),Ne!==void 0&&O.push({name:Ne.binding,type:`assets`}),Pe.forEach(({binding:e,source:t})=>{O.push({name:e,type:`text_blob`,part:e}),e!==`__STATIC_CONTENT_MANIFEST`&&(`contents`in t?r.set(e,new File([t.contents],t.path??e,{type:`text/plain`})):r.set(e,new File([He(t.path)],t.path,{type:`text/plain`})))}),Fe.forEach(({binding:e,source:t})=>{O.push({name:e,type:`data_blob`,part:e}),r.set(e,new File([`contents`in t?t.contents:He(t.path)],`path`in t?t.path??e:e,{type:`application/octet-stream`}))});for(let[e,n]of Object.entries(t??{}))if(d(n.type)&&n.type!==`unsafe_hello_world`){let{type:t,...r}=n;O.push({name:e,type:t.slice(7),...r})}let Ie=`__STATIC_CONTENT_MANIFEST`;if(D?.some(({name:e})=>e===Ie)&&i.type===`esm`){Ge(D!==void 0);let e=new Set(D.map(e=>qe.posix.dirname(e.name)));for(let t of e){if(t===`.`)continue;let e=qe.posix.relative(t,Ie),n=qe.posix.join(t,Ie);D.push({name:n,filePath:n,content:`export { default } from ${JSON.stringify(e)};`,type:`esm`})}}if(i.type===`commonjs`){for(let e of Object.values([...D||[]]))if(e.name===`__STATIC_CONTENT_MANIFEST`)r.set(e.name,new File([e.content],e.name,{type:`text/plain`})),D=D?.filter(t=>t!==e);else if(e.type===`compiled-wasm`||e.type===`text`||e.type===`buffer`){let t=e.name.replace(/[^a-zA-Z0-9_$]/g,`_`);O.push({name:t,type:e.type===`compiled-wasm`?`wasm_module`:e.type===`text`?`text_blob`:`data_blob`,part:t}),r.set(t,new File([e.content],e.name,{type:e.type===`compiled-wasm`?`application/wasm`:e.type===`text`?`text/plain`:`application/octet-stream`})),D=D?.filter(t=>t!==e)}}let Le;if(n?.unsafe?.capnp){let e=Rt(n.unsafe.capnp);Le=`./capnp-${Date.now()}.compiled`,r.set(Le,new File([e],Le,{type:`application/octet-stream`}))}let Re;f&&(Re??=[],Re.push(`plain_text`,`json`)),p&&(Re??=[],Re.push(`secret_text`,`secret_key`)),m&&(Re??=[],Re.push(...m));let ze={...i.type===`commonjs`?{body_part:i.name}:{main_module:i.name},bindings:O,containers:e.containers===void 0?void 0:e.containers.map(e=>({...e.name!==void 0&&{name:e.name},...e.class_name!==void 0&&{class_name:e.class_name}})),...l&&{compatibility_date:l},...u&&{compatibility_flags:u},...o&&{migrations:o},...c&&Object.keys(c).length>0&&{exports:c},capnp_schema:Le,...Re&&{keep_bindings:Re},...h!==void 0&&{logpush:h},...g&&{placement:g},..._&&{tail_consumers:_},...v&&{streaming_tail_consumers:v},...y&&{limits:y},...b&&{annotations:b},...x!==void 0&&{keep_assets:x},...S&&{assets:{jwt:S.jwt,config:E}},...C&&{observability:C},...w&&{cache_options:w},...T?.length&&{package_dependencies:T}};if(n?.unsafe?.metadata!==void 0)for(let e of Object.keys(n.unsafe.metadata))ze[e]=n.unsafe.metadata[e];if(r.set(`metadata`,JSON.stringify(ze)),i.type===`commonjs`&&D&&D.length>0)throw TypeError(`More than one module can only be specified when type = 'esm'`);for(let e of[i].concat(D||[]))r.set(e.name,new File([e.content],e.name,{type:Bt(e.type??i.type??`esm`)}));for(let e of a||[])r.set(e.name,new File([e.content],e.name,{type:`application/source-map`}));return r}F(Ht,`createWorkerUploadForm`);var Ut=e(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),1),Wt=class e extends Error{name=`TimeoutError`;constructor(t,n){super(t,n),Error.captureStackTrace?.(this,e)}};const Gt=e=>e.reason??new DOMException(`This operation was aborted.`,`AbortError`);function Kt(e,t){let{milliseconds:n,fallback:r,message:i,customTimers:a={setTimeout,clearTimeout},signal:o}=t,s,c,l=new Promise((t,l)=>{if(typeof n!=`number`||Math.sign(n)!==1)throw TypeError(`Expected \`milliseconds\` to be a positive number, got \`${n}\``);if(o?.aborted){l(Gt(o));return}if(o&&(c=()=>{l(Gt(o))},o.addEventListener(`abort`,c,{once:!0})),e.then(t,l),n===1/0)return;let u=new Wt;s=a.setTimeout.call(void 0,()=>{if(r){try{t(r())}catch(e){l(e)}return}typeof e.cancel==`function`&&e.cancel(),i===!1?t():i instanceof Error?l(i):(u.message=i??`Promise timed out after ${n} milliseconds`,l(u))},n)}).finally(()=>{l.clear(),c&&o&&o.removeEventListener(`abort`,c)});return l.clear=()=>{a.clearTimeout.call(void 0,s),s=void 0},l}function qt(e,t,n){let r=0,i=e.length;for(;i>0;){let a=Math.trunc(i/2),o=r+a;n(e[o],t)<=0?(r=++o,i-=a+1):i=a}return r}var Jt=class{#e=[];enqueue(e,t){let{priority:n=0,id:r}=t??{},i={priority:n,id:r,run:e};if(this.size===0||this.#e[this.size-1].priority>=n){this.#e.push(i);return}let a=qt(this.#e,i,(e,t)=>t.priority-e.priority);this.#e.splice(a,0,i)}setPriority(e,t){let n=this.#e.findIndex(t=>t.id===e);if(n===-1)throw ReferenceError(`No promise function with the id "${e}" exists in the queue.`);let[r]=this.#e.splice(n,1);this.enqueue(r.run,{priority:t,id:e})}dequeue(){return this.#e.shift()?.run}filter(e){return this.#e.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#e.length}},Yt=class extends Ut.default{#e;#t;#n=0;#r;#i=!1;#a=!1;#o;#s=0;#c=0;#l;#u;#d;#f;#p=0;#m;#h;#g=1n;#_=new Map;timeout;constructor(e){if(super(),e={carryoverIntervalCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Jt,...e},!(typeof e.intervalCap==`number`&&e.intervalCap>=1))throw TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??``}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??``}\` (${typeof e.interval})`);if(this.#e=e.carryoverIntervalCount??e.carryoverConcurrencyCount??!1,this.#t=e.intervalCap===1/0||e.interval===0,this.#r=e.intervalCap,this.#o=e.interval,this.#d=new e.queueClass,this.#f=e.queueClass,this.concurrency=e.concurrency,e.timeout!==void 0&&!(Number.isFinite(e.timeout)&&e.timeout>0))throw TypeError(`Expected \`timeout\` to be a positive finite number, got \`${e.timeout}\` (${typeof e.timeout})`);this.timeout=e.timeout,this.#h=e.autoStart===!1,this.#M()}get#v(){return this.#t||this.#n<this.#r}get#y(){return this.#p<this.#m}#b(){this.#p--,this.#p===0&&this.emit(`pendingZero`),this.#E(),this.emit(`next`)}#x(){this.#O(),this.#D(),this.#u=void 0}get#S(){let e=Date.now();if(this.#l===void 0){let t=this.#s-e;if(t<0){if(this.#c>0){let t=e-this.#c;if(t<this.#o)return this.#C(this.#o-t),!0}this.#n=this.#e?this.#p:0}else return this.#C(t),!0}return!1}#C(e){this.#u===void 0&&(this.#u=setTimeout(()=>{this.#x()},e))}#w(){this.#l&&=(clearInterval(this.#l),void 0)}#T(){this.#u&&=(clearTimeout(this.#u),void 0)}#E(){if(this.#d.size===0)return this.#w(),this.emit(`empty`),this.#p===0&&(this.#T(),this.emit(`idle`)),!1;let e=!1;if(!this.#h){let t=!this.#S;if(this.#v&&this.#y){let n=this.#d.dequeue();this.#t||(this.#n++,this.#N()),this.emit(`active`),this.#c=Date.now(),n(),t&&this.#D(),e=!0}}return e}#D(){this.#t||this.#l!==void 0||(this.#l=setInterval(()=>{this.#O()},this.#o),this.#s=Date.now()+this.#o)}#O(){this.#n===0&&this.#p===0&&this.#l&&this.#w(),this.#n=this.#e?this.#p:0,this.#k(),this.#N()}#k(){for(;this.#E(););}get concurrency(){return this.#m}set concurrency(e){if(!(typeof e==`number`&&e>=1))throw TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#m=e,this.#k()}async#A(e){return new Promise((t,n)=>{e.addEventListener(`abort`,()=>{n(e.reason)},{once:!0})})}setPriority(e,t){if(typeof t!=`number`||!Number.isFinite(t))throw TypeError(`Expected \`priority\` to be a finite number, got \`${t}\` (${typeof t})`);this.#d.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#g++).toString(),t={timeout:this.timeout,...t},new Promise((n,r)=>{let i=Symbol(`task-${t.id}`);this.#d.enqueue(async()=>{this.#p++,this.#_.set(i,{id:t.id,priority:t.priority??0,startTime:Date.now(),timeout:t.timeout});try{try{t.signal?.throwIfAborted()}catch(e){throw this.#t||this.#n--,this.#_.delete(i),e}let r=e({signal:t.signal});t.timeout&&(r=Kt(Promise.resolve(r),{milliseconds:t.timeout,message:`Task timed out after ${t.timeout}ms (queue has ${this.#p} running, ${this.#d.size} waiting)`})),t.signal&&(r=Promise.race([r,this.#A(t.signal)]));let a=await r;n(a),this.emit(`completed`,a)}catch(e){r(e),this.emit(`error`,e)}finally{this.#_.delete(i),queueMicrotask(()=>{this.#b()})}},t),this.emit(`add`),this.#E()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#h?(this.#h=!1,this.#k(),this):this}pause(){this.#h=!0}clear(){this.#d=new this.#f,this.#P()}async onEmpty(){this.#d.size!==0&&await this.#j(`empty`)}async onSizeLessThan(e){this.#d.size<e||await this.#j(`next`,()=>this.#d.size<e)}async onIdle(){this.#p===0&&this.#d.size===0||await this.#j(`idle`)}async onPendingZero(){this.#p!==0&&await this.#j(`pendingZero`)}async onRateLimit(){this.isRateLimited||await this.#j(`rateLimit`)}async onRateLimitCleared(){this.isRateLimited&&await this.#j(`rateLimitCleared`)}async onError(){return new Promise((e,t)=>{let n=e=>{this.off(`error`,n),t(e)};this.on(`error`,n)})}async#j(e,t){return new Promise(n=>{let r=()=>{t&&!t()||(this.off(e,r),n())};this.on(e,r)})}get size(){return this.#d.size}sizeBy(e){return this.#d.filter(e).length}get pending(){return this.#p}get isPaused(){return this.#h}#M(){this.#t||(this.on(`add`,()=>{this.#d.size>0&&this.#N()}),this.on(`next`,()=>{this.#N()}))}#N(){this.#t||this.#a||(this.#a=!0,queueMicrotask(()=>{this.#a=!1,this.#P()}))}#P(){let e=this.#i,t=!this.#t&&this.#n>=this.#r&&this.#d.size>0;t!==e&&(this.#i=t,this.emit(t?`rateLimit`:`rateLimitCleared`))}get isRateLimited(){return this.#i}get isSaturated(){return this.#p===this.#m&&this.#d.size>0||this.isRateLimited&&this.#d.size>0}get runningTasks(){return[...this.#_.values()].map(e=>({...e}))}};const Xt=[`B`,`kB`,`MB`,`GB`,`TB`,`PB`,`EB`,`ZB`,`YB`],Zt=[`B`,`KiB`,`MiB`,`GiB`,`TiB`,`PiB`,`EiB`,`ZiB`,`YiB`],Qt=[`b`,`kbit`,`Mbit`,`Gbit`,`Tbit`,`Pbit`,`Ebit`,`Zbit`,`Ybit`],$t=[`b`,`kibit`,`Mibit`,`Gibit`,`Tibit`,`Pibit`,`Eibit`,`Zibit`,`Yibit`],en=(e,t,n)=>{let r=e;return typeof t==`string`||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function tn(e,t){if(!Number.isFinite(e))throw TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};let n=t.bits?t.binary?$t:Qt:t.binary?Zt:Xt,r=t.space?` `:``;if(t.signed&&e===0)return` 0${r}${n[0]}`;let i=e<0,a=i?`-`:t.signed?`+`:``;i&&(e=-e);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1)return a+en(e,t.locale,o)+r+n[0];let s=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**s,o||(e=e.toPrecision(3));let c=en(Number(e),t.locale,o),l=n[s];return a+c+r+l}var nn=n(((e,t)=>{t.exports={name:`dotenv`,version:`16.3.1`,description:`Loads environment variables from .env file`,main:`lib/main.js`,types:`lib/main.d.ts`,exports:{".":{types:`./lib/main.d.ts`,require:`./lib/main.js`,default:`./lib/main.js`},"./config":`./config.js`,"./config.js":`./config.js`,"./lib/env-options":`./lib/env-options.js`,"./lib/env-options.js":`./lib/env-options.js`,"./lib/cli-options":`./lib/cli-options.js`,"./lib/cli-options.js":`./lib/cli-options.js`,"./package.json":`./package.json`},scripts:{"dts-check":`tsc --project tests/types/tsconfig.json`,lint:`standard`,"lint-readme":`standard-markdown`,pretest:`npm run lint && npm run dts-check`,test:`tap tests/*.js --100 -Rspec`,prerelease:`npm test`,release:`standard-version`},repository:{type:`git`,url:`git://github.com/motdotla/dotenv.git`},funding:`https://github.com/motdotla/dotenv?sponsor=1`,keywords:[`dotenv`,`env`,`.env`,`environment`,`variables`,`config`,`settings`],readmeFilename:`README.md`,license:`BSD-2-Clause`,devDependencies:{"@definitelytyped/dtslint":`^0.0.133`,"@types/node":`^18.11.3`,decache:`^4.6.1`,sinon:`^14.0.1`,standard:`^17.0.0`,"standard-markdown":`^7.1.0`,"standard-version":`^9.5.0`,tap:`^16.3.0`,tar:`^6.1.11`,typescript:`^4.8.4`},engines:{node:`>=12`},browser:{fs:!1}}})),rn=n(((e,n)=>{let r=t(`fs`),i=t(`path`),a=t(`os`),o=t(`crypto`),s=nn().version,c=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;function l(e){let t={},n=e.toString();n=n.replace(/\r\n?/gm,`
3
3
  `);let r;for(;(r=c.exec(n))!=null;){let e=r[1],n=r[2]||``;n=n.trim();let i=n[0];n=n.replace(/^(['"`])([\s\S]*)\1$/gm,`$2`),i===`"`&&(n=n.replace(/\\n/g,`
4
4
  `),n=n.replace(/\\r/g,`\r`)),t[e]=n}return t}function u(e){let t=g(e),n=C.configDotenv({path:t});if(!n.parsed)throw Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);let r=m(e).split(`,`),i=r.length,a;for(let e=0;e<i;e++)try{let t=h(n,r[e].trim());a=C.decrypt(t.ciphertext,t.key);break}catch(t){if(e+1>=i)throw t}return C.parse(a)}function d(e){console.log(`[dotenv@${s}][INFO] ${e}`)}function f(e){console.log(`[dotenv@${s}][WARN] ${e}`)}function p(e){console.log(`[dotenv@${s}][DEBUG] ${e}`)}function m(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:``}function h(e,t){let n;try{n=new URL(t)}catch(e){throw e.code===`ERR_INVALID_URL`?Error(`INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenv.org/vault/.env.vault?environment=development`):e}let r=n.password;if(!r)throw Error(`INVALID_DOTENV_KEY: Missing key part`);let i=n.searchParams.get(`environment`);if(!i)throw Error(`INVALID_DOTENV_KEY: Missing environment part`);let a=`DOTENV_VAULT_${i.toUpperCase()}`,o=e.parsed[a];if(!o)throw Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${a} in your .env.vault file.`);return{ciphertext:o,key:r}}function g(e){let t=i.resolve(process.cwd(),`.env`);return e&&e.path&&e.path.length>0&&(t=e.path),t.endsWith(`.vault`)?t:`${t}.vault`}function _(e){return e[0]===`~`?i.join(a.homedir(),e.slice(1)):e}function v(e){d(`Loading env from encrypted .env.vault`);let t=C._parseVault(e),n=process.env;return e&&e.processEnv!=null&&(n=e.processEnv),C.populate(n,t,e),{parsed:t}}function y(e){let t=i.resolve(process.cwd(),`.env`),n=`utf8`,a=!!(e&&e.debug);e&&(e.path!=null&&(t=_(e.path)),e.encoding!=null&&(n=e.encoding));try{let i=C.parse(r.readFileSync(t,{encoding:n})),a=process.env;return e&&e.processEnv!=null&&(a=e.processEnv),C.populate(a,i,e),{parsed:i}}catch(e){return a&&p(`Failed to load ${t} ${e.message}`),{error:e}}}function b(e){let t=g(e);return m(e).length===0?C.configDotenv(e):r.existsSync(t)?C._configVault(e):(f(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),C.configDotenv(e))}function x(e,t){let n=Buffer.from(t.slice(-64),`hex`),r=Buffer.from(e,`base64`),i=r.slice(0,12),a=r.slice(-16);r=r.slice(12,-16);try{let e=o.createDecipheriv(`aes-256-gcm`,n,i);return e.setAuthTag(a),`${e.update(r)}${e.final()}`}catch(e){let t=e instanceof RangeError,n=e.message===`Invalid key length`,r=e.message===`Unsupported state or unable to authenticate data`;throw t||n?Error(`INVALID_DOTENV_KEY: It must be 64 characters long (or more)`):r?Error(`DECRYPTION_FAILED: Please check your DOTENV_KEY`):(console.error(`Error: `,e.code),console.error(`Error: `,e.message),e)}}function S(e,t,n={}){let r=!!(n&&n.debug),i=!!(n&&n.override);if(typeof t!=`object`)throw Error(`OBJECT_REQUIRED: Please check the processEnv argument being passed to populate`);for(let n of Object.keys(t))Object.prototype.hasOwnProperty.call(e,n)?(i===!0&&(e[n]=t[n]),r&&p(i===!0?`"${n}" is already defined and WAS overwritten`:`"${n}" is already defined and was NOT overwritten`)):e[n]=t[n]}let C={configDotenv:y,_configVault:v,_parseVault:u,config:b,decrypt:x,parse:l,populate:S};n.exports.configDotenv=C.configDotenv,n.exports._configVault=C._configVault,n.exports._parseVault=C._parseVault,n.exports.config=C.config,n.exports.decrypt=C.decrypt,n.exports.parse=C.parse,n.exports.populate=C.populate,n.exports=C}))(),an=wt({"../../node_modules/.pnpm/ignore@5.3.1/node_modules/ignore/index.js"(e,t){function n(e){return Array.isArray(e)?e:[e]}F(n,`makeArray`);var r=``,i=` `,a=`\\`,o=/^\s+$/,s=/(?:[^\\]|^)\\$/,c=/^\\!/,l=/^\\#/,u=/\r?\n/g,d=/^\.*\/|^\.+$/,f=`/`,p=`node-ignore`;typeof Symbol<`u`&&(p=Symbol.for(`node-ignore`));var m=p,h=F((e,t,n)=>Object.defineProperty(e,t,{value:n}),`define`),g=/([0-z])-([0-z])/g,_=F(()=>!1,`RETURN_FALSE`),v=F(e=>e.replace(g,(e,t,n)=>t.charCodeAt(0)<=n.charCodeAt(0)?e:r),`sanitizeRange`),y=F(e=>{let{length:t}=e;return e.slice(0,t-t%2)},`cleanRangeBackSlash`),b=[[/^\uFEFF/,()=>r],[/\\?\s+$/,e=>e.indexOf(`\\`)===0?i:r],[/\\\s/g,()=>i],[/[\\$.|*+(){^]/g,e=>`\\${e}`],[/(?!\\)\?/g,()=>`[^/]`],[/^\//,()=>`^`],[/\//g,()=>`\\/`],[/^\^*\\\*\\\*\\\//,()=>`^(?:.*\\/)?`],[/^(?=[^^])/,F(function(){return/\/(?!$)/.test(this)?`^`:`(?:^|\\/)`},`startingReplacer`)],[/\\\/\\\*\\\*(?=\\\/|$)/g,(e,t,n)=>t+6<n.length?`(?:\\/[^\\/]+)*`:`\\/.+`],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(e,t,n)=>t+n.replace(/\\\*/g,`[^\\/]*`)],[/\\\\\\(?=[$.|*+(){^])/g,()=>a],[/\\\\/g,()=>a],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(e,t,n,r,i)=>t===a?`\\[${n}${y(r)}${i}`:i===`]`&&r.length%2==0?`[${v(n)}${r}]`:`[]`],[/(?:[^*])$/,e=>/\/$/.test(e)?`${e}$`:`${e}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(e,t)=>`${t?`${t}[^/]+`:`[^/]*`}(?=$|\\/$)`]],x=Object.create(null),S=F((e,t)=>{let n=x[e];return n||(n=b.reduce((t,n)=>t.replace(n[0],n[1].bind(e)),e),x[e]=n),t?new RegExp(n,`i`):new RegExp(n)},`makeRegex`),C=F(e=>typeof e==`string`,`isString`),w=F(e=>e&&C(e)&&!o.test(e)&&!s.test(e)&&e.indexOf(`#`)!==0,`checkPattern`),T=F(e=>e.split(u),`splitPattern`),E=class{static{F(this,`IgnoreRule`)}constructor(e,t,n,r){this.origin=e,this.pattern=t,this.negative=n,this.regex=r}},D=F((e,t)=>{let n=e,r=!1;e.indexOf(`!`)===0&&(r=!0,e=e.substr(1)),e=e.replace(c,`!`).replace(l,`#`);let i=S(e,t);return new E(n,e,r,i)},`createRule`),O=F((e,t)=>{throw new t(e)},`throwError`),k=F((e,t,n)=>C(e)?e?k.isNotRelative(e)?n(`path should be a \`path.relative()\`d string, but got "${t}"`,RangeError):!0:n(`path must not be empty`,TypeError):n(`path must be a string, but got \`${t}\``,TypeError),`checkPath`),A=F(e=>d.test(e),`isNotRelative`);k.isNotRelative=A,k.convert=e=>e;var ee=class{static{F(this,`Ignore`)}constructor({ignorecase:e=!0,ignoreCase:t=e,allowRelativePaths:n=!1}={}){h(this,m,!0),this._rules=[],this._ignoreCase=t,this._allowRelativePaths=n,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[m]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(w(e)){let t=D(e,this._ignoreCase);this._added=!0,this._rules.push(t)}}add(e){return this._added=!1,n(C(e)?T(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,t){let n=!1,r=!1;return this._rules.forEach(i=>{let{negative:a}=i;r===a&&n!==r||a&&!n&&!r&&!t||i.regex.test(e)&&(n=!a,r=a)}),{ignored:n,unignored:r}}_test(e,t,n,r){let i=e&&k.convert(e);return k(i,e,this._allowRelativePaths?_:O),this._t(i,t,n,r)}_t(e,t,n,r){if(e in t)return t[e];if(r||=e.split(f),r.pop(),!r.length)return t[e]=this._testOne(e,n);let i=this._t(r.join(f)+f,t,n,r);return t[e]=i.ignored?i:this._testOne(e,n)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return n(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}},te=F(e=>new ee(e),`factory`);if(te.isPathValid=F(e=>k(e&&k.convert(e),e,_),`isPathValid`),te.default=te,t.exports=te,typeof process<`u`&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform===`win32`)){k.convert=F(e=>/^\\\\\?\\/.test(e)||/["<>|\u0000-\u001F]+/u.test(e)?e:e.replace(/\\/g,`/`),`makePosix`);let e=/^[a-z]:\//i;k.isNotRelative=t=>e.test(t)||A(t)}}}),on=wt({"../../node_modules/.pnpm/heap@0.2.7/node_modules/heap/lib/heap.js"(e,t){(function(){var n,r,i=Math.floor,a,o,s,c,l,u,d=Math.min,f,p,m,h,g;r=F(function(e,t){return e<t?-1:+(e>t)},`defaultCmp`),u=F(function(e,t,n,a,o){var s;if(n??=0,o??=r,n<0)throw Error(`lo must be non-negative`);for(a??=e.length;n<a;)s=i((n+a)/2),o(t,e[s])<0?a=s:n=s+1;return[].splice.apply(e,[n,n-n].concat(t)),t},`insort`),s=F(function(e,t,n){return n??=r,e.push(t),h(e,0,e.length-1,n)},`heappush`),o=F(function(e,t){var n,i;return t??=r,n=e.pop(),e.length?(i=e[0],e[0]=n,g(e,0,t)):i=n,i},`heappop`),l=F(function(e,t,n){var i;return n??=r,i=e[0],e[0]=t,g(e,0,n),i},`heapreplace`),c=F(function(e,t,n){var i;return n??=r,e.length&&n(e[0],t)<0&&(i=[e[0],t],t=i[0],e[0]=i[1],g(e,0,n)),t},`heappushpop`),a=F(function(e,t){var n,a,o,s,c,l;for(t??=r,s=function(){l=[];for(var t=0,n=i(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)l.push(t);return l}.apply(this).reverse(),c=[],a=0,o=s.length;a<o;a++)n=s[a],c.push(g(e,n,t));return c},`heapify`),m=F(function(e,t,n){var i;if(n??=r,i=e.indexOf(t),i!==-1)return h(e,0,i,n),g(e,i,n)},`updateItem`),f=F(function(e,t,n){var i,o,s,l,u;if(n??=r,o=e.slice(0,t),!o.length)return o;for(a(o,n),u=e.slice(t),s=0,l=u.length;s<l;s++)i=u[s],c(o,i,n);return o.sort(n).reverse()},`nlargest`),p=F(function(e,t,n){var i,s,c,l,f,p,m,h,g;if(n??=r,t*10<=e.length){if(c=e.slice(0,t).sort(n),!c.length)return c;for(s=c[c.length-1],m=e.slice(t),l=0,p=m.length;l<p;l++)i=m[l],n(i,s)<0&&(u(c,i,0,null,n),c.pop(),s=c[c.length-1]);return c}for(a(e,n),g=[],f=0,h=d(t,e.length);0<=h?f<h:f>h;0<=h?++f:--f)g.push(o(e,n));return g},`nsmallest`),h=F(function(e,t,n,i){var a,o,s;for(i??=r,a=e[n];n>t;){if(s=n-1>>1,o=e[s],i(a,o)<0){e[n]=o,n=s;continue}break}return e[n]=a},`_siftdown`),g=F(function(e,t,n){var i,a,o,s,c;for(n??=r,a=e.length,c=t,o=e[t],i=2*t+1;i<a;)s=i+1,s<a&&!(n(e[i],e[s])<0)&&(i=s),e[t]=e[i],t=i,i=2*t+1;return e[t]=o,h(e,c,t,n)},`_siftup`),n=function(){e.push=s,e.pop=o,e.replace=l,e.pushpop=c,e.heapify=a,e.updateItem=m,e.nlargest=f,e.nsmallest=p;function e(e){this.cmp=e??r,this.nodes=[]}return F(e,`Heap`),e.prototype.push=function(e){return s(this.nodes,e,this.cmp)},e.prototype.pop=function(){return o(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return this.nodes.indexOf(e)!==-1},e.prototype.replace=function(e){return l(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return c(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return a(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return m(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return this.nodes.length===0},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t=new e;return t.nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e}(),(function(n,r){return typeof define==`function`&&define.amd?define([],r):typeof e==`object`?t.exports=r():n.Heap=r()})(this,function(){return n})}).call(e)}}),sn=wt({"../../node_modules/.pnpm/heap@0.2.7/node_modules/heap/index.js"(e,t){t.exports=on()}}),cn=wt({"../../node_modules/.pnpm/@ewoudenberg+difflib@0.1.0/node_modules/@ewoudenberg/difflib/lib/difflib.js"(e){(function(){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S=[].indexOf;({floor:h,max:_,min:v}=Math),n=sn(),p=Ct(`assert`),c=F(function(e,t){return t?2*e/t:1},`_calculateRatio`),s=F(function(e,t){var n,r,i,a,o;for([i,a]=[e.length,t.length],n=r=0,o=v(i,a);0<=o?r<o:r>o;n=0<=o?++r:--r){if(e[n]<t[n])return-1;if(e[n]>t[n])return 1}return i-a},`_arrayCmp`),f=F(function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},`_has`),o=F(function(e){var t,n,r;for(n=0,r=e.length;n<r;n++)if(t=e[n],t)return!0;return!1},`_any`),a=class{static{F(this,`SequenceMatcher`)}constructor(e,t=``,n=``,r=!0){this.isjunk=e,this.autojunk=r,this.a=this.b=null,this.setSeqs(t,n)}setSeqs(e,t){return this.setSeq1(e),this.setSeq2(t)}setSeq1(e){if(e!==this.a)return this.a=e,this.matchingBlocks=this.opcodes=null}setSeq2(e){if(e!==this.b)return this.b=e,this.matchingBlocks=this.opcodes=null,this.fullbcount=null,this._chainB()}_chainB(){var e=this.b,t,n,r,i,a,o,s,c,l,u,d;for(this.b2j=t=new Map,r=s=0,c=e.length;s<c;r=++s)n=e[r],t.has(n)||t.set(n,[]),i=t.get(n),i.push(r);return o=new Map,a=this.isjunk,a&&t.forEach(function(e,n){if(a(n))return o.set(n,!0),t.delete(n)}),d=new Map,l=e.length,this.autojunk&&l>=200&&(u=h(l/100)+1,t.forEach(function(e,n){if(e.length>u)return d.set(n,!0),t.delete(n)})),this.isbjunk=function(e){return o.has(e)},this.isbpopular=function(e){return d.has(e)}}findLongestMatch(e,t,n,r){var i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x;for([i,a,o,d]=[this.a,this.b,this.b2j,this.isbjunk],[s,c,l]=[e,n,0],p={},u=g=b=e,x=t;b<=x?g<x:g>x;u=b<=x?++g:--g){for(y={},m=[],o.has(i[u])&&(m=o.get(i[u])),v=0,_=m.length;v<_;v++)if(f=m[v],!(f<n)){if(f>=r)break;h=y[f]=(p[f-1]||0)+1,h>l&&([s,c,l]=[u-h+1,f-h+1,h])}p=y}for(;s>e&&c>n&&!d(a[c-1])&&i[s-1]===a[c-1];)[s,c,l]=[s-1,c-1,l+1];for(;s+l<t&&c+l<r&&!d(a[c+l])&&i[s+l]===a[c+l];)l++;for(;s>e&&c>n&&d(a[c-1])&&i[s-1]===a[c-1];)[s,c,l]=[s-1,c-1,l+1];for(;s+l<t&&c+l<r&&d(a[c+l])&&i[s+l]===a[c+l];)l++;return[s,c,l]}getMatchingBlocks(){var e,t,n,r,i,a,o,c,l,u,d,f,p,m,h,g,_,v,y,b,x;if(this.matchingBlocks)return this.matchingBlocks;for([h,g]=[this.a.length,this.b.length],b=[[0,h,0,g]],v=[];b.length;)[t,e,r,n]=b.pop(),[i,c,d]=x=this.findLongestMatch(t,e,r,n),d&&(v.push(x),t<i&&r<c&&b.push([t,i,r,c]),i+d<e&&c+d<n&&b.push([i+d,e,c+d,n]));for(v.sort(s),a=l=f=0,y=[],m=0,_=v.length;m<_;m++)[o,u,p]=v[m],a+f===o&&l+f===u?f+=p:(f&&y.push([a,l,f]),[a,l,f]=[o,u,p]);return f&&y.push([a,l,f]),y.push([h,g,0]),this.matchingBlocks=y}getOpcodes(){var e,t,n,r,i,a,o,s,c,l;if(this.opcodes)return this.opcodes;for(r=i=0,this.opcodes=t=[],s=this.getMatchingBlocks(),a=0,o=s.length;a<o;a++)[e,n,c]=s[a],l=``,r<e&&i<n?l=`replace`:r<e?l=`delete`:i<n&&(l=`insert`),l&&t.push([l,r,e,i,n]),[r,i]=[e+c,n+c],c&&t.push([`equal`,e,r,n,i]);return t}getGroupedOpcodes(e=3){var t=this.getOpcodes(),n,r,i,a,o,s,c,l,u,d;for(t.length||(t=[[`equal`,0,1,0,1]]),t[0][0]===`equal`&&([d,i,a,o,s]=t[0],t[0]=[d,_(i,a-e),a,_(o,s-e),s]),t[t.length-1][0]===`equal`&&([d,i,a,o,s]=t[t.length-1],t[t.length-1]=[d,i,v(a,i+e),o,v(s,o+e)]),u=e+e,r=[],n=[],c=0,l=t.length;c<l;c++)[d,i,a,o,s]=t[c],d===`equal`&&a-i>u&&(n.push([d,i,v(a,i+e),o,v(s,o+e)]),r.push(n),n=[],[i,o]=[_(i,a-e),_(o,s-e)]),n.push([d,i,a,o,s]);return n.length&&!(n.length===1&&n[0][0]===`equal`)&&r.push(n),r}ratio(){var e,t,n,r=0,i=this.getMatchingBlocks();for(e=0,t=i.length;e<t;e++)n=i[e],r+=n[2];return c(r,this.a.length+this.b.length)}quickRatio(){var e,t,n,r,i,a,o,s,l,u,d;if(!this.fullbcount)for(this.fullbcount=n={},u=this.b,r=0,i=u.length;r<i;r++)t=u[r],n[t]=(n[t]||0)+1;for(n=this.fullbcount,e={},s=0,d=this.a,o=0,a=d.length;o<a;o++)t=d[o],l=f(e,t)?e[t]:n[t]||0,e[t]=l-1,l>0&&s++;return c(s,this.a.length+this.b.length)}realQuickRatio(){var e,t;return[e,t]=[this.a.length,this.b.length],c(v(e,t),e+t)}},g=F(function(e,t,r=3,i=.6){var o,c,l,u,d,f,p,m,h;if(!(r>0))throw Error(`n must be > 0: (${r})`);if(!(0<=i&&i<=1))throw Error(`cutoff must be in [0.0, 1.0]: (${i})`);for(d=[],p=new a,p.setSeq2(e),o=0,c=t.length;o<c;o++)h=t[o],p.setSeq1(h),p.realQuickRatio()>=i&&p.quickRatio()>=i&&p.ratio()>=i&&d.push([p.ratio(),h]);for(d=n.nlargest(d,r,s),f=[],u=0,l=d.length;u<l;u++)[m,h]=d[u],f.push(h);return f},`getCloseMatches`),l=F(function(e,t){var n,r;for([n,r]=[0,e.length];n<r&&e[n]===t;)n++;return n},`_countLeading`),t=class{static{F(this,`Differ`)}constructor(e,t){this.linejunk=e,this.charjunk=t}compare(e,t){var n,r,i,o,s=new a(this.linejunk,e,t),c,l,u,d,f,p=[],m,h=s.getOpcodes(),g;for(l=0,u=h.length;l<u;l++){switch([g,r,n,o,i]=h[l],g){case`replace`:c=this._fancyReplace(e,r,n,t,o,i);break;case`delete`:c=this._dump(`-`,e,r,n);break;case`insert`:c=this._dump(`+`,t,o,i);break;case`equal`:c=this._dump(` `,e,r,n);break;default:throw Error(`unknow tag (${g})`)}for(m=0,d=c.length;m<d;m++)f=c[m],p.push(f)}return p}_dump(e,t,n,r){var i,a,o,s,c=[];for(i=a=o=n,s=r;o<=s?a<s:a>s;i=o<=s?++a:--a)c.push(`${e} ${t[i]}`);return c}_plainReplace(e,t,n,r,i,a){var o,s,c,l,u,d,f,m,h,g;for(p(t<n&&i<a),a-i<n-t?(o=this._dump(`+`,r,i,a),g=this._dump(`-`,e,t,n)):(o=this._dump(`-`,e,t,n),g=this._dump(`+`,r,i,a)),f=[],h=[o,g],c=0,l=h.length;c<l;c++)for(s=h[c],m=0,u=s.length;m<u;m++)d=s[m],f.push(d);return f}_fancyReplace(e,t,n,r,i,o){var s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,ee,te,ne,j,re,ie,ae,oe,M,N,P,se,ce,le,ue,de,fe,pe,me,he,ge;for([p,x]=[.74,.75],b=new a(this.charjunk),[S,C]=[null,null],re=[],T=E=P=i,se=o;P<=se?E<se:E>se;T=P<=se?++E:--E)for(g=r[T],b.setSeq2(g),w=ie=ce=t,le=n;ce<=le?ie<le:ie>le;w=ce<=le?++ie:--ie){if(c=e[w],c===g){S===null&&([S,C]=[w,T]);continue}b.setSeq1(c),b.realQuickRatio()>p&&b.quickRatio()>p&&b.ratio()>p&&([p,m,h]=[b.ratio(),w,T])}if(p<x){if(S===null){for(ue=this._plainReplace(e,t,n,r,i,o),ae=0,k=ue.length;ae<k;ae++)j=ue[ae],re.push(j);return re}[m,h,p]=[S,C,1]}else S=null;for(de=this._fancyHelper(e,t,m,r,i,h),oe=0,A=de.length;oe<A;oe++)j=de[oe],re.push(j);if([s,f]=[e[m],r[h]],S===null){for(d=y=``,b.setSeqs(s,f),fe=b.getOpcodes(),M=0,ee=fe.length;M<ee;M++)switch([ge,l,u,_,v]=fe[M],[D,O]=[u-l,v-_],ge){case`replace`:d+=Array(D+1).join(`^`),y+=Array(O+1).join(`^`);break;case`delete`:d+=Array(D+1).join(`-`);break;case`insert`:y+=Array(O+1).join(`+`);break;case`equal`:d+=Array(D+1).join(` `),y+=Array(O+1).join(` `);break;default:throw Error(`unknow tag (${ge})`)}for(pe=this._qformat(s,f,d,y),N=0,te=pe.length;N<te;N++)j=pe[N],re.push(j)}else re.push(` `+s);for(me=this._fancyHelper(e,m+1,n,r,h+1,o),he=0,ne=me.length;he<ne;he++)j=me[he],re.push(j);return re}_fancyHelper(e,t,n,r,i,a){var o=[];return t<n?o=i<a?this._fancyReplace(e,t,n,r,i,a):this._dump(`-`,e,t,n):i<a&&(o=this._dump(`+`,r,i,a)),o}_qformat(e,t,n,r){var i,a=[];return i=v(l(e,` `),l(t,` `)),i=v(i,l(n.slice(0,i),` `)),i=v(i,l(r.slice(0,i),` `)),n=n.slice(i).replace(/\s+$/,``),r=r.slice(i).replace(/\s+$/,``),a.push(`- `+e),n.length&&a.push(`? ${Array(i+1).join(` `)}${n}
5
5
  `),a.push(`+ `+t),r.length&&a.push(`? ${Array(i+1).join(` `)}${r}
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./src-CgAVPA4I.mjs";import{a as t}from"./theme-BePJemMn.mjs";import"./ui-DjQ4AQww.mjs";import{a as n,i as r,n as i,r as a,t as o}from"./spawn-Bj8QRFJ5.mjs";import{t as s}from"./registry-CJvn75Bq.mjs";const c={command:`dev [implArgs..]`,describe:`Run the project's Cloudflare dev server`,builder:e=>e.positional(`implArgs`,{type:`string`,array:!0,describe:`Arguments forwarded to the dev-server implementation`}).parserConfiguration({"unknown-options-as-args":!0,"camel-case-expansion":!1}).epilogue(`cf dev starts the appropriate development server for your project. It runs your framework's dev command when available, falling back to an installed Cloudflare dev server.
2
+ import{t as e}from"./src-CHW7s5IS.mjs";import{a as t}from"./theme-BePJemMn.mjs";import"./ui-DIpjthrV.mjs";import{a as n,i as r,n as i,r as a,t as o}from"./spawn-CHkoow5W.mjs";import{t as s}from"./registry-DDcSvd8H.mjs";const c={command:`dev [implArgs..]`,describe:`Run the project's Cloudflare dev server`,builder:e=>e.positional(`implArgs`,{type:`string`,array:!0,describe:`Arguments forwarded to the dev-server implementation`}).parserConfiguration({"unknown-options-as-args":!0,"camel-case-expansion":!1}).epilogue(`cf dev starts the appropriate development server for your project. It runs your framework's dev command when available, falling back to an installed Cloudflare dev server.
3
3
 
4
4
  Arguments after ${t.brand(`cf dev`)} are not forwarded to non-Cloudflare development servers. Run the non-Cloudflare dev command directly to pass additional arguments.`),handler:async t=>{let c=process.cwd(),l=await a(c);l&&!l.configured&&await r(l);let u=(t.implArgs??[]).map(String);throw l?.devCommand?u.length>0?Error(`Arguments cannot currently be forwarded to the detected dev command \`${l.devCommand}\`. Run that command directly with the required arguments.`):new e(await n(l.devCommand,c,{...l.env,...s()})):new e(await o(i(c),`dev`,u))}};export{c as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-DM4z101s.mjs";function p(e){return e.option(`check-type`,{type:`string`,description:`type of check to perform`,choices:[`icmp`],default:`icmp`}).option(`endpoint`,{type:`string`,description:`the IP address of the host to perform checks against`}).option(`name`,{type:`string`,description:`Optional name associated with this check`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create Endpoint Health Check.`,builder:p,handler:async f=>{if(f.dryRun){a({command:`cf diagnostics endpoint-healthchecks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({check_type:l(f[`check-type`],`check-type`,`text`),endpoint:l(f.endpoint,`endpoint`,`text`),name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.diagnostics.endpointHealthchecks.create({body:e,account_id:m})),{successLabel:`Created`});return}f[`check-type`]===void 0&&(f[`check-type`]=await d(`check-type`,`type of check to perform`,[`icmp`])),f.endpoint===void 0&&(f.endpoint=await u(`endpoint`,`the IP address of the host to perform checks against`));let h=c({check_type:l(f[`check-type`],`check-type`,`text`),endpoint:l(f.endpoint,`endpoint`,`text`),name:l(f.name,`name`,`text`)});i(await o(`Creating`,async()=>p.diagnostics.endpointHealthchecks.create({body:h,account_id:m})),{successLabel:`Created`})}};function h(e){return e.positional(`id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <id>`,describe:`Delete Endpoint Health Check.`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf diagnostics endpoint-healthchecks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-CDtLWxNv.mjs";function p(e){return e.option(`check-type`,{type:`string`,description:`type of check to perform`,choices:[`icmp`],default:`icmp`}).option(`endpoint`,{type:`string`,description:`the IP address of the host to perform checks against`}).option(`name`,{type:`string`,description:`Optional name associated with this check`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create Endpoint Health Check.`,builder:p,handler:async f=>{if(f.dryRun){a({command:`cf diagnostics endpoint-healthchecks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({check_type:l(f[`check-type`],`check-type`,`text`),endpoint:l(f.endpoint,`endpoint`,`text`),name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.diagnostics.endpointHealthchecks.create({body:e,account_id:m})),{successLabel:`Created`});return}f[`check-type`]===void 0&&(f[`check-type`]=await d(`check-type`,`type of check to perform`,[`icmp`])),f.endpoint===void 0&&(f.endpoint=await u(`endpoint`,`the IP address of the host to perform checks against`));let h=c({check_type:l(f[`check-type`],`check-type`,`text`),endpoint:l(f.endpoint,`endpoint`,`text`),name:l(f.name,`name`,`text`)});i(await o(`Creating`,async()=>p.diagnostics.endpointHealthchecks.create({body:h,account_id:m})),{successLabel:`Created`})}};function h(e){return e.positional(`id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <id>`,describe:`Delete Endpoint Health Check.`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf diagnostics endpoint-healthchecks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.diagnostics.endpointHealthchecks.delete({account_id:l,id:s.id})),{successLabel:`Deleted`})}};function _(e){return e.positional(`id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <id>`,describe:`Get a single Endpoint Health Check.`,builder:_,handler:async s=>{if(s.dryRun){a({command:`cf diagnostics endpoint-healthchecks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.diagnostics.endpointHealthchecks.get({account_id:l,id:s.id})),{successLabel:`Loaded`})}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`List Endpoint Health Checks.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf diagnostics endpoint-healthchecks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.diagnostics.endpointHealthchecks.list({account_id:l})),{successLabel:`Loaded`})}};function x(e){return e.positional(`id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`check-type`,{type:`string`,description:`type of check to perform`,choices:[`icmp`]}).option(`endpoint`,{type:`string`,description:`the IP address of the host to perform checks against`}).option(`name`,{type:`string`,description:`Optional name associated with this check`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`update <id>`,describe:`Update a Endpoint Health Check.`,builder:x,handler:async f=>{if(f.dryRun){a({command:`cf diagnostics endpoint-healthchecks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/endpoint-healthchecks/${f.id==null?`<id>`:encodeURIComponent(String(f.id))}`,pathParams:{id:String(f.id??``)},bodyKind:`json`,body:f.body===void 0?c({check_type:l(f[`check-type`],`check-type`,`text`),endpoint:l(f.endpoint,`endpoint`,`text`),name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Updating`,async()=>p.diagnostics.endpointHealthchecks.update({body:e,account_id:m,id:f.id})),{successLabel:`Updated`});return}f[`check-type`]===void 0&&(f[`check-type`]=await d(`check-type`,`type of check to perform`,[`icmp`])),f.endpoint===void 0&&(f.endpoint=await u(`endpoint`,`the IP address of the host to perform checks against`));let h=c({check_type:l(f[`check-type`],`check-type`,`text`),endpoint:l(f.endpoint,`endpoint`,`text`),name:l(f.name,`name`,`text`)});i(await o(`Updating`,async()=>p.diagnostics.endpointHealthchecks.update({body:h,account_id:m,id:f.id})),{successLabel:`Updated`})}},C={command:`endpoint-healthchecks`,describe:`Monitor external endpoint availability with periodic HTTP/HTTPS health checks`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`colos`,{type:`string`,array:!0,description:`If no source colo names specified, all colos will be used. China colos are unavailable for traceroutes.`}).option(`options-max-ttl`,{type:`number`,description:`Max TTL.`,default:15}).option(`options-packet-type`,{type:`string`,description:`Type of packet sent.`,choices:[`icmp`,`tcp`,`udp`,`gre`,`gre+icmp`],default:`icmp`}).option(`options-packets-per-ttl`,{type:`number`,description:`Number of packets sent at each TTL.`,default:3}).option(`options-port`,{type:`number`,description:`For UDP and TCP, specifies the destination port. For ICMP, specifies the initial ICMP sequence value. Default value 0 will choose the best value to use for each protocol.`,default:0}).option(`options-wait-time`,{type:`number`,description:`Set the time (in seconds) to wait for a response to a probe.`,default:1}).option(`targets`,{type:`string`,array:!0,description:`The targets field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Run traceroutes from Cloudflare colos.`,builder:w,handler:async u=>{if(u.dryRun){a({command:`cf diagnostics traceroutes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/diagnostics/traceroute`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({colos:u.colos,options:{max_ttl:u[`options-max-ttl`],packet_type:l(u[`options-packet-type`],`options-packet-type`,`text`),packets_per_ttl:u[`options-packets-per-ttl`],port:u[`options-port`],wait_time:u[`options-wait-time`]},targets:u.targets}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.diagnostics.traceroutes.create({...e,account_id:f})),{successLabel:`Created`});return}if(u.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let p=c({colos:u.colos,options:{max_ttl:u[`options-max-ttl`],packet_type:l(u[`options-packet-type`],`options-packet-type`,`text`),packets_per_ttl:u[`options-packets-per-ttl`],port:u[`options-port`],wait_time:u[`options-wait-time`]},targets:u.targets});i(await o(`Creating`,async()=>d.diagnostics.traceroutes.create({...p,account_id:f})),{successLabel:`Created`})}},E={command:`traceroutes`,describe:`Run traceroutes from Cloudflare data centers to diagnose network path issues`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`diagnostics`,describe:`Network diagnostic tools — traceroutes from Cloudflare's edge and endpoint health checks`,builder:e=>e.command(C).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{D as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-DM4z101s.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.option(`host-ipv4`,{type:`string`,description:`The host.ipv4 field`}).option(`host-network-tunnel-id`,{type:`string`,description:`The host.network.tunnel_id field`}).option(`host-ipv6`,{type:`string`,description:`The host.ipv6 field`}).option(`host-hostname`,{type:`string`,description:`The host.hostname field`}).option(`host-resolver-network-resolver-ips`,{type:`string`,array:!0,description:`The host.resolver_network.resolver_ips field`}).option(`host-resolver-network-tunnel-id`,{type:`string`,description:`The host.resolver_network.tunnel_id field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tls-settings-cert-verification-mode`,{type:`string`,description:'TLS certificate verification mode for the connection to the origin.\n\n- `"verify_full"` — verify certificate chain and hostname (default)\n- `"verify_ca"` — verify certificate chain only, skip hostname check\n- `"disabled"` — do not verify the server certificate at all'}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).option(`http-port`,{type:`number`,description:`The http_port field`}).option(`https-port`,{type:`number`,description:`The https_port field`}).option(`app-protocol`,{type:`string`,description:`The app_protocol field`,choices:[`postgresql`,`mysql`]}).option(`tcp-port`,{type:`number`,description:`The tcp_port field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`host-ipv4`,[`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-ipv6`,[`host-ipv4`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-hostname`,[`host-ipv4`,`host-ipv6`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-ipv6`]).conflicts(`http-port`,[`app-protocol`,`tcp-port`]).conflicts(`https-port`,[`app-protocol`,`tcp-port`]).conflicts(`app-protocol`,[`http-port`,`https-port`]).conflicts(`tcp-port`,[`http-port`,`https-port`]).check(e=>{if([`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`].some(t=>e[t]!==void 0)){let t=[`host-network-tunnel-id`,`host-resolver-network-tunnel-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --host-* flag is set`)}return!0}).check(e=>{if([`tls-settings-cert-verification-mode`].some(t=>e[t]!==void 0)){let t=[`tls-settings-cert-verification-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --tls_settings-* flag is set`)}return!0})}const h={command:`create`,describe:`Creates a new Workers VPC connectivity service in the account.`,builder:m,handler:async f=>{if(f.dryRun){a({command:`cf directory services create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/connectivity/directory/services`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.directory.services.create({body:e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await u(`name`,`The name field`)),f.type===void 0&&(f.type=await d(`type`,`The type field`,[`tcp`,`http`]));let h=c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]});i(await o(`Creating`,async()=>p.directory.services.create({body:h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <service-id>`,describe:`Removes a single Workers VPC connectivity service by its ID.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf directory services delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/connectivity/directory/services/${s[`service-id`]==null?`<service-id>`:encodeURIComponent(String(s[`service-id`]))}`,pathParams:{"service-id":String(s[`service-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-CDtLWxNv.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.option(`host-ipv4`,{type:`string`,description:`The host.ipv4 field`}).option(`host-network-tunnel-id`,{type:`string`,description:`The host.network.tunnel_id field`}).option(`host-ipv6`,{type:`string`,description:`The host.ipv6 field`}).option(`host-hostname`,{type:`string`,description:`The host.hostname field`}).option(`host-resolver-network-resolver-ips`,{type:`string`,array:!0,description:`The host.resolver_network.resolver_ips field`}).option(`host-resolver-network-tunnel-id`,{type:`string`,description:`The host.resolver_network.tunnel_id field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tls-settings-cert-verification-mode`,{type:`string`,description:'TLS certificate verification mode for the connection to the origin.\n\n- `"verify_full"` — verify certificate chain and hostname (default)\n- `"verify_ca"` — verify certificate chain only, skip hostname check\n- `"disabled"` — do not verify the server certificate at all'}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).option(`http-port`,{type:`number`,description:`The http_port field`}).option(`https-port`,{type:`number`,description:`The https_port field`}).option(`app-protocol`,{type:`string`,description:`The app_protocol field`,choices:[`postgresql`,`mysql`]}).option(`tcp-port`,{type:`number`,description:`The tcp_port field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`host-ipv4`,[`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-ipv6`,[`host-ipv4`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-hostname`,[`host-ipv4`,`host-ipv6`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-ipv6`]).conflicts(`http-port`,[`app-protocol`,`tcp-port`]).conflicts(`https-port`,[`app-protocol`,`tcp-port`]).conflicts(`app-protocol`,[`http-port`,`https-port`]).conflicts(`tcp-port`,[`http-port`,`https-port`]).check(e=>{if([`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`].some(t=>e[t]!==void 0)){let t=[`host-network-tunnel-id`,`host-resolver-network-tunnel-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --host-* flag is set`)}return!0}).check(e=>{if([`tls-settings-cert-verification-mode`].some(t=>e[t]!==void 0)){let t=[`tls-settings-cert-verification-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --tls_settings-* flag is set`)}return!0})}const h={command:`create`,describe:`Creates a new Workers VPC connectivity service in the account.`,builder:m,handler:async f=>{if(f.dryRun){a({command:`cf directory services create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/connectivity/directory/services`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.directory.services.create({body:e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await u(`name`,`The name field`)),f.type===void 0&&(f.type=await d(`type`,`The type field`,[`tcp`,`http`]));let h=c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]});i(await o(`Creating`,async()=>p.directory.services.create({body:h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <service-id>`,describe:`Removes a single Workers VPC connectivity service by its ID.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf directory services delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/connectivity/directory/services/${s[`service-id`]==null?`<service-id>`:encodeURIComponent(String(s[`service-id`]))}`,pathParams:{"service-id":String(s[`service-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.directory.services.delete({account_id:l,service_id:s[`service-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <service-id>`,describe:`Fetches a single Workers VPC connectivity service by its ID.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf directory services get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/connectivity/directory/services/${s[`service-id`]==null?`<service-id>`:encodeURIComponent(String(s[`service-id`]))}`,pathParams:{"service-id":String(s[`service-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.directory.services.get({account_id:l,service_id:s[`service-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`type`,{type:`string`,description:`Type`,choices:[`tcp`,`http`]}).option(`page`,{type:`number`,description:`Current page in the response`}).option(`per-page`,{type:`number`,description:`Max amount of entries returned per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists the Workers VPC connectivity services in the account.`,builder:p(b),handler:async s=>{let c={type:s.type,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf directory services list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/connectivity/directory/services`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.directory.services.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`service-id`,{type:`string`,description:`Service ID`,demandOption:!0}).option(`host-ipv4`,{type:`string`,description:`The host.ipv4 field`}).option(`host-network-tunnel-id`,{type:`string`,description:`The host.network.tunnel_id field`}).option(`host-ipv6`,{type:`string`,description:`The host.ipv6 field`}).option(`host-hostname`,{type:`string`,description:`The host.hostname field`}).option(`host-resolver-network-resolver-ips`,{type:`string`,array:!0,description:`The host.resolver_network.resolver_ips field`}).option(`host-resolver-network-tunnel-id`,{type:`string`,description:`The host.resolver_network.tunnel_id field`}).option(`name`,{type:`string`,description:`The name field`}).option(`tls-settings-cert-verification-mode`,{type:`string`,description:'TLS certificate verification mode for the connection to the origin.\n\n- `"verify_full"` — verify certificate chain and hostname (default)\n- `"verify_ca"` — verify certificate chain only, skip hostname check\n- `"disabled"` — do not verify the server certificate at all'}).option(`type`,{type:`string`,description:`The type field`,choices:[`tcp`,`http`]}).option(`http-port`,{type:`number`,description:`The http_port field`}).option(`https-port`,{type:`number`,description:`The https_port field`}).option(`app-protocol`,{type:`string`,description:`The app_protocol field`,choices:[`postgresql`,`mysql`]}).option(`tcp-port`,{type:`number`,description:`The tcp_port field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`host-ipv4`,[`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-ipv6`,[`host-ipv4`,`host-hostname`,`host-resolver-network-resolver-ips`]).conflicts(`host-hostname`,[`host-ipv4`,`host-ipv6`]).conflicts(`host-resolver-network-resolver-ips`,[`host-ipv4`,`host-ipv6`]).conflicts(`http-port`,[`app-protocol`,`tcp-port`]).conflicts(`https-port`,[`app-protocol`,`tcp-port`]).conflicts(`app-protocol`,[`http-port`,`https-port`]).conflicts(`tcp-port`,[`http-port`,`https-port`]).check(e=>{if([`host-ipv4`,`host-network-tunnel-id`,`host-ipv6`,`host-hostname`,`host-resolver-network-resolver-ips`,`host-resolver-network-tunnel-id`].some(t=>e[t]!==void 0)){let t=[`host-network-tunnel-id`,`host-resolver-network-tunnel-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --host-* flag is set`)}return!0}).check(e=>{if([`tls-settings-cert-verification-mode`].some(t=>e[t]!==void 0)){let t=[`tls-settings-cert-verification-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --tls_settings-* flag is set`)}return!0})}const C={command:`update <service-id>`,describe:`Updates an existing Workers VPC connectivity service by its ID.`,builder:S,handler:async f=>{if(f.dryRun){a({command:`cf directory services update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/connectivity/directory/services/${f[`service-id`]==null?`<service-id>`:encodeURIComponent(String(f[`service-id`]))}`,pathParams:{"service-id":String(f[`service-id`]??``)},bodyKind:`json`,body:f.body===void 0?c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Updating`,async()=>p.directory.services.update({body:e,account_id:m,service_id:f[`service-id`]})),{successLabel:`Updated`});return}f.name===void 0&&(f.name=await u(`name`,`The name field`)),f.type===void 0&&(f.type=await d(`type`,`The type field`,[`tcp`,`http`]));let h=c({host:{ipv4:l(f[`host-ipv4`],`host-ipv4`,`text`),network:{tunnel_id:l(f[`host-network-tunnel-id`],`host-network-tunnel-id`,`text`)},ipv6:l(f[`host-ipv6`],`host-ipv6`,`text`),hostname:l(f[`host-hostname`],`host-hostname`,`text`),resolver_network:{resolver_ips:f[`host-resolver-network-resolver-ips`],tunnel_id:l(f[`host-resolver-network-tunnel-id`],`host-resolver-network-tunnel-id`,`text`)}},name:l(f.name,`name`,`text`),tls_settings:{cert_verification_mode:l(f[`tls-settings-cert-verification-mode`],`tls-settings-cert-verification-mode`,`text`)},type:l(f.type,`type`,`text`),http_port:f[`http-port`],https_port:f[`https-port`],app_protocol:l(f[`app-protocol`],`app-protocol`,`text`),tcp_port:f[`tcp-port`]});i(await o(`Updating`,async()=>p.directory.services.update({body:h,account_id:m,service_id:f[`service-id`]})),{successLabel:`Updated`})}},w={command:`services`,describe:`Operations for services`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`directory`,describe:`directory`,builder:e=>e.command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{a as r,r as i}from"./auth-C6MhC9EZ.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-C-oFUtvC.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u,t as d}from"./input-validation-BBKJRoRB.mjs";import{a as f,i as p,n as m}from"./prompt-DM4z101s.mjs";function h(e){return e.option(`name`,{type:`string`,description:`The name of the dispatch namespace.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create a new Workers for Platforms namespace.`,builder:h,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({name:u(r.name,`name`,`text`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.dispatchNamespaces.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({name:u(r.name,`name`,`text`)});a(await s(`Creating`,async()=>d.dispatchNamespaces.create({...p,account_id:f})),{successLabel:`Created`})}};function g(e){return e.positional(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <dispatch-namespace>`,describe:`Delete a Workers for Platforms namespace.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{a as r,r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u,t as d}from"./input-validation-BBKJRoRB.mjs";import{a as f,i as p,n as m}from"./prompt-CDtLWxNv.mjs";function h(e){return e.option(`name`,{type:`string`,description:`The name of the dispatch namespace.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create a new Workers for Platforms namespace.`,builder:h,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({name:u(r.name,`name`,`text`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.dispatchNamespaces.create({...e,account_id:f})),{successLabel:`Created`});return}let p=l({name:u(r.name,`name`,`text`)});a(await s(`Creating`,async()=>d.dispatchNamespaces.create({...p,account_id:f})),{successLabel:`Created`})}};function g(e){return e.positional(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <dispatch-namespace>`,describe:`Delete a Workers for Platforms namespace.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>c.dispatchNamespaces.delete({account_id:l,dispatch_namespace:r[`dispatch-namespace`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the dispatch namespace.`}).option(`trusted-workers`,{type:`boolean`,description:'Whether the Workers in the namespace are executed in a "trusted" manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the `request.cf` object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and `request.cf` is undefined. By default, Workers in a namespace are "untrusted".'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`edit <dispatch-namespace>`,describe:`Patch a Workers for Platforms namespace. Omitted fields are left unchanged.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``)},bodyKind:`json`,body:r.body===void 0?l({name:u(r.name,`name`,`text`),trusted_workers:r[`trusted-workers`]}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.dispatchNamespaces.edit({...e,account_id:f,dispatch_namespace:r[`dispatch-namespace`]})),{successLabel:`Updated`});return}let p=l({name:u(r.name,`name`,`text`),trusted_workers:r[`trusted-workers`]});a(await s(`Updating`,async()=>d.dispatchNamespaces.edit({...p,account_id:f,dispatch_namespace:r[`dispatch-namespace`]})),{successLabel:`Updated`})}};function b(e){return e.positional(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <dispatch-namespace>`,describe:`Get a Workers for Platforms namespace.`,builder:b,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.dispatchNamespaces.get({account_id:l,dispatch_namespace:r[`dispatch-namespace`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Fetch a list of Workers for Platforms namespaces.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.dispatchNamespaces.list({account_id:l})),{successLabel:`Loaded`})}};function w(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create <script-name>`,describe:`Start uploading a collection of assets for use in a Worker version. To learn more about the direct uploads of assets, see https://developers.cloudflare.com/workers/static-assets/direct-upload/.`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces scripts asset-upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}/scripts/${r[`script-name`]==null?`<script-name>`:encodeURIComponent(String(r[`script-name`]))}/assets-upload-session`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``),"script-name":String(r[`script-name`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:c(r.body)});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.dispatchNamespaces.scripts.assetUpload.create({body:e,account_id:u,dispatch_namespace:r[`dispatch-namespace`],script_name:r[`script-name`]})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},E={command:`asset-upload`,describe:`Operations for scripts.asset-upload`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <script-name>`,describe:`Fetch script bindings from a script uploaded to a Workers for Platforms namespace.`,builder:D,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces scripts bindings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}/scripts/${r[`script-name`]==null?`<script-name>`:encodeURIComponent(String(r[`script-name`]))}/bindings`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``),"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.dispatchNamespaces.scripts.bindings.get({account_id:l,dispatch_namespace:r[`dispatch-namespace`],script_name:r[`script-name`]})),{successLabel:`Loaded`})}},k={command:`bindings`,describe:`Operations for scripts.bindings`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`tags`,{type:`string`,description:`Filter scripts by tags before deletion. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'.`}).option(`limit`,{type:`number`,description:`Limit the number of scripts to delete.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const j={command:`bulk-delete`,describe:`Delete multiple scripts from a Workers for Platforms namespace based on optional tag filters.`,builder:A,handler:async r=>{let c={tags:r.tags,limit:r.limit};if(r.dryRun){o({command:`cf dispatch-namespaces scripts bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}/scripts`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await m({force:!!r.force})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>l.dispatchNamespaces.scripts.bulkDelete({account_id:u,dispatch_namespace:r[`dispatch-namespace`],...c})),{successLabel:`Deleted`})}};function M(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <script-name>`,describe:`Fetch script content from a script uploaded to a Workers for Platforms namespace.`,builder:M,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces scripts content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}/scripts/${r[`script-name`]==null?`<script-name>`:encodeURIComponent(String(r[`script-name`]))}/content`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``),"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.dispatchNamespaces.scripts.content.get({account_id:l,dispatch_namespace:r[`dispatch-namespace`],script_name:r[`script-name`]})),{successLabel:`Loaded`})}};function P(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`cf-worker-body-part`,{type:`string`,description:`The multipart name of a script upload part containing script content in service worker format. Alternative to including in a metadata part.`}).option(`cf-worker-main-module-part`,{type:`string`,description:`The multipart name of a script upload part containing script content in es module format. Alternative to including in a metadata part.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.<br/>Possible Content-Type(s) are: `application/javascript+module`, `text/javascript+module`, `application/javascript`, `text/javascript`, `text/x-python`, `text/x-python-requirement`, `application/wasm`, `text/plain`, `application/octet-stream`, `application/source-map`."}).option(`metadata`,{type:`string`,description:`JSON-encoded metadata about the uploaded parts and Worker configuration.`})}const F={command:`update <script-name>`,describe:`Put script content for a script uploaded to a Workers for Platforms namespace.`,builder:P,handler:async c=>{let l={};if(c[`cf-worker-body-part`]!==void 0&&(l[`CF-WORKER-BODY-PART`]=String(c[`cf-worker-body-part`])),c[`cf-worker-main-module-part`]!==void 0&&(l[`CF-WORKER-MAIN-MODULE-PART`]=String(c[`cf-worker-main-module-part`])),c.dryRun){o({command:`cf dispatch-namespaces scripts content update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${c[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(c[`dispatch-namespace`]))}/scripts/${c[`script-name`]==null?`<script-name>`:encodeURIComponent(String(c[`script-name`]))}/content`,pathParams:{"dispatch-namespace":String(c[`dispatch-namespace`]??``),"script-name":String(c[`script-name`]??``)},bodyKind:`multipart`,body:{body:c.body,file:c.file,files:c.files,metadata:c.metadata}});return}let f=await i(c),p=c.local?e:await t();if(c.accountId=p,c.file!==void 0||c.body!==void 0||c.files!==void 0||c.metadata!==void 0){let e=new FormData;if(c.file){let t=d(c.file);e.append(`file`,new Blob([t]),c.file.split(/[\\/]/).filter(Boolean).pop())}else c.body!==void 0&&e.append(`file`,c.body);if(c.files!==void 0){let t=typeof c.files==`string`?u(c.files,`files`,`text`):c.files;e.append(`files`,typeof t==`string`?t:JSON.stringify(t))}if(c.metadata!==void 0){let t=typeof c.metadata==`string`?u(c.metadata,`metadata`,`text`):c.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}a(await s(`Updating`,async()=>r(f,`PUT`,`/accounts/${p}/workers/dispatch/namespaces/${encodeURIComponent(String(c[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(c[`script-name`]))}/content`,{body:e,headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`});return}if(c.body){let e=u(c.body,`body`,`binary`);a(await s(`Updating`,async()=>r(f,`PUT`,`/accounts/${p}/workers/dispatch/namespaces/${encodeURIComponent(String(c[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(c[`script-name`]))}/content`,{body:e,headers:{"Content-Type":`multipart/form-data`,...l}})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},I={command:`content`,describe:`Operations for scripts.content`,builder:e=>e.command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`If set to true, delete will not be stopped by associated service binding, durable object, or other binding. Any of these associated bindings/durable objects will be deleted along with the script.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`delete <script-name>`,describe:`Delete a worker from a Workers for Platforms namespace. This call has no response body on a successful delete.`,builder:L,handler:async r=>{let c={force:r.force};if(r.dryRun){o({command:`cf dispatch-namespaces scripts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}/scripts/${r[`script-name`]==null?`<script-name>`:encodeURIComponent(String(r[`script-name`]))}`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``),"script-name":String(r[`script-name`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await m({force:!!r.force})){process.stderr.write(`Aborted.
5
5
  `);return}a(await s(`Deleting`,async()=>l.dispatchNamespaces.scripts.delete({account_id:u,dispatch_namespace:r[`dispatch-namespace`],script_name:r[`script-name`],...c})),{successLabel:`Deleted`})}};function z(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get <script-name>`,describe:`Fetch information about a script uploaded to a Workers for Platforms namespace.`,builder:z,handler:async r=>{if(r.dryRun){o({command:`cf dispatch-namespaces scripts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}/scripts/${r[`script-name`]==null?`<script-name>`:encodeURIComponent(String(r[`script-name`]))}`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``),"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.dispatchNamespaces.scripts.get({account_id:l,dispatch_namespace:r[`dispatch-namespace`],script_name:r[`script-name`]})),{successLabel:`Loaded`})}};function V(e){return e.option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`tags`,{type:`string`,description:`Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`Fetch a list of scripts uploaded to a Workers for Platforms namespace.`,builder:V,handler:async r=>{let c={tags:r.tags};if(r.dryRun){o({command:`cf dispatch-namespaces scripts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}/scripts`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.dispatchNamespaces.scripts.list({account_id:u,dispatch_namespace:r[`dispatch-namespace`],...c})),{successLabel:`Loaded`})}};function U(e){return e.option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`JSON Merge Patch (RFC 7396) request body for bulk secret changes. `}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const te={command:`bulk-edit`,describe:"Create, update, or delete multiple secrets on a script in a single operation using JSON Merge Patch (RFC 7396). Usage: - To create or update a secret, set its value to a secret object. - To delete a secret, set its value to `null`. - Secrets not included in the request are left unchanged.",builder:U,handler:async l=>{if(l.dryRun){o({command:`cf dispatch-namespaces scripts secrets bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${l[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(l[`dispatch-namespace`]))}/scripts/${l[`script-name`]==null?`<script-name>`:encodeURIComponent(String(l[`script-name`]))}/secrets-bulk`,pathParams:{"dispatch-namespace":String(l[`dispatch-namespace`]??``),"script-name":String(l[`script-name`]??``)},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let u=await i(l),f=l.local?e:await t();if(l.accountId=f,l.file){let e=d(l.file);a(await s(`Updating`,async()=>r(u,`PATCH`,`/accounts/${f}/workers/dispatch/namespaces/${encodeURIComponent(String(l[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(l[`script-name`]))}/secrets-bulk`,{body:e,headers:{"Content-Type":`application/merge-patch+json`}})),{successLabel:`Updated`});return}if(l.body){let e=c(l.body);a(await s(`Updating`,async()=>r(u,`PATCH`,`/accounts/${f}/workers/dispatch/namespaces/${encodeURIComponent(String(l[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(l[`script-name`]))}/secrets-bulk`,{body:e})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function W(e){return e.positional(`secret-name`,{type:`string`,description:`A JavaScript variable name for the secret binding.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`url-encoded`,{type:`boolean`,description:`Flag that indicates whether the secret name is URL encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const G={command:`delete <secret-name>`,describe:`Remove a secret from a script uploaded to a Workers for Platforms namespace.`,builder:W,handler:async r=>{let c={url_encoded:r[`url-encoded`]};if(r.dryRun){o({command:`cf dispatch-namespaces scripts secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/dispatch/namespaces/${r[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(r[`dispatch-namespace`]))}/scripts/${r[`script-name`]==null?`<script-name>`:encodeURIComponent(String(r[`script-name`]))}/secrets/${r[`secret-name`]==null?`<secret-name>`:encodeURIComponent(String(r[`secret-name`]))}`,pathParams:{"dispatch-namespace":String(r[`dispatch-namespace`]??``),"script-name":String(r[`script-name`]??``),"secret-name":String(r[`secret-name`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();if(r.accountId=u,!await m({force:!!r.force})){process.stderr.write(`Aborted.
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,n as d}from"./prompt-DM4z101s.mjs";import{t as f}from"./cli-types-BWdZbsFE.mjs";function p(e){return e.option(`cidr`,{type:`string`,description:`IP prefix in CIDR notation to bind.`}).option(`prefix-id`,{type:`string`,description:`The ID of the parent IP prefix that contains the CIDR.`}).option(`region-key`,{type:`string`,description:`Region key from managed regions (e.g., "us", "eu").`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a DLS prefix binding`,builder:p,handler:async d=>{if(d.dryRun){a({command:`cf dls regional_services prefix_bindings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dls/regional_services/prefix_bindings`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({cidr:l(d.cidr,`cidr`,`text`),prefix_id:l(d[`prefix-id`],`prefix-id`,`text`),region_key:l(d[`region-key`],`region-key`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dls.regionalServices.prefixBindings.create({...e,account_id:p})),{successLabel:`Created`});return}d.cidr===void 0&&(d.cidr=await u(`cidr`,`IP prefix in CIDR notation to bind.`)),d[`prefix-id`]===void 0&&(d[`prefix-id`]=await u(`prefix-id`,`The ID of the parent IP prefix that contains the CIDR.`)),d[`region-key`]===void 0&&(d[`region-key`]=await u(`region-key`,`Region key from managed regions (e.g., "us", "eu").`));let m=c({cidr:l(d.cidr,`cidr`,`text`),prefix_id:l(d[`prefix-id`],`prefix-id`,`text`),region_key:l(d[`region-key`],`region-key`,`text`)});i(await o(`Creating`,async()=>f.dls.regionalServices.prefixBindings.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`binding-id`,{type:`string`,description:`Unique identifier for the prefix binding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <binding-id>`,describe:`Delete a DLS prefix binding`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf dls regional_services prefix_bindings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dls/regional_services/prefix_bindings/${s[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(s[`binding-id`]))}`,pathParams:{"binding-id":String(s[`binding-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,n as d}from"./prompt-CDtLWxNv.mjs";import{t as f}from"./cli-types-BWdZbsFE.mjs";function p(e){return e.option(`cidr`,{type:`string`,description:`IP prefix in CIDR notation to bind.`}).option(`prefix-id`,{type:`string`,description:`The ID of the parent IP prefix that contains the CIDR.`}).option(`region-key`,{type:`string`,description:`Region key from managed regions (e.g., "us", "eu").`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a DLS prefix binding`,builder:p,handler:async d=>{if(d.dryRun){a({command:`cf dls regional_services prefix_bindings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dls/regional_services/prefix_bindings`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({cidr:l(d.cidr,`cidr`,`text`),prefix_id:l(d[`prefix-id`],`prefix-id`,`text`),region_key:l(d[`region-key`],`region-key`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dls.regionalServices.prefixBindings.create({...e,account_id:p})),{successLabel:`Created`});return}d.cidr===void 0&&(d.cidr=await u(`cidr`,`IP prefix in CIDR notation to bind.`)),d[`prefix-id`]===void 0&&(d[`prefix-id`]=await u(`prefix-id`,`The ID of the parent IP prefix that contains the CIDR.`)),d[`region-key`]===void 0&&(d[`region-key`]=await u(`region-key`,`Region key from managed regions (e.g., "us", "eu").`));let m=c({cidr:l(d.cidr,`cidr`,`text`),prefix_id:l(d[`prefix-id`],`prefix-id`,`text`),region_key:l(d[`region-key`],`region-key`,`text`)});i(await o(`Creating`,async()=>f.dls.regionalServices.prefixBindings.create({...m,account_id:p})),{successLabel:`Created`})}};function h(e){return e.positional(`binding-id`,{type:`string`,description:`Unique identifier for the prefix binding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <binding-id>`,describe:`Delete a DLS prefix binding`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf dls regional_services prefix_bindings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dls/regional_services/prefix_bindings/${s[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(s[`binding-id`]))}`,pathParams:{"binding-id":String(s[`binding-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
3
3
  `);return}i(await o(`Deleting`,async()=>c.dls.regionalServices.prefixBindings.delete({account_id:l,binding_id:s[`binding-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`binding-id`,{type:`string`,description:`Unique identifier for the prefix binding.`,demandOption:!0}).option(`region-key`,{type:`string`,description:`New region key to assign (e.g., "us", "eu", "cfcanary").`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`edit <binding-id>`,describe:`Update a DLS prefix binding`,builder:_,handler:async d=>{if(d.dryRun){a({command:`cf dls regional_services prefix_bindings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dls/regional_services/prefix_bindings/${d[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(d[`binding-id`]))}`,pathParams:{"binding-id":String(d[`binding-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({region_key:l(d[`region-key`],`region-key`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.dls.regionalServices.prefixBindings.edit({...e,account_id:p,binding_id:d[`binding-id`]})),{successLabel:`Updated`});return}d[`region-key`]===void 0&&(d[`region-key`]=await u(`region-key`,`New region key to assign (e.g., "us", "eu", "cfcanary").`));let m=c({region_key:l(d[`region-key`],`region-key`,`text`)});i(await o(`Updating`,async()=>f.dls.regionalServices.prefixBindings.edit({...m,account_id:p,binding_id:d[`binding-id`]})),{successLabel:`Updated`})}};function y(e){return e.positional(`binding-id`,{type:`string`,description:`Unique identifier for the prefix binding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <binding-id>`,describe:`Get a DLS prefix binding`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf dls regional_services prefix_bindings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dls/regional_services/prefix_bindings/${s[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(s[`binding-id`]))}`,pathParams:{"binding-id":String(s[`binding-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dls.regionalServices.prefixBindings.get({account_id:l,binding_id:s[`binding-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`cursor`,{type:`string`,description:`Opaque token for cursor-based pagination. Omit for the first page. Pass the value from a previous response to fetch the next page.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List DLS prefix bindings for an account`,builder:x,handler:async s=>{let c={cursor:s.cursor,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf dls regional_services prefix_bindings list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dls/regional_services/prefix_bindings`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dls.regionalServices.prefixBindings.list({account_id:u,...c})),{successLabel:`Loaded`})}},C={command:`prefix_bindings`,describe:`Operations for regional_services.prefix_bindings`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`regional_services`,describe:`Operations for regional_services`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`region-id`,{type:`string`,description:`UUID of the region (custom or managed) or region_key of a managed region.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <region-id>`,describe:`Get a DLS region`,builder:T,handler:async s=>{if(s.dryRun){a({command:`cf dls regions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dls/regions/${s[`region-id`]==null?`<region-id>`:encodeURIComponent(String(s[`region-id`]))}`,pathParams:{"region-id":String(s[`region-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dls.regions.get({account_id:l,region_id:s[`region-id`]})),{successLabel:`Loaded`})}};function D(e){return e.option(`cursor`,{type:`string`,description:`Opaque token for cursor-based pagination. Omit for the first page. Pass the value from a previous response to fetch the next page.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`type`,{type:`string`,description:`Filter regions by type. Omit to return all regions.`,choices:[`managed`,`custom`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List DLS regions for an account`,builder:f(D),handler:async s=>{let c={cursor:s.cursor,per_page:s[`per-page`],type:s.type};if(s.dryRun){a({command:`cf dls regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/dls/regions`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dls.regions.list({account_id:u,...c})),{successLabel:`Loaded`})}},k={command:`regions`,describe:`Operations for regions`,builder:e=>e.command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},A={command:`dls`,describe:`dls`,builder:e=>e.command(w).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{A as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{a as i,r as a}from"./auth-C6MhC9EZ.mjs";import{t as o}from"./output-DgW1hQGX.mjs";import{n as s,t as c}from"./progress-C-oFUtvC.mjs";import{n as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d,t as f}from"./input-validation-BBKJRoRB.mjs";import{a as p,n as m}from"./prompt-DM4z101s.mjs";import{t as h}from"./cli-types-BWdZbsFE.mjs";import{n as ee,t as te}from"./raw-fetch-25gXED6c.mjs";function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete`,describe:`Delete DNSSEC.`,builder:g,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n,h as r}from"./oauth-BPizUUqP.mjs";import{a as i,r as a}from"./auth-DuLchM18.mjs";import{t as o}from"./output-DgW1hQGX.mjs";import{n as s,t as c}from"./progress-B84wYh91.mjs";import{n as l,t as u}from"./body-parser-CYD7PKFC.mjs";import{n as d,t as f}from"./input-validation-BBKJRoRB.mjs";import{a as p,n as m}from"./prompt-CDtLWxNv.mjs";import{t as h}from"./cli-types-BWdZbsFE.mjs";import{n as ee,t as te}from"./raw-fetch-Dz-QBoP_.mjs";function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete`,describe:`Delete DNSSEC.`,builder:g,handler:async e=>{if(e.dryRun){s({command:`cf dns dnssec delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/dnssec`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await m({force:!!e.force})){process.stderr.write(`Aborted.
3
3
  `);return}o(await c(`Deleting`,async()=>t.dns.dnssec.delete({zone_id:n})),{successLabel:`Deleted`})}};function v(e){return e.option(`dnssec-multi-signer`,{type:`boolean`,description:`If true, multi-signer DNSSEC is enabled on the zone, allowing multiple
4
4
  providers to serve a DNSSEC-signed zone at the same time.
5
5
  This is required for DNSKEY records (except those automatically
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,n as d}from"./prompt-DM4z101s.mjs";function f(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`,default:!0}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
2
+ import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,n as d}from"./prompt-CDtLWxNv.mjs";function f(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`,default:!0}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
3
3
  indicated by the TTL received from upstream nameservers. This setting
4
4
  sets an upper bound on this duration. For caching purposes, higher TTLs
5
5
  will be decreased to the maximum value defined by this setting.
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n}from"./oauth-BjHjJtnn.mjs";import{r}from"./auth-C6MhC9EZ.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-C-oFUtvC.mjs";function s(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Returns the Durable Object namespaces owned by an account.`,builder:s,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.durableObjects.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function l(e){return e.option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Returns the Durable Objects in a given namespace.`,builder:l,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){a({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/durable_objects/namespaces/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/objects`,pathParams:{id:String(s.id??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.durableObjects.namespaces.objects.list({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},d={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(c).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`durable-objects`,describe:`durable-objects`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
2
+ import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";function s(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Returns the Durable Object namespaces owned by an account.`,builder:s,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.durableObjects.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function l(e){return e.option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Returns the Durable Objects in a given namespace.`,builder:l,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){a({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/durable_objects/namespaces/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/objects`,pathParams:{id:String(s.id??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.durableObjects.namespaces.objects.list({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},d={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(c).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`durable-objects`,describe:`durable-objects`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{h as e}from"./oauth-BjHjJtnn.mjs";import{r as t}from"./auth-C6MhC9EZ.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-C-oFUtvC.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";function s(e){return e.option(`enabled`,{type:`boolean`,description:`Enable or disable DMARC reports for this zone`}).option(`skip-wizard`,{type:`boolean`,description:`Skip the DMARC setup wizard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for PATCH /dmarc-reports`})}const c={command:`edit`,describe:"Updates the DMARC report configuration for a zone. At least one of `enabled` or `skip_wizard` must be provided. When enabling, the handler will ensure the DMARC RUA record exists in DNS.",builder:s,handler:async s=>{if(s.dryRun){r({command:`cf email-auth dmarc-reports edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/email/auth/dmarc-reports`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled,skip_wizard:s[`skip-wizard`]}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.emailAuth.dmarcReports.edit({...e,zone_id:l})),{successLabel:`Updated`});return}let u=o({enabled:s.enabled,skip_wizard:s[`skip-wizard`]});n(await i(`Updating`,async()=>c.emailAuth.dmarcReports.edit({...u,zone_id:l})),{successLabel:`Updated`})}};function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Retrieves the current DMARC report configuration and status for a zone. Returns the RUA prefix, enabled status, approved sources, and DNS records.`,builder:l,handler:async a=>{if(a.dryRun){r({command:`cf email-auth dmarc-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/email/auth/dmarc-reports`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.emailAuth.dmarcReports.get({zone_id:s})),{successLabel:`Loaded`})}},d={command:`dmarc-reports`,describe:`Operations for dmarc-reports`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.option(`id`,{type:`string`,description:`DNS record ID (rec_tag) to inspect`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`inspect`,describe:"Inspects a specific SPF TXT record and returns a parsed tree structure in the spflimit-worker format. The record ID must be provided via the `id` query parameter. Returns a recursive tree showing: - Parsed components with their qualifiers and types - Nested includes recursively resolved within components - Per-component and total lookup counts - Detailed error information with context",builder:f,handler:async a=>{let o={id:a.id};if(a.dryRun){r({command:`cf email-auth spf inspect`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/email/auth/spf/inspect`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.emailAuth.spf.inspect({zone_id:c,...o})),{successLabel:`Loaded`})}},m={command:`spf`,describe:`Operations for spf`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`email-auth`,describe:`email-auth`,builder:e=>e.command(d).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
2
+ import{h as e}from"./oauth-BPizUUqP.mjs";import{r as t}from"./auth-DuLchM18.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-B84wYh91.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";function s(e){return e.option(`enabled`,{type:`boolean`,description:`Enable or disable DMARC reports for this zone`}).option(`skip-wizard`,{type:`boolean`,description:`Skip the DMARC setup wizard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for PATCH /dmarc-reports`})}const c={command:`edit`,describe:"Updates the DMARC report configuration for a zone. At least one of `enabled` or `skip_wizard` must be provided. When enabling, the handler will ensure the DMARC RUA record exists in DNS.",builder:s,handler:async s=>{if(s.dryRun){r({command:`cf email-auth dmarc-reports edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/email/auth/dmarc-reports`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled,skip_wizard:s[`skip-wizard`]}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.emailAuth.dmarcReports.edit({...e,zone_id:l})),{successLabel:`Updated`});return}let u=o({enabled:s.enabled,skip_wizard:s[`skip-wizard`]});n(await i(`Updating`,async()=>c.emailAuth.dmarcReports.edit({...u,zone_id:l})),{successLabel:`Updated`})}};function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Retrieves the current DMARC report configuration and status for a zone. Returns the RUA prefix, enabled status, approved sources, and DNS records.`,builder:l,handler:async a=>{if(a.dryRun){r({command:`cf email-auth dmarc-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/email/auth/dmarc-reports`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.emailAuth.dmarcReports.get({zone_id:s})),{successLabel:`Loaded`})}},d={command:`dmarc-reports`,describe:`Operations for dmarc-reports`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.option(`id`,{type:`string`,description:`DNS record ID (rec_tag) to inspect`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`inspect`,describe:"Inspects a specific SPF TXT record and returns a parsed tree structure in the spflimit-worker format. The record ID must be provided via the `id` query parameter. Returns a recursive tree showing: - Parsed components with their qualifiers and types - Nested includes recursively resolved within components - Per-component and total lookup counts - Detailed error information with context",builder:f,handler:async a=>{let o={id:a.id};if(a.dryRun){r({command:`cf email-auth spf inspect`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/email/auth/spf/inspect`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.emailAuth.spf.inspect({zone_id:c,...o})),{successLabel:`Loaded`})}},m={command:`spf`,describe:`Operations for spf`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`email-auth`,describe:`email-auth`,builder:e=>e.command(d).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-eEF0NF51.mjs";import{f as t,g as n,h as r}from"./oauth-BjHjJtnn.mjs";import{r as i}from"./auth-C6MhC9EZ.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-C-oFUtvC.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,i as f,n as p}from"./prompt-DM4z101s.mjs";import{t as m}from"./cli-types-BWdZbsFE.mjs";function ee(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({email:u(r.email,`email`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.emailRouting.addresses.create({...e,account_id:p})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await d(`email`,`The contact email address of the user.`));let m=l({email:u(r.email,`email`,`text`)});a(await s(`Creating`,async()=>f.emailRouting.addresses.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <destination-address-identifier>`,describe:`Deletes a specific destination address.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
2
+ import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n,h as r}from"./oauth-BPizUUqP.mjs";import{r as i}from"./auth-DuLchM18.mjs";import{t as a}from"./output-DgW1hQGX.mjs";import{n as o,t as s}from"./progress-B84wYh91.mjs";import{n as c,t as l}from"./body-parser-CYD7PKFC.mjs";import{n as u}from"./input-validation-BBKJRoRB.mjs";import{a as d,i as f,n as p}from"./prompt-CDtLWxNv.mjs";import{t as m}from"./cli-types-BWdZbsFE.mjs";function ee(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({email:u(r.email,`email`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.emailRouting.addresses.create({...e,account_id:p})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await d(`email`,`The contact email address of the user.`));let m=l({email:u(r.email,`email`,`text`)});a(await s(`Creating`,async()=>f.emailRouting.addresses.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <destination-address-identifier>`,describe:`Deletes a specific destination address.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
3
3
  `);return}a(await s(`Deleting`,async()=>c.emailRouting.addresses.delete({account_id:l,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <destination-address-identifier>`,describe:`Gets information for a specific destination email already created.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.emailRouting.addresses.get({account_id:l,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Sorts results in an ascending or descending order.`,choices:[`asc`,`desc`]}).option(`verified`,{type:`string`,description:`Filter by verified destination addresses.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists existing destination addresses.`,builder:m(b),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],direction:r.direction,verified:r.verified};if(r.dryRun){o({command:`cf email-routing addresses list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.emailRouting.addresses.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,choices:[`unverified`,`verified`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <destination-address-identifier>`,describe:`Updates the status of a specific destination address.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?l({status:u(r.status,`status`,`text`)}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.emailRouting.addresses.update({...e,account_id:p,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Updated`});return}r.status===void 0&&(r.status=await f(`status`,`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,[`unverified`,`verified`]));let m=l({status:u(r.status,`status`,`text`)});a(await s(`Updating`,async()=>d.emailRouting.addresses.update({...m,account_id:p,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Updated`})}},w={command:`addresses`,describe:`Verified destination email addresses that can receive forwarded mail`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const E={command:`disable`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:T,handler:async e=>{if(e.dryRun){o({command:`cf email-routing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force,message:`This operation turns off email routing for a zone.`})){process.stderr.write(`Aborted.
4
4
  `);return}a(await s(`Deleting`,async()=>t.emailRouting.disable({zone_id:n})),{successLabel:`Deleted`})}};function D(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`create`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:D,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.dns.create({body:r,zone_id:n})),{successLabel:`Created`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.dns.create({body:d,zone_id:n})),{successLabel:`Created`})}};function k(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`delete`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:k,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
5
5
  `);return}if(e.body){let r=c(e.body);a(await s(`Deleting`,async()=>t.emailRouting.dns.delete({body:r,zone_id:n})),{successLabel:`Deleted`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Deleting`,async()=>t.emailRouting.dns.delete({body:d,zone_id:n})),{successLabel:`Deleted`})}};function j(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`edit`,describe:`Unlock MX Records previously locked by Email Routing.`,builder:j,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.dns.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.dns.edit({body:d,zone_id:n})),{successLabel:`Updated`})}};function N(e){return e.option(`subdomain`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Show the DNS records needed to configure your Email Routing zone.`,builder:N,handler:async e=>{let t={subdomain:e.subdomain};if(e.dryRun){o({command:`cf email-routing dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.emailRouting.dns.get({zone_id:c,...t})),{successLabel:`Loaded`})}},F={command:`dns`,describe:`DNS records required for email routing (MX, SPF, DKIM) — enable, lock, or disable`,builder:e=>e.command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`edit`,describe:`Update the settings for your Email Routing zone.`,builder:I,handler:async e=>{if(e.dryRun){o({command:`cf email-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.edit({...r,zone_id:n})),{successLabel:`Updated`});return}let u=l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});a(await s(`Updating`,async()=>t.emailRouting.edit({...u,zone_id:n})),{successLabel:`Updated`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`enable`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:R,handler:async e=>{if(e.dryRun){o({command:`cf email-routing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Creating`,async()=>t.emailRouting.enable({zone_id:n})),{successLabel:`Created`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Get information about the settings for your Email Routing zone.`,builder:z,handler:async e=>{if(e.dryRun){o({command:`cf email-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.get({zone_id:n})),{successLabel:`Loaded`})}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`Get information on the default catch-all routing rule.`,builder:V,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules catch-alls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.rules.catchAlls.get({zone_id:n})),{successLabel:`Loaded`})}};function U(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`update`,describe:`Enable or disable catch-all routing rule, or change action to forward to a specific destination address. Forward actions require exactly one verified destination address.`,builder:U,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules catch-alls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:u(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...r,zone_id:n})),{successLabel:`Updated`});return}let d=l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:u(e.source,`source`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...d,zone_id:n})),{successLabel:`Updated`})}},G={command:`catch-alls`,describe:`Operations for rules.catch-alls`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`,default:!0}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`,default:0}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`],default:`api`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const q={command:`create`,describe:`Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the email (like forwarding it to a specific destination address). Forward actions require exactly one verified destination address.`,builder:K,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.rules.create({...r,zone_id:n})),{successLabel:`Created`});return}let d=l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.rules.create({...d,zone_id:n})),{successLabel:`Created`})}};function J(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`delete <rule-identifier>`,describe:`Delete a specific routing rule.`,builder:J,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.