cf 0.10.0 → 0.11.0

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 (342) hide show
  1. package/README.md +15 -5
  2. package/dist/_meta/agent-context.json +12 -4
  3. package/dist/_meta/commands.json +2249 -262
  4. package/dist/_meta/hand-written-commands.json +784 -0
  5. package/dist/_meta/schemas.json +1882 -155
  6. package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-sDBTV0qZ.mjs} +2 -2
  7. package/dist/{access-lhLJo1v2.mjs → access-DcNzuCue.mjs} +1 -1
  8. package/dist/account-BX90zXn5.mjs +2 -0
  9. package/dist/{account-tags-B88TotoH.mjs → account-tags-Bz3JG5hI.mjs} +4 -4
  10. package/dist/{accounts-BSIAT_iP.mjs → accounts-DCuW3xyZ.mjs} +12 -12
  11. package/dist/{acm-VULm1djv.mjs → acm-zjfShZLS.mjs} +1 -1
  12. package/dist/{addressing-BHPBIkRY.mjs → addressing-DORQ64Ux.mjs} +11 -11
  13. package/dist/{agent-context-KBy48G1b.mjs → agent-context-BgPR_aQr.mjs} +1 -1
  14. package/dist/agent-memory-C0hAUMeC.mjs +6 -0
  15. package/dist/ai-BpEBGMT2.mjs +5 -0
  16. package/dist/ai-audit-DnU3vn3E.mjs +2 -0
  17. package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
  18. package/dist/ai-search-DKbN9Tyd.mjs +7 -0
  19. package/dist/ai-security-C_I5lo58.mjs +4 -0
  20. package/dist/{alerting-Bl8OqViR.mjs → alerting-4T8gmZs-.mjs} +1 -1
  21. package/dist/analytics-Bxh4TCP7.mjs +3 -0
  22. package/dist/analytics_engine-fV56bjVN.mjs +2 -0
  23. package/dist/{api-security-4FVrD4n8.mjs → api-security-COk_i184.mjs} +20 -20
  24. package/dist/argo-DIRfvxvv.mjs +2 -0
  25. package/dist/{artifacts-CVDGnr2V.mjs → artifacts-BBfXNfUg.mjs} +1 -1
  26. package/dist/audit-logs-BlOrlAWe.mjs +2 -0
  27. package/dist/{auth-MQEamPN9.mjs → auth-D3X9HYhD.mjs} +3 -3
  28. package/dist/auth-DPhNN3Ly.mjs +5 -0
  29. package/dist/billing-B9e4PnvN.mjs +3 -0
  30. package/dist/body-parser-BshbixEq.mjs +2 -0
  31. package/dist/bot-management-D2JVeS-V.mjs +5 -0
  32. package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
  33. package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
  34. package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
  35. package/dist/browser-run-CHGOCTdG.mjs +4 -0
  36. package/dist/build-D0FhOj40.mjs +8 -0
  37. package/dist/{cache-VyWK1SjY.mjs → cache-C6V7PbQM.mjs} +1 -1
  38. package/dist/{calls-BxoRYxs4.mjs → calls-Bye8Tyy-.mjs} +1 -1
  39. package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
  40. package/dist/cf-Ds4JFovl.mjs +18 -0
  41. package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
  42. package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
  43. package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
  44. package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
  45. package/dist/cloud-connector-CL1jPQud.mjs +2 -0
  46. package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
  47. package/dist/command-C9VP3xaA.mjs +2 -0
  48. package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
  49. package/dist/config.d.mts +1460 -1348
  50. package/dist/config.mjs +1 -1
  51. package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
  52. package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
  53. package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
  54. package/dist/{connectors-BqxYMMtQ.mjs → connectors-BQwyBJ4_.mjs} +1 -1
  55. package/dist/{containers-CKW081JA.mjs → containers-BrQtGiNp.mjs} +12 -8
  56. package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-DNzhXYkY.mjs} +1 -1
  57. package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
  58. package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
  59. package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
  60. package/dist/custom-csrs-bhClr2SU.mjs +3 -0
  61. package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-C0eiGvG9.mjs} +1 -1
  62. package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
  63. package/dist/custom-pages-DTINMR30.mjs +3 -0
  64. package/dist/d1-sKdExJYF.mjs +20 -0
  65. package/dist/data-security-mV3a6UfW.mjs +7 -0
  66. package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
  67. package/dist/delegate.mjs +1 -1
  68. package/dist/{deploy-CZ7bgNDu.mjs → deploy-BL59O1O1.mjs} +1 -1
  69. package/dist/deploy-input-Dz6q-__n.mjs +2 -0
  70. package/dist/{dev-V10MG-Bg.mjs → dev-BDaavgH1.mjs} +2 -2
  71. package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-CJV6qWUA.mjs} +1 -1
  72. package/dist/{directory-BlH6N6Qy.mjs → directory-B5zCMusW.mjs} +1 -1
  73. package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
  74. package/dist/dist-BHi7UhXO.mjs +72 -0
  75. package/dist/dist-BWpErtDM.mjs +384 -0
  76. package/dist/{dls-BF5iN78p.mjs → dls-t0hnIe_P.mjs} +1 -1
  77. package/dist/{dns-CeCTNqRk.mjs → dns-C8FC2hbh.mjs} +13 -13
  78. package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
  79. package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  80. package/dist/dry-run-DL2V6yFm.mjs +2 -0
  81. package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
  82. package/dist/email-auth-BmYrl0pO.mjs +2 -0
  83. package/dist/email-routing-CF3_Z957.mjs +6 -0
  84. package/dist/email-security-F7OYcMkZ.mjs +18 -0
  85. package/dist/email-sending-EyU3WvGQ.mjs +7 -0
  86. package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
  87. package/dist/{firewall-CBPGJ43p.mjs → firewall-8YWWy4iB.mjs} +9 -9
  88. package/dist/flagship-C4x0l-8J.mjs +4 -0
  89. package/dist/{fraud-BIhS8pLf.mjs → fraud-HR_SdUx3.mjs} +1 -1
  90. package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
  91. package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-4qOvjrTN.mjs} +1 -1
  92. package/dist/{hostnames-Bx0mykMR.mjs → hostnames-DehdYOMz.mjs} +1 -1
  93. package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
  94. package/dist/iam-DR72hmii.mjs +6 -0
  95. package/dist/images-CeKc5JPh.mjs +8 -0
  96. package/dist/index.mjs +1 -1
  97. package/dist/{intel-B-9Z_sJs.mjs → intel-DtFix9WL.mjs} +1 -1
  98. package/dist/{interactive-DtsCYfrK.mjs → interactive-C7M55Wxx.mjs} +1 -1
  99. package/dist/ips-CtWCjXAN.mjs +2 -0
  100. package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
  101. package/dist/keys-BmhG6Kn1.mjs +2 -0
  102. package/dist/{kv-BFDUCnft.mjs → kv-BuVPAuZP.mjs} +1 -1
  103. package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
  104. package/dist/load-balancers-CylN-l7n.mjs +6 -0
  105. package/dist/{local-D-aVNu6A.mjs → local-Be3lg_9E.mjs} +1 -1
  106. package/dist/{local-runtime-Dh3keC5v.mjs → local-runtime-Ce7k598H.mjs} +1 -1
  107. package/dist/logexplorer-CvRPoKbj.mjs +17 -0
  108. package/dist/logo-matches-Heuft3yF.mjs +2 -0
  109. package/dist/logos-DRYjGBDq.mjs +3 -0
  110. package/dist/{logpush-BK34mMQs.mjs → logpush-Dve9jOMp.mjs} +1 -1
  111. package/dist/{logs-CLAqX9h2.mjs → logs-SC86FE89.mjs} +1 -1
  112. package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
  113. package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
  114. package/dist/magic-transit-BK_3asH2.mjs +111 -0
  115. package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
  116. package/dist/matches-Iss9Fo4R.mjs +2 -0
  117. package/dist/mcp-8wxXT6JU.mjs +4 -0
  118. package/dist/mesh-Bf9UAS4J.mjs +4 -0
  119. package/dist/{moq-qmuVPAO0.mjs → moq-ZKMFOeVz.mjs} +1 -1
  120. package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
  121. package/dist/{network-D74cSy3t.mjs → network-B1lBARU9.mjs} +1 -1
  122. package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
  123. package/dist/oauth-DuEONNgC.mjs +14 -0
  124. package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
  125. package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
  126. package/dist/observability-Jya7-zkl.mjs +4 -0
  127. package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
  128. package/dist/{organization-NX7yCZrq.mjs → organization-CYxYV4e0.mjs} +6 -6
  129. package/dist/organizations-SacGUW44.mjs +2 -0
  130. package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
  131. package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
  132. package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
  133. package/dist/{output-DrpYYfnB.mjs → output-Ccqw2WOb.mjs} +1 -1
  134. package/dist/page-rules-BqEyFR2c.mjs +27 -0
  135. package/dist/pages-CQ7ZVWk1.mjs +14 -0
  136. package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
  137. package/dist/pipelines-6De2Pe2C.mjs +6 -0
  138. package/dist/precursor-iwK-1P_d.mjs +4 -0
  139. package/dist/progress-BqQcF5QH.mjs +2 -0
  140. package/dist/project-settings-C_1-JI6Y.mjs +3 -0
  141. package/dist/prompt-B0sWIs9c.mjs +3 -0
  142. package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
  143. package/dist/queries-c7zvnfEQ.mjs +3 -0
  144. package/dist/queues-BU6y16qS.mjs +6 -0
  145. package/dist/r2-Jo3QMahK.mjs +24 -0
  146. package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
  147. package/dist/radar-DIYAMEof.mjs +2 -0
  148. package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-DewOcznT.mjs} +1 -1
  149. package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
  150. package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-cnZEVNDn.mjs} +1 -1
  151. package/dist/registrar-BsWr_aPM.mjs +23 -0
  152. package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-BlcpUyIH.mjs} +4 -4
  153. package/dist/{registry-Bck_zFkz.mjs → registry-jifR3_Y6.mjs} +1 -1
  154. package/dist/reporting--1AyTV7k.mjs +2 -0
  155. package/dist/request-tracers-C_VX7X6-.mjs +2 -0
  156. package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
  157. package/dist/resource-tagging-C33U6T74.mjs +2 -0
  158. package/dist/rules-BfjzALMi.mjs +4 -0
  159. package/dist/rulesets-3i_1Vwt-.mjs +5 -0
  160. package/dist/rum-CjmIckiR.mjs +4 -0
  161. package/dist/{schema-B34Q9tLF.mjs → schema-1mwmslUV.mjs} +1 -1
  162. package/dist/schema-flags-llLJuFFw.mjs +5 -0
  163. package/dist/{scim-CcSyfKCH.mjs → scim-pApmzA5B.mjs} +1 -1
  164. package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-DBC9WJau.mjs} +1 -1
  165. package/dist/security-center-Djm06dq-.mjs +2 -0
  166. package/dist/{security-txt-DqnFpjMI.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
  167. package/dist/{share-BuwYUzOL.mjs → share-Dj-MNXrw.mjs} +4 -4
  168. package/dist/shared-BJvq4DkR.mjs +290 -0
  169. package/dist/smart-shield--8EpJjrF.mjs +4 -0
  170. package/dist/snippets-Dyz0PH60.mjs +4 -0
  171. package/dist/{spawn-O1RS01vr.mjs → spawn-C5Z7oWdp.mjs} +108 -112
  172. package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-rAHWz8rH.mjs} +1 -1
  173. package/dist/{speed-cw31yFva.mjs → speed-BKepWBXj.mjs} +1 -1
  174. package/dist/src-gJma71Ec.mjs +108 -0
  175. package/dist/{ssl-CsEhRVTO.mjs → ssl-KdFiY3ev.mjs} +1 -1
  176. package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
  177. package/dist/{state-Bb5Cbc_L.mjs → state-Cu3cItUg.mjs} +1 -1
  178. package/dist/{stream-DFOao6Gu.mjs → stream-CKJ6Tb0M.mjs} +13 -13
  179. package/dist/submit-BxbKKhBn.mjs +2 -0
  180. package/dist/tags-DA8dq9fx.mjs +2 -0
  181. package/dist/tenant-DLXw48hS.mjs +2 -0
  182. package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
  183. package/dist/{tools-BHfBOZOU.mjs → tools-x8bj9E6b.mjs} +1 -1
  184. package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CNQA5Flp.mjs} +1 -1
  185. package/dist/tunnels-CC10EOsU.mjs +2 -0
  186. package/dist/turnstile-CH58hnf4.mjs +23 -0
  187. package/dist/{ui-DE8CNn6c.mjs → ui-CmnnBm_O.mjs} +1 -1
  188. package/dist/url-info-BpCgdUtL.mjs +2 -0
  189. package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BzuynEy1.mjs} +1 -1
  190. package/dist/url-scanner-APIZbhB7.mjs +2 -0
  191. package/dist/user-2-NGebfI.mjs +12 -0
  192. package/dist/values-S_bNv819.mjs +2 -0
  193. package/dist/{vectorize-CVKu7lEt.mjs → vectorize-Bv7feLBC.mjs} +1 -1
  194. package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
  195. package/dist/{web-assets-C2s9kzWf.mjs → web-assets-C1UmOyzD.mjs} +1 -1
  196. package/dist/web3-GnUocVYH.mjs +4 -0
  197. package/dist/workers-J1-PLwdl.mjs +28 -0
  198. package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-DCHmWOMS.mjs} +1 -1
  199. package/dist/{workflows-B-kGHxFu.mjs → workflows-CArfEI2c.mjs} +1 -1
  200. package/dist/zaraz-mg2YlR3_.mjs +2 -0
  201. package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DVdUPtj1.mjs} +67 -66
  202. package/dist/zone-DMAfrDJX.mjs +2 -0
  203. package/dist/zones-CNwxUi7I.mjs +21 -0
  204. package/package.json +10 -7
  205. package/dist/account-CYRm3yoN.mjs +0 -2
  206. package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
  207. package/dist/ai-audit-BWZGvbca.mjs +0 -2
  208. package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
  209. package/dist/ai-search-BmdskMjR.mjs +0 -7
  210. package/dist/ai-security-CsmfcaUx.mjs +0 -4
  211. package/dist/ai-viHB1tgI.mjs +0 -5
  212. package/dist/analytics-vOxw8Hy0.mjs +0 -3
  213. package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
  214. package/dist/argo-CQfCgazW.mjs +0 -2
  215. package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
  216. package/dist/auth-D0xZxAEa.mjs +0 -5
  217. package/dist/billing-aJgapeRm.mjs +0 -3
  218. package/dist/body-parser-C-c9gfH1.mjs +0 -2
  219. package/dist/bot-management-Y2q5d-pi.mjs +0 -5
  220. package/dist/botnet-feed-DANJqfmE.mjs +0 -3
  221. package/dist/brand-protection-CjpZWBjp.mjs +0 -3
  222. package/dist/browser-run-BFn9h2Tz.mjs +0 -4
  223. package/dist/build-DcflwvqN.mjs +0 -2
  224. package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
  225. package/dist/cf-C7DU4819.mjs +0 -18
  226. package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
  227. package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
  228. package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
  229. package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
  230. package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
  231. package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
  232. package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
  233. package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
  234. package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
  235. package/dist/custom-pages-M7jA2Hit.mjs +0 -3
  236. package/dist/d1-BFvMd6-S.mjs +0 -20
  237. package/dist/data-security-Bji4Or_j.mjs +0 -7
  238. package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
  239. package/dist/deploy-input-CrvuoDGJ.mjs +0 -242
  240. package/dist/dist-CgrMkXFx.mjs +0 -72
  241. package/dist/durable-objects-D8FQORrL.mjs +0 -2
  242. package/dist/email-auth-DJK0Eb30.mjs +0 -2
  243. package/dist/email-routing-NpmiKIrl.mjs +0 -6
  244. package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
  245. package/dist/email-sending-dn-353Nx.mjs +0 -7
  246. package/dist/fieldExtractors-ahysj57J.mjs +0 -3
  247. package/dist/flagship-BusjRNIb.mjs +0 -4
  248. package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
  249. package/dist/iam-Cj63Kjc6.mjs +0 -6
  250. package/dist/images-CBWXCDhy.mjs +0 -8
  251. package/dist/ips-qs9eGJnI.mjs +0 -2
  252. package/dist/keys-D7N0j4-x.mjs +0 -2
  253. package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
  254. package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
  255. package/dist/logo-matches-CJcthPHf.mjs +0 -2
  256. package/dist/logos-BS65zN8q.mjs +0 -3
  257. package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
  258. package/dist/magic-transit-BtsFePMx.mjs +0 -111
  259. package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
  260. package/dist/matches-InA1hwII.mjs +0 -2
  261. package/dist/mcp-mJ7bekNJ.mjs +0 -4
  262. package/dist/mesh-BK4S1Ezy.mjs +0 -4
  263. package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
  264. package/dist/oauth-B0ETkNcX.mjs +0 -15
  265. package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
  266. package/dist/observability-BWE0Gg3V.mjs +0 -4
  267. package/dist/organizations-DLhiRt8g.mjs +0 -2
  268. package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
  269. package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
  270. package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
  271. package/dist/page-rules-BSz1gO-_.mjs +0 -18
  272. package/dist/pages-DVDogxPs.mjs +0 -14
  273. package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
  274. package/dist/pipelines-BszRk4sM.mjs +0 -6
  275. package/dist/precursor-BPNjQr76.mjs +0 -4
  276. package/dist/progress-CsHIt3Tp.mjs +0 -2
  277. package/dist/prompt-DdegNPpg.mjs +0 -3
  278. package/dist/queries-JL1H1Biz.mjs +0 -3
  279. package/dist/queues-DpkYdRUE.mjs +0 -6
  280. package/dist/r2-CKozthw_.mjs +0 -24
  281. package/dist/radar-C-92vggG.mjs +0 -2
  282. package/dist/raw-fetch-CteyTOM2.mjs +0 -2
  283. package/dist/registrar-DKKN0M29.mjs +0 -21
  284. package/dist/reporting-fg_GKXe1.mjs +0 -2
  285. package/dist/request-tracers-CkMya96z.mjs +0 -2
  286. package/dist/resource-tagging-z48JGHCq.mjs +0 -2
  287. package/dist/rules-BTmNjDN-.mjs +0 -4
  288. package/dist/rulesets-CsoSM-17.mjs +0 -5
  289. package/dist/rum-DB4iO2q5.mjs +0 -4
  290. package/dist/schema-flags-iGoOriJt.mjs +0 -5
  291. package/dist/security-center-DFKeHq5c.mjs +0 -2
  292. package/dist/session-D6KHthHf.mjs +0 -2
  293. package/dist/shared-VppSAQf4.mjs +0 -2
  294. package/dist/smart-shield-D6X8L7p8.mjs +0 -4
  295. package/dist/snippets-DIpc9pb_.mjs +0 -4
  296. package/dist/src-D_HETJNy.mjs +0 -108
  297. package/dist/submit--xTzyNPy.mjs +0 -2
  298. package/dist/tags-efICDkah.mjs +0 -2
  299. package/dist/tenant-CerHuToJ.mjs +0 -2
  300. package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
  301. package/dist/triggers-BEsiiKAf.mjs +0 -2
  302. package/dist/tunnels-D0J8lJoI.mjs +0 -2
  303. package/dist/turnstile-CFmtY5bn.mjs +0 -23
  304. package/dist/url-info-DBCeRWwb.mjs +0 -2
  305. package/dist/url-scanner-CNyvg65L.mjs +0 -2
  306. package/dist/user-bifVEQq5.mjs +0 -12
  307. package/dist/values-OxkdP1tV.mjs +0 -2
  308. package/dist/versions-BVL-Ludh.mjs +0 -2
  309. package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
  310. package/dist/web3-y_cY91V_.mjs +0 -4
  311. package/dist/workers-jDcq14GH.mjs +0 -24
  312. package/dist/zaraz-27zwjLvv.mjs +0 -2
  313. package/dist/zone-BJix2KQ9.mjs +0 -2
  314. package/dist/zones-Bkj5i92c.mjs +0 -21
  315. /package/dist/{alerts-CRmjqOZi.mjs → alerts-15-IW4jE.mjs} +0 -0
  316. /package/dist/{autorag-BD7cu5NU.mjs → autorag-CFwRkEKw.mjs} +0 -0
  317. /package/dist/{brands-BhALBkX2.mjs → brands-BgT1vu9B.mjs} +0 -0
  318. /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  319. /package/dist/{clear-BgF8No7D.mjs → clear-BlCK85Me.mjs} +0 -0
  320. /package/dist/{cli-types-BsTty22w.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
  321. /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-BbpcII3_.mjs} +0 -0
  322. /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-DuCiimXl.mjs} +0 -0
  323. /package/dist/{domain-info-C50W5GhA.mjs → domain-info-C7LBxPBt.mjs} +0 -0
  324. /package/dist/{health-BFNZqiAm.mjs → health-DZFfafkX.mjs} +0 -0
  325. /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
  326. /package/dist/{internal-BTeSewwB.mjs → internal-BKHC2D1Y.mjs} +0 -0
  327. /package/dist/{live-Dkiyu30_.mjs → live-DwCvDmaH.mjs} +0 -0
  328. /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
  329. /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
  330. /package/dist/{ready-TKOkKeRg.mjs → ready-D9H2zHHI.mjs} +0 -0
  331. /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
  332. /package/dist/{refute-BVz9nMyd.mjs → refute-2W8NLCN4.mjs} +0 -0
  333. /package/dist/{resolve-CeBbH6Pq.mjs → resolve-B8CyM1mi.mjs} +0 -0
  334. /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
  335. /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-CWhta3x7.mjs} +0 -0
  336. /package/dist/{search-DGNc37HK.mjs → search-DZmBQJL9.mjs} +0 -0
  337. /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-CQrmWgz5.mjs} +0 -0
  338. /package/dist/{submission-info-FjUolE6A.mjs → submission-info-C98A0bqq.mjs} +0 -0
  339. /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
  340. /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-BZoaFoDE.mjs} +0 -0
  341. /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
  342. /package/dist/{verify-DS1PWAJe.mjs → verify-4e4L9IRk.mjs} +0 -0
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";function l(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`reboot-purge`,{type:`boolean`,description:`Purge connector state.`}).option(`restart-purge`,{type:`boolean`,description:`Purge connector state.`}).option(`shutdown-purge`,{type:`boolean`,description:`Purge connector state.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Interrupt action for a connector.`})}const u={command:`create <connector-id>`,describe:`Creates an interrupt for a Magic WAN Connector.`,builder:l,handler:async l=>{if(l.dryRun){a({command:`cf connector-interrupts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${l[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(l[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(l[`connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.connectorInterrupts.create({...e,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`});return}let f=c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}});i(await o(`Creating`,async()=>u.connectorInterrupts.create({...f,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`})}};function d(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Lists interrupts for a Magic WAN Connector.`,builder:d,handler:async s=>{if(s.dryRun){a({command:`cf connector-interrupts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.connectorInterrupts.list({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},p={command:`connector-interrupts`,describe:`connector-interrupts`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";function s(e){return e.positional(`event-n`,{type:`string`,description:`Event n`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`event-t`,{type:`string`,description:`Event t`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get <event-n>`,describe:`Gets Magic WAN Connector Telemetry Event`,builder:s,handler:async s=>{if(s.dryRun){a({command:`cf connector-telemetry-events get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events/${s[`event-t`]==null?`<event-t>`:encodeURIComponent(String(s[`event-t`]))}.${s[`event-n`]==null?`<event-n>`:encodeURIComponent(String(s[`event-n`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"event-t":String(s[`event-t`]??``),"event-n":String(s[`event-n`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.connectorTelemetryEvents.get({account_id:l,connector_id:s[`connector-id`],event_t:s[`event-t`],event_n:s[`event-n`]})),{successLabel:`Loaded`})}};function l(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`k`,{type:`string`,description:`Filter by event kind`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Lists Magic WAN Connector Telemetry Events`,builder:l,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor,k:s.k};if(s.dryRun){a({command:`cf connector-telemetry-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.connectorTelemetryEvents.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},d={command:`connector-telemetry-events`,describe:`connector-telemetry-events`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";function s(e){return e.positional(`snapshot-t`,{type:`string`,description:`Snapshot t`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get <snapshot-t>`,describe:`Gets Magic WAN Connector Telemetry Snapshot`,builder:s,handler:async s=>{if(s.dryRun){a({command:`cf connector-telemetry-snapshots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots/${s[`snapshot-t`]==null?`<snapshot-t>`:encodeURIComponent(String(s[`snapshot-t`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"snapshot-t":String(s[`snapshot-t`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.connectorTelemetrySnapshots.get({account_id:l,connector_id:s[`connector-id`],snapshot_t:s[`snapshot-t`]})),{successLabel:`Loaded`})}};function l(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Lists Magic WAN Connector Telemetry Snapshots`,builder:l,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor};if(s.dryRun){a({command:`cf connector-telemetry-snapshots list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots`,pathParams:{"connector-id":String(s[`connector-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.connectorTelemetrySnapshots.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},d={command:`connector-telemetry-snapshots`,describe:`connector-telemetry-snapshots`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{h as e}from"./oauth-B0ETkNcX.mjs";import{a as t,r as n}from"./auth-MQEamPN9.mjs";import{t as r}from"./output-DrpYYfnB.mjs";import{n as i,t as a}from"./progress-CsHIt3Tp.mjs";import{n as o,t as s}from"./body-parser-C-c9gfH1.mjs";import{n as c}from"./input-validation-Bav2M9F-.mjs";import{a as l,n as u}from"./prompt-DdegNPpg.mjs";import{t as d}from"./cli-types-BsTty22w.mjs";function f(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`],default:`production`}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
3
- Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`type`,{type:`string`,description:`The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.`,choices:[`legacy_custom`,`sni_custom`],default:`legacy_custom`}).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:`Upload a new SSL certificate for a zone.`,builder:f,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`),type:c(t.type,`type`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.customCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let f=s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`),type:c(t.type,`type`,`text`)});r(await a(`Creating`,async()=>u.customCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function m(e){return e.positional(`custom-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 <custom-certificate-id>`,describe:`Remove a SSL certificate from a zone.`,builder:m,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}r(await a(`Deleting`,async()=>o.customCertificates.delete({zone_id:s,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`]}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`]}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
5
- Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).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 <custom-certificate-id>`,describe:`Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing a configuration for sni_custom certificates will result in a new resource id being returned, and the previous one being deleted.`,builder:g,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let l=await n(t),u=await e({zone:t.zone},l,{quiet:t.quiet});if(t.zoneId=u,t.body){let e=o(t.body);r(await a(`Updating`,async()=>l.customCertificates.edit({...e,zone_id:u,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Updated`});return}let d=s({bundle_method:c(t[`bundle-method`],`bundle-method`,`text`),certificate:c(t.certificate,`certificate`,`text`),custom_csr_id:c(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(t.deploy,`deploy`,`text`),geo_restrictions:{label:c(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(t.policy,`policy`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Updating`,async()=>l.customCertificates.edit({...d,zone_id:u,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`custom-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 <custom-certificate-id>`,describe:`Retrieves details for a specific custom SSL certificate, including certificate metadata, bundle method, geographic restrictions, and associated keyless server configuration.`,builder:v,handler:async t=>{if(t.dryRun){i({command:`cf custom-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates/${t[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(t[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(t[`custom-certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.customCertificates.get({zone_id:s,custom_certificate_id:t[`custom-certificate-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`Status of the zone's custom SSL.`,choices:[`active`,`expired`,`deleted`,`pending`,`initializing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List, search, and filter all of your custom SSL certificates. The higher priority will break ties across overlapping 'legacy_custom' certificates, but 'legacy_custom' certificates will always supercede 'sni_custom' certificates.`,builder:d(b),handler:async t=>{let o={page:t.page,per_page:t[`per-page`],match:t.match,status:t.status};if(t.dryRun){i({command:`cf custom-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.customCertificates.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update`,describe:`If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across overlapping 'legacy_custom' certificates.`,builder:S,handler:async s=>{if(s.dryRun){i({command:`cf custom-certificates prioritize update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/custom_certificates/prioritize`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Updating`,async()=>c.customCertificates.prioritize.update({...e,zone_id:l})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(c,`PUT`,`/zones/${s.zoneId}/custom_certificates/prioritize`)),{successLabel:`Updated`})}},w={command:`prioritize`,describe:`Operations for prioritize`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`custom-certificates`,describe:`custom-certificates`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u}from"./input-validation-Bav2M9F-.mjs";import{a as d,n as f}from"./prompt-DdegNPpg.mjs";import{t as p}from"./cli-types-BsTty22w.mjs";function m(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`description`,{type:`string`,description:`Optional description for the CSR.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`name`,{type:`string`,description:`Human-readable name for the CSR.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required.`}).option(`state`,{type:`string`,description:`State or province name.`}).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 custom CSR.`})}const h={command:`create`,describe:`Generate a new custom Certificate Signing Request (CSR) for an account or zone. Cloudflare generates and securely stores the private key associated with the CSR.`,builder:m,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-csrs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_csrs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({common_name:u(f[`common-name`],`common-name`,`text`),country:u(f.country,`country`,`text`),description:u(f.description,`description`,`text`),key_type:u(f[`key-type`],`key-type`,`text`),locality:u(f.locality,`locality`,`text`),name:u(f.name,`name`,`text`),organization:u(f.organization,`organization`,`text`),organizational_unit:u(f[`organizational-unit`],`organizational-unit`,`text`),sans:f.sans,state:u(f.state,`state`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.customCsrs.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}if(f[`common-name`]===void 0&&(f[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),f.country===void 0&&(f.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),f.locality===void 0&&(f.locality=await d(`locality`,`City or locality name.`)),f.organization===void 0&&(f.organization=await d(`organization`,`Organization name.`)),f.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);f.state===void 0&&(f.state=await d(`state`,`State or province name.`));let g=l({common_name:u(f[`common-name`],`common-name`,`text`),country:u(f.country,`country`,`text`),description:u(f.description,`description`,`text`),key_type:u(f[`key-type`],`key-type`,`text`),locality:u(f.locality,`locality`,`text`),name:u(f.name,`name`,`text`),organization:u(f.organization,`organization`,`text`),organizational_unit:u(f[`organizational-unit`],`organizational-unit`,`text`),sans:f.sans,state:u(f.state,`state`,`text`)});a(await s(`Creating`,async()=>p.customCsrs.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function g(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const _={command:`delete <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key.`,builder:g,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-csrs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_csrs/${c[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(c[`custom-csr-id`]))}`,pathParams:{"account-or-zone":String(t),"custom-csr-id":String(c[`custom-csr-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();if(u===`zones`?c.zoneId=d:c.accountId=d,!await f({force:!!c.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>l.customCsrs.delete({account_or_zone:u,account_or_zone_id:d,custom_csr_id:c[`custom-csr-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:v,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-csrs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_csrs/${c[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(c[`custom-csr-id`]))}`,pathParams:{"account-or-zone":String(t),"custom-csr-id":String(c[`custom-csr-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customCsrs.get({account_or_zone:u,account_or_zone_id:d,custom_csr_id:c[`custom-csr-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`order`,{type:`string`,description:`The field to sort the returned custom CSRs by.`,choices:[`name`,`account_tag`,`created_at`]}).option(`direction`,{type:`string`,description:`The direction to sort by.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List all custom Certificate Signing Requests (CSRs) for an account or zone.`,builder:p(b),handler:async c=>{let l={page:c.page,per_page:c[`per-page`],order:c.order,direction:c.direction};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-csrs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_csrs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.customCsrs.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}},S={command:`custom-csrs`,describe:`custom-csrs`,builder:e=>e.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{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u}from"./input-validation-Bav2M9F-.mjs";import{a as d,n as f}from"./prompt-DdegNPpg.mjs";function p(e){return e.option(`ns-name`,{type:`string`,description:`The FQDN of the name server.`}).option(`ns-set`,{type:`number`,description:`The number of the set that this name server belongs to.`,default:1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Adds a custom nameserver to the account or zone for use as a vanity nameserver on zones.`,builder:p,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_ns`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({ns_name:u(f[`ns-name`],`ns-name`,`text`),ns_set:f[`ns-set`]}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.customNameservers.create({body:e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f[`ns-name`]===void 0&&(f[`ns-name`]=await d(`ns-name`,`The FQDN of the name server.`));let g=l({ns_name:u(f[`ns-name`],`ns-name`,`text`),ns_set:f[`ns-set`]});a(await s(`Creating`,async()=>p.customNameservers.create({body:g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function h(e){return e.positional(`custom-ns-id`,{type:`string`,description:`The FQDN of the name server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <custom-ns-id>`,describe:`Removes a custom nameserver from the account.`,builder:h,handler:async r=>{if(r.dryRun){o({command:`cf custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_ns/${r[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(r[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(r[`custom-ns-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>c.customNameservers.delete({account_id:l,custom_ns_id:r[`custom-ns-id`]})),{successLabel:`Deleted`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`List an account or zone's custom nameservers.`,builder:_,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_ns`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customNameservers.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}},y={command:`custom-nameservers`,describe:`custom-nameservers`,builder:e=>e.command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u}from"./input-validation-Bav2M9F-.mjs";import{a as d,i as f,n as p}from"./prompt-DdegNPpg.mjs";function m(e){return e.option(`act`,{type:`string`,description:`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`}).option(`target`,{type:`string`,description:`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`}).option(`url`,{type:`string`,description:`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Creates a signed JWT token used to preview custom pages before they are published.`,builder:m,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-pages account-custom-pages preview-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/preview_tokens`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({act:u(f.act,`act`,`text`),target:u(f.target,`target`,`text`),url:u(f.url,`url`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.customPages.accountCustomPages.previewTokens.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f.act===void 0&&(f.act=await d(`act`,`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`)),f.target===void 0&&(f.target=await d(`target`,`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`)),f.url===void 0&&(f.url=await d(`url`,`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`));let g=l({act:u(f.act,`act`,`text`),target:u(f.target,`target`,`text`),url:u(f.url,`url`,`text`)});a(await s(`Creating`,async()=>p.customPages.accountCustomPages.previewTokens.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}},g={command:`preview-tokens`,describe:`Account preview tokens operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).option(`url`,{type:`string`,description:`The URL associated with the custom page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:_,handler:async p=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/${p.identifier==null?`<identifier>`:encodeURIComponent(String(p.identifier))}`,pathParams:{"account-or-zone":String(t),identifier:String(p.identifier??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?l({state:u(p.state,`state`,`text`),url:u(p.url,`url`,`text`)}):c(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await t();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=c(p.body);a(await s(`Updating`,async()=>m.customPages.accountCustomPages.update({...e,account_or_zone:h,account_or_zone_id:g,identifier:p.identifier})),{successLabel:`Updated`});return}p.state===void 0&&(p.state=await f(`state`,`The custom page state.`,[`default`,`customized`])),p.url===void 0&&(p.url=await d(`url`,`The URL associated with the custom page.`));let _=l({state:u(p.state,`state`,`text`),url:u(p.url,`url`,`text`)});a(await s(`Updating`,async()=>m.customPages.accountCustomPages.update({..._,account_or_zone:h,account_or_zone_id:g,identifier:p.identifier})),{successLabel:`Updated`})}},y={command:`account-custom-pages`,describe:`Account-scoped custom page operations`,builder:e=>e.command(v).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).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 x={command:`asset`,describe:`Creates a new custom asset.`,builder:b,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-pages assets create custom asset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({description:u(f.description,`description`,`text`),name:u(f.name,`name`,`text`),url:u(f.url,`url`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.customPages.assets.create.custom.asset({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f.description===void 0&&(f.description=await d(`description`,`A short description of the custom asset.`)),f.name===void 0&&(f.name=await d(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),f.url===void 0&&(f.url=await d(`url`,`The URL where the asset content is fetched from.`));let g=l({description:u(f.description,`description`,`text`),name:u(f.name,`name`,`text`),url:u(f.url,`url`,`text`)});a(await s(`Creating`,async()=>p.customPages.assets.create.custom.asset({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}},S={command:`custom`,describe:`Operations for assets.create.custom`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`create`,describe:`Operations for assets.create`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,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 T={command:`asset <asset-name>`,describe:`Deletes an existing custom asset.`,builder:w,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages assets delete custom asset`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets/${c[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(c[`asset-name`]))}`,pathParams:{"account-or-zone":String(t),"asset-name":String(c[`asset-name`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();if(u===`zones`?c.zoneId=d:c.accountId=d,!await p({force:!!c.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>l.customPages.assets.delete.custom.asset({account_or_zone:u,account_or_zone_id:d,asset_name:c[`asset-name`]})),{successLabel:`Deleted`})}},E={command:`custom`,describe:`Operations for assets.delete.custom`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`delete`,describe:`Operations for assets.delete`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`asset <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:O,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages assets get custom asset`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets/${c[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(c[`asset-name`]))}`,pathParams:{"account-or-zone":String(t),"asset-name":String(c[`asset-name`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customPages.assets.get.custom.asset({account_or_zone:u,account_or_zone_id:d,asset_name:c[`asset-name`]})),{successLabel:`Loaded`})}},A={command:`custom`,describe:`Operations for assets.get.custom`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`get`,describe:`Operations for assets.get`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`assets`,describe:`Fetches all the custom assets.`,builder:M,handler:async c=>{let l={page:c.page,per_page:c[`per-page`]};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages assets list custom assets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.customPages.assets.list.custom.assets({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}},P={command:`custom`,describe:`Operations for assets.list.custom`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`list`,describe:`Operations for assets.list`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`asset <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:I,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-pages assets update custom asset`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets/${f[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(f[`asset-name`]))}`,pathParams:{"account-or-zone":String(t),"asset-name":String(f[`asset-name`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({description:u(f.description,`description`,`text`),url:u(f.url,`url`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Updating`,async()=>p.customPages.assets.update.custom.asset({...e,account_or_zone:m,account_or_zone_id:h,asset_name:f[`asset-name`]})),{successLabel:`Updated`});return}f.description===void 0&&(f.description=await d(`description`,`A short description of the custom asset.`)),f.url===void 0&&(f.url=await d(`url`,`The URL where the asset content is fetched from.`));let g=l({description:u(f.description,`description`,`text`),url:u(f.url,`url`,`text`)});a(await s(`Updating`,async()=>p.customPages.assets.update.custom.asset({...g,account_or_zone:m,account_or_zone_id:h,asset_name:f[`asset-name`]})),{successLabel:`Updated`})}},R={command:`custom`,describe:`Operations for assets.update.custom`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`update`,describe:`Operations for assets.update`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`assets`,describe:`Assets operations`,builder:e=>e.command(C).command(D).command(j).command(F).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:V,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/${c.identifier==null?`<identifier>`:encodeURIComponent(String(c.identifier))}`,pathParams:{"account-or-zone":String(t),identifier:String(c.identifier??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customPages.get({account_or_zone:u,account_or_zone_id:d,identifier:c.identifier})),{successLabel:`Loaded`})}};function U(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`Fetches all the custom pages.`,builder:U,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customPages.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}},G={command:`custom-pages`,describe:`Custom error and challenge pages (1000s, WAF blocks, captchas) for zones and accounts`,builder:e=>e.command(H).command(W).command(y).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{G as default};
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{t as r}from"./resolve-CeBbH6Pq.mjs";import{r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u}from"./input-validation-Bav2M9F-.mjs";import{a as d,i as f,n as p,t as m}from"./prompt-DdegNPpg.mjs";import{t as h}from"./cli-types-BsTty22w.mjs";import g from"node:fs";import _ from"node:path";const v=(e,t,n)=>{let r=e instanceof RegExp?y(e,n):e,i=t instanceof RegExp?y(t,n):t,a=r!==null&&i!=null&&ee(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)}},y=(e,t)=>{let n=t.match(e);return n?n[0]:null},ee=(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},te=`\0SLASH`+Math.random()+`\0`,ne=`\0OPEN`+Math.random()+`\0`,b=`\0CLOSE`+Math.random()+`\0`,x=`\0COMMA`+Math.random()+`\0`,S=`\0PERIOD`+Math.random()+`\0`,re=new RegExp(te,`g`),ie=new RegExp(ne,`g`),ae=new RegExp(b,`g`),oe=new RegExp(x,`g`),se=new RegExp(S,`g`),ce=/\\\\/g,le=/\\{/g,ue=/\\}/g,de=/\\,/g,fe=/\\\./g;function C(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function pe(e){return e.replace(ce,te).replace(le,ne).replace(ue,b).replace(de,x).replace(fe,S)}function me(e){return e.replace(re,`\\`).replace(ie,`{`).replace(ae,`}`).replace(oe,`,`).replace(se,`.`)}function he(e){if(!e)return[``];let t=[],n=v(`{`,`}`,e);if(!n)return e.split(`,`);let{pre:r,body:i,post:a}=n,o=r.split(`,`);o[o.length-1]+=`{`+i+`}`;let s=he(a);return a.length&&(o[o.length-1]+=s.shift(),o.push.apply(o,s)),t.push.apply(t,o),t}function ge(e,t={}){if(!e)return[];let{max:n=1e5}=t;return e.slice(0,2)===`{}`&&(e=`\\{\\}`+e.slice(2)),w(pe(e),n,!0).map(me)}function _e(e){return`{`+e+`}`}function ve(e){return/^-?0\d/.test(e)}function ye(e,t){return e<=t}function be(e,t){return e>=t}function w(e,t,n){let r=[],i=v(`{`,`}`,e);if(!i)return[e];let a=i.pre,o=i.post.length?w(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+b+i.post,w(e,t,!0)):[e];let d;if(l)d=i.body.split(/\.\./);else if(d=he(i.body),d.length===1&&d[0]!==void 0&&(d=w(d[0],t,!1).map(_e),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=C(d[0]),n=C(d[1]),r=Math.max(d[0].length,d[1].length),i=d.length===3&&d[2]!==void 0?Math.max(Math.abs(C(d[2])),1):1,a=ye;n<e&&(i*=-1,a=be);let o=d.some(ve);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,w(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 T=e=>{if(typeof e!=`string`)throw TypeError(`invalid pattern`);if(e.length>65536)throw TypeError(`pattern is too long`)},xe={"[: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]},E=e=>e.replace(/[[\]\\-]/g,`\\$&`),Se=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),D=e=>e.join(``),Ce=(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(xe))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(E(d)+`-`+E(t)):t===d&&r.push(E(t)),d=``,a++;continue}if(e.startsWith(`-]`,a+1)){r.push(E(t+`-`)),a+=2;continue}if(e.startsWith(`-`,a+1)){d=t,a+=2;continue}r.push(E(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[Se(r[0].length===2?r[0].slice(-1):r[0]),!1,u-n,!1];let f=`[`+(l?`^`:``)+D(r)+`]`,p=`[`+(l?``:`^`)+D(i)+`]`;return[r.length&&i.length?`(`+f+`|`+p+`)`:r.length?f:p,s,u-n,!0]},O=(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 k;const we=new Set([`!`,`?`,`+`,`*`,`@`]),A=e=>we.has(e),j=e=>A(e.type),Te=new Map([[`!`,[`@`]],[`?`,[`?`,`@`]],[`@`,[`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`]]]),Ee=new Map([[`!`,[`?`]],[`@`,[`?`]],[`+`,[`?`,`*`]]]),De=new Map([[`!`,[`?`,`@`]],[`?`,[`?`,`@`]],[`@`,[`?`,`@`]],[`*`,[`*`,`+`,`?`,`@`]],[`+`,[`+`,`@`,`?`,`*`]]]),M=new Map([[`!`,new Map([[`!`,`@`]])],[`?`,new Map([[`*`,`*`],[`+`,`*`]])],[`@`,new Map([[`!`,`!`],[`?`,`?`],[`@`,`@`],[`*`,`*`],[`+`,`+`]])],[`+`,new Map([[`?`,`*`],[`*`,`*`]])]]),N=`(?!\\.)`,Oe=new Set([`[`,`.`]),ke=new Set([`..`,`.`]),Ae=new Set(`().*{}+?[]^$\\!`),je=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`),P=`[^/]`,Me=P+`*?`,F=P+`+?`;let Ne=0;var I=class{type;#e;#t;#n=!1;#r=[];#i;#a;#o;#s=!1;#c;#l;#u=!1;id=++Ne;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 k&&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 k&&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 k(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&&A(n)&&e.charAt(u)===`(`&&i<=a){t.push(d),d=``;let a=new k(n,t);u=k.#f(e,a,u,r,i+1),t.push(a);continue}d+=n}return t.push(d),u}let u=n+1,d=new k(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&&A(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 k(n,d);d.push(o),u=k.#f(e,o,u,r,i+a);continue}if(n===`|`){d.push(p),p=``,f.push(d),d=new k(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,Ee)}#m(e,t=Te){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=De){return!!t.get(this.type)?.includes(e)}#g(e,t){let n=e.#r[0],r=new k(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!!M.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=M.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 k(null,void 0,t);return k.#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()),!j(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`?k.#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&&ke.has(this.#r[0]))){let n=Oe,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,O(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,O(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:``)+F;else{let n=this.type===`!`?`))`+(this.isStart()&&!t&&!e?N:``)+Me+`)`:this.type===`@`?`)`:this.type===`?`?`)?`:this.type===`+`&&a?`)`:this.type===`*`&&a?`)?`:`)${this.type}`;o=r+i+n}return[o,O(i),this.#t=!!this.#t,this.#n]}#x(){if(j(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+=(Ae.has(c)?`\\`:``)+c;continue}if(c===`*`){if(o)continue;o=!0,i+=n&&/^[*]+$/.test(e)?F:Me,t=!0;continue}else o=!1;if(c===`\\`){s===e.length-1?i+=`\\\\`:r=!0;continue}if(c===`[`){let[n,r,o,c]=Ce(e,s);if(o){i+=n,a||=r,s+=o-1,t||=c;continue}}if(c===`?`){i+=P,t=!0;continue}i+=je(c)}return[i,O(e),!!t,a]}};k=I;const Pe=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,`[$&]`):e.replace(/[?*()[\]\\{}]/g,`\\$&`):t?e.replace(/[?*()[\]]/g,`[$&]`):e.replace(/[?*()[\]\\]/g,`\\$&`),L=(e,t,n={})=>(T(t),!n.nocomment&&t.charAt(0)===`#`?!1:new K(t,n).match(e)),Fe=/^\*+([^+@!?*[(]*)$/,Ie=e=>t=>!t.startsWith(`.`)&&t.endsWith(e),Le=e=>t=>t.endsWith(e),Re=e=>(e=e.toLowerCase(),t=>!t.startsWith(`.`)&&t.toLowerCase().endsWith(e)),ze=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Be=/^\*+\.\*+$/,Ve=e=>!e.startsWith(`.`)&&e.includes(`.`),He=e=>e!==`.`&&e!==`..`&&e.includes(`.`),Ue=/^\.\*+$/,We=e=>e!==`.`&&e!==`..`&&e.startsWith(`.`),Ge=/^\*+$/,Ke=e=>e.length!==0&&!e.startsWith(`.`),qe=e=>e.length!==0&&e!==`.`&&e!==`..`,Je=/^\?+([^+@!?*[(]*)?$/,Ye=([e,t=``])=>{let n=R([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Xe=([e,t=``])=>{let n=z([e]);return t?(t=t.toLowerCase(),e=>n(e)&&e.toLowerCase().endsWith(t)):n},Ze=([e,t=``])=>{let n=z([e]);return t?e=>n(e)&&e.endsWith(t):n},Qe=([e,t=``])=>{let n=R([e]);return t?e=>n(e)&&e.endsWith(t):n},R=([e])=>{let t=e.length;return e=>e.length===t&&!e.startsWith(`.`)},z=([e])=>{let t=e.length;return e=>e.length===t&&e!==`.`&&e!==`..`},B=typeof process==`object`&&process?typeof process.env==`object`&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:`posix`,V={win32:{sep:`\\`},posix:{sep:`/`}};L.sep=B===`win32`?V.win32.sep:V.posix.sep;const H=Symbol(`globstar **`);L.GLOBSTAR=H,L.filter=(e,t={})=>n=>L(n,e,t);const U=(e,t={})=>Object.assign({},e,t);L.defaults=e=>{if(!e||typeof e!=`object`||!Object.keys(e).length)return L;let t=L;return Object.assign((n,r,i={})=>t(n,r,U(e,i)),{Minimatch:class extends t.Minimatch{constructor(t,n={}){super(t,U(e,n))}static defaults(n){return t.defaults(U(e,n)).Minimatch}},AST:class extends t.AST{constructor(t,n,r={}){super(t,n,U(e,r))}static fromGlob(n,r={}){return t.AST.fromGlob(n,U(e,r))}},unescape:(n,r={})=>t.unescape(n,U(e,r)),escape:(n,r={})=>t.escape(n,U(e,r)),filter:(n,r={})=>t.filter(n,U(e,r)),defaults:n=>t.defaults(U(e,n)),makeRe:(n,r={})=>t.makeRe(n,U(e,r)),braceExpand:(n,r={})=>t.braceExpand(n,U(e,r)),match:(n,r,i={})=>t.match(n,r,U(e,i)),sep:t.sep,GLOBSTAR:H})};const W=(e,t={})=>(T(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ge(e,{max:t.braceExpandMax}));L.braceExpand=W,L.makeRe=(e,t={})=>new K(e,t).makeRe(),L.match=(e,t,n={})=>{let r=new K(t,n);return e=e.filter(e=>r.match(e)),r.options.nonull&&!e.length&&e.push(t),e};const G=/[?*]|[+@!]\(.*?\)|\[|\]/,$e=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,`\\$&`);var K=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){T(e),t||={},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||B,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]===`?`||!G.test(e[2]))&&!G.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(H)?this.#e(e,t,n,r,i):this.#n(e,t,n,r,i)}#e(e,t,n,r,i){let a=t.indexOf(H,i),o=t.lastIndexOf(H),[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===H?(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===H)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 W(this.pattern,this.options)}parse(e){T(e);let t=this.options;if(e===`**`)return H;if(e===``)return``;let n,r=null;(n=e.match(Ge))?r=t.dot?qe:Ke:(n=e.match(Fe))?r=(t.nocase?t.dot?ze:Re:t.dot?Le:Ie)(n[1]):(n=e.match(Je))?r=(t.nocase?t.dot?Xe:Ye:t.dot?Ze:Qe)(n):(n=e.match(Be))?r=t.dot?He:Ve:(n=e.match(Ue))&&(r=We);let i=I.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`?$e(e):e===H?H:e._src});t.forEach((e,r)=>{let i=t[r+1],a=t[r-1];e!==H||a===H||(a===void 0?i!==void 0&&i!==H?t[r+1]=`(?:\\/|`+n+`\\/)?`+i:t[r]=n:i===void 0?t[r-1]=a+`(?:\\/|\\/`+n+`)?`:i!==H&&(t[r-1]=a+`(?:\\/|\\/`+n+`\\/)`+i,t[r+1]=H))});let i=t.filter(e=>e!==H);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 L.defaults(e).Minimatch}};L.AST=I,L.Minimatch=K,L.escape=Pe,L.unescape=O;function q(e){let t=e.replace(/\\/g,`/`),n=_.posix.normalize(t);return n.endsWith(`/`)?n.slice(0,-1):n}function J(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 Y(e){return`"${e.replace(/"/g,`""`)}"`}function et(e){return`CREATE TABLE IF NOT EXISTS ${Y(e)}(
3
- id INTEGER PRIMARY KEY AUTOINCREMENT,
4
- name TEXT UNIQUE,
5
- applied_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL
6
- );`}function tt(e){return`SELECT *
7
- FROM ${Y(e)}
8
- ORDER BY id`}function X(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=q(e.dir??`./migrations`),n=q(`${t}/*.sql`),r;if(e.pattern===void 0)r=n;else{r=q(e.pattern);try{J(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:_.resolve(e.cwd??process.cwd(),t),migrationsDir:t,migrationsPattern:r,migrationsTableName:e.table??`d1_migrations`}}function nt(e,t){let n=[],r=[{abs:e,rel:``}];for(;r.length>0;){let{abs:e,rel:i}=r.pop(),a;try{a=g.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:_.join(e,o.name),rel:a}):o.isFile()&&t.match(a)&&n.push(a)}}return n.sort(it)}function Z(e){let t=e.split(`/`)[0]??``;return parseInt(t.split(`_`)[0]??``,10)}function rt(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 it(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=rt(n[e]??``,r[e]??``);if(t!==0)return t}return n.length-r.length}function Q(e){let t=J(e.migrationsPattern,e.migrationsDir);return nt(e.migrationsPath,new K(t,{dot:!1}))}function at(e,t){let n=[];for(let r of e)t.includes(r)||n.push(r);return n}function ot(e){let t=Q(e).map(e=>Z(e)).filter(e=>Number.isFinite(e));return Math.max(...t,0)+1}function st(e){if(nt(e.migrationsPath,new K(`*/migration.sql`,{dot:!1})).length!==0)return q(`${e.migrationsDir}/*/migration.sql`)}function ct(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 lt({migrationsPath:e,migrationName:t,migrationsTableName:n}){return`${g.readFileSync(_.join(e,t),`utf8`)}
16
- INSERT INTO ${Y(n)} (name)
17
- values ('${t.replace(/'/g,`''`)}');`}function ut(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 dt(e){return ut(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:ct(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 ft(n){if(!r(n.database))throw Error(`Expected a D1 database ID, but received <database>=${JSON.stringify(n.database)}. Database names and binding names are not accepted.`);let a=X({dir:n.dir,pattern:n.pattern,table:n.table});if(!g.existsSync(a.migrationsPath))throw Error(`No migrations directory at ${a.migrationsPath}.`+(n.dir===void 0?` Pass --dir to point at one.`:``));return{client:await i(n),accountId:n.local?e:await t(),databaseId:n.database,config:a,local:n.local===!0}}async function pt(e){let{client:t,accountId:n,databaseId:r,config:i}=e;await $(t,n,r,et(i.migrationsTableName),`Preparing`,e.local);let a=(await $(t,n,r,tt(i.migrationsTableName),`Loading`,e.local))[0].results.map(e=>e.name),o=Q(i);if(o.length===0){let e=st(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:at(o,a)}}function mt(e){return dt(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const ht={command:`apply <database>`,describe:`Apply any unapplied D1 migrations`,builder:mt,handler:async e=>{let t=await ft(e),n=(await pt(t)).unapplied.map(e=>({name:e,status:`🕒️`}));if(n.length===0){a([],{successLabel:`No migrations to apply`,quiet:e.quiet});return}if(await m(`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=lt({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 gt(e){return ut(e.positional(`message`,{type:`string`,description:`Describes what the migration does`,demandOption:!0}))}const _t={command:`create <message>`,describe:`Create a new empty D1 migration file`,builder:gt,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=X({dir:e.dir,pattern:e.pattern}),n=vt(ot(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=q(`${t.migrationsDir}/${i}`);if(!new K(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(!g.existsSync(t.migrationsPath)){if(!await m(`No migrations folder found.\nOk to create ${t.migrationsPath}?`))throw Error(`No migrations folder present at ${t.migrationsPath}.`);g.mkdirSync(t.migrationsPath,{recursive:!0})}let s=_.join(t.migrationsPath,i);g.writeFileSync(s,`-- Migration number: ${n} \t ${new Date().toISOString()}\n`),a({name:i,path:s},{successLabel:`Created ${i}`,quiet:e.quiet})}};function vt(e,t){let n=e.toString();for(;n.length<t;)n=`0`+n;return n}function yt(e){return dt(e.positional(`database`,{type:`string`,description:`D1 database ID`,demandOption:!0}))}const bt={command:`list <database>`,describe:`View a list of unapplied migration files`,builder:yt,handler:async e=>{let{unapplied:t}=await pt(await ft(e));a(t.map(e=>({Name:e})),{quiet:e.quiet})}},xt={command:`migrations`,describe:`Create, list, and apply D1 database migrations`,builder:e=>e.command(ht).command(_t).command(bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function St(e){return e.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 Ct={command:`create`,describe:`Returns the created D1 database.`,builder:St,handler:async r=>{if(r.dryRun){o({command:`cf d1 create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({jurisdiction:u(r.jurisdiction,`jurisdiction`,`text`),name:u(r.name,`name`,`text`),primary_location_hint:u(r[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:u(r[`read-replication-mode`],`read-replication-mode`,`text`)}}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.d1.create({...e,account_id:p})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await d(`name`,`D1 database name.`));let m=l({jurisdiction:u(r.jurisdiction,`jurisdiction`,`text`),name:u(r.name,`name`,`text`),primary_location_hint:u(r[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:u(r[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Creating`,async()=>f.d1.create({...m,account_id:p})),{successLabel:`Created`})}};function wt(e){return e.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 Tt={command:`delete <database-id>`,describe:`Deletes the specified D1 database.`,builder:wt,handler:async r=>{if(r.dryRun){o({command:`cf d1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}`,pathParams:{"database-id":String(r[`database-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
19
- `);return}a(await s(`Deleting`,async()=>c.d1.delete({account_id:l,database_id:r[`database-id`]})),{successLabel:`Deleted`})}};function Et(e){return e.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 Dt={command:`edit <database-id>`,describe:`Updates partially the specified D1 database.`,builder:Et,handler:async r=>{if(r.dryRun){o({command:`cf d1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}`,pathParams:{"database-id":String(r[`database-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({read_replication:{mode:u(r[`read-replication-mode`],`read-replication-mode`,`text`)}}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.d1.edit({...e,account_id:f,database_id:r[`database-id`]})),{successLabel:`Updated`});return}let p=l({read_replication:{mode:u(r[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Updating`,async()=>d.d1.edit({...p,account_id:f,database_id:r[`database-id`]})),{successLabel:`Updated`})}};function Ot(e){return e.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 kt={command:`export <database-id>`,describe:`Returns a URL where the SQL contents of your D1 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.`,builder:Ot,handler:async r=>{if(r.dryRun){o({command:`cf d1 export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}/export`,pathParams:{"database-id":String(r[`database-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({current_bookmark:u(r[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:r[`dump-options-no-data`],no_schema:r[`dump-options-no-schema`],tables:r[`dump-options-tables`]},output_format:u(r[`output-format`],`output-format`,`text`)}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Loading`,async()=>d.d1.export({...e,account_id:p,database_id:r[`database-id`]})),{successLabel:`Loaded`});return}r[`output-format`]===void 0&&(r[`output-format`]=await f(`output-format`,`Specifies that you will poll this endpoint until the export completes`,[`polling`]));let m=l({current_bookmark:u(r[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:r[`dump-options-no-data`],no_schema:r[`dump-options-no-schema`],tables:r[`dump-options-tables`]},output_format:u(r[`output-format`],`output-format`,`text`)});a(await s(`Loading`,async()=>d.d1.export({...m,account_id:p,database_id:r[`database-id`]})),{successLabel:`Loaded`})}};function At(e){return e.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,
20
- all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const jt={command:`get <database-id>`,describe:`Returns the specified D1 database.`,builder:h(At),handler:async r=>{let c={fields:r.fields};if(r.dryRun){o({command:`cf d1 get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}`,pathParams:{"database-id":String(r[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.d1.get({account_id:u,database_id:r[`database-id`],...c})),{successLabel:`Loaded`})}};function Mt(e){return e.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 Nt={command:`import <database-id>`,describe:`Generates a temporary URL for uploading an SQL file to, then instructing the D1 to import it and polling it for status updates. Imports block the D1 for their duration.`,builder:Mt,handler:async r=>{if(r.dryRun){o({command:`cf d1 import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}/import`,pathParams:{"database-id":String(r[`database-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({action:u(r.action,`action`,`text`),etag:u(r.etag,`etag`,`text`),filename:u(r.filename,`filename`,`text`),current_bookmark:u(r[`current-bookmark`],`current-bookmark`,`text`)}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>d.d1.import({body:e,account_id:p,database_id:r[`database-id`]})),{successLabel:`Created`});return}r.action===void 0&&(r.action=await f(`action`,`Indicates you have a new SQL file to upload.`,[`init`,`ingest`,`poll`]));let m=l({action:u(r.action,`action`,`text`),etag:u(r.etag,`etag`,`text`),filename:u(r.filename,`filename`,`text`),current_bookmark:u(r[`current-bookmark`],`current-bookmark`,`text`)});a(await s(`Creating`,async()=>d.d1.import({body:m,account_id:p,database_id:r[`database-id`]})),{successLabel:`Created`})}};function Pt(e){return e.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 Ft={command:`list`,describe:`Returns a list of D1 databases.`,builder:Pt,handler:async r=>{let c={name:r.name,page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf d1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.d1.list({account_id:u,...c})),{successLabel:`Loaded`})}};function It(e){return e.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(`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`})}const Lt={command:`query <database-id>`,describe:`Returns the query result as an object.`,builder:It,handler:async r=>{if(r.dryRun){o({command:`cf d1 query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}/query`,pathParams:{"database-id":String(r[`database-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({params:r.params,sql:u(r.sql,`sql`,`text`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Loading`,async()=>d.d1.query({body:e,account_id:f,database_id:r[`database-id`]})),{successLabel:`Loaded`});return}let p=l({params:r.params,sql:u(r.sql,`sql`,`text`)});a(await s(`Loading`,async()=>d.d1.query({body:p,account_id:f,database_id:r[`database-id`]})),{successLabel:`Loaded`})}};function Rt(e){return e.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(`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`})}const zt={command:`raw <database-id>`,describe:`Returns the query result rows as arrays rather than objects. This is a performance-optimized version of the /query endpoint.`,builder:Rt,handler:async r=>{if(r.dryRun){o({command:`cf d1 raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}/raw`,pathParams:{"database-id":String(r[`database-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({params:r.params,sql:u(r.sql,`sql`,`text`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Loading`,async()=>d.d1.raw({body:e,account_id:f,database_id:r[`database-id`]})),{successLabel:`Loaded`});return}let p=l({params:r.params,sql:u(r.sql,`sql`,`text`)});a(await s(`Loading`,async()=>d.d1.raw({body:p,account_id:f,database_id:r[`database-id`]})),{successLabel:`Loaded`})}};function Bt(e){return e.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 Vt={command:`get-bookmark <database-id>`,describe:`Retrieves 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.`,builder:Bt,handler:async r=>{let c={timestamp:r.timestamp};if(r.dryRun){o({command:`cf d1 time-travel get-bookmark`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}/time_travel/bookmark`,pathParams:{"database-id":String(r[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.d1.timeTravel.getBookmark({account_id:u,database_id:r[`database-id`],...c})),{successLabel:`Loaded`})}};function Ht(e){return e.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})}const Ut={command:`restore <database-id>`,describe:`Restores a D1 database to a previous point in time either via a bookmark or a timestamp.`,builder:Ht,handler:async r=>{let c={bookmark:r.bookmark,timestamp:r.timestamp};if(r.dryRun){o({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(r[`database-id`]??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Creating`,async()=>l.d1.timeTravel.restore({account_id:u,database_id:r[`database-id`],...c})),{successLabel:`Created`})}},Wt={command:`time-travel`,describe:`use specific point-in-time backups of your D1 database`,builder:e=>e.command(Vt).command(Ut).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Gt(e){return e.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 Kt={command:`update <database-id>`,describe:`Updates the specified D1 database.`,builder:Gt,handler:async r=>{if(r.dryRun){o({command:`cf d1 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/d1/database/${r[`database-id`]==null?`<database-id>`:encodeURIComponent(String(r[`database-id`]))}`,pathParams:{"database-id":String(r[`database-id`]??``)},bodyKind:`json`,body:r.body===void 0?l({read_replication:{mode:u(r[`read-replication-mode`],`read-replication-mode`,`text`)}}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.d1.update({...e,account_id:p,database_id:r[`database-id`]})),{successLabel:`Updated`});return}r[`read-replication-mode`]===void 0&&(r[`read-replication-mode`]=await f(`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 m=l({read_replication:{mode:u(r[`read-replication-mode`],`read-replication-mode`,`text`)}});a(await s(`Updating`,async()=>d.d1.update({...m,account_id:p,database_id:r[`database-id`]})),{successLabel:`Updated`})}},qt={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(Ct).command(Tt).command(Dt).command(kt).command(jt).command(Nt).command(Ft).command(Lt).command(zt).command(Kt).command(xt).command(Wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{qt as default};
@@ -1,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,i as d,n as f}from"./prompt-DdegNPpg.mjs";import{t as p}from"./cli-types-BsTty22w.mjs";function m(e){return e.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 h={command:`archiveFindingInstance <finding-id>`,describe:`Archive one or more finding instances.`,builder:m,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture archiveFindingInstance`,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?c({check_instances:l[`check-instances`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.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=c({check_instances:l[`check-instances`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.archiveFindingInstance({body:f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function ee(e){return e.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 g={command:`changeFindingSeverity <finding-id>`,describe:"Update the severity of a Finding. This will update the `severity_override` field on the Finding payload with the new severity value.",builder:ee,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture changeFindingSeverity`,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?c({new_severity:l[`new-severity`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.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=c({new_severity:l[`new-severity`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.changeFindingSeverity({...f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function _(e){return e.option(`dlp-profile-id`,{type:`string`,array:!0,description:`Filter by DLP profile IDs.`}).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(`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 v={command:`createContentExport`,describe:`Creates a CSV export for content and accepts optional filters in the payload.`,builder:_,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createContentExport`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/content/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({dlp_profile_id:u[`dlp-profile-id`],integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),vendors:u.vendors}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createContentExport({...e,account_id:f})),{successLabel:`Created`});return}let p=c({dlp_profile_id:u[`dlp-profile-id`],integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),vendors:u.vendors});i(await o(`Creating`,async()=>d.dataSecurity.posture.createContentExport({...p,account_id:f})),{successLabel:`Created`})}};function y(e){return e.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(`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 b={command:`createFindingExportCSV`,describe:`Creates a CSV export for findings and accepts optional filters in the payload.`,builder:y,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createFindingExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({ignored:u.ignored,integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),severities:u.severities,vendors:u.vendors}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingExportCsv({...e,account_id:f})),{successLabel:`Created`});return}let p=c({ignored:u.ignored,integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),severities:u.severities,vendors:u.vendors});i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingExportCsv({...p,account_id:f})),{successLabel:`Created`})}};function x(e){return e.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(`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 S={command:`createFindingInstancesExportCSV <storage-namespace-id>`,describe:"Creates 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.",builder:x,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createFindingInstancesExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${u[`storage-namespace-id`]==null?`<storage-namespace-id>`:encodeURIComponent(String(u[`storage-namespace-id`]))}/instances/export`,pathParams:{"storage-namespace-id":String(u[`storage-namespace-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({archived:u.archived,max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingInstancesExportCsv({...e,account_id:f,storage_namespace_id:u[`storage-namespace-id`]})),{successLabel:`Created`});return}let p=c({archived:u.archived,max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`)});i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingInstancesExportCsv({...p,account_id:f,storage_namespace_id:u[`storage-namespace-id`]})),{successLabel:`Created`})}};function C(e){return e.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 w={command:`createPolicy`,describe:`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.`,builder:C,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture createPolicy`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,finding_type_id:l(d[`finding-type-id`],`finding-type-id`,`text`),integration_ids:d[`integration-ids`]}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dataSecurity.posture.createPolicy({...e,account_id:p})),{successLabel:`Created`});return}if(d[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(d[`display-name`]===void 0&&(d[`display-name`]=await u(`display-name`,`Display name for the policy configuration.`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);d[`finding-type-id`]===void 0&&(d[`finding-type-id`]=await u(`finding-type-id`,`The finding type this policy is associated with. All remediation actions must match this finding type.`));let m=c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,finding_type_id:l(d[`finding-type-id`],`finding-type-id`,`text`),integration_ids:d[`integration-ids`]});i(await o(`Creating`,async()=>f.dataSecurity.posture.createPolicy({...m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.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 E={command:`createRemediationJobs`,describe:`Create one or more remediation jobs tied to a specific Cloudflare Account.`,builder:T,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture createRemediationJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({finding_instance_ids:d[`finding-instance-ids`],remediation_type_id:l(d[`remediation-type-id`],`remediation-type-id`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dataSecurity.posture.createRemediationJobs({...e,account_id:p})),{successLabel:`Created`});return}if(d[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);d[`remediation-type-id`]===void 0&&(d[`remediation-type-id`]=await u(`remediation-type-id`,`A UUID identifying this Remediation Type.`));let m=c({finding_instance_ids:d[`finding-instance-ids`],remediation_type_id:l(d[`remediation-type-id`],`remediation-type-id`,`text`)});i(await o(`Creating`,async()=>f.dataSecurity.posture.createRemediationJobs({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.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(`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 O={command:`createRemediationJobsExportCSV`,describe:`Creates a CSV export for remediation jobs and accepts optional filters in the payload.`,builder:D,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createRemediationJobsExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({integration_id:u[`integration-id`],max_updated_at:l(u[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:l(u[`min-updated-at`],`min-updated-at`,`text`),search:l(u.search,`search`,`text`),status:u.status}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createRemediationJobsExportCsv({...e,account_id:f})),{successLabel:`Created`});return}let p=c({integration_id:u[`integration-id`],max_updated_at:l(u[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:l(u[`min-updated-at`],`min-updated-at`,`text`),search:l(u.search,`search`,`text`),status:u.status});i(await o(`Creating`,async()=>d.dataSecurity.posture.createRemediationJobsExportCsv({...p,account_id:f})),{successLabel:`Created`})}};function k(e){return e.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(`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(`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 A={command:`createWebhook`,describe:`Creates a new webhook configuration for sending finding notifications to external endpoints.`,builder:k,handler:async f=>{if(f.dryRun){a({command:`cf data-security posture createWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...e,account_id:m})),{successLabel:`Created`});return}f[`authentication-type`]===void 0&&(f[`authentication-type`]=await d(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),f[`destination-url`]===void 0&&(f[`destination-url`]=await u(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),f.label===void 0&&(f.label=await u(`label`,`Account-specified display label for the webhook configuration.`));let h=c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)});i(await o(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...h,account_id:m})),{successLabel:`Created`})}};function j(e){return e.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 M={command:`createWebhookJobs`,describe:`Creates webhook jobs to send a finding instance to one or more configured webhooks.`,builder:j,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture createWebhookJobs`,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?c({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.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=c({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.createWebhookJobs({...f,account_id:d})),{successLabel:`Created`})}};function N(e){return e.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 P={command:`deletePolicy <policy-id>`,describe:`Deletes a policy configuration.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture deletePolicy`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>c.dataSecurity.posture.deletePolicy({account_id:l,policy_id:s[`policy-id`]})),{successLabel:`Deleted`})}};function F(e){return e.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 I={command:`deleteWebhook <webhook-id>`,describe:`Soft deletes a webhook configuration by its unique identifier. The webhook will be marked as deleted and will no longer be available for use.`,builder:F,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture deleteWebhook`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
4
- `);return}i(await o(`Deleting`,async()=>c.dataSecurity.posture.deleteWebhook({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Deleted`})}};function L(e){return e.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 R={command:`evaluateExistingWebhook <webhook-id>`,describe:`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`,builder:L,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture evaluateExistingWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}/evaluate`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.dataSecurity.posture.evaluateExistingWebhook({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Created`})}};function z(e){return e.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(`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 B={command:`evaluateNewWebhook`,describe:`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`,builder:z,handler:async f=>{if(f.dryRun){a({command:`cf data-security posture evaluateNewWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/evaluate`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.dataSecurity.posture.evaluateNewWebhook({...e,account_id:m})),{successLabel:`Created`});return}f[`authentication-type`]===void 0&&(f[`authentication-type`]=await d(`authentication-type`,`Type of authentication to use for the test webhook request.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),f[`destination-url`]===void 0&&(f[`destination-url`]=await u(`destination-url`,`Target URL to send the test webhook event to.`));let h=c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)});i(await o(`Creating`,async()=>p.dataSecurity.posture.evaluateNewWebhook({...h,account_id:m})),{successLabel:`Created`})}};function V(e){return e.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 H={command:`getExportJob <id>`,describe:`Retrieves a single export job by its unique identifier`,builder:V,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getExportJob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/exports/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getExportJob({account_id:l,id:s.id})),{successLabel:`Loaded`})}};function U(e){return e.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 W={command:`getFinding <finding-id>`,describe:`Gets a security Finding that has been identified as being problematic.`,builder:U,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getFinding`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}`,pathParams:{"finding-id":String(s[`finding-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getFinding({account_id:l,finding_id:s[`finding-id`]})),{successLabel:`Loaded`})}};function G(e){return e.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:`getFindingInstance <instance-id>`,describe:`Gets a security Finding instance by id.`,builder:G,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getFindingInstance`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}/instances/${s[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(s[`instance-id`]))}`,pathParams:{"finding-id":String(s[`finding-id`]??``),"instance-id":String(s[`instance-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getFindingInstance({account_id:l,finding_id:s[`finding-id`],instance_id:s[`instance-id`]})),{successLabel:`Loaded`})}};function q(e){return e.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:`getFindingType <finding-type-id>`,describe:`Retrieve a specific finding type by its unique identifier.`,builder:q,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types/${s[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(s[`finding-type-id`]))}`,pathParams:{"finding-type-id":String(s[`finding-type-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getFindingType({account_id:l,finding_type_id:s[`finding-type-id`]})),{successLabel:`Loaded`})}};function Y(e){return e.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 X={command:`getPolicyByID <policy-id>`,describe:`Retrieves the details of a specific policy configuration, including its associated remediation and webhook actions.`,builder:Y,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getPolicyByID`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getPolicyById({account_id:l,policy_id:s[`policy-id`]})),{successLabel:`Loaded`})}};function Z(e){return e.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 te={command:`getRemediationTypesForFindingType <finding-type-id>`,describe:"List all remediation types for a given finding type. This endpoint supports both cursor and offset pagination. Note that `cursor` and `page` are mutually exclusive.",builder:Z,handler:async s=>{let c={integration_id:s[`integration-id`],cursor:s.cursor,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf data-security posture getRemediationTypesForFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types/${s[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(s[`finding-type-id`]))}/remediation_types`,pathParams:{"finding-type-id":String(s[`finding-type-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.getRemediationTypesForFindingType({account_id:u,finding_type_id:s[`finding-type-id`],...c})),{successLabel:`Loaded`})}};function Q(e){return e.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 ne={command:`getWebhookConfigByID <webhook-id>`,describe:`Retrieves a specific webhook configuration by its unique identifier.`,builder:Q,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getWebhookConfigByID`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getWebhookConfigById({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Loaded`})}};function re(e){return e.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 ie={command:`ignoreFinding`,describe:`Given a list of findings, mark as ignored. Does nothing if Finding is already ignored.`,builder:re,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture ignoreFinding`,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?c({checks:l.checks}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.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=c({checks:l.checks});i(await o(`Creating`,async()=>u.dataSecurity.posture.ignoreFinding({body:f,account_id:d})),{successLabel:`Created`})}};function ae(e){return e.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`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`listContentAssets`,describe:`List DLP content findings`,builder:p(ae),handler:async s=>{let c={direction:s.direction,dlp_profile_id:s[`dlp-profile-id`],integration_id:s[`integration-id`],max_affliction_date:s[`max-affliction-date`],min_affliction_date:s[`min-affliction-date`],order:s.order,page:s.page,per_page:s[`per-page`],search:s.search,vendor:s.vendor};if(s.dryRun){a({command:`cf data-security posture listContentAssets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/content`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listContentAssets({account_id:u,...c})),{successLabel:`Loaded`})}};function se(e){return e.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 ce={command:`listExportJobs`,describe:`List all export jobs for a given requestor's organization`,builder:p(se),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],status:s.status};if(s.dryRun){a({command:`cf data-security posture listExportJobs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/exports`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listExportJobs({account_id:u,...c})),{successLabel:`Loaded`})}};function le(e){return e.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.
5
- 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.
6
- Use 'none' to filter instances with no remediation jobs or instances where the most recent job is stale.
7
- 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 ue={command:`listFindingInstances <finding-id>`,describe:`Lists all security finding instances for a given security finding.`,builder:p(le),handler:async s=>{let c={archived:s.archived,cursor:s.cursor,direction:s.direction,max_affliction_date:s[`max-affliction-date`],min_affliction_date:s[`min-affliction-date`],order:s.order,page:s.page,per_page:s[`per-page`],search:s.search,remediation_statuses:s[`remediation-statuses`],finding_instance_ids:s[`finding-instance-ids`],asset_ids:s[`asset-ids`]};if(s.dryRun){a({command:`cf data-security posture listFindingInstances`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}/instances`,pathParams:{"finding-id":String(s[`finding-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listFindingInstances({account_id:u,finding_id:s[`finding-id`],...c})),{successLabel:`Loaded`})}};function de(e){return e.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`]}).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 fe={command:`listFindings`,describe:`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.`,builder:p(de),handler:async s=>{let c={cursor:s.cursor,direction:s.direction,ignored:s.ignored,integration_id:s[`integration-id`],max_affliction_date:s[`max-affliction-date`],min_affliction_date:s[`min-affliction-date`],observation:s.observation,order:s.order,page:s.page,per_page:s[`per-page`],product:s.product,search:s.search,severity:s.severity,type:s.type,vendor:s.vendor,finding_type_ids:s[`finding-type-ids`]};if(s.dryRun){a({command:`cf data-security posture listFindings`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listFindings({account_id:u,...c})),{successLabel:`Loaded`})}};function pe(e){return e.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 me={command:`listFindingTypes`,describe:`List all available finding types with pagination support.`,builder:p(pe),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],vendors:s.vendors,search:s.search};if(s.dryRun){a({command:`cf data-security posture listFindingTypes`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listFindingTypes({account_id:u,...c})),{successLabel:`Loaded`})}};function he(e){return e.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 ge={command:`listPolicies`,describe:`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.`,builder:he,handler:async s=>{let c={cursor:s.cursor};if(s.dryRun){a({command:`cf data-security posture listPolicies`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listPolicies({account_id:u,...c})),{successLabel:`Loaded`})}};function _e(e){return e.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 ve={command:`listPolicyLogs`,describe:"Returns 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.",builder:_e,handler:async s=>{let c={since:s.since,until:s.until,integration_id:s[`integration-id`],policy_name:s[`policy-name`],page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf data-security posture listPolicyLogs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/logs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listPolicyLogs({account_id:u,...c})),{successLabel:`Loaded`})}};function ye(e){return e.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 be={command:`listRemediationJobs`,describe:"List all remediation jobs tied to a specific Cloudflare Account. Note that `cursor` and `page` are mutually exclusive.",builder:p(ye),handler:async s=>{let c={cursor:s.cursor,page:s.page,per_page:s[`per-page`],search:s.search,min_updated_at:s[`min-updated-at`],max_updated_at:s[`max-updated-at`],status:s.status,triggered_by_actor:s[`triggered-by-actor`],integration_id:s[`integration-id`],order:s.order,direction:s.direction};if(s.dryRun){a({command:`cf data-security posture listRemediationJobs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listRemediationJobs({account_id:u,...c})),{successLabel:`Loaded`})}};function xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`listWebhooks`,describe:`Retrieves all webhook configurations for the authenticated account. Returns an array of webhook configurations that can be used to send finding notifications.`,builder:xe,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture listWebhooks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.listWebhooks({account_id:l})),{successLabel:`Loaded`})}};function Ce(e){return e.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 we={command:`resetFindingSeverity <finding-id>`,describe:`If a Finding's severity has been changed, reset it back to default value. Does nothing if no override exists.`,builder:Ce,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture resetFindingSeverity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}/reset_finding_severity`,pathParams:{"finding-id":String(s[`finding-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.dataSecurity.posture.resetFindingSeverity({account_id:l,finding_id:s[`finding-id`]})),{successLabel:`Created`})}};function Te(e){return e.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:`unarchiveFindingInstance <finding-id>`,describe:`Remove the archive marking from one or more finding instances.`,builder:Te,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture unarchiveFindingInstance`,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?c({check_instances:l[`check-instances`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.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=c({check_instances:l[`check-instances`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.unarchiveFindingInstance({body:f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function De(e){return e.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:`unIgnoreFinding`,describe:`Ability to un-ignore a Finding if it's previously been ignored. Does nothing if the Finding is not ignored.`,builder:De,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture unIgnoreFinding`,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?c({checks:l.checks}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.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=c({checks:l.checks});i(await o(`Creating`,async()=>u.dataSecurity.posture.unIgnoreFinding({body:f,account_id:d})),{successLabel:`Created`})}};function Oe(e){return e.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 ke={command:`updatePolicy <policy-id>`,describe:`Updates an existing policy configuration and replaces its actions.`,builder:Oe,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture updatePolicy`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${d[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(d[`policy-id`]))}`,pathParams:{"policy-id":String(d[`policy-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,integration_ids:d[`integration-ids`]}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.dataSecurity.posture.updatePolicy({...e,account_id:p,policy_id:d[`policy-id`]})),{successLabel:`Updated`});return}if(d[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(d[`display-name`]===void 0&&(d[`display-name`]=await u(`display-name`,`Display name for the policy configuration.`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let m=c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,integration_ids:d[`integration-ids`]});i(await o(`Updating`,async()=>f.dataSecurity.posture.updatePolicy({...m,account_id:p,policy_id:d[`policy-id`]})),{successLabel:`Updated`})}};function Ae(e){return e.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(`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 je={command:`updateWebhook <webhook-id>`,describe:`Updates an existing webhook configuration with new settings.`,builder:Ae,handler:async f=>{if(f.dryRun){a({command:`cf data-security posture updateWebhook`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${f[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(f[`webhook-id`]))}`,pathParams:{"webhook-id":String(f[`webhook-id`]??``)},bodyKind:`json`,body:f.body===void 0?c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`),status:l(f.status,`status`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Updating`,async()=>p.dataSecurity.posture.updateWebhook({...e,account_id:m,webhook_id:f[`webhook-id`]})),{successLabel:`Updated`});return}f[`authentication-type`]===void 0&&(f[`authentication-type`]=await d(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),f[`destination-url`]===void 0&&(f[`destination-url`]=await u(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),f.label===void 0&&(f.label=await u(`label`,`Account-specified display label for the webhook configuration.`)),f.status===void 0&&(f.status=await d(`status`,`Status of the webhook configuration.`,[`enabled`,`disabled`]));let h=c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`),status:l(f.status,`status`,`text`)});i(await o(`Updating`,async()=>p.dataSecurity.posture.updateWebhook({...h,account_id:m,webhook_id:f[`webhook-id`]})),{successLabel:`Updated`})}},Me={command:`posture`,describe:`Operations for posture`,builder:e=>e.command(h).command(g).command(v).command(b).command(S).command(w).command(E).command(O).command(A).command(M).command(P).command(I).command(R).command(B).command(H).command(W).command(K).command(J).command(X).command(te).command(ne).command(ie).command(oe).command(ce).command(ue).command(me).command(fe).command(ge).command(ve).command(be).command(Se).command(we).command($).command(Ee).command(ke).command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ne={command:`data-security`,describe:`data-security`,builder:e=>e.command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ne as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{h as e}from"./oauth-B0ETkNcX.mjs";import{r as t}from"./auth-MQEamPN9.mjs";import{t as n}from"./output-DrpYYfnB.mjs";import{n as r,t as i}from"./progress-CsHIt3Tp.mjs";function a(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`get`,describe:`Retrieve the account and zone specific unique identifier used as part of the CNAME target for DCV Delegation.`,builder:a,handler:async a=>{if(a.dryRun){r({command:`cf dcv-delegation get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/dcv_delegation/uuid`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.dcvDelegation.get({zone_id:s})),{successLabel:`Loaded`})}},s={command:`dcv-delegation`,describe:`dcv-delegation`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{s as default};