cf 1.0.0-beta.4 → 1.0.0-beta.6

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 (261) hide show
  1. package/dist/_meta/commands.json +5047 -5068
  2. package/dist/_meta/hand-written-commands.json +1 -1
  3. package/dist/_meta/schemas.json +3026 -3123
  4. package/dist/abuse-reports-BtI6fvRl.mjs +24 -0
  5. package/dist/{access-DUQisFsH.mjs → access-CqOyTHw4.mjs} +1 -1
  6. package/dist/{account-tags-DMmTopgx.mjs → account-tags-7I77Dwsd.mjs} +1 -1
  7. package/dist/{accounts-DbZdpH5e.mjs → accounts-Cq-eOPzL.mjs} +32 -26
  8. package/dist/{acm-BtXPdUqH.mjs → acm-CSXnlN6o.mjs} +1 -1
  9. package/dist/{addressing-Bc_ZSmrK.mjs → addressing-C5XvjNhk.mjs} +1 -1
  10. package/dist/{agent-memory-CEUI1wKI.mjs → agent-memory-CSzr9gty.mjs} +1 -1
  11. package/dist/{ai-CFHaVQcc.mjs → ai-C0xWIvsG.mjs} +7 -9
  12. package/dist/{ai-audit-guygqmOl.mjs → ai-audit-B43vm1KJ.mjs} +1 -1
  13. package/dist/{ai-gateway-BcKOL4WQ.mjs → ai-gateway-BK3MbIzT.mjs} +1 -1
  14. package/dist/{ai-search-DJvNkX2o.mjs → ai-search-TrFTxBbn.mjs} +1 -1
  15. package/dist/{ai-security-CVaHbGzn.mjs → ai-security-JrYa27qd.mjs} +1 -1
  16. package/dist/{alerting-wy4IuGs7.mjs → alerting-B1-ZwfVT.mjs} +1 -1
  17. package/dist/{analytics-Do4VMrPX.mjs → analytics-B-wlVtDV.mjs} +1 -1
  18. package/dist/{analytics_engine-Cv7IF8ex.mjs → analytics_engine-DWzzQzOs.mjs} +1 -1
  19. package/dist/{api-security-fuzV322d.mjs → api-security-BWFWWmXl.mjs} +1 -1
  20. package/dist/{argo-BBf-Jw0O.mjs → argo-DHPGTvCT.mjs} +1 -1
  21. package/dist/{artifacts-B7_OhBxW.mjs → artifacts-mmBDk3wO.mjs} +1 -1
  22. package/dist/{audit-logs-DyARgcxN.mjs → audit-logs-CCF5e500.mjs} +1 -1
  23. package/dist/{auth-CiOv7s9F.mjs → auth-Dnp10uLy.mjs} +1 -1
  24. package/dist/{auth-BYFcxn1F.mjs → auth-gOCL6Pm0.mjs} +2 -2
  25. package/dist/{autoconfig-DbL_FL5k.mjs → autoconfig-DqEPKpj0.mjs} +2 -2
  26. package/dist/basin-catalog-hRY01t_Z.mjs +44 -0
  27. package/dist/{billing-07_VIO4X.mjs → billing-C_ev-9nh.mjs} +1 -1
  28. package/dist/{bot-management-CmkPUu2I.mjs → bot-management-CyYsXkZt.mjs} +1 -1
  29. package/dist/{botnet-feed-Bn5pE_rx.mjs → botnet-feed-Dj5R5v2o.mjs} +1 -1
  30. package/dist/{brand-protection-CWDqPOXe.mjs → brand-protection-CmQ6Iu0I.mjs} +1 -1
  31. package/dist/{browser-run-CfEIfpnQ.mjs → browser-run-sWHTsCSB.mjs} +1 -1
  32. package/dist/build-Dyt1M_Ib.mjs +2 -0
  33. package/dist/{build-DEbkHHVh.mjs → build-_qqitpn0.mjs} +1 -1
  34. package/dist/{builds-mgouQLUs.mjs → builds-c21rTfcg.mjs} +1 -1
  35. package/dist/{cache-DXLofz5T.mjs → cache-CuNjJl6m.mjs} +27 -27
  36. package/dist/{certificate-authorities-BfW-rEpf.mjs → certificate-authorities-DRUUzvI3.mjs} +1 -1
  37. package/dist/{cli-Dgk9bd8j.mjs → cli-Caa776EB.mjs} +1 -1
  38. package/dist/{client-certificates-By2A46a2.mjs → client-certificates-BSi1CEGk.mjs} +1 -1
  39. package/dist/{client-side-security-Bo6ZwJOS.mjs → client-side-security-BdxUX3Y8.mjs} +1 -1
  40. package/dist/{cloud-connector-DYb_3u-M.mjs → cloud-connector-B46ajuAj.mjs} +1 -1
  41. package/dist/{cloudforce-one-D8l0I5PL.mjs → cloudforce-one-adbVR2Ah.mjs} +47 -56
  42. package/dist/{command-DaAGN9uP.mjs → command-B47VlNBp.mjs} +1 -1
  43. package/dist/{command-BPfW-yE4.mjs → command-B5Itp2BM.mjs} +1 -1
  44. package/dist/{command-DjNcY4cf.mjs → command-BDCTd8Ra.mjs} +1 -1
  45. package/dist/{command-CJR1CUK_.mjs → command-BmXnByw9.mjs} +1 -1
  46. package/dist/{command-C3Qhz4kU.mjs → command-Bw-M_qxb.mjs} +1 -1
  47. package/dist/{command-BgBsFEYv.mjs → command-C2bU5Etc.mjs} +1 -1
  48. package/dist/{command-DJJN9xaA.mjs → command-CHcCSvVz.mjs} +1 -1
  49. package/dist/{command-C7cOrHdI.mjs → command-CRgQ0dM3.mjs} +1 -1
  50. package/dist/{command-DH67hNLj.mjs → command-CVg0qT13.mjs} +1 -1
  51. package/dist/{command-DRlUj6lW.mjs → command-CkJvjkfK.mjs} +1 -1
  52. package/dist/{command-C_lQtSPg.mjs → command-DV196MKR.mjs} +1 -1
  53. package/dist/{command-gSmdvn_d.mjs → command-Du3MiYA7.mjs} +1 -1
  54. package/dist/{command-CGD1oByJ.mjs → command-eBmGBTA7.mjs} +1 -1
  55. package/dist/{command-DYeBZ5mA.mjs → command-eqgT8zz4.mjs} +1 -1
  56. package/dist/{completions-DUDx3DwX.mjs → completions-DbT6O2ol.mjs} +1 -1
  57. package/dist/{connector-interrupts-DIMvaZhN.mjs → connector-interrupts-BhfMiPcq.mjs} +1 -1
  58. package/dist/{connector-telemetry-events-TWQvm-cj.mjs → connector-telemetry-events-CxKECRgO.mjs} +1 -1
  59. package/dist/{connector-telemetry-snapshots-Dyoe-_R3.mjs → connector-telemetry-snapshots-BHi-jHE5.mjs} +1 -1
  60. package/dist/{connectors-D7ZFg3hB.mjs → connectors-gkP2aNSN.mjs} +1 -1
  61. package/dist/{containers-CduXjFBJ.mjs → containers-BY8pinEV.mjs} +1 -1
  62. package/dist/{containers-Bu3tLjU1.mjs → containers-DUvBpnRo.mjs} +1 -1
  63. package/dist/{content-scan-CVBD6mUI.mjs → content-scan-BCPhAjMZ.mjs} +1 -1
  64. package/dist/{context-BsGrhAqB.mjs → context-CE7QFX-z.mjs} +1 -1
  65. package/dist/{cps-CgiRKmTe.mjs → cps-B35EPUAk.mjs} +1 -1
  66. package/dist/{csamScanner-BlXIOFFe.mjs → csamScanner-DcTA9oLR.mjs} +1 -1
  67. package/dist/{ct-alerting-CJZK0uSQ.mjs → ct-alerting-B3CS-CPk.mjs} +1 -1
  68. package/dist/{custom-certificates-DFaj_czg.mjs → custom-certificates-IjJJhl7_.mjs} +1 -1
  69. package/dist/{custom-csrs-BnFQpjOo.mjs → custom-csrs-ChYOaEQg.mjs} +1 -1
  70. package/dist/{custom-hostnames-DSnE6xOT.mjs → custom-hostnames-Bai3cqAD.mjs} +1 -1
  71. package/dist/{custom-nameservers-CdQOt_qU.mjs → custom-nameservers-DsukmLNZ.mjs} +1 -1
  72. package/dist/{custom-pages-TWGlS6Ms.mjs → custom-pages-CiboX-9D.mjs} +1 -1
  73. package/dist/d1-s293SFAJ.mjs +41 -0
  74. package/dist/{dcv-delegation-DM3oGGio.mjs → dcv-delegation-BfgvmpQT.mjs} +1 -1
  75. package/dist/{deploy-BZUWZ888.mjs → deploy-CvxNMDbS.mjs} +1 -1
  76. package/dist/{deploy-input-ChEbf2Kp.mjs → deploy-input-CNrImP7B.mjs} +1 -1
  77. package/dist/{dev-OsbQIdD8.mjs → dev-Z6vYszaT.mjs} +1 -1
  78. package/dist/{diagnostics-8bbleTmW.mjs → diagnostics-Ops0RjxG.mjs} +1 -1
  79. package/dist/discover-CcGReXr0.mjs +2 -0
  80. package/dist/{dist-DTN-pqSs.mjs → dist-Dgnf_i4w.mjs} +1 -1
  81. package/dist/{dls-TzQpry2j.mjs → dls-uo7NYEqE.mjs} +1 -1
  82. package/dist/{dns-Bzv4YLeg.mjs → dns-B-NwBOpQ.mjs} +52 -43
  83. package/dist/{dns-firewall-BjWwOmDR.mjs → dns-firewall-LTIP13nb.mjs} +1 -1
  84. package/dist/durable-objects-o7uB3YYg.mjs +6 -0
  85. package/dist/{email-auth-Bth4_FHy.mjs → email-auth-BUdBDCaE.mjs} +1 -1
  86. package/dist/{email-routing-CkTh4F5j.mjs → email-routing-BPRliM3z.mjs} +1 -1
  87. package/dist/{email-security-C-2jADxE.mjs → email-security-dbLE3I5c.mjs} +50 -50
  88. package/dist/{email-sending-B_sd4ouE.mjs → email-sending-BLlGy5Mn.mjs} +1 -1
  89. package/dist/error-sanitization-CEf4JTNN.mjs +2 -0
  90. package/dist/{error-sanitization-Dc4bLj8k.mjs → error-sanitization-CcNUzN1f.mjs} +1 -1
  91. package/dist/{fieldExtractors-z92V55-Y.mjs → fieldExtractors-M-KfLOGw.mjs} +1 -1
  92. package/dist/{firewall-0yKpxdjj.mjs → firewall-DzbLwqo3.mjs} +1 -1
  93. package/dist/flagship-DcXWEywy.mjs +28 -0
  94. package/dist/{fraud-BpJ_aoIE.mjs → fraud-CGXRWANi.mjs} +1 -1
  95. package/dist/generate-t4dFfFRV.mjs +2 -0
  96. package/dist/{google-tag-gateway-DA_7SCC3.mjs → google-tag-gateway-B3Z3Puwl.mjs} +1 -1
  97. package/dist/{healthchecks-C-GthoQz.mjs → healthchecks-BIiV29q7.mjs} +1 -1
  98. package/dist/{hostnames-CH6utzVv.mjs → hostnames-ueWsZFwv.mjs} +1 -1
  99. package/dist/{hyperdrive-_rIC33bB.mjs → hyperdrive-Bxk9LZf5.mjs} +1 -1
  100. package/dist/{iam-sseKl99z.mjs → iam-kA9gcv79.mjs} +1 -1
  101. package/dist/{images-CvIOwtg0.mjs → images-CK4J5as7.mjs} +1 -1
  102. package/dist/index.mjs +1 -1
  103. package/dist/{init-DEIhItNF.mjs → init-COcG8sp5.mjs} +2 -2
  104. package/dist/{intel-Da84oZMO.mjs → intel-z7DkM9Xc.mjs} +1 -1
  105. package/dist/{ips-zTTd_3jg.mjs → ips-BXdBK4Co.mjs} +1 -1
  106. package/dist/{keyless-certificates-BGOUKdJc.mjs → keyless-certificates-Dp9xTYtD.mjs} +1 -1
  107. package/dist/{keys-CDnrfmiS.mjs → keys-DrVlj4VI.mjs} +1 -1
  108. package/dist/{kv-C5jR7vjM.mjs → kv-WX-dlUT1.mjs} +1 -1
  109. package/dist/{lazy-command-DZtpMsVB.mjs → lazy-command-g04RHlS2.mjs} +1 -1
  110. package/dist/{leaked-credential-checks-B7WSzVG3.mjs → leaked-credential-checks-BMQ0VhCd.mjs} +1 -1
  111. package/dist/{load-balancers-DG9wMQUM.mjs → load-balancers-BbkSL89c.mjs} +1 -1
  112. package/dist/local-BWhuu9TH.mjs +2 -0
  113. package/dist/{local-B3OyWKkW.mjs → local-Cyk8fPvL.mjs} +1 -1
  114. package/dist/{local-runtime-Co5vVDlI.mjs → local-runtime-CWWJJB2E.mjs} +1 -1
  115. package/dist/{login-k3QLVysD.mjs → login-CyU_ZTNI.mjs} +1 -1
  116. package/dist/{login-rJanUgdL.mjs → login-DYQ8UgJQ.mjs} +1 -1
  117. package/dist/{logo-matches-5nijgkg7.mjs → logo-matches-HFmD2hK6.mjs} +1 -1
  118. package/dist/{logos-BRRqg8_2.mjs → logos-Di2PABE_.mjs} +1 -1
  119. package/dist/{logpush-Br7H8sRD.mjs → logpush-DEqdt0I0.mjs} +1 -1
  120. package/dist/logs-Ckfw-3Q_.mjs +37 -0
  121. package/dist/{magic-cloud-networking-Bu7O7wKz.mjs → magic-cloud-networking-C0yBJKMb.mjs} +1 -1
  122. package/dist/{magic-network-monitoring-Bnc--4Jr.mjs → magic-network-monitoring-CLvaiI7s.mjs} +1 -1
  123. package/dist/{magic-transit-Dxr86HKN.mjs → magic-transit-Bhb1kxYj.mjs} +108 -112
  124. package/dist/{managed-defense-Bm_jKFTN.mjs → managed-defense-COL3aqXw.mjs} +1 -1
  125. package/dist/{managed-transforms-D5mvHv_N.mjs → managed-transforms-cK0strTK.mjs} +1 -1
  126. package/dist/{matches-Dhc1eSWw.mjs → matches-Df4WEz0x.mjs} +1 -1
  127. package/dist/{mcp-B-PBoBl5.mjs → mcp-DK_5OUVl.mjs} +1 -1
  128. package/dist/{mesh-CW8B4naI.mjs → mesh-CVXpTYED.mjs} +1 -1
  129. package/dist/{migrate-B4kBnkpV.mjs → migrate-CipwWhJE.mjs} +1 -1
  130. package/dist/monetization-BHk0S5BF.mjs +20 -0
  131. package/dist/{mtls-certificates-swvfPqA2.mjs → mtls-certificates-8pzdxzOX.mjs} +1 -1
  132. package/dist/{network-iwRBn0i7.mjs → network-ClNeXTvG.mjs} +1 -1
  133. package/dist/{network-interconnects-CjXYZC4g.mjs → network-interconnects-t3jSoV7o.mjs} +1 -1
  134. package/dist/{oauth-CrTr-mRe.mjs → oauth-CJamdfrC.mjs} +1 -1
  135. package/dist/{oauth-DJW_HyaL.mjs → oauth-CNSirGUu.mjs} +1 -1
  136. package/dist/{oauth-clients-DGUJzFFu.mjs → oauth-clients-DBxdvlJC.mjs} +1 -1
  137. package/dist/{oauth-scopes-Bl0YUOHt.mjs → oauth-scopes-D39GYkt6.mjs} +1 -1
  138. package/dist/{observability-DRHiMrLy.mjs → observability-ZV1yPflB.mjs} +1 -1
  139. package/dist/{organization-BoMJzks7.mjs → organization-Bk-TkQlB.mjs} +7 -7
  140. package/dist/{organizations-UGtCHzSq.mjs → organizations-hXITNpPl.mjs} +1 -1
  141. package/dist/{origin-ca-certificates-CdByaOCe.mjs → origin-ca-certificates-DsLR_Z2e.mjs} +1 -1
  142. package/dist/{origin-post-quantum-encryption-GjmifGkF.mjs → origin-post-quantum-encryption-C_egsVQu.mjs} +1 -1
  143. package/dist/{origin-tls-client-auth-CCIqSj_C.mjs → origin-tls-client-auth-DPG6A6kz.mjs} +1 -1
  144. package/dist/{page-rules-Btn-r3QF.mjs → page-rules-B8lrkiiF.mjs} +1 -1
  145. package/dist/pages-Cx4doLvQ.mjs +54 -0
  146. package/dist/{pay-per-crawl-DcAZuk9T.mjs → pay-per-crawl-BUVHqPPA.mjs} +1 -1
  147. package/dist/{pay-per-use-z0Iwy9rN.mjs → pay-per-use-CzYgryid.mjs} +1 -1
  148. package/dist/{pipelines-YRPwntqo.mjs → pipelines-CGHmwc4a.mjs} +1 -1
  149. package/dist/{precursor-Bcww14RH.mjs → precursor--Jim5u4y.mjs} +1 -1
  150. package/dist/{previews-BBn-IiQu.mjs → previews-BKO1pZyG.mjs} +1 -1
  151. package/dist/{progress-5nsUpQL6.mjs → progress-CRjK46r1.mjs} +1 -1
  152. package/dist/{prompt-Ba_bys2F.mjs → prompt-C_90YsVE.mjs} +1 -1
  153. package/dist/{queries-lxdncISw.mjs → queries-z2pjzXlA.mjs} +1 -1
  154. package/dist/{queues-Egb0KXYK.mjs → queues-D0IXxSa7.mjs} +1 -1
  155. package/dist/{r2-BD4NOkR7.mjs → r2-DQ7w9dCM.mjs} +1 -1
  156. package/dist/r2-data-catalog-DpktRU5y.mjs +2 -0
  157. package/dist/{radar-B4dtfeBP.mjs → radar-DyLO7Zg1.mjs} +1 -1
  158. package/dist/{raw-fetch-AX_Gz3c3.mjs → raw-fetch-C8SdmQBp.mjs} +1 -1
  159. package/dist/{realtime-CtLXkW8l.mjs → realtime-mQzLbDxe.mjs} +1 -1
  160. package/dist/{registrar-I9XClUOe.mjs → registrar-ClbtM5Dy.mjs} +2 -2
  161. package/dist/{registrar-sandbox-DAqK58QS.mjs → registrar-sandbox-BIEHm_Jp.mjs} +2 -2
  162. package/dist/{reporting-BYsEUCIE.mjs → reporting-CjkMzSsZ.mjs} +1 -1
  163. package/dist/{request-headers-sc4CaZX0.mjs → request-headers-jr2VznA9.mjs} +1 -1
  164. package/dist/{request-tracers-DXr9Dr2z.mjs → request-tracers-BoSXOTox.mjs} +1 -1
  165. package/dist/{resource-sharing-DgbnNgCQ.mjs → resource-sharing-CFS39nJq.mjs} +1 -1
  166. package/dist/{resource-tagging-CjPU8PpX.mjs → resource-tagging-CZ5mvMhE.mjs} +1 -1
  167. package/dist/{rules-BrshTdy1.mjs → rules-CfqumI45.mjs} +4 -4
  168. package/dist/{rulesets-BZulblVp.mjs → rulesets-o3jsPv4U.mjs} +20 -20
  169. package/dist/{rum-B4IRlWgy.mjs → rum-BZ0rYlun.mjs} +1 -1
  170. package/dist/run-D0_7wBp2.mjs +2 -0
  171. package/dist/{run-UHTbUldP.mjs → run-huwFFwXd.mjs} +1 -1
  172. package/dist/{schema-flags-C4KmiKur.mjs → schema-flags-nL7pHvaE.mjs} +1 -1
  173. package/dist/{scim-BL2TVEZM.mjs → scim-0-eR9pvC.mjs} +1 -1
  174. package/dist/{sdk-Bx29ZKK3.mjs → sdk-Bmz7t_CD.mjs} +1 -1
  175. package/dist/{secrets-store-BcyhU7Kj.mjs → secrets-store-Duc29Zs-.mjs} +1 -1
  176. package/dist/security-insights-5CuLC-Yo.mjs +40 -0
  177. package/dist/{security-txt-BGIj4nU3.mjs → security-txt-qm2PqCPz.mjs} +1 -1
  178. package/dist/{shared-jqlTaG5K.mjs → shared-BDIrEKWt.mjs} +1 -1
  179. package/dist/{smart-shield-C8mGSzyE.mjs → smart-shield-BXLH9OM0.mjs} +1 -1
  180. package/dist/{snippets-BmHMaKEZ.mjs → snippets-DZG6UWeH.mjs} +1 -1
  181. package/dist/{spawn-IM_tQldH.mjs → spawn-KZqyx6KK.mjs} +1 -1
  182. package/dist/{spectrum-CrGKTMx-.mjs → spectrum-Be4ImAIY.mjs} +1 -1
  183. package/dist/{speed-yyPLwj5X.mjs → speed-CNWujfIC.mjs} +1 -1
  184. package/dist/{src-DFnlH5Tg.mjs → src-CW6py11z.mjs} +5 -5
  185. package/dist/{ssl-DZ6G7pP_.mjs → ssl-BIlS4Qs8.mjs} +1 -1
  186. package/dist/{stream-hoBmKs9X.mjs → stream-C5RvTAKF.mjs} +1 -1
  187. package/dist/{submit-Lfebq3yj.mjs → submit-Bpru4P79.mjs} +1 -1
  188. package/dist/{tags-CnHv__u_.mjs → tags-Rv7X1rU9.mjs} +1 -1
  189. package/dist/{telemetry-DbAo3nvk.mjs → telemetry-0npQCuKc.mjs} +1 -1
  190. package/dist/telemetry-B4_YhD82.mjs +2 -0
  191. package/dist/tenant-CjYf6OPN.mjs +10 -0
  192. package/dist/{tenant-custom-nameservers-CZL9_D8w.mjs → tenant-custom-nameservers-BbHaaEhv.mjs} +1 -1
  193. package/dist/{tunnels-DuO8F5_h.mjs → tunnels-CLWPaIIF.mjs} +1 -1
  194. package/dist/{turnstile-B-6k-bKa.mjs → turnstile-C5ezKSoz.mjs} +1 -1
  195. package/dist/update-check-CebyUyqG.mjs +2 -0
  196. package/dist/{update-check-g9Jcn6YJ.mjs → update-check-aOpHVlzB.mjs} +1 -1
  197. package/dist/update-check-worker.mjs +1 -1
  198. package/dist/{url-info-C6-jj9nl.mjs → url-info-Gcf8-MyB.mjs} +1 -1
  199. package/dist/{url-normalization-BRSTQe20.mjs → url-normalization-Dvg8mZRk.mjs} +1 -1
  200. package/dist/{url-scanner-DER5YAdW.mjs → url-scanner-BZCsgh0O.mjs} +1 -1
  201. package/dist/{user-foSeF-0m.mjs → user-BnkvXmjc.mjs} +1 -1
  202. package/dist/{values-DgBNckq9.mjs → values-yUGls__L.mjs} +1 -1
  203. package/dist/{vectorize-9AZMN3fN.mjs → vectorize-BiXngTuI.mjs} +3 -3
  204. package/dist/version-C3q1GMTe.mjs +2 -0
  205. package/dist/{waiting-rooms-CUc0Xqp0.mjs → waiting-rooms-BoLWF74U.mjs} +1 -1
  206. package/dist/{web-assets-D5LUB5UO.mjs → web-assets-CEJ9Zne1.mjs} +1 -1
  207. package/dist/{web3-BvOpojFR.mjs → web3-CIjm7EuJ.mjs} +1 -1
  208. package/dist/workers-DdtWb7Ws.mjs +38 -0
  209. package/dist/{workers-builds-BFqiT0GR.mjs → workers-builds-DT4tA-KT.mjs} +1 -1
  210. package/dist/workers-for-platforms-CaCr8ApU.mjs +42 -0
  211. package/dist/{workers-vpc-9xBzFjiF.mjs → workers-vpc-DRtjG39D.mjs} +1 -1
  212. package/dist/{workflows-BS0EGixd.mjs → workflows-DRme6yrC.mjs} +2 -2
  213. package/dist/{wrangler-migration-BDkh1_IV.mjs → wrangler-migration-BDnS1puc.mjs} +1 -1
  214. package/dist/{zaraz-DBccJ-ZM.mjs → zaraz-DmjDEnUJ.mjs} +1 -1
  215. package/dist/{zero-trust-DGagti-V.mjs → zero-trust-BRAHExxa.mjs} +427 -441
  216. package/dist/{zone-B4OniptR.mjs → zone-CclLvb-g.mjs} +1 -1
  217. package/dist/{zones-DYuGVoTH.mjs → zones-C6tc2OOV.mjs} +1 -1
  218. package/package.json +5 -4
  219. package/dist/abuse-reports-L4L7sC0F.mjs +0 -26
  220. package/dist/account-J7N4Ukse.mjs +0 -12
  221. package/dist/build-BmLpTw4w.mjs +0 -2
  222. package/dist/d1-Cbqx2kAz.mjs +0 -45
  223. package/dist/discover-DgHRf-qo.mjs +0 -2
  224. package/dist/durable-objects-CRhSGkpc.mjs +0 -8
  225. package/dist/error-sanitization-Cu-8OKRA.mjs +0 -2
  226. package/dist/flagship-IRVq23te.mjs +0 -28
  227. package/dist/generate-qMU-2MgC.mjs +0 -2
  228. package/dist/local-qOpZjDed.mjs +0 -2
  229. package/dist/logs-CBU44LT8.mjs +0 -48
  230. package/dist/pages-iil93G96.mjs +0 -60
  231. package/dist/r2-data-catalog-CI-oHtKe.mjs +0 -44
  232. package/dist/run-BQGVl3vg.mjs +0 -2
  233. package/dist/security-center-D1LSkhL_.mjs +0 -30
  234. package/dist/telemetry-C3hmM9Q9.mjs +0 -2
  235. package/dist/tenant-7CL844dh.mjs +0 -12
  236. package/dist/update-check-BDMPumcv.mjs +0 -2
  237. package/dist/version-DLvRzH-I.mjs +0 -2
  238. package/dist/workers-Cko7OnFE.mjs +0 -40
  239. package/dist/workers-for-platforms-EVE01qsM.mjs +0 -25
  240. /package/dist/{alerts-DqZgVSCT.mjs → alerts-DY_7Nknx.mjs} +0 -0
  241. /package/dist/{autorag-Cq9k9Ye6.mjs → autorag-K396-M2S.mjs} +0 -0
  242. /package/dist/{cloudflared-91JvyShh.mjs → cloudflared-Ciq4L97v.mjs} +0 -0
  243. /package/dist/{command-C72KLHMc.mjs → command-D1Z5uf_S.mjs} +0 -0
  244. /package/dist/{discover-VRFBjse7.mjs → discover-B_3A4a_t.mjs} +0 -0
  245. /package/dist/{generate-iV6OVNin.mjs → generate-QUDsysBJ.mjs} +0 -0
  246. /package/dist/{rate-limit-analytics-Bw9qmxMx.mjs → rate-limit-analytics-YsGha5pH.mjs} +0 -0
  247. /package/dist/{rate-limits-CDm_xzKt.mjs → rate-limits-kH13NRdf.mjs} +0 -0
  248. /package/dist/{ready-BXGqY1Wi.mjs → ready-DYun4Fpn.mjs} +0 -0
  249. /package/dist/{recent-submissions-AhGZD3a3.mjs → recent-submissions-18NaOGOo.mjs} +0 -0
  250. /package/dist/{refute-D_w5Gw20.mjs → refute-BhMiJcE1.mjs} +0 -0
  251. /package/dist/{registry-DBMUTYqf.mjs → registry-CSv7HR1J.mjs} +0 -0
  252. /package/dist/{scan-logo-BZzFam-Q.mjs → scan-logo-7y0pqFMk.mjs} +0 -0
  253. /package/dist/{scan-page-BPA8nSPM.mjs → scan-page-B6jnK3QI.mjs} +0 -0
  254. /package/dist/{schema-CueLBLXC.mjs → schema-JVvksQ1J.mjs} +0 -0
  255. /package/dist/{search-De0UlXYN.mjs → search-Rn3Eefv8.mjs} +0 -0
  256. /package/dist/{signed-url-ziDz9frX.mjs → signed-url-Dzwy9Xiw.mjs} +0 -0
  257. /package/dist/{submission-info-83D2DCCG.mjs → submission-info-SNhkDRRZ.mjs} +0 -0
  258. /package/dist/{tools-BJbI_f35.mjs → tools-CFEubTr4.mjs} +0 -0
  259. /package/dist/{total-queries-Dhol31Kn.mjs → total-queries-B20xslrH.mjs} +0 -0
  260. /package/dist/{tracked-domains-DoOPs6Vd.mjs → tracked-domains-BCvIOZOK.mjs} +0 -0
  261. /package/dist/{verify-CxpGEnJb.mjs → verify-DOeBG4PL.mjs} +0 -0
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{i as e}from"./context-BsGrhAqB.mjs";import{r as t}from"./auth-BYFcxn1F.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-5nsUpQL6.mjs";import{t as a}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";function o(e){return e.usage(`$0 zone activate
2
+ import{i as e}from"./context-CE7QFX-z.mjs";import{r as t}from"./auth-gOCL6Pm0.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-CRjK46r1.mjs";import{t as a}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";function o(e){return e.usage(`$0 zone activate
3
3
 
4
4
  Triggeres a new activation check for a PENDING Zone. This can be triggered every 5 min for paygo/ent customers, every hour for FREE Zones.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const s={command:`activate`,describe:`Rerun the Activation Check`,builder:o,handler:async o=>a({command:`zone activate`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf zone activate`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/activation_check`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Updating`,async()=>a.zone.activate({zone_id:s})),{successLabel:`Updated`})})},c={command:`zone`,describe:`zone`,builder:e=>e.command(s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{c as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{i as e}from"./context-BsGrhAqB.mjs";import{r as t}from"./auth-BYFcxn1F.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-5nsUpQL6.mjs";import{t as a}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as o,r as s,t as c}from"./body-parser-hh2avzkz.mjs";import{n as l}from"./input-validation-Dk52b0me.mjs";import{a as u,i as d,n as f}from"./prompt-Ba_bys2F.mjs";import{t as ee}from"./cli-types-DoVT5q_M.mjs";function te(e){return e.usage(`$0 zones aegis edit
2
+ import{i as e}from"./context-CE7QFX-z.mjs";import{r as t}from"./auth-gOCL6Pm0.mjs";import{t as n}from"./output-CvQFJkvi.mjs";import{t as r}from"./dry-run-Bq0JAsbX.mjs";import{t as i}from"./progress-CRjK46r1.mjs";import{t as a}from"./run-huwFFwXd.mjs";import"./telemetry-B4_YhD82.mjs";import{n as o,r as s,t as c}from"./body-parser-hh2avzkz.mjs";import{n as l}from"./input-validation-Dk52b0me.mjs";import{a as u,i as d,n as f}from"./prompt-C_90YsVE.mjs";import{t as ee}from"./cli-types-DoVT5q_M.mjs";function te(e){return e.usage(`$0 zones aegis edit
3
3
 
4
4
  Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`).option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).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 p={command:`edit`,describe:`Change aegis setting`,builder:te,handler:async s=>a({command:`zones aegis edit`,classification:{safeFlags:[`value-enabled`,`dry-run`]}},s,async()=>{if(s.dryRun){r({command:`cf zones aegis edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/settings/aegis`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?c({value:{enabled:s[`value-enabled`],pool_id:l(s[`value-pool-id`],`value-pool-id`,`text`)}}):o(s.body)});return}let a=await t(s),u=await e({zone:s.zone},a,{quiet:s.quiet});if(s.zoneId=u,s.body){let e=o(s.body);n(await i(`Updating`,async()=>a.zones.aegis.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=c({value:{enabled:s[`value-enabled`],pool_id:l(s[`value-pool-id`],`value-pool-id`,`text`)}});n(await i(`Updating`,async()=>a.zones.aegis.edit({...d,zone_id:u})),{successLabel:`Updated`})})};function m(e){return e.usage(`$0 zones aegis get
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf",
3
- "version": "1.0.0-beta.4",
3
+ "version": "1.0.0-beta.6",
4
4
  "description": "The Cloudflare CLI",
5
5
  "keywords": [
6
6
  "ai",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@cloudflare/build-output-utils": "0.8.2",
62
- "@cloudflare/codemods": "0.2.0",
62
+ "@cloudflare/codemods": "0.2.1",
63
63
  "@cloudflare/config": "0.20.0",
64
64
  "@cloudflare/runtime-types": "0.1.4",
65
65
  "blake3-wasm": "2.1.5",
@@ -70,7 +70,7 @@
70
70
  "@bomb.sh/tab": "0.0.15",
71
71
  "@clack/core": "1.2.0",
72
72
  "@clack/prompts": "^1.2.0",
73
- "@cloudflare/autoconfig": "0.7.0",
73
+ "@cloudflare/autoconfig": "0.7.1",
74
74
  "@cloudflare/cli-shared-helpers": "0.2.0",
75
75
  "@cloudflare/containers-shared": "0.20.3",
76
76
  "@cloudflare/deploy-helpers": "0.18.1",
@@ -92,7 +92,7 @@
92
92
  "shell-quote": "^1.8.1",
93
93
  "tsdown": "^0.21.0",
94
94
  "tsx": "4.21.0",
95
- "undici": "7.29.0",
95
+ "undici": "7.29.1",
96
96
  "vitest": "4.1.0",
97
97
  "yargs": "18.0.0",
98
98
  "zod": "4.4.3"
@@ -104,6 +104,7 @@
104
104
  "generate": "tsx generate.ts",
105
105
  "dev": "tsx src/dev.ts",
106
106
  "build": "tsdown",
107
+ "build:test": "tsdown --config tsdown.test.config.ts",
107
108
  "check:type": "tsgo --noEmit",
108
109
  "test": "vitest run",
109
110
  "test:watch": "vitest"
@@ -1,26 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{r}from"./auth-BYFcxn1F.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-5nsUpQL6.mjs";import{t as s}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as c,r as l,t as u}from"./body-parser-hh2avzkz.mjs";import{n as d}from"./input-validation-Dk52b0me.mjs";import{a as f,i as p}from"./prompt-Ba_bys2F.mjs";import{t as m}from"./cli-types-DoVT5q_M.mjs";function h(e){return e.usage(`$0 abuse-reports appeals eligibility <report-id>
3
-
4
- Returns whether the report is currently appealable, along with the signals behind that decision: whether it already has an open appeal, how many appeals have been submitted against it, and whether it has at least one mitigation that an appeal could reverse.`).positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`eligibility <report-id>`,describe:`Check whether a report can be appealed`,builder:h,handler:async c=>s({command:`abuse-reports appeals eligibility`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf abuse-reports appeals eligibility`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/appeals/eligibility`,pathParams:{"report-id":String(c[`report-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.abuseReports.appeals.eligibility({account_id:l,report_id:c[`report-id`]})),{successLabel:`Loaded`})})},_={command:`appeals`,describe:`Operations for appeals`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.usage("$0 abuse-reports create <report-param>\n\nSubmit an abuse report of a particular type. Requires the abuse-reports entitlement on the account (Enterprise accounts have it by default; other accounts must request access) and an API token with the `Account > Abuse Reports > Edit` permission. If the account is not entitled, the request is rejected with an HTTP `401` response (see below).").positional(`report-param`,{type:`string`,description:`The report type to be submitted. Example: abuse_general`,demandOption:!0}).option(`act`,{type:`string`,description:`The act field`,choices:[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`]}).option(`comments`,{type:`string`,description:`Any additional comments about the infringement not exceeding 2000 characters`}).option(`company`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email`,{type:`string`,description:`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email2`,{type:`string`,description:"Should match the value provided in `email`"}).option(`name`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`reported-country`,{type:`string`,description:`Text containing 2 characters`}).option(`reported-user-agent`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`tele`,{type:`string`,description:`Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`title`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`urls`,{type:`string`,description:`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`address1`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agent-name`,{type:`string`,description:`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agree`,{type:`number`,description:"Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports"}).option(`city`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`country`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
5
- `}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
6
- `,choices:[`send`,`send-anon`]}).option(`original-work`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
7
- `}).option(`owner-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
8
- `,choices:[`send`,`send-anon`,`none`]}).option(`signature`,{type:`string`,description:`Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports`}).option(`state`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`justification`,{type:`string`,description:`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters.
9
- `}).option(`trademark-number`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-office`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-symbol`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`destination-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ports-protocols`,{type:`string`,description:`A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual port/protocol should not exceed 100 characters. The list should not have more than 30 unique ports and protocols.`}).option(`source-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of source IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ncmec-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
10
- `,choices:[`send`,`send-anon`]}).option(`reg-who-request-reg-who-authorization-statement`,{type:`string`,description:`Optional authorization statement or power of attorney per RDP 10.2.1.3.`}).option(`reg-who-request-reg-who-good-faith-affirmation`,{type:`boolean`,description:`Affirmation that the request is made in good faith per RDP 10.2.4. Must be true.`}).option(`reg-who-request-reg-who-lawful-processing-agreement`,{type:`boolean`,description:`Agreement to process data lawfully per RDP 10.2.5. Must be true.`}).option(`reg-who-request-reg-who-legal-basis`,{type:`string`,description:`Legal rights and rationale for the request per RDP 10.2.3. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-request-type`,{type:`string`,description:`The type of WHOIS data request per RDP procedure.`,choices:[`disclosure`,`invalid_whois`]}).option(`reg-who-request-reg-who-requested-data-elements`,{type:`string`,array:!0,description:`The specific WHOIS data elements being requested per RDP 10.2.2. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-requestor-type`,{type:`string`,description:`The nature of the requestor per RDP 10.2.1.2.`,choices:[`government`,`corporation`,`individual`]}).option(`ncsei-subject-representation`,{type:`boolean`,description:`If the submitter is the target of NCSEI in the URLs of the abuse report.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`address1`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`address1`,[`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agent-name`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agent-name`,[`address1`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agree`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agree`,[`address1`,`agent-name`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`city`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`city`,[`address1`,`agent-name`,`agree`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`country`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`original-work`]).implies(`country`,[`address1`,`agent-name`,`agree`,`city`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`host-notification`,[`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).conflicts(`original-work`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`,`country`]).implies(`original-work`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`signature`,`state`]).conflicts(`signature`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`signature`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`state`]).conflicts(`state`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`state`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`]).conflicts(`justification`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`trademark-number`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-number`,[`host-notification`,`justification`,`trademark-office`,`trademark-symbol`]).conflicts(`trademark-office`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-office`,[`host-notification`,`justification`,`trademark-number`,`trademark-symbol`]).conflicts(`trademark-symbol`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-symbol`,[`host-notification`,`justification`,`trademark-number`,`trademark-office`]).conflicts(`destination-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ports-protocols`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`source-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ncmec-notification`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`ncmec-notification`,[`host-notification`,`justification`]).conflicts(`reg-who-request-reg-who-authorization-statement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-good-faith-affirmation`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-lawful-processing-agreement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-legal-basis`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-request-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requested-data-elements`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requestor-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`ncsei-subject-representation`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).implies(`ncsei-subject-representation`,[`host-notification`]).check(e=>{if([`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`].some(t=>e[t]!==void 0)){let t={"reg-who-request-reg-who-good-faith-affirmation":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-lawful-processing-agreement":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-legal-basis":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-request-type":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-requested-data-elements":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]},n=[`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --reg_who_request-* flag is set`)}return!0})}const y={command:`create <report-param>`,describe:`Submit an abuse report`,builder:v,handler:async l=>s({command:`abuse-reports create`,classification:{safeFlags:[`act`,`host-notification`,`owner-notification`,`ncmec-notification`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf abuse-reports create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports/${l[`report-param`]==null?`<report-param>`:encodeURIComponent(String(l[`report-param`]))}`,pathParams:{"report-param":String(l[`report-param`]??``)},bodyKind:`json`,body:l.body===void 0?u({act:d(l.act,`act`,`text`),comments:d(l.comments,`comments`,`text`),company:d(l.company,`company`,`text`),email:d(l.email,`email`,`text`),email2:d(l.email2,`email2`,`text`),name:d(l.name,`name`,`text`),reported_country:d(l[`reported-country`],`reported-country`,`text`),reported_user_agent:d(l[`reported-user-agent`],`reported-user-agent`,`text`),tele:d(l.tele,`tele`,`text`),title:d(l.title,`title`,`text`),urls:d(l.urls,`urls`,`text`),address1:d(l.address1,`address1`,`text`),agent_name:d(l[`agent-name`],`agent-name`,`text`),agree:l.agree,city:d(l.city,`city`,`text`),country:d(l.country,`country`,`text`),host_notification:d(l[`host-notification`],`host-notification`,`text`),original_work:d(l[`original-work`],`original-work`,`text`),owner_notification:d(l[`owner-notification`],`owner-notification`,`text`),signature:d(l.signature,`signature`,`text`),state:d(l.state,`state`,`text`),justification:d(l.justification,`justification`,`text`),trademark_number:d(l[`trademark-number`],`trademark-number`,`text`),trademark_office:d(l[`trademark-office`],`trademark-office`,`text`),trademark_symbol:d(l[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:d(l[`destination-ips`],`destination-ips`,`text`),ports_protocols:d(l[`ports-protocols`],`ports-protocols`,`text`),source_ips:d(l[`source-ips`],`source-ips`,`text`),ncmec_notification:d(l[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:d(l[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:l[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:l[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:d(l[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:d(l[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:l[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:d(l[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:l[`ncsei-subject-representation`]}):c(l.body)});return}let s=await r(l),m=l.local?e:await n();if(l.accountId=m,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.abuseReports.create({body:e,account_id:m,report_param:l[`report-param`]})),{successLabel:`Created`});return}if(l.act===void 0&&(l.act=await p(`act`,`The act field`,[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`])),l.email===void 0&&(l.email=await f(`email`,`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),l.email2===void 0&&(l.email2=await f(`email2`,"Should match the value provided in `email`")),l.name===void 0&&(l.name=await f(`name`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),l.urls===void 0&&(l.urls=await f(`urls`,`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),l[`owner-notification`]===void 0&&(l[`owner-notification`]=await p(`owner-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,[`send`,`send-anon`,`none`])),l.act===`abuse_dmca`&&l.address1===void 0&&(l.address1=await f(`address1`,`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --address1`})),l.act===`abuse_dmca`&&l[`agent-name`]===void 0&&(l[`agent-name`]=await f(`agent-name`,`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --agent-name`})),l.act===`abuse_dmca`&&l.agree===void 0)throw Error(`--agree is required (or pass --body with this field set).`);if(l.act===`abuse_dmca`&&l.city===void 0&&(l.city=await f(`city`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --city`})),l.act===`abuse_dmca`&&l.country===void 0&&(l.country=await f(`country`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). `,{question:`Enter value for --country`})),l.act===`abuse_dmca`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_dmca`&&l[`original-work`]===void 0&&(l[`original-work`]=await f(`original-work`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). `,{question:`Enter value for --original-work`})),l.act===`abuse_dmca`&&l.signature===void 0&&(l.signature=await f(`signature`,`Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports`,{question:`Enter value for --signature`})),l.act===`abuse_dmca`&&l.state===void 0&&(l.state=await f(`state`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --state`})),l.act===`abuse_trademark`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_trademark`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_trademark`&&l[`trademark-number`]===void 0&&(l[`trademark-number`]=await f(`trademark-number`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-number`})),l.act===`abuse_trademark`&&l[`trademark-office`]===void 0&&(l[`trademark-office`]=await f(`trademark-office`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-office`})),l.act===`abuse_trademark`&&l[`trademark-symbol`]===void 0&&(l[`trademark-symbol`]=await f(`trademark-symbol`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-symbol`})),l.act===`abuse_general`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_general`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_phishing`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_phishing`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_children`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_children`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_children`&&l[`ncmec-notification`]===void 0&&(l[`ncmec-notification`]=await f(`ncmec-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --ncmec-notification`})),l.act===`abuse_threat`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_threat`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_ncsei`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_ncsei`&&l[`ncsei-subject-representation`]===void 0)throw Error(`--ncsei-subject-representation is required (or pass --body with this field set).`);let h=u({act:d(l.act,`act`,`text`),comments:d(l.comments,`comments`,`text`),company:d(l.company,`company`,`text`),email:d(l.email,`email`,`text`),email2:d(l.email2,`email2`,`text`),name:d(l.name,`name`,`text`),reported_country:d(l[`reported-country`],`reported-country`,`text`),reported_user_agent:d(l[`reported-user-agent`],`reported-user-agent`,`text`),tele:d(l.tele,`tele`,`text`),title:d(l.title,`title`,`text`),urls:d(l.urls,`urls`,`text`),address1:d(l.address1,`address1`,`text`),agent_name:d(l[`agent-name`],`agent-name`,`text`),agree:l.agree,city:d(l.city,`city`,`text`),country:d(l.country,`country`,`text`),host_notification:d(l[`host-notification`],`host-notification`,`text`),original_work:d(l[`original-work`],`original-work`,`text`),owner_notification:d(l[`owner-notification`],`owner-notification`,`text`),signature:d(l.signature,`signature`,`text`),state:d(l.state,`state`,`text`),justification:d(l.justification,`justification`,`text`),trademark_number:d(l[`trademark-number`],`trademark-number`,`text`),trademark_office:d(l[`trademark-office`],`trademark-office`,`text`),trademark_symbol:d(l[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:d(l[`destination-ips`],`destination-ips`,`text`),ports_protocols:d(l[`ports-protocols`],`ports-protocols`,`text`),source_ips:d(l[`source-ips`],`source-ips`,`text`),ncmec_notification:d(l[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:d(l[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:l[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:l[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:d(l[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:d(l[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:l[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:d(l[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:l[`ncsei-subject-representation`]});i(await o(`Creating`,async()=>s.abuseReports.create({body:h,account_id:m,report_param:l[`report-param`]})),{successLabel:`Created`})})};function b(e){return e.usage(`$0 abuse-reports emails list-submitted <report-id>
11
-
12
- List successful emails sent to the submitter of a report submitted by the account. Does not include emails sent to customers or hosts.`).positional(`report-id`,{type:`string`,description:`Public report code.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number to retrieve (default 1).`}).option(`per-page`,{type:`number`,description:`Number of emails per page (default 20, max 100).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list-submitted <report-id>`,describe:`List emails sent to an abuse report submitter`,builder:b,handler:async c=>s({command:`abuse-reports emails list-submitted`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf abuse-reports emails list-submitted`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports/submitted/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/emails`,pathParams:{"report-id":String(c[`report-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.emails.listSubmitted({account_id:u,report_id:c[`report-id`],...s})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 abuse-reports emails list
13
-
14
- List emails sent to the customer for an abuse report. Returns all successful customer emails sent for the specified abuse report. Does not include emails sent to hosts or submitters.`).option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number to retrieve (default 1)`}).option(`per-page`,{type:`number`,description:`Number of emails per page (default 20, max 100)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`List abuse report emails`,builder:S,handler:async c=>s({command:`abuse-reports emails list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf abuse-reports emails list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/emails`,pathParams:{"report-id":String(c[`report-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.emails.list({account_id:u,report_id:c[`report-id`],...s})),{successLabel:`Loaded`})})},w={command:`emails`,describe:`Emails operations`,builder:e=>e.command(C).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.usage(`$0 abuse-reports get-submitted <report-id>
15
-
16
- Retrieve a report submitted by the account.`).positional(`report-id`,{type:`string`,description:`Public report code.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get-submitted <report-id>`,describe:`Get a submitted abuse report`,builder:T,handler:async c=>s({command:`abuse-reports get-submitted`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf abuse-reports get-submitted`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports/submitted/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}`,pathParams:{"report-id":String(c[`report-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.abuseReports.getSubmitted({account_id:l,report_id:c[`report-id`]})),{successLabel:`Loaded`})})};function D(e){return e.usage(`$0 abuse-reports get <report-param>
17
-
18
- Retrieve the details of an abuse report.`).positional(`report-param`,{type:`string`,description:`Identifier of the abuse report`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <report-param>`,describe:`Abuse Report Details`,builder:D,handler:async c=>s({command:`abuse-reports get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf abuse-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports/${c[`report-param`]==null?`<report-param>`:encodeURIComponent(String(c[`report-param`]))}`,pathParams:{"report-param":String(c[`report-param`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.abuseReports.get({account_id:l,report_param:c[`report-param`]})),{successLabel:`Loaded`})})};function k(e){return e.usage(`$0 abuse-reports list-submitted
19
-
20
- List abuse reports submitted by the account.`).option(`page`,{type:`number`,description:`Page of submitted reports to return.`}).option(`per-page`,{type:`number`,description:`Number of submitted reports per page.`}).option(`sort`,{type:`string`,description:`A property and direction to sort by (id, cdate, domain, type, status).`}).option(`id`,{type:`string`,description:`Filter by report code.`}).option(`domain`,{type:`string`,description:`Filter by reported domain. This parameter can be specified multiple times.`}).option(`created-before`,{type:`string`,description:`Return reports submitted before this time.`}).option(`created-after`,{type:`string`,description:`Return reports submitted after this time.`}).option(`status`,{type:`string`,description:`Filter by submitter-facing status. This parameter can be specified multiple times.`}).option(`type`,{type:`string`,description:`Filter by report type. This parameter can be specified multiple times.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list-submitted`,describe:`List submitted abuse reports`,builder:m(k),handler:async c=>s({command:`abuse-reports list-submitted`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],sort:c.sort,id:c.id,domain:c.domain,created_before:c[`created-before`],created_after:c[`created-after`],status:c.status,type:c.type};if(c.dryRun){a({command:`cf abuse-reports list-submitted`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports/submitted`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.listSubmitted({account_id:u,...s})),{successLabel:`Loaded`})})};function j(e){return e.usage(`$0 abuse-reports list
21
-
22
- List the abuse reports for a given account`).option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order (id, cdate, domain, type, status)`}).option(`domain`,{type:`string`,description:`Filter by domain name related to the abuse report`}).option(`created-before`,{type:`string`,description:`Returns reports created before the specified date`}).option(`created-after`,{type:`string`,description:`Returns reports created after the specified date`}).option(`status`,{type:`string`,description:`Filter by the status of the report.`,choices:[`accepted`,`in_review`]}).option(`type`,{type:`string`,description:`Filter by the type of the report.`,choices:[`PHISH`,`GEN`,`THREAT`,`DMCA`,`EMER`,`TM`,`REG_WHO`,`NCSEI`,`NETWORK`]}).option(`mitigation-status`,{type:`string`,description:`Filter reports that have any mitigations in the given status.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`List abuse reports`,builder:m(j),handler:async c=>s({command:`abuse-reports list`,classification:{safeFlags:[`status`,`type`,`mitigation-status`,`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],sort:c.sort,domain:c.domain,created_before:c[`created-before`],created_after:c[`created-after`],status:c.status,type:c.type,mitigation_status:c[`mitigation-status`]};if(c.dryRun){a({command:`cf abuse-reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.list({account_id:u,...s})),{successLabel:`Loaded`})})};function N(e){return e.usage(`$0 abuse-reports mitigations list
23
-
24
- List mitigations done to remediate the abuse report.`).option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order`,choices:[`type,asc`,`type,desc`,`effective_date,asc`,`effective_date,desc`,`status,asc`,`status,desc`,`entity_type,asc`,`entity_type,desc`]}).option(`type`,{type:`string`,description:`Filter by the type of mitigation. This filter parameter can be specified multiple times to include multiple types of mitigations in the result set.`}).option(`effective-before`,{type:`string`,description:`Returns mitigations that were dispatched before the given date`}).option(`effective-after`,{type:`string`,description:`Returns mitigation that were dispatched after the given date`}).option(`status`,{type:`string`,description:`Filter by the status of the mitigation.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`entity-type`,{type:`string`,description:`Filter by the type of entity the mitigation impacts.`,choices:[`url_pattern`,`account`,`zone`,`custom_expression`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`List abuse report mitigations`,builder:m(N),handler:async c=>s({command:`abuse-reports mitigations list`,classification:{safeFlags:[`sort`,`status`,`entity-type`,`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],sort:c.sort,type:c.type,effective_before:c[`effective-before`],effective_after:c[`effective-after`],status:c.status,entity_type:c[`entity-type`]};if(c.dryRun){a({command:`cf abuse-reports mitigations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/mitigations`,pathParams:{"report-id":String(c[`report-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.mitigations.list({account_id:u,report_id:c[`report-id`],...s})),{successLabel:`Loaded`})})};function F(e){return e.usage(`$0 abuse-reports mitigations review <report-id>
25
-
26
- Request a review for mitigations on an account. Repeating a request for a mitigation with an unresolved appeal is idempotent and returns that mitigation in the in-review state.`).positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`appeals`,{type:`string`,description:`List of mitigations to appeal. Provide as a JSON array of objects or @path/to/file.json.`}).option(`data-city`,{type:`string`,description:`The data.city field`}).option(`data-company`,{type:`string`,description:`The data.company field`}).option(`data-counter-notice-response`,{type:`string`,description:`The data.counter_notice_response field`}).option(`data-country`,{type:`string`,description:`The data.country field`}).option(`data-email`,{type:`string`,description:`The data.email field`}).option(`data-full-name`,{type:`string`,description:`The data.full_name field`}).option(`data-jurisdiction-consent`,{type:`boolean`,description:`The data.jurisdiction_consent field`}).option(`data-perjury-attestation`,{type:`boolean`,description:`The data.perjury_attestation field`}).option(`data-phone-number`,{type:`string`,description:`The data.phone_number field`}).option(`data-signature`,{type:`string`,description:`The data.signature field`}).option(`data-state`,{type:`string`,description:`The data.state field`}).option(`data-street-address`,{type:`string`,description:`The data.street_address field`}).option(`data-urls`,{type:`string`,array:!0,description:`The data.urls field`}).option(`data-zip-code`,{type:`string`,description:`The data.zip_code field`}).option(`type`,{type:`string`,description:`The type of appeal being submitted.`,choices:[`counter_notice`,`content_removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Submit an appeal for a report. Provide either a list of mitigations to appeal, or an appeal type with its supporting details, but not both. When type is "counter_notice", the counter-notice details are required.`}).check(e=>{if([`data-city`,`data-company`,`data-counter-notice-response`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].some(t=>e[t]!==void 0)){let t=[`data-city`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --data-* flag is set`)}return!0})}const I={command:`review <report-id>`,describe:`Request review on mitigations`,builder:F,handler:async f=>s({command:`abuse-reports mitigations review`,classification:{safeFlags:[`data-jurisdiction-consent`,`data-perjury-attestation`,`type`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf abuse-reports mitigations review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/abuse-reports/${f[`report-id`]==null?`<report-id>`:encodeURIComponent(String(f[`report-id`]))}/mitigations/appeal`,pathParams:{"report-id":String(f[`report-id`]??``)},bodyKind:`json`,body:f.body===void 0?u({appeals:l(f.appeals,`appeals`),data:{city:d(f[`data-city`],`data-city`,`text`),company:d(f[`data-company`],`data-company`,`text`),counter_notice_response:d(f[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:d(f[`data-country`],`data-country`,`text`),email:d(f[`data-email`],`data-email`,`text`),full_name:d(f[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:f[`data-jurisdiction-consent`],perjury_attestation:f[`data-perjury-attestation`],phone_number:d(f[`data-phone-number`],`data-phone-number`,`text`),signature:d(f[`data-signature`],`data-signature`,`text`),state:d(f[`data-state`],`data-state`,`text`),street_address:d(f[`data-street-address`],`data-street-address`,`text`),urls:f[`data-urls`],zip_code:d(f[`data-zip-code`],`data-zip-code`,`text`)},type:d(f.type,`type`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await n();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.abuseReports.mitigations.review({body:e,account_id:p,report_id:f[`report-id`]})),{successLabel:`Created`});return}let m=u({appeals:l(f.appeals,`appeals`),data:{city:d(f[`data-city`],`data-city`,`text`),company:d(f[`data-company`],`data-company`,`text`),counter_notice_response:d(f[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:d(f[`data-country`],`data-country`,`text`),email:d(f[`data-email`],`data-email`,`text`),full_name:d(f[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:f[`data-jurisdiction-consent`],perjury_attestation:f[`data-perjury-attestation`],phone_number:d(f[`data-phone-number`],`data-phone-number`,`text`),signature:d(f[`data-signature`],`data-signature`,`text`),state:d(f[`data-state`],`data-state`,`text`),street_address:d(f[`data-street-address`],`data-street-address`,`text`),urls:f[`data-urls`],zip_code:d(f[`data-zip-code`],`data-zip-code`,`text`)},type:d(f.type,`type`,`text`)});i(await o(`Creating`,async()=>s.abuseReports.mitigations.review({body:m,account_id:p,report_id:f[`report-id`]})),{successLabel:`Created`})})},L={command:`mitigations`,describe:`Mitigation actions taken in response to abuse reports`,builder:e=>e.command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`abuse-reports`,describe:`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,builder:e=>e.command(y).command(O).command(E).command(M).command(A).command(_).command(w).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{R as default};
@@ -1,12 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{r}from"./auth-BYFcxn1F.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-5nsUpQL6.mjs";import{t as s}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as c,t as l}from"./body-parser-hh2avzkz.mjs";import{n as u}from"./input-validation-Dk52b0me.mjs";import{a as d}from"./prompt-Ba_bys2F.mjs";function f(e){return e.usage(`$0 account batch move
3
-
4
- Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`).option(`account-ids`,{type:`string`,array:!0,description:`Move these accounts to the destination organization.`}).option(`destination-organization-id`,{type:`string`,description:`Move accounts to this organization ID.`}).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 p={command:`move`,describe:`Batch move accounts`,builder:f,handler:async e=>s({command:`account batch move`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf account batch move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({account_ids:e[`account-ids`],destination_organization_id:u(e[`destination-organization-id`],`destination-organization-id`,`text`)}):c(e.body)});return}let t=await r(e);if(e.body){let n=c(e.body);i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`});return}if(e[`account-ids`]===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e[`destination-organization-id`]===void 0&&(e[`destination-organization-id`]=await d(`destination-organization-id`,`Move accounts to this organization ID.`));let n=l({account_ids:e[`account-ids`],destination_organization_id:u(e[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`})})},m={command:`batch`,describe:`Operations for batch`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.usage(`$0 account move
5
-
6
- Move an account within an organization hierarchy or an account outside an organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`).option(`destination-organization-id`,{type:`string`,description:`The destination_organization_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The destination organization ID is where the account is to be moved.`})}const g={command:`move`,describe:`Move account`,builder:h,handler:async f=>s({command:`account move`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf account move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({destination_organization_id:u(f[`destination-organization-id`],`destination-organization-id`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await n();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.account.move({...e,account_id:p})),{successLabel:`Created`});return}f[`destination-organization-id`]===void 0&&(f[`destination-organization-id`]=await d(`destination-organization-id`,`The destination_organization_id field`));let m=l({destination_organization_id:u(f[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>s.account.move({...m,account_id:p})),{successLabel:`Created`})})};function _(e){return e.usage(`$0 account organization list
7
-
8
- Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List account organizations`,builder:_,handler:async c=>s({command:`account organization list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf account organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/organizations`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.account.organization.list({account_id:l})),{successLabel:`Loaded`})})},y={command:`organization`,describe:`Operations for organization`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.usage(`$0 account profile get
9
-
10
- Retrieves the profile information for a specific Cloudflare account, including organization details, settings, and metadata. This endpoint is commonly used to verify account access and retrieve account-level configuration.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Get account profile`,builder:b,handler:async c=>s({command:`account profile get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf account profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/profile`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await n();c.accountId=l,i(await o(`Loading`,async()=>s.account.profile.get({account_id:l})),{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 account profile update
11
-
12
- Updates the profile information for a Cloudflare account. Allows modification of account-level settings and organizational details. Requires Account Settings Write permission.`).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update`,describe:`Modify account profile`,builder:S,handler:async f=>s({command:`account profile update`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf account profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({business_address:u(f[`business-address`],`business-address`,`text`),business_email:u(f[`business-email`],`business-email`,`text`),business_name:u(f[`business-name`],`business-name`,`text`),business_phone:u(f[`business-phone`],`business-phone`,`text`),external_metadata:u(f[`external-metadata`],`external-metadata`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await n();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Updating`,async()=>s.account.profile.update({body:e,account_id:p})),{successLabel:`Updated`});return}f[`business-address`]===void 0&&(f[`business-address`]=await d(`business-address`,`The business_address field`)),f[`business-email`]===void 0&&(f[`business-email`]=await d(`business-email`,`The business_email field`)),f[`business-name`]===void 0&&(f[`business-name`]=await d(`business-name`,`The business_name field`)),f[`business-phone`]===void 0&&(f[`business-phone`]=await d(`business-phone`,`The business_phone field`)),f[`external-metadata`]===void 0&&(f[`external-metadata`]=await d(`external-metadata`,`The external_metadata field`));let m=l({business_address:u(f[`business-address`],`business-address`,`text`),business_email:u(f[`business-email`],`business-email`,`text`),business_name:u(f[`business-name`],`business-name`,`text`),business_phone:u(f[`business-phone`],`business-phone`,`text`),external_metadata:u(f[`external-metadata`],`external-metadata`,`text`)});i(await o(`Updating`,async()=>s.account.profile.update({body:m,account_id:p})),{successLabel:`Updated`})})},w={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`account`,describe:`account`,builder:e=>e.command(g).command(m).command(y).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e,t}from"./build-DEbkHHVh.mjs";export{t as default,e as runBuild};
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{n as t}from"./resolve-BCTrtcx7.mjs";import{a as n,t as r}from"./context-BsGrhAqB.mjs";import{r as i}from"./auth-BYFcxn1F.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-5nsUpQL6.mjs";import{n as c,t as l}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as u,r as d,t as f}from"./body-parser-hh2avzkz.mjs";import{n as p}from"./input-validation-Dk52b0me.mjs";import{a as m,i as h,n as g,t as _}from"./prompt-Ba_bys2F.mjs";import{t as ee}from"./cli-types-DoVT5q_M.mjs";import v from"node:fs";import y from"node:path";const te=(e,t,n)=>{let r=e instanceof RegExp?b(e,n):e,i=t instanceof RegExp?b(t,n):t,a=r!==null&&i!=null&&ne(r,i,n);return a&&{start:a[0],end:a[1],pre:n.slice(0,a[0]),body:n.slice(a[0]+r.length,a[1]),post:n.slice(a[1]+i.length)}},b=(e,t)=>{let n=t.match(e);return n?n[0]:null},ne=(e,t,n)=>{let r,i,a,o,s,c=n.indexOf(e),l=n.indexOf(t,c+1),u=c;if(c>=0&&l>0){if(e===t)return[c,l];for(r=[],a=n.length;u>=0&&!s;){if(u===c)r.push(u),c=n.indexOf(e,u+1);else if(r.length===1){let e=r.pop();e!==void 0&&(s=[e,l])}else i=r.pop(),i!==void 0&&i<a&&(a=i,o=l),l=n.indexOf(t,u+1);u=c<l&&c>=0?c:l}r.length&&o!==void 0&&(s=[a,o])}return s},x=`\0SLASH`+Math.random()+`\0`,S=`\0OPEN`+Math.random()+`\0`,C=`\0CLOSE`+Math.random()+`\0`,w=`\0COMMA`+Math.random()+`\0`,re=`\0PERIOD`+Math.random()+`\0`,ie=new RegExp(x,`g`),ae=new RegExp(S,`g`),oe=new RegExp(C,`g`),se=new RegExp(w,`g`),ce=new RegExp(re,`g`),le=/\\\\/g,ue=/\\{/g,de=/\\}/g,fe=/\\,/g,pe=/\\\./g;function T(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function me(e){return e.replace(le,x).replace(ue,S).replace(de,C).replace(fe,w).replace(pe,re)}function he(e){return e.replace(ie,`\\`).replace(ae,`{`).replace(oe,`}`).replace(se,`,`).replace(ce,`.`)}function ge(e){if(!e)return[``];let t=[],n=te(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=ge(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function _e(e,t={}){if(!e)return[];let{max:n=1e5}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),E(me(e),n,!0).map(he)}function ve(e){return`{`+e+`}`}function ye(e){return/^-?0\d/.test(e)}function be(e,t){return e<=t}function xe(e,t){return e>=t}function E(e,t,n){let r=[],i=te(`{`,`}`,e);if(!i)return[e];let a=i.pre,o=i.post.length?E(i.post,t,!1):[``];if(/\$$/.test(i.pre))for(let e=0;e<o.length&&e<t;e++){let t=a+`{`+i.body+`}`+o[e];r.push(t)}else{let s=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),l=s||c,u=i.body.indexOf(`,`)>=0;if(!l&&!u)return i.post.match(/,(?!,).*\}/)?(e=i.pre+`{`+i.body+C+i.post,E(e,t,!0)):[e];let d;if(l)d=i.body.split(/\.\./);else if(d=ge(i.body),d.length===1&&d[0]!==void 0&&(d=E(d[0],t,!1).map(ve),d.length===1))return o.map(e=>i.pre+d[0]+e);let f;if(l&&d[0]!==void 0&&d[1]!==void 0){let e=T(d[0]),n=T(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(T(d[2])),1):1,a=be;n<e&&(i*=-1,a=xe);let o=d.some(ye);f=[];for(let s=e;a(s,n)&&f.length<t;s+=i){let e;if(c)e=String.fromCharCode(s),e===`\\`&&(e=``);else if(e=String(s),o){let t=r-e.length;if(t>0){let n=Array(t+1).join(`0`);e=s<0?`-`+n+e.slice(1):n+e}}f.push(e)}}else{f=[];for(let e=0;e<d.length;e++)f.push.apply(f,E(d[e],t,!1))}for(let e=0;e<f.length;e++)for(let i=0;i<o.length&&r.length<t;i++){let t=a+f[e]+o[i];(!n||l||t)&&r.push(t)}}return r}const D=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},Se={"[:alnum:]":[`\\p{L}\\p{Nl}\\p{Nd}`,!0],"[:alpha:]":[`\\p{L}\\p{Nl}`,!0],"[:ascii:]":[`\\x00-\\x7f`,!1],"[:blank:]":[`\\p{Zs}\\t`,!0],"[:cntrl:]":[`\\p{Cc}`,!0],"[:digit:]":[`\\p{Nd}`,!0],"[:graph:]":[`\\p{Z}\\p{C}`,!0,!0],"[:lower:]":[`\\p{Ll}`,!0],"[:print:]":[`\\p{C}`,!0],"[:punct:]":[`\\p{P}`,!0],"[:space:]":[`\\p{Z}\\t\\r\\n\\v\\f`,!0],"[:upper:]":[`\\p{Lu}`,!0],"[:word:]":[`\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}`,!0],"[:xdigit:]":[`A-Fa-f0-9`,!1]},O=e=>e.replace(/[[\]\\-]/g,`\\$&`),Ce=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),k=e=>e.join(``),we=(e,t)=>{let n=t;if(e.charAt(n)!==`[`)throw Error(`not in a brace expression`);let r=[],i=[],a=n+1,o=!1,s=!1,c=!1,l=!1,u=n,d=``;WHILE:for(;a<e.length;){let t=e.charAt(a);if((t===`!`||t===`^`)&&a===n+1){l=!0,a++;continue}if(t===`]`&&o&&!c){u=a+1;break}if(o=!0,t===`\\`&&!c){c=!0,a++;continue}if(t===`[`&&!c){for(let[t,[o,c,l]]of Object.entries(Se))if(e.startsWith(t,a)){if(d)return[`$.`,!1,e.length-n,!0];a+=t.length,l?i.push(o):r.push(o),s||=c;continue WHILE}}if(c=!1,d){t>d?r.push(O(d)+`-`+O(t)):t===d&&r.push(O(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(O(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(O(t)),a++}if(u<a)return[``,!1,0,!1];if(!r.length&&!i.length)return[`$.`,!1,e.length-n,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l)return[Ce(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+k(r)+`]`,p=`[`+(l?``:`^`)+k(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},A=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\])\]/g,`$1$2`).replace(/\\([^/])/g,`$1`):t?e.replace(/\[([^/\\{}])\]/g,`$1`):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,`$1$2`).replace(/\\([^/{}])/g,`$1`);var j;const Te=new Set([`!`,`?`,`+`,`*`,`@`]),M=e=>Te.has(e),Ee=e=>M(e.type),De=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Oe=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),ke=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),Ae=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),N=`(?!\\.)`,je=new Set([`[`,`.`]),Me=new Set([`..`,`.`]),Ne=new Set(`().*{}+?[]^$\\!`),Pe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),P=`[^/]`,F=P+`*?`,I=P+`+?`;let Fe=0;var L=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Fe;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for(`nodejs.util.inspect.custom`)](){return{"@@type":`AST`,id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(e,t,n={}){this.type=e,e&&(this.#t=!0),this.#i=t,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?n:this.#e.#c,this.#o=this.#e===this?[]:this.#e.#o,e===`!`&&!this.#e.#s&&this.#o.push(this),this.#a=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#r)if(typeof e!=`string`&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#l===void 0?this.type?this.#l=this.type+`(`+this.#r.map(e=>String(e)).join(`|`)+`)`:this.#l=this.#r.map(e=>String(e)).join(``):this.#l}#d(){if(this!==this.#e)throw Error(`should only call on root`);if(this.#s)return this;this.toString(),this.#s=!0;let e;for(;e=this.#o.pop();){if(e.type!==`!`)continue;let t=e,n=t.#i;for(;n;){for(let r=t.#a+1;!n.type&&r<n.#r.length;r++)for(let t of e.#r){if(typeof t==`string`)throw Error(`string part in extglob AST??`);t.copyIn(n.#r[r])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==``){if(typeof t!=`string`&&!(t instanceof j&&t.#i===this))throw Error(`invalid part: `+t);this.#r.push(t)}}toJSON(){let e=this.type===null?this.#r.slice().map(e=>typeof e==`string`?e:e.toJSON()):[this.type,...this.#r.map(e=>e.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type===`!`)&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#r[t];if(!(n instanceof j&&n.type===`!`))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type===`!`)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#r.length:0;return this.#a===e-1}copyIn(e){typeof e==`string`?this.push(e):this.push(e.clone(this))}clone(e){let t=new j(this.type,e);for(let e of this.#r)t.copyIn(e);return t}static#f(e,t,n,r,i){let a=r.maxExtglobRecursion??2,o=!1,s=!1,c=-1,l=!1;if(t.type===null){let u=n,d=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,d+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),d+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,d+=n;continue}if(!r.noext&&M(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new j(n,t);u=j.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new j(null,t),f=[],p=``;for(;u<e.length;){let n=e.charAt(u++);if(o||n===`\\`){o=!o,p+=n;continue}if(s){u===c+1?(n===`^`||n===`!`)&&(l=!0):n===`]`&&!(u===c+2&&l)&&(s=!1),p+=n;continue}else if(n===`[`){s=!0,c=u,l=!1,p+=n;continue}if(!r.noext&&M(n)&&e.charAt(u)===`(`&&(i<=a||t&&t.#h(n))){let a=t&&t.#h(n)?0:1;d.push(p),p=``;let o=new j(n,d);d.push(o),u=j.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new j(null,t);continue}if(n===`)`)return p===``&&t.#r.length===0&&(t.#u=!0),d.push(p),p=``,t.push(...f,d),u;p+=n}return t.type=null,t.#t=void 0,t.#r=[e.substring(n-1)],u}#p(e){return this.#m(e,Oe)}#m(e,t=De){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null)return!1;let n=e.#r[0];return!n||typeof n!=`object`||n.type===null?!1:this.#h(n.type,t)}#h(e,t=ke){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new j(null,n,this.options);r.#r.push(``),n.push(r),this.#_(e,t)}#_(e,t){let n=e.#r[0];this.#r.splice(t,1,...n.#r);for(let e of n.#r)typeof e==`object`&&(e.#i=this);this.#l=void 0}#v(e){return!!Ae.get(this.type)?.has(e)}#y(e){if(!e||typeof e!=`object`||e.type!==null||e.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let t=e.#r[0];return!t||typeof t!=`object`||t.type===null?!1:this.#v(t.type)}#b(e){let t=Ae.get(this.type),n=e.#r[0],r=t?.get(n.type);if(!r)return!1;this.#r=n.#r;for(let e of this.#r)typeof e==`object`&&(e.#i=this);this.type=r,this.#l=void 0,this.#u=!1}static fromGlob(e,t={}){let n=new j(null,void 0,t);return j.#f(e,n,0,t,0),n}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,n,r,i]=this.toRegExpSource();if(!(r||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let a=(this.#c.nocase?`i`:``)+(i?`u`:``);return Object.assign(RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#e===this&&(this.#x(),this.#d()),!Ee(this)){let n=this.isStart()&&this.isEnd()&&!this.#r.some(e=>typeof e!=`string`),r=this.#r.map(t=>{let[r,i,a,o]=typeof t==`string`?j.#C(t,this.#t,n):t.toRegExpSource(e);return this.#t=this.#t||a,this.#n=this.#n||o,r}).join(``),i=``;if(this.isStart()&&typeof this.#r[0]==`string`&&!(this.#r.length===1&&Me.has(this.#r[0]))){let n=je,a=t&&n.has(r.charAt(0))||r.startsWith(`\\.`)&&n.has(r.charAt(2))||r.startsWith(`\\.\\.`)&&n.has(r.charAt(4)),o=!t&&!e&&n.has(r.charAt(0));i=a?`(?!(?:^|/)\\.\\.?(?:$|/))`:o?N:``}let a=``;return this.isEnd()&&this.#e.#s&&this.#i?.type===`!`&&(a=`(?:$|\\/)`),[i+r+a,A(r),this.#t=!!this.#t,this.#n]}let n=this.type===`*`||this.type===`+`,r=this.type===`!`?`(?:(?!(?:`:`(?:`,i=this.#S(t);if(this.isStart()&&this.isEnd()&&!i&&this.type!==`!`){let e=this.toString(),t=this;return t.#r=[e],t.type=null,t.#t=void 0,[e,A(this.toString()),!1,!1]}let a=!n||e||t?``:this.#S(!0);a===i&&(a=``),a&&(i=`(?:${i})(?:${a})*?`);let o=``;if(this.type===`!`&&this.#u)o=(this.isStart()&&!t?N:``)+I;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?N:``)+F+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,A(i),this.#t=!!this.#t,this.#n]}#x(){if(Ee(this)){let e=0,t=!1;do{t=!0;for(let e=0;e<this.#r.length;e++){let n=this.#r[e];typeof n==`object`&&(n.#x(),this.#m(n)?(t=!1,this.#_(n,e)):this.#p(n)?(t=!1,this.#g(n,e)):this.#y(n)&&(t=!1,this.#b(n)))}}while(!t&&++e<10)}else for(let e of this.#r)typeof e==`object`&&e.#x();this.#l=void 0}#S(e){return this.#r.map(t=>{if(typeof t==`string`)throw Error(`string type in extglob ast??`);let[n,r,i,a]=t.toRegExpSource(e);return this.#n=this.#n||a,n}).filter(e=>!(this.isStart()&&this.isEnd())||!!e).join(`|`)}static#C(e,t,n=!1){let r=!1,i=``,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e.charAt(s);if(r){r=!1,i+=(Ne.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?I:F,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=we(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=P,t=!0;continue}i+=Pe(c)}return[i,A(e),!!t,a]}};j=L;const Ie=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),R=(e,t,n={})=>(D(t),!n.nocomment&&t.charAt(0)===`#`?!1:new q(t,n).match(e)),Le=/^\*+([^+@!?*[(]*)$/,Re=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),ze=e=>t=>t.endsWith(e),Be=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),Ve=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),He=/^\*+\.\*+$/,Ue=e=>!e.startsWith(`.`)&&e.includes(`.`),We=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Ge=/^\.\*+$/,Ke=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),qe=/^\*+$/,Je=e=>e.length!==0&&!e.startsWith(`.`),Ye=e=>e.length!==0&&e!==`.`&&e!==`..`,Xe=/^\?+([^+@!?*[(]*)?$/,Ze=([e,t=``])=>{let n=z([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Qe=([e,t=``])=>{let n=B([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},$e=([e,t=``])=>{let n=B([e]);return t?e=>n(e)&&e.endsWith(t):n},et=([e,t=``])=>{let n=z([e]);return t?e=>n(e)&&e.endsWith(t):n},z=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},B=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},V=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,H={win32:{sep:`\\`},posix:{sep:`/`}};R.sep=V===`win32`?H.win32.sep:H.posix.sep;const U=Symbol(`globstar **`);R.GLOBSTAR=U,R.filter=(e,t={})=>n=>R(n,e,t);const W=(e,t={})=>Object.assign({},e,t);R.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return R;let t=R;return Object.assign((n,r,i={})=>t(n,r,W(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,W(e,n))}static defaults(n){return t.defaults(W(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,W(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,W(e,r))}},unescape:(n,r={})=>t.unescape(n,W(e,r)),escape:(n,r={})=>t.escape(n,W(e,r)),filter:(n,r={})=>t.filter(n,W(e,r)),defaults:n=>t.defaults(W(e,n)),makeRe:(n,r={})=>t.makeRe(n,W(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,W(e,r)),match:(n,r,i={})=>t.match(n,r,W(e,i)),sep:t.sep,GLOBSTAR:U})};const G=(e,t={})=>(D(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:_e(e,{max:t.braceExpandMax}));R.braceExpand=G,R.makeRe=(e,t={})=>new q(e,t).makeRe(),R.match=(e,t,n={})=>{let r=new q(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const K=/[?*]|[+@!]\(.*?\)|\[|\]/,tt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var q=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){D(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||V,this.isWindows=this.platform===`win32`,this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,`/`)),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot===void 0?!!(this.isWindows&&this.nocase):t.windowsNoMagicRoot,this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!=`string`)return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)===`#`){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...e)=>console.error(...e)),this.debug(this.pattern,this.globSet);let n=this.globSet.map(e=>this.slashSplit(e));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((e,t,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){let t=e[0]===``&&e[1]===``&&(e[2]===`?`||!K.test(e[2]))&&!K.test(e[3]),n=/^[a-z]:/i.test(e[0]);if(t)return[...e.slice(0,4),...e.slice(4).map(e=>this.parse(e))];if(n)return[e[0],...e.slice(1).map(e=>this.parse(e))]}return e.map(e=>this.parse(e))});if(this.debug(this.pattern,r),this.set=r.filter(e=>e.indexOf(!1)===-1),this.isWindows)for(let e=0;e<this.set.length;e++){let t=this.set[e];t[0]===``&&t[1]===``&&this.globParts[e][2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3])&&(t[2]=`?`)}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let t of e)for(let e=0;e<t.length;e++)t[e]===`**`&&(t[e]=`*`);let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):e=t>=1?this.levelOneOptimize(e):this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(e=>{let t=-1;for(;(t=e.indexOf(`**`,t+1))!==-1;){let n=t;for(;e[n+1]===`**`;)n++;n!==t&&e.splice(t,n-t)}return e})}levelOneOptimize(e){return e.map(e=>(e=e.reduce((e,t)=>{let n=e[e.length-1];return t===`**`&&n===`**`?e:t===`..`&&n&&n!==`..`&&n!==`.`&&n!==`**`?(e.pop(),e):(e.push(t),e)},[]),e.length===0?[``]:e))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let n=1;n<e.length-1;n++){let r=e[n];n===1&&r===``&&e[0]===``||(r===`.`||r===``)&&(t=!0,e.splice(n,1),n--)}e[0]===`.`&&e.length===2&&(e[1]===`.`||e[1]===``)&&(t=!0,e.pop())}let n=0;for(;(n=e.indexOf(`..`,n+1))!==-1;){let r=e[n-1];r&&r!==`.`&&r!==`..`&&r!==`**`&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[``]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let r=-1;for(;(r=n.indexOf(`**`,r+1))!==-1;){let i=r;for(;n[i+1]===`**`;)i++;i>r&&n.splice(r+1,i-r);let a=n[r+1],o=n[r+2],s=n[r+3];if(a!==`..`||!o||o===`.`||o===`..`||!s||s===`.`||s===`..`)continue;t=!0,n.splice(r,1);let c=n.slice(0);c[r]=`**`,e.push(c),r--}if(!this.preserveMultipleSlashes){for(let e=1;e<n.length-1;e++){let r=n[e];e===1&&r===``&&n[0]===``||(r===`.`||r===``)&&(t=!0,n.splice(e,1),e--)}n[0]===`.`&&n.length===2&&(n[1]===`.`||n[1]===``)&&(t=!0,n.pop())}let i=0;for(;(i=n.indexOf(`..`,i+1))!==-1;){let e=n[i-1];if(e&&e!==`.`&&e!==`..`&&e!==`**`){t=!0;let e=i===1&&n[i+1]===`**`?[`.`]:[];n.splice(i-1,2,...e),n.length===0&&n.push(``),i-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let r=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(r){e[t]=[],e[n]=r;break}}return e.filter(e=>e.length)}partsMatch(e,t,n=!1){let r=0,i=0,a=[],o=``;for(;r<e.length&&i<t.length;)if(e[r]===t[i])a.push(o===`b`?t[i]:e[r]),r++,i++;else if(n&&e[r]===`**`&&t[i]===e[r+1])a.push(e[r]),r++;else if(n&&t[i]===`**`&&e[r]===t[i+1])a.push(t[i]),i++;else if(e[r]===`*`&&t[i]&&(this.options.dot||!t[i].startsWith(`.`))&&t[i]!==`**`){if(o===`b`)return!1;o=`a`,a.push(e[r]),r++,i++}else if(t[i]===`*`&&e[r]&&(this.options.dot||!e[r].startsWith(`.`))&&e[r]!==`**`){if(o===`a`)return!1;o=`b`,a.push(t[i]),r++,i++}else return!1;return e.length===t.length&&a}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,n=0;for(let r=0;r<e.length&&e.charAt(r)===`!`;r++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!1){let r=0,i=0;if(this.isWindows){let n=typeof e[0]==`string`&&/^[a-z]:$/i.test(e[0]),a=!n&&e[0]===``&&e[1]===``&&e[2]===`?`&&/^[a-z]:$/i.test(e[3]),o=typeof t[0]==`string`&&/^[a-z]:$/i.test(t[0]),s=!o&&t[0]===``&&t[1]===``&&t[2]===`?`&&typeof t[3]==`string`&&/^[a-z]:$/i.test(t[3]),c=a?3:n?0:void 0,l=s?3:o?0:void 0;if(typeof c==`number`&&typeof l==`number`){let[n,a]=[e[c],t[l]];n.toLowerCase()===a.toLowerCase()&&(t[l]=n,i=l,r=c)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(U)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(U,i),o=t.lastIndexOf(U),[s,c,l]=n?[t.slice(i,a),t.slice(a+1),[]]:[t.slice(i,a),t.slice(a+1,o),t.slice(o+1)];if(s.length){let t=e.slice(r,r+s.length);if(!this.#n(t,s,n,0,0))return!1;r+=s.length,i+=s.length}let u=0;if(l.length){if(l.length+r>e.length)return!1;let t=e.length-l.length;if(this.#n(e,l,n,t,0))u=l.length;else{if(e[e.length-1]!==``||r+l.length===e.length||(t--,!this.#n(e,l,n,t,0)))return!1;u=l.length+1}}if(!c.length){let t=!!u;for(let n=r;n<e.length-u;n++){let r=String(e[n]);if(t=!0,r===`.`||r===`..`||!this.options.dot&&r.startsWith(`.`))return!1}return n||t}let d=[[[],0]],f=d[0],p=0,m=[0];for(let e of c)e===U?(m.push(p),f=[[],0],d.push(f)):(f[0].push(e),p++);let h=d.length-1,g=e.length-u;for(let e of d)e[1]=g-(m[h--]+e[0].length);return!!this.#t(e,d,r,0,n,0,!!u)}#t(e,t,n,r,i,a,o){let s=t[r];if(!s){for(let t=n;t<e.length;t++){o=!0;let n=e[t];if(n===`.`||n===`..`||!this.options.dot&&n.startsWith(`.`))return!1}return o}let[c,l]=s;for(;n<=l;){if(this.#n(e.slice(0,n+c.length),c,i,n,0)&&a<this.maxGlobstarRecursion){let s=this.#t(e,t,n+c.length,r+1,i,a+1,o);if(s!==!1)return s}let s=e[n];if(s===`.`||s===`..`||!this.options.dot&&s.startsWith(`.`))return!1;n++}return i||null}#n(e,t,n,r,i){let a,o,s,c;for(a=r,o=i,c=e.length,s=t.length;a<c&&o<s;a++,o++){this.debug(`matchOne loop`);let n=t[o],r=e[a];if(this.debug(t,n,r),n===!1||n===U)return!1;let i;if(typeof n==`string`?(i=r===n,this.debug(`string match`,n,r,i)):(i=n.test(r),this.debug(`pattern match`,n,r,i)),!i)return!1}if(a===c&&o===s)return!0;if(a===c)return n;if(o===s)return a===c-1&&e[a]===``;throw Error(`wtf?`)}braceExpand(){return G(this.pattern,this.options)}parse(e){D(e);let t=this.options;if(e===`**`)return U;if(e===``)return``;let n,r=null;(n=e.match(qe))?r=t.dot?Ye:Je:(n=e.match(Le))?r=(t.nocase?t.dot?Ve:Be:t.dot?ze:Re)(n[1]):(n=e.match(Xe))?r=(t.nocase?t.dot?Qe:Ze:t.dot?$e:et)(n):(n=e.match(He))?r=t.dot?We:Ue:(n=e.match(Ge))&&(r=Ke);let i=L.fromGlob(e,this.options).toMMPattern();return r&&typeof i==`object`&&Reflect.defineProperty(i,`test`,{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,n=t.noglobstar?`[^/]*?`:t.dot?`(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?`:`(?:(?!(?:\\/|^)\\.).)*?`,r=new Set(t.nocase?[`i`]:[]),i=e.map(e=>{let t=e.map(e=>{if(e instanceof RegExp)for(let t of e.flags.split(``))r.add(t);return typeof e==`string`?tt(e):e===U?U:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==U||a===U||(a===void 0?i!==void 0&&i!==U?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==U&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=U))});let i=t.filter(e=>e!==U);if(this.partial&&i.length>=1){let e=[];for(let t=1;t<=i.length;t++)e.push(i.slice(0,t).join(`/`));return`(?:`+e.join(`|`)+`)`}return i.join(`/`)}).join(`|`),[a,o]=e.length>1?[`(?:`,`)`]:[``,``];i=`^`+a+i+o+`$`,this.partial&&(i=`^(?:\\/|`+a+i.slice(1,-1)+o+`)$`),this.negate&&(i=`^(?!`+i+`).+$`);try{this.regexp=new RegExp(i,[...r].join(``))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split(`/`):this.isWindows&&/^\/\/[^/]+/.test(e)?[``,...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug(`match`,e,this.pattern),this.comment)return!1;if(this.empty)return e===``;if(e===`/`&&t)return!0;let n=this.options;this.isWindows&&(e=e.split(`\\`).join(`/`));let r=this.slashSplit(e);this.debug(this.pattern,`split`,r);let i=this.set;this.debug(this.pattern,`set`,i);let a=r[r.length-1];if(!a)for(let e=r.length-2;!a&&e>=0;e--)a=r[e];for(let e of i){let i=r;if(n.matchBase&&e.length===1&&(i=[a]),this.matchOne(i,e,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return R.defaults(e).Minimatch}};R.AST=L,R.Minimatch=q,R.escape=Ie,R.unescape=A;function J(e){let t=e.replace(/\\/g,`/`),n=y.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}function Y(e,t){if(t===`.`)return e;let n=`${t}/`;if(!e.startsWith(n))throw Error(`Expected migrations pattern ${JSON.stringify(e)} to start with ${JSON.stringify(n)}`);return e.slice(n.length)}function X(e){return`"${e.replace(/"/g,`""`)}"`}function nt(e){return`CREATE TABLE IF NOT EXISTS ${X(e)}(
3
- id INTEGER PRIMARY KEY AUTOINCREMENT,
4
- name TEXT UNIQUE,
5
- applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
6
- );`}function rt(e){return`SELECT *
7
- FROM ${X(e)}
8
- ORDER BY id`}function it(e){if(e.pattern!==void 0&&e.dir===void 0)throw Error(`You have set --pattern "${e.pattern}" but have not set --dir.\n\nWhen --pattern is set, --dir must also be set, and --pattern must start with "<dir>/".`);let t=J(e.dir??`./migrations`),n=J(`${t}/*.sql`),r;if(e.pattern===void 0)r=n;else{r=J(e.pattern);try{Y(r,t)}catch{throw Error(`--pattern "${e.pattern}" must start with "${t}/" to match --dir "${t}".\nEither change --pattern so it starts with "${t}/" (for example, "${n}"), or change --dir to match the start of your pattern.`)}}return{migrationsPath:y.resolve(e.cwd??process.cwd(),t),migrationsDir:t,migrationsPattern:r,migrationsTableName:e.table??`d1_migrations`}}function at(e,t){let n=[],r=[{abs:e,rel:``}];for(;r.length>0;){let{abs:e,rel:i}=r.pop(),a;try{a=v.readdirSync(e,{withFileTypes:!0})}catch{continue}for(let o of a){let a=i===``?o.name:`${i}/${o.name}`;o.isDirectory()?t.match(a,!0)&&r.push({abs:y.join(e,o.name),rel:a}):o.isFile()&&t.match(a)&&n.push(a)}}return n.sort(st)}function Z(e){let t=e.split(`/`)[0]??``;return parseInt(t.split(`_`)[0]??``,10)}function ot(e,t){let n=Z(e),r=Z(t);if(n!==r){if(Number.isFinite(n)&&Number.isFinite(r))return n-r;if(Number.isFinite(n))return-1;if(Number.isFinite(r))return 1}return e<t?-1:+(e>t)}function st(e,t){let n=e.split(`/`),r=t.split(`/`),i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=ot(n[e]??``,r[e]??``);if(t!==0)return t}return n.length-r.length}function ct(e){let t=Y(e.migrationsPattern,e.migrationsDir);return at(e.migrationsPath,new q(t,{dot:!1}))}function lt(e,t){let n=[];for(let r of e)t.includes(r)||n.push(r);return n}function ut(e){let t=ct(e).map(e=>Z(e)).filter(e=>Number.isFinite(e));return Math.max(...t,0)+1}function dt(e){if(at(e.migrationsPath,new q(`*/migration.sql`,{dot:!1})).length!==0)return J(`${e.migrationsDir}/*/migration.sql`)}function ft(e){let t=``,n,r=!1,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=e[a+1];if(n!==void 0){t+=o,o===n&&(s===n?(t+=s,a++):n=void 0);continue}if(r){o===`\r`&&s===`
9
- `?(t+=`
10
- `,a++,r=!1):(t+=o,r=o!==`
11
- `);continue}if(i){o===`\r`&&s===`
12
- `?(t+=`
13
- `,a++):(t+=o,o===`*`&&s===`/`&&(t+=s,a++,i=!1));continue}if(o===`-`&&s===`-`){t+=`--`,a++,r=!0;continue}if(o===`/`&&s===`*`){t+=`/*`,a++,i=!0;continue}if(o===`'`||o===`"`||o==="`"){t+=o,n=o;continue}if(o===`[`){t+=o,n=`]`;continue}if(o===`\r`&&s===`
14
- `){t+=`
15
- `,a++;continue}t+=o}return t}function pt({migrationsPath:e,migrationName:t,migrationsTableName:n}){return`${v.readFileSync(y.join(e,t),`utf8`)}
16
- INSERT INTO ${X(n)} (name)
17
- values ('${t.replace(/'/g,`''`)}');`}function mt(e){return e.option(`dir`,{type:`string`,description:`Directory containing migration files (default: ./migrations)`}).option(`pattern`,{type:`string`,description:`Glob for discovering migration files under --dir. Defaults to "<dir>/*.sql"; Drizzle's nested layout uses "<dir>/*/migration.sql"`})}function Q(e){return mt(e).option(`table`,{type:`string`,description:`Table recording applied migrations`,default:`d1_migrations`})}async function $(e,t,n,r,i,a=!1){return s(i,async()=>{let i={account_id:t,database_id:n,body:{sql:ft(r)}};return a?((await e.d1.raw(i))?.result??[]).map(e=>{let t=e.results?.columns??[],n=e.results?.rows??[];return{...e,results:n.map(e=>Object.fromEntries(t.map((t,n)=>[t,e[n]])))}}):(await e.d1.query(i))?.result??[]})}async function ht(n){if(!t(n.database))throw Error(`Expected a D1 database ID, but received <database>=${JSON.stringify(n.database)}. Database names and binding names are not accepted.`);let a=it({dir:n.dir,pattern:n.pattern,table:n.table});if(!v.existsSync(a.migrationsPath))throw Error(`No migrations directory at ${a.migrationsPath}.`+(n.dir===void 0?` Pass --dir to point at one.`:``));return{client:await i(n),accountId:n.local?e:await r(),databaseId:n.database,config:a,local:n.local===!0}}async function gt(e){let{client:t,accountId:n,databaseId:r,config:i}=e;await $(t,n,r,nt(i.migrationsTableName),`Preparing`,e.local);let a=(await $(t,n,r,rt(i.migrationsTableName),`Loading`,e.local))[0].results.map(e=>e.name),o=ct(i);if(o.length===0){let e=dt(i);e!==void 0&&process.stderr.write(`No files matched --pattern "${i.migrationsPattern}", but "${e}" does match. If an ORM such as drizzle manages your migrations, pass --pattern "${e}".\n`)}return{applied:a,all:o,unapplied:lt(o,a)}}function _t(e){return Q(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const vt={command:`apply <database>`,describe:`Apply any unapplied D1 migrations`,builder:_t,handler:async e=>{let t=await ht(e),n=(await gt(t)).unapplied.map(e=>({name:e,status:`🕒️`}));if(n.length===0){a([],{successLabel:`No migrations to apply`,quiet:e.quiet});return}if(await _(`About to apply ${n.length} migration(s)\nYour database may not be available to serve requests during the migration, continue?`)){for(let e of n){let n=pt({migrationsPath:t.config.migrationsPath,migrationName:e.name,migrationsTableName:t.config.migrationsTableName}),r=!0,i=[];try{let i=await $(t.client,t.accountId,t.databaseId,n,`Applying ${e.name}`,t.local);for(let e of i)e.success||(r=!1)}catch(e){r=!1,i=[e instanceof Error?e.message:String(e)]}if(e.status=r?`✅`:`❌`,i.length>0)throw Error(i.join(`
18
- `))}a(n,{quiet:e.quiet})}}};function yt(e){return mt(e.positional(`message`,{type:`string`,description:`Describes what the migration does`,demandOption:!0}))}const bt={command:`create <message>`,describe:`Create a new empty D1 migration file`,builder:yt,handler:async e=>{if(e.local)throw Error("--local is not supported with `cf d1 migrations create`. This command only creates a migration file on your local filesystem, so you do not need --local.");let t=it({dir:e.dir,pattern:e.pattern}),n=xt(ut(t),4),r=e.message.replaceAll(` `,`_`);if(/[\\/]/.test(r))throw Error(`The migration name ${JSON.stringify(e.message)} contains a path separator ("/" or "\\"). Remove it and try again.`);let i=`${n}_${r}.sql`,o=J(`${t.migrationsDir}/${i}`);if(!new q(t.migrationsPattern,{dot:!1}).match(o))throw Error(`Would create "${o}", but --pattern "${t.migrationsPattern}" would not match it, so \`cf d1 migrations apply\` would skip it.\n\`cf d1 migrations create\` only writes top-level files inside --dir. If you are using an ORM like Drizzle, use \`drizzle-kit generate\` instead — it writes the nested layout your pattern expects.`);if(!v.existsSync(t.migrationsPath)){if(!await _(`No migrations folder found.\nOk to create ${t.migrationsPath}?`))throw Error(`No migrations folder present at ${t.migrationsPath}.`);v.mkdirSync(t.migrationsPath,{recursive:!0})}let s=y.join(t.migrationsPath,i);v.writeFileSync(s,`-- Migration number: ${n} \t ${new Date().toISOString()}\n`),a({name:i,path:s},{successLabel:`Created ${i}`,quiet:e.quiet})}};function xt(e,t){let n=e.toString();for(;n.length<t;)n=`0`+n;return n}function St(e){return Q(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const Ct={command:`list <database>`,describe:`View a list of unapplied migration files`,builder:St,handler:async e=>{let{unapplied:t}=await gt(await ht(e));a(t.map(e=>({Name:e})),{quiet:e.quiet})}},wt={command:`migrations`,describe:`Create, list, and apply D1 database migrations`,builder:e=>e.command(c(vt,{command:`d1 migrations apply`,classification:{safeFlags:[]}})).command(c(bt,{command:`d1 migrations create`,classification:{safeFlags:[]}})).command(c(Ct,{command:`d1 migrations list`,classification:{safeFlags:[]}})).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Tt(e){return e.usage(`$0 d1 create
19
-
20
- Create a new D1 database in your account.`).option(`jurisdiction`,{type:`string`,description:`Specify the location to restrict the D1 database to run and store data. If this option is present, the location hint is ignored.`,choices:[`eu`,`fedramp`,`us`]}).option(`name`,{type:`string`,description:`D1 database name.`}).option(`primary-location-hint`,{type:`string`,description:`Specify the region to create the D1 primary, if available. If this option is omitted, the D1 will be created as close as possible to the current user.`,choices:[`wnam`,`enam`,`weur`,`eeur`,`apac`,`oc`]}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).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)`}).check(e=>{if([`read-replication-mode`].some(t=>e[t]!==void 0)){let t=[`read-replication-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --read_replication-* flag is set`)}return!0})}const Et={command:`create`,describe:`Create D1 Database`,builder:Tt,handler:async t=>l({command:`d1 create`,classification:{safeFlags:[`jurisdiction`,`primary-location-hint`,`read-replication-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database`,pathParams:{},bodyKind:`json`,body:t.body===void 0?f({jurisdiction:p(t.jurisdiction,`jurisdiction`,`text`),name:p(t.name,`name`,`text`),primary_location_hint:p(t[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}}):u(t.body)});return}let c=await i(t),l=t.local?e:await r();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Creating`,async()=>c.d1.create({...e,account_id:l})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await m(`name`,`D1 database name.`));let d=f({jurisdiction:p(t.jurisdiction,`jurisdiction`,`text`),name:p(t.name,`name`,`text`),primary_location_hint:p(t[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Creating`,async()=>c.d1.create({...d,account_id:l})),{successLabel:`Created`})})};function Dt(e){return e.usage(`$0 d1 delete <database-id>
21
-
22
- Delete a D1 database.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ot={command:`delete <database-id>`,describe:`Delete D1 Database`,builder:Dt,handler:async t=>l({command:`d1 delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){o({command:`cf d1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`none`});return}let c=await i(t),l=t.local?e:await r();if(t.accountId=l,!await g({force:!!t.force,message:`This permanently deletes the D1 database and all of its data.`})){process.stderr.write(`Aborted.
23
- `);return}a(await s(`Deleting`,async()=>c.d1.delete({account_id:l,database_id:t[`database-id`]})),{successLabel:`Deleted`})})};function kt(e){return e.usage(`$0 d1 edit <database-id>
24
-
25
- Partially update a D1 database's configuration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).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)`}).check(e=>{if([`read-replication-mode`].some(t=>e[t]!==void 0)){let t=[`read-replication-mode`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --read_replication-* flag is set`)}return!0})}const At={command:`edit <database-id>`,describe:`Update D1 Database partially`,builder:kt,handler:async t=>l({command:`d1 edit`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}}):u(t.body)});return}let c=await i(t),l=t.local?e:await r();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Updating`,async()=>c.d1.edit({...e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Updated`});return}let d=f({read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Updating`,async()=>c.d1.edit({...d,account_id:l,database_id:t[`database-id`]})),{successLabel:`Updated`})})};function jt(e){return e.usage(`$0 d1 export <database-id>
26
-
27
- Export the SQL contents of a D1 database and return a URL where they can be downloaded. Note: this process may take some time for larger DBs, during which your D1 will be unavailable to serve queries. To avoid blocking your DB unnecessarily, an in-progress export must be continually polled or will automatically cancel.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`current-bookmark`,{type:`string`,description:`To poll an in-progress export, provide the current bookmark (returned by your first polling response)`}).option(`dump-options-no-data`,{type:`boolean`,description:`Export only the table definitions, not their contents`}).option(`dump-options-no-schema`,{type:`boolean`,description:`Export only each table's contents, not its definition`}).option(`dump-options-tables`,{type:`string`,array:!0,description:`Filter the export to just one or more tables. Passing an empty array is the same as not passing anything and means: export all tables.`}).option(`output-format`,{type:`string`,description:`Specifies that you will poll this endpoint until the export completes`,choices:[`polling`]}).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 Mt={command:`export <database-id>`,describe:`Export D1 Database as SQL`,builder:jt,handler:async t=>l({command:`d1 export`,classification:{safeFlags:[`dump-options-no-data`,`dump-options-no-schema`,`output-format`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/export`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({current_bookmark:p(t[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:t[`dump-options-no-data`],no_schema:t[`dump-options-no-schema`],tables:t[`dump-options-tables`]},output_format:p(t[`output-format`],`output-format`,`text`)}):u(t.body)});return}let c=await i(t),l=t.local?e:await r();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Loading`,async()=>c.d1.export({...e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`});return}t[`output-format`]===void 0&&(t[`output-format`]=await h(`output-format`,`Specifies that you will poll this endpoint until the export completes`,[`polling`]));let d=f({current_bookmark:p(t[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:t[`dump-options-no-data`],no_schema:t[`dump-options-no-schema`],tables:t[`dump-options-tables`]},output_format:p(t[`output-format`],`output-format`,`text`)});a(await s(`Loading`,async()=>c.d1.export({...d,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`})})};function Nt(e){return e.usage(`$0 d1 get <database-id>
28
-
29
- Get details for a specific D1 database.`).positional(`database-id`,{type:`string`,description:`Database ID`,demandOption:!0}).option(`fields`,{type:`string`,description:`Comma-separated list of fields to include in the response. When omitted,
30
- all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pt={command:`get <database-id>`,describe:`Get D1 Database`,builder:ee(Nt),handler:async t=>l({command:`d1 get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={fields:t.fields};if(t.dryRun){o({command:`cf d1 get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await r();t.accountId=u,a(await s(`Loading`,async()=>l.d1.get({account_id:u,database_id:t[`database-id`],...c})),{successLabel:`Loaded`})})};function Ft(e){return e.usage(`$0 d1 import <database-id>
31
-
32
- Generate a temporary URL for uploading an SQL file to, then instruct the D1 to import it and poll it for status updates. Imports block the D1 for their duration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`action`,{type:`string`,description:`Indicates you have a new SQL file to upload.`,choices:[`init`,`ingest`,`poll`]}).option(`etag`,{type:`string`,description:`Required when action is 'init' or 'ingest'. An md5 hash of the file you're uploading. Used to check if it already exists, and validate its contents before ingesting.`}).option(`filename`,{type:`string`,description:`The filename you have successfully uploaded.`}).option(`current-bookmark`,{type:`string`,description:`This identifies the currently-running import, checking its status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`etag`,[`current-bookmark`]).conflicts(`filename`,[`current-bookmark`]).implies(`filename`,[`etag`]).conflicts(`current-bookmark`,[`etag`,`filename`])}const It={command:`import <database-id>`,describe:`Import SQL into your D1 Database`,builder:Ft,handler:async t=>l({command:`d1 import`,classification:{safeFlags:[`action`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/import`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({action:p(t.action,`action`,`text`),etag:p(t.etag,`etag`,`text`),filename:p(t.filename,`filename`,`text`),current_bookmark:p(t[`current-bookmark`],`current-bookmark`,`text`)}):u(t.body)});return}let c=await i(t),l=t.local?e:await r();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Creating`,async()=>c.d1.import({body:e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Created`});return}t.action===void 0&&(t.action=await h(`action`,`Indicates you have a new SQL file to upload.`,[`init`,`ingest`,`poll`]));let d=f({action:p(t.action,`action`,`text`),etag:p(t.etag,`etag`,`text`),filename:p(t.filename,`filename`,`text`),current_bookmark:p(t[`current-bookmark`],`current-bookmark`,`text`)});a(await s(`Creating`,async()=>c.d1.import({body:d,account_id:l,database_id:t[`database-id`]})),{successLabel:`Created`})})};function Lt(e){return e.usage(`$0 d1 list
33
-
34
- List D1 databases in your account.`).option(`name`,{type:`string`,description:`a database name to search for.`}).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 Rt={command:`list`,describe:`List D1 Databases`,builder:Lt,handler:async t=>l({command:`d1 list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={name:t.name,page:t.page,per_page:t[`per-page`]};if(t.dryRun){o({command:`cf d1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await r();t.accountId=u,a(await s(`Loading`,async()=>l.d1.list({account_id:u,...c})),{successLabel:`Loaded`})})};function zt(e){return e.usage(`$0 d1 query <database-id>
35
-
36
- Execute a SQL query against a D1 database and return results as objects.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`params`,{type:`string`,array:!0,description:`The params field`}).option(`sql`,{type:`string`,description:`Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch.`}).option(`batch`,{type:`string`,description:`The batch field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A single query object or a batch query object`}).conflicts(`params`,[`batch`]).conflicts(`sql`,[`batch`]).conflicts(`batch`,[`params`,`sql`])}const Bt={command:`query <database-id>`,describe:`Query D1 Database`,builder:zt,handler:async t=>l({command:`d1 query`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/query`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({params:t.params,sql:p(t.sql,`sql`,`text`),batch:d(t.batch,`batch`)}):u(t.body)});return}let c=await i(t),l=t.local?e:await r();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Loading`,async()=>c.d1.query({body:e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`});return}let m=f({params:t.params,sql:p(t.sql,`sql`,`text`),batch:d(t.batch,`batch`)});a(await s(`Loading`,async()=>c.d1.query({body:m,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`})})};function Vt(e){return e.usage(`$0 d1 raw <database-id>
37
-
38
- Execute a SQL query against a D1 database and return result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`params`,{type:`string`,array:!0,description:`The params field`}).option(`sql`,{type:`string`,description:`Your SQL query. Supports multiple statements, joined by semicolons, which will be executed as a batch.`}).option(`batch`,{type:`string`,description:`The batch field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A single query object or a batch query object`}).conflicts(`params`,[`batch`]).conflicts(`sql`,[`batch`]).conflicts(`batch`,[`params`,`sql`])}const Ht={command:`raw <database-id>`,describe:`Raw D1 Database query`,builder:Vt,handler:async t=>l({command:`d1 raw`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/raw`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({params:t.params,sql:p(t.sql,`sql`,`text`),batch:d(t.batch,`batch`)}):u(t.body)});return}let c=await i(t),l=t.local?e:await r();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Loading`,async()=>c.d1.raw({body:e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`});return}let m=f({params:t.params,sql:p(t.sql,`sql`,`text`),batch:d(t.batch,`batch`)});a(await s(`Loading`,async()=>c.d1.raw({body:m,account_id:l,database_id:t[`database-id`]})),{successLabel:`Loaded`})})};function Ut(e){return e.usage(`$0 d1 time-travel get-bookmark <database-id>
39
-
40
- Retrieve the current bookmark, or the nearest bookmark at or before a provided timestamp. Bookmarks can be used with the restore endpoint to revert the database to a previous point in time.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`timestamp`,{type:`string`,description:`An optional ISO 8601 timestamp. If provided, returns the nearest available bookmark at or before this timestamp. If omitted, returns the current bookmark.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Wt={command:`get-bookmark <database-id>`,describe:`Get D1 database bookmark`,builder:Ut,handler:async t=>l({command:`d1 time-travel get-bookmark`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let c={timestamp:t.timestamp};if(t.dryRun){o({command:`cf d1 time-travel get-bookmark`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/time_travel/bookmark`,pathParams:{"database-id":String(t[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await r();t.accountId=u,a(await s(`Loading`,async()=>l.d1.timeTravel.getBookmark({account_id:u,database_id:t[`database-id`],...c})),{successLabel:`Loaded`})})};function Gt(e){return e.usage(`$0 d1 time-travel restore <database-id>
41
-
42
- Restore a D1 database to a previous point in time either via a bookmark or a timestamp.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`bookmark`,{type:`string`,description:"A bookmark to restore the database to. Required if `timestamp` is not provided."}).option(`timestamp`,{type:`string`,description:"An ISO 8601 timestamp to restore the database to. Required if `bookmark` is not provided."}).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 Kt={command:`restore <database-id>`,describe:`Restore D1 Database to a bookmark or point in time`,builder:Gt,handler:async t=>l({command:`d1 time-travel restore`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{let c={bookmark:t.bookmark,timestamp:t.timestamp};if(t.dryRun){o({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(t[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await r();if(t.accountId=u,!await g({force:!!t.force,message:`This reverts the D1 database to a previous point in time. Data written after the bookmark will be lost.`})){process.stderr.write(`Aborted.
43
- `);return}a(await s(`Deleting`,async()=>l.d1.timeTravel.restore({account_id:u,database_id:t[`database-id`],...c})),{successLabel:`Deleted`})})},qt={command:`time-travel`,describe:`use specific point-in-time backups of your D1 database`,builder:e=>e.command(Wt).command(Kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Jt(e){return e.usage(`$0 d1 update <database-id>
44
-
45
- Update a D1 database's configuration.`).positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`read-replication-mode`,{type:`string`,description:`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,choices:[`auto`,`disabled`]}).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 Yt={command:`update <database-id>`,describe:`Update D1 Database`,builder:Jt,handler:async t=>l({command:`d1 update`,classification:{safeFlags:[`read-replication-mode`,`dry-run`]}},t,async()=>{if(t.dryRun){o({command:`cf d1 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?f({read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}}):u(t.body)});return}let c=await i(t),l=t.local?e:await r();if(t.accountId=l,t.body){let e=u(t.body);a(await s(`Updating`,async()=>c.d1.update({...e,account_id:l,database_id:t[`database-id`]})),{successLabel:`Updated`});return}t[`read-replication-mode`]===void 0&&(t[`read-replication-mode`]=await h(`read-replication-mode`,`The read replication mode for the database. Use 'auto' to create replicas and allow D1 automatically place them around the world, or 'disabled' to not use any database replicas (it can take a few hours for all replicas to be deleted).`,[`auto`,`disabled`]));let d=f({read_replication:{mode:p(t[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Updating`,async()=>c.d1.update({...d,account_id:l,database_id:t[`database-id`]})),{successLabel:`Updated`})})},Xt={command:`d1`,describe:`D1 is Cloudflare's managed, serverless database with SQLite's SQL semantics, built-in disaster recovery, and Worker and HTTP API access.`,builder:e=>e.command(Et).command(Ot).command(At).command(Mt).command(Pt).command(It).command(Rt).command(Bt).command(Ht).command(Yt).command(wt).command(qt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Xt as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./discover-VRFBjse7.mjs";export{e as discoverImpls};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{r}from"./auth-BYFcxn1F.mjs";import{t as i}from"./output-CvQFJkvi.mjs";import{t as a}from"./dry-run-Bq0JAsbX.mjs";import{t as o}from"./progress-5nsUpQL6.mjs";import{t as s}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as c,r as l,t as u}from"./body-parser-hh2avzkz.mjs";import{n as d}from"./input-validation-Dk52b0me.mjs";function f(e){return e.usage(`$0 durable-objects namespaces list
3
-
4
- Returns the Durable Object namespaces owned by an account.`).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`list`,describe:`List Durable Object Namespaces`,builder:f,handler:async c=>s({command:`durable-objects namespaces list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.durableObjects.namespaces.list({account_id:u,...s})),{successLabel:`Loaded`})})};function m(e){return e.usage(`$0 durable-objects namespaces objects list
5
-
6
- Returns the Durable Objects in a given Durable Object namespace.`).option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`list`,describe:`List Objects in a Durable Object namespace`,builder:m,handler:async c=>s({command:`durable-objects namespaces objects list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={limit:c.limit,cursor:c.cursor};if(c.dryRun){a({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/workers/durable_objects/namespaces/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}/objects`,pathParams:{id:String(c.id??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await n();c.accountId=u,i(await o(`Loading`,async()=>l.durableObjects.namespaces.objects.list({account_id:u,id:c.id,...s})),{successLabel:`Loaded`})})},g={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.usage(`$0 durable-objects namespaces query <id>
7
-
8
- Executes one or more SQL queries against a Durable Object.`).positional(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`durable-object-id`,{type:`string`,description:`The durable_object_id field`}).option(`queries`,{type:`string`,description:`The queries field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`durable-object-name`,{type:`string`,description:`The durable_object_name field`}).option(`jurisdiction`,{type:`string`,description:`The jurisdiction field`,choices:[`fedramp`,`eu`,`none`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`durable-object-id`,[`durable-object-name`,`jurisdiction`]).conflicts(`durable-object-name`,[`durable-object-id`]).implies(`durable-object-name`,[`jurisdiction`]).conflicts(`jurisdiction`,[`durable-object-id`]).implies(`jurisdiction`,[`durable-object-name`])}const v={command:`query <id>`,describe:`Query a Durable Object`,builder:_,handler:async f=>s({command:`durable-objects namespaces query`,classification:{safeFlags:[`jurisdiction`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf durable-objects namespaces query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/workers/durable_objects/namespaces/${f.id==null?`<id>`:encodeURIComponent(String(f.id))}/query/v2`,pathParams:{id:String(f.id??``)},bodyKind:`json`,body:f.body===void 0?u({durable_object_id:d(f[`durable-object-id`],`durable-object-id`,`text`),queries:l(f.queries,`queries`),durable_object_name:d(f[`durable-object-name`],`durable-object-name`,`text`),jurisdiction:d(f.jurisdiction,`jurisdiction`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await n();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Loading`,async()=>s.durableObjects.namespaces.query({body:e,account_id:p,id:f.id})),{successLabel:`Loaded`});return}if(f.queries===void 0)throw Error(`--queries is required (or pass --body with this field set).`);let m=u({durable_object_id:d(f[`durable-object-id`],`durable-object-id`,`text`),queries:l(f.queries,`queries`),durable_object_name:d(f[`durable-object-name`],`durable-object-name`,`text`),jurisdiction:d(f.jurisdiction,`jurisdiction`,`text`)});i(await o(`Loading`,async()=>s.durableObjects.namespaces.query({body:m,account_id:p,id:f.id})),{successLabel:`Loaded`})})},y={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(p).command(v).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`durable-objects`,describe:`durable-objects`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./error-sanitization-Dc4bLj8k.mjs";export{e as sanitizeError};
@@ -1,28 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-B3OyWKkW.mjs";import{a as t,t as n}from"./context-BsGrhAqB.mjs";import{a as r,r as i}from"./auth-BYFcxn1F.mjs";import{t as a}from"./output-CvQFJkvi.mjs";import{t as o}from"./dry-run-Bq0JAsbX.mjs";import{t as s}from"./progress-5nsUpQL6.mjs";import{t as c}from"./run-UHTbUldP.mjs";import"./telemetry-C3hmM9Q9.mjs";import{n as l,r as u,t as d}from"./body-parser-hh2avzkz.mjs";import{n as f}from"./input-validation-Dk52b0me.mjs";import{a as p,n as m}from"./prompt-Ba_bys2F.mjs";function h(e){return e.usage(`$0 flagship apps create
3
-
4
- Creates an app. The returned \`id\` is used in all subsequent flag, changelog, and evaluation requests.`).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Create app`,builder:h,handler:async r=>c({command:`flagship apps create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({name:f(r.name,`name`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await n();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.flagship.apps.create({...e,account_id:u})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await p(`name`,`The name field`));let m=d({name:f(r.name,`name`,`text`)});a(await s(`Creating`,async()=>c.flagship.apps.create({...m,account_id:u})),{successLabel:`Created`})})};function _(e){return e.usage("$0 flagship apps definitions get <app-id>\n\nReturns an app's evaluation-only flag definitions for SDKs that evaluate locally. Send the returned `ETag` in `If-None-Match` to avoid downloading unchanged definitions.").positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`if-none-match`,{type:`string`,description:"Previously returned ETag, or `*`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <app-id>`,describe:`Get flag definitions`,builder:_,handler:async l=>c({command:`flagship apps definitions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={};if(l[`if-none-match`]!==void 0&&(c[`If-None-Match`]=String(l[`if-none-match`])),l.dryRun){o({command:`cf flagship apps definitions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${l[`app-id`]==null?`<app-id>`:encodeURIComponent(String(l[`app-id`]))}/definitions`,pathParams:{"app-id":String(l[`app-id`]??``)},bodyKind:`none`});return}let u=await i(l),d=l.local?e:await n();l.accountId=d,a(await s(`Loading`,async()=>r(u,`GET`,`/accounts/${d}/flagship/apps/${encodeURIComponent(String(l[`app-id`]))}/definitions`,{headers:Object.keys(c).length>0?c:void 0})),{successLabel:`Loaded`})})},y={command:`definitions`,describe:`Operations for apps.definitions`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.usage(`$0 flagship apps delete <app-id>
5
-
6
- Deletes an app and all its flags and changelog history. Returns 409 if any Worker still references this app via a Flagship binding.`).positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <app-id>`,describe:`Delete app`,builder:b,handler:async r=>c({command:`flagship apps delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
7
- `);return}a(await s(`Deleting`,async()=>c.flagship.apps.delete({account_id:l,app_id:r[`app-id`]})),{successLabel:`Deleted`})})};function S(e){return e.usage(`$0 flagship apps evaluate create <app-id>
8
-
9
- Evaluates a flag against the provided context, passed as a JSON request body (OFREP-shaped) rather than query parameters. Returns the same response shape as the GET variant.`).positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`flag-key`,{type:`string`,description:`The flagKey field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`create <app-id>`,describe:`Evaluate flag (POST)`,builder:S,handler:async r=>c({command:`flagship apps evaluate create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps evaluate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/evaluate`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({flagKey:f(r[`flag-key`],`flag-key`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await n();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.flagship.apps.evaluate.create({...e,account_id:u,app_id:r[`app-id`]})),{successLabel:`Created`});return}r[`flag-key`]===void 0&&(r[`flag-key`]=await p(`flag-key`,`The flagKey field`));let m=d({flagKey:f(r[`flag-key`],`flag-key`,`text`)});a(await s(`Creating`,async()=>c.flagship.apps.evaluate.create({...m,account_id:u,app_id:r[`app-id`]})),{successLabel:`Created`})})};function w(e){return e.usage(`$0 flagship apps evaluate get <app-id>
10
-
11
- Evaluates a flag against the provided context. Pass context attributes as query parameters; values are forwarded as strings. For low-latency in-Worker evaluation, prefer the Flagship binding over this endpoint.`).positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`flag-key`,{type:`string`,description:`The flag key to evaluate.`,demandOption:!0}).option(`targeting-key`,{type:`string`,description:`Context targeting key (per OpenFeature spec); used for percentage rollout bucketing.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <app-id>`,describe:`Evaluate flag`,builder:w,handler:async r=>c({command:`flagship apps evaluate get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={flagKey:r[`flag-key`],targetingKey:r[`targeting-key`]};if(r.dryRun){o({command:`cf flagship apps evaluate get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/evaluate`,pathParams:{"app-id":String(r[`app-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();r.accountId=u,a(await s(`Loading`,async()=>l.flagship.apps.evaluate.get({account_id:u,app_id:r[`app-id`],...c})),{successLabel:`Loaded`})})},E={command:`evaluate`,describe:`Operations for apps.evaluate`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.usage(`$0 flagship apps flags changelog list
12
-
13
- Returns the audit history for a flag, newest first. Each entry includes the event type and full flag state after the change; \`update\` entries include a field-level diff. Capped at 200 entries per flag.`).option(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`flag-key`,{type:`string`,description:`Flag key (slug).`,demandOption:!0}).option(`limit`,{type:`string`,description:`Max items to return (1–200).`}).option(`cursor`,{type:`string`,description:`Pagination cursor from a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`Get flag changelog`,builder:D,handler:async r=>c({command:`flagship apps flags changelog list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf flagship apps flags changelog list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags/${r[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(r[`flag-key`]))}/changelog`,pathParams:{"app-id":String(r[`app-id`]??``),"flag-key":String(r[`flag-key`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();r.accountId=u,a(await s(`Loading`,async()=>l.flagship.apps.flags.changelog.list({account_id:u,app_id:r[`app-id`],flag_key:r[`flag-key`],...c})),{successLabel:`Loaded`})})},k={command:`changelog`,describe:`Operations for apps.flags.changelog`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.usage(`$0 flagship apps flags create <app-id>
14
-
15
- Creates a flag. Returns 409 if the key already exists. \`type\` is always inferred from variation values; legacy request-side values are ignored.`).positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`default-variation`,{type:`string`,description:"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`."}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:"When false, the flag bypasses all rules and always serves `default_variation`."}).option(`key`,{type:`string`,description:`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`}).option(`rules`,{type:`string`,description:"Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. Provide as a JSON array of objects or @path/to/file.json."}).option(`type`,{type:`string`,description:`Deprecated compatibility field. Omit it; the API ignores this value and infers the type from the flag's variations.`,choices:[`boolean`,`string`,`number`,`json`]}).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 j={command:`create <app-id>`,describe:`Create flag`,builder:A,handler:async r=>c({command:`flagship apps flags create`,classification:{safeFlags:[`enabled`,`type`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps flags create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({default_variation:f(r[`default-variation`],`default-variation`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled,key:f(r.key,`key`,`text`),rules:u(r.rules,`rules`),type:f(r.type,`type`,`text`)}):l(r.body)});return}let c=await i(r),m=r.local?e:await n();if(r.accountId=m,r.body){let e=l(r.body);a(await s(`Creating`,async()=>c.flagship.apps.flags.create({...e,account_id:m,app_id:r[`app-id`]})),{successLabel:`Created`});return}if(r[`default-variation`]===void 0&&(r[`default-variation`]=await p(`default-variation`,"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`.")),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(r.key===void 0&&(r.key=await p(`key`,`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`)),r.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let h=d({default_variation:f(r[`default-variation`],`default-variation`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled,key:f(r.key,`key`,`text`),rules:u(r.rules,`rules`),type:f(r.type,`type`,`text`)});a(await s(`Creating`,async()=>c.flagship.apps.flags.create({...h,account_id:m,app_id:r[`app-id`]})),{successLabel:`Created`})})};function M(e){return e.usage(`$0 flagship apps flags delete <flag-key>
16
-
17
- Deletes a flag permanently. Subsequent evaluations fall back to the caller-supplied default. Cannot be undone.`).positional(`flag-key`,{type:`string`,description:`Flag key (slug).`,demandOption:!0}).option(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const N={command:`delete <flag-key>`,describe:`Delete flag`,builder:M,handler:async r=>c({command:`flagship apps flags delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps flags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags/${r[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(r[`flag-key`]))}`,pathParams:{"app-id":String(r[`app-id`]??``),"flag-key":String(r[`flag-key`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();if(r.accountId=l,!await m({force:!!r.force})){process.stderr.write(`Aborted.
18
- `);return}a(await s(`Deleting`,async()=>c.flagship.apps.flags.delete({account_id:l,app_id:r[`app-id`],flag_key:r[`flag-key`]})),{successLabel:`Deleted`})})};function P(e){return e.usage(`$0 flagship apps flags get <flag-key>
19
-
20
- Returns the full flag definition including rules, variations, and audit fields.`).positional(`flag-key`,{type:`string`,description:`Flag key (slug).`,demandOption:!0}).option(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <flag-key>`,describe:`Get flag`,builder:P,handler:async r=>c({command:`flagship apps flags get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps flags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags/${r[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(r[`flag-key`]))}`,pathParams:{"app-id":String(r[`app-id`]??``),"flag-key":String(r[`flag-key`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.flagship.apps.flags.get({account_id:l,app_id:r[`app-id`],flag_key:r[`flag-key`]})),{successLabel:`Loaded`})})};function I(e){return e.usage("$0 flagship apps flags list\n\nLists an app's flags ordered by key. Pass `cursor` from `result_info` to page forward; a null cursor indicates the last page.").option(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`limit`,{type:`string`,description:`Max items to return (1–200).`}).option(`cursor`,{type:`string`,description:`Pagination cursor from a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List flags`,builder:I,handler:async r=>c({command:`flagship apps flags list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf flagship apps flags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags`,pathParams:{"app-id":String(r[`app-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await n();r.accountId=u,a(await s(`Loading`,async()=>l.flagship.apps.flags.list({account_id:u,app_id:r[`app-id`],...c})),{successLabel:`Loaded`})})};function R(e){return e.usage(`$0 flagship apps flags update <flag-key>
21
-
22
- Replaces the entire flag definition. Omitted fields are dropped, not preserved — read before writing. Each update appends a changelog entry.`).positional(`flag-key`,{type:`string`,description:`Flag key (slug).`,demandOption:!0}).option(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`default-variation`,{type:`string`,description:"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`."}).option(`description`,{type:`string`,description:`The description field`}).option(`enabled`,{type:`boolean`,description:"When false, the flag bypasses all rules and always serves `default_variation`."}).option(`key`,{type:`string`,description:`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`}).option(`rules`,{type:`string`,description:"Targeting rules evaluated in ascending `priority`; the first matching rule wins. An empty array means the flag always serves `default_variation`. Provide as a JSON array of objects or @path/to/file.json."}).option(`type`,{type:`string`,description:`Deprecated compatibility field. Omit it; the API ignores this value and infers the type from the flag's variations.`,choices:[`boolean`,`string`,`number`,`json`]}).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 z={command:`update <flag-key>`,describe:`Update flag`,builder:R,handler:async r=>c({command:`flagship apps flags update`,classification:{safeFlags:[`enabled`,`type`,`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps flags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}/flags/${r[`flag-key`]==null?`<flag-key>`:encodeURIComponent(String(r[`flag-key`]))}`,pathParams:{"app-id":String(r[`app-id`]??``),"flag-key":String(r[`flag-key`]??``)},bodyKind:`json`,body:r.body===void 0?d({default_variation:f(r[`default-variation`],`default-variation`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled,key:f(r.key,`key`,`text`),rules:u(r.rules,`rules`),type:f(r.type,`type`,`text`)}):l(r.body)});return}let c=await i(r),m=r.local?e:await n();if(r.accountId=m,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.flagship.apps.flags.update({...e,account_id:m,app_id:r[`app-id`],flag_key:r[`flag-key`]})),{successLabel:`Updated`});return}if(r[`default-variation`]===void 0&&(r[`default-variation`]=await p(`default-variation`,"Variation the API serves when the flag is off, or when it's on but no rule matches the context. Must be a key in `variations`.")),r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(r.key===void 0&&(r.key=await p(`key`,`Unique identifier for the flag within an app. Used in all evaluation and SDK calls.`)),r.rules===void 0)throw Error(`--rules is required (or pass --body with this field set).`);let h=d({default_variation:f(r[`default-variation`],`default-variation`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled,key:f(r.key,`key`,`text`),rules:u(r.rules,`rules`),type:f(r.type,`type`,`text`)});a(await s(`Updating`,async()=>c.flagship.apps.flags.update({...h,account_id:m,app_id:r[`app-id`],flag_key:r[`flag-key`]})),{successLabel:`Updated`})})},B={command:`flags`,describe:`Operations for apps.flags`,builder:e=>e.command(j).command(N).command(F).command(L).command(z).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.usage(`$0 flagship apps get <app-id>
23
-
24
- Returns an app's name and audit fields. Flag definitions are not included.`).positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <app-id>`,describe:`Get app`,builder:V,handler:async r=>c({command:`flagship apps get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.flagship.apps.get({account_id:l,app_id:r[`app-id`]})),{successLabel:`Loaded`})})};function U(e){return e.usage(`$0 flagship apps list
25
-
26
- Lists all apps in the account. Returns identity and audit fields only — flag definitions are not included.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`List apps`,builder:U,handler:async r=>c({command:`flagship apps list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await n();r.accountId=l,a(await s(`Loading`,async()=>c.flagship.apps.list({account_id:l})),{successLabel:`Loaded`})})};function G(e){return e.usage(`$0 flagship apps update <app-id>
27
-
28
- Updates an app. Only \`name\` is mutable.`).positional(`app-id`,{type:`string`,description:`App identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`update <app-id>`,describe:`Update app`,builder:G,handler:async r=>c({command:`flagship apps update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf flagship apps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await t()??`<account-id>`}/flagship/apps/${r[`app-id`]==null?`<app-id>`:encodeURIComponent(String(r[`app-id`]))}`,pathParams:{"app-id":String(r[`app-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({name:f(r.name,`name`,`text`)}):l(r.body)});return}let c=await i(r),u=r.local?e:await n();if(r.accountId=u,r.body){let e=l(r.body);a(await s(`Updating`,async()=>c.flagship.apps.update({...e,account_id:u,app_id:r[`app-id`]})),{successLabel:`Updated`});return}let p=d({name:f(r.name,`name`,`text`)});a(await s(`Updating`,async()=>c.flagship.apps.update({...p,account_id:u,app_id:r[`app-id`]})),{successLabel:`Updated`})})},q={command:`apps`,describe:`Operations for apps`,builder:e=>e.command(g).command(x).command(H).command(W).command(K).command(y).command(E).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},J={command:`flagship`,describe:`flagship`,builder:e=>e.command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{J as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e}from"./generate-iV6OVNin.mjs";export{e as generateWorkerTypes};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./local-B3OyWKkW.mjs";export{e as createLocalFetch};