cf 0.5.0 → 0.7.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 (317) hide show
  1. package/dist/_meta/agent-context.json +78 -41
  2. package/dist/_meta/commands.json +19888 -21071
  3. package/dist/_meta/schemas.json +14305 -15328
  4. package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
  5. package/dist/account-D8mYiWxQ.mjs +2 -0
  6. package/dist/accounts-CJci1Oez.mjs +23 -0
  7. package/dist/acm-CmCd985Q.mjs +3 -0
  8. package/dist/addressing-R7p6TRBe.mjs +12 -0
  9. package/dist/{agent-context-DMPfi54f.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
  10. package/dist/ai-BzJg0RIX.mjs +3 -0
  11. package/dist/ai-audit-B0vJNOZG.mjs +2 -0
  12. package/dist/ai-gateway-D3vJR3My.mjs +10 -0
  13. package/dist/ai-search-CNg7W7U4.mjs +7 -0
  14. package/dist/alerting-_sdM0B0S.mjs +6 -0
  15. package/dist/alerts-dpT6Qsdu.mjs +2 -0
  16. package/dist/{analytics-DSSRDZz8.mjs → analytics-BFBJhDrP.mjs} +1 -1
  17. package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
  18. package/dist/api-gateway-D4AIEtUq.mjs +33 -0
  19. package/dist/argo-Bjk6nFfs.mjs +2 -0
  20. package/dist/artifacts-Ba4b3iOa.mjs +4 -0
  21. package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BE0T5All.mjs} +1 -1
  22. package/dist/{auth-CSC4yhEJ.mjs → auth-CZ0E51rF.mjs} +3 -3
  23. package/dist/auth-D_zyQbDR.mjs +5 -0
  24. package/dist/autorag-Cnpp8PAG.mjs +2 -0
  25. package/dist/billing-Dz6Zj8Eq.mjs +2 -0
  26. package/dist/bot-management-pFwIbFi-.mjs +5 -0
  27. package/dist/botnet-feed-BY9uGChY.mjs +3 -0
  28. package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
  29. package/dist/brands-CGpk9nZB.mjs +2 -0
  30. package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
  31. package/dist/browser-run-DhHtz4y3.mjs +4 -0
  32. package/dist/build-CWuStmDi.mjs +2 -0
  33. package/dist/cache-DVhkiIGK.mjs +5 -0
  34. package/dist/calls-95zjvIcO.mjs +4 -0
  35. package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
  36. package/dist/cf-BLT7uKJF.mjs +18 -0
  37. package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
  38. package/dist/clear-DXx8WBAN.mjs +2 -0
  39. package/dist/client-certificates-D6mE4vJu.mjs +3 -0
  40. package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
  41. package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
  42. package/dist/{completions-DOeHPdCG.mjs → completions-DMc_PlIw.mjs} +2 -2
  43. package/dist/connectivity-DJkE3crz.mjs +3 -0
  44. package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
  45. package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
  46. package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
  47. package/dist/connectors-zWaZTi2A.mjs +3 -0
  48. package/dist/content-scanning-CGvGf04y.mjs +4 -0
  49. package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
  50. package/dist/custom-certificates-CWUrPYLP.mjs +5 -0
  51. package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
  52. package/dist/custom-hostnames-CVQSksqq.mjs +5 -0
  53. package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
  54. package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
  55. package/dist/d1-78Ym1P6D.mjs +4 -0
  56. package/dist/data-security-zmFoMwRU.mjs +6 -0
  57. package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
  58. package/dist/{deploy-dVrgDUOp.mjs → deploy-CVvkZFjR.mjs} +1 -1
  59. package/dist/{dev-C01_Lby6.mjs → dev-DSslyDXx.mjs} +1 -1
  60. package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
  61. package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
  62. package/dist/dist-B7hsuvbF.mjs +57 -0
  63. package/dist/dist-BH-4NQOV.mjs +134 -0
  64. package/dist/dns-D7VAaCyO.mjs +29 -0
  65. package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
  66. package/dist/domain-info-CRvKc2Lg.mjs +2 -0
  67. package/dist/durable-objects-BIpvyu9m.mjs +2 -0
  68. package/dist/email-auth-Cx--s8W4.mjs +2 -0
  69. package/dist/email-routing-CiDbivcN.mjs +10 -0
  70. package/dist/email-security-BYeAuSc6.mjs +12 -0
  71. package/dist/email-sending-Dg2rSmHH.mjs +4 -0
  72. package/dist/filters-DZ8YnQ90.mjs +4 -0
  73. package/dist/firewall-DEd1hs_I.mjs +11 -0
  74. package/dist/flagship-DVw7xGoP.mjs +4 -0
  75. package/dist/{fraud-C03MtdZb.mjs → fraud-BbGS3FZs.mjs} +2 -2
  76. package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
  77. package/dist/healthchecks-Da9N3ix4.mjs +4 -0
  78. package/dist/hostnames-mimZu2tB.mjs +3 -0
  79. package/dist/hyperdrive-BNdvxOos.mjs +21 -0
  80. package/dist/iam-DGQ-OgRl.mjs +6 -0
  81. package/dist/images-CI6Iy9ho.mjs +7 -0
  82. package/dist/index.mjs +1 -1
  83. package/dist/intel-BDB-aRtU.mjs +3 -0
  84. package/dist/internal-Czlp5Ekb.mjs +2 -0
  85. package/dist/{ips-nv9INuWZ.mjs → ips-B9UuPvsY.mjs} +1 -1
  86. package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
  87. package/dist/kv-BHerx4dZ.mjs +5 -0
  88. package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
  89. package/dist/live-Ce7dZW7p.mjs +2 -0
  90. package/dist/load-balancers-DSjS5WKw.mjs +6 -0
  91. package/dist/logexplorer-DBIfTlRP.mjs +24 -0
  92. package/dist/logo-matches-C00iGpzW.mjs +2 -0
  93. package/dist/logos-CJLhx1go.mjs +3 -0
  94. package/dist/logpush-Cr1U-eK-.mjs +5 -0
  95. package/dist/logs-DMvtchc6.mjs +3 -0
  96. package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
  97. package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
  98. package/dist/magic-transit-DiKiPUax.mjs +110 -0
  99. package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
  100. package/dist/matches-B0yHbQ2I.mjs +2 -0
  101. package/dist/moq-UgBawOXe.mjs +13 -0
  102. package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
  103. package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
  104. package/dist/oauth-DBJ5GSFk.mjs +40 -0
  105. package/dist/observability-B-1y36QS.mjs +4 -0
  106. package/dist/organization-Dq3PClZ7.mjs +41 -0
  107. package/dist/organizations-AhsQkHyX.mjs +2 -0
  108. package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
  109. package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
  110. package/dist/origin-tls-client-auth-BDw5q-6G.mjs +4 -0
  111. package/dist/{page-rules-EZHJePmn.mjs → page-rules-DqYQ23eg.mjs} +5 -5
  112. package/dist/{page-shield-CXJioWPs.mjs → page-shield-DKdlZOLO.mjs} +5 -5
  113. package/dist/pages-BsXF11Kv.mjs +11 -0
  114. package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
  115. package/dist/pipelines-D_QhSnGW.mjs +6 -0
  116. package/dist/progress-O88q63Bk.mjs +2 -0
  117. package/dist/prompt-DTAWiEm2.mjs +3 -0
  118. package/dist/queries-CAE95-OH.mjs +3 -0
  119. package/dist/queues-BBz35Mqd.mjs +6 -0
  120. package/dist/r2-Zp99S5xF.mjs +21 -0
  121. package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
  122. package/dist/radar-Cij-XVQJ.mjs +2 -0
  123. package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
  124. package/dist/rate-limits-DSdToIWv.mjs +5 -0
  125. package/dist/raw-fetch-DgezeshQ.mjs +2 -0
  126. package/dist/ready-DMpJvyaz.mjs +2 -0
  127. package/dist/realtime-kit-9rJcapfM.mjs +18 -0
  128. package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
  129. package/dist/refute-BGTpr5sy.mjs +2 -0
  130. package/dist/registrar-CXViZlah.mjs +83 -0
  131. package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
  132. package/dist/request-tracers-DATfBnE9.mjs +2 -0
  133. package/dist/{resolve-C3h-mwp7.mjs → resolve-Bs2sMRYS.mjs} +1 -1
  134. package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
  135. package/dist/resource-tagging-BTn05AOj.mjs +16 -0
  136. package/dist/rules-ens3OHme.mjs +4 -0
  137. package/dist/rulesets-bkreZRao.mjs +8 -0
  138. package/dist/rum-CpgXFcwl.mjs +4 -0
  139. package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
  140. package/dist/scan-page-BqoQTk3R.mjs +2 -0
  141. package/dist/{schema-BR31o4P6.mjs → schema-DCF4yEp_.mjs} +1 -1
  142. package/dist/schema-validation-Ca6o94ts.mjs +24 -0
  143. package/dist/scim-C4oT8TMc.mjs +4 -0
  144. package/dist/sdk-pQ5kaGUX.mjs +3 -0
  145. package/dist/search-C4T5riPh.mjs +2 -0
  146. package/dist/secrets-store-CWEuiDNo.mjs +7 -0
  147. package/dist/security-center-BOvm7xy6.mjs +2 -0
  148. package/dist/security-txt-BCAUBctN.mjs +3 -0
  149. package/dist/session-B1ARgLG7.mjs +2 -0
  150. package/dist/share-DhmVspmL.mjs +5 -0
  151. package/dist/shared-Bod3-Exx.mjs +990 -0
  152. package/dist/signed-url-DA509wgp.mjs +2 -0
  153. package/dist/smart-shield-DZm4fn6z.mjs +3 -0
  154. package/dist/snippets-oQ0u26-z.mjs +4 -0
  155. package/dist/{spawn-CCGzKlC4.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
  156. package/dist/{spectrum-pVGxb7u5.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
  157. package/dist/speed-DqNnvLBD.mjs +4 -0
  158. package/dist/{src-DU7FBCOX.mjs → src-By-zTCHz.mjs} +9 -9
  159. package/dist/ssl-tS3CYZsZ.mjs +15 -0
  160. package/dist/state-OsdDJvdj.mjs +2 -0
  161. package/dist/stream-Bud9Os5V.mjs +14 -0
  162. package/dist/submission-info-DfIXmu-M.mjs +2 -0
  163. package/dist/submit-BtP8she2.mjs +2 -0
  164. package/dist/tenant-CMwHa-tU.mjs +2 -0
  165. package/dist/token-validation-BYC7HTok.mjs +10 -0
  166. package/dist/{tools-D_hfUU_Z.mjs → tools-Dru4l8yh.mjs} +1 -1
  167. package/dist/total-queries-DdLBNJzd.mjs +2 -0
  168. package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
  169. package/dist/turnstile-CP4nScaL.mjs +23 -0
  170. package/dist/{ui-erjBdVKL.mjs → ui-BNoF0KpD.mjs} +2 -2
  171. package/dist/url-info-Chs9h7Y-.mjs +2 -0
  172. package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
  173. package/dist/url-scanner-D4pYNlO-.mjs +2 -0
  174. package/dist/user-DtefniLc.mjs +11 -0
  175. package/dist/vectorize-BeAY2g-7.mjs +4 -0
  176. package/dist/verify-D7J3F_NZ.mjs +2 -0
  177. package/dist/{versions-CBHwWPAM.mjs → versions-dMW3bLVv.mjs} +1 -1
  178. package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
  179. package/dist/web3-Dhw79l4S.mjs +4 -0
  180. package/dist/workers-builds-CuOAB3u4.mjs +7 -0
  181. package/dist/workers-l3zMNOU6.mjs +20 -0
  182. package/dist/workflows-rb7RYBKP.mjs +6 -0
  183. package/dist/zaraz-CHecMYuo.mjs +2 -0
  184. package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
  185. package/dist/zone-BnnqJwW-.mjs +2 -0
  186. package/dist/zones-DpI2YikF.mjs +21 -0
  187. package/package.json +3 -1
  188. package/dist/abuse-reports-Ina5TlsU.mjs +0 -8
  189. package/dist/accounts-B_joQcMi.mjs +0 -22
  190. package/dist/acm-_kIHqYME.mjs +0 -3
  191. package/dist/addressing-CaFlw8y1.mjs +0 -12
  192. package/dist/ai-CqnhNb_c.mjs +0 -2
  193. package/dist/ai-gateway-pgYGI519.mjs +0 -8
  194. package/dist/ai-search-eqQMPQol.mjs +0 -7
  195. package/dist/ai_gateway--vuVLnOm.mjs +0 -4
  196. package/dist/alerting-CPxHiYHb.mjs +0 -6
  197. package/dist/analytics_engine-gWyfnsCs.mjs +0 -2
  198. package/dist/api-gateway-BXXGFCVR.mjs +0 -33
  199. package/dist/argo-aC6A3JyX.mjs +0 -2
  200. package/dist/artifacts-HD4V2xpK.mjs +0 -4
  201. package/dist/auth-D5hNsOFq.mjs +0 -5
  202. package/dist/billing-COaghyxl.mjs +0 -2
  203. package/dist/bot-management-DmEzeV1Y.mjs +0 -5
  204. package/dist/botnet-feed-ByEAXAkw.mjs +0 -3
  205. package/dist/brand-protection-dPrGe8sL.mjs +0 -3
  206. package/dist/browser-rendering-BiSGnpBf.mjs +0 -4
  207. package/dist/build-HuS9-R0V.mjs +0 -1054
  208. package/dist/cache-CY-7Lt71.mjs +0 -5
  209. package/dist/calls-wOQGDWPl.mjs +0 -4
  210. package/dist/certificate-authorities-CtqzAtxQ.mjs +0 -2
  211. package/dist/client-certificates-CRf41xLe.mjs +0 -3
  212. package/dist/cloud-connector-BA5IRZUP.mjs +0 -2
  213. package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
  214. package/dist/config-B5k-XbwS.mjs +0 -2
  215. package/dist/connectivity-Bx3MgTHX.mjs +0 -3
  216. package/dist/connector-interrupts-D7ylweJZ.mjs +0 -2
  217. package/dist/connector-telemetry-events-6izV1kbP.mjs +0 -2
  218. package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +0 -2
  219. package/dist/connectors-DRt4e6d_.mjs +0 -3
  220. package/dist/content-scanning-Cd2vy5Sz.mjs +0 -4
  221. package/dist/context-jpewmual.mjs +0 -2
  222. package/dist/custom-certificates-DYE-9epx.mjs +0 -5
  223. package/dist/custom-hostnames-CtuTdFcX.mjs +0 -5
  224. package/dist/custom-nameservers-CWqA51in.mjs +0 -3
  225. package/dist/custom-pages-DeUKEFGe.mjs +0 -4
  226. package/dist/d1-DvWY9Gp4.mjs +0 -4
  227. package/dist/data-security-BPo6dIWu.mjs +0 -6
  228. package/dist/diagnostics-6nKPmVgz.mjs +0 -3
  229. package/dist/dispatch-namespaces-64lXx2WJ.mjs +0 -7
  230. package/dist/dist-C6zxsVdY.mjs +0 -306
  231. package/dist/dist-t_YrL25p.mjs +0 -82
  232. package/dist/dns-ClciFGxx.mjs +0 -29
  233. package/dist/dns-firewall-DfUmXDCe.mjs +0 -57
  234. package/dist/durable-objects-CMaYZ-YU.mjs +0 -2
  235. package/dist/email-routing-CGXhFqF5.mjs +0 -10
  236. package/dist/email-security-D5viPq8S.mjs +0 -8
  237. package/dist/email-sending-C2jpc3gh.mjs +0 -3
  238. package/dist/filters-bzsFcWt0.mjs +0 -4
  239. package/dist/firewall-DYZcTtIC.mjs +0 -11
  240. package/dist/google-tag-gateway-Dfy887yA.mjs +0 -2
  241. package/dist/healthchecks-DRoAlWgr.mjs +0 -4
  242. package/dist/hostnames-CFgIVI3s.mjs +0 -3
  243. package/dist/hyperdrive-C7-gwTSV.mjs +0 -18
  244. package/dist/iam-DqVPzGrb.mjs +0 -6
  245. package/dist/images-BYfl4YgR.mjs +0 -7
  246. package/dist/intel-duTEPIHc.mjs +0 -3
  247. package/dist/keyless-certificates-CRCDVd3g.mjs +0 -3
  248. package/dist/kv-CZoV4tiv.mjs +0 -5
  249. package/dist/leaked-credential-checks-DNIBg7Pe.mjs +0 -3
  250. package/dist/load-balancers--OMg0HNt.mjs +0 -6
  251. package/dist/logpush-C0_lZTyY.mjs +0 -4
  252. package/dist/logs-BtpWZQfV.mjs +0 -3
  253. package/dist/magic-cloud-networking-u6rwYbGg.mjs +0 -5
  254. package/dist/magic-network-monitoring-CKgQyRj4.mjs +0 -4
  255. package/dist/magic-transit-CLhMcJ_-.mjs +0 -89
  256. package/dist/managed-transforms-D0Z2mlth.mjs +0 -3
  257. package/dist/mtls-certificates-BL65NK5T.mjs +0 -3
  258. package/dist/network-interconnects-Bgu9gmaG.mjs +0 -36
  259. package/dist/oauth-Bk-F-tIO.mjs +0 -52
  260. package/dist/observability-BynRbTF4.mjs +0 -4
  261. package/dist/organizations-BqJHyvMK.mjs +0 -41
  262. package/dist/origin-ca-certificates-BGvYwm3C.mjs +0 -3
  263. package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +0 -2
  264. package/dist/origin-tls-client-auth-d3snC3vr.mjs +0 -4
  265. package/dist/pages-D4aYteKk.mjs +0 -11
  266. package/dist/pipelines-G8Iusxq-.mjs +0 -6
  267. package/dist/progress-DrDErV9w.mjs +0 -2
  268. package/dist/queues-DEkbKqZX.mjs +0 -6
  269. package/dist/r2-CV0IkCAW.mjs +0 -21
  270. package/dist/r2-data-catalog-NtqGC_a_.mjs +0 -14
  271. package/dist/radar-D986zPJr.mjs +0 -2
  272. package/dist/rate-limits-B2wRsUX1.mjs +0 -5
  273. package/dist/raw-fetch-_n0lMAnD.mjs +0 -2
  274. package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
  275. package/dist/registrar-CDIwTz3G.mjs +0 -46
  276. package/dist/request-tracers-D7SFMDik.mjs +0 -2
  277. package/dist/resource-sharing-YIQ04jXE.mjs +0 -5
  278. package/dist/resource-tagging-Bd6Y03sg.mjs +0 -16
  279. package/dist/rules-DHjLP5Kx.mjs +0 -4
  280. package/dist/rulesets-q4QABpKs.mjs +0 -8
  281. package/dist/rum-SmT4HZmM.mjs +0 -4
  282. package/dist/schema-validation-vVetgC_P.mjs +0 -24
  283. package/dist/scim-ChOkZpNx.mjs +0 -3
  284. package/dist/sdk-DhIhH6GB.mjs +0 -5
  285. package/dist/secrets-store-BAK9G12O.mjs +0 -25
  286. package/dist/security-center-eScuYDKP.mjs +0 -2
  287. package/dist/security-txt-x7R4gmQu.mjs +0 -3
  288. package/dist/session-DHYCE-PM.mjs +0 -93
  289. package/dist/shared-BAjo72Lz.mjs +0 -2
  290. package/dist/smart-shield-CWlSsNi8.mjs +0 -3
  291. package/dist/snippets-DrlgYJYp.mjs +0 -4
  292. package/dist/speed-ZFrMWDgd.mjs +0 -4
  293. package/dist/ssl-9JY05sYt.mjs +0 -15
  294. package/dist/stream-tRU39b8K.mjs +0 -14
  295. package/dist/tenants-HLGUazms.mjs +0 -2
  296. package/dist/token-validation-_VdamKpz.mjs +0 -10
  297. package/dist/turnstile-BRzXd28B.mjs +0 -23
  298. package/dist/url-normalization-D-NxuLtN.mjs +0 -3
  299. package/dist/url-scanner-BzzR6iDx.mjs +0 -2
  300. package/dist/user-C4omq__w.mjs +0 -10
  301. package/dist/vectorize-By6EqcNR.mjs +0 -4
  302. package/dist/waiting-rooms-u6KwrzWd.mjs +0 -11
  303. package/dist/web3-DQ5dmE9W.mjs +0 -4
  304. package/dist/workers-D8Be7_as.mjs +0 -18
  305. package/dist/workers-builds-BE3W3qNk.mjs +0 -7
  306. package/dist/workflows-BWWufqFA.mjs +0 -4
  307. package/dist/zaraz-Bsa9AvVL.mjs +0 -2
  308. package/dist/zero-trust-UNVZFnKu.mjs +0 -118
  309. package/dist/zero_trust-B0_Rk4p2.mjs +0 -3
  310. package/dist/zones-BXtdwt6E.mjs +0 -21
  311. /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
  312. /package/dist/{cli-types-BeyOc81z.mjs → cli-types-CFw6Xygp.mjs} +0 -0
  313. /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
  314. /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
  315. /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
  316. /package/dist/{metadata-OOwvpR8m.mjs → metadata-Cnyws6iO.mjs} +0 -0
  317. /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{S as e,g as t,w as n}from"./oauth-Bk-F-tIO.mjs";import{n as r}from"./auth-CSC4yhEJ.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-DrDErV9w.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./local-CYc9q7l2.mjs";import{t as d}from"./cli-types-BeyOc81z.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 n=>{if(n.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:n.body===void 0?a({device:{id:l(n[`device-id`],`device-id`,`text`),provision_license:n[`device-provision-license`],serial_number:l(n[`device-serial-number`],`device-serial-number`,`text`)},activated:n.activated,interrupt_window_days_of_week:n[`interrupt-window-days-of-week`],interrupt_window_duration_hours:n[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:n[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:n[`interrupt-window-hour-of-day`],notes:l(n.notes,`notes`,`text`),primary:n.primary,site_id:l(n[`site-id`],`site-id`,`text`),timezone:l(n.timezone,`timezone`,`text`)}):i(n.body)});return}let d=await r(n),f=n.local?u:await t(d);if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Creating`,async()=>d.connectors.create({...e,account_id:f})),{successLabel:`Created`});return}let p=a({device:{id:l(n[`device-id`],`device-id`,`text`),provision_license:n[`device-provision-license`],serial_number:l(n[`device-serial-number`],`device-serial-number`,`text`)},activated:n.activated,interrupt_window_days_of_week:n[`interrupt-window-days-of-week`],interrupt_window_duration_hours:n[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:n[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:n[`interrupt-window-hour-of-day`],notes:l(n.notes,`notes`,`text`),primary:n.primary,site_id:l(n[`site-id`],`site-id`,`text`),timezone:l(n.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 t(a);if(i.accountId=l,!await n({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 n=>{if(n.dryRun){s({command:`cf connectors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/connectors/${n[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(n[`connector-id`]))}`,pathParams:{"connector-id":String(n[`connector-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({activated:n.activated,interrupt_window_days_of_week:n[`interrupt-window-days-of-week`],interrupt_window_duration_hours:n[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:n[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:n[`interrupt-window-hour-of-day`],notes:l(n.notes,`notes`,`text`),primary:n.primary,site_id:l(n[`site-id`],`site-id`,`text`),timezone:l(n.timezone,`timezone`,`text`),provision_license:n[`provision-license`]}):i(n.body)});return}let d=await r(n),f=n.local?u:await t(d);if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.connectors.edit({...e,account_id:f,connector_id:n[`connector-id`]})),{successLabel:`Updated`});return}let p=a({activated:n.activated,interrupt_window_days_of_week:n[`interrupt-window-days-of-week`],interrupt_window_duration_hours:n[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:n[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:n[`interrupt-window-hour-of-day`],notes:l(n.notes,`notes`,`text`),primary:n.primary,site_id:l(n[`site-id`],`site-id`,`text`),timezone:l(n.timezone,`timezone`,`text`),provision_license:n[`provision-license`]});o(await c(`Updating`,async()=>d.connectors.edit({...p,account_id:f,connector_id:n[`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 n=>{if(n.dryRun){s({command:`cf connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/connectors/${n[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(n[`connector-id`]))}`,pathParams:{"connector-id":String(n[`connector-id`]??``)},bodyKind:`none`});return}let i=await r(n),a=n.local?u:await t(i);n.accountId=a,o(await c(`Loading`,async()=>i.connectors.get({account_id:a,connector_id:n[`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 n=>{let i={device_type:n[`device-type`]};if(n.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(n),l=n.local?u:await t(a);n.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 n=>{if(n.dryRun){s({command:`cf connectors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/magic/connectors/${n[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(n[`connector-id`]))}`,pathParams:{"connector-id":String(n[`connector-id`]??``)},bodyKind:`json`,body:n.body===void 0?a({activated:n.activated,interrupt_window_days_of_week:n[`interrupt-window-days-of-week`],interrupt_window_duration_hours:n[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:n[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:n[`interrupt-window-hour-of-day`],notes:l(n.notes,`notes`,`text`),primary:n.primary,site_id:l(n[`site-id`],`site-id`,`text`),timezone:l(n.timezone,`timezone`,`text`),provision_license:n[`provision-license`]}):i(n.body)});return}let d=await r(n),f=n.local?u:await t(d);if(n.accountId=f,n.body){let e=i(n.body);o(await c(`Updating`,async()=>d.connectors.update({...e,account_id:f,connector_id:n[`connector-id`]})),{successLabel:`Updated`});return}let p=a({activated:n.activated,interrupt_window_days_of_week:n[`interrupt-window-days-of-week`],interrupt_window_duration_hours:n[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:n[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:n[`interrupt-window-hour-of-day`],notes:l(n.notes,`notes`,`text`),primary:n.primary,site_id:l(n[`site-id`],`site-id`,`text`),timezone:l(n.timezone,`timezone`,`text`),provision_license:n[`provision-license`]});o(await c(`Updating`,async()=>d.connectors.update({...p,account_id:f,connector_id:n[`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,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{T as e,w as t,x as n}from"./oauth-Bk-F-tIO.mjs";import{n as r}from"./auth-CSC4yhEJ.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-DrDErV9w.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";function u(e){return e.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 d={command:`disable`,describe:`Disable Content Scanning.`,builder:u,handler:async e=>{if(e.dryRun){s({command:`cf content-scanning disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/content-upload-scan/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await n({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force,message:`This operation turns off WAF content scanning for a zone.`})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>i.contentScanning.disable({zone_id:a})),{successLabel:`Deleted`})}};function f(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`enable`,describe:`Enable Content Scanning.`,builder:f,handler:async e=>{if(e.dryRun){s({command:`cf content-scanning enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/content-upload-scan/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,o(await c(`Creating`,async()=>t.contentScanning.enable({zone_id:i})),{successLabel:`Created`})}};function m(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of custom scan expressions to add.`})}const h={command:`create`,describe:`Add custom scan expressions for Content Scanning.`,builder:m,handler:async e=>{if(e.dryRun){s({command:`cf content-scanning payloads create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/content-upload-scan/payloads`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:i(e.body)});return}let t=await r(e),a=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=a,e.body){let n=i(e.body);o(await c(`Creating`,async()=>t.contentScanning.payloads.create({body:n,zone_id:a})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function g(e){return e.positional(`expression-id`,{type:`string`,description:`defines the unique ID for this custom scan expression.`,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 <expression-id>`,describe:`Delete a Content Scan Custom Expression.`,builder:g,handler:async e=>{if(e.dryRun){s({command:`cf content-scanning payloads delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/content-upload-scan/payloads/${e[`expression-id`]==null?`<expression-id>`:encodeURIComponent(String(e[`expression-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"expression-id":String(e[`expression-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await n({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}o(await c(`Deleting`,async()=>i.contentScanning.payloads.delete({zone_id:a,expression_id:e[`expression-id`]})),{successLabel:`Deleted`})}};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`Get a list of existing custom scan expressions for Content Scanning.`,builder:v,handler:async e=>{if(e.dryRun){s({command:`cf content-scanning payloads list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/content-upload-scan/payloads`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>t.contentScanning.payloads.list({zone_id:i})),{successLabel:`Loaded`})}},b={command:`payloads`,describe:`Operations for payloads`,builder:e=>e.command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Retrieve the current status of Content Scanning.`,builder:x,handler:async e=>{if(e.dryRun){s({command:`cf content-scanning settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/content-upload-scan/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>t.contentScanning.settings.get({zone_id:i})),{successLabel:`Loaded`})}},C={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`value`,{type:`string`,description:`The status value for Content Scanning.`,choices:[`enabled`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Content Scanning settings to update.`})}const T={command:`update`,describe:`Update the Content Scanning status.`,builder:w,handler:async t=>{if(t.dryRun){s({command:`cf content-scanning update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/content-upload-scan/settings`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({value:l(t.value,`value`,`text`)}):i(t.body)});return}let u=await r(t),d=await n({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=i(t.body);o(await c(`Updating`,async()=>u.contentScanning.update({...e,zone_id:d})),{successLabel:`Updated`});return}t.value===void 0&&(t.value=await e(`value`,`The status value for Content Scanning.`,[`enabled`,`disabled`]));let f=a({value:l(t.value,`value`,`text`)});o(await c(`Updating`,async()=>u.contentScanning.update({...f,zone_id:d})),{successLabel:`Updated`})}},E={command:`content-scanning`,describe:`content-scanning`,builder:e=>e.command(d).command(p).command(T).command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{E as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{a as e}from"./theme-DbNbIY4d.mjs";import{n as t,r as n}from"./ui-erjBdVKL.mjs";import{n as r,r as i}from"./config-B5k-XbwS.mjs";import{C as a,d as o,f as s,h as c,m as l,p as u,v as d,y as f}from"./oauth-Bk-F-tIO.mjs";import{r as p,t as m}from"./auth-CSC4yhEJ.mjs";import{t as h}from"./output-B6fBFRqe.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:o}).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 i=>{let a=i.project?`project`:`user`;if(i.all){l(`all`,a);let i=a===`project`?f():r();if(a===`project`){let r=c();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=i.key?s[i.key]:void 0;u||(console.error(e.error(`Unknown key "${i.key}". Options: ${o.join(`, `)}.`)),process.exit(1)),l(u,a);let d=a===`project`?f():r();console.log(n(`Cleared ${i.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:o,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 i=t.project?`project`:`user`,c=s[t.key];c||(console.error(e.error(`Unknown key "${t.key}". Options: ${o.join(`, `)}.`)),process.exit(1)),c===`complianceRegion`&&(u.includes(t.value)||(console.error(e.error(`Invalid compliance region "${t.value}". Must be one of: ${u.join(`, `)}`)),process.exit(1)));let l;if(c===`accountId`||c===`zone`){let t;try{t=await p()}catch{console.error(e.error(`Please authenticate first with `)+e.code(`cf auth login`)),process.exit(1)}l=m({apiToken:t})}let d=await a(c,t.value,i,l),h=i===`project`?f():r();console.log(n(`Saved ${t.key} "${e.bold(d.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 d(),n=i(),a=c(),o;try{o=m({apiToken:await p()})}catch{}if(o){if(t.accountId){let e=await v(t.accountId.value,o);e&&(t.accountId.name=e)}if(t.zone){let e=await y(t.zone.value,o);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:r(),userConfigExists:!!n,projectConfig:a?.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,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{E as e,w as t,x as n}from"./oauth-Bk-F-tIO.mjs";import{i as r,n as i}from"./auth-CSC4yhEJ.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-DrDErV9w.mjs";import{n as u}from"./input-validation-_fMCApaH.mjs";import{t as d}from"./cli-types-BeyOc81z.mjs";function f(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`],default:`production`}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
3
- Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`type`,{type:`string`,description:`The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.`,choices:[`legacy_custom`,`sni_custom`],default:`legacy_custom`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`create`,describe:`Upload a new SSL certificate for a zone.`,builder:f,handler:async t=>{if(t.dryRun){c({command:`cf custom-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({bundle_method:u(t[`bundle-method`],`bundle-method`,`text`),certificate:u(t.certificate,`certificate`,`text`),custom_csr_id:u(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:u(t.deploy,`deploy`,`text`),geo_restrictions:{label:u(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:u(t.policy,`policy`,`text`),private_key:u(t[`private-key`],`private-key`,`text`),type:u(t.type,`type`,`text`)}):a(t.body)});return}let r=await i(t),d=await n({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=a(t.body);s(await l(`Creating`,async()=>r.customCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await e(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let f=o({bundle_method:u(t[`bundle-method`],`bundle-method`,`text`),certificate:u(t.certificate,`certificate`,`text`),custom_csr_id:u(t[`custom-csr-id`],`custom-csr-id`,`text`),deploy:u(t.deploy,`deploy`,`text`),geo_restrictions:{label:u(t[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:u(t.policy,`policy`,`text`),private_key:u(t[`private-key`],`private-key`,`text`),type:u(t.type,`type`,`text`)});s(await l(`Creating`,async()=>r.customCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function m(e){return e.positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const h={command:`delete <custom-certificate-id>`,describe:`Remove a SSL certificate from a zone.`,builder:m,handler:async e=>{if(e.dryRun){c({command:`cf custom-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_certificates/${e[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(e[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(e[`custom-certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}s(await l(`Deleting`,async()=>r.customCertificates.delete({zone_id:a,custom_certificate_id:e[`custom-certificate-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`]}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`]}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
5
- Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`edit <custom-certificate-id>`,describe:`Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing a configuration for sni_custom certificates will result in a new resource id being returned, and the previous one being deleted.`,builder:g,handler:async e=>{if(e.dryRun){c({command:`cf custom-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_certificates/${e[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(e[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(e[`custom-certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({bundle_method:u(e[`bundle-method`],`bundle-method`,`text`),certificate:u(e.certificate,`certificate`,`text`),custom_csr_id:u(e[`custom-csr-id`],`custom-csr-id`,`text`),deploy:u(e.deploy,`deploy`,`text`),geo_restrictions:{label:u(e[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:u(e.policy,`policy`,`text`),private_key:u(e[`private-key`],`private-key`,`text`)}):a(e.body)});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.customCertificates.edit({...n,zone_id:r,custom_certificate_id:e[`custom-certificate-id`]})),{successLabel:`Updated`});return}let d=o({bundle_method:u(e[`bundle-method`],`bundle-method`,`text`),certificate:u(e.certificate,`certificate`,`text`),custom_csr_id:u(e[`custom-csr-id`],`custom-csr-id`,`text`),deploy:u(e.deploy,`deploy`,`text`),geo_restrictions:{label:u(e[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:u(e.policy,`policy`,`text`),private_key:u(e[`private-key`],`private-key`,`text`)});s(await l(`Updating`,async()=>t.customCertificates.edit({...d,zone_id:r,custom_certificate_id:e[`custom-certificate-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <custom-certificate-id>`,describe:`Retrieves details for a specific custom SSL certificate, including certificate metadata, bundle method, geographic restrictions, and associated keyless server configuration.`,builder:v,handler:async e=>{if(e.dryRun){c({command:`cf custom-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_certificates/${e[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(e[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(e[`custom-certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,s(await l(`Loading`,async()=>t.customCertificates.get({zone_id:r,custom_certificate_id:e[`custom-certificate-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`Status of the zone's custom SSL.`,choices:[`active`,`expired`,`deleted`,`pending`,`initializing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List, search, and filter all of your custom SSL certificates. The higher priority will break ties across overlapping 'legacy_custom' certificates, but 'legacy_custom' certificates will always supercede 'sni_custom' certificates.`,builder:d(b),handler:async e=>{let t={page:e.page,per_page:e[`per-page`],match:e.match,status:e.status};if(e.dryRun){c({command:`cf custom-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await i(e),a=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=a,s(await l(`Loading`,async()=>r.customCertificates.list({zone_id:a,...t})),{successLabel:`Loaded`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update`,describe:`If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across overlapping 'legacy_custom' certificates.`,builder:S,handler:async e=>{if(e.dryRun){c({command:`cf custom-certificates prioritize update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_certificates/prioritize`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let t=await i(e),o=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=o,e.body){let n=a(e.body);s(await l(`Updating`,async()=>t.customCertificates.prioritize.update({...n,zone_id:o})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>r(t,`PUT`,`/zones/${e.zoneId}/custom_certificates/prioritize`)),{successLabel:`Updated`})}},w={command:`prioritize`,describe:`Operations for prioritize`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`custom-certificates`,describe:`Upload and manage your own SSL/TLS certificates for a zone, with priority ordering`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- import{E as e,w as t,x as n}from"./oauth-Bk-F-tIO.mjs";import{n as r}from"./auth-CSC4yhEJ.mjs";import{n as i,t as a}from"./body-parser-DWSy7uZ8.mjs";import{t as o}from"./output-B6fBFRqe.mjs";import{n as s,t as c}from"./progress-DrDErV9w.mjs";import{n as l}from"./input-validation-_fMCApaH.mjs";import{t as u}from"./cli-types-BeyOc81z.mjs";function d(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-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 f={command:`delete <certificate-id>`,describe:`Delete a single custom certificate from a certificate pack that contains two bundled certificates. Deletion is subject to the following constraints. You cannot delete a certificate if it is the only remaining certificate in the pack. At least one certificate must remain in the pack.`,builder:d,handler:async e=>{if(e.dryRun){s({command:`cf custom-hostnames certificate-pack certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_hostnames/${e[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(e[`custom-hostname-id`]))}/certificate_pack/${e[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(e[`certificate-pack-id`]))}/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(e[`custom-hostname-id`]??``),"certificate-pack-id":String(e[`certificate-pack-id`]??``),"certificate-id":String(e[`certificate-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await n({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>i.customHostnames.certificatePack.certificates.delete({zone_id:a,custom_hostname_id:e[`custom-hostname-id`],certificate_pack_id:e[`certificate-pack-id`],certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).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:`update <certificate-id>`,describe:`Replace a single custom certificate within a certificate pack that contains two bundled certificates. The replacement must adhere to the following constraints. You can only replace an RSA certificate with another RSA certificate or an ECDSA certificate with another ECDSA certificate.`,builder:p,handler:async t=>{if(t.dryRun){s({command:`cf custom-hostnames certificate-pack certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_hostnames/${t[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(t[`custom-hostname-id`]))}/certificate_pack/${t[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(t[`certificate-pack-id`]))}/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(t[`custom-hostname-id`]??``),"certificate-pack-id":String(t[`certificate-pack-id`]??``),"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({custom_certificate:l(t[`custom-certificate`],`custom-certificate`,`text`),custom_key:l(t[`custom-key`],`custom-key`,`text`)}):i(t.body)});return}let u=await r(t),d=await n({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=i(t.body);o(await c(`Updating`,async()=>u.customHostnames.certificatePack.certificates.update({body:e,zone_id:d,custom_hostname_id:t[`custom-hostname-id`],certificate_pack_id:t[`certificate-pack-id`],certificate_id:t[`certificate-id`]})),{successLabel:`Updated`});return}t[`custom-certificate`]===void 0&&(t[`custom-certificate`]=await e(`custom-certificate`,`If a custom uploaded certificate is used.`)),t[`custom-key`]===void 0&&(t[`custom-key`]=await e(`custom-key`,`The key for a custom uploaded certificate.`,{kind:`secret`}));let f=a({custom_certificate:l(t[`custom-certificate`],`custom-certificate`,`text`),custom_key:l(t[`custom-key`],`custom-key`,`text`)});o(await c(`Updating`,async()=>u.customHostnames.certificatePack.certificates.update({body:f,zone_id:d,custom_hostname_id:t[`custom-hostname-id`],certificate_pack_id:t[`certificate-pack-id`],certificate_id:t[`certificate-id`]})),{successLabel:`Updated`})}},h={command:`certificates`,describe:`Operations for certificate-pack.certificates`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`certificate-pack`,describe:`Operations for certificate-pack`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`hostname`,{type:`string`,description:`The custom hostname that will point to your hostname via CNAME.`}).option(`ssl-bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).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:`create`,describe:`Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' recommended if the CNAME is already in place (or will be soon). Specifying 'email' will send an email to the WHOIS contacts on file for the base domain plus hostmaster, postmaster, webmaster, admin, administrator. If http is used and the domain is not already pointing to the Managed CNAME host, the PATCH method must be used once it is (to complete validation). Enable bundling of certificates using the custom_cert_bundle field. The bundling process requires the following condition One certificate in the bundle must use an RSA, and the other must use an ECDSA.`,builder:_,handler:async t=>{if(t.dryRun){s({command:`cf custom-hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({custom_origin_server:l(t[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:l(t[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:l(t.hostname,`hostname`,`text`),ssl:{bundle_method:l(t[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:l(t[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:t[`ssl-cloudflare-branding`],custom_certificate:l(t[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:l(t[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:l(t[`ssl-custom-key`],`ssl-custom-key`,`text`),method:l(t[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:t[`ssl-settings-ciphers`],early_hints:l(t[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:l(t[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:l(t[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:l(t[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:l(t[`ssl-type`],`ssl-type`,`text`),wildcard:t[`ssl-wildcard`]}}):i(t.body)});return}let u=await r(t),d=await n({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=i(t.body);o(await c(`Creating`,async()=>u.customHostnames.create({...e,zone_id:d})),{successLabel:`Created`});return}t.hostname===void 0&&(t.hostname=await e(`hostname`,`The custom hostname that will point to your hostname via CNAME.`));let f=a({custom_origin_server:l(t[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:l(t[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:l(t.hostname,`hostname`,`text`),ssl:{bundle_method:l(t[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:l(t[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:t[`ssl-cloudflare-branding`],custom_certificate:l(t[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:l(t[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:l(t[`ssl-custom-key`],`ssl-custom-key`,`text`),method:l(t[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:t[`ssl-settings-ciphers`],early_hints:l(t[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:l(t[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:l(t[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:l(t[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:l(t[`ssl-type`],`ssl-type`,`text`),wildcard:t[`ssl-wildcard`]}});o(await c(`Creating`,async()=>u.customHostnames.create({...f,zone_id:d})),{successLabel:`Created`})}};function y(e){return e.positional(`custom-hostname-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 b={command:`delete <custom-hostname-id>`,describe:`Permanently deletes a custom hostname and revokes any SSL certificates that were issued for it. This action cannot be undone.`,builder:y,handler:async e=>{if(e.dryRun){s({command:`cf custom-hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_hostnames/${e[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(e[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(e[`custom-hostname-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await n({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}o(await c(`Deleting`,async()=>i.customHostnames.delete({zone_id:a,custom_hostname_id:e[`custom-hostname-id`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`ssl-bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`]}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).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:`edit <custom-hostname-id>`,describe:`Modify SSL configuration for a custom hostname. When sent with SSL config that matches existing config, used to indicate that hostname should pass domain control validation (DCV). Can also be used to change validation type, e.g., from 'http' to 'email'. Bundle an existing certificate with another certificate by using the "custom_cert_bundle" field. The bundling process supports combining certificates as long as the following condition is met. One certificate must use the RSA algorithm, and the other must use the ECDSA algorithm.`,builder:x,handler:async e=>{if(e.dryRun){s({command:`cf custom-hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_hostnames/${e[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(e[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(e[`custom-hostname-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?a({custom_origin_server:l(e[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:l(e[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:l(e[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:l(e[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:e[`ssl-cloudflare-branding`],custom_certificate:l(e[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:l(e[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:l(e[`ssl-custom-key`],`ssl-custom-key`,`text`),method:l(e[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:e[`ssl-settings-ciphers`],early_hints:l(e[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:l(e[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:l(e[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:l(e[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:l(e[`ssl-type`],`ssl-type`,`text`),wildcard:e[`ssl-wildcard`]}}):i(e.body)});return}let t=await r(e),u=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=u,e.body){let n=i(e.body);o(await c(`Updating`,async()=>t.customHostnames.edit({...n,zone_id:u,custom_hostname_id:e[`custom-hostname-id`]})),{successLabel:`Updated`});return}let d=a({custom_origin_server:l(e[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:l(e[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:l(e[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:l(e[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:e[`ssl-cloudflare-branding`],custom_certificate:l(e[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:l(e[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:l(e[`ssl-custom-key`],`ssl-custom-key`,`text`),method:l(e[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:e[`ssl-settings-ciphers`],early_hints:l(e[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:l(e[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:l(e[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:l(e[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:l(e[`ssl-type`],`ssl-type`,`text`),wildcard:e[`ssl-wildcard`]}});o(await c(`Updating`,async()=>t.customHostnames.edit({...d,zone_id:u,custom_hostname_id:e[`custom-hostname-id`]})),{successLabel:`Updated`})}};function C(e){return e.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 w={command:`delete`,describe:`Removes the fallback origin configuration for custom hostnames on a zone. Custom hostnames without specific origins will no longer have a fallback.`,builder:C,handler:async e=>{if(e.dryRun){s({command:`cf custom-hostnames fallback-origin delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let i=await r(e),a=await n({zone:e.zone},i,{quiet:e.quiet});if(e.zoneId=a,!await t({force:!!e.force})){process.stderr.write(`Aborted.
5
- `);return}o(await c(`Deleting`,async()=>i.customHostnames.fallbackOrigin.delete({zone_id:a})),{successLabel:`Deleted`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Retrieves the current fallback origin configuration for custom hostnames on a zone. The fallback origin handles traffic when specific custom hostname origins are unavailable.`,builder:T,handler:async e=>{if(e.dryRun){s({command:`cf custom-hostnames fallback-origin get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>t.customHostnames.fallbackOrigin.get({zone_id:i})),{successLabel:`Loaded`})}};function D(e){return e.option(`origin`,{type:`string`,description:`Your origin hostname that requests to your custom hostnames will be sent to.`}).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 O={command:`update`,describe:`Updates the fallback origin configuration for custom hostnames on a zone. Sets the default origin server for custom hostname traffic.`,builder:D,handler:async t=>{if(t.dryRun){s({command:`cf custom-hostnames fallback-origin update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?a({origin:l(t.origin,`origin`,`text`)}):i(t.body)});return}let u=await r(t),d=await n({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=i(t.body);o(await c(`Updating`,async()=>u.customHostnames.fallbackOrigin.update({...e,zone_id:d})),{successLabel:`Updated`});return}t.origin===void 0&&(t.origin=await e(`origin`,`Your origin hostname that requests to your custom hostnames will be sent to.`));let f=a({origin:l(t.origin,`origin`,`text`)});o(await c(`Updating`,async()=>u.customHostnames.fallbackOrigin.update({...f,zone_id:d})),{successLabel:`Updated`})}},k={command:`fallback-origin`,describe:`Operations for fallback-origin`,builder:e=>e.command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get <custom-hostname-id>`,describe:`Retrieves detailed information about a specific custom hostname, including SSL certificate status, ownership verification, and origin configuration.`,builder:A,handler:async e=>{if(e.dryRun){s({command:`cf custom-hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_hostnames/${e[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(e[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(e[`custom-hostname-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await r(e),i=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=i,o(await c(`Loading`,async()=>t.customHostnames.get({zone_id:i,custom_hostname_id:e[`custom-hostname-id`]})),{successLabel:`Loaded`})}};function M(e){return e.option(`hostname`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-exact`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-starts-with`,{type:`string`,description:`Filters hostnames by a prefix match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.contain' parameters.`}).option(`hostname-contain`,{type:`string`,description:`Filters hostnames by a substring match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.startsWith' parameters.`}).option(`id`,{type:`string`,description:`Hostname ID to match against. This ID was generated and returned during the initial custom_hostname creation. This parameter cannot be used with the 'hostname', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of hostnames per page.`}).option(`order`,{type:`string`,description:`Field to order hostnames by.`,choices:[`ssl`,`ssl_status`]}).option(`direction`,{type:`string`,description:`Direction to order hostnames.`,choices:[`asc`,`desc`]}).option(`ssl-status`,{type:`string`,description:`Filter by SSL certificate status.`,choices:[`initializing`,`pending_validation`,`deleted`,`pending_issuance`,`pending_deployment`,`pending_deletion`,`pending_expiration`,`expired`,`active`,`initializing_timed_out`,`validation_timed_out`,`issuance_timed_out`,`deployment_timed_out`,`deletion_timed_out`,`pending_cleanup`,`staging_deployment`,`staging_active`,`deactivating`,`inactive`,`backup_issued`,`holding_deployment`]}).option(`hostname-status`,{type:`string`,description:`Filter by the hostname's activation status.`,choices:[`active`,`pending`,`active_redeploying`,`moved`,`pending_deletion`,`deleted`,`pending_blocked`,`pending_migration`,`pending_provisioned`,`test_pending`,`test_active`,`test_active_apex`,`test_blocked`,`test_failed`,`provisioned`,`blocked`]}).option(`certificate-authority`,{type:`string`,description:`Filter by the certificate authority that issued the SSL certificate.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`wildcard`,{type:`boolean`,description:`Filter by whether the custom hostname is a wildcard hostname.`}).option(`custom-origin-server`,{type:`string`,description:`Filter by custom origin server name.`}).option(`ssl`,{type:`string`,description:`Whether to filter hostnames based on if they have SSL enabled.`,choices:[`0`,`1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List, search, sort, and filter all of your custom hostnames.`,builder:u(M),handler:async e=>{let t={hostname:e.hostname,"hostname.exact":e[`hostname-exact`],"hostname.startsWith":e[`hostname-starts-with`],"hostname.contain":e[`hostname-contain`],id:e.id,page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,ssl_status:e[`ssl-status`],hostname_status:e[`hostname-status`],certificate_authority:e[`certificate-authority`],wildcard:e.wildcard,custom_origin_server:e[`custom-origin-server`],ssl:e.ssl};if(e.dryRun){s({command:`cf custom-hostnames list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let i=await r(e),a=await n({zone:e.zone},i,{quiet:e.quiet});e.zoneId=a,o(await c(`Loading`,async()=>i.customHostnames.list({zone_id:a,...t})),{successLabel:`Loaded`})}},P={command:`custom-hostnames`,describe:`Bring custom vanity domains to your SaaS zone with per-hostname SSL and origin mapping`,builder:e=>e.command(v).command(b).command(S).command(j).command(N).command(g).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{P as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{E as e,S as t,g as n,w as r}from"./oauth-Bk-F-tIO.mjs";import{n as i}from"./auth-CSC4yhEJ.mjs";import{n as a,t as o}from"./body-parser-DWSy7uZ8.mjs";import{t as s}from"./output-B6fBFRqe.mjs";import{n as c,t as l}from"./progress-DrDErV9w.mjs";import{n as u}from"./input-validation-_fMCApaH.mjs";import{t as d}from"./local-CYc9q7l2.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 r=>{if(r.dryRun){c({command:`cf custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({ns_name:u(r[`ns-name`],`ns-name`,`text`),ns_set:r[`ns-set`]}):a(r.body)});return}let f=await i(r),p=r.local?d:await n(f);if(r.accountId=p,r.body){let e=a(r.body);s(await l(`Creating`,async()=>f.customNameservers.create({body:e,account_id:p})),{successLabel:`Created`});return}r[`ns-name`]===void 0&&(r[`ns-name`]=await e(`ns-name`,`The FQDN of the name server.`));let m=o({ns_name:u(r[`ns-name`],`ns-name`,`text`),ns_set:r[`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 e=>{if(e.dryRun){c({command:`cf custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/custom_ns/${e[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(e[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(e[`custom-ns-id`]??``)},bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}s(await l(`Deleting`,async()=>a.customNameservers.delete({account_id:o,custom_ns_id:e[`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 e=>{if(e.dryRun){c({command:`cf custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/custom_ns`,pathParams:{},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.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{E as e,S as t,T as n,g as r,w as i,x as a}from"./oauth-Bk-F-tIO.mjs";import{n as o}from"./auth-CSC4yhEJ.mjs";import{n as s,t as c}from"./body-parser-DWSy7uZ8.mjs";import{t as l}from"./output-B6fBFRqe.mjs";import{n as u,t as d}from"./progress-DrDErV9w.mjs";import{n as f}from"./input-validation-_fMCApaH.mjs";import{t as p}from"./local-CYc9q7l2.mjs";import{t as m}from"./cli-types-BeyOc81z.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 i=>{if(i.dryRun){u({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/custom_pages/${i.identifier==null?`<identifier>`:encodeURIComponent(String(i.identifier))}`,pathParams:{identifier:String(i.identifier??``)},bodyKind:`json`,body:i.body===void 0?c({state:f(i.state,`state`,`text`),url:f(i.url,`url`,`text`)}):s(i.body)});return}let a=await o(i),m=i.local?p:await r(a);if(i.accountId=m,i.body){let e=s(i.body);l(await d(`Updating`,async()=>a.customPages.accountCustomPages.update({...e,account_identifier:m,identifier:i.identifier})),{successLabel:`Updated`});return}i.state===void 0&&(i.state=await n(`state`,`The custom page state.`,[`default`,`customized`])),i.url===void 0&&(i.url=await e(`url`,`The URL associated with the custom page.`));let h=c({state:f(i.state,`state`,`text`),url:f(i.url,`url`,`text`)});l(await d(`Updating`,async()=>a.customPages.accountCustomPages.update({...h,account_identifier:m,identifier:i.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/${t()??`<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 i=await o(n),a=n.local?p:await r(i);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>i.customPages.assets.create.custom.asset({...e,account_identifier:a})),{successLabel:`Created`});return}n.description===void 0&&(n.description=await e(`description`,`A short description of the custom asset.`)),n.name===void 0&&(n.name=await e(`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 e(`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()=>i.customPages.assets.create.custom.asset({...m,account_identifier:a})),{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 t=>{if(t.dryRun){u({command:`cf custom-pages assets create v2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/assets`,pathParams:{"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?c({description:f(t.description,`description`,`text`),name:f(t.name,`name`,`text`),url:f(t.url,`url`,`text`)}):s(t.body)});return}let n=await o(t),r=await a({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.customPages.assets.create.v2({...e,zone_identifier:r})),{successLabel:`Created`});return}t.description===void 0&&(t.description=await e(`description`,`A short description of the custom asset.`)),t.name===void 0&&(t.name=await e(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),t.url===void 0&&(t.url=await e(`url`,`The URL where the asset content is fetched from.`));let i=c({description:f(t.description,`description`,`text`),name:f(t.name,`name`,`text`),url:f(t.url,`url`,`text`)});l(await d(`Creating`,async()=>n.customPages.assets.create.v2({...i,zone_identifier:r})),{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 e=>{if(e.dryRun){u({command:`cf custom-pages assets delete custom asset`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``)},bodyKind:`none`});return}let n=await o(e),a=e.local?p:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}l(await d(`Deleting`,async()=>n.customPages.assets.delete.custom.asset({account_identifier:a,asset_name:e[`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 a({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 e=>{if(e.dryRun){u({command:`cf custom-pages assets get custom asset`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/custom_pages/assets/${e[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(e[`asset-name`]))}`,pathParams:{"asset-name":String(e[`asset-name`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.customPages.assets.get.custom.asset({account_identifier:i,asset_name:e[`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 a({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 e=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){u({command:`cf custom-pages assets list custom assets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/custom_pages/assets`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?p:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.customPages.assets.list.custom.assets({account_identifier:a,...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),r=await a({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>n.customPages.assets.list.v2({zone_identifier:r,...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/${t()??`<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 i=await o(n),a=n.local?p:await r(i);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Updating`,async()=>i.customPages.assets.update.custom.asset({...e,account_identifier:a,asset_name:n[`asset-name`]})),{successLabel:`Updated`});return}n.description===void 0&&(n.description=await e(`description`,`A short description of the custom asset.`)),n.url===void 0&&(n.url=await e(`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()=>i.customPages.assets.update.custom.asset({...m,account_identifier:a,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 t=>{if(t.dryRun){u({command:`cf custom-pages assets update v2`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/assets/${t[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(t[`asset-name`]))}`,pathParams:{"asset-name":String(t[`asset-name`]??``),"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?c({description:f(t.description,`description`,`text`),url:f(t.url,`url`,`text`)}):s(t.body)});return}let n=await o(t),r=await a({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=s(t.body);l(await d(`Updating`,async()=>n.customPages.assets.update.v2({...e,zone_identifier:r,asset_name:t[`asset-name`]})),{successLabel:`Updated`});return}t.description===void 0&&(t.description=await e(`description`,`A short description of the custom asset.`)),t.url===void 0&&(t.url=await e(`url`,`The URL where the asset content is fetched from.`));let i=c({description:f(t.description,`description`,`text`),url:f(t.url,`url`,`text`)});l(await d(`Updating`,async()=>n.customPages.assets.update.v2({...i,zone_identifier:r,asset_name:t[`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 e=>{if(e.dryRun){u({command:`cf custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/custom_pages/${e.identifier==null?`<identifier>`:encodeURIComponent(String(e.identifier))}`,pathParams:{identifier:String(e.identifier??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.customPages.get({account_identifier:i,identifier:e.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 e=>{if(e.dryRun){u({command:`cf custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/custom_pages`,pathParams:{},bodyKind:`none`});return}let n=await o(e),i=e.local?p:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.customPages.list({account_identifier:i})),{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 t=>{if(t.dryRun){u({command:`cf custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/custom_pages/${t.identifier==null?`<identifier>`:encodeURIComponent(String(t.identifier))}`,pathParams:{identifier:String(t.identifier??``),"zone-identifier":String(t.zone??t[`zone-identifier`]??``)},bodyKind:`json`,body:t.body===void 0?c({state:f(t.state,`state`,`text`),url:f(t.url,`url`,`text`)}):s(t.body)});return}let r=await o(t),i=await a({zone:t.zone},r,{quiet:t.quiet});if(t.zoneId=i,t.body){let e=s(t.body);l(await d(`Updating`,async()=>r.customPages.update({...e,zone_identifier:i,identifier:t.identifier})),{successLabel:`Updated`});return}t.state===void 0&&(t.state=await n(`state`,`The custom page state.`,[`default`,`customized`])),t.url===void 0&&(t.url=await e(`url`,`The URL associated with the custom page.`));let p=c({state:f(t.state,`state`,`text`),url:f(t.url,`url`,`text`)});l(await d(`Updating`,async()=>r.customPages.update({...p,zone_identifier:i,identifier:t.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 a({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 a({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{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{t as p}from"./cli-types-BeyOc81z.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/${t()??`<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 i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.d1.create({...e,account_id:p})),{successLabel:`Created`});return}n.name===void 0&&(n.name=await e(`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()=>i.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 e=>{if(e.dryRun){l({command:`cf d1 delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>n.d1.delete({account_id:o,database_id:e[`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 e=>{if(e.dryRun){l({command:`cf d1 edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({read_replication:{mode:d(e[`read-replication-mode`],`read-replication-mode`,`text`)}}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.d1.edit({...t,account_id:i,database_id:e[`database-id`]})),{successLabel:`Updated`});return}let p=s({read_replication:{mode:d(e[`read-replication-mode`],`read-replication-mode`,`text`)}});c(await u(`Updating`,async()=>n.d1.edit({...p,account_id:i,database_id:e[`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 e=>{if(e.dryRun){l({command:`cf d1 export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/export`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({current_bookmark:d(e[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:e[`dump-options-no-data`],no_schema:e[`dump-options-no-schema`],tables:e[`dump-options-tables`]},output_format:d(e[`output-format`],`output-format`,`text`)}):o(e.body)});return}let i=await a(e),p=e.local?f:await r(i);if(e.accountId=p,e.body){let t=o(e.body);c(await u(`Loading`,async()=>i.d1.export({...t,account_id:p,database_id:e[`database-id`]})),{successLabel:`Loaded`});return}e[`output-format`]===void 0&&(e[`output-format`]=await n(`output-format`,`Specifies that you will poll this endpoint until the export completes`,[`polling`]));let m=s({current_bookmark:d(e[`current-bookmark`],`current-bookmark`,`text`),dump_options:{no_data:e[`dump-options-no-data`],no_schema:e[`dump-options-no-schema`],tables:e[`dump-options-tables`]},output_format:d(e[`output-format`],`output-format`,`text`)});c(await u(`Loading`,async()=>i.d1.export({...m,account_id:p,database_id:e[`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 e=>{let n={fields:e.fields};if(e.dryRun){l({command:`cf d1 get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.d1.get({account_id:o,database_id:e[`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 e=>{if(e.dryRun){l({command:`cf d1 import`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/import`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({action:d(e.action,`action`,`text`),etag:d(e.etag,`etag`,`text`),filename:d(e.filename,`filename`,`text`),current_bookmark:d(e[`current-bookmark`],`current-bookmark`,`text`)}):o(e.body)});return}let i=await a(e),p=e.local?f:await r(i);if(e.accountId=p,e.body){let t=o(e.body);c(await u(`Creating`,async()=>i.d1.import({body:t,account_id:p,database_id:e[`database-id`]})),{successLabel:`Created`});return}e.action===void 0&&(e.action=await n(`action`,`Indicates you have a new SQL file to upload.`,[`init`,`ingest`,`poll`]));let m=s({action:d(e.action,`action`,`text`),etag:d(e.etag,`etag`,`text`),filename:d(e.filename,`filename`,`text`),current_bookmark:d(e[`current-bookmark`],`current-bookmark`,`text`)});c(await u(`Creating`,async()=>i.d1.import({body:m,account_id:p,database_id:e[`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 e=>{let n={name:e.name,page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf d1 list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.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 e=>{if(e.dryRun){l({command:`cf d1 query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/query`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({params:e.params,sql:d(e.sql,`sql`,`text`)}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Loading`,async()=>n.d1.query({body:t,account_id:i,database_id:e[`database-id`]})),{successLabel:`Loaded`});return}let p=s({params:e.params,sql:d(e.sql,`sql`,`text`)});c(await u(`Loading`,async()=>n.d1.query({body:p,account_id:i,database_id:e[`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 e=>{if(e.dryRun){l({command:`cf d1 raw`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/raw`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({params:e.params,sql:d(e.sql,`sql`,`text`)}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Loading`,async()=>n.d1.raw({body:t,account_id:i,database_id:e[`database-id`]})),{successLabel:`Loaded`});return}let p=s({params:e.params,sql:d(e.sql,`sql`,`text`)});c(await u(`Loading`,async()=>n.d1.raw({body:p,account_id:i,database_id:e[`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 e=>{let n={timestamp:e.timestamp};if(e.dryRun){l({command:`cf d1 time-travel get-bookmark`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/bookmark`,pathParams:{"database-id":String(e[`database-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.d1.timeTravel.getBookmark({account_id:o,database_id:e[`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 e=>{let n={bookmark:e.bookmark,timestamp:e.timestamp};if(e.dryRun){l({command:`cf d1 time-travel restore`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}/time_travel/restore`,pathParams:{"database-id":String(e[`database-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Creating`,async()=>i.d1.timeTravel.restore({account_id:o,database_id:e[`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 e=>{if(e.dryRun){l({command:`cf d1 update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/d1/database/${e[`database-id`]==null?`<database-id>`:encodeURIComponent(String(e[`database-id`]))}`,pathParams:{"database-id":String(e[`database-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({read_replication:{mode:d(e[`read-replication-mode`],`read-replication-mode`,`text`)}}):o(e.body)});return}let i=await a(e),p=e.local?f:await r(i);if(e.accountId=p,e.body){let t=o(e.body);c(await u(`Updating`,async()=>i.d1.update({...t,account_id:p,database_id:e[`database-id`]})),{successLabel:`Updated`});return}e[`read-replication-mode`]===void 0&&(e[`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(e[`read-replication-mode`],`read-replication-mode`,`text`)}});c(await u(`Updating`,async()=>i.d1.update({...m,account_id:p,database_id:e[`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{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{t as p}from"./cli-types-BeyOc81z.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 e=>{if(e.dryRun){l({command:`cf data-security posture archiveFindingInstance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/instances/archive`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({check_instances:e[`check-instances`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.archiveFindingInstance({body:t,account_id:i,finding_id:e[`finding-id`]})),{successLabel:`Created`});return}if(e[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let d=s({check_instances:e[`check-instances`]});c(await u(`Creating`,async()=>n.dataSecurity.posture.archiveFindingInstance({body:d,account_id:i,finding_id:e[`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 e=>{if(e.dryRun){l({command:`cf data-security posture changeFindingSeverity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/tune_finding_severity`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({new_severity:e[`new-severity`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.changeFindingSeverity({...t,account_id:i,finding_id:e[`finding-id`]})),{successLabel:`Created`});return}if(e[`new-severity`]===void 0)throw Error(`--new-severity is required (or pass --body with this field set).`);let d=s({new_severity:e[`new-severity`]});c(await u(`Creating`,async()=>n.dataSecurity.posture.changeFindingSeverity({...d,account_id:i,finding_id:e[`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 e=>{if(e.dryRun){l({command:`cf data-security posture createContentExport`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/content/export`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({dlp_profile_id:e[`dlp-profile-id`],integration_id:e[`integration-id`],max_affliction_date:d(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(e[`min-affliction-date`],`min-affliction-date`,`text`),search:d(e.search,`search`,`text`),vendors:e.vendors}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createContentExport({...t,account_id:i})),{successLabel:`Created`});return}let p=s({dlp_profile_id:e[`dlp-profile-id`],integration_id:e[`integration-id`],max_affliction_date:d(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(e[`min-affliction-date`],`min-affliction-date`,`text`),search:d(e.search,`search`,`text`),vendors:e.vendors});c(await u(`Creating`,async()=>n.dataSecurity.posture.createContentExport({...p,account_id:i})),{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 e=>{if(e.dryRun){l({command:`cf data-security posture createFindingExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/export`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({ignored:e.ignored,integration_id:e[`integration-id`],max_affliction_date:d(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(e[`min-affliction-date`],`min-affliction-date`,`text`),search:d(e.search,`search`,`text`),severities:e.severities,vendors:e.vendors}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createFindingExportCsv({...t,account_id:i})),{successLabel:`Created`});return}let p=s({ignored:e.ignored,integration_id:e[`integration-id`],max_affliction_date:d(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(e[`min-affliction-date`],`min-affliction-date`,`text`),search:d(e.search,`search`,`text`),severities:e.severities,vendors:e.vendors});c(await u(`Creating`,async()=>n.dataSecurity.posture.createFindingExportCsv({...p,account_id:i})),{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 e=>{if(e.dryRun){l({command:`cf data-security posture createFindingInstancesExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/${e[`storage-namespace-id`]==null?`<storage-namespace-id>`:encodeURIComponent(String(e[`storage-namespace-id`]))}/instances/export`,pathParams:{"storage-namespace-id":String(e[`storage-namespace-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({archived:e.archived,max_affliction_date:d(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(e[`min-affliction-date`],`min-affliction-date`,`text`),search:d(e.search,`search`,`text`)}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createFindingInstancesExportCsv({...t,account_id:i,storage_namespace_id:e[`storage-namespace-id`]})),{successLabel:`Created`});return}let p=s({archived:e.archived,max_affliction_date:d(e[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:d(e[`min-affliction-date`],`min-affliction-date`,`text`),search:d(e.search,`search`,`text`)});c(await u(`Creating`,async()=>n.dataSecurity.posture.createFindingInstancesExportCsv({...p,account_id:i,storage_namespace_id:e[`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/${t()??`<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 i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.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 e(`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()=>i.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 e=>{if(e.dryRun){l({command:`cf data-security posture createRemediationJobsExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/remediations/jobs/export`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({integration_id:e[`integration-id`],max_updated_at:d(e[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:d(e[`min-updated-at`],`min-updated-at`,`text`),search:d(e.search,`search`,`text`),status:e.status}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createRemediationJobsExportCsv({...t,account_id:i})),{successLabel:`Created`});return}let p=s({integration_id:e[`integration-id`],max_updated_at:d(e[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:d(e[`min-updated-at`],`min-updated-at`,`text`),search:d(e.search,`search`,`text`),status:e.status});c(await u(`Creating`,async()=>n.dataSecurity.posture.createRemediationJobsExportCsv({...p,account_id:i})),{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 i=>{if(i.dryRun){l({command:`cf data-security posture createWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({authentication_type:d(i[`authentication-type`],`authentication-type`,`text`),destination_url:d(i[`destination-url`],`destination-url`,`text`),label:d(i.label,`label`,`text`),signing_secret:d(i[`signing-secret`],`signing-secret`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...e,account_id:m})),{successLabel:`Created`});return}i[`authentication-type`]===void 0&&(i[`authentication-type`]=await n(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),i[`destination-url`]===void 0&&(i[`destination-url`]=await e(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),i.label===void 0&&(i.label=await e(`label`,`Account-specified display label for the webhook configuration.`));let h=s({authentication_type:d(i[`authentication-type`],`authentication-type`,`text`),destination_url:d(i[`destination-url`],`destination-url`,`text`),label:d(i.label,`label`,`text`),signing_secret:d(i[`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 e=>{if(e.dryRun){l({command:`cf data-security posture createWebhookJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/webhooks/jobs`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({finding_instance_ids:e[`finding-instance-ids`],webhook_ids:e[`webhook-ids`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.createWebhookJobs({...t,account_id:i})),{successLabel:`Created`});return}if(e[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);if(e[`webhook-ids`]===void 0)throw Error(`--webhook-ids is required (or pass --body with this field set).`);let d=s({finding_instance_ids:e[`finding-instance-ids`],webhook_ids:e[`webhook-ids`]});c(await u(`Creating`,async()=>n.dataSecurity.posture.createWebhookJobs({...d,account_id:i})),{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 e=>{if(e.dryRun){l({command:`cf data-security posture delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>n.dataSecurity.posture.delete({account_id:o,webhook_id:e[`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 e=>{if(e.dryRun){l({command:`cf data-security posture evaluateExistingWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}/evaluate`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Creating`,async()=>n.dataSecurity.posture.evaluateExistingWebhook({account_id:i,webhook_id:e[`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 i=>{if(i.dryRun){l({command:`cf data-security posture evaluateNewWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/webhooks/evaluate`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({authentication_type:d(i[`authentication-type`],`authentication-type`,`text`),destination_url:d(i[`destination-url`],`destination-url`,`text`),signing_secret:d(i[`signing-secret`],`signing-secret`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.dataSecurity.posture.evaluateNewWebhook({...e,account_id:m})),{successLabel:`Created`});return}i[`authentication-type`]===void 0&&(i[`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`])),i[`destination-url`]===void 0&&(i[`destination-url`]=await e(`destination-url`,`Target URL to send the test webhook event to.`));let h=s({authentication_type:d(i[`authentication-type`],`authentication-type`,`text`),destination_url:d(i[`destination-url`],`destination-url`,`text`),signing_secret:d(i[`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 e=>{if(e.dryRun){l({command:`cf data-security posture getExportJob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/exports/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.dataSecurity.posture.getExportJob({account_id:i,id:e.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 e=>{if(e.dryRun){l({command:`cf data-security posture getFinding`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.dataSecurity.posture.getFinding({account_id:i,finding_id:e[`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 e=>{if(e.dryRun){l({command:`cf data-security posture getFindingInstance`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}`,pathParams:{"finding-id":String(e[`finding-id`]??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.dataSecurity.posture.getFindingInstance({account_id:i,finding_id:e[`finding-id`],instance_id:e[`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 e=>{if(e.dryRun){l({command:`cf data-security posture getFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/finding_types/${e[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(e[`finding-type-id`]))}`,pathParams:{"finding-type-id":String(e[`finding-type-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.dataSecurity.posture.getFindingType({account_id:i,finding_type_id:e[`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 e=>{let n={integration_id:e[`integration-id`],cursor:e.cursor,page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf data-security posture getRemediationTypesForFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/finding_types/${e[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(e[`finding-type-id`]))}/remediation_types`,pathParams:{"finding-type-id":String(e[`finding-type-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.dataSecurity.posture.getRemediationTypesForFindingType({account_id:o,finding_type_id:e[`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 e=>{if(e.dryRun){l({command:`cf data-security posture getWebhookConfigByID`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/webhooks/${e[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(e[`webhook-id`]))}`,pathParams:{"webhook-id":String(e[`webhook-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.dataSecurity.posture.getWebhookConfigById({account_id:i,webhook_id:e[`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 e=>{if(e.dryRun){l({command:`cf data-security posture ignoreFinding`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/ignore`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({checks:e.checks}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.ignoreFinding({body:t,account_id:i})),{successLabel:`Created`});return}if(e.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let d=s({checks:e.checks});c(await u(`Creating`,async()=>n.dataSecurity.posture.ignoreFinding({body:d,account_id:i})),{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 e=>{let n={page:e.page,per_page:e[`per-page`],status:e.status};if(e.dryRun){l({command:`cf data-security posture listExportJobs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/exports`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.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 e=>{let n={archived:e.archived,cursor:e.cursor,direction:e.direction,max_affliction_date:e[`max-affliction-date`],min_affliction_date:e[`min-affliction-date`],order:e.order,page:e.page,per_page:e[`per-page`],search:e.search,remediation_statuses:e[`remediation-statuses`],finding_instance_ids:e[`finding-instance-ids`],asset_ids:e[`asset-ids`]};if(e.dryRun){l({command:`cf data-security posture listFindingInstances`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/instances`,pathParams:{"finding-id":String(e[`finding-id`]??``)},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.dataSecurity.posture.listFindingInstances({account_id:o,finding_id:e[`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 e=>{let n={page:e.page,per_page:e[`per-page`]};if(e.dryRun){l({command:`cf data-security posture listFindingTypes`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/finding_types`,pathParams:{},query:n,bodyKind:`none`});return}let i=await a(e),o=e.local?f:await r(i);e.accountId=o,c(await u(`Loading`,async()=>i.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 e=>{if(e.dryRun){l({command:`cf data-security posture listWebhooks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.dataSecurity.posture.listWebhooks({account_id:i})),{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 e=>{if(e.dryRun){l({command:`cf data-security posture resetFindingSeverity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/reset_finding_severity`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Creating`,async()=>n.dataSecurity.posture.resetFindingSeverity({account_id:i,finding_id:e[`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 e=>{if(e.dryRun){l({command:`cf data-security posture unarchiveFindingInstance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/${e[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(e[`finding-id`]))}/instances/unarchive`,pathParams:{"finding-id":String(e[`finding-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({check_instances:e[`check-instances`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.unarchiveFindingInstance({body:t,account_id:i,finding_id:e[`finding-id`]})),{successLabel:`Created`});return}if(e[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let d=s({check_instances:e[`check-instances`]});c(await u(`Creating`,async()=>n.dataSecurity.posture.unarchiveFindingInstance({body:d,account_id:i,finding_id:e[`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 e=>{if(e.dryRun){l({command:`cf data-security posture unIgnoreFinding`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/findings/unignore`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({checks:e.checks}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.dataSecurity.posture.unIgnoreFinding({body:t,account_id:i})),{successLabel:`Created`});return}if(e.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let d=s({checks:e.checks});c(await u(`Creating`,async()=>n.dataSecurity.posture.unIgnoreFinding({body:d,account_id:i})),{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 i=>{if(i.dryRun){l({command:`cf data-security posture update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/data-security/posture/webhooks/${i[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(i[`webhook-id`]))}`,pathParams:{"webhook-id":String(i[`webhook-id`]??``)},bodyKind:`json`,body:i.body===void 0?s({authentication_type:d(i[`authentication-type`],`authentication-type`,`text`),destination_url:d(i[`destination-url`],`destination-url`,`text`),label:d(i.label,`label`,`text`),signing_secret:d(i[`signing-secret`],`signing-secret`,`text`),status:d(i.status,`status`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Updating`,async()=>p.dataSecurity.posture.update({...e,account_id:m,webhook_id:i[`webhook-id`]})),{successLabel:`Updated`});return}i[`authentication-type`]===void 0&&(i[`authentication-type`]=await n(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),i[`destination-url`]===void 0&&(i[`destination-url`]=await e(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),i.label===void 0&&(i.label=await e(`label`,`Account-specified display label for the webhook configuration.`)),i.status===void 0&&(i.status=await n(`status`,`Status of the webhook configuration.`,[`enabled`,`disabled`]));let h=s({authentication_type:d(i[`authentication-type`],`authentication-type`,`text`),destination_url:d(i[`destination-url`],`destination-url`,`text`),label:d(i.label,`label`,`text`),signing_secret:d(i[`signing-secret`],`signing-secret`,`text`),status:d(i.status,`status`,`text`)});c(await u(`Updating`,async()=>p.dataSecurity.posture.update({...h,account_id:m,webhook_id:i[`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,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.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 i=>{if(i.dryRun){l({command:`cf diagnostics endpoint-healthchecks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({check_type:d(i[`check-type`],`check-type`,`text`),endpoint:d(i.endpoint,`endpoint`,`text`),name:d(i.name,`name`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.diagnostics.endpointHealthchecks.create({body:e,account_id:m})),{successLabel:`Created`});return}i[`check-type`]===void 0&&(i[`check-type`]=await n(`check-type`,`type of check to perform`,[`icmp`])),i.endpoint===void 0&&(i.endpoint=await e(`endpoint`,`the IP address of the host to perform checks against`));let h=s({check_type:d(i[`check-type`],`check-type`,`text`),endpoint:d(i.endpoint,`endpoint`,`text`),name:d(i.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 e=>{if(e.dryRun){l({command:`cf diagnostics endpoint-healthchecks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/diagnostics/endpoint-healthchecks/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>n.diagnostics.endpointHealthchecks.delete({account_id:o,id:e.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 e=>{if(e.dryRun){l({command:`cf diagnostics endpoint-healthchecks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/diagnostics/endpoint-healthchecks/${e.id==null?`<id>`:encodeURIComponent(String(e.id))}`,pathParams:{id:String(e.id??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.diagnostics.endpointHealthchecks.get({account_id:i,id:e.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 e=>{if(e.dryRun){l({command:`cf diagnostics endpoint-healthchecks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/diagnostics/endpoint-healthchecks`,pathParams:{},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.diagnostics.endpointHealthchecks.list({account_id:i})),{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 i=>{if(i.dryRun){l({command:`cf diagnostics endpoint-healthchecks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/diagnostics/endpoint-healthchecks/${i.id==null?`<id>`:encodeURIComponent(String(i.id))}`,pathParams:{id:String(i.id??``)},bodyKind:`json`,body:i.body===void 0?s({check_type:d(i[`check-type`],`check-type`,`text`),endpoint:d(i.endpoint,`endpoint`,`text`),name:d(i.name,`name`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Updating`,async()=>p.diagnostics.endpointHealthchecks.update({body:e,account_id:m,id:i.id})),{successLabel:`Updated`});return}i[`check-type`]===void 0&&(i[`check-type`]=await n(`check-type`,`type of check to perform`,[`icmp`])),i.endpoint===void 0&&(i.endpoint=await e(`endpoint`,`the IP address of the host to perform checks against`));let h=s({check_type:d(i[`check-type`],`check-type`,`text`),endpoint:d(i.endpoint,`endpoint`,`text`),name:d(i.name,`name`,`text`)});c(await u(`Updating`,async()=>p.diagnostics.endpointHealthchecks.update({body:h,account_id:m,id:i.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 e=>{if(e.dryRun){l({command:`cf diagnostics traceroutes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/diagnostics/traceroute`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({colos:e.colos,options:{max_ttl:e[`options-max-ttl`],packet_type:d(e[`options-packet-type`],`options-packet-type`,`text`),packets_per_ttl:e[`options-packets-per-ttl`],port:e[`options-port`],wait_time:e[`options-wait-time`]},targets:e.targets}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>n.diagnostics.traceroutes.create({...t,account_id:i})),{successLabel:`Created`});return}if(e.targets===void 0)throw Error(`--targets is required (or pass --body with this field set).`);let p=s({colos:e.colos,options:{max_ttl:e[`options-max-ttl`],packet_type:d(e[`options-packet-type`],`options-packet-type`,`text`),packets_per_ttl:e[`options-packets-per-ttl`],port:e[`options-port`],wait_time:e[`options-wait-time`]},targets:e.targets});c(await u(`Creating`,async()=>n.diagnostics.traceroutes.create({...p,account_id:i})),{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,7 +0,0 @@
1
- #!/usr/bin/env node
2
- import{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{i as a,n as o}from"./auth-CSC4yhEJ.mjs";import{n as s,t as c}from"./body-parser-DWSy7uZ8.mjs";import{t as l}from"./output-B6fBFRqe.mjs";import{n as u,t as d}from"./progress-DrDErV9w.mjs";import{n as f,t as p}from"./input-validation-_fMCApaH.mjs";import{t as m}from"./local-CYc9q7l2.mjs";function h(e){return e.option(`name`,{type:`string`,description:`The name of the dispatch namespace.`}).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 ee={command:`create`,describe:`Create a new Workers for Platforms namespace.`,builder:h,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`)}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.dispatchNamespaces.create({...t,account_id:i})),{successLabel:`Created`});return}let a=c({name:f(e.name,`name`,`text`)});l(await d(`Creating`,async()=>n.dispatchNamespaces.create({...a,account_id:i})),{successLabel:`Created`})}};function g(e){return e.positional(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,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 <dispatch-namespace>`,describe:`Delete a Workers for Platforms namespace.`,builder:g,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``)},bodyKind:`none`});return}let n=await o(e),a=e.local?m:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}l(await d(`Deleting`,async()=>n.dispatchNamespaces.delete({account_id:a,dispatch_namespace:e[`dispatch-namespace`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the dispatch namespace.`}).option(`trusted-workers`,{type:`boolean`,description:'Whether the Workers in the namespace are executed in a "trusted" manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the `request.cf` object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and `request.cf` is undefined. By default, Workers in a namespace are "untrusted".'}).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:`edit <dispatch-namespace>`,describe:`Patch a Workers for Platforms namespace. Omitted fields are left unchanged.`,builder:v,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`),trusted_workers:e[`trusted-workers`]}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>n.dispatchNamespaces.edit({...t,account_id:i,dispatch_namespace:e[`dispatch-namespace`]})),{successLabel:`Updated`});return}let a=c({name:f(e.name,`name`,`text`),trusted_workers:e[`trusted-workers`]});l(await d(`Updating`,async()=>n.dispatchNamespaces.edit({...a,account_id:i,dispatch_namespace:e[`dispatch-namespace`]})),{successLabel:`Updated`})}};function b(e){return e.positional(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <dispatch-namespace>`,describe:`Get a Workers for Platforms namespace.`,builder:b,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.dispatchNamespaces.get({account_id:i,dispatch_namespace:e[`dispatch-namespace`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Fetch a list of Workers for Platforms namespaces.`,builder:S,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces`,pathParams:{},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.dispatchNamespaces.list({account_id:i})),{successLabel:`Loaded`})}};function w(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,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 T={command:`create <script-name>`,describe:`Start uploading a collection of assets for use in a Worker version. To learn more about the direct uploads of assets, see https://developers.cloudflare.com/workers/static-assets/direct-upload/.`,builder:w,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts asset-upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/assets-upload-session`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>n.dispatchNamespaces.scripts.assetUpload.create({body:t,account_id:i,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},E={command:`asset-upload`,describe:`Operations for scripts.asset-upload`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <script-name>`,describe:`Fetch script bindings from a script uploaded to a Workers for Platforms namespace.`,builder:D,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts bindings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/bindings`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.dispatchNamespaces.scripts.bindings.get({account_id:i,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]})),{successLabel:`Loaded`})}},k={command:`bindings`,describe:`Operations for scripts.bindings`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`tags`,{type:`string`,description:`Filter scripts by tags before deletion. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'.`}).option(`limit`,{type:`number`,description:`Limit the number of scripts to delete.`}).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 j={command:`bulk-delete`,describe:`Delete multiple scripts from a Workers for Platforms namespace based on optional tag filters.`,builder:A,handler:async e=>{let n={tags:e.tags,limit:e.limit};if(e.dryRun){u({command:`cf dispatch-namespaces scripts bulk-delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``)},query:n,bodyKind:`none`});return}let a=await o(e),s=e.local?m:await r(a);if(e.accountId=s,!await i({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}l(await d(`Deleting`,async()=>a.dispatchNamespaces.scripts.bulkDelete({account_id:s,dispatch_namespace:e[`dispatch-namespace`],...n})),{successLabel:`Deleted`})}};function M(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`get <script-name>`,describe:`Fetch script content from a script uploaded to a Workers for Platforms namespace.`,builder:M,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/content`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.dispatchNamespaces.scripts.content.get({account_id:i,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]})),{successLabel:`Loaded`})}};function P(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`cf-worker-body-part`,{type:`string`,description:`The multipart name of a script upload part containing script content in service worker format. Alternative to including in a metadata part.`}).option(`cf-worker-main-module-part`,{type:`string`,description:`The multipart name of a script upload part containing script content in es module format. Alternative to including in a metadata part.`}).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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.<br/>Possible Content-Type(s) are: `application/javascript+module`, `text/javascript+module`, `application/javascript`, `text/javascript`, `text/x-python`, `text/x-python-requirement`, `application/wasm`, `text/plain`, `application/octet-stream`, `application/source-map`."}).option(`metadata`,{type:`string`,description:`JSON-encoded metadata about the uploaded parts and Worker configuration.`})}const F={command:`update <script-name>`,describe:`Put script content for a script uploaded to a Workers for Platforms namespace.`,builder:P,handler:async e=>{let n={};if(e[`cf-worker-body-part`]!==void 0&&(n[`CF-WORKER-BODY-PART`]=String(e[`cf-worker-body-part`])),e[`cf-worker-main-module-part`]!==void 0&&(n[`CF-WORKER-MAIN-MODULE-PART`]=String(e[`cf-worker-main-module-part`])),e.dryRun){u({command:`cf dispatch-namespaces scripts content update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/content`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,files:e.files,metadata:e.metadata}});return}let i=await o(e),s=e.local?m:await r(i);if(e.accountId=s,e.file!==void 0||e.body!==void 0||e.files!==void 0||e.metadata!==void 0){let t=new FormData;if(e.file){let n=p(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);if(e.files!==void 0){let n=typeof e.files==`string`?f(e.files,`files`,`text`):e.files;t.append(`files`,typeof n==`string`?n:JSON.stringify(n))}if(e.metadata!==void 0){let n=typeof e.metadata==`string`?f(e.metadata,`metadata`,`text`):e.metadata;t.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}l(await d(`Updating`,async()=>a(i,`PUT`,`/accounts/${s}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}/content`,{body:t,headers:Object.keys(n).length>0?n:void 0})),{successLabel:`Updated`});return}if(e.body){let t=f(e.body,`body`,`binary`);l(await d(`Updating`,async()=>a(i,`PUT`,`/accounts/${s}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}/content`,{body:t,headers:{"Content-Type":`multipart/form-data`,...n}})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},I={command:`content`,describe:`Operations for scripts.content`,builder:e=>e.command(N).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`force`,{type:`boolean`,description:`If set to true, delete will not be stopped by associated service binding, durable object, or other binding. Any of these associated bindings/durable objects will be deleted along with the script.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`delete <script-name>`,describe:`Delete a worker from a Workers for Platforms namespace. This call has no response body on a successful delete.`,builder:L,handler:async e=>{let n={force:e.force};if(e.dryRun){u({command:`cf dispatch-namespaces scripts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},query:n,bodyKind:`none`});return}let a=await o(e),s=e.local?m:await r(a);if(e.accountId=s,!await i({force:!!e.force})){process.stderr.write(`Aborted.
5
- `);return}l(await d(`Deleting`,async()=>a.dispatchNamespaces.scripts.delete({account_id:s,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`],...n})),{successLabel:`Deleted`})}};function z(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get <script-name>`,describe:`Fetch information about a script uploaded to a Workers for Platforms namespace.`,builder:z,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.dispatchNamespaces.scripts.get({account_id:i,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]})),{successLabel:`Loaded`})}};function V(e){return e.option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`tags`,{type:`string`,description:`Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:`Fetch a list of scripts uploaded to a Workers for Platforms namespace.`,builder:V,handler:async e=>{let n={tags:e.tags};if(e.dryRun){u({command:`cf dispatch-namespaces scripts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``)},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.dispatchNamespaces.scripts.list({account_id:a,dispatch_namespace:e[`dispatch-namespace`],...n})),{successLabel:`Loaded`})}};function U(e){return e.positional(`secret-name`,{type:`string`,description:`A JavaScript variable name for the secret binding.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`url-encoded`,{type:`boolean`,description:`Flag that indicates whether the secret name is URL encoded.`}).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 te={command:`delete <secret-name>`,describe:`Remove a secret from a script uploaded to a Workers for Platforms namespace.`,builder:U,handler:async e=>{let n={url_encoded:e[`url-encoded`]};if(e.dryRun){u({command:`cf dispatch-namespaces scripts secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/secrets/${e[`secret-name`]==null?`<secret-name>`:encodeURIComponent(String(e[`secret-name`]))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``),"secret-name":String(e[`secret-name`]??``)},query:n,bodyKind:`none`});return}let a=await o(e),s=e.local?m:await r(a);if(e.accountId=s,!await i({force:!!e.force})){process.stderr.write(`Aborted.
6
- `);return}l(await d(`Deleting`,async()=>a.dispatchNamespaces.scripts.secrets.delete({account_id:s,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`],secret_name:e[`secret-name`],...n})),{successLabel:`Deleted`})}};function W(e){return e.positional(`secret-name`,{type:`string`,description:`A JavaScript variable name for the secret binding.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`url-encoded`,{type:`boolean`,description:`Flag that indicates whether the secret name is URL encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <secret-name>`,describe:`Get a given secret binding (value omitted) on a script uploaded to a Workers for Platforms namespace.`,builder:W,handler:async e=>{let n={url_encoded:e[`url-encoded`]};if(e.dryRun){u({command:`cf dispatch-namespaces scripts secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/secrets/${e[`secret-name`]==null?`<secret-name>`:encodeURIComponent(String(e[`secret-name`]))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``),"secret-name":String(e[`secret-name`]??``)},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,l(await d(`Loading`,async()=>i.dispatchNamespaces.scripts.secrets.get({account_id:a,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`],secret_name:e[`secret-name`],...n})),{successLabel:`Loaded`})}};function K(e){return e.option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`list`,describe:`List secrets bound to a script uploaded to a Workers for Platforms namespace.`,builder:K,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/secrets`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.dispatchNamespaces.scripts.secrets.list({account_id:i,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]})),{successLabel:`Loaded`})}};function J(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`name`,{type:`string`,description:`A JavaScript variable name for the binding.`}).option(`text`,{type:`string`,description:`The secret value to use.`}).option(`type`,{type:`string`,description:`The kind of resource that the binding provides.`,choices:[`secret_text`,`secret_key`],default:`secret_text`}).option(`format`,{type:`string`,description:`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,choices:[`raw`,`pkcs8`,`spki`,`jwk`]}).option(`key-base64`,{type:`string`,description:'Base64-encoded key data. Required if `format` is "raw", "pkcs8", or "spki".'}).option(`usages`,{type:`string`,array:!0,description:`Allowed operations with the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A secret value accessible through a binding.`}).conflicts(`text`,[`format`,`key-base64`,`usages`]).conflicts(`format`,[`text`]).implies(`format`,[`usages`]).conflicts(`key-base64`,[`text`]).conflicts(`usages`,[`text`]).implies(`usages`,[`format`])}const Y={command:`update <script-name>`,describe:`Add a secret to a script uploaded to a Workers for Platforms namespace.`,builder:J,handler:async i=>{if(i.dryRun){u({command:`cf dispatch-namespaces scripts secrets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${i[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(i[`dispatch-namespace`]))}/scripts/${i[`script-name`]==null?`<script-name>`:encodeURIComponent(String(i[`script-name`]))}/secrets`,pathParams:{"dispatch-namespace":String(i[`dispatch-namespace`]??``),"script-name":String(i[`script-name`]??``)},bodyKind:`json`,body:i.body===void 0?c({name:f(i.name,`name`,`text`),text:f(i.text,`text`,`text`),type:f(i.type,`type`,`text`),format:f(i.format,`format`,`text`),key_base64:f(i[`key-base64`],`key-base64`,`text`),usages:i.usages}):s(i.body)});return}let a=await o(i),p=i.local?m:await r(a);if(i.accountId=p,i.body){let e=s(i.body);l(await d(`Updating`,async()=>a.dispatchNamespaces.scripts.secrets.update({body:e,account_id:p,dispatch_namespace:i[`dispatch-namespace`],script_name:i[`script-name`]})),{successLabel:`Updated`});return}i.name===void 0&&(i.name=await e(`name`,`A JavaScript variable name for the binding.`)),i.type===void 0&&(i.type=await n(`type`,`The kind of resource that the binding provides.`,[`secret_text`,`secret_key`])),i.type===`secret_text`&&i.text===void 0&&(i.text=await e(`text`,`The secret value to use.`,{kind:`secret`,question:`Enter value for --text`})),i.type===`secret_key`&&i.format===void 0&&(i.format=await e(`format`,`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,{question:`Enter value for --format`}));let h=c({name:f(i.name,`name`,`text`),text:f(i.text,`text`,`text`),type:f(i.type,`type`,`text`),format:f(i.format,`format`,`text`),key_base64:f(i[`key-base64`],`key-base64`,`text`),usages:i.usages});l(await d(`Updating`,async()=>a.dispatchNamespaces.scripts.secrets.update({body:h,account_id:p,dispatch_namespace:i[`dispatch-namespace`],script_name:i[`script-name`]})),{successLabel:`Updated`})}},X={command:`secrets`,describe:`Operations for scripts.secrets`,builder:e=>e.command(te).command(G).command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`settings`,{type:`string`,description:`Script and version settings for Workers for Platforms namespace scripts. Same as script-and-version-settings-item but without annotations, which are not supported for namespace scripts. `})}const Q={command:`edit <script-name>`,describe:`Patch script metadata, such as bindings.`,builder:Z,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/settings`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,settings:e.settings}});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.file!==void 0||e.body!==void 0||e.settings!==void 0){let t=new FormData;if(e.file){let n=p(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);if(e.settings!==void 0){let n=typeof e.settings==`string`?f(e.settings,`settings`,`text`):e.settings;t.append(`settings`,typeof n==`string`?n:JSON.stringify(n))}l(await d(`Updating`,async()=>a(n,`PATCH`,`/accounts/${i}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}/settings`,{body:t})),{successLabel:`Updated`});return}if(e.body){let t=f(e.body,`body`,`binary`);l(await d(`Updating`,async()=>a(n,`PATCH`,`/accounts/${i}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}/settings`,{body:t,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}l(await d(`Updating`,async()=>n.dispatchNamespaces.scripts.settings.edit({account_id:i,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]})),{successLabel:`Updated`})}};function ne(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <script-name>`,describe:`Get script settings from a script uploaded to a Workers for Platforms namespace.`,builder:ne,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/settings`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.dispatchNamespaces.scripts.settings.get({account_id:i,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]})),{successLabel:`Loaded`})}},ie={command:`settings`,describe:`Operations for scripts.settings`,builder:e=>e.command(Q).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`tag`,{type:`string`,description:`Tag`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`create <tag>`,describe:`Put a single tag on a script uploaded to a Workers for Platforms namespace.`,builder:ae,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts tags create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/tags/${e.tag==null?`<tag>`:encodeURIComponent(String(e.tag))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``),tag:String(e.tag??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,l(await d(`Updating`,async()=>n.dispatchNamespaces.scripts.tags.create({account_id:i,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`],tag:e.tag})),{successLabel:`Updated`})}};function se(e){return e.positional(`tag`,{type:`string`,description:`Tag`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route 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 ce={command:`delete <tag>`,describe:`Delete script tag for a script uploaded to a Workers for Platforms namespace.`,builder:se,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/tags/${e.tag==null?`<tag>`:encodeURIComponent(String(e.tag))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``),tag:String(e.tag??``)},bodyKind:`none`});return}let n=await o(e),a=e.local?m:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
7
- `);return}l(await d(`Deleting`,async()=>n.dispatchNamespaces.scripts.tags.delete({account_id:a,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`],tag:e.tag})),{successLabel:`Deleted`})}};function le(e){return e.option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`list`,describe:`Fetch tags from a script uploaded to a Workers for Platforms namespace.`,builder:le,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts tags list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/tags`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,l(await d(`Loading`,async()=>n.dispatchNamespaces.scripts.tags.list({account_id:i,dispatch_namespace:e[`dispatch-namespace`],script_name:e[`script-name`]})),{successLabel:`Loaded`})}};function de(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Tags associated with the Worker.`})}const fe={command:`update <script-name>`,describe:`Put script tags for a script uploaded to a Workers for Platforms namespace.`,builder:de,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces scripts tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}/tags`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);if(Array.isArray(t)&&t.length>10){let r=Math.ceil(t.length/10),o=null;for(let s=0;s<t.length;s+=10){let c=t.slice(s,s+10);o=await d(`Updating: batch ${Math.floor(s/10)+1}/${r}`,async()=>a(n,`PUT`,`/accounts/${i}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}/tags`,{body:c}))}l(o,{successLabel:`Updated`});return}l(await d(`Updating`,async()=>a(n,`PUT`,`/accounts/${i}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}/tags`,{body:t})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},pe={command:`tags`,describe:`Operations for scripts.tags`,builder:e=>e.command(oe).command(ce).command(ue).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.positional(`script-name`,{type:`string`,description:`Name of the script, used in URLs and route configuration.`,demandOption:!0}).option(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`bindings-inherit`,{type:`string`,description:'When set to "strict", the upload will fail if any `inherit` type bindings cannot be resolved against the previous version of the script. Without this, unresolvable inherit bindings are silently dropped.',choices:[`strict`]}).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)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.<br/>Possible Content-Type(s) are: `application/javascript+module`, `text/javascript+module`, `application/javascript`, `text/javascript`, `text/x-python`, `text/x-python-requirement`, `application/wasm`, `text/plain`, `application/octet-stream`, `application/source-map`."}).option(`metadata`,{type:`string`,description:`JSON-encoded metadata about the uploaded parts and Worker configuration.`})}const me={command:`update <script-name>`,describe:`Upload a worker module to a Workers for Platforms namespace. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.`,builder:$,handler:async e=>{let n={bindings_inherit:e[`bindings-inherit`]};if(e.dryRun){u({command:`cf dispatch-namespaces scripts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${e[`script-name`]==null?`<script-name>`:encodeURIComponent(String(e[`script-name`]))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``),"script-name":String(e[`script-name`]??``)},query:n,bodyKind:`multipart`,body:{body:e.body,file:e.file,files:e.files,metadata:e.metadata}});return}let i=await o(e),s=e.local?m:await r(i);if(e.accountId=s,e.file!==void 0||e.body!==void 0||e.files!==void 0||e.metadata!==void 0){let t=new FormData;if(e.file){let n=p(e.file);t.append(`file`,new Blob([n]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&t.append(`file`,e.body);if(e.files!==void 0){let n=typeof e.files==`string`?f(e.files,`files`,`text`):e.files;t.append(`files`,typeof n==`string`?n:JSON.stringify(n))}if(e.metadata!==void 0){let n=typeof e.metadata==`string`?f(e.metadata,`metadata`,`text`):e.metadata;t.append(`metadata`,typeof n==`string`?n:JSON.stringify(n))}l(await d(`Updating`,async()=>a(i,`PUT`,`/accounts/${s}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}`,{body:t})),{successLabel:`Updated`});return}if(e.body){let t=f(e.body,`body`,`binary`),r=new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();l(await d(`Updating`,async()=>a(i,`PUT`,`/accounts/${s}/workers/dispatch/namespaces/${encodeURIComponent(String(e[`dispatch-namespace`]))}/scripts/${encodeURIComponent(String(e[`script-name`]))}${r?`?`+r:``}`,{body:t,headers:{"Content-Type":`application/javascript`}})),{successLabel:`Updated`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},he={command:`scripts`,describe:`Operations for scripts`,builder:e=>e.command(j).command(R).command(B).command(H).command(me).command(E).command(k).command(I).command(X).command(ie).command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.positional(`dispatch-namespace`,{type:`string`,description:`Name of the Workers for Platforms dispatch namespace.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the dispatch namespace.`}).option(`trusted-workers`,{type:`boolean`,description:'Whether the Workers in the namespace are executed in a "trusted" manner. When a Worker is trusted, it has access to the shared caches for the zone in the Cache API, and has access to the `request.cf` object on incoming Requests. When a Worker is untrusted, caches are not shared across the zone, and `request.cf` is undefined. By default, Workers in a namespace are "untrusted".'}).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 _e={command:`update <dispatch-namespace>`,describe:`Update a Workers for Platforms namespace.`,builder:ge,handler:async e=>{if(e.dryRun){u({command:`cf dispatch-namespaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/dispatch/namespaces/${e[`dispatch-namespace`]==null?`<dispatch-namespace>`:encodeURIComponent(String(e[`dispatch-namespace`]))}`,pathParams:{"dispatch-namespace":String(e[`dispatch-namespace`]??``)},bodyKind:`json`,body:e.body===void 0?c({name:f(e.name,`name`,`text`),trusted_workers:e[`trusted-workers`]}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>n.dispatchNamespaces.update({...t,account_id:i,dispatch_namespace:e[`dispatch-namespace`]})),{successLabel:`Updated`});return}let a=c({name:f(e.name,`name`,`text`),trusted_workers:e[`trusted-workers`]});l(await d(`Updating`,async()=>n.dispatchNamespaces.update({...a,account_id:i,dispatch_namespace:e[`dispatch-namespace`]})),{successLabel:`Updated`})}},ve={command:`dispatch-namespaces`,describe:`Workers for Platforms dispatch namespaces — isolate customer Workers for SaaS and multi-tenant deployments`,builder:e=>e.command(ee).command(_).command(y).command(x).command(C).command(_e).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ve as default};