cf 0.4.0 → 0.5.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 (220) hide show
  1. package/README.md +7 -1
  2. package/dist/{abuse-reports-Dy76QPNP.mjs → abuse-reports-Ina5TlsU.mjs} +2 -2
  3. package/dist/{accounts-CjtZ8x1z.mjs → accounts-B_joQcMi.mjs} +9 -9
  4. package/dist/{acm-C2lYIWs1.mjs → acm-_kIHqYME.mjs} +2 -2
  5. package/dist/{addressing-CHFK6uxW.mjs → addressing-CaFlw8y1.mjs} +10 -10
  6. package/dist/{agent-context-CgGCT0xU.mjs → agent-context-DMPfi54f.mjs} +1 -1
  7. package/dist/ai-CqnhNb_c.mjs +2 -0
  8. package/dist/ai-gateway-pgYGI519.mjs +8 -0
  9. package/dist/ai-search-eqQMPQol.mjs +7 -0
  10. package/dist/ai_gateway--vuVLnOm.mjs +4 -0
  11. package/dist/{alerting-Bk85NNf5.mjs → alerting-CPxHiYHb.mjs} +5 -5
  12. package/dist/{analytics-CkhhhZWZ.mjs → analytics-DSSRDZz8.mjs} +1 -1
  13. package/dist/analytics_engine-gWyfnsCs.mjs +2 -0
  14. package/dist/{api-gateway-CWdR4Ne7.mjs → api-gateway-BXXGFCVR.mjs} +10 -10
  15. package/dist/argo-aC6A3JyX.mjs +2 -0
  16. package/dist/artifacts-HD4V2xpK.mjs +4 -0
  17. package/dist/audit-logs-BuExU_nz.mjs +2 -0
  18. package/dist/auth-CSC4yhEJ.mjs +9 -0
  19. package/dist/auth-D5hNsOFq.mjs +5 -0
  20. package/dist/billing-COaghyxl.mjs +2 -0
  21. package/dist/bot-management-DmEzeV1Y.mjs +5 -0
  22. package/dist/botnet-feed-ByEAXAkw.mjs +3 -0
  23. package/dist/brand-protection-dPrGe8sL.mjs +3 -0
  24. package/dist/{browser-rendering-Rae0AUt0.mjs → browser-rendering-BiSGnpBf.mjs} +3 -3
  25. package/dist/{build-BE4o4imx.mjs → build-HuS9-R0V.mjs} +2 -2
  26. package/dist/{cache-B7pRbpTy.mjs → cache-CY-7Lt71.mjs} +4 -4
  27. package/dist/{calls-DXRWsZ8n.mjs → calls-wOQGDWPl.mjs} +3 -3
  28. package/dist/certificate-authorities-CtqzAtxQ.mjs +2 -0
  29. package/dist/client-certificates-CRf41xLe.mjs +3 -0
  30. package/dist/cloud-connector-BA5IRZUP.mjs +2 -0
  31. package/dist/{cloudforce-one-B6HYfk5Z.mjs → cloudforce-one-Bq_qPAWs.mjs} +20 -20
  32. package/dist/{completions-D_9WsLG7.mjs → completions-DOeHPdCG.mjs} +2 -2
  33. package/dist/{config-7CBz8Xm0.mjs → config-B5k-XbwS.mjs} +1 -1
  34. package/dist/connectivity-Bx3MgTHX.mjs +3 -0
  35. package/dist/connector-interrupts-D7ylweJZ.mjs +2 -0
  36. package/dist/connector-telemetry-events-6izV1kbP.mjs +2 -0
  37. package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +2 -0
  38. package/dist/connectors-DRt4e6d_.mjs +3 -0
  39. package/dist/{content-scanning-CnW2A0pv.mjs → content-scanning-Cd2vy5Sz.mjs} +3 -3
  40. package/dist/context-jpewmual.mjs +2 -0
  41. package/dist/{custom-certificates-CnYh6Yi-.mjs → custom-certificates-DYE-9epx.mjs} +3 -3
  42. package/dist/{custom-hostnames-C2upqZso.mjs → custom-hostnames-CtuTdFcX.mjs} +4 -4
  43. package/dist/custom-nameservers-CWqA51in.mjs +3 -0
  44. package/dist/custom-pages-DeUKEFGe.mjs +4 -0
  45. package/dist/d1-DvWY9Gp4.mjs +4 -0
  46. package/dist/data-security-BPo6dIWu.mjs +6 -0
  47. package/dist/dcv-delegation-Bgf86J-r.mjs +2 -0
  48. package/dist/{deploy-KBRFIatG.mjs → deploy-dVrgDUOp.mjs} +1 -1
  49. package/dist/{dev-pPazzZvt.mjs → dev-C01_Lby6.mjs} +1 -1
  50. package/dist/diagnostics-6nKPmVgz.mjs +3 -0
  51. package/dist/{dispatch-namespaces-Cz2rajnP.mjs → dispatch-namespaces-64lXx2WJ.mjs} +6 -6
  52. package/dist/{dist-DpDjsWWn.mjs → dist-C6zxsVdY.mjs} +2 -2
  53. package/dist/{dist-DA54ZQu0.mjs → dist-t_YrL25p.mjs} +1 -1
  54. package/dist/{dns-62t95Xif.mjs → dns-ClciFGxx.mjs} +13 -13
  55. package/dist/dns-firewall-DfUmXDCe.mjs +57 -0
  56. package/dist/durable-objects-CMaYZ-YU.mjs +2 -0
  57. package/dist/{email-routing-BDUYYeV3.mjs → email-routing-CGXhFqF5.mjs} +9 -9
  58. package/dist/{email-security-ChHA6eqQ.mjs → email-security-D5viPq8S.mjs} +7 -7
  59. package/dist/email-sending-C2jpc3gh.mjs +3 -0
  60. package/dist/{filters-qJpU9uAS.mjs → filters-bzsFcWt0.mjs} +3 -3
  61. package/dist/{firewall-C3DDwfwh.mjs → firewall-DYZcTtIC.mjs} +10 -10
  62. package/dist/{fraud-DY3YXFVf.mjs → fraud-C03MtdZb.mjs} +1 -1
  63. package/dist/google-tag-gateway-Dfy887yA.mjs +2 -0
  64. package/dist/{healthchecks-Drvb79v0.mjs → healthchecks-DRoAlWgr.mjs} +3 -3
  65. package/dist/hostnames-CFgIVI3s.mjs +3 -0
  66. package/dist/hyperdrive-C7-gwTSV.mjs +18 -0
  67. package/dist/iam-DqVPzGrb.mjs +6 -0
  68. package/dist/{images-D1jI3r3O.mjs → images-BYfl4YgR.mjs} +6 -6
  69. package/dist/index.mjs +1 -1
  70. package/dist/intel-duTEPIHc.mjs +3 -0
  71. package/dist/{ips-B6JETVOY.mjs → ips-nv9INuWZ.mjs} +1 -1
  72. package/dist/keyless-certificates-CRCDVd3g.mjs +3 -0
  73. package/dist/{kv-CSWoD9ks.mjs → kv-CZoV4tiv.mjs} +4 -4
  74. package/dist/leaked-credential-checks-DNIBg7Pe.mjs +3 -0
  75. package/dist/{load-balancers-Du1tNuUt.mjs → load-balancers--OMg0HNt.mjs} +5 -5
  76. package/dist/{logpush-SuJyO-uX.mjs → logpush-C0_lZTyY.mjs} +3 -3
  77. package/dist/{logs-DcDNRPRl.mjs → logs-BtpWZQfV.mjs} +2 -2
  78. package/dist/magic-cloud-networking-u6rwYbGg.mjs +5 -0
  79. package/dist/{magic-network-monitoring-CqtvOePQ.mjs → magic-network-monitoring-CKgQyRj4.mjs} +3 -3
  80. package/dist/{magic-transit-BTbkhBtF.mjs → magic-transit-CLhMcJ_-.mjs} +32 -32
  81. package/dist/managed-transforms-D0Z2mlth.mjs +3 -0
  82. package/dist/mtls-certificates-BL65NK5T.mjs +3 -0
  83. package/dist/{network-interconnects-DsiNytOU.mjs → network-interconnects-Bgu9gmaG.mjs} +5 -5
  84. package/dist/oauth-Bk-F-tIO.mjs +52 -0
  85. package/dist/{observability-CLqZ7OSi.mjs → observability-BynRbTF4.mjs} +3 -3
  86. package/dist/{open-YWOUIZ5Y-BpqIuBsR.mjs → open-YWOUIZ5Y-3jqSKAB1.mjs} +1 -1
  87. package/dist/{organizations-aRi1bhFC.mjs → organizations-BqJHyvMK.mjs} +3 -3
  88. package/dist/origin-ca-certificates-BGvYwm3C.mjs +3 -0
  89. package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +2 -0
  90. package/dist/{origin-tls-client-auth-CnQNy9-l.mjs → origin-tls-client-auth-d3snC3vr.mjs} +3 -3
  91. package/dist/{output-CUxZRM5A.mjs → output-B6fBFRqe.mjs} +1 -1
  92. package/dist/{page-rules-CYqtPU1p.mjs → page-rules-EZHJePmn.mjs} +4 -4
  93. package/dist/{page-shield-D8l9ZMUl.mjs → page-shield-CXJioWPs.mjs} +5 -5
  94. package/dist/{pages-ChurJ2H7.mjs → pages-D4aYteKk.mjs} +8 -8
  95. package/dist/{pipelines-CeyujvRf.mjs → pipelines-G8Iusxq-.mjs} +5 -5
  96. package/dist/progress-DrDErV9w.mjs +2 -0
  97. package/dist/queues-DEkbKqZX.mjs +6 -0
  98. package/dist/{r2-BtuTO3vQ.mjs → r2-CV0IkCAW.mjs} +9 -9
  99. package/dist/r2-data-catalog-NtqGC_a_.mjs +14 -0
  100. package/dist/{radar-CzGM92uM.mjs → radar-D986zPJr.mjs} +1 -1
  101. package/dist/{rate-limits-Bbk7HxP7.mjs → rate-limits-B2wRsUX1.mjs} +3 -3
  102. package/dist/raw-fetch-_n0lMAnD.mjs +2 -0
  103. package/dist/{realtime-kit-CivLpkpg.mjs → realtime-kit-Ld3c5eU6.mjs} +9 -9
  104. package/dist/{registrar-8IeA5DKd.mjs → registrar-CDIwTz3G.mjs} +6 -6
  105. package/dist/request-tracers-D7SFMDik.mjs +2 -0
  106. package/dist/{resource-sharing-B-Pcto7-.mjs → resource-sharing-YIQ04jXE.mjs} +4 -4
  107. package/dist/{resource-tagging-Bpb6Qq1M.mjs → resource-tagging-Bd6Y03sg.mjs} +7 -7
  108. package/dist/rules-DHjLP5Kx.mjs +4 -0
  109. package/dist/{rulesets-lYczEcJp.mjs → rulesets-q4QABpKs.mjs} +7 -7
  110. package/dist/rum-SmT4HZmM.mjs +4 -0
  111. package/dist/{schema-hefO-tzo.mjs → schema-BR31o4P6.mjs} +1 -1
  112. package/dist/{schema-validation-DTq517Em.mjs → schema-validation-vVetgC_P.mjs} +5 -5
  113. package/dist/{scim-BiLfOQ89.mjs → scim-ChOkZpNx.mjs} +2 -2
  114. package/dist/{session-CsvPYFj8.mjs → sdk-DhIhH6GB.mjs} +4 -4
  115. package/dist/{secrets-store-CBX0dvHL.mjs → secrets-store-BAK9G12O.mjs} +12 -12
  116. package/dist/security-center-eScuYDKP.mjs +2 -0
  117. package/dist/security-txt-x7R4gmQu.mjs +3 -0
  118. package/dist/session-DHYCE-PM.mjs +93 -0
  119. package/dist/shared-BAjo72Lz.mjs +2 -0
  120. package/dist/{smart-shield-DblHIce0.mjs → smart-shield-CWlSsNi8.mjs} +2 -2
  121. package/dist/snippets-DrlgYJYp.mjs +4 -0
  122. package/dist/{spawn-DK7pott_.mjs → spawn-CCGzKlC4.mjs} +1 -1
  123. package/dist/{spectrum-CnrG0jIC.mjs → spectrum-pVGxb7u5.mjs} +6 -6
  124. package/dist/speed-ZFrMWDgd.mjs +4 -0
  125. package/dist/src-DU7FBCOX.mjs +108 -0
  126. package/dist/ssl-9JY05sYt.mjs +15 -0
  127. package/dist/{stream-CGTRN4ZN.mjs → stream-tRU39b8K.mjs} +13 -13
  128. package/dist/{tenants-o_M62Y1n.mjs → tenants-HLGUazms.mjs} +1 -1
  129. package/dist/{token-validation-Ca5AGEns.mjs → token-validation-_VdamKpz.mjs} +4 -4
  130. package/dist/{tools-DtNNmO6l.mjs → tools-D_hfUU_Z.mjs} +1 -1
  131. package/dist/{turnstile-l7mo9BWL.mjs → turnstile-BRzXd28B.mjs} +4 -4
  132. package/dist/{ui-B97lRnOv.mjs → ui-erjBdVKL.mjs} +1 -1
  133. package/dist/url-normalization-D-NxuLtN.mjs +3 -0
  134. package/dist/url-scanner-BzzR6iDx.mjs +2 -0
  135. package/dist/{user-CiyYZ69X.mjs → user-C4omq__w.mjs} +1 -1
  136. package/dist/vectorize-By6EqcNR.mjs +4 -0
  137. package/dist/{versions-B6E8WQyA.mjs → versions-CBHwWPAM.mjs} +1 -1
  138. package/dist/{waiting-rooms-Bhy_nuV3.mjs → waiting-rooms-u6KwrzWd.mjs} +6 -6
  139. package/dist/{web3-DlHE0CZc.mjs → web3-DQ5dmE9W.mjs} +3 -3
  140. package/dist/{workers-DRAkU6YR.mjs → workers-D8Be7_as.mjs} +14 -14
  141. package/dist/workers-builds-BE3W3qNk.mjs +7 -0
  142. package/dist/{workflows-z6oapEJs.mjs → workflows-BWWufqFA.mjs} +3 -3
  143. package/dist/zaraz-Bsa9AvVL.mjs +2 -0
  144. package/dist/{zero-trust-fyyIelWx.mjs → zero-trust-UNVZFnKu.mjs} +87 -87
  145. package/dist/zero_trust-B0_Rk4p2.mjs +3 -0
  146. package/dist/{zones-MSULnDwW.mjs → zones-BXtdwt6E.mjs} +6 -6
  147. package/package.json +1 -1
  148. package/dist/ai-DS3i-I1a.mjs +0 -2
  149. package/dist/ai-gateway-RIsegO2x.mjs +0 -8
  150. package/dist/ai-search-Dcj4BauG.mjs +0 -7
  151. package/dist/ai_gateway-w7YwfcPE.mjs +0 -4
  152. package/dist/analytics_engine-B7qgDJCA.mjs +0 -2
  153. package/dist/argo-DnJRVnGX.mjs +0 -2
  154. package/dist/artifacts-BVWKiJUl.mjs +0 -4
  155. package/dist/audit-logs-DjTstbzL.mjs +0 -2
  156. package/dist/auth-BqDOIrKX.mjs +0 -150
  157. package/dist/auth-DKkSwnxh.mjs +0 -5
  158. package/dist/billing-3rEqF83h.mjs +0 -2
  159. package/dist/bot-management-CJxD1pqi.mjs +0 -5
  160. package/dist/botnet-feed-MG91D7BR.mjs +0 -3
  161. package/dist/brand-protection-CK7gJi06.mjs +0 -3
  162. package/dist/certificate-authorities-BR3gXBLs.mjs +0 -2
  163. package/dist/client-certificates-B0ebLJdk.mjs +0 -3
  164. package/dist/cloud-connector-BOjaggJk.mjs +0 -2
  165. package/dist/connectivity-welFvZ7X.mjs +0 -3
  166. package/dist/connector-interrupts-DTV3F-50.mjs +0 -2
  167. package/dist/connector-telemetry-events-kDqb_AGm.mjs +0 -2
  168. package/dist/connector-telemetry-snapshots-DC-wD75E.mjs +0 -2
  169. package/dist/connectors-3vjrdFLB.mjs +0 -3
  170. package/dist/context-CONbNKO-.mjs +0 -2
  171. package/dist/custom-nameservers-BGkAD_PZ.mjs +0 -3
  172. package/dist/custom-pages-5fCSP8in.mjs +0 -4
  173. package/dist/d1-CyiRbZZn.mjs +0 -4
  174. package/dist/data-security-Casx4OS_.mjs +0 -6
  175. package/dist/dcv-delegation-DVYO10oA.mjs +0 -2
  176. package/dist/diagnostics-BqYDoDfw.mjs +0 -3
  177. package/dist/dns-firewall-Coy8d47t.mjs +0 -57
  178. package/dist/durable-objects-BSuRERkw.mjs +0 -2
  179. package/dist/email-sending-CVrRqn6S.mjs +0 -3
  180. package/dist/google-tag-gateway-B00MHDfB.mjs +0 -2
  181. package/dist/hostnames-BdAQo1Mr.mjs +0 -3
  182. package/dist/hyperdrive-99OJV9nl.mjs +0 -18
  183. package/dist/iam-BRbpg3lN.mjs +0 -6
  184. package/dist/intel-C3ajLpXd.mjs +0 -3
  185. package/dist/keyless-certificates-C4MZ4xnf.mjs +0 -3
  186. package/dist/leaked-credential-checks-Dgs2oKm9.mjs +0 -3
  187. package/dist/magic-cloud-networking-D-T0RCvi.mjs +0 -5
  188. package/dist/managed-transforms-CfUBSz9p.mjs +0 -3
  189. package/dist/mtls-certificates-Cf1O8c2E.mjs +0 -3
  190. package/dist/origin-ca-certificates-BB4H89a_.mjs +0 -3
  191. package/dist/origin-post-quantum-encryption-DurP3PXG.mjs +0 -2
  192. package/dist/progress-Cent9Lsg.mjs +0 -2
  193. package/dist/queues-Rf_n11Cx.mjs +0 -6
  194. package/dist/r2-data-catalog-Debz38kv.mjs +0 -14
  195. package/dist/raw-fetch-DnbAMFBp.mjs +0 -2
  196. package/dist/request-tracers-D1aH4NmL.mjs +0 -2
  197. package/dist/rules-B10XWY10.mjs +0 -4
  198. package/dist/rum-B5GUKa4I.mjs +0 -4
  199. package/dist/security-center-AVpTOBK3.mjs +0 -2
  200. package/dist/security-txt-DVlh8y9l.mjs +0 -3
  201. package/dist/shared-0bwWVDLo.mjs +0 -2
  202. package/dist/snippets-DrpqSXYC.mjs +0 -4
  203. package/dist/speed-BzRY3Xlh.mjs +0 -4
  204. package/dist/src-D9_Gq68b.mjs +0 -108
  205. package/dist/ssl-Cp6tQkZH.mjs +0 -15
  206. package/dist/url-normalization-D1CogSIG.mjs +0 -3
  207. package/dist/url-scanner-BnJHJqcz.mjs +0 -2
  208. package/dist/vectorize-D3LgMLOn.mjs +0 -4
  209. package/dist/workers-builds-BmNjiHDZ.mjs +0 -7
  210. package/dist/zaraz-CyzfYOEU.mjs +0 -2
  211. package/dist/zero_trust-BAhlNkjo.mjs +0 -3
  212. /package/dist/{body-parser-CBpeIUns.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
  213. /package/dist/{chunk-6IEM75FG-U3L9fKgi.mjs → chunk-6IEM75FG-BEjRFMGh.mjs} +0 -0
  214. /package/dist/{cli-types-CMNMD1V7.mjs → cli-types-BeyOc81z.mjs} +0 -0
  215. /package/dist/{input-validation-CTqtyiY9.mjs → input-validation-_fMCApaH.mjs} +0 -0
  216. /package/dist/{lib-B6xvCJjc.mjs → lib-4PQI6yRW.mjs} +0 -0
  217. /package/dist/{local-D8bhHUMK.mjs → local-CYc9q7l2.mjs} +0 -0
  218. /package/dist/{metadata-jh2EIan8.mjs → metadata-OOwvpR8m.mjs} +0 -0
  219. /package/dist/{resolve-D1mG0REg.mjs → resolve-C3h-mwp7.mjs} +0 -0
  220. /package/dist/{theme-CFHr0Dh9.mjs → theme-DbNbIY4d.mjs} +0 -0
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,T as t,_ as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./local-D8bhHUMK.mjs";import{t as d}from"./cli-types-CMNMD1V7.mjs";function f(e){return e.option(`device-id`,{type:`string`,description:`The device.id field`}).option(`device-provision-license`,{type:`boolean`,description:`When true, create and provision a new licence key for the connector.`}).option(`device-serial-number`,{type:`string`,description:`The device.serial_number field`}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`,default:!0}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`create`,describe:`Creates a Magic WAN Connector.`,builder:f,handler:async t=>{if(t.dryRun){s({command:`cf connectors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/connectors`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({device:{id:l(t[`device-id`],`device-id`,`text`),provision_license:t[`device-provision-license`],serial_number:l(t[`device-serial-number`],`device-serial-number`,`text`)},activated:t.activated,interrupt_window_days_of_week:t[`interrupt-window-days-of-week`],interrupt_window_duration_hours:t[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:t[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:t[`interrupt-window-hour-of-day`],notes:l(t.notes,`notes`,`text`),primary:t.primary,site_id:l(t[`site-id`],`site-id`,`text`),timezone:l(t.timezone,`timezone`,`text`)}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.connectors.create({...e,account_id:f})),{successLabel:`Created`});return}let p=a({device:{id:l(t[`device-id`],`device-id`,`text`),provision_license:t[`device-provision-license`],serial_number:l(t[`device-serial-number`],`device-serial-number`,`text`)},activated:t.activated,interrupt_window_days_of_week:t[`interrupt-window-days-of-week`],interrupt_window_duration_hours:t[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:t[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:t[`interrupt-window-hour-of-day`],notes:l(t.notes,`notes`,`text`),primary:t.primary,site_id:l(t[`site-id`],`site-id`,`text`),timezone:l(t.timezone,`timezone`,`text`)});o(await c(`Creating`,async()=>d.connectors.create({...p,account_id:f})),{successLabel:`Created`})}};function m(e){return e.positional(`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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <connector-id>`,describe:`Deletes a Magic WAN Connector.`,builder:m,handler:async i=>{if(i.dryRun){s({command:`cf connectors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/connectors/${i[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(i[`connector-id`]))}`,pathParams:{"connector-id":String(i[`connector-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>a.connectors.delete({account_id:l,connector_id:i[`connector-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).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 <connector-id>`,describe:`Edits properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:g,handler:async t=>{if(t.dryRun){s({command:`cf connectors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/connectors/${t[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(t[`connector-id`]))}`,pathParams:{"connector-id":String(t[`connector-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({activated:t.activated,interrupt_window_days_of_week:t[`interrupt-window-days-of-week`],interrupt_window_duration_hours:t[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:t[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:t[`interrupt-window-hour-of-day`],notes:l(t.notes,`notes`,`text`),primary:t.primary,site_id:l(t[`site-id`],`site-id`,`text`),timezone:l(t.timezone,`timezone`,`text`),provision_license:t[`provision-license`]}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.connectors.edit({...e,account_id:f,connector_id:t[`connector-id`]})),{successLabel:`Updated`});return}let p=a({activated:t.activated,interrupt_window_days_of_week:t[`interrupt-window-days-of-week`],interrupt_window_duration_hours:t[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:t[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:t[`interrupt-window-hour-of-day`],notes:l(t.notes,`notes`,`text`),primary:t.primary,site_id:l(t[`site-id`],`site-id`,`text`),timezone:l(t.timezone,`timezone`,`text`),provision_license:t[`provision-license`]});o(await c(`Updating`,async()=>d.connectors.edit({...p,account_id:f,connector_id:t[`connector-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`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 y={command:`get <connector-id>`,describe:`Gets a Magic WAN Connector.`,builder:v,handler:async t=>{if(t.dryRun){s({command:`cf connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/connectors/${t[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(t[`connector-id`]))}`,pathParams:{"connector-id":String(t[`connector-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.connectors.get({account_id:a,connector_id:t[`connector-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`device-type`,{type:`string`,description:`Filter connectors by device type.`,choices:[`MANAGED`,`LICENSED`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists Magic WAN Connectors.`,builder:d(b),handler:async t=>{let i={device_type:t[`device-type`]};if(t.dryRun){s({command:`cf connectors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/connectors`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.connectors.list({account_id:l,...i})),{successLabel:`Loaded`})}};function S(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).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 <connector-id>`,describe:`Updates properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:S,handler:async t=>{if(t.dryRun){s({command:`cf connectors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/connectors/${t[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(t[`connector-id`]))}`,pathParams:{"connector-id":String(t[`connector-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({activated:t.activated,interrupt_window_days_of_week:t[`interrupt-window-days-of-week`],interrupt_window_duration_hours:t[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:t[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:t[`interrupt-window-hour-of-day`],notes:l(t.notes,`notes`,`text`),primary:t.primary,site_id:l(t[`site-id`],`site-id`,`text`),timezone:l(t.timezone,`timezone`,`text`),provision_license:t[`provision-license`]}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.connectors.update({...e,account_id:f,connector_id:t[`connector-id`]})),{successLabel:`Updated`});return}let p=a({activated:t.activated,interrupt_window_days_of_week:t[`interrupt-window-days-of-week`],interrupt_window_duration_hours:t[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:t[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:t[`interrupt-window-hour-of-day`],notes:l(t.notes,`notes`,`text`),primary:t.primary,site_id:l(t[`site-id`],`site-id`,`text`),timezone:l(t.timezone,`timezone`,`text`),provision_license:t[`provision-license`]});o(await c(`Updating`,async()=>d.connectors.update({...p,account_id:f,connector_id:t[`connector-id`]})),{successLabel:`Updated`})}},w={command:`connectors`,describe:`connectors`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as e}from"./theme-CFHr0Dh9.mjs";import{n as t,r as n}from"./ui-B97lRnOv.mjs";import{b as r,f as i,g as a,h as o,m as s,p as c,r as l,t as u,w as d,y as f}from"./auth-BqDOIrKX.mjs";import{n as p,r as m}from"./config-7CBz8Xm0.mjs";import{t as h}from"./output-CUxZRM5A.mjs";const g={command:`clear [key]`,describe:`Clear a default context value`,builder:e=>e.positional(`key`,{type:`string`,description:`Context key to clear`,choices:i}).option(`all`,{type:`boolean`,description:`Clear all context defaults`,default:!1}).option(`project`,{type:`boolean`,alias:`p`,description:`Clear from project .cfrc instead of user config`,default:!1}).check(e=>{if(!e.key&&!e.all)throw Error(`Please specify a key to clear, or use --all to clear everything`);return!0}),handler:async s=>{let l=s.project?`project`:`user`;if(s.all){o(`all`,l);let i=l===`project`?r():p();if(l===`project`){let r=a();console.log(r?n(`Deleted ${e.muted(r.path)}`):t(`No project config found to delete`))}else console.log(n(`Cleared all defaults from ${e.muted(i)}`));return}let u=s.key?c[s.key]:void 0;u||(console.error(e.error(`Unknown key "${s.key}". Options: ${i.join(`, `)}.`)),process.exit(1)),o(u,l);let d=l===`project`?r():p();console.log(n(`Cleared ${s.key} from ${e.muted(d)}`))}},_={command:`set <key> <value>`,describe:`Set a default context value`,builder:e=>e.positional(`key`,{type:`string`,description:`Context key to set`,choices:i,demandOption:!0}).positional(`value`,{type:`string`,description:`Value to set`,demandOption:!0}).option(`project`,{type:`boolean`,alias:`p`,description:`Save to project .cfrc instead of user config`,default:!1}),handler:async t=>{let a=t.project?`project`:`user`,o=c[t.key];o||(console.error(e.error(`Unknown key "${t.key}". Options: ${i.join(`, `)}.`)),process.exit(1)),o===`complianceRegion`&&(s.includes(t.value)||(console.error(e.error(`Invalid compliance region "${t.value}". Must be one of: ${s.join(`, `)}`)),process.exit(1)));let f;if(o===`accountId`||o===`zone`){let t;try{t=await l()}catch{console.error(e.error(`Please authenticate first with `)+e.code(`cf auth login`)),process.exit(1)}f=u({apiToken:t})}let m=await d(o,t.value,a,f),h=a===`project`?r():p();console.log(n(`Saved ${t.key} "${e.bold(m.displayName)}" to ${e.muted(h)}`))}};async function v(e,t){try{return(await t.accounts.list({})).result.find(t=>t.id===e)?.name}catch{return}}async function y(e,t){try{return(await t.zones.list({})).result.find(t=>t.id===e||t.name===e)?.name}catch{return}}const b={command:`show`,describe:`Show current context (default account and zone)`,builder:e=>e,handler:async e=>{let t=await f(),n=m(),r=a(),i;try{i=u({apiToken:await l()})}catch{}if(i){if(t.accountId){let e=await v(t.accountId.value,i);e&&(t.accountId.name=e)}if(t.zone){let e=await y(t.zone.value,i);e&&(t.zone.name=e)}}h({accountId:t.accountId||null,zone:t.zone||null,complianceRegion:t.complianceRegion||null,env:{CLOUDFLARE_ACCOUNT_ID:process.env.CLOUDFLARE_ACCOUNT_ID||null,CLOUDFLARE_ZONE_ID:process.env.CLOUDFLARE_ZONE_ID||null,CLOUDFLARE_COMPLIANCE_REGION:process.env.CLOUDFLARE_COMPLIANCE_REGION||null},files:{userConfig:p(),userConfigExists:!!n,projectConfig:r?.path||null}})}},x={command:`context`,describe:`Manage default project environment context, for example account`,builder:e=>e.command(b).command(_).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{x as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,T as n,_ as r,n as i}from"./auth-BqDOIrKX.mjs";import{n as a,t as o}from"./body-parser-CBpeIUns.mjs";import{t as s}from"./output-CUxZRM5A.mjs";import{n as c,t as l}from"./progress-Cent9Lsg.mjs";import{n as u}from"./input-validation-CTqtyiY9.mjs";import{t as d}from"./local-D8bhHUMK.mjs";function f(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 p={command:`create`,describe:`Adds a custom nameserver to the account for use as a vanity nameserver on zones.`,builder:f,handler:async n=>{if(n.dryRun){c({command:`cf custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`json`,body:n.body===void 0?o({ns_name:u(n[`ns-name`],`ns-name`,`text`),ns_set:n[`ns-set`]}):a(n.body)});return}let f=await i(n),p=n.local?d:await r(f);if(n.accountId=p,n.body){let e=a(n.body);s(await l(`Creating`,async()=>f.customNameservers.create({body:e,account_id:p})),{successLabel:`Created`});return}n[`ns-name`]===void 0&&(n[`ns-name`]=await t(`ns-name`,`The FQDN of the name server.`));let m=o({ns_name:u(n[`ns-name`],`ns-name`,`text`),ns_set:n[`ns-set`]});s(await l(`Creating`,async()=>f.customNameservers.create({body:m,account_id:p})),{successLabel:`Created`})}};function m(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 h={command:`delete <custom-ns-id>`,describe:`Removes a custom nameserver from the account.`,builder:m,handler:async t=>{if(t.dryRun){c({command:`cf custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_ns/${t[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(t[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(t[`custom-ns-id`]??``)},bodyKind:`none`});return}let a=await i(t),o=t.local?d:await r(a);if(t.accountId=o,!await n({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}s(await l(`Deleting`,async()=>a.customNameservers.delete({account_id:o,custom_ns_id:t[`custom-ns-id`]})),{successLabel:`Deleted`})}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`List an account's custom nameservers.`,builder:g,handler:async t=>{if(t.dryRun){c({command:`cf custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`none`});return}let n=await i(t),a=t.local?d:await r(n);t.accountId=a,s(await l(`Loading`,async()=>n.customNameservers.get({account_id:a})),{successLabel:`Loaded`})}},v={command:`custom-nameservers`,describe:`Vanity nameservers that use your own domain instead of Cloudflare-assigned NS records`,builder:e=>e.command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{v as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,S as r,T as i,_ as a,n as o}from"./auth-BqDOIrKX.mjs";import{n as s,t as c}from"./body-parser-CBpeIUns.mjs";import{t as l}from"./output-CUxZRM5A.mjs";import{n as u,t as d}from"./progress-Cent9Lsg.mjs";import{n as f}from"./input-validation-CTqtyiY9.mjs";import{t as p}from"./local-D8bhHUMK.mjs";import{t as m}from"./cli-types-CMNMD1V7.mjs";function h(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 g={command:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:m(h),handler:async r=>{if(r.dryRun){u({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_pages/${r.identifier==null?`<identifier>`:encodeURIComponent(String(r.identifier))}`,pathParams:{identifier:String(r.identifier??``)},bodyKind:`json`,body:r.body===void 0?c({state:f(r.state,`state`,`text`),url:f(r.url,`url`,`text`)}):s(r.body)});return}let i=await o(r),m=r.local?p:await a(i);if(r.accountId=m,r.body){let e=s(r.body);l(await d(`Updating`,async()=>i.customPages.accountCustomPages.update({...e,account_identifier:m,identifier:r.identifier})),{successLabel:`Updated`});return}r.state===void 0&&(r.state=await n(`state`,`The custom page state.`,[`default`,`customized`])),r.url===void 0&&(r.url=await t(`url`,`The URL associated with the custom page.`));let h=c({state:f(r.state,`state`,`text`),url:f(r.url,`url`,`text`)});l(await d(`Updating`,async()=>i.customPages.accountCustomPages.update({...h,account_identifier:m,identifier:r.identifier})),{successLabel:`Updated`})}},_={command:`account-custom-pages`,describe:`Operations for account-custom-pages`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(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 y={command:`asset`,describe:`Creates a new custom asset at the account level.`,builder:v,handler:async n=>{if(n.dryRun){u({command:`cf custom-pages assets create custom asset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_pages/assets`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({description:f(n.description,`description`,`text`),name:f(n.name,`name`,`text`),url:f(n.url,`url`,`text`)}):s(n.body)});return}let r=await o(n),i=n.local?p:await a(r);if(n.accountId=i,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.customPages.assets.create.custom.asset({...e,account_identifier:i})),{successLabel:`Created`});return}n.description===void 0&&(n.description=await t(`description`,`A short description of the custom asset.`)),n.name===void 0&&(n.name=await t(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),n.url===void 0&&(n.url=await t(`url`,`The URL where the asset content is fetched from.`));let m=c({description:f(n.description,`description`,`text`),name:f(n.name,`name`,`text`),url:f(n.url,`url`,`text`)});l(await d(`Creating`,async()=>r.customPages.assets.create.custom.asset({...m,account_identifier:i})),{successLabel:`Created`})}},b={command:`custom`,describe:`Operations for assets.create.custom`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).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 S={command:`v2 <zone-identifier>`,describe:`Creates a new custom asset at the zone level.`,builder:x,handler:async e=>{if(e.dryRun){u({command:`cf custom-pages assets create v2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?c({description:f(e.description,`description`,`text`),name:f(e.name,`name`,`text`),url:f(e.url,`url`,`text`)}):s(e.body)});return}let n=await o(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.customPages.assets.create.v2({...t,zone_identifier:i})),{successLabel:`Created`});return}e.description===void 0&&(e.description=await t(`description`,`A short description of the custom asset.`)),e.name===void 0&&(e.name=await t(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),e.url===void 0&&(e.url=await t(`url`,`The URL where the asset content is fetched from.`));let a=c({description:f(e.description,`description`,`text`),name:f(e.name,`name`,`text`),url:f(e.url,`url`,`text`)});l(await d(`Creating`,async()=>n.customPages.assets.create.v2({...a,zone_identifier:i})),{successLabel:`Created`})}},C={command:`create`,describe:`Operations for assets.create`,builder:e=>e.command(S).command(b).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 t=>{if(t.dryRun){u({command:`cf custom-pages assets delete custom asset`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_pages/assets/${t[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(t[`asset-name`]))}`,pathParams:{"asset-name":String(t[`asset-name`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);if(t.accountId=r,!await i({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}l(await d(`Deleting`,async()=>n.customPages.assets.delete.custom.asset({account_identifier:r,asset_name:t[`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:()=>{}};function D(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(`zone-identifier`,{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 O={command:`v2 <asset-name>`,describe:`Deletes an existing custom asset.`,builder:D,handler:async e=>{if(e.dryRun){u({command:`cf custom-pages assets delete v2`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await i({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}l(await d(`Deleting`,async()=>t.customPages.assets.delete.v2({zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Deleted`})}},k={command:`delete`,describe:`Operations for assets.delete`,builder:e=>e.command(O).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(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 j={command:`asset <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:A,handler:async t=>{if(t.dryRun){u({command:`cf custom-pages assets get custom asset`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_pages/assets/${t[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(t[`asset-name`]))}`,pathParams:{"asset-name":String(t[`asset-name`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);t.accountId=r,l(await d(`Loading`,async()=>n.customPages.assets.get.custom.asset({account_identifier:r,asset_name:t[`asset-name`]})),{successLabel:`Loaded`})}},M={command:`custom`,describe:`Operations for assets.get.custom`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(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(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`v2 <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:N,handler:async e=>{if(e.dryRun){u({command:`cf custom-pages assets get v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.customPages.assets.get.v2({zone_identifier:n,asset_name:e[`asset-name`]})),{successLabel:`Loaded`})}},F={command:`get`,describe:`Operations for assets.get`,builder:e=>e.command(P).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(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 ee={command:`assets`,describe:`Fetches all the custom assets at the account level.`,builder:I,handler:async t=>{let n={page:t.page,per_page:t[`per-page`]};if(t.dryRun){u({command:`cf custom-pages assets list custom assets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_pages/assets`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),i=t.local?p:await a(r);t.accountId=i,l(await d(`Loading`,async()=>r.customPages.assets.list.custom.assets({account_identifier:i,...n})),{successLabel:`Loaded`})}},L={command:`custom`,describe:`Operations for assets.list.custom`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.positional(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).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 z={command:`v2 <zone-identifier>`,describe:`Fetches all the custom assets at the zone level.`,builder:R,handler:async e=>{let t={page:e.page,per_page:e[`per-page`]};if(e.dryRun){u({command:`cf custom-pages assets list v2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},query:t,bodyKind:`none`});return}let n=await o(e),i=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>n.customPages.assets.list.v2({zone_identifier:i,...t})),{successLabel:`Loaded`})}},B={command:`list`,describe:`Operations for assets.list`,builder:e=>e.command(z).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(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 H={command:`asset <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:V,handler:async n=>{if(n.dryRun){u({command:`cf custom-pages assets update custom asset`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_pages/assets/${n[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(n[`asset-name`]))}`,pathParams:{"asset-name":String(n[`asset-name`]??``)},bodyKind:`json`,body:n.body===void 0?c({description:f(n.description,`description`,`text`),url:f(n.url,`url`,`text`)}):s(n.body)});return}let r=await o(n),i=n.local?p:await a(r);if(n.accountId=i,n.body){let e=s(n.body);l(await d(`Updating`,async()=>r.customPages.assets.update.custom.asset({...e,account_identifier:i,asset_name:n[`asset-name`]})),{successLabel:`Updated`});return}n.description===void 0&&(n.description=await t(`description`,`A short description of the custom asset.`)),n.url===void 0&&(n.url=await t(`url`,`The URL where the asset content is fetched from.`));let m=c({description:f(n.description,`description`,`text`),url:f(n.url,`url`,`text`)});l(await d(`Updating`,async()=>r.customPages.assets.update.custom.asset({...m,account_identifier:i,asset_name:n[`asset-name`]})),{successLabel:`Updated`})}},U={command:`custom`,describe:`Operations for assets.update.custom`,builder:e=>e.command(H).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(`zone-identifier`,{type:`string`,description:`Identifier.`,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 G={command:`v2 <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:W,handler:async e=>{if(e.dryRun){u({command:`cf custom-pages assets update v2`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?c({description:f(e.description,`description`,`text`),url:f(e.url,`url`,`text`)}):s(e.body)});return}let n=await o(e),i=await r({zone:e.zone},n,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>n.customPages.assets.update.v2({...t,zone_identifier:i,asset_name:e[`asset-name`]})),{successLabel:`Updated`});return}e.description===void 0&&(e.description=await t(`description`,`A short description of the custom asset.`)),e.url===void 0&&(e.url=await t(`url`,`The URL where the asset content is fetched from.`));let a=c({description:f(e.description,`description`,`text`),url:f(e.url,`url`,`text`)});l(await d(`Updating`,async()=>n.customPages.assets.update.v2({...a,zone_identifier:i,asset_name:e[`asset-name`]})),{successLabel:`Updated`})}},K={command:`update`,describe:`Operations for assets.update`,builder:e=>e.command(G).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`assets`,describe:`Operations for assets`,builder:e=>e.command(C).command(k).command(F).command(B).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(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 Y={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:m(J),handler:async t=>{if(t.dryRun){u({command:`cf custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_pages/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}`,pathParams:{identifier:String(t.identifier??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);t.accountId=r,l(await d(`Loading`,async()=>n.customPages.get({account_identifier:r,identifier:t.identifier})),{successLabel:`Loaded`})}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:`Fetches all the custom pages at the account level.`,builder:X,handler:async t=>{if(t.dryRun){u({command:`cf custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/custom_pages`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?p:await a(n);t.accountId=r,l(await d(`Loading`,async()=>n.customPages.list({account_identifier:r})),{successLabel:`Loaded`})}};function Q(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,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 $={command:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:m(Q),handler:async e=>{if(e.dryRun){u({command:`cf custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`json`,body:e.body===void 0?c({state:f(e.state,`state`,`text`),url:f(e.url,`url`,`text`)}):s(e.body)});return}let i=await o(e),a=await r({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,e.body){let t=s(e.body);l(await d(`Updating`,async()=>i.customPages.update({...t,zone_identifier:a,identifier:e.identifier})),{successLabel:`Updated`});return}e.state===void 0&&(e.state=await n(`state`,`The custom page state.`,[`default`,`customized`])),e.url===void 0&&(e.url=await t(`url`,`The URL associated with the custom page.`));let p=c({state:f(e.state,`state`,`text`),url:f(e.url,`url`,`text`)});l(await d(`Updating`,async()=>i.customPages.update({...p,zone_identifier:a,identifier:e.identifier})),{successLabel:`Updated`})}};function te(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:m(te),handler:async e=>{if(e.dryRun){u({command:`cf custom-pages zone-custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``),"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.customPages.zoneCustomPages.get({zone_identifier:n,identifier:e.identifier})),{successLabel:`Loaded`})}};function re(e){return e.option(`zone-identifier`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`Fetches all the custom pages at the zone level.`,builder:re,handler:async e=>{if(e.dryRun){u({command:`cf custom-pages zone-custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_pages`,pathParams:{"zone-identifier":String(e.zone??e[`zone-identifier`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.customPages.zoneCustomPages.list({zone_identifier:n})),{successLabel:`Loaded`})}},ae={command:`zone-custom-pages`,describe:`Operations for zone-custom-pages`,builder:e=>e.command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},oe={command:`custom-pages`,describe:`Custom error and challenge pages (1000s, WAF blocks, captchas) for zones and accounts`,builder:e=>e.command(Y).command(Z).command($).command(_).command(q).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{oe as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";import{t as p}from"./cli-types-CMNMD1V7.mjs";function m(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`]}).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 h={command:`create`,describe:`Returns the created D1 database.`,builder:m,handler:async n=>{if(n.dryRun){l({command:`cf d1 create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({jurisdiction:d(n.jurisdiction,`jurisdiction`,`text`),name:d(n.name,`name`,`text`),primary_location_hint:d(n[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:d(n[`read-replication-mode`],`read-replication-mode`,`text`)}}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.d1.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await t(`name`,`D1 database name.`));let m=s({jurisdiction:d(n.jurisdiction,`jurisdiction`,`text`),name:d(n.name,`name`,`text`),primary_location_hint:d(n[`primary-location-hint`],`primary-location-hint`,`text`),read_replication:{mode:d(n[`read-replication-mode`],`read-replication-mode`,`text`)}});c(await u(`Creating`,async()=>r.d1.create({...m,account_id:p})),{successLabel:`Created`})}};function g(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 _={command:`delete <database-id>`,describe:`Deletes the specified D1 database.`,builder:g,handler:async t=>{if(t.dryRun){l({command:`cf d1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>n.d1.delete({account_id:o,database_id:t[`database-id`]})),{successLabel:`Deleted`})}};function v(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 y={command:`edit <database-id>`,describe:`Updates partially the specified D1 database.`,builder:v,handler:async t=>{if(t.dryRun){l({command:`cf d1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({read_replication:{mode:d(t[`read-replication-mode`],`read-replication-mode`,`text`)}}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.d1.edit({...e,account_id:r,database_id:t[`database-id`]})),{successLabel:`Updated`});return}let p=s({read_replication:{mode:d(t[`read-replication-mode`],`read-replication-mode`,`text`)}});c(await u(`Updating`,async()=>n.d1.edit({...p,account_id:r,database_id:t[`database-id`]})),{successLabel:`Updated`})}};function b(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 x={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:b,handler:async t=>{if(t.dryRun){l({command:`cf d1 export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/export`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({current_bookmark:d(t[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:t[`dump-options-no-data`],no_schema:t[`dump-options-no-schema`],tables:t[`dump-options-tables`]},output_format:d(t[`output-format`],`output-format`,`text`)}):o(t.body)});return}let r=await a(t),p=t.local?f:await i(r);if(t.accountId=p,t.body){let e=o(t.body);c(await u(`Loading`,async()=>r.d1.export({...e,account_id:p,database_id:t[`database-id`]})),{successLabel:`Loaded`});return}t[`output-format`]===void 0&&(t[`output-format`]=await n(`output-format`,`Specifies that you will poll this endpoint until the export completes`,[`polling`]));let m=s({current_bookmark:d(t[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:t[`dump-options-no-data`],no_schema:t[`dump-options-no-schema`],tables:t[`dump-options-tables`]},output_format:d(t[`output-format`],`output-format`,`text`)});c(await u(`Loading`,async()=>r.d1.export({...m,account_id:p,database_id:t[`database-id`]})),{successLabel:`Loaded`})}};function S(e){return e.positional(`database-id`,{type:`string`,description:`D1 database identifier (UUID).`,demandOption:!0}).option(`fields`,{type:`string`,description:`Comma-separated list of fields to include in the response. When omitted,
4
- all fields are returned.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <database-id>`,describe:`Returns the specified D1 database.`,builder:p(S),handler:async t=>{let n={fields:t.fields};if(t.dryRun){l({command:`cf d1 get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.d1.get({account_id:o,database_id:t[`database-id`],...n})),{successLabel:`Loaded`})}};function w(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 T={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:w,handler:async t=>{if(t.dryRun){l({command:`cf d1 import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/import`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({action:d(t.action,`action`,`text`),etag:d(t.etag,`etag`,`text`),filename:d(t.filename,`filename`,`text`),current_bookmark:d(t[`current-bookmark`],`current-bookmark`,`text`)}):o(t.body)});return}let r=await a(t),p=t.local?f:await i(r);if(t.accountId=p,t.body){let e=o(t.body);c(await u(`Creating`,async()=>r.d1.import({body:e,account_id:p,database_id:t[`database-id`]})),{successLabel:`Created`});return}t.action===void 0&&(t.action=await n(`action`,`Indicates you have a new SQL file to upload.`,[`init`,`ingest`,`poll`]));let m=s({action:d(t.action,`action`,`text`),etag:d(t.etag,`etag`,`text`),filename:d(t.filename,`filename`,`text`),current_bookmark:d(t[`current-bookmark`],`current-bookmark`,`text`)});c(await u(`Creating`,async()=>r.d1.import({body:m,account_id:p,database_id:t[`database-id`]})),{successLabel:`Created`})}};function E(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 D={command:`list`,describe:`Returns a list of D1 databases.`,builder:E,handler:async t=>{let n={name:t.name,page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf d1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.d1.list({account_id:o,...n})),{successLabel:`Loaded`})}};function O(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 k={command:`query <database-id>`,describe:`Returns the query result as an object.`,builder:O,handler:async t=>{if(t.dryRun){l({command:`cf d1 query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/query`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({params:t.params,sql:d(t.sql,`sql`,`text`)}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Loading`,async()=>n.d1.query({body:e,account_id:r,database_id:t[`database-id`]})),{successLabel:`Loaded`});return}let p=s({params:t.params,sql:d(t.sql,`sql`,`text`)});c(await u(`Loading`,async()=>n.d1.query({body:p,account_id:r,database_id:t[`database-id`]})),{successLabel:`Loaded`})}};function A(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 j={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:A,handler:async t=>{if(t.dryRun){l({command:`cf d1 raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/raw`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({params:t.params,sql:d(t.sql,`sql`,`text`)}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Loading`,async()=>n.d1.raw({body:e,account_id:r,database_id:t[`database-id`]})),{successLabel:`Loaded`});return}let p=s({params:t.params,sql:d(t.sql,`sql`,`text`)});c(await u(`Loading`,async()=>n.d1.raw({body:p,account_id:r,database_id:t[`database-id`]})),{successLabel:`Loaded`})}};function M(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 N={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:M,handler:async t=>{let n={timestamp:t.timestamp};if(t.dryRun){l({command:`cf d1 time-travel get-bookmark`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/time_travel/bookmark`,pathParams:{"database-id":String(t[`database-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.d1.timeTravel.getBookmark({account_id:o,database_id:t[`database-id`],...n})),{successLabel:`Loaded`})}};function P(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 F={command:`restore <database-id>`,describe:`Restores a D1 database to a previous point in time either via a bookmark or a timestamp.`,builder:P,handler:async t=>{let n={bookmark:t.bookmark,timestamp:t.timestamp};if(t.dryRun){l({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(t[`database-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Creating`,async()=>r.d1.timeTravel.restore({account_id:o,database_id:t[`database-id`],...n})),{successLabel:`Created`})}},I={command:`time-travel`,describe:`Operations for time-travel`,builder:e=>e.command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(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 R={command:`update <database-id>`,describe:`Updates the specified D1 database.`,builder:L,handler:async t=>{if(t.dryRun){l({command:`cf d1 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/d1/database/${t[`database-id`]==null?`<database-id>`:encodeURIComponent(String(t[`database-id`]))}`,pathParams:{"database-id":String(t[`database-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({read_replication:{mode:d(t[`read-replication-mode`],`read-replication-mode`,`text`)}}):o(t.body)});return}let r=await a(t),p=t.local?f:await i(r);if(t.accountId=p,t.body){let e=o(t.body);c(await u(`Updating`,async()=>r.d1.update({...e,account_id:p,database_id:t[`database-id`]})),{successLabel:`Updated`});return}t[`read-replication-mode`]===void 0&&(t[`read-replication-mode`]=await n(`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=s({read_replication:{mode:d(t[`read-replication-mode`],`read-replication-mode`,`text`)}});c(await u(`Updating`,async()=>r.d1.update({...m,account_id:p,database_id:t[`database-id`]})),{successLabel:`Updated`})}},z={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(h).command(_).command(y).command(x).command(C).command(T).command(D).command(k).command(j).command(R).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{z as default};
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";import{t as p}from"./cli-types-CMNMD1V7.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 t=>{if(t.dryRun){l({command:`cf data-security posture archiveFindingInstance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/instances/archive`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({check_instances:t[`check-instances`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.archiveFindingInstance({body:e,account_id:r,finding_id:t[`finding-id`]})),{successLabel:`Created`});return}if(t[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let d=s({check_instances:t[`check-instances`]});c(await u(`Creating`,async()=>n.dataSecurity.posture.archiveFindingInstance({body:d,account_id:r,finding_id:t[`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 t=>{if(t.dryRun){l({command:`cf data-security posture changeFindingSeverity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/tune_finding_severity`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({new_severity:t[`new-severity`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.changeFindingSeverity({...e,account_id:r,finding_id:t[`finding-id`]})),{successLabel:`Created`});return}if(t[`new-severity`]===void 0)throw Error(`--new-severity is required (or pass --body with this field set).`);let d=s({new_severity:t[`new-severity`]});c(await u(`Creating`,async()=>n.dataSecurity.posture.changeFindingSeverity({...d,account_id:r,finding_id:t[`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 t=>{if(t.dryRun){l({command:`cf data-security posture createContentExport`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/content/export`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({dlp_profile_id:t[`dlp-profile-id`],integration_id:t[`integration-id`],max_affliction_date:d(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(t[`min-affliction-date`],`min-affliction-date`,`text`),search:d(t.search,`search`,`text`),vendors:t.vendors}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createContentExport({...e,account_id:r})),{successLabel:`Created`});return}let p=s({dlp_profile_id:t[`dlp-profile-id`],integration_id:t[`integration-id`],max_affliction_date:d(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(t[`min-affliction-date`],`min-affliction-date`,`text`),search:d(t.search,`search`,`text`),vendors:t.vendors});c(await u(`Creating`,async()=>n.dataSecurity.posture.createContentExport({...p,account_id:r})),{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 t=>{if(t.dryRun){l({command:`cf data-security posture createFindingExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/export`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({ignored:t.ignored,integration_id:t[`integration-id`],max_affliction_date:d(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(t[`min-affliction-date`],`min-affliction-date`,`text`),search:d(t.search,`search`,`text`),severities:t.severities,vendors:t.vendors}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createFindingExportCsv({...e,account_id:r})),{successLabel:`Created`});return}let p=s({ignored:t.ignored,integration_id:t[`integration-id`],max_affliction_date:d(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(t[`min-affliction-date`],`min-affliction-date`,`text`),search:d(t.search,`search`,`text`),severities:t.severities,vendors:t.vendors});c(await u(`Creating`,async()=>n.dataSecurity.posture.createFindingExportCsv({...p,account_id:r})),{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 t=>{if(t.dryRun){l({command:`cf data-security posture createFindingInstancesExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/${t[`storage-namespace-id`]==null?`<storage-namespace-id>`:encodeURIComponent(String(t[`storage-namespace-id`]))}/instances/export`,pathParams:{"storage-namespace-id":String(t[`storage-namespace-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({archived:t.archived,max_affliction_date:d(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(t[`min-affliction-date`],`min-affliction-date`,`text`),search:d(t.search,`search`,`text`)}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createFindingInstancesExportCsv({...e,account_id:r,storage_namespace_id:t[`storage-namespace-id`]})),{successLabel:`Created`});return}let p=s({archived:t.archived,max_affliction_date:d(t[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(t[`min-affliction-date`],`min-affliction-date`,`text`),search:d(t.search,`search`,`text`)});c(await u(`Creating`,async()=>n.dataSecurity.posture.createFindingInstancesExportCsv({...p,account_id:r,storage_namespace_id:t[`storage-namespace-id`]})),{successLabel:`Created`})}};function C(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 w={command:`createRemediationJobs`,describe:`Create one or more remediation jobs tied to a specific Cloudflare Account.`,builder:C,handler:async n=>{if(n.dryRun){l({command:`cf data-security posture createRemediationJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({finding_instance_ids:n[`finding-instance-ids`],remediation_type_id:d(n[`remediation-type-id`],`remediation-type-id`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.dataSecurity.posture.createRemediationJobs({...e,account_id:p})),{successLabel:`Created`});return}if(n[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);n[`remediation-type-id`]===void 0&&(n[`remediation-type-id`]=await t(`remediation-type-id`,`A UUID identifying this Remediation Type.`));let m=s({finding_instance_ids:n[`finding-instance-ids`],remediation_type_id:d(n[`remediation-type-id`],`remediation-type-id`,`text`)});c(await u(`Creating`,async()=>r.dataSecurity.posture.createRemediationJobs({...m,account_id:p})),{successLabel:`Created`})}};function T(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 E={command:`createRemediationJobsExportCSV`,describe:`Creates a CSV export for remediation jobs and accepts optional filters in the payload.`,builder:T,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture createRemediationJobsExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/remediations/jobs/export`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({integration_id:t[`integration-id`],max_updated_at:d(t[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:d(t[`min-updated-at`],`min-updated-at`,`text`),search:d(t.search,`search`,`text`),status:t.status}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createRemediationJobsExportCsv({...e,account_id:r})),{successLabel:`Created`});return}let p=s({integration_id:t[`integration-id`],max_updated_at:d(t[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:d(t[`min-updated-at`],`min-updated-at`,`text`),search:d(t.search,`search`,`text`),status:t.status});c(await u(`Creating`,async()=>n.dataSecurity.posture.createRemediationJobsExportCsv({...p,account_id:r})),{successLabel:`Created`})}};function D(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 O={command:`createWebhook`,describe:`Creates a new webhook configuration for sending finding notifications to external endpoints.`,builder:D,handler:async r=>{if(r.dryRun){l({command:`cf data-security posture createWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({authentication_type:d(r[`authentication-type`],`authentication-type`,`text`),destination_url:d(r[`destination-url`],`destination-url`,`text`),label:d(r.label,`label`,`text`),signing_secret:d(r[`signing-secret`],`signing-secret`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...e,account_id:m})),{successLabel:`Created`});return}r[`authentication-type`]===void 0&&(r[`authentication-type`]=await n(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),r[`destination-url`]===void 0&&(r[`destination-url`]=await t(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),r.label===void 0&&(r.label=await t(`label`,`Account-specified display label for the webhook configuration.`));let h=s({authentication_type:d(r[`authentication-type`],`authentication-type`,`text`),destination_url:d(r[`destination-url`],`destination-url`,`text`),label:d(r.label,`label`,`text`),signing_secret:d(r[`signing-secret`],`signing-secret`,`text`)});c(await u(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...h,account_id:m})),{successLabel:`Created`})}};function k(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 webhook jobs`})}const A={command:`createWebhookJobs`,describe:`Creates webhook jobs to send a finding instance to one or more configured webhooks.`,builder:k,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture createWebhookJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/webhooks/jobs`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({finding_instance_ids:t[`finding-instance-ids`],webhook_ids:t[`webhook-ids`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createWebhookJobs({...e,account_id:r})),{successLabel:`Created`});return}if(t[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);if(t[`webhook-ids`]===void 0)throw Error(`--webhook-ids is required (or pass --body with this field set).`);let d=s({finding_instance_ids:t[`finding-instance-ids`],webhook_ids:t[`webhook-ids`]});c(await u(`Creating`,async()=>n.dataSecurity.posture.createWebhookJobs({...d,account_id:r})),{successLabel:`Created`})}};function j(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 M={command:`delete <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:j,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}`,pathParams:{"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>n.dataSecurity.posture.delete({account_id:o,webhook_id:t[`webhook-id`]})),{successLabel:`Deleted`})}};function N(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 P={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:N,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture evaluateExistingWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}/evaluate`,pathParams:{"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Creating`,async()=>n.dataSecurity.posture.evaluateExistingWebhook({account_id:r,webhook_id:t[`webhook-id`]})),{successLabel:`Created`})}};function F(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 I={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:F,handler:async r=>{if(r.dryRun){l({command:`cf data-security posture evaluateNewWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/webhooks/evaluate`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({authentication_type:d(r[`authentication-type`],`authentication-type`,`text`),destination_url:d(r[`destination-url`],`destination-url`,`text`),signing_secret:d(r[`signing-secret`],`signing-secret`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.dataSecurity.posture.evaluateNewWebhook({...e,account_id:m})),{successLabel:`Created`});return}r[`authentication-type`]===void 0&&(r[`authentication-type`]=await n(`authentication-type`,`Type of authentication to use for the test webhook request.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),r[`destination-url`]===void 0&&(r[`destination-url`]=await t(`destination-url`,`Target URL to send the test webhook event to.`));let h=s({authentication_type:d(r[`authentication-type`],`authentication-type`,`text`),destination_url:d(r[`destination-url`],`destination-url`,`text`),signing_secret:d(r[`signing-secret`],`signing-secret`,`text`)});c(await u(`Creating`,async()=>p.dataSecurity.posture.evaluateNewWebhook({...h,account_id:m})),{successLabel:`Created`})}};function L(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 R={command:`getExportJob <id>`,describe:`Retrieves a single export job by its unique identifier`,builder:L,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture getExportJob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/exports/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.dataSecurity.posture.getExportJob({account_id:r,id:t.id})),{successLabel:`Loaded`})}};function z(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 te={command:`getFinding <finding-id>`,describe:`Gets a security Finding that has been identified as being problematic.`,builder:z,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture getFinding`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.dataSecurity.posture.getFinding({account_id:r,finding_id:t[`finding-id`]})),{successLabel:`Loaded`})}};function B(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 V={command:`getFindingInstance <instance-id>`,describe:`Gets a security Finding instance by id.`,builder:B,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture getFindingInstance`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/instances/${t[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(t[`instance-id`]))}`,pathParams:{"finding-id":String(t[`finding-id`]??``),"instance-id":String(t[`instance-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.dataSecurity.posture.getFindingInstance({account_id:r,finding_id:t[`finding-id`],instance_id:t[`instance-id`]})),{successLabel:`Loaded`})}};function H(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 U={command:`getFindingType <finding-type-id>`,describe:`Retrieve a specific finding type by its unique identifier.`,builder:H,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture getFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/finding_types/${t[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(t[`finding-type-id`]))}`,pathParams:{"finding-type-id":String(t[`finding-type-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.dataSecurity.posture.getFindingType({account_id:r,finding_type_id:t[`finding-type-id`]})),{successLabel:`Loaded`})}};function W(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 G={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:W,handler:async t=>{let n={integration_id:t[`integration-id`],cursor:t.cursor,page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf data-security posture getRemediationTypesForFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/finding_types/${t[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(t[`finding-type-id`]))}/remediation_types`,pathParams:{"finding-type-id":String(t[`finding-type-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.dataSecurity.posture.getRemediationTypesForFindingType({account_id:o,finding_type_id:t[`finding-type-id`],...n})),{successLabel:`Loaded`})}};function K(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 q={command:`getWebhookConfigByID <webhook-id>`,describe:`Retrieves a specific webhook configuration by its unique identifier.`,builder:K,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture getWebhookConfigByID`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/webhooks/${t[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(t[`webhook-id`]))}`,pathParams:{"webhook-id":String(t[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.dataSecurity.posture.getWebhookConfigById({account_id:r,webhook_id:t[`webhook-id`]})),{successLabel:`Loaded`})}};function J(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 Y={command:`ignoreFinding`,describe:`Given a list of findings, mark as ignored. Does nothing if Finding is already ignored.`,builder:J,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture ignoreFinding`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/ignore`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({checks:t.checks}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.ignoreFinding({body:e,account_id:r})),{successLabel:`Created`});return}if(t.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let d=s({checks:t.checks});c(await u(`Creating`,async()=>n.dataSecurity.posture.ignoreFinding({body:d,account_id:r})),{successLabel:`Created`})}};function X(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 Z={command:`listExportJobs`,describe:`List all export jobs for a given requestor's organization`,builder:p(X),handler:async t=>{let n={page:t.page,per_page:t[`per-page`],status:t.status};if(t.dryRun){l({command:`cf data-security posture listExportJobs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/exports`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.dataSecurity.posture.listExportJobs({account_id:o,...n})),{successLabel:`Loaded`})}};function Q(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.
4
- 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.
5
- Use 'none' to filter instances with no remediation jobs or instances where the most recent job is stale.
6
- 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 ne={command:`listFindingInstances <finding-id>`,describe:`Lists all security finding instances for a given security finding.`,builder:p(Q),handler:async t=>{let n={archived:t.archived,cursor:t.cursor,direction:t.direction,max_affliction_date:t[`max-affliction-date`],min_affliction_date:t[`min-affliction-date`],order:t.order,page:t.page,per_page:t[`per-page`],search:t.search,remediation_statuses:t[`remediation-statuses`],finding_instance_ids:t[`finding-instance-ids`],asset_ids:t[`asset-ids`]};if(t.dryRun){l({command:`cf data-security posture listFindingInstances`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/instances`,pathParams:{"finding-id":String(t[`finding-id`]??``)},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.dataSecurity.posture.listFindingInstances({account_id:o,finding_id:t[`finding-id`],...n})),{successLabel:`Loaded`})}};function re(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(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`listFindingTypes`,describe:`List all available finding types with pagination support.`,builder:re,handler:async t=>{let n={page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf data-security posture listFindingTypes`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/finding_types`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.dataSecurity.posture.listFindingTypes({account_id:o,...n})),{successLabel:`Loaded`})}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={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:ae,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture listWebhooks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.dataSecurity.posture.listWebhooks({account_id:r})),{successLabel:`Loaded`})}};function $(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 se={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:$,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture resetFindingSeverity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/reset_finding_severity`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Creating`,async()=>n.dataSecurity.posture.resetFindingSeverity({account_id:r,finding_id:t[`finding-id`]})),{successLabel:`Created`})}};function ce(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 le={command:`unarchiveFindingInstance <finding-id>`,describe:`Remove the archive marking from one or more finding instances.`,builder:ce,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture unarchiveFindingInstance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/${t[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(t[`finding-id`]))}/instances/unarchive`,pathParams:{"finding-id":String(t[`finding-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({check_instances:t[`check-instances`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.unarchiveFindingInstance({body:e,account_id:r,finding_id:t[`finding-id`]})),{successLabel:`Created`});return}if(t[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let d=s({check_instances:t[`check-instances`]});c(await u(`Creating`,async()=>n.dataSecurity.posture.unarchiveFindingInstance({body:d,account_id:r,finding_id:t[`finding-id`]})),{successLabel:`Created`})}};function ue(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 de={command:`unIgnoreFinding`,describe:`Ability to un-ignore a Finding if it's previously been ignored. Does nothing if the Finding is not ignored.`,builder:ue,handler:async t=>{if(t.dryRun){l({command:`cf data-security posture unIgnoreFinding`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/findings/unignore`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({checks:t.checks}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.unIgnoreFinding({body:e,account_id:r})),{successLabel:`Created`});return}if(t.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let d=s({checks:t.checks});c(await u(`Creating`,async()=>n.dataSecurity.posture.unIgnoreFinding({body:d,account_id:r})),{successLabel:`Created`})}};function fe(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 pe={command:`update <webhook-id>`,describe:`Updates an existing webhook configuration with new settings.`,builder:fe,handler:async r=>{if(r.dryRun){l({command:`cf data-security posture update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/data-security/posture/webhooks/${r[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(r[`webhook-id`]))}`,pathParams:{"webhook-id":String(r[`webhook-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({authentication_type:d(r[`authentication-type`],`authentication-type`,`text`),destination_url:d(r[`destination-url`],`destination-url`,`text`),label:d(r.label,`label`,`text`),signing_secret:d(r[`signing-secret`],`signing-secret`,`text`),status:d(r.status,`status`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Updating`,async()=>p.dataSecurity.posture.update({...e,account_id:m,webhook_id:r[`webhook-id`]})),{successLabel:`Updated`});return}r[`authentication-type`]===void 0&&(r[`authentication-type`]=await n(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),r[`destination-url`]===void 0&&(r[`destination-url`]=await t(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),r.label===void 0&&(r.label=await t(`label`,`Account-specified display label for the webhook configuration.`)),r.status===void 0&&(r.status=await n(`status`,`Status of the webhook configuration.`,[`enabled`,`disabled`]));let h=s({authentication_type:d(r[`authentication-type`],`authentication-type`,`text`),destination_url:d(r[`destination-url`],`destination-url`,`text`),label:d(r.label,`label`,`text`),signing_secret:d(r[`signing-secret`],`signing-secret`,`text`),status:d(r.status,`status`,`text`)});c(await u(`Updating`,async()=>p.dataSecurity.posture.update({...h,account_id:m,webhook_id:r[`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(te).command(V).command(U).command(G).command(q).command(Y).command(Z).command(ne).command(ie).command(oe).command(se).command(de).command(le).command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},he={command:`data-security`,describe:`data-security`,builder:e=>e.command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{he as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{S as e,n as t}from"./auth-BqDOIrKX.mjs";import{t as n}from"./output-CUxZRM5A.mjs";import{n as r,t as i}from"./progress-Cent9Lsg.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:`Delegate domain control validation (DCV) to Cloudflare so certificates auto-renew without manual DNS changes`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{s as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";function p(e){return e.option(`check-type`,{type:`string`,description:`type of check to perform`,choices:[`icmp`],default:`icmp`}).option(`endpoint`,{type:`string`,description:`the IP address of the host to perform checks against`}).option(`name`,{type:`string`,description:`Optional name associated with this check`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create Endpoint Health Check.`,builder:p,handler:async r=>{if(r.dryRun){l({command:`cf diagnostics endpoint-healthchecks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({check_type:d(r[`check-type`],`check-type`,`text`),endpoint:d(r.endpoint,`endpoint`,`text`),name:d(r.name,`name`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.diagnostics.endpointHealthchecks.create({body:e,account_id:m})),{successLabel:`Created`});return}r[`check-type`]===void 0&&(r[`check-type`]=await n(`check-type`,`type of check to perform`,[`icmp`])),r.endpoint===void 0&&(r.endpoint=await t(`endpoint`,`the IP address of the host to perform checks against`));let h=s({check_type:d(r[`check-type`],`check-type`,`text`),endpoint:d(r.endpoint,`endpoint`,`text`),name:d(r.name,`name`,`text`)});c(await u(`Creating`,async()=>p.diagnostics.endpointHealthchecks.create({body:h,account_id:m})),{successLabel:`Created`})}};function h(e){return e.positional(`id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <id>`,describe:`Delete Endpoint Health Check.`,builder:h,handler:async t=>{if(t.dryRun){l({command:`cf diagnostics endpoint-healthchecks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/diagnostics/endpoint-healthchecks/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>n.diagnostics.endpointHealthchecks.delete({account_id:o,id:t.id})),{successLabel:`Deleted`})}};function _(e){return e.positional(`id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <id>`,describe:`Get a single Endpoint Health Check.`,builder:_,handler:async t=>{if(t.dryRun){l({command:`cf diagnostics endpoint-healthchecks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/diagnostics/endpoint-healthchecks/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.diagnostics.endpointHealthchecks.get({account_id:r,id:t.id})),{successLabel:`Loaded`})}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`List Endpoint Health Checks.`,builder:y,handler:async t=>{if(t.dryRun){l({command:`cf diagnostics endpoint-healthchecks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.diagnostics.endpointHealthchecks.list({account_id:r})),{successLabel:`Loaded`})}};function x(e){return e.positional(`id`,{type:`string`,description:`UUID.`,demandOption:!0}).option(`check-type`,{type:`string`,description:`type of check to perform`,choices:[`icmp`]}).option(`endpoint`,{type:`string`,description:`the IP address of the host to perform checks against`}).option(`name`,{type:`string`,description:`Optional name associated with this check`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`update <id>`,describe:`Update a Endpoint Health Check.`,builder:x,handler:async r=>{if(r.dryRun){l({command:`cf diagnostics endpoint-healthchecks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/diagnostics/endpoint-healthchecks/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?s({check_type:d(r[`check-type`],`check-type`,`text`),endpoint:d(r.endpoint,`endpoint`,`text`),name:d(r.name,`name`,`text`)}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Updating`,async()=>p.diagnostics.endpointHealthchecks.update({body:e,account_id:m,id:r.id})),{successLabel:`Updated`});return}r[`check-type`]===void 0&&(r[`check-type`]=await n(`check-type`,`type of check to perform`,[`icmp`])),r.endpoint===void 0&&(r.endpoint=await t(`endpoint`,`the IP address of the host to perform checks against`));let h=s({check_type:d(r[`check-type`],`check-type`,`text`),endpoint:d(r.endpoint,`endpoint`,`text`),name:d(r.name,`name`,`text`)});c(await u(`Updating`,async()=>p.diagnostics.endpointHealthchecks.update({body:h,account_id:m,id:r.id})),{successLabel:`Updated`})}},C={command:`endpoint-healthchecks`,describe:`Monitor external endpoint availability with periodic HTTP/HTTPS health checks`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`colos`,{type:`string`,array:!0,description:`If no source colo names specified, all colos will be used. China colos are unavailable for traceroutes.`}).option(`options-max-ttl`,{type:`number`,description:`Max TTL.`,default:15}).option(`options-packet-type`,{type:`string`,description:`Type of packet sent.`,choices:[`icmp`,`tcp`,`udp`,`gre`,`gre+icmp`],default:`icmp`}).option(`options-packets-per-ttl`,{type:`number`,description:`Number of packets sent at each TTL.`,default:3}).option(`options-port`,{type:`number`,description:`For UDP and TCP, specifies the destination port. For ICMP, specifies the initial ICMP sequence value. Default value 0 will choose the best value to use for each protocol.`,default:0}).option(`options-wait-time`,{type:`number`,description:`Set the time (in seconds) to wait for a response to a probe.`,default:1}).option(`targets`,{type:`string`,array:!0,description:`The targets field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`create`,describe:`Run traceroutes from Cloudflare colos.`,builder:w,handler:async t=>{if(t.dryRun){l({command:`cf diagnostics traceroutes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/diagnostics/traceroute`,pathParams:{},bodyKind:`json`,body:t.body===void 0?s({colos:t.colos,options:{max_ttl:t[`options-max-ttl`],packet_type:d(t[`options-packet-type`],`options-packet-type`,`text`),packets_per_ttl:t[`options-packets-per-ttl`],port:t[`options-port`],wait_time:t[`options-wait-time`]},targets:t.targets}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.diagnostics.traceroutes.create({...e,account_id:r})),{successLabel:`Created`});return}if(t.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let p=s({colos:t.colos,options:{max_ttl:t[`options-max-ttl`],packet_type:d(t[`options-packet-type`],`options-packet-type`,`text`),packets_per_ttl:t[`options-packets-per-ttl`],port:t[`options-port`],wait_time:t[`options-wait-time`]},targets:t.targets});c(await u(`Creating`,async()=>n.diagnostics.traceroutes.create({...p,account_id:r})),{successLabel:`Created`})}},E={command:`traceroutes`,describe:`Run traceroutes from Cloudflare data centers to diagnose network path issues`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`diagnostics`,describe:`Network diagnostic tools — traceroutes from Cloudflare's edge and endpoint health checks`,builder:e=>e.command(C).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{D as default};
@@ -1,57 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,T as t,_ as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i,t as a}from"./body-parser-CBpeIUns.mjs";import{t as o}from"./output-CUxZRM5A.mjs";import{n as s,t as c}from"./progress-Cent9Lsg.mjs";import{n as l}from"./input-validation-CTqtyiY9.mjs";import{t as u}from"./local-D8bhHUMK.mjs";import{t as d}from"./cli-types-CMNMD1V7.mjs";function f(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`time-delta`,{type:`string`,description:`Unit of time to group data by.`,choices:[`all`,`auto`,`year`,`quarter`,`month`,`week`,`day`,`hour`,`dekaminute`,`minute`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`get <dns-firewall-id>`,describe:`Retrieves a list of aggregate metrics grouped by time interval. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:d(f),handler:async t=>{let i={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters,time_delta:t[`time-delta`]};if(t.dryRun){s({command:`cf dns-firewall analytics reports bytimes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report/bytime`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.bytimes.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},m={command:`bytimes`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`metrics`,{type:`string`,description:`A comma-separated list of metrics to query.`}).option(`dimensions`,{type:`string`,description:`A comma-separated list of dimensions to group results by.`}).option(`since`,{type:`string`,description:`Start date and time of requesting data period in ISO 8601 format.`}).option(`until`,{type:`string`,description:`End date and time of requesting data period in ISO 8601 format.`}).option(`limit`,{type:`number`,description:`Limit number of returned metrics.`}).option(`sort`,{type:`string`,description:`A comma-separated list of dimensions to sort by, where each dimension may be prefixed by - (descending) or + (ascending).`}).option(`filters`,{type:`string`,description:`Segmentation filter in 'attribute operator value' format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`get <dns-firewall-id>`,describe:`Retrieves a list of summarised aggregate metrics over a given time period. See [Analytics API properties](https://developers.cloudflare.com/dns/reference/analytics-api-properties/) for detailed information about the available query parameters.`,builder:h,handler:async t=>{let i={metrics:t.metrics,dimensions:t.dimensions,since:t.since,until:t.until,limit:t.limit,sort:t.sort,filters:t.filters};if(t.dryRun){s({command:`cf dns-firewall analytics reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/dns_analytics/report`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.analytics.reports.get({account_id:l,dns_firewall_id:t[`dns-firewall-id`],...i})),{successLabel:`Loaded`})}},_={command:`reports`,describe:`Query volume, latency, and response code analytics for DNS Firewall clusters`,builder:e=>e.command(g).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},v={command:`analytics`,describe:`Operations for analytics`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`,default:!0}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
3
- indicated by the TTL received from upstream nameservers. This setting
4
- sets an upper bound on this duration. For caching purposes, higher TTLs
5
- will be decreased to the maximum value defined by this setting.
6
-
7
- This setting does not affect the TTL value in the DNS response
8
- Cloudflare returns to clients. Cloudflare will always forward the TTL
9
- value received from upstream nameservers.
10
- `,default:900}).option(`minimum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
11
- indicated by the TTL received from upstream nameservers. This setting
12
- sets a lower bound on this duration. For caching purposes, lower TTLs
13
- will be increased to the minimum value defined by this setting.
14
-
15
- This setting does not affect the TTL value in the DNS response
16
- Cloudflare returns to clients. Cloudflare will always forward the TTL
17
- value received from upstream nameservers.
18
-
19
- Note that, even with this setting, there is no guarantee that a
20
- response will be cached for at least the specified duration. Cached
21
- responses may be removed earlier for capacity or other operational
22
- reasons.
23
- `,default:60}).option(`name`,{type:`string`,description:`DNS Firewall cluster name`}).option(`negative-cache-ttl`,{type:`number`,description:`This setting controls how long DNS Firewall should cache negative
24
- responses (e.g., NXDOMAIN) from the upstream servers.
25
-
26
- This setting does not affect the TTL value in the DNS response
27
- Cloudflare returns to clients. Cloudflare will always forward the TTL
28
- value received from upstream nameservers.
29
- `}).option(`ratelimit`,{type:`number`,description:`Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.`}).option(`retries`,{type:`number`,description:`Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)`,default:2}).option(`upstream-ips`,{type:`string`,array:!0,description:`The upstream_ips field`}).option(`dns-firewall-ip-count`,{type:`number`,description:`Number of IPv4 addresses to assign to the DNS Firewall cluster. Only used during cluster creation and cannot be changed later.`,default:2}).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 b={command:`create`,describe:`Create a DNS Firewall cluster`,builder:y,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall`,pathParams:{},bodyKind:`json`,body:t.body===void 0?a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`],dns_firewall_ip_count:t[`dns-firewall-ip-count`]}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Creating`,async()=>d.dnsFirewall.create({...e,account_id:f})),{successLabel:`Created`});return}let p=a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`],dns_firewall_ip_count:t[`dns-firewall-ip-count`]});o(await c(`Creating`,async()=>d.dnsFirewall.create({...p,account_id:f})),{successLabel:`Created`})}};function x(e){return e.positional(`dns-firewall-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 S={command:`delete <dns-firewall-id>`,describe:`Delete a DNS Firewall cluster`,builder:x,handler:async i=>{if(i.dryRun){s({command:`cf dns-firewall delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${i[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(i[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(i[`dns-firewall-id`]??``)},bodyKind:`none`});return}let a=await r(i),l=i.local?u:await n(a);if(i.accountId=l,!await t({force:!!i.force})){process.stderr.write(`Aborted.
30
- `);return}o(await c(`Deleting`,async()=>a.dnsFirewall.delete({account_id:l,dns_firewall_id:i[`dns-firewall-id`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`attack-mitigation-enabled`,{type:`boolean`,description:`When enabled, automatically mitigate random-prefix attacks to protect upstream DNS servers`}).option(`attack-mitigation-only-when-upstream-unhealthy`,{type:`boolean`,description:`Only mitigate attacks when upstream servers seem unhealthy`}).option(`deprecate-any-requests`,{type:`boolean`,description:`Whether to refuse to answer queries for the ANY type`}).option(`ecs-fallback`,{type:`boolean`,description:`Whether to forward client IP (resolver) subnet if no EDNS Client Subnet is sent`}).option(`maximum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
31
- indicated by the TTL received from upstream nameservers. This setting
32
- sets an upper bound on this duration. For caching purposes, higher TTLs
33
- will be decreased to the maximum value defined by this setting.
34
-
35
- This setting does not affect the TTL value in the DNS response
36
- Cloudflare returns to clients. Cloudflare will always forward the TTL
37
- value received from upstream nameservers.
38
- `}).option(`minimum-cache-ttl`,{type:`number`,description:`By default, Cloudflare attempts to cache responses for as long as
39
- indicated by the TTL received from upstream nameservers. This setting
40
- sets a lower bound on this duration. For caching purposes, lower TTLs
41
- will be increased to the minimum value defined by this setting.
42
-
43
- This setting does not affect the TTL value in the DNS response
44
- Cloudflare returns to clients. Cloudflare will always forward the TTL
45
- value received from upstream nameservers.
46
-
47
- Note that, even with this setting, there is no guarantee that a
48
- response will be cached for at least the specified duration. Cached
49
- responses may be removed earlier for capacity or other operational
50
- reasons.
51
- `}).option(`name`,{type:`string`,description:`DNS Firewall cluster name`}).option(`negative-cache-ttl`,{type:`number`,description:`This setting controls how long DNS Firewall should cache negative
52
- responses (e.g., NXDOMAIN) from the upstream servers.
53
-
54
- This setting does not affect the TTL value in the DNS response
55
- Cloudflare returns to clients. Cloudflare will always forward the TTL
56
- value received from upstream nameservers.
57
- `}).option(`ratelimit`,{type:`number`,description:`Maximum number of DNS queries per second that will be forwarded to your upstream nameservers. The limit is enforced per server, where each server receives a fraction of the configured value. The actual aggregate rate for a data center may vary depending on how many servers are present. Responses served from cache do not count toward this limit. Set to null to disable rate limiting.`}).option(`retries`,{type:`number`,description:`Number of retries for fetching DNS responses from upstream nameservers (not counting the initial attempt)`}).option(`upstream-ips`,{type:`string`,array:!0,description:`The upstream_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const w={command:`edit <dns-firewall-id>`,describe:`Modify the configuration of a DNS Firewall cluster`,builder:C,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`]}):i(t.body)});return}let d=await r(t),f=t.local?u:await n(d);if(t.accountId=f,t.body){let e=i(t.body);o(await c(`Updating`,async()=>d.dnsFirewall.edit({...e,account_id:f,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`});return}let p=a({attack_mitigation:{enabled:t[`attack-mitigation-enabled`],only_when_upstream_unhealthy:t[`attack-mitigation-only-when-upstream-unhealthy`]},deprecate_any_requests:t[`deprecate-any-requests`],ecs_fallback:t[`ecs-fallback`],maximum_cache_ttl:t[`maximum-cache-ttl`],minimum_cache_ttl:t[`minimum-cache-ttl`],name:l(t.name,`name`,`text`),negative_cache_ttl:t[`negative-cache-ttl`],ratelimit:t.ratelimit,retries:t.retries,upstream_ips:t[`upstream-ips`]});o(await c(`Updating`,async()=>d.dnsFirewall.edit({...p,account_id:f,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`})}};function T(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get <dns-firewall-id>`,describe:`Show a single DNS Firewall cluster for an account`,builder:T,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.get({account_id:a,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Loaded`})}};function D(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results`}).option(`per-page`,{type:`number`,description:`Number of clusters per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`list`,describe:`List DNS Firewall clusters for an account`,builder:D,handler:async t=>{let i={page:t.page,per_page:t[`per-page`]};if(t.dryRun){s({command:`cf dns-firewall list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall`,pathParams:{},query:i,bodyKind:`none`});return}let a=await r(t),l=t.local?u:await n(a);t.accountId=l,o(await c(`Loading`,async()=>a.dnsFirewall.list({account_id:l,...i})),{successLabel:`Loaded`})}};function k(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`edit <dns-firewall-id>`,describe:`Update reverse DNS configuration (PTR records) for a DNS Firewall cluster`,builder:k,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall reverse-dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:i(t.body)});return}let a=await r(t),l=t.local?u:await n(a);if(t.accountId=l,t.body){let e=i(t.body);o(await c(`Updating`,async()=>a.dnsFirewall.reverseDns.edit({...e,account_id:l,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>a.dnsFirewall.reverseDns.edit({account_id:l,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`dns-firewall-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <dns-firewall-id>`,describe:`Show reverse DNS configuration (PTR records) for a DNS Firewall cluster`,builder:j,handler:async t=>{if(t.dryRun){s({command:`cf dns-firewall reverse-dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/dns_firewall/${t[`dns-firewall-id`]==null?`<dns-firewall-id>`:encodeURIComponent(String(t[`dns-firewall-id`]))}/reverse_dns`,pathParams:{"dns-firewall-id":String(t[`dns-firewall-id`]??``)},bodyKind:`none`});return}let i=await r(t),a=t.local?u:await n(i);t.accountId=a,o(await c(`Loading`,async()=>i.dnsFirewall.reverseDns.get({account_id:a,dns_firewall_id:t[`dns-firewall-id`]})),{successLabel:`Loaded`})}},N={command:`reverse-dns`,describe:`Operations for reverse-dns`,builder:e=>e.command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},P={command:`dns-firewall`,describe:`DNS proxy clusters that filter and forward DNS queries with DDoS protection and caching`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).command(v).command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,_ as t,n}from"./auth-BqDOIrKX.mjs";import{t as r}from"./output-CUxZRM5A.mjs";import{n as i,t as a}from"./progress-Cent9Lsg.mjs";import{t as o}from"./local-D8bhHUMK.mjs";function s(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Returns the Durable Object namespaces owned by an account.`,builder:s,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){i({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function l(e){return e.option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Returns the Durable Objects in a given namespace.`,builder:l,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){i({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/workers/durable_objects/namespaces/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/objects`,pathParams:{id:String(s.id??``)},query:c,bodyKind:`none`});return}let l=await n(s),u=s.local?o:await t(l);s.accountId=u,r(await a(`Loading`,async()=>l.durableObjects.namespaces.objects.list({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},d={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(c).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`durable-objects`,describe:`Stateful serverless objects with transactional storage, ideal for coordination, sessions, and real-time collaboration`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,S as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Returns the current daily sending quota for the account and, when a quota is resolved, the account's current usage against it. Quota is null when not yet available; usage is null when there is no resolved quota or usage is temporarily unavailable.`,builder:p,handler:async t=>{if(t.dryRun){l({command:`cf email-sending limits get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/limits`,pathParams:{},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.emailSending.limits.get({account_id:r})),{successLabel:`Loaded`})}},h={command:`limits`,describe:`Operations for limits`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`from`,{type:`string`,description:`Sender email address.`}).option(`mime-message`,{type:`string`,description:`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`}).option(`recipients`,{type:`string`,array:!0,description:`List of recipient email addresses.`}).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:`send-raw`,describe:`Send a raw RFC 5322 (MIME) email for the specified account. Provide the full MIME message plus the SMTP envelope (from and recipients).`,builder:g,handler:async n=>{if(n.dryRun){l({command:`cf email-sending send-raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/send_raw`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({from:d(n.from,`from`,`text`),mime_message:d(n[`mime-message`],`mime-message`,`text`),recipients:n.recipients}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.emailSending.sendRaw({...e,account_id:p})),{successLabel:`Created`});return}if(n.from===void 0&&(n.from=await t(`from`,`Sender email address.`)),n[`mime-message`]===void 0&&(n[`mime-message`]=await t(`mime-message`,`The full MIME-encoded email message. Should include standard RFC 5322 headers such as From, To, Subject, and Content-Type. The from and recipients fields in the request body control SMTP envelope routing; the From and To headers in the MIME message control what the recipient's email client displays.`)),n.recipients===void 0)throw Error(`--recipients is required (or pass --body with this field set).`);let m=s({from:d(n.from,`from`,`text`),mime_message:d(n[`mime-message`],`mime-message`,`text`),recipients:n.recipients});c(await u(`Creating`,async()=>r.emailSending.sendRaw({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.option(`bcc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`bcc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`cc-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`cc-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`from-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`from-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`html`,{type:`string`,description:`HTML body of the email. Provide at least one of text or html (non-empty).`}).option(`reply-to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`reply-to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`subject`,{type:`string`,description:`Email subject line.`}).option(`text`,{type:`string`,description:`Plain text body of the email. Provide at least one of text or html (non-empty).`}).option(`to-address`,{type:`string`,description:`Email address (e.g., 'user@example.com').`}).option(`to-name`,{type:`string`,description:`Display name for the email address (e.g., 'John Doe'). Optional; set to null or leave it unset to send the address on its own.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const y={command:`send`,describe:`Send an email for the specified account using the structured builder. Provide the sender, recipients, subject, and at least one of text or html; attachments are optional.`,builder:v,handler:async n=>{if(n.dryRun){l({command:`cf email-sending send`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/email/sending/send`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({bcc:{address:d(n[`bcc-address`],`bcc-address`,`text`),name:d(n[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(n[`cc-address`],`cc-address`,`text`),name:d(n[`cc-name`],`cc-name`,`text`)},from:{address:d(n[`from-address`],`from-address`,`text`),name:d(n[`from-name`],`from-name`,`text`)},html:d(n.html,`html`,`text`),reply_to:{address:d(n[`reply-to-address`],`reply-to-address`,`text`),name:d(n[`reply-to-name`],`reply-to-name`,`text`)},subject:d(n.subject,`subject`,`text`),text:d(n.text,`text`,`text`),to:{address:d(n[`to-address`],`to-address`,`text`),name:d(n[`to-name`],`to-name`,`text`)}}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.emailSending.send({...e,account_id:p})),{successLabel:`Created`});return}n.subject===void 0&&(n.subject=await t(`subject`,`Email subject line.`));let m=s({bcc:{address:d(n[`bcc-address`],`bcc-address`,`text`),name:d(n[`bcc-name`],`bcc-name`,`text`)},cc:{address:d(n[`cc-address`],`cc-address`,`text`),name:d(n[`cc-name`],`cc-name`,`text`)},from:{address:d(n[`from-address`],`from-address`,`text`),name:d(n[`from-name`],`from-name`,`text`)},html:d(n.html,`html`,`text`),reply_to:{address:d(n[`reply-to-address`],`reply-to-address`,`text`),name:d(n[`reply-to-name`],`reply-to-name`,`text`)},subject:d(n.subject,`subject`,`text`),text:d(n.text,`text`,`text`),to:{address:d(n[`to-address`],`to-address`,`text`),name:d(n[`to-name`],`to-name`,`text`)}});c(await u(`Creating`,async()=>r.emailSending.send({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.option(`name`,{type:`string`,description:`The subdomain name. Must be within the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Creates a new sending subdomain or re-enables sending on an existing subdomain that had it disabled. If zone-level Email Sending has not been enabled yet, the zone flag is automatically set when the entitlement is present.`,builder:b,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({name:d(e.name,`name`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.emailSending.subdomains.create({...t,zone_id:i})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await t(`name`,`The subdomain name. Must be within the zone.`));let f=s({name:d(e.name,`name`,`text`)});c(await u(`Creating`,async()=>r.emailSending.subdomains.create({...f,zone_id:i})),{successLabel:`Created`})}};function S(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain 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 C={command:`delete <subdomain-id>`,describe:`Disables sending on a subdomain and removes its DNS records. If routing is still active on the subdomain, only sending is disabled.`,builder:S,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>t.emailSending.subdomains.delete({zone_id:i,subdomain_id:e[`subdomain-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`fix <subdomain-id>`,describe:`Idempotently re-applies the sending DNS records (creates missing records, re-applies the email_routing lock on records whose lock has been cleared). Refuses with a 409 if foreign MX, multiple SPF, multiple DMARC, or multiple DKIM records exist at the relevant DNS names — those require manual cleanup.`,builder:w,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns fix`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Creating`,async()=>t.emailSending.subdomains.dns.fix({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Created`})}};function E(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get-status <subdomain-id>`,describe:`Returns the desired DNS records for a sending subdomain along with a live diff against actual DNS state. Use this to detect missing, unlocked, foreign, or multi-record conflicts before deciding whether to call the fix endpoint.`,builder:E,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns get-status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns/status`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.dns.getStatus({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function O(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <subdomain-id>`,describe:`Returns the expected DNS records for a sending subdomain.`,builder:O,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}/dns`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.dns.get({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}},A={command:`dns`,describe:`Operations for subdomains.dns`,builder:e=>e.command(T).command(k).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <subdomain-id>`,describe:`Gets information for a specific sending subdomain.`,builder:j,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.get({zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Loaded`})}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Lists all sending-enabled subdomains for the zone.`,builder:N,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.emailSending.subdomains.list({zone_id:r})),{successLabel:`Loaded`})}};function F(e){return e.option(`name`,{type:`string`,description:`The subdomain name. Must be within the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`preview`,describe:`Returns the DNS records that would be created for a sending subdomain, flags which records are missing, and reports any conflicts with existing DNS records. This is a read-only dry-run — no records are created or modified. Use before or after creating a subdomain to check DNS status.`,builder:F,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/preview`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({name:d(e.name,`name`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Loading`,async()=>r.emailSending.subdomains.preview({...t,zone_id:i})),{successLabel:`Loaded`});return}e.name===void 0&&(e.name=await t(`name`,`The subdomain name. Must be within the zone.`));let f=s({name:d(e.name,`name`,`text`)});c(await u(`Loading`,async()=>r.emailSending.subdomains.preview({...f,zone_id:i})),{successLabel:`Loaded`})}};function L(e){return e.positional(`subdomain-id`,{type:`string`,description:`Sending subdomain identifier.`,demandOption:!0}).option(`preview-enabled`,{type:`boolean`,description:`Whether sent messages from this subdomain can be previewed in the activity log.`}).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 R={command:`update <subdomain-id>`,describe:`Updates the activity-log preview preference for a sending subdomain.`,builder:L,handler:async e=>{if(e.dryRun){l({command:`cf email-sending subdomains update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/sending/subdomains/${e[`subdomain-id`]==null?`<subdomain-id>`:encodeURIComponent(String(e[`subdomain-id`]))}`,pathParams:{"subdomain-id":String(e[`subdomain-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({preview_enabled:e[`preview-enabled`]}):o(e.body)});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=o(e.body);c(await u(`Updating`,async()=>t.emailSending.subdomains.update({...n,zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`});return}if(e[`preview-enabled`]===void 0)throw Error(`--preview-enabled is required (or pass --body with this field set).`);let i=s({preview_enabled:e[`preview-enabled`]});c(await u(`Updating`,async()=>t.emailSending.subdomains.update({...i,zone_id:r,subdomain_id:e[`subdomain-id`]})),{successLabel:`Updated`})}},z={command:`subdomains`,describe:`Operations for subdomains`,builder:e=>e.command(x).command(C).command(M).command(P).command(I).command(R).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`email-sending`,describe:`Send emails and manage sending subdomains`,builder:e=>e.command(y).command(_).command(h).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{B as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{D as e,S as t,n}from"./auth-BqDOIrKX.mjs";import{n as r,t as i}from"./body-parser-CBpeIUns.mjs";import{t as a}from"./output-CUxZRM5A.mjs";import{n as o,t as s}from"./progress-Cent9Lsg.mjs";import{n as c}from"./input-validation-CTqtyiY9.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Gets the Google Tag Gateway configuration for a zone.`,builder:l,handler:async e=>{if(e.dryRun){o({command:`cf google-tag-gateway config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/settings/google-tag-gateway/config`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.googleTagGateway.config.get({zone_id:i})),{successLabel:`Loaded`})}};function d(e){return e.option(`enabled`,{type:`boolean`,description:`Enables or disables Google Tag Gateway for this zone.`}).option(`endpoint`,{type:`string`,description:`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`}).option(`hide-original-ip`,{type:`boolean`,description:`Hides the original client IP address from Google when enabled.`}).option(`measurement-id`,{type:`string`,description:`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`}).option(`set-up-tag`,{type:`boolean`,description:`Set up the associated Google Tag on the zone automatically when enabled.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Google Tag Gateway configuration for a zone.`})}const f={command:`update`,describe:`Updates the Google Tag Gateway configuration for a zone.`,builder:d,handler:async l=>{if(l.dryRun){o({command:`cf google-tag-gateway config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/settings/google-tag-gateway/config`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?i({enabled:l.enabled,endpoint:c(l.endpoint,`endpoint`,`text`),hideOriginalIp:l[`hide-original-ip`],measurementId:c(l[`measurement-id`],`measurement-id`,`text`),setUpTag:l[`set-up-tag`]}):r(l.body)});return}let u=await n(l),d=await t({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=r(l.body);a(await s(`Updating`,async()=>u.googleTagGateway.config.update({body:e,zone_id:d})),{successLabel:`Updated`});return}if(l.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);if(l.endpoint===void 0&&(l.endpoint=await e(`endpoint`,`Specifies the endpoint path for proxying Google Tag Manager requests. Use an absolute path starting with '/', with no nested paths and alphanumeric characters only (e.g. /metrics).`)),l[`hide-original-ip`]===void 0)throw Error(`--hide-original-ip is required (or pass --body with this field set).`);l[`measurement-id`]===void 0&&(l[`measurement-id`]=await e(`measurement-id`,`Specify the Google Tag Manager container or measurement ID (e.g. GTM-XXXXXXX or G-XXXXXXXXXX).`));let f=i({enabled:l.enabled,endpoint:c(l.endpoint,`endpoint`,`text`),hideOriginalIp:l[`hide-original-ip`],measurementId:c(l[`measurement-id`],`measurement-id`,`text`),setUpTag:l[`set-up-tag`]});a(await s(`Updating`,async()=>u.googleTagGateway.config.update({body:f,zone_id:d})),{successLabel:`Updated`})}},p={command:`config`,describe:`Operations for config`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`google-tag-gateway`,describe:`Google Tag Gateway operations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{m as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{S as e,T as t,i as n,n as r}from"./auth-BqDOIrKX.mjs";import{n as i}from"./body-parser-CBpeIUns.mjs";import{t as a}from"./output-CUxZRM5A.mjs";import{n as o,t as s}from"./progress-Cent9Lsg.mjs";import{t as c}from"./cli-types-CMNMD1V7.mjs";function l(e){return e.positional(`hostname`,{type:`string`,description:`The hostname for which the tls settings are set.`,demandOption:!0}).option(`setting-id`,{type:`string`,description:'The TLS Setting name.\nThe value type depends on the setting:\n- `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`).\n- `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`).\n- `http2`: value is `"on"` or `"off"`.',demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get <hostname>`,describe:`Get the requested TLS setting for the hostname.`,builder:c(l),handler:async t=>{if(t.dryRun){o({command:`cf hostnames settings tls-single get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hostnames/settings/${t[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(t[`setting-id`]))}/${t.hostname==null?`<hostname>`:encodeURIComponent(String(t.hostname))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"setting-id":String(t[`setting-id`]??``),hostname:String(t.hostname??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>n.hostnames.settings.tlsSingle.get({zone_id:i,setting_id:t[`setting-id`],hostname:t.hostname})),{successLabel:`Loaded`})}},d={command:`tls-single`,describe:`Operations for settings.tls-single`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.positional(`hostname`,{type:`string`,description:`The hostname for which the tls settings are set.`,demandOption:!0}).option(`setting-id`,{type:`string`,description:'The TLS Setting name.\nThe value type depends on the setting:\n- `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`).\n- `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`).\n- `http2`: value is `"on"` or `"off"`.',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:`delete <hostname>`,describe:`Delete the tls setting value for the hostname.`,builder:c(f),handler:async n=>{if(n.dryRun){o({command:`cf hostnames settings tls delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${n.zone??n.zoneId??`<zone>`}/hostnames/settings/${n[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(n[`setting-id`]))}/${n.hostname==null?`<hostname>`:encodeURIComponent(String(n.hostname))}`,pathParams:{"zone-id":String(n.zone??n[`zone-id`]??``),"setting-id":String(n[`setting-id`]??``),hostname:String(n.hostname??``)},bodyKind:`none`});return}let i=await r(n),c=await e({zone:n.zone},i,{quiet:n.quiet});if(n.zoneId=c,!await t({force:!!n.force})){process.stderr.write(`Aborted.
3
- `);return}a(await s(`Deleting`,async()=>i.hostnames.settings.tls.delete({zone_id:c,setting_id:n[`setting-id`],hostname:n.hostname})),{successLabel:`Deleted`})}};function m(e){return e.positional(`setting-id`,{type:`string`,description:'The TLS Setting name. The value type depends on the setting: - `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`). - `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`). - `http2`: value is `"on"` or `"off"`.',demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <setting-id>`,describe:`List the requested TLS setting for the hostnames under this zone.`,builder:c(m),handler:async t=>{if(t.dryRun){o({command:`cf hostnames settings tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hostnames/settings/${t[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(t[`setting-id`]))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"setting-id":String(t[`setting-id`]??``)},bodyKind:`none`});return}let n=await r(t),i=await e({zone:t.zone},n,{quiet:t.quiet});t.zoneId=i,a(await s(`Loading`,async()=>n.hostnames.settings.tls.get({zone_id:i,setting_id:t[`setting-id`]})),{successLabel:`Loaded`})}};function g(e){return e.positional(`hostname`,{type:`string`,description:`The hostname for which the tls settings are set.`,demandOption:!0}).option(`setting-id`,{type:`string`,description:'The TLS Setting name.\nThe value type depends on the setting:\n- `ciphers`: value is an array of cipher suite strings (e.g., `["ECDHE-RSA-AES128-GCM-SHA256", "AES128-GCM-SHA256"]`).\n- `min_tls_version`: value is a TLS version string (`"1.0"`, `"1.1"`, `"1.2"`, or `"1.3"`).\n- `http2`: value is `"on"` or `"off"`.',demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`update <hostname>`,describe:`Update the tls setting value for the hostname.`,builder:c(g),handler:async t=>{if(t.dryRun){o({command:`cf hostnames settings tls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/hostnames/settings/${t[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(t[`setting-id`]))}/${t.hostname==null?`<hostname>`:encodeURIComponent(String(t.hostname))}`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``),"setting-id":String(t[`setting-id`]??``),hostname:String(t.hostname??``)},bodyKind:`json`,body:t.body===void 0?void 0:i(t.body)});return}let c=await r(t),l=await e({zone:t.zone},c,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=i(t.body);a(await s(`Updating`,async()=>c.hostnames.settings.tls.update({...e,zone_id:l,setting_id:t[`setting-id`],hostname:t.hostname})),{successLabel:`Updated`});return}a(await s(`Updating`,async()=>n(c,`PUT`,`/zones/${t.zoneId}/hostnames/settings/${encodeURIComponent(String(t[`setting-id`]))}/${encodeURIComponent(String(t.hostname))}`)),{successLabel:`Updated`})}},v={command:`tls`,describe:`Operations for settings.tls`,builder:e=>e.command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(v).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},b={command:`hostnames`,describe:`Per-hostname TLS settings — minimum TLS version, ciphers, and certificate pinning overrides`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- import{C as e,D as t,E as n,T as r,_ as i,n as a}from"./auth-BqDOIrKX.mjs";import{n as o,t as s}from"./body-parser-CBpeIUns.mjs";import{t as c}from"./output-CUxZRM5A.mjs";import{n as l,t as u}from"./progress-Cent9Lsg.mjs";import{n as d}from"./input-validation-CTqtyiY9.mjs";import{t as f}from"./local-D8bhHUMK.mjs";function p(e){return e.option(`caching-disabled`,{type:`boolean`,description:`Set to true to disable caching of SQL responses. Default is false.`}).option(`caching-max-age`,{type:`number`,description:`Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.`}).option(`caching-stale-while-revalidate`,{type:`number`,description:`Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.`}).option(`mtls-ca-certificate-id`,{type:`string`,description:`Define CA certificate ID obtained after uploading CA cert.`}).option(`mtls-certificate-id`,{type:`string`,description:`Define mTLS certificate ID obtained after uploading client cert.`}).option(`mtls-sslmode`,{type:`string`,description:`Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.`,choices:[`require`,`verify-ca`,`verify-full`]}).option(`name`,{type:`string`,description:`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`}).option(`origin-database`,{type:`string`,description:`Set the name of your origin database.`}).option(`origin-password`,{type:`string`,description:`Set the password needed to access your origin database. The API never returns this write-only value.`}).option(`origin-scheme`,{type:`string`,description:`Specifies the URL scheme used to connect to your origin database.`,choices:[`postgres`,`postgresql`,`mysql`]}).option(`origin-user`,{type:`string`,description:`Set the user of your origin database.`}).option(`origin-host`,{type:`string`,description:`Defines the host (hostname or IP) of your origin database.`}).option(`origin-port`,{type:`number`,description:`Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.`}).option(`origin-access-client-id`,{type:`string`,description:`Defines the Client ID of the Access token to use when connecting to the origin database.`}).option(`origin-access-client-secret`,{type:`string`,description:`Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.`}).option(`origin-service-id`,{type:`string`,description:`The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.`}).option(`origin-connection-limit`,{type:`number`,description:`The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.
3
-
4
- Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
5
- If not specified, defaults to 20 for free tier and 60 for paid tier.
6
- Contact Cloudflare if you need a higher limit.
7
- `}).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(`origin-host`,[`origin-service-id`]).conflicts(`origin-port`,[`origin-access-client-id`,`origin-access-client-secret`,`origin-service-id`]).implies(`origin-port`,[`origin-host`]).conflicts(`origin-access-client-id`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-id`,[`origin-host`,`origin-access-client-secret`]).conflicts(`origin-access-client-secret`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-secret`,[`origin-host`,`origin-access-client-id`]).conflicts(`origin-service-id`,[`origin-host`,`origin-port`,`origin-access-client-id`,`origin-access-client-secret`])}const m={command:`create`,describe:`Creates and returns a new Hyperdrive configuration.`,builder:p,handler:async r=>{if(r.dryRun){l({command:`cf hyperdrive create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({caching:{disabled:r[`caching-disabled`],max_age:r[`caching-max-age`],stale_while_revalidate:r[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(r[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(r[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(r[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(r.name,`name`,`text`),origin:{database:d(r[`origin-database`],`origin-database`,`text`),password:d(r[`origin-password`],`origin-password`,`text`),scheme:d(r[`origin-scheme`],`origin-scheme`,`text`),user:d(r[`origin-user`],`origin-user`,`text`),host:d(r[`origin-host`],`origin-host`,`text`),port:r[`origin-port`],access_client_id:d(r[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:d(r[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:d(r[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:r[`origin-connection-limit`]}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Creating`,async()=>p.hyperdrive.create({body:e,account_id:m})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await t(`name`,`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`)),r[`origin-database`]===void 0&&(r[`origin-database`]=await t(`origin-database`,`Set the name of your origin database.`)),r[`origin-password`]===void 0&&(r[`origin-password`]=await t(`origin-password`,`Set the password needed to access your origin database. The API never returns this write-only value.`,{kind:`secret`})),r[`origin-scheme`]===void 0&&(r[`origin-scheme`]=await n(`origin-scheme`,`Specifies the URL scheme used to connect to your origin database.`,[`postgres`,`postgresql`,`mysql`])),r[`origin-user`]===void 0&&(r[`origin-user`]=await t(`origin-user`,`Set the user of your origin database.`));let h=s({caching:{disabled:r[`caching-disabled`],max_age:r[`caching-max-age`],stale_while_revalidate:r[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(r[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(r[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(r[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(r.name,`name`,`text`),origin:{database:d(r[`origin-database`],`origin-database`,`text`),password:d(r[`origin-password`],`origin-password`,`text`),scheme:d(r[`origin-scheme`],`origin-scheme`,`text`),user:d(r[`origin-user`],`origin-user`,`text`),host:d(r[`origin-host`],`origin-host`,`text`),port:r[`origin-port`],access_client_id:d(r[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:d(r[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:d(r[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:r[`origin-connection-limit`]});c(await u(`Creating`,async()=>p.hyperdrive.create({body:h,account_id:m})),{successLabel:`Created`})}};function h(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive 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 g={command:`delete <hyperdrive-id>`,describe:`Deletes the specified Hyperdrive.`,builder:h,handler:async t=>{if(t.dryRun){l({command:`cf hyperdrive delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs/${t[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(t[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(t[`hyperdrive-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
8
- `);return}c(await u(`Deleting`,async()=>n.hyperdrive.delete({account_id:o,hyperdrive_id:t[`hyperdrive-id`]})),{successLabel:`Deleted`})}};function _(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`caching-disabled`,{type:`boolean`,description:`Set to true to disable caching of SQL responses. Default is false.`}).option(`caching-max-age`,{type:`number`,description:`Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.`}).option(`caching-stale-while-revalidate`,{type:`number`,description:`Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.`}).option(`mtls-ca-certificate-id`,{type:`string`,description:`Define CA certificate ID obtained after uploading CA cert.`}).option(`mtls-certificate-id`,{type:`string`,description:`Define mTLS certificate ID obtained after uploading client cert.`}).option(`mtls-sslmode`,{type:`string`,description:`Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.`,choices:[`require`,`verify-ca`,`verify-full`]}).option(`name`,{type:`string`,description:`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`}).option(`origin-connection-limit`,{type:`number`,description:`The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.
9
-
10
- Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
11
- If not specified, defaults to 20 for free tier and 60 for paid tier.
12
- Contact Cloudflare if you need a higher limit.
13
- `}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`edit <hyperdrive-id>`,describe:`Patches and returns the specified Hyperdrive configuration. Custom caching settings are not kept if caching is disabled.`,builder:_,handler:async t=>{if(t.dryRun){l({command:`cf hyperdrive edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs/${t[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(t[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(t[`hyperdrive-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({caching:{disabled:t[`caching-disabled`],max_age:t[`caching-max-age`],stale_while_revalidate:t[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(t[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(t[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(t[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(t.name,`name`,`text`),origin_connection_limit:t[`origin-connection-limit`]}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.hyperdrive.edit({...e,account_id:r,hyperdrive_id:t[`hyperdrive-id`]})),{successLabel:`Updated`});return}let p=s({caching:{disabled:t[`caching-disabled`],max_age:t[`caching-max-age`],stale_while_revalidate:t[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(t[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(t[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(t[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(t.name,`name`,`text`),origin_connection_limit:t[`origin-connection-limit`]});c(await u(`Updating`,async()=>n.hyperdrive.edit({...p,account_id:r,hyperdrive_id:t[`hyperdrive-id`]})),{successLabel:`Updated`})}};function y(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <hyperdrive-id>`,describe:`Returns the specified Hyperdrive configuration.`,builder:y,handler:async t=>{if(t.dryRun){l({command:`cf hyperdrive get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs/${t[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(t[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(t[`hyperdrive-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.hyperdrive.get({account_id:r,hyperdrive_id:t[`hyperdrive-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Returns a list of Hyperdrives.`,builder:x,handler:async t=>{let n={page:t.page,per_page:t[`per-page`]};if(t.dryRun){l({command:`cf hyperdrive list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs`,pathParams:{},query:n,bodyKind:`none`});return}let r=await a(t),o=t.local?f:await i(r);t.accountId=o,c(await u(`Loading`,async()=>r.hyperdrive.list({account_id:o,...n})),{successLabel:`Loaded`})}};function C(e){return e.positional(`hyperdrive-id`,{type:`string`,description:`The unique identifier of the Hyperdrive configuration.`,demandOption:!0}).option(`caching-disabled`,{type:`boolean`,description:`Set to true to disable caching of SQL responses. Default is false.`}).option(`caching-max-age`,{type:`number`,description:`Specify the maximum duration (in seconds) items should persist in the cache. Defaults to 60 seconds if not specified.`}).option(`caching-stale-while-revalidate`,{type:`number`,description:`Specify the number of seconds the cache may serve a stale response. Defaults to 15 seconds if not specified.`}).option(`mtls-ca-certificate-id`,{type:`string`,description:`Define CA certificate ID obtained after uploading CA cert.`}).option(`mtls-certificate-id`,{type:`string`,description:`Define mTLS certificate ID obtained after uploading client cert.`}).option(`mtls-sslmode`,{type:`string`,description:`Set SSL mode to 'require', 'verify-ca', or 'verify-full' to verify the CA.`,choices:[`require`,`verify-ca`,`verify-full`]}).option(`name`,{type:`string`,description:`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`}).option(`origin-database`,{type:`string`,description:`Set the name of your origin database.`}).option(`origin-password`,{type:`string`,description:`Set the password needed to access your origin database. The API never returns this write-only value.`}).option(`origin-scheme`,{type:`string`,description:`Specifies the URL scheme used to connect to your origin database.`,choices:[`postgres`,`postgresql`,`mysql`]}).option(`origin-user`,{type:`string`,description:`Set the user of your origin database.`}).option(`origin-host`,{type:`string`,description:`Defines the host (hostname or IP) of your origin database.`}).option(`origin-port`,{type:`number`,description:`Defines the port of your origin database. Defaults to 5432 for PostgreSQL or 3306 for MySQL if not specified.`}).option(`origin-access-client-id`,{type:`string`,description:`Defines the Client ID of the Access token to use when connecting to the origin database.`}).option(`origin-access-client-secret`,{type:`string`,description:`Defines the Client Secret of the Access Token to use when connecting to the origin database. The API never returns this write-only value.`}).option(`origin-service-id`,{type:`string`,description:`The identifier of the Workers VPC Service to connect through. Hyperdrive will egress through the specified VPC Service to reach the origin database.`}).option(`origin-connection-limit`,{type:`number`,description:`The (soft) maximum number of connections the Hyperdrive is allowed to make to the origin database.
14
-
15
- Maximum allowed: 20 for free tier accounts, 100 for paid tier accounts.
16
- If not specified, defaults to 20 for free tier and 60 for paid tier.
17
- Contact Cloudflare if you need a higher limit.
18
- `}).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(`origin-host`,[`origin-service-id`]).conflicts(`origin-port`,[`origin-access-client-id`,`origin-access-client-secret`,`origin-service-id`]).implies(`origin-port`,[`origin-host`]).conflicts(`origin-access-client-id`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-id`,[`origin-host`,`origin-access-client-secret`]).conflicts(`origin-access-client-secret`,[`origin-port`,`origin-service-id`]).implies(`origin-access-client-secret`,[`origin-host`,`origin-access-client-id`]).conflicts(`origin-service-id`,[`origin-host`,`origin-port`,`origin-access-client-id`,`origin-access-client-secret`])}const w={command:`update <hyperdrive-id>`,describe:`Updates and returns the specified Hyperdrive configuration.`,builder:C,handler:async r=>{if(r.dryRun){l({command:`cf hyperdrive update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/hyperdrive/configs/${r[`hyperdrive-id`]==null?`<hyperdrive-id>`:encodeURIComponent(String(r[`hyperdrive-id`]))}`,pathParams:{"hyperdrive-id":String(r[`hyperdrive-id`]??``)},bodyKind:`json`,body:r.body===void 0?s({caching:{disabled:r[`caching-disabled`],max_age:r[`caching-max-age`],stale_while_revalidate:r[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(r[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(r[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(r[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(r.name,`name`,`text`),origin:{database:d(r[`origin-database`],`origin-database`,`text`),password:d(r[`origin-password`],`origin-password`,`text`),scheme:d(r[`origin-scheme`],`origin-scheme`,`text`),user:d(r[`origin-user`],`origin-user`,`text`),host:d(r[`origin-host`],`origin-host`,`text`),port:r[`origin-port`],access_client_id:d(r[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:d(r[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:d(r[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:r[`origin-connection-limit`]}):o(r.body)});return}let p=await a(r),m=r.local?f:await i(p);if(r.accountId=m,r.body){let e=o(r.body);c(await u(`Updating`,async()=>p.hyperdrive.update({body:e,account_id:m,hyperdrive_id:r[`hyperdrive-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await t(`name`,`The name of the Hyperdrive configuration. Used to identify the configuration in the Cloudflare dashboard and API.`)),r[`origin-database`]===void 0&&(r[`origin-database`]=await t(`origin-database`,`Set the name of your origin database.`)),r[`origin-password`]===void 0&&(r[`origin-password`]=await t(`origin-password`,`Set the password needed to access your origin database. The API never returns this write-only value.`,{kind:`secret`})),r[`origin-scheme`]===void 0&&(r[`origin-scheme`]=await n(`origin-scheme`,`Specifies the URL scheme used to connect to your origin database.`,[`postgres`,`postgresql`,`mysql`])),r[`origin-user`]===void 0&&(r[`origin-user`]=await t(`origin-user`,`Set the user of your origin database.`));let h=s({caching:{disabled:r[`caching-disabled`],max_age:r[`caching-max-age`],stale_while_revalidate:r[`caching-stale-while-revalidate`]},mtls:{ca_certificate_id:d(r[`mtls-ca-certificate-id`],`mtls-ca-certificate-id`,`text`),mtls_certificate_id:d(r[`mtls-certificate-id`],`mtls-certificate-id`,`text`),sslmode:d(r[`mtls-sslmode`],`mtls-sslmode`,`text`)},name:d(r.name,`name`,`text`),origin:{database:d(r[`origin-database`],`origin-database`,`text`),password:d(r[`origin-password`],`origin-password`,`text`),scheme:d(r[`origin-scheme`],`origin-scheme`,`text`),user:d(r[`origin-user`],`origin-user`,`text`),host:d(r[`origin-host`],`origin-host`,`text`),port:r[`origin-port`],access_client_id:d(r[`origin-access-client-id`],`origin-access-client-id`,`text`),access_client_secret:d(r[`origin-access-client-secret`],`origin-access-client-secret`,`text`),service_id:d(r[`origin-service-id`],`origin-service-id`,`text`)},origin_connection_limit:r[`origin-connection-limit`]});c(await u(`Updating`,async()=>p.hyperdrive.update({body:h,account_id:m,hyperdrive_id:r[`hyperdrive-id`]})),{successLabel:`Updated`})}},T={command:`hyperdrive`,describe:`Accelerate access to existing databases by caching queries and pooling connections at the edge`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};