cf 1.0.0-beta.20 → 1.0.0-beta.21

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 (290) hide show
  1. package/README.md +1 -1
  2. package/dist/_meta/commands.json +911 -751
  3. package/dist/_meta/schemas.json +401 -382
  4. package/dist/{abuse-reports-mKv00yPh.mjs → abuse-reports-CbUAnJxd.mjs} +1 -1
  5. package/dist/{access-CyRjTbhh.mjs → access-C-78DlxL.mjs} +1 -1
  6. package/dist/{accounts-BmF_YKvG.mjs → accounts-DEqQPxCz.mjs} +8 -15
  7. package/dist/{acm-BcIFiAb8.mjs → acm-jmhCq3Yh.mjs} +2 -3
  8. package/dist/{addressing-D6xVD7MM.mjs → addressing-BeYFpQvC.mjs} +12 -23
  9. package/dist/{agent-memory-Blldunhv.mjs → agent-memory-Chlovb7j.mjs} +5 -9
  10. package/dist/{ai-CU8tdTfC.mjs → ai-BndH3HYN.mjs} +2 -3
  11. package/dist/{ai-audit-Id3hq5pV.mjs → ai-audit-BUJ-70O_.mjs} +1 -1
  12. package/dist/{ai-gateway-BKeZ28CQ.mjs → ai-gateway-CCk7VKhL.mjs} +9 -15
  13. package/dist/{ai-search-DOiZEmn7.mjs → ai-search-BexET_wp.mjs} +6 -11
  14. package/dist/{ai-security-CioADDZi.mjs → ai-security-D4MxRlxX.mjs} +3 -5
  15. package/dist/{alerting-BzN1N3Se.mjs → alerting-rw8Oi3x7.mjs} +5 -9
  16. package/dist/{analytics-engine-CugCQfDe.mjs → analytics-engine-Bk7dQLcm.mjs} +1 -1
  17. package/dist/{analytics-Cte-DrzH.mjs → analytics-q-guNEOK.mjs} +1 -1
  18. package/dist/{api-security-CCs0g510.mjs → api-security-BDc6gkf1.mjs} +9 -17
  19. package/dist/{argo-BHBFZnmO.mjs → argo-CnLIqm0i.mjs} +1 -1
  20. package/dist/args-BAOHroBC.mjs +2 -0
  21. package/dist/{artifacts-BzAwvrCD.mjs → artifacts-Cil33dzV.mjs} +4 -7
  22. package/dist/{audit-logs-jWivEKCy.mjs → audit-logs--E2Eclb7.mjs} +1 -1
  23. package/dist/auth-B0lEsD_1.mjs +2 -0
  24. package/dist/{auth-BUQscD5b.mjs → auth-BcNLQji1.mjs} +1 -1
  25. package/dist/auth-BtZmY6sE.mjs +2 -0
  26. package/dist/{auth-token-T0aqYgl9.mjs → auth-token-aF5AVLlH.mjs} +1 -1
  27. package/dist/{autoconfig-CBdcYYf4.mjs → autoconfig-Dbp6J25P.mjs} +88 -88
  28. package/dist/{basin-catalog-_8w_4599.mjs → basin-catalog-dnVyzopm.mjs} +3 -5
  29. package/dist/{billing-Ce0WN0yw.mjs → billing-Fqp3jB2V.mjs} +2 -3
  30. package/dist/{blocks-CFAm0Ma3.mjs → blocks-BOQH-Won.mjs} +1 -1
  31. package/dist/{bot-management-DskcSr4B.mjs → bot-management-SEDgo1Xg.mjs} +1 -1
  32. package/dist/{botnet-feed-CmBm13-D.mjs → botnet-feed-DPqR4M0Y.mjs} +2 -3
  33. package/dist/{brand-protection-DTuFrsN0.mjs → brand-protection-B8vwKfM9.mjs} +2 -3
  34. package/dist/{browser-run-CXdzSOHa.mjs → browser-run-BybYDq3I.mjs} +3 -5
  35. package/dist/build-BqGmiORA.mjs +2 -0
  36. package/dist/build-CWlpWVBf.mjs +2 -0
  37. package/dist/{builds-_1u5Nx6f.mjs → builds-CvtOG-Gk.mjs} +8 -15
  38. package/dist/cache-Bme_d2Wx.mjs +36 -0
  39. package/dist/cf-fIBhEAxU.mjs +18 -0
  40. package/dist/chunk-DSGVRFIS-DHC6NOIj.mjs +2 -0
  41. package/dist/{chunk-2K52M2W5-iYNzknM1.mjs → chunk-XVBBSNW2-DfMyGS-l.mjs} +8 -8
  42. package/dist/{cli-DyhOdzMo.mjs → cli-CIKDqm-u.mjs} +3 -3
  43. package/dist/{client-side-security-DnnYaRsd.mjs → client-side-security-ZQeRoo1t.mjs} +2 -3
  44. package/dist/{cloud-connector-Ct6b6pz8.mjs → cloud-connector-BeunZlNV.mjs} +1 -1
  45. package/dist/{cloudflared-CHLpWU35.mjs → cloudflared-DbzoIouQ.mjs} +1 -1
  46. package/dist/{cloudforce-one-Rl6nCCm0.mjs → cloudforce-one-D20t9ojD.mjs} +26 -51
  47. package/dist/{command-BwgvUpNx.mjs → command-B3uWlw57.mjs} +1 -1
  48. package/dist/{command-DuLxEkGq.mjs → command-BGRucANI.mjs} +1 -1
  49. package/dist/{command-BONLLcyz.mjs → command-C6kE7BU0.mjs} +1 -1
  50. package/dist/{command-DOpykk8X.mjs → command-C9CNvZi_.mjs} +1 -1
  51. package/dist/{command-BRpBIju7.mjs → command-CQ5qHE7n.mjs} +1 -1
  52. package/dist/{command-CHGc-KZ7.mjs → command-CkZkTjIj.mjs} +1 -1
  53. package/dist/{command-BRXOUAGD.mjs → command-CqKRlHGv.mjs} +1 -1
  54. package/dist/{command-BwlIi3Bv.mjs → command-CtlD6MEi.mjs} +1 -1
  55. package/dist/{command-CXzje7qc.mjs → command-CzWWQv8j.mjs} +1 -1
  56. package/dist/{command-BMYi_gS-.mjs → command-DWWuXQV8.mjs} +1 -1
  57. package/dist/{command-CPDQPdss.mjs → command-DkwmylF2.mjs} +1 -1
  58. package/dist/{command-CMa807gY.mjs → command-MxFFWqMg.mjs} +1 -1
  59. package/dist/{command-BVO9UOuU.mjs → command-orlUsdgf.mjs} +1 -1
  60. package/dist/{command-CVoDyQnL.mjs → command-prWMAJbg.mjs} +1 -1
  61. package/dist/{command-0WS5I_JW.mjs → command-rUCxlpQI.mjs} +1 -1
  62. package/dist/command-resolution-DAQ4PWUt.mjs +2 -0
  63. package/dist/{completions-DMwrvK_S.mjs → completions-2Otv0HMd.mjs} +1 -1
  64. package/dist/{connector-interrupts-DyWilINb.mjs → connector-interrupts-Dfhxupmg.mjs} +1 -1
  65. package/dist/{connector-telemetry-events-BUW9qTOs.mjs → connector-telemetry-events-CLVpDTIa.mjs} +1 -1
  66. package/dist/{connector-telemetry-snapshots-Djs5QssR.mjs → connector-telemetry-snapshots-E_1tmNmQ.mjs} +1 -1
  67. package/dist/{connectors-e_cpzDEm.mjs → connectors-ChJpQFSl.mjs} +2 -3
  68. package/dist/{containers-CEH15JUu.mjs → containers-Cj5-9nUg.mjs} +6 -9
  69. package/dist/containers-CzAZfmnj.mjs +380 -0
  70. package/dist/{content-scan-B6Ahw9JA.mjs → content-scan-CIA_9PV8.mjs} +3 -5
  71. package/dist/{context-Sgba0fZP.mjs → context-DVh8Wyfs.mjs} +2 -2
  72. package/dist/{cps-uDD0SSJ-.mjs → cps-hJkqdsHx.mjs} +1 -1
  73. package/dist/{csam-scanner-BSUl7jGn.mjs → csam-scanner-cCVO3lNF.mjs} +1 -1
  74. package/dist/{custom-csrs-BDcXggph.mjs → custom-csrs-BrTWUZ0c.mjs} +2 -3
  75. package/dist/{custom-hostnames-UmIlwkwt.mjs → custom-hostnames-C4ft77oC.mjs} +4 -7
  76. package/dist/{custom-nameservers-D7kU6d--.mjs → custom-nameservers-BWfrZhD1.mjs} +2 -3
  77. package/dist/{custom-pages-CkhIQCfM.mjs → custom-pages-DqTMKtRc.mjs} +2 -3
  78. package/dist/{d1-myRLEAGs.mjs → d1-B58AA9PA.mjs} +3 -6
  79. package/dist/delegate-D7yYckA4.mjs +2 -0
  80. package/dist/delegate.mjs +1 -1
  81. package/dist/{deploy-BJqCpycz.mjs → deploy-CEROLAdh.mjs} +1 -1
  82. package/dist/deploy-context-Do89WayB.mjs +56 -0
  83. package/dist/{deploy-input-v2DryyLP.mjs → deploy-input-DyMuMsi5.mjs} +1 -1
  84. package/dist/{dev-S1PJi83q.mjs → dev-BaFS7kOM.mjs} +2 -2
  85. package/dist/{diagnostics-q65rcNIk.mjs → diagnostics-4gfYj7Pf.mjs} +2 -3
  86. package/dist/dialog-D5lus4M4.mjs +2 -0
  87. package/dist/discover-6kAmVMPp.mjs +2 -0
  88. package/dist/discover-C06Syc2B.mjs +2 -0
  89. package/dist/dist-BtzWfAjU.mjs +453 -0
  90. package/dist/dls-ClWVxTBg.mjs +16 -0
  91. package/dist/{dns-DhARjFQs.mjs → dns-CML-wxIt.mjs} +68 -68
  92. package/dist/{dns-firewall-BP6r9QG6.mjs → dns-firewall-CL0b3dJ1.mjs} +2 -3
  93. package/dist/{docs-CReGWDrw.mjs → docs-BeYBHwUN.mjs} +1 -1
  94. package/dist/{dotenv-Ck-6V1hm.mjs → dotenv-CmPRiXmU.mjs} +1 -1
  95. package/dist/{dry-run-BBjUQUhR.mjs → dry-run-gy0Hl9xo.mjs} +1 -1
  96. package/dist/{durable-objects-tOJy-5te.mjs → durable-objects-uZECeq_f.mjs} +1 -1
  97. package/dist/{email-auth-Bq9sq_2j.mjs → email-auth-CCNW798I.mjs} +1 -1
  98. package/dist/email-domains-1rD1d84O.mjs +12 -0
  99. package/dist/{email-routing-CYo4dp50.mjs → email-routing-CYv-LrbV.mjs} +4 -7
  100. package/dist/{email-security-CNtWET2d.mjs → email-security-CWEUYPYo.mjs} +16 -31
  101. package/dist/{email-sending-BvagNLRr.mjs → email-sending-DHSzCfJx.mjs} +3 -5
  102. package/dist/{errors-DpbAQQv8.mjs → errors-ol9sMqSe.mjs} +8 -8
  103. package/dist/{field-extractors-C9R3Qivh.mjs → field-extractors-CuBM_uO4.mjs} +2 -3
  104. package/dist/{firewall-DsgUY-Qv.mjs → firewall-SMIUSypF.mjs} +4 -7
  105. package/dist/flagship-D3v6iDdw.mjs +24 -0
  106. package/dist/{fraud-24l8dKyk.mjs → fraud-B2f7O15X.mjs} +1 -1
  107. package/dist/{google-tag-gateway-CAkudP5W.mjs → google-tag-gateway-BwOc62Gy.mjs} +1 -1
  108. package/dist/{gt-D6YemCLh.mjs → gt-BQkaDQDq.mjs} +1 -1
  109. package/dist/{healthchecks-CEGMe3lO.mjs → healthchecks-BQXHnihB.mjs} +3 -5
  110. package/dist/{hyperdrive-DLDaOU2O.mjs → hyperdrive-Bd6Yfje3.mjs} +2 -3
  111. package/dist/{iam-ChldOMSL.mjs → iam-qJPI1_aZ.mjs} +5 -9
  112. package/dist/{images-Ba9tS5wT.mjs → images-goHZJOxy.mjs} +6 -11
  113. package/dist/index.mjs +1 -1
  114. package/dist/init-CVx0Ya1E.mjs +43 -0
  115. package/dist/{intel-DbLRah4Y.mjs → intel-CwiqwJI9.mjs} +18 -21
  116. package/dist/interactive-CHcvofEp.mjs +2 -0
  117. package/dist/{interactive-d_lFnSev.mjs → interactive-D4E8PdaW.mjs} +31 -31
  118. package/dist/interactive-wQM7Blhm.mjs +2 -0
  119. package/dist/internal-5cnlw9mH.mjs +4 -0
  120. package/dist/{ips-BGyzyQLL.mjs → ips-KBxmXhvO.mjs} +1 -1
  121. package/dist/{k2-BVQ3MqEl.mjs → k2-KhIP5NFT.mjs} +2 -3
  122. package/dist/kv-CCem2sEY.mjs +12 -0
  123. package/dist/{lazy-command-D0I6itZs.mjs → lazy-command-BMhD5ffF.mjs} +1 -1
  124. package/dist/{leaked-credential-checks-Dga83Qy3.mjs → leaked-credential-checks-BkPZiwE2.mjs} +3 -5
  125. package/dist/live-BhHzxFna.mjs +4 -0
  126. package/dist/{load-balancers-D9cB6of8.mjs → load-balancers-17GBXdju.mjs} +5 -9
  127. package/dist/local-CAs8RWYW.mjs +2 -0
  128. package/dist/{local-B7ZJ78al.mjs → local-CSH3UMpD.mjs} +1 -1
  129. package/dist/{local-runtime-DB545Gqq.mjs → local-runtime-KOFLRZeZ.mjs} +1 -1
  130. package/dist/log-BWdaOGOW.mjs +66 -0
  131. package/dist/log-DZfik9Jk.mjs +2 -0
  132. package/dist/login-BTiflOun.mjs +2 -0
  133. package/dist/login-Buhvx6Fi.mjs +5 -0
  134. package/dist/{logpush-Ccmr0Y_I.mjs → logpush-BCCUxa4J.mjs} +3 -5
  135. package/dist/{logs-CZBMuuBC.mjs → logs-4CwupKRG.mjs} +2 -3
  136. package/dist/{magic-cloud-networking-BwOxZVql.mjs → magic-cloud-networking-Xy6SC-V-.mjs} +4 -7
  137. package/dist/{magic-network-monitoring-Cx5kKdbk.mjs → magic-network-monitoring-B8pRZp2g.mjs} +3 -5
  138. package/dist/{magic-transit-BJwg3sVK.mjs → magic-transit-CwfO3OOX.mjs} +36 -67
  139. package/dist/managed-defense-CtFLuvuB.mjs +18 -0
  140. package/dist/{managed-transforms-C-HMtesC.mjs → managed-transforms-Hto8OCBS.mjs} +2 -3
  141. package/dist/{mcp-bGKgzz6F.mjs → mcp-SQ0MAVUJ.mjs} +3 -5
  142. package/dist/{mesh-DeQIll19.mjs → mesh-C8A6tVqA.mjs} +3 -5
  143. package/dist/{migrate-B6HsPeFh.mjs → migrate-Dufxsb_F.mjs} +1 -1
  144. package/dist/{monetization-B-TIrpA5.mjs → monetization-CYVaCAe9.mjs} +3 -5
  145. package/dist/{network-BrjykU-I.mjs → network-CJBTdEM3.mjs} +5 -9
  146. package/dist/{network-interconnects-I06kbxIl.mjs → network-interconnects-CKlNFj3i.mjs} +3 -5
  147. package/dist/{o11y-Ba0Fa98_.mjs → o11y-5x2Q8CWm.mjs} +8 -15
  148. package/dist/{oauth-BH-uQd3C.mjs → oauth-BN6_FpYp.mjs} +1 -1
  149. package/dist/oauth-D_A8AcIS.mjs +4 -0
  150. package/dist/{oauth-clients-Dd5gvDqf.mjs → oauth-clients-qKXg8ZH3.mjs} +3 -5
  151. package/dist/{oauth-scopes-CXpH3Syj.mjs → oauth-scopes-Ct1jDyC5.mjs} +1 -1
  152. package/dist/{organization-DKPqwe3j.mjs → organization-lBQSeqS1.mjs} +3 -5
  153. package/dist/{organizations-Cq4iy-Yr.mjs → organizations-DEX8Er3g.mjs} +1 -1
  154. package/dist/{origin-post-quantum-encryption-DSB1sbYV.mjs → origin-post-quantum-encryption-DUsxVGCs.mjs} +1 -1
  155. package/dist/output-BJEgbI0G.mjs +2 -0
  156. package/dist/package-BqSbnt6u.mjs +2 -0
  157. package/dist/{page-rules-CDWTYaf7.mjs → page-rules-BMt6nt03.mjs} +2 -3
  158. package/dist/{pages-Dgtm51Uj.mjs → pages-Jxa92ECz.mjs} +7 -13
  159. package/dist/{pay-per-crawl-CHenxdhv.mjs → pay-per-crawl-Cv0044CZ.mjs} +3 -5
  160. package/dist/{pay-per-use-Bd5l0hBi.mjs → pay-per-use-DGEeG-dC.mjs} +2 -3
  161. package/dist/{pipelines-GsyD6nUM.mjs → pipelines-CEC78A3w.mjs} +5 -9
  162. package/dist/{precursor-mO-Zua09.mjs → precursor-Ba0Ejhzt.mjs} +1 -1
  163. package/dist/previews-DnZbUTym.mjs +6 -0
  164. package/dist/progress-CtGsPOpV.mjs +2 -0
  165. package/dist/prompt-YrI7ltMa.mjs +4 -0
  166. package/dist/{queues-D8cAr2lB.mjs → queues-Chq997uj.mjs} +6 -11
  167. package/dist/{r2-CJiJbG6b.mjs → r2-BFgZDs-F.mjs} +17 -33
  168. package/dist/{radar-PUZ_PCZ8.mjs → radar-DJdDzLJw.mjs} +1 -1
  169. package/dist/{raw-fetch-DSdFjojI.mjs → raw-fetch-BE3QgdTE.mjs} +1 -1
  170. package/dist/ready-Cok0aqke.mjs +4 -0
  171. package/dist/{realtime-X6uQsldp.mjs → realtime-BHWWCiKp.mjs} +10 -19
  172. package/dist/{registrar-BqZdUTss.mjs → registrar-9Y-1IQ0n.mjs} +1 -1
  173. package/dist/{registrar-sandbox-CmM3e1QN.mjs → registrar-sandbox-DTS1kRnb.mjs} +1 -1
  174. package/dist/{registry-D0tMkLv6.mjs → registry-Bm-GgDC3.mjs} +1 -1
  175. package/dist/{reporting-DFVz98Xg.mjs → reporting-D5RbKQJf.mjs} +1 -1
  176. package/dist/request-headers-KhW_hy36.mjs +2 -0
  177. package/dist/{request-tracers-BC1u2WDU.mjs → request-tracers-wxWCjmHo.mjs} +1 -1
  178. package/dist/{resource-sharing-CdEn5Iex.mjs → resource-sharing-BGoaVvJa.mjs} +5 -9
  179. package/dist/rolldown-runtime-BNtqjh-B.mjs +2 -0
  180. package/dist/{rules-B663VetJ.mjs → rules-Cd3EjhdF.mjs} +3 -5
  181. package/dist/{rulesets-p4EijVr6.mjs → rulesets-Bnz3rSBT.mjs} +4 -7
  182. package/dist/{rum-CHHXe4KK.mjs → rum-CK9HEe3O.mjs} +3 -5
  183. package/dist/run-Be6Js7D6.mjs +2 -0
  184. package/dist/run-DnZGQbq_.mjs +2 -0
  185. package/dist/sanitization-DkVWMHkc.mjs +2 -0
  186. package/dist/{schema-B38ojvsS.mjs → schema-DuLIZRhA.mjs} +1 -1
  187. package/dist/{schema-flags-z7yn0JZ_.mjs → schema-flags-BrDlFwLv.mjs} +1 -1
  188. package/dist/{scim-BMnUa4Oz.mjs → scim-UdqaWnOu.mjs} +3 -5
  189. package/dist/{secrets-store-EYrhEzVG.mjs → secrets-store-Bf5v96LC.mjs} +3 -5
  190. package/dist/{security-insights-C-AwDwXb.mjs → security-insights-BAGySlGu.mjs} +1 -1
  191. package/dist/{security-txt-CQMe8TD3.mjs → security-txt-D0fMmjHs.mjs} +2 -3
  192. package/dist/session-6xqrJWXy.mjs +2 -0
  193. package/dist/shared-DYRRG9A-.mjs +2 -0
  194. package/dist/signed-url-Ce0muRem.mjs +4 -0
  195. package/dist/{smart-shield-CHSuitaH.mjs → smart-shield-CCy7_M3j.mjs} +3 -5
  196. package/dist/{snippets-DGSBz4lg.mjs → snippets-Bc8m3HSV.mjs} +3 -5
  197. package/dist/spawn-BAEdy9kS.mjs +5 -0
  198. package/dist/{spectrum-59LhYG1t.mjs → spectrum-DtNX8WBX.mjs} +2 -3
  199. package/dist/{speed-CMCfoG3s.mjs → speed-TbkeWV_x.mjs} +3 -5
  200. package/dist/{sql-MxWaTDdj.mjs → sql-DI319y25.mjs} +1 -1
  201. package/dist/src-COwxoocl.mjs +2 -0
  202. package/dist/{src-J3Yss3VM.mjs → src-Dc6ojwUW.mjs} +5 -5
  203. package/dist/{ssl-DTTFZR9x.mjs → ssl-D0MIzFl2.mjs} +9 -17
  204. package/dist/startup-profile-CZYtQziF.mjs +2 -0
  205. package/dist/{startup-profile-bp348qmf.mjs → startup-profile-DlWrt4Fm.mjs} +5 -5
  206. package/dist/state-B3Uy1jPX.mjs +2 -0
  207. package/dist/{state-CqAtTENS.mjs → state-DazGSbRx.mjs} +1 -1
  208. package/dist/{stream-gVG_7si-.mjs → stream-4Mrb8HEo.mjs} +14 -27
  209. package/dist/tags-BP25qydR.mjs +22 -0
  210. package/dist/telemetry-CvZean4s.mjs +2 -0
  211. package/dist/telemetry-DKSJSLtq.mjs +2 -0
  212. package/dist/{tenant-custom-nameservers-DBmmUcxn.mjs → tenant-custom-nameservers-BzVP85Tq.mjs} +2 -3
  213. package/dist/{tenant-Qv_PC8gW.mjs → tenant-jmfZqEZ4.mjs} +1 -1
  214. package/dist/{tools-B1ajcUAF.mjs → tools-C-vmgYSv.mjs} +1 -1
  215. package/dist/{tunnels-CHNKPYRV.mjs → tunnels-BNswR1Dj.mjs} +4 -6
  216. package/dist/{turnstile-C60RxPo2.mjs → turnstile-BgsTP2fz.mjs} +2 -3
  217. package/dist/ui-Bo6DCvbS.mjs +2 -0
  218. package/dist/{update-check-BHarE3V9.mjs → update-check-BOF1hn_I.mjs} +1 -1
  219. package/dist/update-check-C7mfEeQ7.mjs +2 -0
  220. package/dist/update-check-worker.mjs +1 -1
  221. package/dist/{url-normalization-3t6Xpafi.mjs → url-normalization-Bqrs4-2F.mjs} +2 -3
  222. package/dist/{url-scanner-DNG__DiK.mjs → url-scanner-Dm4Fps5T.mjs} +1 -1
  223. package/dist/{user-B4i7OIFK.mjs → user-u_LxzLM4.mjs} +8 -15
  224. package/dist/{vectorize-y3PCQDDf.mjs → vectorize-DLGiOyd4.mjs} +3 -5
  225. package/dist/version-DmTuWNZ5.mjs +2 -0
  226. package/dist/{waiting-rooms-xkZLvPkT.mjs → waiting-rooms-DmgJgJXb.mjs} +4 -7
  227. package/dist/{web-assets-BlqHZywy.mjs → web-assets-rNhZWP-6.mjs} +7 -13
  228. package/dist/{web3-DGAJMcLv.mjs → web3-BVBdFt8E.mjs} +3 -5
  229. package/dist/{workers-cCNBx0Bc.mjs → workers-CjUKJvH8.mjs} +18 -22
  230. package/dist/{workers-builds-COKp3NfU.mjs → workers-builds-D3Q97l7X.mjs} +1 -1
  231. package/dist/{workers-for-platforms-CAtiWI_G.mjs → workers-for-platforms-C_fcw30y.mjs} +5 -9
  232. package/dist/{workers-vpc-ChBfXwPy.mjs → workers-vpc-CnRO3Stc.mjs} +2 -3
  233. package/dist/{workflows-BYhgJvyR.mjs → workflows-cpHFe5v6.mjs} +5 -9
  234. package/dist/{wrangler-migration-B12OR2bu.mjs → wrangler-migration-DQehjmoh.mjs} +74 -74
  235. package/dist/{zaraz-BW0kvRCK.mjs → zaraz-BRj0J7vK.mjs} +1 -1
  236. package/dist/{zero-trust-DSeWXkNV.mjs → zero-trust-CVZKDLCB.mjs} +75 -149
  237. package/dist/{zone-B-YJG2UA.mjs → zone-N6ccK70C.mjs} +1 -1
  238. package/dist/{zones-B8pqPHu8.mjs → zones-C4S_kpGz.mjs} +49 -52
  239. package/package.json +12 -12
  240. package/dist/auth-CdEGiJ5Y.mjs +0 -2
  241. package/dist/auth-DF_ml7rE.mjs +0 -2
  242. package/dist/build-BJHRK6qE.mjs +0 -2
  243. package/dist/build-D7s3a8zW.mjs +0 -2
  244. package/dist/cache-CDPUUv_O.mjs +0 -45
  245. package/dist/cf-3vj8dGYz.mjs +0 -18
  246. package/dist/chunk-DSGVRFIS-RUG6Dtqz.mjs +0 -2
  247. package/dist/containers-CcZHRM9g.mjs +0 -376
  248. package/dist/delegate-Tgfxa-MZ.mjs +0 -2
  249. package/dist/deploy-context-DIAl408H.mjs +0 -56
  250. package/dist/dialog-BnIgdgWi.mjs +0 -2
  251. package/dist/discover-DEjUARkU.mjs +0 -2
  252. package/dist/discover-P20XeGBF.mjs +0 -2
  253. package/dist/dist-CX6dDtzj.mjs +0 -449
  254. package/dist/dist-DAeCUX-u.mjs +0 -60
  255. package/dist/dls-CMTrCDjZ.mjs +0 -17
  256. package/dist/flagship-geGDHp9H.mjs +0 -28
  257. package/dist/init-C08hBFYn.mjs +0 -43
  258. package/dist/interactive-pjVqirHx.mjs +0 -2
  259. package/dist/kv-Cd8vbPWK.mjs +0 -15
  260. package/dist/local-CFZtOOxg.mjs +0 -2
  261. package/dist/log-CRbgNbDp.mjs +0 -3
  262. package/dist/login-C3Bahro9.mjs +0 -5
  263. package/dist/login-DvsRxI3E.mjs +0 -2
  264. package/dist/logo-matches-jeNkUxAq.mjs +0 -6
  265. package/dist/logos-pxN5aumY.mjs +0 -7
  266. package/dist/managed-defense-C_KLy4oB.mjs +0 -18
  267. package/dist/matches-DnjBnG-Y.mjs +0 -6
  268. package/dist/oauth-Cf3-g-kk.mjs +0 -4
  269. package/dist/output-CpiIVa7Q.mjs +0 -2
  270. package/dist/previews-oHUiD54J.mjs +0 -7
  271. package/dist/progress-B1dpmxCT.mjs +0 -2
  272. package/dist/prompt-Y5OBwDVE.mjs +0 -4
  273. package/dist/queries-CS0sYfte.mjs +0 -9
  274. package/dist/request-headers-Bg8_Idw3.mjs +0 -2
  275. package/dist/run-0EozpORq.mjs +0 -2
  276. package/dist/run-DKg70Sqf.mjs +0 -2
  277. package/dist/session-3DgztoAI.mjs +0 -2
  278. package/dist/shared-o8saqcSK.mjs +0 -2
  279. package/dist/source-AlTrHNem.mjs +0 -6
  280. package/dist/spawn-BZd__5sj.mjs +0 -10
  281. package/dist/startup-profile-DJsOtbVN.mjs +0 -2
  282. package/dist/state-Dvzl3aSj.mjs +0 -2
  283. package/dist/submit-wJYcQB8d.mjs +0 -4
  284. package/dist/tags-BwFKjaOr.mjs +0 -23
  285. package/dist/telemetry-BczXOpQn.mjs +0 -2
  286. package/dist/telemetry-CE15pfOU.mjs +0 -2
  287. package/dist/ui-CBhKUPys.mjs +0 -2
  288. package/dist/update-check-C3RhhXja.mjs +0 -2
  289. package/dist/url-info-By6VD20A.mjs +0 -4
  290. package/dist/version-izjB0Yrl.mjs +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf",
3
- "version": "1.0.0-beta.20",
3
+ "version": "1.0.0-beta.21",
4
4
  "description": "The Cloudflare CLI",
5
5
  "keywords": [
6
6
  "ai",
@@ -59,25 +59,25 @@
59
59
  "./package.json": "./package.json"
60
60
  },
61
61
  "dependencies": {
62
- "@cloudflare/build-output-utils": "0.9.3",
63
- "@cloudflare/config": "0.27.0",
64
- "@cloudflare/runtime-types": "0.1.14",
62
+ "@cloudflare/build-output-utils": "0.9.4",
63
+ "@cloudflare/config": "0.28.0",
64
+ "@cloudflare/runtime-types": "0.1.15",
65
65
  "blake3-wasm": "2.1.5",
66
- "miniflare": "5.20261019.1-beta"
66
+ "miniflare": "5.20261019.2-beta"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@bomb.sh/tab": "0.0.22",
70
70
  "@bytecodealliance/jco": "1.39.0",
71
71
  "@clack/core": "1.5.1",
72
72
  "@clack/prompts": "^1.8.1",
73
- "@cloudflare/autoconfig": "0.7.11",
74
- "@cloudflare/cli-shared-helpers": "0.2.7",
75
- "@cloudflare/codemods": "0.5.1",
76
- "@cloudflare/containers-shared": "0.23.1",
77
- "@cloudflare/deploy-helpers": "0.22.1",
73
+ "@cloudflare/autoconfig": "0.8.0",
74
+ "@cloudflare/cli-shared-helpers": "0.2.8",
75
+ "@cloudflare/codemods": "0.6.0",
76
+ "@cloudflare/containers-shared": "0.23.2",
77
+ "@cloudflare/deploy-helpers": "0.23.0",
78
78
  "@cloudflare/forge": "https://pkg.pr.new/cloudflare/forge/@cloudflare/forge@260488a28036586904e9a020dea46a9bcdcea553",
79
- "@cloudflare/workers-auth": "0.14.1",
80
- "@cloudflare/workers-utils": "0.47.3",
79
+ "@cloudflare/workers-auth": "0.15.0",
80
+ "@cloudflare/workers-utils": "0.48.0",
81
81
  "@types/node": "25.9.9",
82
82
  "@types/semver": "7.8.0",
83
83
  "@types/shell-quote": "^1.7.5",
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./agent-context-DFEgYjEQ.mjs";import{i as n}from"./blocks-CFAm0Ma3.mjs";import"./ui-CBhKUPys.mjs";import{n as r,t as i}from"./log-CRbgNbDp.mjs";import{d as a,f as o,i as s,r as c,t as l}from"./oauth-Cf3-g-kk.mjs";import{t as u}from"./auth-token-T0aqYgl9.mjs";import{t as d}from"./output-CpiIVa7Q.mjs";import{n as f}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{a as p,c as m,i as h,n as g,o as _,r as v,s as y,t as b}from"./login-C3Bahro9.mjs";const x={command:`logout`,describe:`Log out and remove stored credentials`,handler:async t=>{h(t,`logout`,"Run `cf auth delete <name>` to remove a named profile.");let n=c();n!=="default"&&(i.warn(`This directory has profile "${n}" active. ${e.code(`cf auth logout`)} removes the default profile's token, not "${n}". To delete "${n}", run:`),r(`cf auth delete ${n}`)),await a(`default`)}},S={command:`whoami`,describe:`Show current user and authentication status`,handler:async e=>{if(e[`temporary-account`]||e[`event-code`]!==void 0)throw Error(`--temporary-account and --event-code are not supported by cf auth whoami.`);let r=process.env.CLOUDFLARE_API_TOKEN,i=o(),a;a=r?`CLOUDFLARE_API_TOKEN environment variable`:i?.oauth_token?`OAuth token from ${s()}`:`none`;let c;try{c=await u()}catch{d({authenticated:!1,error:`Not logged in`}),a===`none`&&t().isAgentic&&console.error(n('Ask the user: "I can put this online for 60 minutes without you signing in. To keep it, complete the temporary-account claim before it expires. Would you like me to deploy it that way?" (https://developers.cloudflare.com/workers/platform/claim-deployments/) If they agree, run `cf deploy --temporary-account`.'));return}let{createCloudflareClientWithToken:f}=await import(`./auth-DF_ml7rE.mjs`),{default:p}=await import(`./get-BTisquA3.mjs`),m=f({apiToken:c}),h,g=[],[_,v]=await Promise.allSettled([m.send(p),l()]);if(_.status===`fulfilled`){let e=_.value;e&&`email`in e&&typeof e.email==`string`&&(h=e.email)}else process.env.DEBUG&&console.error(`User lookup error:`,_.reason);v.status===`fulfilled`?g=v.value:process.env.DEBUG&&console.error(`Account lookup error:`,v.reason);let y=_.status===`fulfilled`||v.status===`fulfilled`,b={authenticated:!0,authSource:a,tokenValid:y,...h&&{email:h},accounts:g};i?.oauth_token&&(b.scopes=i.scopes,b.expiresAt=i.expiration_time),d(b)}},C={command:`auth`,describe:`Manage authentication and profiles`,builder:e=>e.command(f(b,{command:`auth login`,classification:g})).command(w(x,`auth logout`)).command(w(S,`auth whoami`)).command(w(p,`auth create`,[`browser`,`device`])).command(w(y,`auth delete`)).command(w(v,`auth activate`)).command(w(_,`auth deactivate`)).command(w(m,`auth list`)).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e,t,n=[],r){return f(e,{command:t,classification:{safeFlags:n,shortFlagAliases:r}})}export{C as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export{t as createCloudflareClientWithToken}from"./auth-BUQscD5b.mjs";import"./context-Sgba0fZP.mjs";import"./oauth-Cf3-g-kk.mjs";import"./auth-token-T0aqYgl9.mjs";
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./theme-BGHWSKCw.mjs";import{t}from"./cli-exit-CstFZ1eJ.mjs";import{M as n}from"./dist-CX6dDtzj.mjs";import{i as r,r as i}from"./autoconfig-CBdcYYf4.mjs";import"./ui-CBhKUPys.mjs";import{n as a}from"./dist-DAeCUX-u.mjs";import{n as o,t as s}from"./spawn-BZd__5sj.mjs";import c from"node:path";import{readBuildOutput as l}from"@cloudflare/build-output-utils";import{convertToWranglerConfig as u}from"@cloudflare/config";var d=class extends Error{constructor(e){super(e),this.name=`BuildOutputConfigError`}};function f(e,t){if(e!==void 0){if(t===void 0)throw new d(`The Build Output does not record which mode it was created with, but this command requested mode "${e}". Rebuild with "--mode ${e}" before deploying.`);if(t!==e)throw new d(`The Build Output was created with mode "${t}", but this command requested mode "${e}". To use the existing Build Output, rerun with "--mode ${t}". To deploy in ${e} mode, rebuild with "--mode ${e}" before deploying.`)}}function p(e,t){if(e!==void 0&&t)throw new d(`Temporary accounts can't be used when a specific account ID ("${e}") is set in your config file. Remove \`--temporary-account\` to use that account, or remove \`accountId\` from your config file and rebuild to use a temporary account.`)}const m={type:`string`,description:`Name of the Worker in the Build Output to use (defaults to the default Worker)`,requiresArg:!0,coerce:e=>{if(Array.isArray(e))throw Error(`--worker can only be specified once.`);return e}};function h(e,t){if(t===void 0)return e.default;let n=Object.values(e).filter(e=>e.config.name===t);if(n.length>1)throw new d(`The Build Output contains more than one Worker named "${t}".`);if(n[0]!==void 0)return n[0];let{default:r,...i}=e;throw new d(`The Build Output has no Worker named "${t}". Available Workers: ${[`${r.config.name} (default)`,...Object.values(i).map(e=>e.config.name).sort()].join(`, `)}.`)}function g(e,t){let n=e.config,{buildContext:r,...i}=t,{manifest:a,...o}=n,s=u({...i,worker:o,containers:[]});n.manifest?.mainModule&&e.bundleDir&&(s.main=c.join(e.bundleDir,n.manifest.mainModule));let l=c.resolve(`cloudflare.config.ts`),{validationConfig:d,containerReferences:f}=v(s),p=_(d,e.configPath,l);y(p,f);let{containers:m,...h}=p;return{wranglerConfig:h,builtConfig:n}}function _(e,t,r){let{config:i,diagnostics:a}=n(e,t,r,{});if(a.hasErrors())throw new d(a.renderErrors());return a.hasWarnings()&&console.warn(a.renderWarnings()),i}function v(e){let{containers:t,...n}=e,r=/* @__PURE__ */ new Map;return n.exports!==void 0&&(n.exports=Object.fromEntries(Object.entries(n.exports).map(([e,t])=>{if(!(`container`in t)||typeof t.container!=`string`)return[e,t];r.set(e,t.container);let{container:n,...i}=t;return[e,i]}))),{validationConfig:n,containerReferences:r}}function y(e,t){e.exports!==void 0&&t.size!==0&&(e.exports=Object.fromEntries(Object.entries(e.exports).map(([e,n])=>{let r=t.get(e);return[e,r===void 0?n:{...n,container:r}]})))}function b(e){return e}async function x(n,{worker:c,dryRun:u=!1,...d}={},f={}){let p=d.output??`stdout`,m=process.cwd(),{details:_,configuration:v,setupNeeded:y}=await i(m,{...d,dryRun:u});if(y)return`setup-needed`;let b=v?.buildCommand??_?.buildCommand,x={..._?.env,...f.isPreview?{CLOUDFLARE_PREVIEW_BUILD:`true`}:{}};if(b&&n&&!_?.framework?.supportsMode)throw Error(`The detected command \`${b}\` does not currently support \`--mode\`.`);p!==`silent`&&a.message(e.bold(`Build`),{symbol:e.muted(`├`),spacing:0,output:p===`stderr`?process.stderr:void 0});let C=n?[`--mode`,n]:[],w;if(b)w=await r(b,m,{...d,env:x,args:C});else{let e=o(m);p!==`silent`&&a.message(`Delegating to ${S(e)}`,{spacing:0,output:p===`stderr`?process.stderr:void 0}),w=await s(e,`build`,C,{...d,env:x})}if(w.exitCode!==0||w.signal)throw new t(w.exitCode,{signal:w.signal});let{workers:T,rootConfig:E}=await l(m);return g(h(T,c),E),p!==`silent`&&a.success(`Build complete`,{spacing:0,output:p===`stderr`?process.stderr:void 0}),`built`}function S(e){switch(e.impl.pkg){case`@cloudflare/vite-plugin`:return`Vite`;case`wrangler`:return`Wrangler`;case`cloudflare-py-dev-server`:return`the Python dev server`;case`cloudflare-rs-dev-server`:return`the Rust dev server`;default:return e.impl.pkg}}const C={command:`build`,describe:`Build a project for Cloudflare`,builder:b,handler:async e=>{await x(e.mode)}};export{h as a,d as c,g as i,x as n,p as o,m as r,f as s,C as t};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export{t as default,n as runBuild}from"./build-BJHRK6qE.mjs";
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env node
2
- import"./api-eMuS5GI1.mjs";import{t as e}from"./path-DRw6Y-nd.mjs";import{i as t,n}from"./auth-BUQscD5b.mjs";import{i as r}from"./context-Sgba0fZP.mjs";import{t as i}from"./output-CpiIVa7Q.mjs";import{t as a}from"./dry-run-BBjUQUhR.mjs";import{t as o}from"./progress-B1dpmxCT.mjs";import{t as s}from"./run-0EozpORq.mjs";import"./telemetry-BczXOpQn.mjs";import{n as c,t as l}from"./body-parser-ChnyBsfm.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{a as d,i as f,n as p}from"./prompt-Y5OBwDVE.mjs";var m={method:`POST`,path:t=>e`/zones/${t.zone_id}/environments/${t.environment_id}/invalidate_cache`,body:`json`};function h(e){return e.usage("$0 cache invalidate-environment <environment-id>\n\nMarks cached content as stale for one environment of the zone. Content cached for the zone's other environments, including production, is not affected. Otherwise this works like `POST /zones/{zone_id}/invalidate_cache`: the next request for invalidated content makes Cloudflare revalidate it with your origin, and the request body takes the same fields. Environments are part of [Version Management](https://developers.cloudflare.com/version-management/). To delete the content instead, use `POST /zones/{zone_id}/environments/{environment_id}/purge_cache`. Invalidating by URL (`files`) does not work for environments that select requests by IP address, country, ASN, or threat score, and fails with error `1136`. Use `tags`, `hosts`, `prefixes`, or `purge_everything` for those environments. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").positional(`environment-id`,{type:`string`,description:`The environment ID, from Version Management.`,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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`invalidate-environment <environment-id>`,describe:`Invalidate Cached Content by Environment`,builder:h,handler:async e=>s({command:`cache invalidate-environment`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){a({command:`cf cache invalidate-environment`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let s=await n(e),l=await r({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=l,!await p({force:!!e.force,message:`This operation marks the selected content in the environment's cache as stale.`})){process.stderr.write(`Aborted.
3
- `);return}if(e.body){let t=c(e.body),n=await o(`Deleting`,async()=>s.send(m,{body:t,zone_id:l,environment_id:e[`environment-id`]}));i(n,{successLabel:`Deleted`});return}let u=await o(`Deleting`,async()=>t(s,`POST`,`/zones/${e.zoneId}/environments/${encodeURIComponent(String(e[`environment-id`]))}/invalidate_cache`));i(u,{successLabel:`Deleted`})})};var ee={method:`POST`,path:t=>e`/zones/${t.zone_id}/invalidate_cache`,body:`json`};function te(e){return e.usage("$0 cache invalidate\n\nMarks cached content as stale in every Cloudflare data center and cache tier, including Cache Reserve. The content stays in cache. The next request for it makes Cloudflare revalidate it with your origin, using the `ETag` and `Last-Modified` values it was cached with: - If your origin answers `304 Not Modified`, Cloudflare serves the cached copy without downloading it again, and `CF-Cache-Status` is `REVALIDATED`. - If your origin sends a full response, Cloudflare serves and caches the new content, and `CF-Cache-Status` is `EXPIRED`. With Tiered Cache, each tier revalidates with the tier above it, so a visitor can see `EXPIRED` even when your origin answered `304`. Until content is revalidated, your `stale-while-revalidate` and `stale-if-error` directives still apply, counted from the time you invalidated it. For example, if your origin fails during revalidation, Cloudflare can keep serving the stale copy for the `stale-if-error` window. ### Invalidate or purge? - **Invalidate** when content may not have changed, for example after a deploy. Unchanged content costs your origin a `304` instead of a full response. That saving needs an origin that sends `ETag` or `Last-Modified` and answers conditional requests. Otherwise, every revalidation downloads the full response. - **Purge**, with `POST /zones/{zone_id}/purge_cache`, when content must not be served again, for example content you removed for legal or security reasons. Invalidating takes the same request bodies as purging, needs the same permission, and counts against the same rate limits. After a broad invalidation, such as `purge_everything`, expect more conditional requests to your origin while visitors request the invalidated content again. ### Choose what to invalidate Send one of these fields in the request body: - `files`: specific URLs. If your cache key includes request headers, send each URL with the header values it was cached with. - `tags`: all content whose `Cache-Tag` response header contains one of the tags. - `hosts`: all content cached for the hostnames. - `prefixes`: all content whose URL starts with one of the prefixes. - `purge_everything`: all cached content in the zone. ### Check the result A `200` response with `success: true` means Cloudflare accepted the request. To check, request an invalidated URL and confirm that the `CF-Cache-Status` response header is `REVALIDATED` or `EXPIRED`. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").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 ne={command:`invalidate`,describe:`Invalidate Cached Content`,builder:te,handler:async e=>s({command:`cache invalidate`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){a({command:`cf cache invalidate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/invalidate_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let s=await n(e),l=await r({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=l,!await p({force:!!e.force,message:`This operation marks the selected content in the zone's cache as stale.`})){process.stderr.write(`Aborted.
4
- `);return}if(e.body){let t=c(e.body),n=await o(`Deleting`,async()=>s.send(ee,{body:t,zone_id:l}));i(n,{successLabel:`Deleted`});return}let u=await o(`Deleting`,async()=>t(s,`POST`,`/zones/${e.zoneId}/invalidate_cache`));i(u,{successLabel:`Deleted`})})};function re(e){return e.usage("$0 cache origin-cloud-regions bulk-delete\n\nRemoves up to 100 IP-to-cloud-region mappings in a single request. Each IP is validated independently — successfully deleted items are returned in the `succeeded` array and IPs that could not be found or are invalid are returned in the `failed` array.").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 ie={command:`bulk-delete`,describe:`Batch delete origin cloud region mappings`,builder:re,handler:async e=>s({command:`cache origin-cloud-regions bulk-delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){a({command:`cf cache origin-cloud-regions bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let s=await n(e);if(e.zoneId=await r({zone:e.zone},s,{quiet:e.quiet}),!await p({force:!!e.force,message:`Are you sure you want to delete these Origin Cloud Region configurations?`}))process.stderr.write(`Aborted.
5
- `);else if(e.body){let n=c(e.body);if(Array.isArray(n)&&n.length>100){let r=Math.ceil(n.length/100),a=null;for(let i=0;i<n.length;i+=100){let c=n.slice(i,i+100),l=Math.floor(i/100)+1;a=await o(`Deleting: batch ${l}/${r}`,async()=>t(s,`DELETE`,`/zones/${e.zoneId}/origin/cloud_regions/batch`,{body:c}))}i(a,{successLabel:`Deleted`});return}let r=await o(`Deleting`,async()=>t(s,`DELETE`,`/zones/${e.zoneId}/origin/cloud_regions/batch`,{body:n}));i(r,{successLabel:`Deleted`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function ae(e){return e.usage("$0 cache origin-cloud-regions bulk-update\n\nUpserts up to 100 IP-to-cloud-region mappings in a single request. Items in the request body are created or replaced; mappings not included in the request body are preserved unchanged (this is a merge operation, not a full collection replacement). Each item is validated independently — valid items are applied and invalid items are returned in the `failed` array. The vendor and region for every item are validated against the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`.").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 _={command:`bulk-update`,describe:`Batch create or replace origin cloud region mappings`,builder:ae,handler:async e=>s({command:`cache origin-cloud-regions bulk-update`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache origin-cloud-regions bulk-update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/batch`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let s=await n(e);if(e.zoneId=await r({zone:e.zone},s,{quiet:e.quiet}),e.body){let n=c(e.body);if(Array.isArray(n)&&n.length>100){let r=Math.ceil(n.length/100),a=null;for(let i=0;i<n.length;i+=100){let c=n.slice(i,i+100),l=Math.floor(i/100)+1;a=await o(`Updating: batch ${l}/${r}`,async()=>t(s,`PUT`,`/zones/${e.zoneId}/origin/cloud_regions/batch`,{body:c}))}i(a,{successLabel:`Updated`});return}let r=await o(`Updating`,async()=>t(s,`PUT`,`/zones/${e.zoneId}/origin/cloud_regions/batch`,{body:n}));i(r,{successLabel:`Updated`})}else if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};var v={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/${t.origin_ip}`};function y(e){return e.usage(`$0 cache origin-cloud-regions delete <origin-ip>
6
-
7
- Removes the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup. Returns the deleted IP on success. Returns 404 if no mapping exists for the specified IP. When the last mapping for the zone is removed the underlying rule record is also deleted.`).positional(`origin-ip`,{type:`string`,description:`Origin IP address whose mapping should be deleted.`,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 b={command:`delete <origin-ip>`,describe:`Delete an origin cloud region mapping`,builder:y,handler:async e=>s({command:`cache origin-cloud-regions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){a({command:`cf cache origin-cloud-regions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/${e[`origin-ip`]==null?`<origin-ip>`:encodeURIComponent(String(e[`origin-ip`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"origin-ip":String(e[`origin-ip`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,!await p({force:!!e.force,message:`Are you sure you want to delete this Origin Cloud Region configuration?`})){process.stderr.write(`Aborted.
8
- `);return}let c=await o(`Deleting`,async()=>t.send(v,{zone_id:s,origin_ip:e[`origin-ip`]}));i(c,{successLabel:`Deleted`})})};var x={method:`GET`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/${t.origin_ip}`};function S(e){return e.usage(`$0 cache origin-cloud-regions get <origin-ip>
9
-
10
- Returns the cloud region mapping for a single origin IP address. The IP path parameter is normalized before lookup (RFC 5952 for IPv6). Returns 404 if the zone has no mappings or if the specified IP has no mapping.`).positional(`origin-ip`,{type:`string`,description:`Origin IP address to look up. IPv4 and IPv6 are supported.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <origin-ip>`,describe:`Get an origin cloud region mapping`,builder:S,handler:async e=>s({command:`cache origin-cloud-regions get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache origin-cloud-regions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/${e[`origin-ip`]==null?`<origin-ip>`:encodeURIComponent(String(e[`origin-ip`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"origin-ip":String(e[`origin-ip`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=s;let c=await o(`Loading`,async()=>t.send(x,{zone_id:s,origin_ip:e[`origin-ip`]}));i(c,{successLabel:`Loaded`})})};var w={method:`GET`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions`,query:[`page`,`per_page`]};function T(e){return e.usage(`$0 cache origin-cloud-regions list
11
-
12
- Returns all IP-to-cloud-region mappings configured for the zone with pagination support. Each mapping tells Cloudflare which cloud vendor and region hosts the origin at that IP, enabling the edge to route via the nearest Tiered Cache upper-tier co-located with that cloud provider. Returns an empty array when no mappings exist.`).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List origin cloud region mappings`,builder:T,handler:async e=>s({command:`cache origin-cloud-regions list`,classification:{safeFlags:[`dry-run`]}},e,async()=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){a({command:`cf cache origin-cloud-regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let s=await n(e),c=await r({zone:e.zone},s,{quiet:e.quiet});e.zoneId=c;let l=await o(`Loading`,async()=>s.send(w,{zone_id:c,...t}));i(l,{successLabel:`Loaded`})})};var D={method:`GET`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/supported_regions`};function O(e){return e.usage(`$0 cache origin-cloud-regions supported-regions
13
-
14
- Returns the cloud vendors and regions that are valid values for origin cloud region mappings. Each region includes the Tiered Cache upper-tier colocation codes that will be used for cache routing when a mapping targeting that region is active. Requires the zone to have Tiered Cache enabled.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`supported-regions`,describe:`List supported cloud vendors and regions`,builder:O,handler:async e=>s({command:`cache origin-cloud-regions supported-regions`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache origin-cloud-regions supported-regions`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/supported_regions`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=s;let c=await o(`Loading`,async()=>t.send(D,{zone_id:s}));i(c,{successLabel:`Loaded`})})};var A={method:`PUT`,path:t=>e`/zones/${t.zone_id}/origin/cloud_regions/${t.origin_ip}`,body:`json`};function j(e){return e.usage("$0 cache origin-cloud-regions update <origin-ip>\n\nCreates a new IP-to-cloud-region mapping or replaces the existing mapping for the specified IP. PUT is idempotent — calling it repeatedly with the same body produces the same result. The IP path parameter is normalized to canonical form (RFC 5952 for IPv6) before storage. The vendor and region are validated against the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`. Returns 400 if the `origin_ip` in the body does not match the URL path parameter. Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP mappings.").positional(`origin-ip`,{type:`string`,description:`Origin IP address to create or replace.`,demandOption:!0}).option(`region`,{type:`string`,description:`Cloud vendor region identifier. Must be a valid region for the specified vendor as returned by the supported_regions endpoint.`}).option(`vendor`,{type:`string`,description:`Cloud vendor hosting the origin. Must be one of the supported vendors.`,choices:[`aws`,`azure`,`gcp`,`oci`]}).coerce(`vendor`,e=>u(e,`vendor`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating or replacing an origin cloud region mapping.`})}const M={command:`update <origin-ip>`,describe:`Create or replace an origin cloud region mapping`,builder:j,handler:async e=>s({command:`cache origin-cloud-regions update`,classification:{safeFlags:[`vendor`,`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache origin-cloud-regions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin/cloud_regions/${e[`origin-ip`]==null?`<origin-ip>`:encodeURIComponent(String(e[`origin-ip`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"origin-ip":String(e[`origin-ip`]??``)},bodyKind:`json`,body:e.body===void 0?l({region:u(e.region,`region`,`text`),vendor:e.vendor}):c(e.body)});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,e.body){let n=c(e.body),r=await o(`Updating`,async()=>t.send(A,{body:n,zone_id:s,origin_ip:e[`origin-ip`]}));i(r,{successLabel:`Updated`});return}e.region===void 0&&(e.region=await d(`region`,`Cloud vendor region identifier. Must be a valid region for the specified vendor as returned by the supported_regions endpoint.`)),e.vendor===void 0&&(e.vendor=await f(`vendor`,`Cloud vendor hosting the origin. Must be one of the supported vendors.`,[`aws`,`azure`,`gcp`,`oci`]));let p=l({region:u(e.region,`region`,`text`),vendor:e.vendor}),m=await o(`Updating`,async()=>t.send(A,{body:p,zone_id:s,origin_ip:e[`origin-ip`]}));i(m,{successLabel:`Updated`})})},N={command:`origin-cloud-regions`,describe:`Manage Origin Cloud Regions routing and failover configurations`,builder:e=>e.command(ie).command(_).command(b).command(C).command(E).command(k).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var P={method:`POST`,path:t=>e`/zones/${t.zone_id}/environments/${t.environment_id}/purge_cache`,body:`json`};function F(e){return e.usage("$0 cache purge-environment <environment-id>\n\nDeletes cached content for one environment of the zone. Content cached for the zone's other environments, including production, is not affected. Otherwise this works like `POST /zones/{zone_id}/purge_cache`: the next request for purged content is a cache `MISS`, and the request body takes the same fields. Environments are part of [Version Management](https://developers.cloudflare.com/version-management/). To keep content cached and have Cloudflare revalidate it instead, use `POST /zones/{zone_id}/environments/{environment_id}/invalidate_cache`. Purging by URL (`files`) does not work for environments that select requests by IP address, country, ASN, or threat score, and fails with error `1136`. Use `tags`, `hosts`, `prefixes`, or `purge_everything` for those environments. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").positional(`environment-id`,{type:`string`,description:`The environment ID, from Version Management.`,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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`purge-environment <environment-id>`,describe:`Purge Cached Content by Environment`,builder:F,handler:async e=>s({command:`cache purge-environment`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){a({command:`cf cache purge-environment`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/environments/${e[`environment-id`]==null?`<environment-id>`:encodeURIComponent(String(e[`environment-id`]))}/purge_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"environment-id":String(e[`environment-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let s=await n(e),l=await r({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=l,!await p({force:!!e.force,message:`This operation deletes the selected content from the environment's cache.`})){process.stderr.write(`Aborted.
15
- `);return}if(e.body){let t=c(e.body),n=await o(`Deleting`,async()=>s.send(P,{body:t,zone_id:l,environment_id:e[`environment-id`]}));i(n,{successLabel:`Deleted`});return}let u=await o(`Deleting`,async()=>t(s,`POST`,`/zones/${e.zoneId}/environments/${encodeURIComponent(String(e[`environment-id`]))}/purge_cache`));i(u,{successLabel:`Deleted`})})};var L={method:`POST`,path:t=>e`/zones/${t.zone_id}/purge_cache`,body:`json`};function R(e){return e.usage("$0 cache purge\n\nDeletes cached content in every Cloudflare data center and cache tier, including Cache Reserve. The next request for purged content is a cache `MISS`: Cloudflare fetches the full response from your origin and caches it again. Cloudflare does not serve purged content from cache again, even if your origin is unavailable. To keep content cached and have Cloudflare revalidate it with your origin instead, use `POST /zones/{zone_id}/invalidate_cache`. ### Choose what to purge Send one of these fields in the request body: - `files`: specific URLs. If your cache key includes request headers, send each URL with the header values it was cached with. - `tags`: all content whose `Cache-Tag` response header contains one of the tags. - `hosts`: all content cached for the hostnames. - `prefixes`: all content whose URL starts with one of the prefixes. - `purge_everything`: all cached content in the zone. ### Check the result A `200` response with `success: true` means Cloudflare accepted the request. It does not confirm that any content was cached or removed. To check, request a purged URL and confirm that the `CF-Cache-Status` response header is `MISS`. ### Availability and limits Rate limits and the number of items you can send in one request depend on your plan. See [Purge cache: availability and limits](https://developers.cloudflare.com/cache/how-to/purge-cache/#availability-and-limits).").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 z={command:`purge`,describe:`Purge Cached Content`,builder:R,handler:async e=>s({command:`cache purge`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){a({command:`cf cache purge`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/purge_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:c(e.body)});return}let s=await n(e),l=await r({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=l,!await p({force:!!e.force,message:`This operation deletes the selected content from the zone's cache.`})){process.stderr.write(`Aborted.
16
- `);return}if(e.body){let t=c(e.body),n=await o(`Deleting`,async()=>s.send(L,{body:t,zone_id:l}));i(n,{successLabel:`Deleted`});return}let u=await o(`Deleting`,async()=>t(s,`POST`,`/zones/${e.zoneId}/purge_cache`));i(u,{successLabel:`Deleted`})})};var B={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/cache/regional_tiered_cache`,body:`json`};function V(e){return e.usage(`$0 cache settings regional-tiered-cache edit
17
-
18
- Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`).option(`value`,{type:`string`,description:`Value of the Regional Tiered Cache zone setting.`,choices:[`on`,`off`]}).coerce(`value`,e=>u(e,`value`,`text`)).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:`edit`,describe:`Change Regional Tiered Cache setting`,builder:V,handler:async e=>s({command:`cache settings regional-tiered-cache edit`,classification:{safeFlags:[`value`,`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings regional-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({value:e.value}):c(e.body)});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,e.body){let n=c(e.body),r=await o(`Updating`,async()=>t.send(B,{body:n,zone_id:s}));i(r,{successLabel:`Updated`});return}e.value===void 0&&(e.value=await f(`value`,`Value of the Regional Tiered Cache zone setting.`,[`on`,`off`]));let u=l({value:e.value}),d=await o(`Updating`,async()=>t.send(B,{body:u,zone_id:s}));i(d,{successLabel:`Updated`})})};var U={method:`GET`,path:t=>e`/zones/${t.zone_id}/cache/regional_tiered_cache`};function W(e){return e.usage(`$0 cache settings regional-tiered-cache get
19
-
20
- Instructs Cloudflare to check a regional hub data center on the way to your upper tier. This can help improve performance for smart and custom tiered cache topologies.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get`,describe:`Get Regional Tiered Cache setting`,builder:W,handler:async e=>s({command:`cache settings regional-tiered-cache get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings regional-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/regional_tiered_cache`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=s;let c=await o(`Loading`,async()=>t.send(U,{zone_id:s}));i(c,{successLabel:`Loaded`})})},K={command:`regional-tiered-cache`,describe:`Restrict tiered cache topology to data centers within a specific geographic region`,builder:e=>e.command(H).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var q={method:`POST`,path:t=>e`/zones/${t.zone_id}/cache/cache_reserve_clear`};function J(e){return e.usage(`$0 cache settings reserve clear
21
-
22
- You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`).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 oe={command:`clear`,describe:`Start Cache Reserve Clear`,builder:J,handler:async e=>s({command:`cache settings reserve clear`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){a({command:`cf cache settings reserve clear`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,!await p({force:!!e.force,message:`This operation permanently clears Cache Reserve for this zone and cannot be undone.`})){process.stderr.write(`Aborted.
23
- `);return}let c=await o(`Deleting`,async()=>t.send(q,{zone_id:s}));i(c,{successLabel:`Deleted`})})};var Y={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/cache/cache_reserve`,body:`json`};function se(e){return e.usage(`$0 cache settings reserve edit
24
-
25
- Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`).option(`value`,{type:`string`,description:`Value of the Cache Reserve zone setting.`,choices:[`on`,`off`]}).coerce(`value`,e=>u(e,`value`,`text`)).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 ce={command:`edit`,describe:`Change Cache Reserve setting`,builder:se,handler:async e=>s({command:`cache settings reserve edit`,classification:{safeFlags:[`value`,`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings reserve edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({value:e.value}):c(e.body)});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,e.body){let n=c(e.body),r=await o(`Updating`,async()=>t.send(Y,{body:n,zone_id:s}));i(r,{successLabel:`Updated`});return}e.value===void 0&&(e.value=await f(`value`,`Value of the Cache Reserve zone setting.`,[`on`,`off`]));let u=l({value:e.value}),d=await o(`Updating`,async()=>t.send(Y,{body:u,zone_id:s}));i(d,{successLabel:`Updated`})})};var le={method:`GET`,path:t=>e`/zones/${t.zone_id}/cache/cache_reserve`};function ue(e){return e.usage(`$0 cache settings reserve get
26
-
27
- Increase cache lifetimes by automatically storing all cacheable files into Cloudflare's persistent object storage buckets. Requires Cache Reserve subscription. Note: using Tiered Cache with Cache Reserve is highly recommended to reduce Reserve operations costs. See the [developer docs](https://developers.cloudflare.com/cache/about/cache-reserve) for more information.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get`,describe:`Get Cache Reserve setting`,builder:ue,handler:async e=>s({command:`cache settings reserve get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings reserve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=s;let c=await o(`Loading`,async()=>t.send(le,{zone_id:s}));i(c,{successLabel:`Loaded`})})};var fe={method:`GET`,path:t=>e`/zones/${t.zone_id}/cache/cache_reserve_clear`};function pe(e){return e.usage(`$0 cache settings reserve status
28
-
29
- You can use Cache Reserve Clear to clear your Cache Reserve, but you must first disable Cache Reserve. In most cases, this will be accomplished within 24 hours. You cannot re-enable Cache Reserve while this process is ongoing. Keep in mind that you cannot undo or cancel this operation.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`status`,describe:`Get Cache Reserve Clear`,builder:pe,handler:async e=>s({command:`cache settings reserve status`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings reserve status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/cache_reserve_clear`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=s;let c=await o(`Loading`,async()=>t.send(fe,{zone_id:s}));i(c,{successLabel:`Loaded`})})},he={command:`reserve`,describe:`Persistent storage tier that keeps cached assets even after eviction from edge caches`,builder:e=>e.command(oe).command(ce).command(de).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var X={method:`POST`,path:t=>e`/zones/${t.zone_id}/cache/tiered_cache_smart_topology_enable`,body:`json`};function ge(e){return e.usage(`$0 cache settings smart-tiered-cache create
30
-
31
- Smart Tiered Cache dynamically selects the single closest upper tier for each of your website's origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`).option(`value`,{type:`string`,description:`Enable or disable the Smart Tiered Cache.`,choices:[`on`,`off`]}).coerce(`value`,e=>u(e,`value`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Smart Tiered Cache.`})}const _e={command:`create`,describe:`Create Smart Tiered Cache setting`,builder:ge,handler:async e=>s({command:`cache settings smart-tiered-cache create`,classification:{safeFlags:[`value`,`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings smart-tiered-cache create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({value:e.value}):c(e.body)});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,e.body){let n=c(e.body),r=await o(`Creating`,async()=>t.send(X,{body:n,zone_id:s}));i(r,{successLabel:`Created`});return}e.value===void 0&&(e.value=await f(`value`,`Enable or disable the Smart Tiered Cache.`,[`on`,`off`]));let u=l({value:e.value}),d=await o(`Creating`,async()=>t.send(X,{body:u,zone_id:s}));i(d,{successLabel:`Created`})})};var ve={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/cache/tiered_cache_smart_topology_enable`};function ye(e){return e.usage(`$0 cache settings smart-tiered-cache delete
32
-
33
- Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`).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 be={command:`delete`,describe:`Delete Smart Tiered Cache setting`,builder:ye,handler:async e=>s({command:`cache settings smart-tiered-cache delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){a({command:`cf cache settings smart-tiered-cache delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,!await p({force:!!e.force})){process.stderr.write(`Aborted.
34
- `);return}let c=await o(`Deleting`,async()=>t.send(ve,{zone_id:s}));i(c,{successLabel:`Deleted`})})};var Z={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/cache/tiered_cache_smart_topology_enable`,body:`json`};function xe(e){return e.usage(`$0 cache settings smart-tiered-cache edit
35
-
36
- Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`).option(`value`,{type:`string`,description:`Enable or disable the Smart Tiered Cache.`,choices:[`on`,`off`]}).coerce(`value`,e=>u(e,`value`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update enablement of Smart Tiered Cache.`})}const Se={command:`edit`,describe:`Patch Smart Tiered Cache setting`,builder:xe,handler:async e=>s({command:`cache settings smart-tiered-cache edit`,classification:{safeFlags:[`value`,`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings smart-tiered-cache edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({value:e.value}):c(e.body)});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,e.body){let n=c(e.body),r=await o(`Updating`,async()=>t.send(Z,{body:n,zone_id:s}));i(r,{successLabel:`Updated`});return}e.value===void 0&&(e.value=await f(`value`,`Enable or disable the Smart Tiered Cache.`,[`on`,`off`]));let u=l({value:e.value}),d=await o(`Updating`,async()=>t.send(Z,{body:u,zone_id:s}));i(d,{successLabel:`Updated`})})};var Ce={method:`GET`,path:t=>e`/zones/${t.zone_id}/cache/tiered_cache_smart_topology_enable`};function we(e){return e.usage(`$0 cache settings smart-tiered-cache get
37
-
38
- Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get`,describe:`Get Smart Tiered Cache setting`,builder:we,handler:async e=>s({command:`cache settings smart-tiered-cache get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings smart-tiered-cache get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/tiered_cache_smart_topology_enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=s;let c=await o(`Loading`,async()=>t.send(Ce,{zone_id:s}));i(c,{successLabel:`Loaded`})})},Ee={command:`smart-tiered-cache`,describe:`Automatically determine the best upper-tier data centers for tiered cache topology`,builder:e=>e.command(_e).command(be).command(Se).command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};var De={method:`DELETE`,path:t=>e`/zones/${t.zone_id}/cache/variants`};function Oe(e){return e.usage(`$0 cache settings variants delete
39
-
40
- Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`).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 Q={command:`delete`,describe:`Delete variants setting`,builder:Oe,handler:async e=>s({command:`cache settings variants delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){a({command:`cf cache settings variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,!await p({force:!!e.force})){process.stderr.write(`Aborted.
41
- `);return}let c=await o(`Deleting`,async()=>t.send(De,{zone_id:s}));i(c,{successLabel:`Deleted`})})};var $={method:`PATCH`,path:t=>e`/zones/${t.zone_id}/cache/variants`,body:`json`};function ke(e){return e.usage(`$0 cache settings variants edit
42
-
43
- Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`).option(`value-avif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for avif.`}).option(`value-bmp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for bmp.`}).option(`value-gif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for gif.`}).option(`value-jp2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jp2.`}).option(`value-jpeg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpeg.`}).option(`value-jpg`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg.`}).option(`value-jpg2`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for jpg2.`}).option(`value-png`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for png.`}).option(`value-tif`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tif.`}).option(`value-tiff`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for tiff.`}).option(`value-webp`,{type:`string`,array:!0,description:`List of strings with the MIME types of all the variants that should be served for webp.`}).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 Ae={command:`edit`,describe:`Change variants setting`,builder:ke,handler:async e=>s({command:`cache settings variants edit`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}}):c(e.body)});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=s,e.body){let n=c(e.body),r=await o(`Updating`,async()=>t.send($,{body:n,zone_id:s}));i(r,{successLabel:`Updated`});return}let u=l({value:{avif:e[`value-avif`],bmp:e[`value-bmp`],gif:e[`value-gif`],jp2:e[`value-jp2`],jpeg:e[`value-jpeg`],jpg:e[`value-jpg`],jpg2:e[`value-jpg2`],png:e[`value-png`],tif:e[`value-tif`],tiff:e[`value-tiff`],webp:e[`value-webp`]}}),d=await o(`Updating`,async()=>t.send($,{body:u,zone_id:s}));i(d,{successLabel:`Updated`})})};var je={method:`GET`,path:t=>e`/zones/${t.zone_id}/cache/variants`};function Me(e){return e.usage(`$0 cache settings variants get
44
-
45
- Variant support enables caching variants of images with certain file extensions in addition to the original. This only applies when the origin server sends the 'Vary: Accept' response header. If the origin server sends 'Vary: Accept' but does not serve the variant requested, the response will not be cached. This will be indicated with BYPASS cache status in the response headers.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ne={command:`get`,describe:`Get variants setting`,builder:Me,handler:async e=>s({command:`cache settings variants get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf cache settings variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/variants`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),s=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=s;let c=await o(`Loading`,async()=>t.send(je,{zone_id:s}));i(c,{successLabel:`Loaded`})})},Pe={command:`variants`,describe:`Serve different cached versions of an image based on the Accept header (WebP, AVIF, etc.)`,builder:e=>e.command(Q).command(Ae).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Fe={command:`settings`,describe:`Configure Cache Reserve, tiered caching, and variant serving`,builder:e=>e.command(K).command(he).command(Ee).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`cache`,describe:`Purge cached content and configure Cache Reserve, tiered caching, and variant serving`,builder:e=>e.command(ne).command(g).command(z).command(I).command(N).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ie as default};
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- import{$ as e,D as t,E as n,K as r,L as i,N as a,d as o,h as s,k as c,q as l,rt as u}from"./dist-CX6dDtzj.mjs";import{N as d,O as f}from"./chunk-2HLTAS5V-B92NbX1j.mjs";import{a as p,c as m,d as h,f as ee,h as g,i as _,l as v,m as y,n as te,o as ne,p as re,r as b,s as ie,t as ae,u as x}from"./chunk-2K52M2W5-iYNzknM1.mjs";import{createRequire as S}from"node:module";import{chmodSync as C,existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,writeFileSync as k}from"node:fs";import A from"node:path";import{URLSearchParams as oe}from"node:url";S(import.meta.url||(typeof __filename==`string`?__filename:`/`));function j(e){function t(){return A.resolve(e(),`preferences.json`)}g(t,`getUserPreferencesPath`);function n(){try{let e=E(t(),`utf8`),n=JSON.parse(e);return typeof n==`object`&&n?n:{}}catch{return{}}}g(n,`readUserPreferences`);function r(e){let r={...n(),...e},i=t();T(A.dirname(i),{recursive:!0}),k(i,JSON.stringify(r,null,` `),{encoding:`utf-8`})}return g(r,`updateUserPreferences`),{readUserPreferences:n,updateUserPreferences:r}}g(j,`createPreferences`);var M=6e4,N=525600,P=43200,F=1440,I=Symbol.for(`constructDateFrom`);function L(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&I in e?e[I](t):e instanceof Date?new e.constructor(t):new Date(t)}g(L,`constructFrom`);function R(e,t){return L(t||e,e)}g(R,`toDate`);var z={};function B(){return z}g(B,`getDefaultOptions`);function V(e){let t=R(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-n}g(V,`getTimezoneOffsetInMilliseconds`);function H(e,...t){let n=L.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}g(H,`normalizeDates`);function U(e,t){let n=+R(e)-R(t);return n<0?-1:n>0?1:n}g(U,`compareAsc`);function se(e){return L(e,Date.now())}g(se,`constructNow`);function ce(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}g(ce,`getRoundingMethod`);var le={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},ue=/* @__PURE__ */ g((e,t,n)=>{let r,i=le[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},`formatDistance`);function W(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}g(W,`buildFormatLongFn`);var de={date:W({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:W({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:W({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},fe={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},pe=/* @__PURE__ */ g((e,t,n,r)=>fe[e],`formatRelative`);function G(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}g(G,`buildLocalizeFn`);var me={ordinalNumber:/* @__PURE__ */ g((e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},`ordinalNumber`),era:G({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:G({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:/* @__PURE__ */ g(e=>e-1,`argumentCallback`)}),month:G({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:G({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:G({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function K(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?ge(s,e=>e.test(o)):he(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}g(K,`buildMatchFn`);function he(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}g(he,`findKey`);function ge(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}g(ge,`findIndex`);function _e(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}g(_e,`buildMatchPatternFn`);var ve={code:`en-US`,formatDistance:ue,formatLong:de,formatRelative:pe,localize:me,match:{ordinalNumber:_e({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:/* @__PURE__ */ g(e=>parseInt(e,10),`valueCallback`)}),era:K({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:K({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:/* @__PURE__ */ g(e=>e+1,`valueCallback`)}),month:K({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:K({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:K({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function ye(e,t,n){let r=B(),i=n?.locale??r.locale??ve,a=U(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=H(n?.in,...a>0?[t,e]:[e,t]),l=ce(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/M,f=(u-(V(c)-V(s)))/M,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<F?`hour`:f<P?`day`:f<N?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}if(m===`day`){let e=l(f/F);return i.formatDistance(`xDays`,e,o)}if(m===`month`){let e=l(f/P);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}{let e=l(f/N);return i.formatDistance(`xYears`,e,o)}}g(ye,`formatDistanceStrict`);function be(e,t){return ye(e,se(e),t)}g(be,`formatDistanceToNowStrict`);function q(e,t){return{read:/* @__PURE__ */ g(()=>{let n=t();if(!w(n))return;let r=f(n);try{return x(e,r)}catch{return}},`read`),write(n){let r=t();T(A.dirname(r),{recursive:!0}),k(r,ee(e,n),{encoding:`utf-8`,mode:384}),C(r,384)},clear(){let e=t(),n=w(e);return O(e,{force:!0}),n},path:t}}g(q,`createFileStorage`);function xe(e){let{temporaryAccountLogger:t,prompt:n}=e;return/* @__PURE__ */ g(async function(e,r){if(c())return t.log(r),!0;let i=await n(e);return typeof i==`string`&&i.trim().toLowerCase()===`yes`},`ensureTemporaryTermsAccepted`)}g(xe,`createTemporaryTermsPrompt`);var Se=[9106,1e4];function J(e){return e?.code}g(J,`getErrorCode`);function Ce(e){let t=J(e);return t!==void 0&&Se.includes(t)}g(Ce,`isMembershipsInaccessible`);function we(e){return{"no-credentials-non-interactive":`Could not authenticate because no credentials were found and the environment is non-interactive. Set a CLOUDFLARE_API_TOKEN environment variable or run \`${e}\` in an interactive terminal first.`,"no-credentials-login-failed":`No credentials were found and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-expired-non-interactive":`Your auth token has expired and could not be refreshed, and the environment is non-interactive. Run \`${e}\` in an interactive terminal or set a CLOUDFLARE_API_TOKEN.`,"token-expired-login-failed":`Your auth token has expired and could not be refreshed, and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-refresh-unreachable":`Your auth token has expired and could not be refreshed because the Cloudflare auth server could not be reached. This is usually a network problem (connectivity, proxy, or IPv6), not an invalid login: your stored credentials were left unchanged. Check your connection and try again.`}}g(we,`notLoggedInErrorBodies`);function Te(e,t,n){let r=new Date(t.claim.expiresAt);e.log(_`
3
- Temporary account ready:
4
- Account: ${t.account.name} (${n?`reused`:`created`})
5
- Claim within: ${be(r)}
6
- Claim URL: ${t.claim.url}
7
- `)}g(Te,`logTemporaryPreviewAccount`);function Ee(e,r){let{logger:u}=r,f=r.temporaryAccountLogger??u,p=e.cliName,m=we(e.commands.login),h=`
8
- Run \`${e.commands.whoami}\` to check your current authentication status.`,ee=j(e.getConfigPath),_=o(u,e.cacheNamespace?{namespace:e.cacheNamespace}:void 0),v=ae({serviceName:e.keyringServiceName,getConfigPath:e.getConfigPath,isKeyringEnabled:/* @__PURE__ */ g(()=>ee.readUserPreferences().keyring_enabled===!0,`isKeyringEnabled`),logger:u,isNonInteractiveOrCI:c,loginCommand:e.commands.login,format:e.fileFormat}),y=e.allowGlobalAuthKey??!0,b=te({logger:u,isNonInteractiveOrCI:c,openInBrowser:/* @__PURE__ */ g(e=>a(e,u),`openInBrowser`),hasEnvCredentials:/* @__PURE__ */ g(()=>ne({allowGlobalAuthKey:y})!==void 0,`hasEnvCredentials`),purgeOnLoginOrLogout:_.purgeConfigCaches,clientId:e.clientId,consent:e.consent,cliDisplayName:e.displayName,deviceLoginCommand:e.commands.deviceLogin,redirectUri:e.redirectUri,storageFactory:v.storageFactory,allowGlobalAuthKey:y,temporary:{storage:q(e.fileFormat,e.getTemporaryAccountConfigPath),cliDisplayName:e.displayName,logoutCommand:e.commands.logout,prompt:xe({temporaryAccountLogger:f,prompt:r.prompt}),temporaryAccountLogger:f}});function x(e){b.setProfile(e)}g(x,`setProfile`);function S(){return b.getActiveProfile()}g(S,`getActiveProfile`);function C(){return v.getActiveStore(b.getActiveProfile())}g(C,`getCredentialStore`);function w(e,t){b.setTemporaryAllowed(e,t)}g(w,`setTemporaryAllowed`);function T(){return b.getAPIToken()}g(T,`getAPIToken`);function E(){return b.requireApiToken()}g(E,`requireApiToken`);function D(t,n){return{complianceConfig:t,scopes:n?.scopes??e.getDefaultScopeKeys(),browser:n?.browser??!0,callbackHost:n?.callbackHost,callbackPort:n?.callbackPort,profile:n?.profile,device:n?.device??e.useDeviceFlowByDefault??!1}}g(D,`withLoginDefaults`);async function O(e,t){return b.login(D(e,t))}g(O,`login`);async function k(e){return b.logout(e)}g(k,`logout`);async function A(e,t){return b.getActiveTemporaryAccount()?{loggedIn:!0}:b.loginOrRefreshIfRequired(D(e,t))}g(A,`loginOrRefreshIfRequired`);async function M(){return b.getOAuthTokenFromLocalState()}g(M,`getOAuthTokenFromLocalState`);function N(){return b.getScopes()}g(N,`getScopes`);function P(){return v.storageFactory(S()).read()}g(P,`readAuthCredentials`);function F(e){v.storageFactory(S()).write(e)}g(F,`writeAuthCredentials`);function I(){let t=b.getActiveProfile();return t==="default"?`${e.accountCachePrefix}.json`:`${e.accountCachePrefix}-${t}.json`}g(I,`getAccountCacheFileName`);function L(e){_.saveToConfigCache(I(),{account:e})}g(L,`saveAccountToCache`);function R(){return _.getConfigCache(I()).account}g(R,`getAccountFromCache`);async function z(e,t,a){let o=[],c=!0,l=1,d;for(;c;){d=new oe(d),d.set(`page`,String(l));let{response:f,status:p}=await s(e,t,{},r.userAgent,u,d,void 0,a);f.success?(o.push(...f.result),n(f.result_info)?l+=1:c=!1):i(t,f,p)}return o}g(z,`fetchAccountsPaged`);async function B(t,n={}){let{throwOnEmpty:r=!0}=n,i=await A(t);if(!i.loggedIn)throw new d(`Not logged in. ${m[i.reason]}${h}`,{telemetryMessage:`cfetch auth login required`});let a=E(),[o,s]=await Promise.allSettled([z(t,`/accounts`,a),z(t,`/memberships`,a)]);if(o.status===`rejected`)throw o.reason;if(s.status===`rejected`){if(Ce(s.reason)){if(o.status===`fulfilled`&&o.value.length>0)return o.value;throw J(s.reason)===9106?new d(`Failed to automatically retrieve account IDs for the logged in user.
9
- You may have incorrect permissions on your API token, or an environment variable such as CLOUDFLARE_API_TOKEN, CLOUDFLARE_API_KEY, or CLOUDFLARE_EMAIL may be set to an invalid value.
10
- Check your environment and unset or correct any Cloudflare credential variables, or run \`${e.commands.login}\` to re-authenticate.
11
- You can also skip this account check by adding an \`account_id\` in your ${e.getConfigFileLabel()} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID`,{telemetryMessage:`user account fetch permission denied`}):new d(`Failed to automatically retrieve account IDs for the logged in user.
12
- You may have incorrect permissions on your API token, or your authentication may have expired. Try running \`${e.commands.login}\` to re-authenticate. You can also skip this account check by adding an \`account_id\` in your ${e.getConfigFileLabel()} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID`,{telemetryMessage:`user account fetch permission denied`})}throw s.reason}let c=new Set(s.value.map(e=>e.account.id)),l=o.value.filter(e=>c.has(e.id));if(l.length===0&&r)throw new d(`Failed to automatically retrieve account IDs for the logged in user.
13
- In a non-interactive environment, it is mandatory to specify an account ID, either by assigning its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your ${e.getConfigFileLabel()} file.
14
- Alternatively, try running \`${e.commands.login}\` to re-authenticate.`,{telemetryMessage:`user account fetch empty`});return l}g(B,`fetchAllAccounts`);function V(t){let n=b.getActiveTemporaryAccount();return n?n.account.id:t.account_id?re(t.account_id,`set as \`account_id\` in your ${e.getConfigFileLabel()} file`):ie()||R()?.id}g(V,`getActiveAccountId`);async function H(n){let i=V(n);if(i)return i;let a=await B(n);if(a.length===1)return L({id:a[0].id,name:a[0].name}),a[0].id;try{let e=await r.select(`Select an account`,{choices:a.map(e=>({title:e.name,value:e.id}))}),t=a.find(t=>t.id===e);if(!t)throw Error(`Selected account not found in accounts list`);return L({id:t.id,name:t.name}),e}catch(n){if(r.isNoDefaultValueProvidedError(n)){let n=t();throw new d(`More than one account available but unable to select one in non-interactive mode.
15
- Please set the appropriate \`account_id\` in your ${e.getConfigFileLabel()} file or assign it to the \`CLOUDFLARE_ACCOUNT_ID\` environment variable.
16
- Available accounts are (\`<name>\`: \`<account_id>\`):
17
- ${a.map(e=>` \`${n?`(redacted)`:e.name}\`: \`${e.id}\``).join(`
18
- `)}`,{telemetryMessage:`user account selection unavailable`})}throw n}}g(H,`getOrSelectAccountId`);async function U(e){if(b.isTemporaryAllowed()){if(l(e)!==`public`)throw new d(`Temporary accounts aren't available when the compliance region is not set to public.`,{telemetryMessage:`user temporary account unavailable in compliance region`});let t=b.getActiveTemporaryAccount();if(t)return t.account.id;if(T())throw new d("You're already authenticated with Cloudflare, so `--temporary` can't be used. Temporary preview accounts are only for unauthenticated use. Either remove `--temporary` to use your existing account, or log out (and unset CLOUDFLARE_API_TOKEN) first.",{telemetryMessage:`user temporary account already authenticated`});let{account:n,cached:r}=await b.activateTemporaryAccount();return Te(f,n,r),n.account.id}let t=await A(e);if(!t.loggedIn)throw t.reason===`no-credentials-non-interactive`||t.reason===`token-expired-non-interactive`?new d(`In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for ${p} to work. Please go to https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ for instructions on how to create an api token, and assign its value to CLOUDFLARE_API_TOKEN.`,{telemetryMessage:`user auth missing api token non interactive`}):t.reason===`token-refresh-unreachable`?new d(m[t.reason],{telemetryMessage:`user auth token refresh unreachable`}):new d(`Did not login, quitting...`,{telemetryMessage:`user login cancelled`});let n=await H(e);if(!n)throw new d(`No account id found, quitting...`,{telemetryMessage:`user auth missing account id`});return n}return g(U,`requireAuth`),{setProfile:x,getActiveProfile:S,getCredentialStore:C,setTemporaryAllowed:w,getAPIToken:T,requireApiToken:E,login:O,logout:k,loginOrRefreshIfRequired:A,getOAuthTokenFromLocalState:M,getScopes:N,readAuthCredentials:P,writeAuthCredentials:F,getActiveAccountId:V,getOrSelectAccountId:H,getAccountFromCache:R,fetchAllAccounts:B,requireAuth:U}}g(Ee,`createCloudflareAuth`);var De=`profiles/directory-bindings.json`,Oe=`.enc`;function Y(e){let{logger:t,getConfigPath:n,keyringServiceName:r,format:i}=e,a=`.${i}`;function o(e){return p(n(),e,i)}g(o,`plaintextPath`);function s(e){return v(n(),e)}g(s,`encryptedPath`);function c(){return A.dirname(o(`default`))}g(c,`getProfileConfigDirectory`);let l={exists(e){return w(o(e))||w(s(e))},list(){let e=c();if(!w(e))return[];let t=/* @__PURE__ */ new Set;for(let n of D(e))n.endsWith(a)?t.add(n.slice(0,-a.length)):n.endsWith(Oe)&&t.add(n.slice(0,-Oe.length));return[...t]},delete(e){let{backendAvailable:a,encryptedFileExisted:s}=h({serviceName:r,configPath:n(),profile:e,format:i});q(i,()=>o(e)).clear(),s&&!a&&t.warn(`Removed the credential files for profile "${e}", but the keyring backend was not reachable on this host so its keyring entry could not be cleared. Clear it manually if it persists.`)}};function u(){return A.join(n(),De)}return g(u,`getDirectoryBindingsPath`),b({configs:l,bindings:{read(){try{let e=E(u(),`utf-8`);return JSON.parse(e)}catch{return{}}},write(e){let t=u();T(A.dirname(t),{recursive:!0}),k(t,JSON.stringify(e,null,` `),`utf-8`)}}})}g(Y,`createCloudflareProfileStore`);function ke(e){let{loginCommand:t,createProfileCommand:n,keyringServiceName:r,getConfigPath:i,format:a,preferences:o}=e,{readUserPreferences:s,updateUserPreferences:c}=o;function l(e){return e??`default`}g(l,`describeProfile`);function u(e){let t=[];w(v(i()))&&t.push(void 0);let n=Y({logger:e,getConfigPath:i,keyringServiceName:r,format:a});for(let e of n.configs.list()){try{y(e)}catch{continue}w(v(i(),e))&&t.push(e)}return t}g(u,`listEncryptedProfiles`);function d(e){let o=u(e);if(o.length===0)return;let s=[],c=[];for(let t of o)try{let{backendAvailable:e}=h({serviceName:r,configPath:i(),profile:t,format:a});s.push(l(t)),e||c.push(l(t))}catch(n){e.warn(`Failed to remove encrypted credentials for profile "${l(t)}": ${n instanceof Error?n.message:String(n)}. You may need to clear them manually.`)}if(s.length>0){let r=n?`Re-authenticate with \`${t}\` (default profile) or \`${n} <name>\` (named profiles).`:`Re-authenticate with \`${t}\`.`;e.log(`Removed encrypted credentials for ${s.map(e=>`"${e}"`).join(`, `)}. ${r}`)}c.length>0&&e.warn(`The keyring backend was not reachable on this host, so the keyring entry for ${c.map(e=>`"${e}"`).join(`, `)} could not be cleared. Clear it manually if it persists.`)}g(d,`scrubAllEncryptedProfiles`);function f(e,t){let{logger:n,getCredentialStore:r}=t,i=s().keyring_enabled===!0,a=m();if(a!==void 0&&a!==e&&n.warn(`CLOUDFLARE_AUTH_USE_KEYRING=${a} overrides ${e?`enabling`:`disabling`} keyring storage for this command.`),!e&&a!==!0&&d(n),c({keyring_enabled:e}),e&&a!==!1)try{r().kind!==`encrypted-file`&&(c({keyring_enabled:i}),n.warn(`Keyring storage isn't available on this host (see warning above), so it was not enabled. Try again once the keyring backend is reachable.`))}catch(e){throw c({keyring_enabled:i}),e}return{enabled:s().keyring_enabled===!0}}return g(f,`setKeyringPreference`),{setKeyringPreference:f}}g(ke,`createKeyringPreference`);function Ae(e){let{getConfigPath:t,format:n}=e;function r(e){return p(t(),e,n)}g(r,`getAuthConfigFilePath`);function i(e){return v(t(),e)}g(i,`getEncryptedAuthConfigFilePath`);function a(e){return q(n,()=>r(e))}g(a,`defaultAuthConfigStorage`);function o(e,t){a(t).write(e)}g(o,`writeAuthConfigFile`);function s(e){return a(e).read()}return g(s,`readAuthConfigFile`),{getAuthConfigFilePath:r,getEncryptedAuthConfigFilePath:i,defaultAuthConfigStorage:a,readAuthConfigFile:s,writeAuthConfigFile:o}}g(Ae,`createAuthConfigFileHelpers`),S(import.meta.url||(typeof __filename==`string`?__filename:`/`));var X=`cloudflare`,je=`cf`,Me=`cf`,Ne=`http://localhost:8877/oauth/callback`,Pe={granted:{url:`https://welcome.developers.workers.dev/cf-oauth-consent-granted`},denied:{url:`https://welcome.developers.workers.dev/cf-oauth-consent-denied`,error:"Error: Consent denied. You must grant consent to cf in order to login.\nIf you don't want to do this consider passing an API token via the `CLOUDFLARE_API_TOKEN` environment variable"}},Fe=u({variableName:`CLOUDFLARE_CLIENT_ID`,defaultValue:/* @__PURE__ */ g(()=>`cbca97e7-c331-4cdd-8fd8-e25a451b98bf`,`defaultValue`)});function Z(){return e({appName:`cloudflare`,leadingDot:!1,useLegacyHomeDir:!1})}g(Z,`getCfConfigPath`);var Ie=/* @__PURE__ */ `access:read,access:write,account:read,account_api_tokens:create,agw:read,agw:run,agw:write,ai:read,ai:write,ai-search:read,ai-search:run,ai-search:write,aiaudit:read,aiaudit:write,aig:read,aig:write,auditlogs:read,billing:read,billing:write,browser:read,browser:write,cfone:read,cfone:write,cloudchamber:write,connectivity:admin,connectivity:bind,connectivity:read,constellation:write,containers:write,d1:write,dex:read,dex:write,dns_analytics:read,dns_records:edit,dns_records:read,dns_settings:read,email_routing:read,email_routing:write,email_sending:read,email_sending:write,firstpartytags:write,hyperdrive-planetscale:setup,images:read,images:write,lb:edit,lb:read,logpush:read,logpush:write,mcp_portals:read,mcp_portals:write,notebook-examples:read,notebook-managed:read,notification:read,notification:write,oauth_account_ssl_and_certificates_write,offline,openid,pages:read,pages:write,pipelines:read,pipelines:setup,pipelines:write,query_cache:write,queues:write,r2_catalog:write,radar:read,rag:read,rag:write,registrar:read,registrar:write,secrets_store:read,secrets_store:write,sso-connector:read,sso-connector:write,ssl_certs:write,teams:pii,teams:read,teams:secure_location,teams:write,url_scanner:read,url_scanner:write,user:read,vectorize:write,workers:read,workers:write,workers_builds:read,workers_builds:write,workers_deployments:read,workers_kv:write,workers_observability:read,workers_observability:write,workers_observability_telemetry:write,workers_routes:write,workers_scripts:write,workers_tail:read,zone:read,account-analytics.read,account-ssl-and-certificates.write,ssl-and-certificates.read,ssl-and-certificates.write,registrar-domains.read,registrar-domains.admin,logs.read,logs.write,websearch.run,snippets.read,snippets.write,access-acct.read,access-acct.revoke,access-acct.write,access-app.read,access-app.revoke,access-app.write,access-audit-log.read,access-certificate.read,access-certificate.write,access-custom-page.read,access-custom-page.write,access-device-posture.read,access-device-posture.write,access-group.read,access-group.write,access-idp.read,access-idp.write,access-key.read,access-key.write,access-org.read,access-org.revoke,access-org.write,access-policy-test.read,access-policy-test.write,access-policy.read,access-policy.write,access-population.read,access-population.write,access-saml-certificate.read,access-saml-certificate.write,access-scim-log.read,access-seats.write,access-service-token.read,access-service-token.write,access-ssh-auditing.read,access-ssh-auditing.write,access-tag.read,access-tag.write,access-users.read,access-users.write,access.read,access.revoke,access.write,account-api-gateway.read,account-api-gateway.write,account-custom-asset.read,account-custom-asset.write,account-custom-error-rules.read,account-custom-error-rules.write,account-custom-pages.read,account-custom-pages.write,account-disable-esc.read,account-disable-esc.write,account-dns-settings.read,account-dns-settings.write,account-firewall-access-rules.read,account-firewall-access-rules.write,account-logs.read,account-logs.write,account-rule-lists.read,account-rule-lists.write,account-rulesets.read,account-rulesets.write,account-security-center-insights.read,account-security-center-insights.write,account-settings.read,account-settings.write,account-ssl-and-certificates.read,account-waf.read,account-waf.write,account-waiting-rooms.read,address-maps.read,address-maps.write,agent-memory.write,agw.read,agw.run,agw.write,ai-search.index,ai-search.metadata_read,ai-search.read,ai-search.run,ai-search.write,ai.read,ai.write,aiaudit.read,aiaudit.write,aig.metadata_read,aig.read,aig.run,aig.write,analytics.read,api-gateway.read,api-gateway.write,apps.write,argotunnel.read,argotunnel.write,artifacts.read,artifacts.write,bot-management-feedback.read,bot-management-feedback.write,bot-management.read,bot-management.write,browser-rendering.read,browser-rendering.write,cache-settings.read,cache-settings.write,cache.purge,calls.read,calls.write,casb.read,casb.write,cf-agents.read,cf-agents.write,challenge-widgets.read,challenge-widgets.write,chinanetwork-steering.read,chinanetwork-steering.write,cloud-connector.read,cloud-connector.write,cloud-email-security.read,cloud-email-security.write,cloudchamber.read,cloudchamber.write,cloudforce-one.read,cloudforce-one.write,config-settings.read,config-settings.write,connectivity-directory.admin,connectivity-directory.bind,connectivity-directory.read,constellation.read,constellation.write,containers.read,containers.write,custom-errors.read,custom-errors.write,custom-pages.read,custom-pages.write,d1.metadata_read,d1.read,d1.write,ddos-botnet-feed.read,ddos-botnet-feed.write,ddos-protection.read,ddos-protection.write,dls.read,dls.write,dns-firewall.read,dns-firewall.write,dns-view.read,dns-view.write,dns.read,dns.write,domain-page-shield.read,domain-page.shield,dynamic-redirect.read,dynamic-redirect.write,email-routing-account-rule.read,email-routing-address.read,email-routing-address.write,email-routing-rule.read,email-routing-rule.write,email-routing-suppression.read,email-routing-suppression.write,email-security-dmarcreports.read,email-security-dmarcreports.write,email-sending.read,email-sending.write,fbm.admin,fbm.read,fbm.write,field-extractor.read,field-extractor.write,firewall-for-ai.read,firewall-for-ai.write,firewall-services.read,firewall-services.write,flagship.evaluate,flagship.read,flagship.write,fraud-detection-pii.read,fraud-detection.read,fraud-detection.write,fraud-events.write,fraud-feedback.read,fraud-feedback.write,healthcheck.read,healthcheck.write,http-applications.read,http-applications.write,http-ddos-managed-ruleset.read,http-ddos-managed-ruleset.write,images.metadata_read,images.read,images.write,integration.write,intel.read,intel.write,iot.read,iot.write,ip-prefix-bgp-on-demand.read,ip-prefix-bgp-on-demand.write,ip-prefix.read,ip-prefix.write,k2.consume,k2.produce,k2.read,k2.write,l4-ddos-managed-ruleset.read,l4-ddos-managed-ruleset.write,load-balancers-account.read,load-balancers-account.write,load-balancers.read,load-balancers.write,load-balancing-monitors-and-pools.read,load-balancing-monitors-and-pools.write,magic-firewall.read,magic-firewall.write,magic-transit.read,magic-transit.write,magic-wan.read,magic-wan.write,managed-headers.read,managed-headers.write,mass-url-redirects.read,mass-url-redirects.write,mcp-portals.read,mcp-portals.write,memberships.read,memberships.write,messaging.edit,messaging.metadata_read,messaging.read,moq.read,moq.write,notifications.read,notifications.write,origin.read,origin.write,page-rules.read,page-rules.write,page-shield.read,page.read,page.shield,page.write,pages.metadata_read,payments-gateway.read,payments-gateway.write,pcaps-api.read,pcaps-api.write,pipelines.read,pipelines.send,pipelines.write,precursor.read,precursor.write,pubsub.read,pubsub.write,query-cache.read,query-cache.write,queues.metadata_read,queues.read,queues.write,r2-catalog-sql.read,r2-catalog.read,r2-catalog.write,radar.read,rag.read,rag.run,rag.write,realtime.admin,realtime.read,realtime.write,registrar-sandbox-domains.admin,registrar-sandbox-domains.read,reports-application-security-report.read,request-tracer.read,resource-library.read,resource-library.write,resource-sharing.read,response-compression.read,response-compression.write,sanitize.read,sanitize.write,secrets-store.read,secrets-store.write,select-configuration.read,select-configuration.write,stream.metadata_read,stream.read,stream.write,tag.read,tag.write,teams-cds-compute-account.read,teams-cds-compute-account.write,teams-connector-cloudflared.monitoring,teams-connector-cloudflared.read,teams-connector-cloudflared.write,teams-connector-warp.read,teams-connector-warp.write,teams-connectors.read,teams-connectors.write,teams-dex.read,teams-dex.write,teams-networks.read,teams-networks.write,teams-pii.read,teams-resilience.read,teams-resilience.write,teams-secure.location,teams.read,teams.report,teams.write,transform-rules.read,transform-rules.write,trust-and-safety.read,trust-and-safety.write,url-scanner.read,url-scanner.write,user-details.read,user-details.write,vectorize.read,vectorize.write,waiting-rooms.read,waiting-rooms.write,web3-hostnames.read,web3-hostnames.write,websearch.metadata_read,websearch.read,websearch.write,workers-ci.read,workers-ci.write,workers-kv-storage.metadata_read,workers-kv-storage.read,workers-kv-storage.write,workers-observability-telemetry.write,workers-observability.read,workers-observability.write,workers-r2-bucket-item.read,workers-r2-bucket-item.write,workers-r2.metadata_read,workers-r2.read,workers-r2.write,workers-routes.read,workers-routes.write,workers-scripts.bind,workers-scripts.read,workers-scripts.write,workers-tail.read,workers_ai.metadata_read,zaraz.edit,zaraz.read,zaraz.write,zone-access.read,zone-access.revoke,zone-access.write,zone-custom-asset.read,zone-custom-asset.write,zone-disable-esc.read,zone-disable-esc.write,zone-dns-settings.read,zone-dns-settings.write,zone-observability.read,zone-observability.write,zone-security-center-insights.read,zone-security-center-insights.write,zone-settings.read,zone-settings.write,zone-transform-rules.read,zone-transform-rules.write,zone-versioning.read,zone-versioning.write,zone-waf.read,zone-waf.write,zone.read,zone.write`.split(`,`),Le=[`billing:read`,`billing:write`,`email_routing:read`,`email_sending:read`,`notebook-managed:read`,`oauth_account_ssl_and_certificates_write`],Re=[`hyperdrive-planetscale:setup`],ze=new Set(Le),Be=Ie.filter(e=>!ze.has(e)),Ve=new Set(Re),He=Be.filter(e=>!Ve.has(e));function Ue(e){He=e}g(Ue,`setLoginScopeKeys`);var We=new Set(Be);function Ge(e){return e.every(e=>We.has(e))}g(Ge,`validateScopeKeys`);function Q(){let e=r();return e===`production`?`cloudflare-temporary-account.json`:`cloudflare-temporary-account.${e}.json`}g(Q,`getTemporaryAccountConfigFile`);function Ke(){return A.join(Z(),Q())}g(Ke,`getCfTemporaryAccountConfigPath`);function qe(e){return q(`json`,e)}g(qe,`createJsonFileStorage`);var{getAuthConfigFilePath:Je,getEncryptedAuthConfigFilePath:Ye,defaultAuthConfigStorage:Xe,readAuthConfigFile:Ze,writeAuthConfigFile:Qe}=Ae({getConfigPath:Z,format:`json`}),$={cliName:je,displayName:Me,commands:{login:`cf auth login`,logout:`cf auth logout`,whoami:`cf auth whoami`,createProfile:`cf auth create`,deviceLogin:`cf auth login`},keyringServiceName:X,clientId:Fe,consent:Pe,redirectUri:Ne,useDeviceFlowByDefault:!0,allowGlobalAuthKey:!1,getConfigPath:Z,getTemporaryAccountConfigPath:Ke,fileFormat:`json`,accountCachePrefix:`cloudflare-account`,cacheNamespace:`cloudflare`,getConfigFileLabel:/* @__PURE__ */ g(()=>`cf config`,`getConfigFileLabel`),getDefaultScopeKeys:/* @__PURE__ */ g(()=>He,`getDefaultScopeKeys`)},$e=j(Z),{readUserPreferences:et,updateUserPreferences:tt}=$e;function nt(e){return Ee($,e)}g(nt,`createCfAuth`);function rt(e){return Y({logger:e.logger,getConfigPath:Z,keyringServiceName:X,format:`json`})}g(rt,`createCfProfileStore`);var it=ke({loginCommand:$.commands.login,createProfileCommand:$.commands.createProfile,keyringServiceName:X,getConfigPath:Z,format:`json`,preferences:$e});function at(e,t){return it.setKeyringPreference(e,t)}g(at,`setKeyringPreference`);export{at as a,Z as i,rt as n,Ge as o,qe as r,nt as t};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e,r as t}from"./source-AlTrHNem.mjs";import{B as n,j as r,m as i}from"./dist-CX6dDtzj.mjs";import{N as a,r as o}from"./chunk-2HLTAS5V-B92NbX1j.mjs";import{createRequire as s}from"node:module";import{readFileSync as c}from"node:fs";import l,{resolve as u}from"node:path";import d from"node:assert";import{spawnSync as f}from"node:child_process";const p=s(import.meta.url||(typeof __filename==`string`?__filename:`/`));var m=Object.create,h=Object.defineProperty,g=Object.getOwnPropertyDescriptor,_=Object.getOwnPropertyNames,v=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty,b=(e,t)=>h(e,`name`,{value:t,configurable:!0}),x=/* @__PURE__ */ (e=>p===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(p===void 0?e:p)[t]}):e:p)(function(e){if(p!==void 0)return p.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),S=(e,t)=>function(){return t||(0,e[_(e)[0]])((t={exports:{}}).exports,t),t.exports},C=(e,t)=>{for(var n in t)h(e,n,{get:t[n],enumerable:!0})},w=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of _(t))!y.call(e,i)&&i!==n&&h(e,i,{get:()=>t[i],enumerable:!(r=g(t,i))||r.enumerable});return e},T=(e,t,n)=>(n=e==null?{}:m(v(e)),w(t||!e||!e.__esModule?h(n,`default`,{value:e,enumerable:!0}):n,e)),E=/* @__PURE__ */ e(((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){i?p(e,n):r(`command -v `+t+` 2>/dev/null && { echo >&1 `+t+`; exit 0; }`,function(e,t,r){n(null,!!t)})})},g=function(e,t,n){/^(?!(?:.*\s|.*\.|\W+)$)(?:[a-zA-Z]:)?(?:(?:[^<>:"\|\?\*\n])+(?:\/\/|\/|\\\\|\\)?)+$/m.test(e)?r(`where `+t,function(e){e===null?n(null,!0):n(null,!1)}):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)}})),D=/* @__PURE__ */ e(((e,t)=>{t.exports=E()})),ee=n(),O=D();s(import.meta.url||(typeof __filename==`string`?__filename:`/`));function k(e){if(e.compiled_schema)return c(u(e.compiled_schema));let{base_path:t,source_schemas:n}=e,r=(n??[]).map(e=>u(t,e));if(!(0,O.sync)(`capnp`))throw new a(`The capnp compiler is required to upload capnp schemas, but is not present.`,{telemetryMessage:`capnp compiler missing`});let i=u(t??`.`),o=f(`capnp`,[`compile`,`-o-`,`--src-prefix=${i}`,...r],{maxBuffer:3145728});if(o.error)throw o.error;if(o.stderr.length)throw Error(o.stderr.toString());return o.stdout}b(k,`handleUnsafeCapnp`);var A={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 j(e){let t=A[e];if(t===void 0)throw TypeError(`Unsupported module: `+e);return t}b(j,`toMimeType`);function M(e){let t=Object.keys(A).find(t=>A[t]===e);if(t===void 0)throw TypeError(`Unsupported mime type: `+e);return t}b(M,`fromMimeType`);function N(e,t,n){let s=new ee.FormData,{main:u,sourceMaps:f,migrations:p,code_update_strategy:m,exports:h,compatibility_date:g,compatibility_flags:_,keepVars:v,keepSecrets:y,keepBindings:b,logpush:x,placement:S,tail_consumers:C,streaming_tail_consumers:w,limits:T,annotations:E,keep_assets:D,assets:O,observability:A,cache:M,package_dependencies:N}=e,P={html_handling:O?.assetConfig?.html_handling,not_found_handling:O?.assetConfig?.not_found_handling,base_path:O?.assetConfig?.base_path,run_worker_first:O?.run_worker_first,_redirects:O?._redirects,_headers:O?._headers};if(O&&!O.routerConfig.has_user_worker)return s.set(`metadata`,JSON.stringify({assets:{jwt:O.jwt,config:P},...E&&{annotations:E},...g&&{compatibility_date:g},..._&&{compatibility_flags:_}})),s;let{modules:F}=e,I=[],te=i(`plain_text`,t),ne=i(`json`,t),re=i(`secret_text`,t),ie=i(`kv_namespace`,t),ae=i(`send_email`,t),oe=i(`durable_object_namespace`,t),se=i(`workflow`,t),ce=i(`queue`,t),le=i(`r2_bucket`,t),ue=i(`d1`,t),de=i(`vectorize`,t),fe=i(`ai_search_namespace`,t),pe=i(`ai_search`,t),L=i(`agent_memory`,t),R=i(`hyperdrive`,t),z=i(`secrets_store_secret`,t),B=i(`artifacts`,t),me=i(`unsafe_hello_world`,t),he=i(`flagship`,t),ge=i(`ratelimit`,t),_e=i(`vpc_service`,t),ve=i(`vpc_network`,t),V=i(`service`,t),ye=i(`analytics_engine`,t),be=i(`dispatch_namespace`,t),xe=i(`mtls_certificate`,t),Se=i(`pipeline`,t),Ce=i(`k2`,t),we=i(`worker_loader`,t),Te=i(`logfwdr`,t),Ee=i(`wasm_module`,t),H=i(`browser`,t)[0],U=i(`analytics`,t)[0],W=i(`ai`,t)[0],G=i(`images`,t)[0],K=i(`stream`,t)[0],q=i(`media`,t)[0],J=i(`version_metadata`,t)[0],Y=i(`assets`,t)[0],De=i(`text_blob`,t),Oe=i(`data_blob`,t);i(`inherit`,t).forEach(({binding:e})=>{I.push({name:e,type:`inherit`})}),te.forEach(({binding:e,value:t})=>{I.push({name:e,type:`plain_text`,text:t})}),ne.forEach(({binding:e,value:t})=>{I.push({name:e,type:`json`,json:t})}),re.forEach(({binding:e,value:t})=>{I.push({name:e,type:`secret_text`,text:t})}),ie.forEach(({id:e,binding:t,raw:r})=>{if(n?.dryRun&&(e??=o),e===void 0)throw new a(`${t} bindings must have an "id" field`,{telemetryMessage:`kv namespace binding missing id`});e===o?I.push({name:t,type:`inherit`}):I.push({name:t,type:`kv_namespace`,namespace_id:e,raw:r})}),ae.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?I.push(t):I.push({...t,allowed_destination_addresses:e.allowed_destination_addresses}):I.push({...t,destination_address:e.destination_address})}),oe.forEach(({name:e,class_name:t,script_name:n,environment:r})=>{I.push({name:e,type:`durable_object_namespace`,class_name:t,...n&&{script_name:n},...r&&{environment:r}})}),se.forEach(({binding:e,name:t,class_name:n,script_name:r,raw:i})=>{I.push({type:`workflow`,name:e,workflow_name:t,class_name:n,script_name:r,raw:i})}),ce.forEach(({binding:e,queue_name:t,delivery_delay:r,raw:i})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({type:`queue`,name:e,queue_name:t,delivery_delay:r,raw:i})}),le.forEach(({binding:e,bucket_name:t,jurisdiction:r,raw:i})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`r2_bucket`,bucket_name:t,jurisdiction:r,raw:i})}),ue.forEach(({binding:e,database_id:t,database_internal_env:r,raw:i})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`d1`,id:t,internalEnv:r,raw:i})}),de.forEach(({binding:e,index_name:t,raw:n})=>{I.push({name:e,type:`vectorize`,index_name:t,raw:n})}),fe.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`ai_search_namespace`,namespace:t})}),pe.forEach(({binding:e,instance_name:t})=>{I.push({name:e,type:`ai_search`,instance_name:t})}),L.forEach(({binding:e,namespace:t})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`agent_memory`,namespace:t})}),R.forEach(({binding:e,id:t})=>{I.push({name:e,type:`hyperdrive`,id:t})}),z.forEach(({binding:e,store_id:t,secret_name:n})=>{I.push({name:e,type:`secrets_store_secret`,store_id:t,secret_name:n})}),B.forEach(({binding:e,namespace:t})=>{I.push({name:e,type:`artifacts`,namespace:t})}),me.forEach(({binding:e,enable_timer:t})=>{I.push({name:e,type:`unsafe_hello_world`,enable_timer:t})}),he.forEach(({binding:e,app_id:t})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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`});I.push(t===o?{name:e,type:`inherit`}:{name:e,type:`flagship`,app_id:t})}),ge.forEach(({name:e,namespace_id:t,simple:n})=>{I.push({name:e,type:`ratelimit`,namespace_id:t,simple:n})}),_e.forEach(({binding:e,service_id:t})=>{I.push({name:e,type:`vpc_service`,service_id:t})}),ve.forEach(({binding:e,tunnel_id:t,network_id:n})=>{I.push({name:e,type:`vpc_network`,...t===void 0?{network_id:n}:{tunnel_id:t}})}),V.forEach(({binding:e,service:t,environment:n,entrypoint:r,props:i,cross_account_grant:a})=>{I.push({name:e,type:`service`,service:t,cross_account_grant:a,...n&&{environment:n},...r&&{entrypoint:r},...i&&{props:i}})}),ye.forEach(({binding:e,dataset:t})=>{I.push({name:e,type:`analytics_engine`,dataset:t})}),be.forEach(({binding:e,namespace:t,outbound:r})=>{if(n?.dryRun&&(t??=o),t===void 0)throw new a(`${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===o?I.push({name:e,type:`inherit`}):I.push({name:e,type:`dispatch_namespace`,namespace:t,...r&&{outbound:{worker:{service:r.service,environment:r.environment},params:r.parameters?.map(e=>({name:e}))}}})}),xe.forEach(({binding:e,certificate_id:t})=>{I.push({name:e,type:`mtls_certificate`,certificate_id:t})}),Se.forEach(({binding:e,stream:t,pipeline:n})=>{if(t)I.push({name:e,type:`pipelines`,stream:t});else if(n)I.push({name:e,type:`pipelines`,pipeline:n});else throw Error(`Pipeline binding must specify a stream or pipeline`)}),Ce.forEach(({binding:e,stream:t})=>{I.push({name:e,type:`k2`,stream:t})}),we.forEach(({binding:e})=>{I.push({name:e,type:`worker_loader`})}),Te.forEach(({name:e,destination:t})=>{I.push({name:e,type:`logfwdr`,destination:t})}),Ee.forEach(({binding:e,source:t})=>{I.push({name:e,type:`wasm_module`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/wasm`}))}),H!==void 0&&I.push({name:H.binding,type:`browser`,raw:H.raw}),U!==void 0&&I.push({name:U.binding,type:`analytics`}),W!==void 0&&I.push({name:W.binding,staging:W.staging,type:`ai`,raw:W.raw}),G!==void 0&&I.push({name:G.binding,type:`images`,raw:G.raw}),K!==void 0&&I.push({name:K.binding,type:`stream`}),q!==void 0&&I.push({name:q.binding,type:`media`}),J!==void 0&&I.push({name:J.binding,type:`version_metadata`}),Y!==void 0&&I.push({name:Y.binding,type:`assets`}),De.forEach(({binding:e,source:t})=>{I.push({name:e,type:`text_blob`,part:e}),e!==`__STATIC_CONTENT_MANIFEST`&&(`contents`in t?s.set(e,new File([t.contents],t.path??e,{type:`text/plain`})):s.set(e,new File([c(t.path)],t.path,{type:`text/plain`})))}),Oe.forEach(({binding:e,source:t})=>{I.push({name:e,type:`data_blob`,part:e}),s.set(e,new File([`contents`in t?t.contents:c(t.path)],`path`in t?t.path??e:e,{type:`application/octet-stream`}))});for(let[e,n]of Object.entries(t??{}))if(r(n.type)&&n.type!==`unsafe_hello_world`){let{type:t,...r}=n;I.push({name:e,type:t.slice(7),...r})}let X=`__STATIC_CONTENT_MANIFEST`;if(F?.some(({name:e})=>e===X)&&u.type===`esm`){d(F!==void 0);let e=new Set(F.map(e=>l.posix.dirname(e.name)));for(let t of e){if(t===`.`)continue;let e=l.posix.relative(t,X),n=l.posix.join(t,X);F.push({name:n,filePath:n,content:`export { default } from ${JSON.stringify(e)};`,type:`esm`})}}if(u.type===`commonjs`){for(let e of Object.values([...F||[]]))if(e.name===`__STATIC_CONTENT_MANIFEST`)s.set(e.name,new File([e.content],e.name,{type:`text/plain`})),F=F?.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,`_`);I.push({name:t,type:e.type===`compiled-wasm`?`wasm_module`:e.type===`text`?`text_blob`:`data_blob`,part:t}),s.set(t,new File([e.content],e.name,{type:e.type===`compiled-wasm`?`application/wasm`:e.type===`text`?`text/plain`:`application/octet-stream`})),F=F?.filter(t=>t!==e)}}let Z;if(n?.unsafe?.capnp){let e=k(n.unsafe.capnp);Z=`./capnp-${Date.now()}.compiled`,s.set(Z,new File([e],Z,{type:`application/octet-stream`}))}let Q;v&&(Q??=[],Q.push(`plain_text`,`json`)),y&&(Q??=[],Q.push(`secret_text`,`secret_key`)),b&&(Q??=[],Q.push(...b));let $={...u.type===`commonjs`?{body_part:u.name}:{main_module:u.name},bindings:I,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},...e.images!==void 0&&{images:e.images}})),...g&&{compatibility_date:g},..._&&{compatibility_flags:_},...p&&{migrations:p},...m&&{code_update_strategy:m},...h&&Object.keys(h).length>0&&{exports:h},capnp_schema:Z,...Q&&{keep_bindings:Q},...x!==void 0&&{logpush:x},...S&&{placement:S},...C&&{tail_consumers:C},...w&&{streaming_tail_consumers:w},...T&&{limits:T},...E&&{annotations:E},...D!==void 0&&{keep_assets:D},...O&&{assets:{jwt:O.jwt,config:P}},...A&&{observability:A},...M&&{cache_options:M},...N?.length&&{package_dependencies:N}};if(n?.unsafe?.metadata!==void 0)for(let e of Object.keys(n.unsafe.metadata))$[e]=n.unsafe.metadata[e];if(s.set(`metadata`,JSON.stringify($)),u.type===`commonjs`&&F&&F.length>0)throw TypeError(`More than one module can only be specified when type = 'esm'`);for(let e of[u].concat(F||[]))s.set(e.name,new File([e.content],e.name,{type:j(e.type??u.type??`esm`)}));for(let e of f||[])s.set(e.name,new File([e.content],e.name,{type:`application/source-map`}));return s}b(N,`createWorkerUploadForm`);export{C as a,T as c,S as i,M as n,b as o,A as r,x as s,N as t};