cf 1.0.0-beta.1 → 1.0.0-beta.11

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 (378) hide show
  1. package/README.md +12 -0
  2. package/dist/_meta/commands.json +11448 -13819
  3. package/dist/_meta/hand-written-commands.json +579 -41
  4. package/dist/_meta/schemas.json +14496 -16450
  5. package/dist/abuse-reports-DX5xgeka.mjs +24 -0
  6. package/dist/access-DuHs0Mii.mjs +2 -0
  7. package/dist/{account-tags-DAf-hq1m.mjs → account-tags-CiKwgOWd.mjs} +6 -6
  8. package/dist/{accounts-BDIKjiG2.mjs → accounts-DfXSHrkF.mjs} +63 -57
  9. package/dist/{acm-D-q1FVWJ.mjs → acm-BgSr3Ig4.mjs} +7 -7
  10. package/dist/{addressing-0w2U1NEy.mjs → addressing-B70NFnrX.mjs} +43 -43
  11. package/dist/agent-context-GRiQ4zRU.mjs +2 -0
  12. package/dist/{agent-memory-Drumm4qd.mjs → agent-memory-DJRquHeq.mjs} +15 -15
  13. package/dist/ai-CP2oIS-I.mjs +29 -0
  14. package/dist/{ai-audit-CPrmohqf.mjs → ai-audit-Bn_BfMFS.mjs} +3 -3
  15. package/dist/ai-gateway-CrrEtzUP.mjs +82 -0
  16. package/dist/{ai-search-B5l4IDSR.mjs → ai-search-C4YWVTCa.mjs} +42 -42
  17. package/dist/{ai-security-C7_IGDDl.mjs → ai-security-Bt_fG65f.mjs} +4 -4
  18. package/dist/{alerting-B6m1Rhf4.mjs → alerting-CRr88fVR.mjs} +26 -26
  19. package/dist/{analytics-nnzFBB_7.mjs → analytics-XqS9OP5B.mjs} +11 -12
  20. package/dist/{analytics_engine-BvjKCwn1.mjs → analytics_engine-CzmYem4f.mjs} +2 -2
  21. package/dist/{api-security-B9IozS2a.mjs → api-security-gB1FHrHq.mjs} +57 -57
  22. package/dist/{argo-C_QcqR6P.mjs → argo-wFCAsYx7.mjs} +5 -5
  23. package/dist/args-CXgkQKK7.mjs +2 -0
  24. package/dist/{artifacts-DDFNpYBz.mjs → artifacts-qFjlNRqb.mjs} +20 -20
  25. package/dist/{audit-logs-cTzNV0DV.mjs → audit-logs-CpPUjMUP.mjs} +2 -2
  26. package/dist/auth-7Fk7PVIC.mjs +2 -0
  27. package/dist/auth-BmJ946bE.mjs +2 -0
  28. package/dist/auth-Br-t8vL_.mjs +2 -0
  29. package/dist/auth-token-DeG33BMQ.mjs +8 -0
  30. package/dist/autoconfig-D-copdZG.mjs +511 -0
  31. package/dist/banner-Xk4xBN8U.mjs +2 -0
  32. package/dist/basin-catalog-CshcpsAH.mjs +46 -0
  33. package/dist/{billing-DU2X-q-x.mjs → billing-B-xNxxiP.mjs} +11 -11
  34. package/dist/{bot-management-BHAAoZOh.mjs → bot-management-DhafeA2J.mjs} +4 -4
  35. package/dist/{botnet-feed-DOOnGVVY.mjs → botnet-feed-D6uCLE_D.mjs} +5 -5
  36. package/dist/{brand-protection-C_DYa7IK.mjs → brand-protection-c3WiHbYn.mjs} +13 -13
  37. package/dist/browser-extension-Dee2Y1qn.mjs +2 -0
  38. package/dist/{browser-run-Dw-vgWGR.mjs → browser-run-D9_cwaSD.mjs} +24 -24
  39. package/dist/build-9ihDp-Gy.mjs +2 -0
  40. package/dist/build-DrG6TqMw.mjs +2 -0
  41. package/dist/{builds-CO0MmSd3.mjs → builds-Dl8if-2k.mjs} +32 -32
  42. package/dist/cache-CIZokBjd.mjs +45 -0
  43. package/dist/{certificate-authorities-Dmxh7w-Z.mjs → certificate-authorities-NUQzCDK8.mjs} +3 -3
  44. package/dist/cf-DfQfIu3q.mjs +18 -0
  45. package/dist/chunk-FT2NMTJB-BFqlGcem.mjs +97 -0
  46. package/dist/chunk-KKDV4JPS-B_t8sDTz.mjs +2 -0
  47. package/dist/chunk-U6NEESU5-BhF4rnpx.mjs +2 -0
  48. package/dist/chunk-WMOON6TZ-B8xCqjB1.mjs +2 -0
  49. package/dist/cli-aChy8ou_.mjs +6 -0
  50. package/dist/cli-exit-Dqoo6Jgb.mjs +2 -0
  51. package/dist/client-certificates-qgLpBn8t.mjs +13 -0
  52. package/dist/{client-side-security-D7NWV0YH.mjs → client-side-security-DZO6Xw14.mjs} +14 -14
  53. package/dist/{cloud-connector-XMFOTNqT.mjs → cloud-connector-C7vGDCzX.mjs} +3 -3
  54. package/dist/{cloudflared-DhItYrCq.mjs → cloudflared-CEfZhSQH.mjs} +1 -1
  55. package/dist/{cloudforce-one-Cew4MHvA.mjs → cloudforce-one-CE7y5UkF.mjs} +237 -246
  56. package/dist/command-07vhr56i.mjs +2 -0
  57. package/dist/command-B6TpINoN.mjs +2 -0
  58. package/dist/command-BWC9CbE7.mjs +2 -0
  59. package/dist/command-BsmF3J_l.mjs +2 -0
  60. package/dist/command-C2pNxAeL.mjs +2 -0
  61. package/dist/command-C65Ed0o9.mjs +2 -0
  62. package/dist/command-Cdx___59.mjs +2 -0
  63. package/dist/command-CrtDkZNs.mjs +2 -0
  64. package/dist/command-D0MKPucK.mjs +2 -0
  65. package/dist/command-DHdWKtqx.mjs +2 -0
  66. package/dist/command-Ds5OVat3.mjs +2 -0
  67. package/dist/command-Dv6YavZa.mjs +2 -0
  68. package/dist/command-dAYWrB5y.mjs +2 -0
  69. package/dist/command-eM48o0J6.mjs +2 -0
  70. package/dist/command-maDJWJgu.mjs +2 -0
  71. package/dist/{completions-xPLd1cvL.mjs → completions-D0280hul.mjs} +26 -26
  72. package/dist/{connector-interrupts-BfQN_pm6.mjs → connector-interrupts-CVjFhU-C.mjs} +3 -3
  73. package/dist/{connector-telemetry-events-B7qLZsZJ.mjs → connector-telemetry-events-Bu3LKP6T.mjs} +3 -3
  74. package/dist/{connector-telemetry-snapshots-Ckvg9BPc.mjs → connector-telemetry-snapshots-BbDTIc06.mjs} +3 -3
  75. package/dist/{connectors-BhvAP5fb.mjs → connectors-DGtx-rPI.mjs} +7 -7
  76. package/dist/{containers-Cq1gtnq6.mjs → containers-CzNbBrYE.mjs} +70 -72
  77. package/dist/{containers-Bl3EY-cy.mjs → containers-DEFrbNgO.mjs} +17 -17
  78. package/dist/{content-scan-BYGe9fFj.mjs → content-scan-BCtWBCqd.mjs} +6 -6
  79. package/dist/context-CquYYyS3.mjs +7 -0
  80. package/dist/{cps-BWMDWeVq.mjs → cps-C8BbnbuD.mjs} +1 -1
  81. package/dist/{csamScanner-DMYGzLNi.mjs → csamScanner-CsJ9H2fA.mjs} +3 -3
  82. package/dist/{ct-alerting-Vq4l2s7n.mjs → ct-alerting-CYsQZO2H.mjs} +3 -3
  83. package/dist/{custom-certificates-BDEHH0Ym.mjs → custom-certificates-CA8HqolM.mjs} +8 -8
  84. package/dist/{custom-csrs-CHSkZNdX.mjs → custom-csrs-D0P2vWJE.mjs} +5 -5
  85. package/dist/{custom-hostnames-Bch3iQZC.mjs → custom-hostnames-CzYMChbh.mjs} +12 -12
  86. package/dist/{custom-nameservers-Tdvu1-vr.mjs → custom-nameservers-Cet3oF56.mjs} +5 -5
  87. package/dist/{custom-pages-rFsiIXlr.mjs → custom-pages-DUkHIaTP.mjs} +10 -10
  88. package/dist/d1-B2duXfH2.mjs +41 -0
  89. package/dist/{dcv-delegation-D6xiYj2l.mjs → dcv-delegation-BkdRVEAH.mjs} +2 -2
  90. package/dist/{delegate-GctF_lrq.mjs → delegate-CCGgla7X.mjs} +1 -1
  91. package/dist/delegate.mjs +1 -1
  92. package/dist/{deploy-D04Xvm0m.mjs → deploy-BdWBEbLj.mjs} +1 -1
  93. package/dist/{deploy-input-COEKxOA1.mjs → deploy-input-LmLfj6kI.mjs} +1 -1
  94. package/dist/dev-BHkVwAea.mjs +4 -0
  95. package/dist/{diagnostics-BZVAAguV.mjs → diagnostics-9Wj5UWBL.mjs} +7 -7
  96. package/dist/dialog-Dpi-UVbz.mjs +2 -0
  97. package/dist/discover-BYkHr5Ja.mjs +2 -0
  98. package/dist/discover-t6E9lpf3.mjs +2 -0
  99. package/dist/{dist-BpadEMNY.mjs → dist-Cpb7_h4N.mjs} +35 -35
  100. package/dist/dist-D1iG7guo.mjs +366 -0
  101. package/dist/dist-zep5OXGt.mjs +48 -0
  102. package/dist/{dls-BsnURYja.mjs → dls-Caya7FZc.mjs} +8 -8
  103. package/dist/{dns-B_nTXhuM.mjs → dns-BLNa0GrP.mjs} +72 -63
  104. package/dist/{dns-firewall-DDsrdulo.mjs → dns-firewall-ChCvC5rT.mjs} +8 -8
  105. package/dist/dot-prop-IITUZ2XW-BsZYdILY.mjs +2 -0
  106. package/dist/dotenv-CcQjGlV0.mjs +4 -0
  107. package/dist/dry-run-p9Q7nMZ5.mjs +2 -0
  108. package/dist/durable-objects-DuRbdp7N.mjs +6 -0
  109. package/dist/{email-auth-CzjtGH6g.mjs → email-auth-C28s03aI.mjs} +3 -3
  110. package/dist/{email-routing-B92fty1-.mjs → email-routing-Ci-xjXIN.mjs} +24 -24
  111. package/dist/email-security-DPU6xvI9.mjs +158 -0
  112. package/dist/{email-sending-B7f95epu.mjs → email-sending-kTVAlVKO.mjs} +23 -23
  113. package/dist/error-sanitization-BbEw--0B.mjs +2 -0
  114. package/dist/error-sanitization-p5rmb53x.mjs +2 -0
  115. package/dist/errors-cuuW88wR.mjs +3 -0
  116. package/dist/{fieldExtractors-DL_H1m7E.mjs → fieldExtractors-ceaXu4zD.mjs} +4 -4
  117. package/dist/firewall-BND3qSY2.mjs +36 -0
  118. package/dist/flagship-DfxbNzgx.mjs +28 -0
  119. package/dist/{fraud-DU_YCLC5.mjs → fraud-DgyYv_CC.mjs} +3 -3
  120. package/dist/generate-9P8Q_RiO.mjs +2 -0
  121. package/dist/generate-VxmGG8BF.mjs +3 -0
  122. package/dist/{google-tag-gateway-xqN-QudN.mjs → google-tag-gateway-v3p7murv.mjs} +3 -3
  123. package/dist/gt-KlYHH-UC.mjs +2 -0
  124. package/dist/{healthchecks-COnq1YOx.mjs → healthchecks-CByb4qYA.mjs} +10 -10
  125. package/dist/{hostnames-CxRAY_Pp.mjs → hostnames-3CqeMF5g.mjs} +6 -6
  126. package/dist/hyperdrive-CmyYTE-K.mjs +37 -0
  127. package/dist/{iam-CtX9NPCy.mjs → iam-CV_M681j.mjs} +24 -24
  128. package/dist/{images-CuWFOsGw.mjs → images-DaLPjskW.mjs} +33 -33
  129. package/dist/index.mjs +1 -1
  130. package/dist/init-CBKifk5L.mjs +39 -0
  131. package/dist/{intel-BeGV3VXt.mjs → intel-MpftjuPB.mjs} +36 -36
  132. package/dist/interactive-D80kbTap.mjs +32 -0
  133. package/dist/interactive-mJQ_IrGd.mjs +2 -0
  134. package/dist/{ips-d6aoKAI4.mjs → ips-WWvPwSBc.mjs} +1 -1
  135. package/dist/k2-D0QYUFqT.mjs +13 -0
  136. package/dist/keyless-certificates-DqILy3t9.mjs +13 -0
  137. package/dist/{keys-Fyf3vWcA.mjs → keys-DhX4AcqF.mjs} +2 -2
  138. package/dist/kv-DLUfUL0_.mjs +15 -0
  139. package/dist/lazy-command--5YpWUVY.mjs +2 -0
  140. package/dist/{leaked-credential-checks-B7ewx3W-.mjs → leaked-credential-checks-C0U1oYM5.mjs} +8 -8
  141. package/dist/{load-balancers-DHD4f2CT.mjs → load-balancers-BJKI9lm7.mjs} +39 -39
  142. package/dist/local-DkYQiSQQ.mjs +2 -0
  143. package/dist/{local-B6b2OIBW.mjs → local-rYpzEQb-.mjs} +1 -1
  144. package/dist/{local-runtime-DD8DAIlm.mjs → local-runtime-DZTTIe6x.mjs} +1 -1
  145. package/dist/login-CnE2Ii_F.mjs +2 -0
  146. package/dist/login-bnylLTit.mjs +5 -0
  147. package/dist/{logo-matches-BAX8v3iL.mjs → logo-matches-DFZybI0C.mjs} +3 -3
  148. package/dist/{logos-BWBVGwU6.mjs → logos-Da2YtqSN.mjs} +4 -4
  149. package/dist/{logpush-CZKR8DHO.mjs → logpush-Q7WIEHS1.mjs} +23 -23
  150. package/dist/logs-c3b3USyS.mjs +36 -0
  151. package/dist/{magic-cloud-networking-DttrBXqd.mjs → magic-cloud-networking-BoyDmFq3.mjs} +37 -37
  152. package/dist/{magic-network-monitoring-9VXDSYuL.mjs → magic-network-monitoring-BkUbpMUp.mjs} +18 -18
  153. package/dist/{magic-transit-Dsu_cSGM.mjs → magic-transit-4-THD45G.mjs} +161 -165
  154. package/dist/{managed-defense-SYreve4W.mjs → managed-defense-CTMqSp6z.mjs} +9 -9
  155. package/dist/{managed-transforms-CzSy_xPw.mjs → managed-transforms-DcYAvqTe.mjs} +4 -4
  156. package/dist/{matches-qf7GReyu.mjs → matches-hnU16rSJ.mjs} +3 -3
  157. package/dist/{mcp-DYSk5_gc.mjs → mcp-kZX4irfN.mjs} +15 -15
  158. package/dist/{mesh-DdY07OYt.mjs → mesh-Dxzvvso6.mjs} +12 -12
  159. package/dist/migrate-BNvUWrjy.mjs +2 -0
  160. package/dist/monetization-Dsqj9DCA.mjs +20 -0
  161. package/dist/mtls-certificates-BSbMwIna.mjs +13 -0
  162. package/dist/{network-interconnects-C4uUoeNa.mjs → network-interconnects-osO_vAPu.mjs} +17 -17
  163. package/dist/{network-DpaZ5LJL.mjs → network-mEnXTEiG.mjs} +24 -24
  164. package/dist/oauth-CeZ3d_dB.mjs +9 -0
  165. package/dist/{oauth-clients-D7Ou7oAS.mjs → oauth-clients-CWPHi-Yn.mjs} +7 -7
  166. package/dist/{oauth-scopes-BFoE82Mv.mjs → oauth-scopes-CxpRD6d7.mjs} +1 -1
  167. package/dist/{oauth-nsTDJ0dF.mjs → oauth-w0fWmrwU.mjs} +1 -1
  168. package/dist/{observability-smcOFbC1.mjs → observability-BxL2RqWZ.mjs} +44 -44
  169. package/dist/open-PCXX3ZDZ-C7gpxSsl.mjs +4 -0
  170. package/dist/{organization-Dyf_0mq4.mjs → organization-DNieJ1xJ.mjs} +7 -7
  171. package/dist/{organizations-D7zGPLVm.mjs → organizations-BIXPmTy5.mjs} +1 -1
  172. package/dist/{origin-ca-certificates-DJrp29gv.mjs → origin-ca-certificates-dVJvSIH8.mjs} +3 -3
  173. package/dist/{origin-post-quantum-encryption-BYj3kJiq.mjs → origin-post-quantum-encryption-CO6tDW1t.mjs} +3 -3
  174. package/dist/{origin-tls-client-auth-j0tGh6Fy.mjs → origin-tls-client-auth-DeTY8aN2.mjs} +14 -14
  175. package/dist/output-ClYel9WX.mjs +2 -0
  176. package/dist/{page-rules-CLzba_nr.mjs → page-rules-DA552Ra4.mjs} +7 -7
  177. package/dist/pages-B0x7tidm.mjs +54 -0
  178. package/dist/{pay-per-crawl-DbaTVI8V.mjs → pay-per-crawl-DoTg9VP7.mjs} +32 -32
  179. package/dist/{pay-per-use-BEvtoppJ.mjs → pay-per-use-yRO2QBfe.mjs} +3 -3
  180. package/dist/{pipelines-lps71uoA.mjs → pipelines-CQxrm9ao.mjs} +20 -20
  181. package/dist/precursor-FiGYDRV9.mjs +4 -0
  182. package/dist/previews-BthBa50j.mjs +4 -0
  183. package/dist/progress-TLUEIYE6.mjs +2 -0
  184. package/dist/prompt-Ck_1PCHm.mjs +3 -0
  185. package/dist/{queries-EJYlFw8m.mjs → queries-C0RRdol7.mjs} +4 -4
  186. package/dist/{queues-CozKGaA4.mjs → queues-sLgvjsRP.mjs} +29 -35
  187. package/dist/r2-C2PllL6i.mjs +125 -0
  188. package/dist/r2-data-catalog-Bg7zq1IB.mjs +2 -0
  189. package/dist/{radar-NmpdyMo5.mjs → radar-Bez6k9Dw.mjs} +1 -1
  190. package/dist/raw-fetch-DNxNCoeP.mjs +2 -0
  191. package/dist/{realtime-iWTz8WbH.mjs → realtime-D-HSXznX.mjs} +78 -78
  192. package/dist/{registrar-Cza1L8i_.mjs → registrar-DwHrG9QR.mjs} +9 -9
  193. package/dist/{registrar-sandbox-BP4GQg5s.mjs → registrar-sandbox-jNukmzQP.mjs} +6 -6
  194. package/dist/{registry-vreNkX6u.mjs → registry-CsSLAAOE.mjs} +1 -1
  195. package/dist/{reporting-gvXX2MxY.mjs → reporting-DolhAb10.mjs} +7 -7
  196. package/dist/request-headers-Lhj314mk.mjs +2 -0
  197. package/dist/{request-tracers-F8a_aj32.mjs → request-tracers-w72hKc33.mjs} +2 -2
  198. package/dist/resolve-Djf2xgBx.mjs +2 -0
  199. package/dist/{resource-sharing-D6XWIDmb.mjs → resource-sharing-DTrSkqI4.mjs} +18 -18
  200. package/dist/{resource-tagging-c_z4VZt0.mjs → resource-tagging-aURR4fIJ.mjs} +2 -2
  201. package/dist/{rules-_QDaG3U5.mjs → rules-C8a7cV-W.mjs} +8 -8
  202. package/dist/{rulesets-Bc4ZuPG_.mjs → rulesets-RJ6yBefy.mjs} +20 -20
  203. package/dist/{rum-ChPyfpM2.mjs → rum-Bk1dPW4p.mjs} +14 -14
  204. package/dist/run-BJOAPmsz.mjs +2 -0
  205. package/dist/run-iFM5TxtQ.mjs +2 -0
  206. package/dist/{schema-flags-C9lbLgE-.mjs → schema-flags-PagOq-G2.mjs} +2 -2
  207. package/dist/schema-v7mOxMdx.mjs +2 -0
  208. package/dist/{scim-BjiswXbC.mjs → scim-C0FmjkkV.mjs} +10 -10
  209. package/dist/{secrets-store-Cn3D5a0d.mjs → secrets-store-cG_5RMzK.mjs} +11 -11
  210. package/dist/security-insights-DVAqroY5.mjs +40 -0
  211. package/dist/{security-txt-CaR5Idmz.mjs → security-txt-rfrrdiZV.mjs} +4 -4
  212. package/dist/session-B6mFkaVZ.mjs +2 -0
  213. package/dist/shared-BqsWoApw.mjs +2 -0
  214. package/dist/{smart-shield-CphSzoh4.mjs → smart-shield-_HA814Im.mjs} +11 -11
  215. package/dist/{snippets-r-Mre0cE.mjs → snippets-mRelEw0p.mjs} +10 -10
  216. package/dist/source-38bULAR8.mjs +6 -0
  217. package/dist/spawn-BzPhcLJI.mjs +10 -0
  218. package/dist/{spectrum-BhjCVFZk.mjs → spectrum-BwtOiaDw.mjs} +11 -11
  219. package/dist/{speed-CPgypY7n.mjs → speed-DmqsZtiJ.mjs} +11 -11
  220. package/dist/src--KDGqL5N.mjs +109 -0
  221. package/dist/{ssl-DsMrXyqK.mjs → ssl-DCvfveJB.mjs} +16 -16
  222. package/dist/startup-profile-BCe9k9sR.mjs +17 -0
  223. package/dist/startup-profile-WrwRyMwH.mjs +2 -0
  224. package/dist/{state-BxCejn42.mjs → state-BPwdiNO_.mjs} +1 -1
  225. package/dist/state-a1tTOGjm.mjs +2 -0
  226. package/dist/{stream-L2NmGPby.mjs → stream-aroClJeD.mjs} +56 -56
  227. package/dist/{submit-KN0Ul5fV.mjs → submit-BBKhoKT8.mjs} +2 -2
  228. package/dist/{tags-CZMFKGdP.mjs → tags-Djw0e-4j.mjs} +2 -2
  229. package/dist/telemetry-DoBQOGRk.mjs +2 -0
  230. package/dist/telemetry-DrFNujdx.mjs +2 -0
  231. package/dist/{tenant-custom-nameservers-Nx59Buv0.mjs → tenant-custom-nameservers-XCbXryBZ.mjs} +1 -1
  232. package/dist/tenant-tc1wb_ym.mjs +10 -0
  233. package/dist/{theme-BiIYWOed.mjs → theme-BIWQFmZ0.mjs} +2 -2
  234. package/dist/tools-CB4NleeJ.mjs +2 -0
  235. package/dist/{tunnels-C-mMZy4v.mjs → tunnels-C2FTswb6.mjs} +15 -15
  236. package/dist/{turnstile-39JL9tMt.mjs → turnstile-BV4Mdd-j.mjs} +8 -8
  237. package/dist/ui-D1hhIDIs.mjs +5 -0
  238. package/dist/update-check-CFt6cMOi.mjs +2 -0
  239. package/dist/update-check-Dtj9fzNe.mjs +2 -0
  240. package/dist/update-check-worker.mjs +1 -1
  241. package/dist/{url-info-7ikewAnp.mjs → url-info-CeegsDK7.mjs} +2 -2
  242. package/dist/{url-normalization-B0D7Fhf3.mjs → url-normalization-Dbypc9wz.mjs} +4 -4
  243. package/dist/{url-scanner-DpKIqkin.mjs → url-scanner-BFXMrpJF.mjs} +8 -8
  244. package/dist/{user-BFq8UM1s.mjs → user-3uwLMH78.mjs} +1 -1
  245. package/dist/{values-DnBYV1ZD.mjs → values-BTncDc3U.mjs} +2 -2
  246. package/dist/{vectorize-BpZ4UsUj.mjs → vectorize-CtMAtx8r.mjs} +17 -17
  247. package/dist/version-oN1bmOgM.mjs +2 -0
  248. package/dist/{waiting-rooms-DJfqehy9.mjs → waiting-rooms-1xDvjF13.mjs} +25 -25
  249. package/dist/{web-assets-CCSSW_JH.mjs → web-assets-BfEprX1S.mjs} +29 -29
  250. package/dist/{web3-bbT1REPc.mjs → web3-DNbp5sZw.mjs} +13 -13
  251. package/dist/workers-DK_JgS4Y.mjs +38 -0
  252. package/dist/{workers-builds-TRF3K416.mjs → workers-builds-CdhwmmsQ.mjs} +7 -7
  253. package/dist/workers-for-platforms-CP6IqxrK.mjs +42 -0
  254. package/dist/{workers-vpc-kgryQ48l.mjs → workers-vpc-LVfayM2-.mjs} +6 -6
  255. package/dist/{workflows-CKdPlIkK.mjs → workflows-CA5K8FFb.mjs} +23 -23
  256. package/dist/wrangler-migration-B0mKHqGd.mjs +2 -0
  257. package/dist/{zaraz-BXFlEWSx.mjs → zaraz-BY60ZUQ4.mjs} +11 -11
  258. package/dist/{zero-trust-M08mBsYd.mjs → zero-trust-CQNohO7_.mjs} +460 -434
  259. package/dist/{zone-DHmrotGW.mjs → zone-BVDW2UGd.mjs} +2 -2
  260. package/dist/{zones-C0eKBTqG.mjs → zones-CcZL0YQp.mjs} +44 -44
  261. package/package.json +23 -15
  262. package/dist/abuse-reports-Dd6kJM7r.mjs +0 -26
  263. package/dist/access-C_2rEi0H.mjs +0 -27
  264. package/dist/account-CZ9SPVdz.mjs +0 -12
  265. package/dist/ai-ARwLeQ1O.mjs +0 -31
  266. package/dist/ai-gateway-DNY4FPF2.mjs +0 -147
  267. package/dist/auth-DJhSjNNL.mjs +0 -8
  268. package/dist/auth-sAorfdWU.mjs +0 -2
  269. package/dist/browser-extension-C48pKh3t.mjs +0 -15
  270. package/dist/build-1a8CiNIT.mjs +0 -2
  271. package/dist/build-Ca_drQY2.mjs +0 -2
  272. package/dist/cache-XxusQxXe.mjs +0 -45
  273. package/dist/cf-oadujOtC.mjs +0 -18
  274. package/dist/chunk-6EUZQHAF-QVTL_mC-.mjs +0 -2
  275. package/dist/chunk-DL5FNmn1.mjs +0 -2
  276. package/dist/chunk-Q72B4Q5Z-Cr1H_iK6.mjs +0 -2
  277. package/dist/chunk-Q72B4Q5Z-DKhx_4ok.mjs +0 -2
  278. package/dist/chunk-QBZBEHZB-Byagrlop.mjs +0 -2
  279. package/dist/chunk-XLADBZ7F-BXKOjWbx.mjs +0 -374
  280. package/dist/client-certificates-CgaIc3zN.mjs +0 -13
  281. package/dist/command-CF0giIIc.mjs +0 -3
  282. package/dist/command-CsZFRm3P.mjs +0 -2
  283. package/dist/command-DBz8QiFk.mjs +0 -2
  284. package/dist/command-RiZ_LYcm.mjs +0 -2
  285. package/dist/config-B4vIa0zp.mjs +0 -2
  286. package/dist/d1-C1GK7DsW.mjs +0 -45
  287. package/dist/data-security-DDhPnX8Z.mjs +0 -71
  288. package/dist/dev-CVD3BVUG.mjs +0 -4
  289. package/dist/dialog--iw0F2s-.mjs +0 -2
  290. package/dist/dist-CUUGKvjh.mjs +0 -48
  291. package/dist/dist-dc4E1u01.mjs +0 -272
  292. package/dist/dot-prop-6SRZBKHT-Dj7YOlwR.mjs +0 -2
  293. package/dist/dry-run-CLX6Pbtq.mjs +0 -2
  294. package/dist/durable-objects-8U8DpF9q.mjs +0 -8
  295. package/dist/email-security-keTqF0nJ.mjs +0 -160
  296. package/dist/error-sanitization-Cbd_oegl.mjs +0 -2
  297. package/dist/error-sanitization-DwOlM3R7.mjs +0 -2
  298. package/dist/firewall-67qoXiqD.mjs +0 -56
  299. package/dist/flagship-CjC3dF7L.mjs +0 -28
  300. package/dist/hyperdrive-DPWyiXpj.mjs +0 -37
  301. package/dist/interactive-B6woOLo-.mjs +0 -32
  302. package/dist/interactive-DnUvQHjc.mjs +0 -2
  303. package/dist/keyless-certificates-Dvib4jhw.mjs +0 -13
  304. package/dist/kv-CA4J7cCq.mjs +0 -21
  305. package/dist/local-BrfySqnx.mjs +0 -2
  306. package/dist/login-CLW108XX.mjs +0 -5
  307. package/dist/login-xgRjiyJa.mjs +0 -2
  308. package/dist/logs-CiDyrqEu.mjs +0 -48
  309. package/dist/mtls-certificates-LXlgdkf1.mjs +0 -13
  310. package/dist/oauth-Dzk6Gy-6.mjs +0 -14
  311. package/dist/open-PBXRGS4R-C4CKEADM.mjs +0 -4
  312. package/dist/open-PBXRGS4R-C_-G_4DC.mjs +0 -4
  313. package/dist/output-Bia1u2k5.mjs +0 -2
  314. package/dist/pages-pah6dZBJ.mjs +0 -60
  315. package/dist/precursor-DTTYLDEa.mjs +0 -4
  316. package/dist/previews-B89cUmpr.mjs +0 -4
  317. package/dist/progress-D_mL-Kcy.mjs +0 -2
  318. package/dist/prompt-sL_yMZbI.mjs +0 -3
  319. package/dist/r2-Chn_JQUM.mjs +0 -127
  320. package/dist/r2-data-catalog-Bfn3AWzn.mjs +0 -44
  321. package/dist/raw-fetch-lSVttVJF.mjs +0 -2
  322. package/dist/request-headers-POBKmu93.mjs +0 -2
  323. package/dist/resolve-BXemCSyA.mjs +0 -2
  324. package/dist/run-DtN51G2A.mjs +0 -2
  325. package/dist/run-oACgYK8I.mjs +0 -2
  326. package/dist/schema-DZSSJaY0.mjs +0 -2
  327. package/dist/sdk-CsWOex96.mjs +0 -3
  328. package/dist/security-center-DP4GC1cG.mjs +0 -30
  329. package/dist/shared-W9uoX1-W.mjs +0 -2
  330. package/dist/source-BR4_k2ad.mjs +0 -6
  331. package/dist/spawn-BWEuIO-w.mjs +0 -523
  332. package/dist/src-Hw-TlVAO.mjs +0 -108
  333. package/dist/startup-profile-CYEokTVe.mjs +0 -2
  334. package/dist/startup-profile-CgWHy4rE.mjs +0 -17
  335. package/dist/state-DSzkxXML.mjs +0 -2
  336. package/dist/telemetry-CSj_ezpk.mjs +0 -2
  337. package/dist/telemetry-DAf9gLyH.mjs +0 -2
  338. package/dist/telemetry-Dk1GcQ0u.mjs +0 -5
  339. package/dist/tenant-Cu4P-foo.mjs +0 -12
  340. package/dist/tools-BMKpYraQ.mjs +0 -2
  341. package/dist/ui-DH95w1Qk.mjs +0 -5
  342. package/dist/undici-DTSBJHNS.mjs +0 -96
  343. package/dist/update-check-BKQBD4MQ.mjs +0 -2
  344. package/dist/update-check-CE9XB6gf.mjs +0 -2
  345. package/dist/version-Bh3b9vTa.mjs +0 -2
  346. package/dist/workers-CXuyjZB8.mjs +0 -36
  347. package/dist/workers-for-platforms-B57iKiSN.mjs +0 -25
  348. /package/dist/{Page-C-JHZnIy.mjs → Page-DAgOEX17.mjs} +0 -0
  349. /package/dist/{alerts-CstOk8n0.mjs → alerts-D3iKtzoN.mjs} +0 -0
  350. /package/dist/{autorag-PRTwXGgn.mjs → autorag-pvRfDwne.mjs} +0 -0
  351. /package/dist/{body-parser-CUWbw_Tq.mjs → body-parser-NjzJZMOV.mjs} +0 -0
  352. /package/dist/{brands-BHRXlWDm.mjs → brands-DP5Ndir1.mjs} +0 -0
  353. /package/dist/{clear-UvKESVx3.mjs → clear-qLKPlJqb.mjs} +0 -0
  354. /package/dist/{cli-types-tt_LZMbn.mjs → cli-types-_Kmwfpnp.mjs} +0 -0
  355. /package/dist/{connector-telemetry-events-latest-DwnFeZg0.mjs → connector-telemetry-events-latest-_aCmWeZx.mjs} +0 -0
  356. /package/dist/{connector-telemetry-snapshots-latest-Dv6rZlxs.mjs → connector-telemetry-snapshots-latest-CffEplpV.mjs} +0 -0
  357. /package/dist/{domain-info-BqTDXNBo.mjs → domain-info-BQh9XapD.mjs} +0 -0
  358. /package/dist/{health-CwPzzrV6.mjs → health--10IShMi.mjs} +0 -0
  359. /package/dist/{input-validation-Ch4Vllrm.mjs → input-validation-0CeePPHp.mjs} +0 -0
  360. /package/dist/{internal-WLHfxX64.mjs → internal-BUs583vv.mjs} +0 -0
  361. /package/dist/{lifecycle-Ichnb2x1.mjs → lifecycle-Cyc3fmyN.mjs} +0 -0
  362. /package/dist/{live-D_k7eHdv.mjs → live-VCSxA0N9.mjs} +0 -0
  363. /package/dist/{metadata-APBiectA.mjs → metadata-C33s4rc-.mjs} +0 -0
  364. /package/dist/{project-settings-DSXevRvj.mjs → project-settings-Bf6rReo1.mjs} +0 -0
  365. /package/dist/{rate-limit-analytics-CDTPxSET.mjs → rate-limit-analytics-D3q0mGv2.mjs} +0 -0
  366. /package/dist/{rate-limits-C3K9smdl.mjs → rate-limits-BIxlBuMn.mjs} +0 -0
  367. /package/dist/{ready-CvwvbdTX.mjs → ready-CAgelFmC.mjs} +0 -0
  368. /package/dist/{recent-submissions-CjzcT-iH.mjs → recent-submissions-B3TOjNmk.mjs} +0 -0
  369. /package/dist/{refute-CIAFMj00.mjs → refute-BZNkFpBB.mjs} +0 -0
  370. /package/dist/{resolve-CUDKxUrW.mjs → resolve-CGKqk7q8.mjs} +0 -0
  371. /package/dist/{scan-logo-zFkphtQ3.mjs → scan-logo-StecHiaf.mjs} +0 -0
  372. /package/dist/{scan-page-CLl2MAkZ.mjs → scan-page-B4adr-vD.mjs} +0 -0
  373. /package/dist/{search-12jA1b4l.mjs → search-Devngw4M.mjs} +0 -0
  374. /package/dist/{signed-url-U0T_PEMR.mjs → signed-url-ChR5eXXd.mjs} +0 -0
  375. /package/dist/{submission-info-CZ84a3Nb.mjs → submission-info-BGb81HZN.mjs} +0 -0
  376. /package/dist/{total-queries-CJTc9Pde.mjs → total-queries-_wa6KxEl.mjs} +0 -0
  377. /package/dist/{tracked-domains-BKLxnnSv.mjs → tracked-domains-BesKGqfI.mjs} +0 -0
  378. /package/dist/{verify-CZW5Fo1q.mjs → verify-CYM5GlPu.mjs} +0 -0
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- import{_ as e}from"./oauth-Dzk6Gy-6.mjs";import{r as t}from"./auth-DJhSjNNL.mjs";import{t as n}from"./output-Bia1u2k5.mjs";import{t as r}from"./dry-run-CLX6Pbtq.mjs";import{t as i}from"./progress-D_mL-Kcy.mjs";import{t as a}from"./run-DtN51G2A.mjs";import"./telemetry-DAf9gLyH.mjs";import{n as o,t as s}from"./body-parser-CUWbw_Tq.mjs";import{n as c}from"./input-validation-Ch4Vllrm.mjs";import{a as l,n as u}from"./prompt-sL_yMZbI.mjs";import{t as d}from"./cli-types-tt_LZMbn.mjs";function f(e){return e.usage(`$0 client-certificates create
3
-
4
- Create a new API Shield mTLS Client Certificate.`).option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`validity-days`,{type:`number`,description:`The number of days the Client Certificate will be valid after the issued_on date.`}).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:`create`,describe:`Create Client Certificate`,builder:f,handler:async u=>a({command:`client-certificates create`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf client-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({csr:c(u.csr,`csr`,`text`),validity_days:u[`validity-days`]}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Creating`,async()=>a.clientCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(u.csr===void 0&&(u.csr=await l(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),u[`validity-days`]===void 0)throw Error(`--validity-days is required (or pass --body with this field set).`);let f=s({csr:c(u.csr,`csr`,`text`),validity_days:u[`validity-days`]});n(await i(`Creating`,async()=>a.clientCertificates.create({...f,zone_id:d})),{successLabel:`Created`})})};function m(e){return e.usage(`$0 client-certificates delete <client-certificate-id>
5
-
6
- Set a API Shield mTLS Client Certificate to pending_revocation status for processing to revoked status.`).positional(`client-certificate-id`,{type:`string`,description:`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 h={command:`delete <client-certificate-id>`,describe:`Revoke Client Certificate`,builder:m,handler:async o=>a({command:`client-certificates delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf client-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/client_certificates/${o[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(o[`client-certificate-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"client-certificate-id":String(o[`client-certificate-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await u({force:!!o.force})){process.stderr.write(`Aborted.
7
- `);return}n(await i(`Deleting`,async()=>a.clientCertificates.delete({zone_id:s,client_certificate_id:o[`client-certificate-id`]})),{successLabel:`Deleted`})})};function g(e){return e.usage(`$0 client-certificates edit <client-certificate-id>
8
-
9
- If a API Shield mTLS Client Certificate is in a pending_revocation state, you may reactivate it with this endpoint.`).positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`reactivate`,{type:`boolean`,description:`The reactivate 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 _={command:`edit <client-certificate-id>`,describe:`Reactivate Client Certificate`,builder:g,handler:async c=>a({command:`client-certificates edit`,classification:{safeFlags:[`reactivate`,`dry-run`]}},c,async()=>{if(c.dryRun){r({command:`cf client-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/client_certificates/${c[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(c[`client-certificate-id`]))}`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"client-certificate-id":String(c[`client-certificate-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({reactivate:c.reactivate}):o(c.body)});return}let a=await t(c),l=await e({zone:c.zone},a,{quiet:c.quiet});if(c.zoneId=l,c.body){let e=o(c.body);n(await i(`Updating`,async()=>a.clientCertificates.edit({...e,zone_id:l,client_certificate_id:c[`client-certificate-id`]})),{successLabel:`Updated`});return}let u=s({reactivate:c.reactivate});n(await i(`Updating`,async()=>a.clientCertificates.edit({...u,zone_id:l,client_certificate_id:c[`client-certificate-id`]})),{successLabel:`Updated`})})};function v(e){return e.usage(`$0 client-certificates get <client-certificate-id>
10
-
11
- Get Details for a single mTLS API Shield Client Certificate.`).positional(`client-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <client-certificate-id>`,describe:`Client Certificate Details`,builder:v,handler:async o=>a({command:`client-certificates get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf client-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/client_certificates/${o[`client-certificate-id`]==null?`<client-certificate-id>`:encodeURIComponent(String(o[`client-certificate-id`]))}`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``),"client-certificate-id":String(o[`client-certificate-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(`Loading`,async()=>a.clientCertificates.get({zone_id:s,client_certificate_id:o[`client-certificate-id`]})),{successLabel:`Loaded`})})};function b(e){return e.usage(`$0 client-certificates list
12
-
13
- List all of your Zone's API Shield mTLS Client Certificates by Status and/or using Pagination.`).option(`status`,{type:`string`,description:`Client Certitifcate Status to filter results by.`,choices:[`all`,`active`,`pending_reactivation`,`pending_revocation`,`revoked`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List Client Certificates`,builder:d(b),handler:async o=>a({command:`client-certificates list`,classification:{safeFlags:[`status`,`dry-run`]}},o,async()=>{let a={status:o.status,page:o.page,per_page:o[`per-page`],limit:o.limit,offset:o.offset};if(o.dryRun){r({command:`cf client-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/client_certificates`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.clientCertificates.list({zone_id:c,...a})),{successLabel:`Loaded`})})},S={command:`client-certificates`,describe:`client-certificates`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{S as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e,t}from"./project-settings-DSXevRvj.mjs";import{t as n}from"./output-Bia1u2k5.mjs";import*as r from"node:path";import*as i from"node:fs/promises";import{generateTypes as a,loadAndParseConfig as o}from"@cloudflare/config";import{RUNTIME_TYPES_MARKER as s,generateRuntimeTypes as c}from"@cloudflare/runtime-types";const l=r.join(`.cloudflare`,`types`,`index.d.ts`);function u(e){return e.option(`include-runtime`,{type:`boolean`,description:`Include Cloudflare Workers runtime types`,default:!0})}function d(e){return e.map(e=>{let t=e.path.filter(e=>typeof e!=`symbol`).join(`.`);return` - ${t?`${t}: `:``}${e.message}`}).join(`
3
- `)}function f(e,t){let n=r.relative(e,t).split(r.sep).join(`/`);return n.startsWith(`.`)?n:`./${n}`}const p={command:`types`,describe:`Generate types from cloudflare.config.ts`,builder:u,handler:async u=>{if(u.local)throw Error(`--local is not supported by cf workers types.`);let p=e();if(p===null)throw Error(`${t} is required by cf workers types.`);let m=await o(p,{isPreview:!1,mode:u.mode});if(!m.result.success)throw Error(`Invalid ${t}:\n${d(m.result.error.issues)}`);let h=m.result.data.worker;if(h===void 0)throw Error(`${t} must define a Worker to generate types.`);let g=r.dirname(p),_=r.join(g,l),v;try{v=await i.readFile(_,`utf8`)}catch{}let y=a({configPath:f(r.dirname(_),p),packageName:`cf/config`});if(u.includeRuntime){let{runtimeHeader:e,runtimeTypes:t}=await c({compatibilityDate:h.compatibilityDate,compatibilityFlags:h.compatibilityFlags??[],existingContent:v});y+=`\n${e}\n${s}\n${t}`}v!==y&&(await i.mkdir(r.dirname(_),{recursive:!0}),await i.writeFile(_,y)),n({path:r.relative(process.cwd(),_)},{quiet:u.quiet})}};export{p as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./src-Hw-TlVAO.mjs";import{n as t,t as n}from"./cloudflared-DhItYrCq.mjs";const r={command:`quick-start <url>`,describe:`Expose a local URL with a temporary trycloudflare.com tunnel. The tunnel remains active until cf exits.`,builder:e=>e.positional(`url`,{type:`string`,description:`Local URL to expose (for example, http://localhost:3000)`,demandOption:!0}).option(`log-level`,{type:`string`,choices:n,default:`info`,description:`cloudflared log level`}),handler:async n=>{throw n.local?Error(`--local is not supported by cf tunnels quick-start.`):new e(await t([`tunnel`,`--url`,n.url,`--loglevel`,n[`log-level`]]))}};export{r as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./src-Hw-TlVAO.mjs";import{r as t}from"./resolve-CUDKxUrW.mjs";import{m as n}from"./oauth-Dzk6Gy-6.mjs";import{r}from"./auth-DJhSjNNL.mjs";import{t as i}from"./progress-D_mL-Kcy.mjs";import{n as a,t as o}from"./cloudflared-DhItYrCq.mjs";const s=1e3;async function c(e,n,r){if(t(r))return r;let i=0,a;for(let t=1;;t++){let o=await e.tunnel.list({account_id:n,name:r,is_deleted:!1,page:t,per_page:s}),c=o.result??[];for(let e of c)e.name===r&&(i++,a=e.id);let l=o.result_info?.per_page||s;if(c.length<l)break}if(i===0)throw Error(`"${r}" is neither the ID nor the name of any tunnel. Run \`cf tunnels list\` to see available tunnels.`);if(i>1)throw Error(`Found multiple tunnels named "${r}". Pass the tunnel UUID instead.`);if(!a)throw Error(`Tunnel "${r}" was found but has no ID. Pass the tunnel UUID instead.`);return a}async function l(e,t,n){let r=await e.tunnels.token.get({account_id:t,tunnel_id:n});if(typeof r!=`string`||r.length===0)throw Error(`The API returned an empty token for tunnel ${n}.`);return r}function u(e){return e.positional(`tunnel`,{type:`string`,description:`Tunnel name or UUID; required unless --token is provided`}).option(`token`,{type:`string`,description:`Tunnel token supplied directly to cloudflared`}).option(`log-level`,{type:`string`,choices:o,default:`info`,description:`cloudflared log level`})}const d={command:`run [tunnel]`,describe:`Run a named Cloudflare Tunnel using the cf-managed cloudflared binary.`,builder:u,handler:async t=>{if(t.local)throw Error(`--local is not supported by cf tunnels run.`);let o=t.token,s=t.tunnel;if(!o){if(!s)throw Error(`Either a tunnel name/UUID or --token must be provided.`);let e=await r(t),a=await n();o=await i(`Fetching tunnel token`,async()=>l(e,a,await c(e,a,s)))}let u=[`tunnel`,`--loglevel`,t[`log-level`]];throw u.push(`run`),new e(await a(u,{env:{TUNNEL_TOKEN:o}}))}};export{d as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{d as e}from"./dist-dc4E1u01.mjs";import{t}from"./chunk-QBZBEHZB-Byagrlop.mjs";import{i as n,n as r,t as i}from"./startup-profile-CgWHy4rE.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./progress-D_mL-Kcy.mjs";import{a as s,i as c,n as l,o as u,r as d,s as f}from"./build-1a8CiNIT.mjs";import{t as p}from"./deploy-input-COEKxOA1.mjs";import m from"node:path";import{writeFile as h}from"node:fs/promises";import{readBuildOutput as g}from"@cloudflare/build-output-utils";function _(e){return e.option(`outfile`,{type:`string`,description:`Output file for the startup CPU profile`,default:`worker-startup.cpuprofile`,requiresArg:!0}).option(`prebuilt`,{type:`boolean`,description:`Use existing Build Output Specification files without building`,default:!1}).option(`worker`,d)}const v={command:`check`,describe:`Profile a Worker's startup performance`,builder:_,handler:async d=>{if(d.local)throw Error(`--local is not supported by cf workers check.`);d.prebuilt||await l(d.mode,{output:d.quiet?`silent`:`stderr`,worker:d.worker});let{workers:_,rootConfig:v}=await g(process.cwd());u(d.mode,v.buildContext.mode,{requireRequestedMode:d.prebuilt});let y=s(_,d.worker),{wranglerConfig:b,builtConfig:x}=c(y,v),S=p(y,x);if(!S.resolvedEntryPointPath)throw new f(`Startup profiling requires a Worker entrypoint; assets-only projects cannot be profiled.`);if(S.bundleType===`commonjs`)throw new f(`Startup profiling does not support service-worker format Workers. Refer to https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ for migration guidance.`);let C=t({name:b.name??y.config.name??`worker`,main:{name:x.manifest?.mainModule??m.basename(S.resolvedEntryPointPath),filePath:S.resolvedEntryPointPath,content:S.content,type:S.bundleType},modules:S.modules,sourceMaps:S.sourceMaps,compatibility_date:b.compatibility_date,compatibility_flags:b.compatibility_flags??[],assets:void 0,containers:void 0,migrations:void 0,exports:void 0,keepVars:void 0,keepSecrets:void 0,logpush:void 0,placement:void 0,tail_consumers:void 0,streaming_tail_consumers:void 0,limits:void 0,annotations:void 0,observability:void 0,cache:void 0,package_dependencies:void 0},e(b),{dryRun:!0,unsafe:b.unsafe}),w=await r(C),T=d.quiet?await i(C):await o(`Profiling Worker startup`,()=>i(C)),E=n(T);await h(d.outfile,JSON.stringify(T)),a({bundle:{sizeBytes:w.size,gzipSizeBytes:w.gzipSize},startup:{profileWindowMs:E.profileWindow/1e3,sampledTimeMs:E.sampledTime/1e3,activeTimeMs:E.activeTime/1e3,garbageCollectionTimeMs:E.garbageCollectionTime/1e3,idleTimeMs:E.idleTime/1e3,sampleCount:E.sampleCount},profile:d.outfile,note:`This profile was measured locally. Use it to understand where startup time is spent, not to predict startup time on Cloudflare.`},{quiet:d.quiet})}};export{v as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e,t}from"./state-BxCejn42.mjs";import{randomUUID as n}from"node:crypto";const r=new Date(`2026-01-01T00:00:00.000Z`),i=`CF_SEND_TELEMETRY`,a=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function o(){let e=process.env[i];if(e===void 0)return;let t=e.trim().toLowerCase();if(t===`true`||t===`1`)return!0;if(t===`false`||t===`0`)return!1}function s(){let r=t();if(typeof r.deviceId==`string`&&a.test(r.deviceId))return r.deviceId;let i=n();return e({deviceId:i}),i}function c(){return t().deviceId===void 0}function l(){let e=o();if(e!==void 0)return{enabled:e,source:`env`};let n=t().telemetry?.preference;return n?.enabled===!1?{enabled:!1,source:`config`}:n?.enabled===!0?{enabled:!0,source:typeof n.date==`string`&&new Date(n.date)>=r?`config`:`default`}:{enabled:!0,source:`default`}}function u(t){e({telemetry:{preference:{enabled:t,date:new Date().toISOString()}}})}function d(){return t().telemetry?.bannerLastShown}function f(t){e({telemetry:{bannerLastShown:t}})}export{o as a,f as c,s as i,u as l,r as n,c as o,d as r,l as s,i as t};
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-B6b2OIBW.mjs";import{n as t}from"./resolve-CUDKxUrW.mjs";import{m as n,v as r}from"./oauth-Dzk6Gy-6.mjs";import{r as i}from"./auth-DJhSjNNL.mjs";import{t as a}from"./output-Bia1u2k5.mjs";import{t as o}from"./dry-run-CLX6Pbtq.mjs";import{t as s}from"./progress-D_mL-Kcy.mjs";import{n as c,t as l}from"./run-DtN51G2A.mjs";import"./telemetry-DAf9gLyH.mjs";import{n as u,r as d,t as f}from"./body-parser-CUWbw_Tq.mjs";import{n as p}from"./input-validation-Ch4Vllrm.mjs";import{a as m,i as h,n as g,t as _}from"./prompt-sL_yMZbI.mjs";import{t as ee}from"./cli-types-tt_LZMbn.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(r){if(!t(r.database))throw Error(`Expected a D1 database ID, but received <database>=${JSON.stringify(r.database)}. Database names and binding names are not accepted.`);let a=it({dir:r.dir,pattern:r.pattern,table:r.table});if(!v.existsSync(a.migrationsPath))throw Error(`No migrations directory at ${a.migrationsPath}.`+(r.dir===void 0?` Pass --dir to point at one.`:``));return{client:await i(r),accountId:r.local?e:await n(),databaseId:r.database,config:a,local:r.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 r()??`<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 n();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 r()??`<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 n();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 r()??`<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 n();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 r()??`<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 n();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 r()??`<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 n();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 r()??`<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 n();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 r()??`<account-id>`}/d1/database`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(t),u=t.local?e:await n();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 r()??`<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 n();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 r()??`<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 n();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 r()??`<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 n();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 r()??`<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 n();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 r()??`<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 n();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,71 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-B6b2OIBW.mjs";import{m as t,v as n}from"./oauth-Dzk6Gy-6.mjs";import{r}from"./auth-DJhSjNNL.mjs";import{t as i}from"./output-Bia1u2k5.mjs";import{t as a}from"./dry-run-CLX6Pbtq.mjs";import{t as o}from"./progress-D_mL-Kcy.mjs";import{t as s}from"./run-DtN51G2A.mjs";import"./telemetry-DAf9gLyH.mjs";import{n as c,r as l,t as u}from"./body-parser-CUWbw_Tq.mjs";import{n as d}from"./input-validation-Ch4Vllrm.mjs";import{a as f,i as p,n as m}from"./prompt-sL_yMZbI.mjs";import{t as h}from"./cli-types-tt_LZMbn.mjs";function g(e){return e.usage(`$0 data-security posture archive-finding-instance <finding-id>
3
-
4
- Archive one or more finding instances.`).positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const ee={command:`archive-finding-instance <finding-id>`,describe:`Archive a finding`,builder:g,handler:async l=>s({command:`data-security posture archive-finding-instance`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf data-security posture archive-finding-instance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/instances/archive`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({check_instances:l[`check-instances`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.archiveFindingInstance({body:e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let f=u({check_instances:l[`check-instances`]});i(await o(`Creating`,async()=>s.dataSecurity.posture.archiveFindingInstance({body:f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})})};function te(e){return e.usage(`$0 data-security posture change-finding-severity <finding-id>
5
-
6
- Update the severity of a Finding. This will update the \`severity_override\` field on the Finding payload with the new severity value.`).positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`new-severity`,{type:`number`,description:`The numeric severity value to apply to the finding.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating a finding's severity.`})}const _={command:`change-finding-severity <finding-id>`,describe:`Update the severity for a finding`,builder:te,handler:async l=>s({command:`data-security posture change-finding-severity`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf data-security posture change-finding-severity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/tune_finding_severity`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({new_severity:l[`new-severity`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.changeFindingSeverity({...e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`new-severity`]===void 0)throw Error(`--new-severity is required (or pass --body with this field set).`);let f=u({new_severity:l[`new-severity`]});i(await o(`Creating`,async()=>s.dataSecurity.posture.changeFindingSeverity({...f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})})};function v(e){return e.usage(`$0 data-security posture content export create
7
-
8
- Creates a CSV export for content and accepts optional filters in the payload.`).option(`dlp-profile-id`,{type:`string`,array:!0,description:`Filter by DLP profile IDs.`}).option(`dlp-profile-information`,{type:`string`,description:`DLP profile metadata for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view content flagged on or before this date.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view content flagged on or after this date.`}).option(`orders`,{type:`string`,description:`Ordering specifications for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`Search term to filter content.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating content exports.`})}const y={command:`create`,describe:`Create a content export`,builder:v,handler:async f=>s({command:`data-security posture content export create`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf data-security posture content export create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/content/export`,pathParams:{},bodyKind:`json`,body:f.body===void 0?u({dlp_profile_id:f[`dlp-profile-id`],dlp_profile_information:l(f[`dlp-profile-information`],`dlp-profile-information`),integration_id:f[`integration-id`],max_affliction_date:d(f[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(f[`min-affliction-date`],`min-affliction-date`,`text`),orders:l(f.orders,`orders`),search:d(f.search,`search`,`text`),vendors:f.vendors}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.content.export.create({...e,account_id:p})),{successLabel:`Created`});return}if(f[`dlp-profile-information`]===void 0)throw Error(`--dlp-profile-information is required (or pass --body with this field set).`);let m=u({dlp_profile_id:f[`dlp-profile-id`],dlp_profile_information:l(f[`dlp-profile-information`],`dlp-profile-information`),integration_id:f[`integration-id`],max_affliction_date:d(f[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(f[`min-affliction-date`],`min-affliction-date`,`text`),orders:l(f.orders,`orders`),search:d(f.search,`search`,`text`),vendors:f.vendors});i(await o(`Creating`,async()=>s.dataSecurity.posture.content.export.create({...m,account_id:p})),{successLabel:`Created`})})},b={command:`export`,describe:`Operations for posture.content.export`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.usage(`$0 data-security posture content list
9
-
10
- List DLP content findings`).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dlp-profile-id`,{type:`string`,description:`Filter by an DLP profile ID`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering content assets.`,choices:[`asset_name`,`dlp_profile_count`,`integration_name`,`latest_affliction_date`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`vendor`,{type:`string`,description:`Filter by vendor`,choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`,`ZOOM`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`List DLP content findings`,builder:h(x),handler:async c=>s({command:`data-security posture content list`,classification:{safeFlags:[`direction`,`order`,`vendor`,`dry-run`]}},c,async()=>{let s={direction:c.direction,dlp_profile_id:c[`dlp-profile-id`],integration_id:c[`integration-id`],max_affliction_date:c[`max-affliction-date`],min_affliction_date:c[`min-affliction-date`],order:c.order,page:c.page,per_page:c[`per-page`],search:c.search,vendor:c.vendor};if(c.dryRun){a({command:`cf data-security posture content list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/content`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.content.list({account_id:u,...s})),{successLabel:`Loaded`})})},C={command:`content`,describe:`Operations for posture.content`,builder:e=>e.command(S).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.usage(`$0 data-security posture create-finding-export-csv
11
-
12
- Creates a CSV export for findings and accepts optional filters in the payload.`).option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see active items.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`orders`,{type:`string`,description:`Which fields to use when ordering the findings. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`severities`,{type:`string`,array:!0,description:`Filter by severity levels.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for findings export jobs.`})}const T={command:`create-finding-export-csv`,describe:`Create new findings export request`,builder:w,handler:async f=>s({command:`data-security posture create-finding-export-csv`,classification:{safeFlags:[`ignored`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf data-security posture create-finding-export-csv`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/export`,pathParams:{},bodyKind:`json`,body:f.body===void 0?u({ignored:f.ignored,integration_id:f[`integration-id`],max_affliction_date:d(f[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(f[`min-affliction-date`],`min-affliction-date`,`text`),orders:l(f.orders,`orders`),search:d(f.search,`search`,`text`),severities:f.severities,vendors:f.vendors}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.createFindingExportCsv({...e,account_id:p})),{successLabel:`Created`});return}let m=u({ignored:f.ignored,integration_id:f[`integration-id`],max_affliction_date:d(f[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(f[`min-affliction-date`],`min-affliction-date`,`text`),orders:l(f.orders,`orders`),search:d(f.search,`search`,`text`),severities:f.severities,vendors:f.vendors});i(await o(`Creating`,async()=>s.dataSecurity.posture.createFindingExportCsv({...m,account_id:p})),{successLabel:`Created`})})};function E(e){return e.usage("$0 data-security posture create-finding-instances-export-csv <storage-namespace-id>\n\nCreates a CSV export for Finding instances and accepts optional filters in the payload. The `storage_namespace_id` path parameter is derived from the finding ID by base64-decoding it (which yields `integration_id:finding_type_id`) and replacing the colon with a hyphen.").positional(`storage-namespace-id`,{type:`string`,description:"A storage namespace identifier for the finding, used to scope finding instance exports. Constructed by base64-decoding the finding ID (which encodes `integration_id:finding_type_id`) and replacing the colon separator with a hyphen. For example, a finding ID that decodes to `00000000-0000-0000-0000-000000000001:00000000-0000-0000-0000-000000000002` becomes `00000000-0000-0000-0000-000000000001-00000000-0000-0000-0000-000000000002`.",demandOption:!0}).option(`archived`,{type:`boolean`,description:`Filter for archived status.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`orders`,{type:`string`,description:`Ordering specifications for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for finding instance exports.`})}const D={command:`create-finding-instances-export-csv <storage-namespace-id>`,describe:`Create a finding instances export`,builder:E,handler:async f=>s({command:`data-security posture create-finding-instances-export-csv`,classification:{safeFlags:[`archived`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf data-security posture create-finding-instances-export-csv`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${f[`storage-namespace-id`]==null?`<storage-namespace-id>`:encodeURIComponent(String(f[`storage-namespace-id`]))}/instances/export`,pathParams:{"storage-namespace-id":String(f[`storage-namespace-id`]??``)},bodyKind:`json`,body:f.body===void 0?u({archived:f.archived,max_affliction_date:d(f[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(f[`min-affliction-date`],`min-affliction-date`,`text`),orders:l(f.orders,`orders`),search:d(f.search,`search`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.createFindingInstancesExportCsv({...e,account_id:p,storage_namespace_id:f[`storage-namespace-id`]})),{successLabel:`Created`});return}let m=u({archived:f.archived,max_affliction_date:d(f[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(f[`min-affliction-date`],`min-affliction-date`,`text`),orders:l(f.orders,`orders`),search:d(f.search,`search`,`text`)});i(await o(`Creating`,async()=>s.dataSecurity.posture.createFindingInstancesExportCsv({...m,account_id:p,storage_namespace_id:f[`storage-namespace-id`]})),{successLabel:`Created`})})};function O(e){return e.usage(`$0 data-security posture create-remediation-jobs-export-csv
13
-
14
- Creates a CSV export for remediation jobs and accepts optional filters in the payload.`).option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or before this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or after this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`orders`,{type:`string`,description:`Ordering specifications for the export. Provide as a JSON array of objects or @path/to/file.json.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`status`,{type:`string`,array:!0,description:`Filter by remediation job status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for remediation jobs export.`})}const k={command:`create-remediation-jobs-export-csv`,describe:`Create a remediation jobs export`,builder:O,handler:async f=>s({command:`data-security posture create-remediation-jobs-export-csv`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf data-security posture create-remediation-jobs-export-csv`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs/export`,pathParams:{},bodyKind:`json`,body:f.body===void 0?u({integration_id:f[`integration-id`],max_updated_at:d(f[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:d(f[`min-updated-at`],`min-updated-at`,`text`),orders:l(f.orders,`orders`),search:d(f.search,`search`,`text`),status:f.status}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.createRemediationJobsExportCsv({...e,account_id:p})),{successLabel:`Created`});return}let m=u({integration_id:f[`integration-id`],max_updated_at:d(f[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:d(f[`min-updated-at`],`min-updated-at`,`text`),orders:l(f.orders,`orders`),search:d(f.search,`search`,`text`),status:f.status});i(await o(`Creating`,async()=>s.dataSecurity.posture.createRemediationJobsExportCsv({...m,account_id:p})),{successLabel:`Created`})})};function A(e){return e.usage(`$0 data-security posture create-remediation-jobs
15
-
16
- Create one or more remediation jobs tied to a specific Cloudflare Account.`).option(`finding-instance-ids`,{type:`string`,array:!0,description:`UUIDs identifying Finding Instances.`}).option(`remediation-type-id`,{type:`string`,description:`A UUID identifying this Remediation Type.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating remediation jobs.`})}const j={command:`create-remediation-jobs`,describe:`Creates remediation jobs`,builder:A,handler:async l=>s({command:`data-security posture create-remediation-jobs`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf data-security posture create-remediation-jobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({finding_instance_ids:l[`finding-instance-ids`],remediation_type_id:d(l[`remediation-type-id`],`remediation-type-id`,`text`)}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.createRemediationJobs({...e,account_id:p})),{successLabel:`Created`});return}if(l[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);l[`remediation-type-id`]===void 0&&(l[`remediation-type-id`]=await f(`remediation-type-id`,`A UUID identifying this Remediation Type.`));let m=u({finding_instance_ids:l[`finding-instance-ids`],remediation_type_id:d(l[`remediation-type-id`],`remediation-type-id`,`text`)});i(await o(`Creating`,async()=>s.dataSecurity.posture.createRemediationJobs({...m,account_id:p})),{successLabel:`Created`})})};function M(e){return e.usage(`$0 data-security posture create-webhook-jobs
17
-
18
- Creates webhook jobs to send a finding instance to one or more configured webhooks.`).option(`finding-instance-ids`,{type:`string`,array:!0,description:`Array of finding instance IDs to send to the webhooks.`}).option(`webhook-ids`,{type:`string`,array:!0,description:`Array of webhook IDs to trigger jobs for.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating up to 100 webhook jobs. The number of jobs is the product of webhook_ids and finding_instance_ids.`})}const N={command:`create-webhook-jobs`,describe:`Create webhook jobs`,builder:M,handler:async l=>s({command:`data-security posture create-webhook-jobs`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf data-security posture create-webhook-jobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/jobs`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.createWebhookJobs({...e,account_id:d})),{successLabel:`Created`});return}if(l[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);if(l[`webhook-ids`]===void 0)throw Error(`--webhook-ids is required (or pass --body with this field set).`);let f=u({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]});i(await o(`Creating`,async()=>s.dataSecurity.posture.createWebhookJobs({...f,account_id:d})),{successLabel:`Created`})})};function P(e){return e.usage(`$0 data-security posture create-webhook
19
-
20
- Creates a new webhook configuration for sending finding notifications to external endpoints.`).option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`headers`,{type:`string`,description:`List of custom headers to include in webhook requests. Provide as a JSON array of objects or @path/to/file.json.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`status`,{type:`string`,description:`Status of the webhook configuration. Defaults to enabled when omitted.`,choices:[`enabled`,`disabled`],default:`enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a new webhook configuration.`})}const F={command:`create-webhook`,describe:`Create a new webhook configuration`,builder:P,handler:async m=>s({command:`data-security posture create-webhook`,classification:{safeFlags:[`authentication-type`,`status`,`dry-run`]}},m,async()=>{if(m.dryRun){a({command:`cf data-security posture create-webhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({authentication_type:d(m[`authentication-type`],`authentication-type`,`text`),destination_url:d(m[`destination-url`],`destination-url`,`text`),headers:l(m.headers,`headers`),label:d(m.label,`label`,`text`),signing_secret:d(m[`signing-secret`],`signing-secret`,`text`),status:d(m.status,`status`,`text`)}):c(m.body)});return}let s=await r(m),h=m.local?e:await t();if(m.accountId=h,m.body){let e=c(m.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.createWebhook({...e,account_id:h})),{successLabel:`Created`});return}m[`authentication-type`]===void 0&&(m[`authentication-type`]=await p(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),m[`destination-url`]===void 0&&(m[`destination-url`]=await f(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),m.label===void 0&&(m.label=await f(`label`,`Account-specified display label for the webhook configuration.`));let g=u({authentication_type:d(m[`authentication-type`],`authentication-type`,`text`),destination_url:d(m[`destination-url`],`destination-url`,`text`),headers:l(m.headers,`headers`),label:d(m.label,`label`,`text`),signing_secret:d(m[`signing-secret`],`signing-secret`,`text`),status:d(m.status,`status`,`text`)});i(await o(`Creating`,async()=>s.dataSecurity.posture.createWebhook({...g,account_id:h})),{successLabel:`Created`})})};function I(e){return e.usage(`$0 data-security posture evaluate-existing-webhook <webhook-id>
21
-
22
- Sends a test webhook event using an existing webhook configuration. This allows customers to verify their webhook endpoint is still reachable and properly configured after creating the webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`evaluate-existing-webhook <webhook-id>`,describe:`Test an existing webhook configuration`,builder:I,handler:async c=>s({command:`data-security posture evaluate-existing-webhook`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture evaluate-existing-webhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${c[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(c[`webhook-id`]))}/evaluate`,pathParams:{"webhook-id":String(c[`webhook-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.dataSecurity.posture.evaluateExistingWebhook({account_id:l,webhook_id:c[`webhook-id`]})),{successLabel:`Created`})})};function R(e){return e.usage(`$0 data-security posture evaluate-new-webhook
23
-
24
- Sends a test webhook event to the specified destination URL to verify the webhook endpoint is reachable and properly configured. This allows customers to validate their webhook configuration before creating the actual webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`).option(`authentication-type`,{type:`string`,description:`Type of authentication to use for the test webhook request.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL to send the test webhook event to.`}).option(`headers`,{type:`string`,description:`List of custom headers to include in the test webhook request. Provide as a JSON array of objects or @path/to/file.json.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for testing a webhook configuration before creating it.`})}const z={command:`evaluate-new-webhook`,describe:`Test a webhook configuration before creating it`,builder:R,handler:async m=>s({command:`data-security posture evaluate-new-webhook`,classification:{safeFlags:[`authentication-type`,`dry-run`]}},m,async()=>{if(m.dryRun){a({command:`cf data-security posture evaluate-new-webhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/evaluate`,pathParams:{},bodyKind:`json`,body:m.body===void 0?u({authentication_type:d(m[`authentication-type`],`authentication-type`,`text`),destination_url:d(m[`destination-url`],`destination-url`,`text`),headers:l(m.headers,`headers`),signing_secret:d(m[`signing-secret`],`signing-secret`,`text`)}):c(m.body)});return}let s=await r(m),h=m.local?e:await t();if(m.accountId=h,m.body){let e=c(m.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.evaluateNewWebhook({...e,account_id:h})),{successLabel:`Created`});return}m[`authentication-type`]===void 0&&(m[`authentication-type`]=await p(`authentication-type`,`Type of authentication to use for the test webhook request.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),m[`destination-url`]===void 0&&(m[`destination-url`]=await f(`destination-url`,`Target URL to send the test webhook event to.`));let g=u({authentication_type:d(m[`authentication-type`],`authentication-type`,`text`),destination_url:d(m[`destination-url`],`destination-url`,`text`),headers:l(m.headers,`headers`),signing_secret:d(m[`signing-secret`],`signing-secret`,`text`)});i(await o(`Creating`,async()=>s.dataSecurity.posture.evaluateNewWebhook({...g,account_id:h})),{successLabel:`Created`})})};function B(e){return e.usage(`$0 data-security posture exports list
25
-
26
- List all export jobs for a given requestor's organization`).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`status`,{type:`string`,description:`Filter on export job's status`,choices:[`Pending`,`Success`,`Failure`,`Rescheduled`,`In-Progress`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`list`,describe:`List all export jobs`,builder:h(B),handler:async c=>s({command:`data-security posture exports list`,classification:{safeFlags:[`status`,`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],status:c.status};if(c.dryRun){a({command:`cf data-security posture exports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/exports`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.exports.list({account_id:u,...s})),{successLabel:`Loaded`})})},H={command:`exports`,describe:`Operations for posture.exports`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.usage(`$0 data-security posture get-export-job <id>
27
-
28
- Retrieves a single export job by its unique identifier`).positional(`id`,{type:`string`,description:`Unique identifier for the export job`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get-export-job <id>`,describe:`Get a single export job`,builder:U,handler:async c=>s({command:`data-security posture get-export-job`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture get-export-job`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/exports/${c.id==null?`<id>`:encodeURIComponent(String(c.id))}`,pathParams:{id:String(c.id??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.dataSecurity.posture.getExportJob({account_id:l,id:c.id})),{successLabel:`Loaded`})})};function G(e){return e.usage(`$0 data-security posture get-finding-instance <instance-id>
29
-
30
- Gets a security Finding instance by id.`).positional(`instance-id`,{type:`string`,description:`A uuid ID identifying this Finding instance.`,demandOption:!0}).option(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get-finding-instance <instance-id>`,describe:`Get a finding instance using an instance ID`,builder:G,handler:async c=>s({command:`data-security posture get-finding-instance`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture get-finding-instance`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${c[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(c[`finding-id`]))}/instances/${c[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(c[`instance-id`]))}`,pathParams:{"finding-id":String(c[`finding-id`]??``),"instance-id":String(c[`instance-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.dataSecurity.posture.getFindingInstance({account_id:l,finding_id:c[`finding-id`],instance_id:c[`instance-id`]})),{successLabel:`Loaded`})})};function q(e){return e.usage(`$0 data-security posture get-finding-type <finding-type-id>
31
-
32
- Retrieve a specific finding type by its unique identifier.`).positional(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get-finding-type <finding-type-id>`,describe:`Get finding by ID`,builder:q,handler:async c=>s({command:`data-security posture get-finding-type`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture get-finding-type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types/${c[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(c[`finding-type-id`]))}`,pathParams:{"finding-type-id":String(c[`finding-type-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.dataSecurity.posture.getFindingType({account_id:l,finding_type_id:c[`finding-type-id`]})),{successLabel:`Loaded`})})};function Y(e){return e.usage(`$0 data-security posture get-finding <finding-id>
33
-
34
- Gets a security Finding that has been identified as being problematic.`).positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get-finding <finding-id>`,describe:`Get a finding type`,builder:Y,handler:async c=>s({command:`data-security posture get-finding`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture get-finding`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${c[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(c[`finding-id`]))}`,pathParams:{"finding-id":String(c[`finding-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.dataSecurity.posture.getFinding({account_id:l,finding_id:c[`finding-id`]})),{successLabel:`Loaded`})})};function Z(e){return e.usage("$0 data-security posture get-remediation-types-for-finding-type <finding-type-id>\n\nList all remediation types for a given finding type. This endpoint supports both cursor and offset pagination. Note that `cursor` and `page` are mutually exclusive.").positional(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`cursor`,{type:`string`,description:`A cursor for pagination.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`get-remediation-types-for-finding-type <finding-type-id>`,describe:`List remediation types for a finding type`,builder:Z,handler:async c=>s({command:`data-security posture get-remediation-types-for-finding-type`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={integration_id:c[`integration-id`],cursor:c.cursor,page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf data-security posture get-remediation-types-for-finding-type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types/${c[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(c[`finding-type-id`]))}/remediation_types`,pathParams:{"finding-type-id":String(c[`finding-type-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.getRemediationTypesForFindingType({account_id:u,finding_type_id:c[`finding-type-id`],...s})),{successLabel:`Loaded`})})};function ne(e){return e.usage(`$0 data-security posture get-webhook-config-by-id <webhook-id>
35
-
36
- Retrieves a specific webhook configuration by its unique identifier.`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get-webhook-config-by-id <webhook-id>`,describe:`Get webhook configuration by ID`,builder:ne,handler:async c=>s({command:`data-security posture get-webhook-config-by-id`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture get-webhook-config-by-id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${c[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(c[`webhook-id`]))}`,pathParams:{"webhook-id":String(c[`webhook-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.dataSecurity.posture.getWebhookConfigById({account_id:l,webhook_id:c[`webhook-id`]})),{successLabel:`Loaded`})})};function ie(e){return e.usage(`$0 data-security posture ignore-finding
37
-
38
- Given a list of findings, mark as ignored. Does nothing if Finding is already ignored.`).option(`checks`,{type:`string`,array:!0,description:`A list of finding IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on findings.`})}const ae={command:`ignore-finding`,describe:`Mark a finding as ignored`,builder:ie,handler:async l=>s({command:`data-security posture ignore-finding`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf data-security posture ignore-finding`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/ignore`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({checks:l.checks}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.ignoreFinding({body:e,account_id:d})),{successLabel:`Created`});return}if(l.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let f=u({checks:l.checks});i(await o(`Creating`,async()=>s.dataSecurity.posture.ignoreFinding({body:f,account_id:d})),{successLabel:`Created`})})};function oe(e){return e.usage(`$0 data-security posture list-finding-instances <finding-id>
39
-
40
- Lists all security finding instances for a given security finding.`).positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`archived`,{type:`boolean`,description:`Archived`}).option(`cursor`,{type:`string`,description:"A cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering the Finding's instances.
41
- When ordering by 'remediation.status', only the most recent non-stale remediation job is considered. Stale jobs (created before the instance's affliction_date) are treated as having no status for ordering purposes.`,choices:[`affliction_date`,`asset.name`,`remediation.status`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`remediation-statuses`,{type:`string`,description:`Filter finding instances by most recent remediation job status. Supports multiple comma-separated values.
42
- Use 'none' to filter instances with no remediation jobs or instances where the most recent job is stale.
43
- Note: Stale jobs (created before the instance's affliction_date) are ignored for filtering purposes, but are still included in the 'remediations' array with stale=true.`}).option(`finding-instance-ids`,{type:`string`,description:`Filter finding instances by an array of finding instance IDs. Supports multiple comma-separated values.`}).option(`asset-ids`,{type:`string`,description:`Filter finding instances by an array of asset IDs. Supports multiple comma-separated values.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`list-finding-instances <finding-id>`,describe:`List instances of a finding`,builder:h(oe),handler:async c=>s({command:`data-security posture list-finding-instances`,classification:{safeFlags:[`archived`,`direction`,`order`,`dry-run`]}},c,async()=>{let s={archived:c.archived,cursor:c.cursor,direction:c.direction,max_affliction_date:c[`max-affliction-date`],min_affliction_date:c[`min-affliction-date`],order:c.order,page:c.page,per_page:c[`per-page`],search:c.search,remediation_statuses:c[`remediation-statuses`],finding_instance_ids:c[`finding-instance-ids`],asset_ids:c[`asset-ids`]};if(c.dryRun){a({command:`cf data-security posture list-finding-instances`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${c[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(c[`finding-id`]))}/instances`,pathParams:{"finding-id":String(c[`finding-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listFindingInstances({account_id:u,finding_id:c[`finding-id`],...s})),{successLabel:`Loaded`})})};function ce(e){return e.usage(`$0 data-security posture list-finding-types
44
-
45
- List all available finding types with pagination support.`).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`vendors`,{type:`string`,description:`Filter finding types by vendor. Supports multiple comma-separated values. Each value may be either the vendor enum (GOOGLE_WORKSPACE) or the friendly name returned by the read routes (Google Workspace).`}).option(`search`,{type:`string`,description:`Filter finding types by name or ID (case-insensitive substring match).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`list-finding-types`,describe:`List all finding types`,builder:h(ce),handler:async c=>s({command:`data-security posture list-finding-types`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],vendors:c.vendors,search:c.search};if(c.dryRun){a({command:`cf data-security posture list-finding-types`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listFindingTypes({account_id:u,...s})),{successLabel:`Loaded`})})};function ue(e){return e.usage(`$0 data-security posture list-findings
46
-
47
- List all security findings that have been identified as being problematic. This will return a list of findings regardless if they have been ignored or not.`).option(`cursor`,{type:`string`,description:"A cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see "active" items`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`observation`,{type:`string`,description:`Filter by observation type of the finding`,choices:[`Activity`,`Insight`,`Issue`]}).option(`order`,{type:`string`,description:`Which field to use when ordering the findings.`,choices:[`finding.name`,`instance_count`,`integration.name`,`latest_affliction_date`,`severity`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`product`,{type:`string`,description:`Filter by product category of the finding`,choices:[`Cloud`,`Saas`]}).option(`search`,{type:`string`,description:`A search term.`}).option(`severity`,{type:`string`,description:`Filter by severity`,choices:[`Critical`,`High`,`Medium`,`Low`]}).option(`type`,{type:`string`,description:`Filter by type of the finding`,choices:[`Content`,`Posture`]}).option(`vendor`,{type:`string`,description:`Filter by vendor`,choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`,`ZOOM`]}).option(`finding-type-ids`,{type:`string`,description:`A comma separated list of UUIDs identifying the finding type(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`list-findings`,describe:`List posture findings`,builder:h(ue),handler:async c=>s({command:`data-security posture list-findings`,classification:{safeFlags:[`direction`,`ignored`,`observation`,`order`,`product`,`severity`,`type`,`vendor`,`dry-run`]}},c,async()=>{let s={cursor:c.cursor,direction:c.direction,ignored:c.ignored,integration_id:c[`integration-id`],max_affliction_date:c[`max-affliction-date`],min_affliction_date:c[`min-affliction-date`],observation:c.observation,order:c.order,page:c.page,per_page:c[`per-page`],product:c.product,search:c.search,severity:c.severity,type:c.type,vendor:c.vendor,finding_type_ids:c[`finding-type-ids`]};if(c.dryRun){a({command:`cf data-security posture list-findings`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listFindings({account_id:u,...s})),{successLabel:`Loaded`})})};function fe(e){return e.usage("$0 data-security posture list-remediation-jobs\n\nList all remediation jobs tied to a specific Cloudflare Account. Note that `cursor` and `page` are mutually exclusive.").option(`cursor`,{type:`string`,description:`A cursor for pagination.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediations updated on or after the min updated datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediations updated on or before the max updated datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`status`,{type:`string`,description:`Filter to view remediations with the given status.`,choices:[`pending`,`processing`,`completed`,`failed`,`validating`]}).option(`triggered-by-actor`,{type:`string`,description:`Filter remediations by what kind of actor triggered them. Supports multiple comma-separated values.`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`order`,{type:`string`,description:`An optional param to sort the results by the given field.`,choices:[`created_at`,`affliction_date`,`integration_name`,`status`,`last_updated_at`,`asset_name`,`finding_type_name`]}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list-remediation-jobs`,describe:`List remediation jobs`,builder:h(fe),handler:async c=>s({command:`data-security posture list-remediation-jobs`,classification:{safeFlags:[`status`,`order`,`direction`,`dry-run`]}},c,async()=>{let s={cursor:c.cursor,page:c.page,per_page:c[`per-page`],search:c.search,min_updated_at:c[`min-updated-at`],max_updated_at:c[`max-updated-at`],status:c.status,triggered_by_actor:c[`triggered-by-actor`],integration_id:c[`integration-id`],order:c.order,direction:c.direction};if(c.dryRun){a({command:`cf data-security posture list-remediation-jobs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listRemediationJobs({account_id:u,...s})),{successLabel:`Loaded`})})};function me(e){return e.usage(`$0 data-security posture list-webhooks
48
-
49
- Retrieves all webhook configurations for the authenticated account. Returns an array of webhook configurations that can be used to send finding notifications.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const he={command:`list-webhooks`,describe:`List webhook configurations`,builder:me,handler:async c=>s({command:`data-security posture list-webhooks`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture list-webhooks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.dataSecurity.posture.listWebhooks({account_id:l})),{successLabel:`Loaded`})})};function ge(e){return e.usage(`$0 data-security posture policies create
50
-
51
- Creates a new policy configuration that defines automated actions to be executed when security findings are detected. A policy can include multiple remediation and/or webhook actions that will be triggered automatically.`).option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`finding-type-id`,{type:`string`,description:`The finding type this policy is associated with. All remediation actions must match this finding type.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a new policy configuration.`})}const _e={command:`create`,describe:`Create a new policy configuration`,builder:ge,handler:async l=>s({command:`data-security posture policies create`,classification:{safeFlags:[`applies-to-all-integrations`,`enabled`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf data-security posture policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({applies_to_all_integrations:l[`applies-to-all-integrations`],description:d(l.description,`description`,`text`),display_name:d(l[`display-name`],`display-name`,`text`),enabled:l.enabled,finding_type_id:d(l[`finding-type-id`],`finding-type-id`,`text`),integration_ids:l[`integration-ids`]}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.policies.create({...e,account_id:p})),{successLabel:`Created`});return}if(l[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(l[`display-name`]===void 0&&(l[`display-name`]=await f(`display-name`,`Display name for the policy configuration.`)),l.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);l[`finding-type-id`]===void 0&&(l[`finding-type-id`]=await f(`finding-type-id`,`The finding type this policy is associated with. All remediation actions must match this finding type.`));let m=u({applies_to_all_integrations:l[`applies-to-all-integrations`],description:d(l.description,`description`,`text`),display_name:d(l[`display-name`],`display-name`,`text`),enabled:l.enabled,finding_type_id:d(l[`finding-type-id`],`finding-type-id`,`text`),integration_ids:l[`integration-ids`]});i(await o(`Creating`,async()=>s.dataSecurity.posture.policies.create({...m,account_id:p})),{successLabel:`Created`})})};function ve(e){return e.usage(`$0 data-security posture policies delete <policy-id>
52
-
53
- Deletes a policy configuration.`).positional(`policy-id`,{type:`string`,description:`A UUID identifying the policy.`,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 ye={command:`delete <policy-id>`,describe:`Delete a policy configuration`,builder:ve,handler:async c=>s({command:`data-security posture policies delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${c[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(c[`policy-id`]))}`,pathParams:{"policy-id":String(c[`policy-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
54
- `);return}i(await o(`Deleting`,async()=>s.dataSecurity.posture.policies.delete({account_id:l,policy_id:c[`policy-id`]})),{successLabel:`Deleted`})})};function be(e){return e.usage(`$0 data-security posture policies get <policy-id>
55
-
56
- Retrieves the details of a specific policy configuration, including its associated remediation and webhook actions.`).positional(`policy-id`,{type:`string`,description:`The UUID of the policy configuration to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`get <policy-id>`,describe:`Get a policy configuration by ID`,builder:be,handler:async c=>s({command:`data-security posture policies get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${c[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(c[`policy-id`]))}`,pathParams:{"policy-id":String(c[`policy-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.dataSecurity.posture.policies.get({account_id:l,policy_id:c[`policy-id`]})),{successLabel:`Loaded`})})};function Se(e){return e.usage(`$0 data-security posture policies list
57
-
58
- Returns a list of integration-scoped policy configurations for the given account. This endpoint supports cursor based pagination. By default, results are returned in sorted order based on created_at.`).option(`cursor`,{type:`string`,description:"Cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`list`,describe:`List policy configurations`,builder:Se,handler:async c=>s({command:`data-security posture policies list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={cursor:c.cursor};if(c.dryRun){a({command:`cf data-security posture policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.policies.list({account_id:u,...s})),{successLabel:`Loaded`})})};function we(e){return e.usage("$0 data-security posture policies logs list\n\nReturns a list of policy invocation logs for the given account, sourced from ClickHouse via Ready Analytics. Each entry represents one execution of a policy against a finding instance, including the actions (remediation jobs and webhooks) it dispatched. Results are scoped to the requesting account's CASB integrations. The `integration_id` query parameter, when supplied, is intersected against the account's integration allowlist; values outside the allowlist are silently dropped. Pagination is offset-based. The response does not include a total row count; clients should treat a result with fewer than `per_page` entries as the end of the list.").option(`since`,{type:`string`,description:"Lower bound on the log entry timestamp. Accepts ISO 8601 / RFC3339 or epoch seconds. Defaults to 7 days before `until`. The window between `since` and `until` cannot exceed 180 days."}).option(`until`,{type:`string`,description:"Upper bound on the log entry timestamp. Accepts ISO 8601 / RFC3339 or epoch seconds. Defaults to the current time. Must be greater than or equal to `since`."}).option(`integration-id`,{type:`string`,description:`Comma-separated list of CASB integration IDs to filter by. At most 100 values, each at most 128 characters. Values outside the account's tenancy allowlist are silently ignored. When omitted, results are scoped to the full allowlist.`}).option(`policy-name`,{type:`string`,description:`Comma-separated list of policy display names to filter by. At most 100 values, each at most 255 characters.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`list`,describe:`List policy invocation logs`,builder:we,handler:async c=>s({command:`data-security posture policies logs list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={since:c.since,until:c.until,integration_id:c[`integration-id`],policy_name:c[`policy-name`],page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf data-security posture policies logs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/logs`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.policies.logs.list({account_id:u,...s})),{successLabel:`Loaded`})})},Ee={command:`logs`,describe:`Operations for posture.policies.logs`,builder:e=>e.command(Te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function De(e){return e.usage(`$0 data-security posture policies update <policy-id>
59
-
60
- Updates an existing policy configuration and replaces its actions.`).positional(`policy-id`,{type:`string`,description:`Policy configuration ID`,demandOption:!0}).option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating an existing policy configuration.`})}const Oe={command:`update <policy-id>`,describe:`Update a policy configuration`,builder:De,handler:async l=>s({command:`data-security posture policies update`,classification:{safeFlags:[`applies-to-all-integrations`,`enabled`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf data-security posture policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${l[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(l[`policy-id`]))}`,pathParams:{"policy-id":String(l[`policy-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({applies_to_all_integrations:l[`applies-to-all-integrations`],description:d(l.description,`description`,`text`),display_name:d(l[`display-name`],`display-name`,`text`),enabled:l.enabled,integration_ids:l[`integration-ids`]}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.dataSecurity.posture.policies.update({...e,account_id:p,policy_id:l[`policy-id`]})),{successLabel:`Updated`});return}if(l[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(l[`display-name`]===void 0&&(l[`display-name`]=await f(`display-name`,`Display name for the policy configuration.`)),l.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let m=u({applies_to_all_integrations:l[`applies-to-all-integrations`],description:d(l.description,`description`,`text`),display_name:d(l[`display-name`],`display-name`,`text`),enabled:l.enabled,integration_ids:l[`integration-ids`]});i(await o(`Updating`,async()=>s.dataSecurity.posture.policies.update({...m,account_id:p,policy_id:l[`policy-id`]})),{successLabel:`Updated`})})},ke={command:`policies`,describe:`Operations for posture.policies`,builder:e=>e.command(_e).command(ye).command(xe).command(Ce).command(Oe).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ae(e){return e.usage(`$0 data-security posture reset-finding-severity <finding-id>
61
-
62
- If a Finding's severity has been changed, reset it back to default value. Does nothing if no override exists.`).positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`reset-finding-severity <finding-id>`,describe:`Reset severity for a finding back to the default`,builder:Ae,handler:async c=>s({command:`data-security posture reset-finding-severity`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture reset-finding-severity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${c[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(c[`finding-id`]))}/reset_finding_severity`,pathParams:{"finding-id":String(c[`finding-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Creating`,async()=>s.dataSecurity.posture.resetFindingSeverity({account_id:l,finding_id:c[`finding-id`]})),{successLabel:`Created`})})};function Me(e){return e.usage(`$0 data-security posture unarchive-finding-instance <finding-id>
63
-
64
- Remove the archive marking from one or more finding instances.`).positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const Ne={command:`unarchive-finding-instance <finding-id>`,describe:`Remove the archive marking from a finding instance`,builder:Me,handler:async l=>s({command:`data-security posture unarchive-finding-instance`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf data-security posture unarchive-finding-instance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/instances/unarchive`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({check_instances:l[`check-instances`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.unarchiveFindingInstance({body:e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let f=u({check_instances:l[`check-instances`]});i(await o(`Creating`,async()=>s.dataSecurity.posture.unarchiveFindingInstance({body:f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})})};function Pe(e){return e.usage(`$0 data-security posture unignore-finding
65
-
66
- Ability to un-ignore a Finding if it's previously been ignored. Does nothing if the Finding is not ignored.`).option(`checks`,{type:`string`,array:!0,description:`A list of finding IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on findings.`})}const $={command:`unignore-finding`,describe:`Remove ignore marker from a finding`,builder:Pe,handler:async l=>s({command:`data-security posture unignore-finding`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf data-security posture unignore-finding`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/unignore`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({checks:l.checks}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.dataSecurity.posture.unignoreFinding({body:e,account_id:d})),{successLabel:`Created`});return}if(l.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let f=u({checks:l.checks});i(await o(`Creating`,async()=>s.dataSecurity.posture.unignoreFinding({body:f,account_id:d})),{successLabel:`Created`})})};function Fe(e){return e.usage(`$0 data-security posture webhooks delete <webhook-id>
67
-
68
- Soft deletes a webhook configuration by its unique identifier. The webhook will be marked as deleted and will no longer be available for use.`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,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 Ie={command:`delete <webhook-id>`,describe:`Delete a webhook configuration`,builder:Fe,handler:async c=>s({command:`data-security posture webhooks delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf data-security posture webhooks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${c[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(c[`webhook-id`]))}`,pathParams:{"webhook-id":String(c[`webhook-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await m({force:!!c.force})){process.stderr.write(`Aborted.
69
- `);return}i(await o(`Deleting`,async()=>s.dataSecurity.posture.webhooks.delete({account_id:l,webhook_id:c[`webhook-id`]})),{successLabel:`Deleted`})})};function Le(e){return e.usage(`$0 data-security posture webhooks update <webhook-id>
70
-
71
- Updates an existing webhook configuration with new settings.`).positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`headers`,{type:`string`,description:`List of custom headers to include in webhook requests. Provide as a JSON array of objects or @path/to/file.json.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`status`,{type:`string`,description:`Status of the webhook configuration.`,choices:[`enabled`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating an existing webhook configuration.`})}const Re={command:`update <webhook-id>`,describe:`Update an existing webhook configuration`,builder:Le,handler:async m=>s({command:`data-security posture webhooks update`,classification:{safeFlags:[`authentication-type`,`status`,`dry-run`]}},m,async()=>{if(m.dryRun){a({command:`cf data-security posture webhooks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${m[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(m[`webhook-id`]))}`,pathParams:{"webhook-id":String(m[`webhook-id`]??``)},bodyKind:`json`,body:m.body===void 0?u({authentication_type:d(m[`authentication-type`],`authentication-type`,`text`),destination_url:d(m[`destination-url`],`destination-url`,`text`),headers:l(m.headers,`headers`),label:d(m.label,`label`,`text`),signing_secret:d(m[`signing-secret`],`signing-secret`,`text`),status:d(m.status,`status`,`text`)}):c(m.body)});return}let s=await r(m),h=m.local?e:await t();if(m.accountId=h,m.body){let e=c(m.body);i(await o(`Updating`,async()=>s.dataSecurity.posture.webhooks.update({...e,account_id:h,webhook_id:m[`webhook-id`]})),{successLabel:`Updated`});return}m[`authentication-type`]===void 0&&(m[`authentication-type`]=await p(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),m[`destination-url`]===void 0&&(m[`destination-url`]=await f(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),m.label===void 0&&(m.label=await f(`label`,`Account-specified display label for the webhook configuration.`)),m.status===void 0&&(m.status=await p(`status`,`Status of the webhook configuration.`,[`enabled`,`disabled`]));let g=u({authentication_type:d(m[`authentication-type`],`authentication-type`,`text`),destination_url:d(m[`destination-url`],`destination-url`,`text`),headers:l(m.headers,`headers`),label:d(m.label,`label`,`text`),signing_secret:d(m[`signing-secret`],`signing-secret`,`text`),status:d(m.status,`status`,`text`)});i(await o(`Updating`,async()=>s.dataSecurity.posture.webhooks.update({...g,account_id:h,webhook_id:m[`webhook-id`]})),{successLabel:`Updated`})})},ze={command:`webhooks`,describe:`Operations for posture.webhooks`,builder:e=>e.command(Ie).command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Be={command:`posture`,describe:`Operations for posture`,builder:e=>e.command(ee).command(_).command(T).command(D).command(j).command(k).command(F).command(N).command(L).command(z).command(W).command(X).command(K).command(J).command(Q).command(re).command(ae).command(se).command(le).command(de).command(pe).command(he).command(je).command(Ne).command($).command(C).command(H).command(ke).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ve={command:`data-security`,describe:`data-security`,builder:e=>e.command(Be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ve as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./src-Hw-TlVAO.mjs";import{a as t}from"./theme-BiIYWOed.mjs";import"./ui-DH95w1Qk.mjs";import{a as n,i as r,n as i,r as a,t as o}from"./spawn-BWEuIO-w.mjs";import{t as s}from"./registry-vreNkX6u.mjs";const c={command:`dev [implArgs..]`,describe:`Run the project's Cloudflare dev server`,builder:e=>e.positional(`implArgs`,{type:`string`,array:!0,describe:`Arguments forwarded to the dev-server implementation`}).parserConfiguration({"unknown-options-as-args":!0,"camel-case-expansion":!1}).epilogue(`cf dev starts the appropriate development server for your project. It runs your framework's dev command when available, falling back to an installed Cloudflare dev server.
3
-
4
- Only ${t.brand(`--mode`)} is forwarded to supported framework development servers. Other arguments are forwarded only to Cloudflare dev-server implementations.`),handler:async t=>{let c=process.cwd(),l=await a(c);l&&!l.configured&&await r(l);let u=(t.implArgs??[]).map(String),d=t.mode?[`--mode`,t.mode]:[];if(l?.devCommand){if(u.length>0)throw Error(`Arguments cannot currently be forwarded to the detected dev command \`${l.devCommand}\`. Run that command directly with the required arguments.`);if(t.mode&&!l.framework?.supportsMode)throw Error(`The detected command \`${l.devCommand}\` does not currently support \`--mode\`.`);let r=await n(l.devCommand,c,{env:{...l.env,...s()},args:d});throw new e(r.exitCode,{signal:r.signal})}let f=await o(i(c),`dev`,[...d,...u]);throw new e(f.exitCode,{signal:f.signal})}};export{c as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./src-Hw-TlVAO.mjs";import{M as t,n}from"./interactive-B6woOLo-.mjs";import{i as r,o as i,t as a}from"./dist-BpadEMNY.mjs";async function o(r,i){if(n())return i.fallbackValue??!1;let o=await a({message:r,initialValue:i.defaultValue,output:i.output});if(t(o))throw new e(130,{cancelled:!0});return o}async function s(r,a={}){if(n()){if(a.fallbackValue===void 0)throw Error(a.fallbackError);return a.fallbackValue}for(;;){let n=await i({message:r,defaultValue:a.defaultValue,initialValue:a.initialValue,output:a.output});if(t(n))throw new e(130,{cancelled:!0});let o=await a.validate?.(n);if(o===void 0||o===!0)return n;console.error(o===!1?`Invalid value`:o)}}async function c(i,a){if(n()){let e=a.fallbackOption??a.defaultOption??0,t=a.choices[e]??a.choices[0];if(!t)throw Error(a.fallbackError??`select() called with no choices`);return t.value}let o=await r({message:i,options:a.choices.map(e=>({label:e.title,value:e.value,hint:e.description})),initialValue:a.choices[a.defaultOption??0]?.value,output:a.output});if(t(o))throw new e(130,{cancelled:!0});return o}export{s as n,c as r,o as t};