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{w as e,x as t}from"./oauth-Bk-F-tIO.mjs";import{n}from"./auth-CSC4yhEJ.mjs";import{n as r}from"./body-parser-DWSy7uZ8.mjs";import{t as i}from"./output-B6fBFRqe.mjs";import{n as a,t as o}from"./progress-DrDErV9w.mjs";function s(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 c={command:`delete`,describe:`Disables all Managed Transforms.`,builder:s,handler:async r=>{if(r.dryRun){a({command:`cf managed-transforms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${r.zone??r.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(r.zone??r[`zone-id`]??``)},bodyKind:`none`});return}let s=await n(r),c=await t({zone:r.zone},s,{quiet:r.quiet});if(r.zoneId=c,!await e({force:!!r.force})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>s.managedTransforms.delete({zone_id:c})),{successLabel:`Deleted`})}};function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A Managed Transforms patch object. Both fields are optional; only the sections provided will be updated.`})}const u={command:`edit`,describe:`Updates the status of one or more Managed Transforms.`,builder:l,handler:async e=>{if(e.dryRun){a({command:`cf managed-transforms edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:r(e.body)});return}let s=await n(e),c=await t({zone:e.zone},s,{quiet:e.quiet});if(e.zoneId=c,e.body){let t=r(e.body);i(await o(`Updating`,async()=>s.managedTransforms.edit({...t,zone_id:c})),{successLabel:`Updated`});return}i(await o(`Updating`,async()=>s.managedTransforms.edit({zone_id:c})),{successLabel:`Updated`})}};function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Fetches a list of all Managed Transforms.`,builder:d,handler:async e=>{if(e.dryRun){a({command:`cf managed-transforms list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),s=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=s,i(await o(`Loading`,async()=>r.managedTransforms.list({zone_id:s})),{successLabel:`Loaded`})}},p={command:`managed-transforms`,describe:`Cloudflare-managed HTTP header transforms — automatically add security headers, remove server info, etc.`,builder:e=>e.command(c).command(u).command(f).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";import{t as f}from"./cli-types-BeyOc81z.mjs";function p(e){return e.positional(`mtls-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 m={command:`get <mtls-certificate-id>`,describe:`Lists all active associations between the certificate and Cloudflare services.`,builder:p,handler:async e=>{if(e.dryRun){c({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates/${e[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(e[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(e[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.mtlsCertificates.associations.get({account_id:a,mtls_certificate_id:e[`mtls-certificate-id`]})),{successLabel:`Loaded`})}},h={command:`associations`,describe:`Operations for associations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`ca`,{type:`boolean`,description:`Indicates whether the certificate is a CA or leaf certificate.`}).option(`certificates`,{type:`string`,description:`The uploaded root CA certificate.`}).option(`name`,{type:`string`,description:`Optional unique name for the certificate. Only used for human readability.`}).option(`private-key`,{type:`string`,description:`The private key for the certificate. This field is only needed for specific use cases such as using a custom certificate with Zero Trust's block 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:`create`,describe:`Upload a certificate that you want to use with mTLS-enabled Cloudflare services, such as Bring Your Own CA (BYO-CA) for mTLS. To create certificates issued by the Cloudflare managed CA, use the [Create Client Certificate endpoint](/api/resources/client_certificates/methods/create/).`,builder:g,handler:async r=>{if(r.dryRun){c({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({ca:r.ca,certificates:u(r.certificates,`certificates`,`text`),name:u(r.name,`name`,`text`),private_key:u(r[`private-key`],`private-key`,`text`)}):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.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(r.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);r.certificates===void 0&&(r.certificates=await e(`certificates`,`The uploaded root CA certificate.`));let m=o({ca:r.ca,certificates:u(r.certificates,`certificates`,`text`),name:u(r.name,`name`,`text`),private_key:u(r[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>f.mtlsCertificates.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`mtls-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 y={command:`delete <mtls-certificate-id>`,describe:`Deletes the mTLS certificate unless the certificate is in use by one or more Cloudflare services.`,builder:v,handler:async e=>{if(e.dryRun){c({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates/${e[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(e[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(e[`mtls-certificate-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.mtlsCertificates.delete({account_id:o,mtls_certificate_id:e[`mtls-certificate-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`mtls-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 x={command:`get <mtls-certificate-id>`,describe:`Fetches a single mTLS certificate uploaded to your account. To get a certificate issued by the Cloudflare managed CA, use the [Client Certificate Details endpoint](/api/resources/client_certificates/methods/get/).`,builder:b,handler:async e=>{if(e.dryRun){c({command:`cf mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates/${e[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(e[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(e[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.mtlsCertificates.get({account_id:a,mtls_certificate_id:e[`mtls-certificate-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`type`,{type:`string`,description:`Filters results by certificate type. Multiple types can be comma-separated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Lists all mTLS certificates uploaded to your account, such as Bring Your Own CA (BYO-CA) for mTLS. To list certificates issued by the Cloudflare managed CA, use the [List Client Certificates endpoint](/api/resources/client_certificates/methods/list/).`,builder:f(S),handler:async e=>{let r={type:e.type};if(e.dryRun){c({command:`cf mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mtls_certificates`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.mtlsCertificates.list({account_id:o,...r})),{successLabel:`Loaded`})}},w={command:`mtls-certificates`,describe:`Upload and manage mTLS certificates used by API Shield, Workers, and Gateway for client authentication`,builder:e=>e.command(_).command(y).command(x).command(C).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -1,36 +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(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
3
-
4
- Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
5
- key is not treated as a secret value. This is *only* supported for preventing
6
- misconfiguration, not for defending against malicious attacks.
7
-
8
- The MD5 key, if set, must be of non-zero length and consist only of the following types of
9
- character:
10
-
11
- * ASCII alphanumerics: \`[a-zA-Z0-9]\`
12
- * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
13
-
14
- In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
15
- quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
16
- (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
17
- these disallowed characters will be rejected.`}).option(`interconnect`,{type:`string`,description:`The interconnect field`}).option(`magic-conduit-name`,{type:`string`,description:`The magic.conduit_name field`}).option(`magic-description`,{type:`string`,description:`The magic.description field`}).option(`magic-mtu`,{type:`number`,description:`The magic.mtu 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)`}).check(e=>{if([`bgp-customer-asn`,`bgp-extra-prefixes`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`,`bgp-extra-prefixes`].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 --bgp-* flag is set`)}return!0})}const p={command:`create`,describe:`Create a new CNI object`,builder:f,handler:async r=>{if(r.dryRun){c({command:`cf network-interconnects cnis create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({account:u(r.account,`account`,`text`),bgp:{customer_asn:r[`bgp-customer-asn`],extra_prefixes:r[`bgp-extra-prefixes`],md5_key:u(r[`bgp-md5-key`],`bgp-md5-key`,`text`)},interconnect:u(r.interconnect,`interconnect`,`text`),magic:{conduit_name:u(r[`magic-conduit-name`],`magic-conduit-name`,`text`),description:u(r[`magic-description`],`magic-description`,`text`),mtu:r[`magic-mtu`]}}):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.networkInterconnects.cnis.create({...e,account_id:p})),{successLabel:`Created`});return}if(r.account===void 0&&(r.account=await e(`account`,`Customer account tag`)),r.interconnect===void 0&&(r.interconnect=await e(`interconnect`,`The interconnect field`)),r[`magic-conduit-name`]===void 0&&(r[`magic-conduit-name`]=await e(`magic-conduit-name`,`The magic.conduit_name field`)),r[`magic-description`]===void 0&&(r[`magic-description`]=await e(`magic-description`,`The magic.description field`)),r[`magic-mtu`]===void 0)throw Error(`--magic-mtu is required (or pass --body with this field set).`);let m=o({account:u(r.account,`account`,`text`),bgp:{customer_asn:r[`bgp-customer-asn`],extra_prefixes:r[`bgp-extra-prefixes`],md5_key:u(r[`bgp-md5-key`],`bgp-md5-key`,`text`)},interconnect:u(r.interconnect,`interconnect`,`text`),magic:{conduit_name:u(r[`magic-conduit-name`],`magic-conduit-name`,`text`),description:u(r[`magic-description`],`magic-description`,`text`),mtu:r[`magic-mtu`]}});s(await l(`Creating`,async()=>f.networkInterconnects.cnis.create({...m,account_id:p})),{successLabel:`Created`})}};function m(e){return e.positional(`cni`,{type:`string`,description:`CNI ID to retrieve information about`,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 <cni>`,describe:`Delete a specified CNI object`,builder:m,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects cnis delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis/${e.cni==null?`<cni>`:encodeURIComponent(String(e.cni))}`,pathParams:{cni:String(e.cni??``)},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.
18
- `);return}s(await l(`Deleting`,async()=>a.networkInterconnects.cnis.delete({account_id:o,cni:e.cni})),{successLabel:`Deleted`})}};function g(e){return e.positional(`cni`,{type:`string`,description:`CNI ID to retrieve information about`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <cni>`,describe:`Get information about a CNI object`,builder:g,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects cnis get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis/${e.cni==null?`<cni>`:encodeURIComponent(String(e.cni))}`,pathParams:{cni:String(e.cni??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.cnis.get({account_id:a,cni:e.cni})),{successLabel:`Loaded`})}};function v(e){return e.option(`slot`,{type:`string`,description:`If specified, only show CNIs associated with the specified slot`}).option(`tunnel-id`,{type:`string`,description:`If specified, only show cnis associated with the specified tunnel id`}).option(`cursor`,{type:`number`,description:`Cursor`}).option(`limit`,{type:`number`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List existing CNI objects`,builder:v,handler:async e=>{let r={slot:e.slot,tunnel_id:e[`tunnel-id`],cursor:e.cursor,limit:e.limit};if(e.dryRun){c({command:`cf network-interconnects cnis list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.networkInterconnects.cnis.list({account_id:o,...r})),{successLabel:`Loaded`})}};function b(e){return e.positional(`cni`,{type:`string`,description:`CNI ID to retrieve information about`,demandOption:!0}).option(`account`,{type:`string`,description:`Customer account tag`}).option(`bgp-customer-asn`,{type:`number`,description:`ASN used on the customer end of the BGP session`}).option(`bgp-extra-prefixes`,{type:`string`,array:!0,description:`Extra set of static prefixes to advertise to the customer's end of the session`}).option(`bgp-md5-key`,{type:`string`,description:`MD5 key to use for session authentication.
19
-
20
- Note that *this is not a security measure*. MD5 is not a valid security mechanism, and the
21
- key is not treated as a secret value. This is *only* supported for preventing
22
- misconfiguration, not for defending against malicious attacks.
23
-
24
- The MD5 key, if set, must be of non-zero length and consist only of the following types of
25
- character:
26
-
27
- * ASCII alphanumerics: \`[a-zA-Z0-9]\`
28
- * Special characters in the set \`'!@#$%^&*()+[]{}<>/.,;:_-~\`= \\|\`
29
-
30
- In other words, MD5 keys may contain any printable ASCII character aside from newline (0x0A),
31
- quotation mark (\`"\`), vertical tab (0x0B), carriage return (0x0D), tab (0x09), form feed
32
- (0x0C), and the question mark (\`?\`). Requests specifying an MD5 key with one or more of
33
- these disallowed characters will be rejected.`}).option(`cust-ip`,{type:`string`,description:`Customer end of the point-to-point link
34
-
35
- This should always be inside the same prefix as \`p2p_ip\`.`}).option(`id`,{type:`string`,description:`The id field`}).option(`interconnect`,{type:`string`,description:`Interconnect identifier hosting this CNI`}).option(`magic-conduit-name`,{type:`string`,description:`The magic.conduit_name field`}).option(`magic-description`,{type:`string`,description:`The magic.description field`}).option(`magic-mtu`,{type:`number`,description:`The magic.mtu field`}).option(`p2p-ip`,{type:`string`,description:`Cloudflare end of the point-to-point link`}).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([`bgp-customer-asn`,`bgp-extra-prefixes`,`bgp-md5-key`].some(t=>e[t]!==void 0)){let t=[`bgp-customer-asn`,`bgp-extra-prefixes`].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 --bgp-* flag is set`)}return!0})}const x={command:`update <cni>`,describe:`Modify stored information about a CNI object`,builder:b,handler:async r=>{if(r.dryRun){c({command:`cf network-interconnects cnis update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/cnis/${r.cni==null?`<cni>`:encodeURIComponent(String(r.cni))}`,pathParams:{cni:String(r.cni??``)},bodyKind:`json`,body:r.body===void 0?o({account:u(r.account,`account`,`text`),bgp:{customer_asn:r[`bgp-customer-asn`],extra_prefixes:r[`bgp-extra-prefixes`],md5_key:u(r[`bgp-md5-key`],`bgp-md5-key`,`text`)},cust_ip:u(r[`cust-ip`],`cust-ip`,`text`),id:u(r.id,`id`,`text`),interconnect:u(r.interconnect,`interconnect`,`text`),magic:{conduit_name:u(r[`magic-conduit-name`],`magic-conduit-name`,`text`),description:u(r[`magic-description`],`magic-description`,`text`),mtu:r[`magic-mtu`]},p2p_ip:u(r[`p2p-ip`],`p2p-ip`,`text`)}):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(`Updating`,async()=>f.networkInterconnects.cnis.update({body:e,account_id:p,cni:r.cni})),{successLabel:`Updated`});return}if(r.account===void 0&&(r.account=await e(`account`,`Customer account tag`)),r[`cust-ip`]===void 0&&(r[`cust-ip`]=await e(`cust-ip`,"Customer end of the point-to-point link This should always be inside the same prefix as `p2p_ip`.")),r.id===void 0&&(r.id=await e(`id`,`The id field`)),r.interconnect===void 0&&(r.interconnect=await e(`interconnect`,`Interconnect identifier hosting this CNI`)),r[`magic-conduit-name`]===void 0&&(r[`magic-conduit-name`]=await e(`magic-conduit-name`,`The magic.conduit_name field`)),r[`magic-description`]===void 0&&(r[`magic-description`]=await e(`magic-description`,`The magic.description field`)),r[`magic-mtu`]===void 0)throw Error(`--magic-mtu is required (or pass --body with this field set).`);r[`p2p-ip`]===void 0&&(r[`p2p-ip`]=await e(`p2p-ip`,`Cloudflare end of the point-to-point link`));let m=o({account:u(r.account,`account`,`text`),bgp:{customer_asn:r[`bgp-customer-asn`],extra_prefixes:r[`bgp-extra-prefixes`],md5_key:u(r[`bgp-md5-key`],`bgp-md5-key`,`text`)},cust_ip:u(r[`cust-ip`],`cust-ip`,`text`),id:u(r.id,`id`,`text`),interconnect:u(r.interconnect,`interconnect`,`text`),magic:{conduit_name:u(r[`magic-conduit-name`],`magic-conduit-name`,`text`),description:u(r[`magic-description`],`magic-description`,`text`),mtu:r[`magic-mtu`]},p2p_ip:u(r[`p2p-ip`],`p2p-ip`,`text`)});s(await l(`Updating`,async()=>f.networkInterconnects.cnis.update({body:m,account_id:p,cni:r.cni})),{successLabel:`Updated`})}},S={command:`cnis`,describe:`Cloud Network Interconnect (CNI) connections — private links from cloud providers to Cloudflare`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`account`,{type:`string`,description:`The account field`}).option(`type`,{type:`string`,description:`The type field`}).option(`slot-id`,{type:`string`,description:`The slot_id field`}).option(`speed`,{type:`string`,description:`The speed field`}).option(`bandwidth`,{type:`string`,description:`Bandwidth structure as visible through the customer-facing API.`,choices:[`50M`,`100M`,`200M`,`300M`,`400M`,`500M`,`1G`,`2G`,`5G`,`10G`,`20G`,`50G`]}).option(`pairing-key`,{type:`string`,description:`Pairing key provided by GCP`}).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(`slot-id`,[`bandwidth`,`pairing-key`]).conflicts(`speed`,[`bandwidth`,`pairing-key`]).conflicts(`bandwidth`,[`slot-id`,`speed`]).implies(`bandwidth`,[`pairing-key`]).conflicts(`pairing-key`,[`slot-id`,`speed`]).implies(`pairing-key`,[`bandwidth`])}const w={command:`create`,describe:`Create a new interconnect`,builder:C,handler:async r=>{if(r.dryRun){c({command:`cf network-interconnects interconnects create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects`,pathParams:{},bodyKind:`json`,body:r.body===void 0?o({account:u(r.account,`account`,`text`),type:u(r.type,`type`,`text`),slot_id:u(r[`slot-id`],`slot-id`,`text`),speed:u(r.speed,`speed`,`text`),bandwidth:u(r.bandwidth,`bandwidth`,`text`),pairing_key:u(r[`pairing-key`],`pairing-key`,`text`)}):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.networkInterconnects.interconnects.create({body:e,account_id:p})),{successLabel:`Created`});return}r.account===void 0&&(r.account=await e(`account`,`The account field`)),r.type===void 0&&(r.type=await e(`type`,`The type field`));let m=o({account:u(r.account,`account`,`text`),type:u(r.type,`type`,`text`),slot_id:u(r[`slot-id`],`slot-id`,`text`),speed:u(r.speed,`speed`,`text`),bandwidth:u(r.bandwidth,`bandwidth`,`text`),pairing_key:u(r[`pairing-key`],`pairing-key`,`text`)});s(await l(`Creating`,async()=>f.networkInterconnects.interconnects.create({body:m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.positional(`icon`,{type:`string`,description:`Interconnect name to retrieve information about`,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 E={command:`delete <icon>`,describe:`Delete an interconnect object`,builder:T,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects interconnects delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects/${e.icon==null?`<icon>`:encodeURIComponent(String(e.icon))}`,pathParams:{icon:String(e.icon??``)},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.
36
- `);return}s(await l(`Deleting`,async()=>a.networkInterconnects.interconnects.delete({account_id:o,icon:e.icon})),{successLabel:`Deleted`})}};function D(e){return e.positional(`icon`,{type:`string`,description:`Interconnect name to retrieve information about`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <icon>`,describe:`Get information about an interconnect object`,builder:D,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects interconnects get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects/${e.icon==null?`<icon>`:encodeURIComponent(String(e.icon))}`,pathParams:{icon:String(e.icon??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.interconnects.get({account_id:a,icon:e.icon})),{successLabel:`Loaded`})}};function k(e){return e.option(`site`,{type:`string`,description:`If specified, only show interconnects located at the given site`}).option(`type`,{type:`string`,description:`If specified, only show interconnects of the given type`}).option(`cursor`,{type:`number`,description:`Cursor`}).option(`limit`,{type:`number`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`List existing interconnects`,builder:k,handler:async e=>{let r={site:e.site,type:e.type,cursor:e.cursor,limit:e.limit};if(e.dryRun){c({command:`cf network-interconnects interconnects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.networkInterconnects.interconnects.list({account_id:o,...r})),{successLabel:`Loaded`})}};function j(e){return e.positional(`icon`,{type:`string`,description:`Interconnect name to retrieve information about`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`loa <icon>`,describe:`Generate the Letter of Authorization (LOA) for a given interconnect`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects interconnects loa`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects/${e.icon==null?`<icon>`:encodeURIComponent(String(e.icon))}/loa`,pathParams:{icon:String(e.icon??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.interconnects.loa({account_id:a,icon:e.icon})),{successLabel:`Loaded`})}};function N(e){return e.positional(`icon`,{type:`string`,description:`Interconnect name to retrieve information about`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`status <icon>`,describe:`Get the current status of an interconnect object`,builder:N,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects interconnects status`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/interconnects/${e.icon==null?`<icon>`:encodeURIComponent(String(e.icon))}/status`,pathParams:{icon:String(e.icon??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.interconnects.status({account_id:a,icon:e.icon})),{successLabel:`Loaded`})}},F={command:`interconnects`,describe:`Physical cross-connect and partner interconnect sessions with LOA and status tracking`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get`,describe:`Get the current settings for the active account`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/settings`,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.networkInterconnects.settings.get({account_id:a})),{successLabel:`Loaded`})}};function R(e){return e.option(`default-asn`,{type:`number`,description:`The default_asn 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 z={command:`update`,describe:`Update the current settings for the active account`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/settings`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({default_asn:e[`default-asn`]}):a(e.body)});return}let r=await i(e),u=e.local?d:await n(r);if(e.accountId=u,e.body){let t=a(e.body);s(await l(`Updating`,async()=>r.networkInterconnects.settings.update({...t,account_id:u})),{successLabel:`Updated`});return}let f=o({default_asn:e[`default-asn`]});s(await l(`Updating`,async()=>r.networkInterconnects.settings.update({...f,account_id:u})),{successLabel:`Updated`})}},B={command:`settings`,describe:`Account-level interconnect settings and default configurations`,builder:e=>e.command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`slot`,{type:`string`,description:`Slot`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <slot>`,describe:`Get information about the specified slot`,builder:V,handler:async e=>{if(e.dryRun){c({command:`cf network-interconnects slots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/slots/${e.slot==null?`<slot>`:encodeURIComponent(String(e.slot))}`,pathParams:{slot:String(e.slot??``)},bodyKind:`none`});return}let r=await i(e),a=e.local?d:await n(r);e.accountId=a,s(await l(`Loading`,async()=>r.networkInterconnects.slots.get({account_id:a,slot:e.slot})),{successLabel:`Loaded`})}};function U(e){return e.option(`address-contains`,{type:`string`,description:`If specified, only show slots with the given text in their address field`}).option(`site`,{type:`string`,description:`If specified, only show slots located at the given site`}).option(`speed`,{type:`string`,description:`If specified, only show slots that support the given speed`}).option(`occupied`,{type:`boolean`,description:`If specified, only show slots with a specific occupied/unoccupied state`}).option(`cursor`,{type:`number`,description:`Cursor`}).option(`limit`,{type:`number`,description:`Limit`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`Retrieve a list of all slots matching the specified parameters`,builder:U,handler:async e=>{let r={address_contains:e[`address-contains`],site:e.site,speed:e.speed,occupied:e.occupied,cursor:e.cursor,limit:e.limit};if(e.dryRun){c({command:`cf network-interconnects slots list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/cni/slots`,pathParams:{},query:r,bodyKind:`none`});return}let a=await i(e),o=e.local?d:await n(a);e.accountId=o,s(await l(`Loading`,async()=>a.networkInterconnects.slots.list({account_id:o,...r})),{successLabel:`Loaded`})}},G={command:`slots`,describe:`Available interconnect facility slots showing port capacity at Cloudflare data centers`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`network-interconnects`,describe:`Physical and virtual private interconnects between your infrastructure and Cloudflare's network`,builder:e=>e.command(S).command(F).command(B).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
@@ -1,52 +0,0 @@
1
- #!/usr/bin/env node
2
- import{o as e,r as t}from"./chunk-DH-VkVmc.mjs";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,o as f,p,s as m,t as h,u as ee,v as g,y as _}from"./session-DHYCE-PM.mjs";import{$ as te,A as ne,I as re,M as ie,P as ae,S as v,W as y,_ as b,a as oe,et as x,j as se,s as ce,v as le}from"./dist-C6zxsVdY.mjs";import{n as S,t as C}from"./theme-DbNbIY4d.mjs";import{i as w,n as ue,r as T}from"./config-B5k-XbwS.mjs";import{c as E,f as de,h as D,i as O,m as k,o as A,r as j,s as M,t as N}from"./dist-t_YrL25p.mjs";import{n as fe,t as pe}from"./resolve-C3h-mwp7.mjs";import{chmodSync as me,existsSync as P,mkdirSync as he,readFileSync as F,readdirSync as ge,rmSync as _e,unlinkSync as ve,writeFileSync as I}from"node:fs";import"node:os";import L,{dirname as R,join as z}from"node:path";import{URLSearchParams as ye}from"node:url";import"node:process";const{white:be,gray:xe,dim:Se,hidden:Ce,bold:we,cyanBright:Te,bgCyan:Ee}=D;D.hex(`#BD5B08`);const B=D.hex(`#111`);D.hex(`#0E838F`);const De=B.bgHex(`#0E838F`);D.hex(`#AB2526`);const Oe=B.bgHex(`#AB2526`);D.hex(`#218529`);const ke=B.bgHex(`#218529`);D.hex(`#7F7322`);const Ae=B.bgHex(`#7F7322`),je=process.stdout;process.stderr;var Me=e(E(),1);const Ne={diamond:`◇`,dash:`─`,radioInactive:`○`,radioActive:`●`,backActive:`◀`,backInactive:`◁`,bar:`│`,leftT:`├`,rigthT:`┤`,arrows:{left:`‹`,right:`›`},corners:{tl:`╭`,bl:`╰`,tr:`╮`,br:`╯`}};Oe(` ERROR `),Ae(` WARNING `),De(` INFO `),ke(` SUCCESS `),be.bgRed(` X `),M(je),xe(Ne.bar),xe(Ne.corners.bl),xe(Ne.leftT);function Pe(){try{return!!(process.stdin.isTTY&&process.stdout.isTTY)}catch{return!1}}function V(){return!Pe()||Me.isCI}const Fe=Me.isCI;function Ie(){h(_)}async function Le(e){let t=S(),n=e.map(e=>({value:e,label:e.name})),r=await new de({options:n,initialValue:n[0]?.value,render(){let e=t.bold(`Select an account`),n=this.options.map((e,n)=>{let r=n===this.cursor,i=e.value,a=t.hex(C.muted)(`${i.id.slice(0,12)}...`);return r?` ${t.hex(C.orange)(`>`)} ${t.bold(i.name)} ${a}`:` ${t.dim(i.name)} ${a}`});return`${e} ${t.dim(`(use arrow keys, enter to confirm)`)}\n${n.join(`
3
- `)}`}}).prompt();return k(r)||!r?null:r}async function Re(){let e=[];for await(let t of process.stdin)e.push(Buffer.from(t));let t=Buffer.concat(e).toString(`utf-8`);return t.endsWith(`
4
- `)?t.slice(0,-1):t}async function ze(e,t,n){let r=n?.kind??`text`;if(V()){if(r===`secret`){let t=await Re();if(t.length>0)return t;throw Error(`--${e} is required. Pipe the value via stdin, pass --${e} <value>, or run interactively.`)}throw Error(`--${e} is required. Pass --${e} <value> or run interactively.`)}let i=`Enter value for --${e}`,a=t||n?.question||i;Ie();let o=r===`secret`?await j({message:a,mask:`•`,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`}):await A({message:a,validate:e=>e&&e.length>0?void 0:`Value cannot be empty`});return(k(o)||typeof o!=`string`)&&process.exit(130),o}async function Be(e,t,n){if(V())throw Error(`--${e} is required (one of: ${n.join(`, `)}). Pass --${e} <value> or run interactively.`);let r=`Select value for --${e}`,i=t||r;Ie();let a=await O({message:i,options:n.map(e=>({value:e,label:e}))});return(k(a)||typeof a!=`string`)&&process.exit(130),a}async function Ve(e={}){if(e.force===!0)return!0;let t=e.message?`${e.message} Continue?`:`This permanently deletes the resource. Continue?`;if(V()){let e=S();return process.stderr.write(`${e.hex(C.warning)(`?`)} ${t}\n ${e.dim(`(non-interactive; pass --force to confirm)`)}\n`),!1}Ie();let n=await N({message:t,initialValue:!1});return k(n)&&process.exit(130),n===!0}const H=`.cfrc`;function U(e){let t=e||process.cwd(),n=R(t);for(;t!==n;){let e=z(t,H);if(P(e))try{let t=F(e,`utf-8`).replace(/^\s*\/\/.*$/gm,``);return{config:JSON.parse(t),path:e}}catch{}t=R(t)}let r=z(t,H);if(P(r))try{let e=F(r,`utf-8`).replace(/^\s*\/\/.*$/gm,``);return{config:JSON.parse(e),path:r}}catch{}return null}function He(e,t){I(z(t||process.cwd(),H),JSON.stringify(e,null,2)+`
5
- `,{mode:384})}function Ue(e){let t=z(e||process.cwd(),H);return P(t)?(ve(t),!0):!1}async function We(e){let t={},n=W(`accountId`,`CLOUDFLARE_ACCOUNT_ID`);n&&(t.accountId=n);let r=W(`zone`,`CLOUDFLARE_ZONE_ID`,e?.zone);r&&(t.zone=r);let i=W(`complianceRegion`,`CLOUDFLARE_COMPLIANCE_REGION`);return i&&(t.complianceRegion=i),t}function W(e,t,n){if(n)return{value:n,source:`flag`};let r=process.env[t];if(r)return{value:r,source:`env`};let i=U(),a=i?.config[e];if(a)return{value:a,source:`project`,path:i.path};let o=T().defaults?.[e];if(o)return{value:o,source:`config`,path:ue()}}function Ge(){return W(`accountId`,`CLOUDFLARE_ACCOUNT_ID`)?.value}async function Ke(e){let t=W(`accountId`,`CLOUDFLARE_ACCOUNT_ID`);if(t)return qe(t.value,rt(t,`accountId`)),t.value;if(e){let t=await Je(e);if(t)return t}throw Error(`No account ID found.
6
-
7
- Please provide one of the following:
8
- 1. CLOUDFLARE_ACCOUNT_ID environment variable
9
- 2. Run 'cf context set account-id <id>' to set a default
10
- 3. Create a .cfrc file in your project
11
-
12
- You can find your account ID in the Cloudflare dashboard URL:
13
- https://dash.cloudflare.com/<account-id>/...`)}function qe(e,t){if(!process.env.DEBUG)return;let n=e.length>12?e.slice(0,12)+`…`:e;process.stderr.write(`Using account: ${n} (${t})\n`)}async function Je(e){let t;try{t=await ot(e)}catch{return}if(t.length===0)return;if(t.length===1&&t[0]){let n=t[0],{displayName:r}=await it(`accountId`,n.id,`user`,e);return qe(n.id,`auto-selected from token — ${r}`),n.id}if(V()){let e=t.map(e=>` ${e.id} ${e.name}`).join(`
14
- `);throw Error(`Multiple accounts available but running non-interactively.
15
-
16
- Available accounts:
17
- ${e}
18
-
19
- Set one with CLOUDFLARE_ACCOUNT_ID or 'cf context set account-id'.`)}let n=await Le(t);n||process.exit(130);let{displayName:r}=await it(`accountId`,n.id,`user`,e);return qe(n.id,`selected interactively — ${r}`),n.id}async function Ye(e,t,n){if(e?.zoneId)return Xe(e.zoneId,t);let r=W(`zone`,`CLOUDFLARE_ZONE_ID`,e?.zone);if(r){if(!n?.quiet&&r.source!==`flag`){let e=rt(r);console.error(`Using zone: ${r.value} (from ${e})`)}return Xe(r.value,t)}throw Error(`No zone specified.
20
-
21
- Please provide one of the following:
22
- 1. Zone as a positional argument: cf dns records list <zone>
23
- 2. --zone flag (or -z): cf dns records list --zone example.com
24
- 3. CLOUDFLARE_ZONE_ID environment variable
25
- 4. Run 'cf context set zone <zone>' to set a default
26
- 5. Create a .cfrc file in your project with {"zone": "example.com"}`)}async function Xe(e,t){if(pe(e)||!t)return e;let{resolveZoneId:n}=await import(`./resolve-C3h-mwp7.mjs`).then(e=>e.r);return n(t,await Ke(),e)}function Ze(e){if(e?.scriptName)return e.scriptName;throw Error("Required Worker name missing. Please specify the Worker name with `--worker <name>`.")}const Qe=[`public`,`fedramp_high`],$e={"account-id":`accountId`,zone:`zone`,"compliance-region":`complianceRegion`},et=Object.keys($e);function tt(e){return Qe.includes(e)}function nt(){let e=W(`complianceRegion`,`CLOUDFLARE_COMPLIANCE_REGION`);if(!e)return`public`;if(!tt(e.value))throw Error(`Invalid compliance region "${e.value}". Must be one of: ${Qe.join(`, `)}`);return e.value}function rt(e,t=`zone`){switch(e.source){case`flag`:return t===`zone`?`--zone flag`:`(flag)`;case`env`:return{accountId:`CLOUDFLARE_ACCOUNT_ID`,zone:`CLOUDFLARE_ZONE_ID`,complianceRegion:`CLOUDFLARE_COMPLIANCE_REGION`}[t];case`project`:return`.cfrc`;case`config`:return`~/.config/cf/config.json`}}async function it(e,t,n,r){let i=t,a=t;if(e===`accountId`){if(!r)throw Error(`Authentication required to validate account ID`);let{id:e,name:n}=await st(t,r);i=e,a=n?`${e.slice(0,12)}... (${n})`:e}else if(e===`zone`){if(!r)throw Error(`Authentication required to validate zone`);let e=await ct(t,r);i=t,a=e.name}else e===`complianceRegion`&&(i=t,a=t);if(n===`project`){let t=U()?.config||{};t[e]=i,He(t)}else{let t=T();t.defaults||={},t.defaults[e]=i,w(t)}return{resolvedValue:i,displayName:a}}function at(e,t){if(t===`project`)if(e===`all`)Ue();else{let t=U();t&&(delete t.config[e],Object.keys(t.config).length===0?Ue(R(t.path)):He(t.config,R(t.path)))}else{let t=T();t.defaults&&(e===`all`?delete t.defaults:(delete t.defaults[e],Object.keys(t.defaults).length===0&&delete t.defaults),w(t))}}async function ot(e){return(await e.accounts.list({})).result}async function st(e,t){let n=await ot(t),r=n.find(t=>t.id===e);if(r)return{id:r.id,name:r.name};let i=n.find(t=>t.name.toLowerCase()===e.toLowerCase());if(i)return{id:i.id,name:i.name};if(pe(e))return{id:e};throw Error(`Account not found: "${e}"
27
-
28
- Available accounts:
29
- ${n.map(e=>` ${e.id.slice(0,12)}... ${e.name}`).join(`
30
- `)}`)}async function ct(e,t){let n=(await t.zones.list({})).result,r=n.find(t=>t.id===e);if(r)return{id:r.id,name:r.name};let i=n.find(t=>t.name.toLowerCase()===e.toLowerCase());if(i)return{id:i.id,name:i.name};throw fe(e)?Error(`Zone not found: "${e}"
31
-
32
- This zone either doesn't exist or you don't have access to it.
33
- Run 'cf zones list' to see available zones.`):Error(`Invalid zone: "${e}"
34
-
35
- Please provide a zone ID or domain name.
36
- Run 'cf zones list' to see available zones.`)}function lt(){return z(process.cwd(),H)}function ut(e){function t(){return L.resolve(e(),`preferences.json`)}n(t,`getUserPreferencesPath`);function r(){try{let e=F(t(),`utf8`),n=JSON.parse(e);return typeof n==`object`&&n?n:{}}catch{return{}}}n(r,`readUserPreferences`);function i(e){let n={...r(),...e},i=t();he(L.dirname(i),{recursive:!0}),I(i,JSON.stringify(n,null,` `),{encoding:`utf-8`})}return n(i,`updateUserPreferences`),{readUserPreferences:r,updateUserPreferences:i}}n(ut,`createPreferences`);var dt=6e4,ft=525600,pt=43200,mt=1440,ht=Symbol.for(`constructDateFrom`);function G(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&ht in e?e[ht](t):e instanceof Date?new e.constructor(t):new Date(t)}n(G,`constructFrom`);function K(e,t){return G(t||e,e)}n(K,`toDate`);var gt={};function _t(){return gt}n(_t,`getDefaultOptions`);function vt(e){let t=K(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}n(vt,`getTimezoneOffsetInMilliseconds`);function yt(e,...t){let n=G.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}n(yt,`normalizeDates`);function bt(e,t){let n=K(e)-+K(t);return n<0?-1:n>0?1:n}n(bt,`compareAsc`);function xt(e){return G(e,Date.now())}n(xt,`constructNow`);function St(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}n(St,`getRoundingMethod`);var Ct={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},wt=n((e,t,n)=>{let r,i=Ct[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},`formatDistance`);function q(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}n(q,`buildFormatLongFn`);var Tt={date:q({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:q({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:q({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Et={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Dt=n((e,t,n,r)=>Et[e],`formatRelative`);function J(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}n(J,`buildLocalizeFn`);var Ot={ordinalNumber:n((e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},`ordinalNumber`),era:J({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:J({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:n(e=>e-1,`argumentCallback`)}),month:J({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:J({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:J({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function Y(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?At(s,e=>e.test(o)):kt(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}n(Y,`buildMatchFn`);function kt(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}n(kt,`findKey`);function At(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}n(At,`findIndex`);function jt(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}n(jt,`buildMatchPatternFn`);var Mt={code:`en-US`,formatDistance:wt,formatLong:Tt,formatRelative:Dt,localize:Ot,match:{ordinalNumber:jt({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:n(e=>parseInt(e,10),`valueCallback`)}),era:Y({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Y({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:n(e=>e+1,`valueCallback`)}),month:Y({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:Y({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:Y({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function Nt(e,t,n){let r=_t(),i=n?.locale??r.locale??Mt,a=bt(e,t);if(isNaN(a))throw RangeError(`Invalid time value`);let o=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[s,c]=yt(n?.in,...a>0?[t,e]:[e,t]),l=St(n?.roundingMethod??`round`),u=c.getTime()-s.getTime(),d=u/dt,f=(u-(vt(c)-vt(s)))/dt,p=n?.unit,m;if(m=p||(d<1?`second`:d<60?`minute`:d<mt?`hour`:f<pt?`day`:f<ft?`month`:`year`),m===`second`){let e=l(u/1e3);return i.formatDistance(`xSeconds`,e,o)}else if(m===`minute`){let e=l(d);return i.formatDistance(`xMinutes`,e,o)}else if(m===`hour`){let e=l(d/60);return i.formatDistance(`xHours`,e,o)}else if(m===`day`){let e=l(f/mt);return i.formatDistance(`xDays`,e,o)}else if(m===`month`){let e=l(f/pt);return e===12&&p!==`month`?i.formatDistance(`xYears`,1,o):i.formatDistance(`xMonths`,e,o)}else{let e=l(f/ft);return i.formatDistance(`xYears`,e,o)}}n(Nt,`formatDistanceStrict`);function Pt(e,t){return Nt(e,xt(e),t)}n(Pt,`formatDistanceToNowStrict`);function X(e,t){return{read:n(()=>{let n=t();if(!P(n))return;let r=te(n);try{return p(e,r)}catch{return}},`read`),write(n){let r=t();he(L.dirname(r),{recursive:!0}),I(r,c(e,n),{encoding:`utf-8`,mode:384}),me(r,384)},clear(){let e=t(),n=P(e);return _e(e,{force:!0}),n},path:t}}n(X,`createFileStorage`);function Ft(e){let{logger:t,prompt:r}=e;return n(async function(e,n){if(ie())return t.log(n),!0;let i=await r(e);return typeof i==`string`&&i.trim().toLowerCase()===`yes`},`ensureTemporaryTermsAccepted`)}n(Ft,`createTemporaryTermsPrompt`);var It=[9106,1e4];function Lt(e){return e?.code}n(Lt,`getErrorCode`);function Rt(e){let t=Lt(e);return t!==void 0&&It.includes(t)}n(Rt,`isMembershipsInaccessible`);function zt(e){return{"no-credentials-non-interactive":`Could not authenticate because no credentials were found and the environment is non-interactive. Set a CLOUDFLARE_API_TOKEN environment variable or run \`${e}\` in an interactive terminal first.`,"no-credentials-login-failed":`No credentials were found and the login attempt was unsuccessful. Run \`${e}\` to try again.`,"token-expired-non-interactive":`Your auth token has expired and could not be refreshed, and the environment is non-interactive. Run \`${e}\` in an interactive terminal or set a CLOUDFLARE_API_TOKEN.`,"token-expired-login-failed":`Your auth token has expired and could not be refreshed, and the login attempt was unsuccessful. Run \`${e}\` to try again.`}}n(zt,`notLoggedInErrorBodies`);function Bt(e,t,n){let r=new Date(t.claim.expiresAt);e.log(m`
37
- Temporary account ready:
38
- Account: ${t.account.name} (${n?`reused`:`created`})
39
- Claim within: ${Pt(r)}
40
- Claim URL: ${t.claim.url}
41
- `)}n(Bt,`logTemporaryPreviewAccount`);function Vt(e,t){let{logger:i}=t,a=e.cliName,o=zt(e.commands.login),s=`
42
- Run \`${e.commands.whoami}\` to check your current authentication status.`,c=ut(e.getConfigPath),d=oe(i,e.cacheNamespace?{namespace:e.cacheNamespace}:void 0),f=l({serviceName:e.keyringServiceName,getConfigPath:e.getConfigPath,isKeyringEnabled:n(()=>c.readUserPreferences().keyring_enabled===!0,`isKeyringEnabled`),logger:i,isNonInteractiveOrCI:ie,loginCommand:e.commands.login,format:e.fileFormat}),p=e.allowGlobalAuthKey??!0,m=r({logger:i,isNonInteractiveOrCI:ie,openInBrowser:n(e=>ae(e,i),`openInBrowser`),hasEnvCredentials:n(()=>u({allowGlobalAuthKey:p})!==void 0,`hasEnvCredentials`),purgeOnLoginOrLogout:d.purgeConfigCaches,clientId:e.clientId,consent:e.consent,redirectUri:e.redirectUri,storageFactory:f.storageFactory,allowGlobalAuthKey:p,temporary:{storage:X(e.fileFormat,e.getTemporaryAccountConfigPath),prompt:Ft({logger:i,prompt:t.prompt})}});function h(e){m.setProfile(e)}n(h,`setProfile`);function g(){return m.getActiveProfile()}n(g,`getActiveProfile`);function _(){return f.getActiveStore(m.getActiveProfile())}n(_,`getCredentialStore`);function te(e){m.setTemporaryAllowed(e)}n(te,`setTemporaryAllowed`);function v(){return m.getAPIToken()}n(v,`getAPIToken`);function b(){return m.requireApiToken()}n(b,`requireApiToken`);function x(t,n){return{complianceConfig:t,scopes:n?.scopes??e.getDefaultScopeKeys(),browser:n?.browser??!0,callbackHost:n?.callbackHost,callbackPort:n?.callbackPort,profile:n?.profile}}n(x,`withDefaultScopes`);async function S(e,t){return m.login(x(e,t))}n(S,`login`);async function C(e){return m.logout(e)}n(C,`logout`);async function w(e,t){return m.getActiveTemporaryAccount()?{loggedIn:!0}:m.loginOrRefreshIfRequired(x(e,t))}n(w,`loginOrRefreshIfRequired`);async function ue(){return m.getOAuthTokenFromLocalState()}n(ue,`getOAuthTokenFromLocalState`);function T(){return m.getScopes()}n(T,`getScopes`);function E(){return f.storageFactory(g()).read()}n(E,`readAuthCredentials`);function de(e){f.storageFactory(g()).write(e)}n(de,`writeAuthCredentials`);function D(){let t=m.getActiveProfile();return t===`default`?`${e.accountCachePrefix}.json`:`${e.accountCachePrefix}-${t}.json`}n(D,`getAccountCacheFileName`);function O(e){d.saveToConfigCache(D(),{account:e})}n(O,`saveAccountToCache`);function k(){return d.getConfigCache(D()).account}n(k,`getAccountFromCache`);async function A(e,n){let r=await w(e);if(!r.loggedIn)throw new y(`Not logged in. ${o[r.reason]}${s}`,{telemetryMessage:`cfetch auth login required`});let a=b(),c=[],l=!0,u=1,d;for(;l;){d=new ye(d),d.set(`page`,String(u));let{response:r,status:o}=await ce(e,n,{},t.userAgent,i,d,void 0,a);r.success?(c.push(...r.result),ne(r.result_info)?u+=1:l=!1):re(n,r,o)}return c}n(A,`fetchAccountsPaged`);async function j(t,n={}){let{throwOnEmpty:r=!0}=n,[i,a]=await Promise.allSettled([A(t,`/accounts`),A(t,`/memberships`)]);if(i.status===`rejected`)throw i.reason;if(a.status===`rejected`)if(Rt(a.reason)){if(i.status===`fulfilled`&&i.value.length>0)return i.value;throw Lt(a.reason)===9106?new y(`Failed to automatically retrieve account IDs for the logged in user.
43
- You may have incorrect permissions on your API token, or an environment variable such as CLOUDFLARE_API_TOKEN, CLOUDFLARE_API_KEY, or CLOUDFLARE_EMAIL may be set to an invalid value.
44
- Check your environment and unset or correct any Cloudflare credential variables, or run \`${e.commands.login}\` to re-authenticate.
45
- You can also skip this account check by adding an \`account_id\` in your ${e.getConfigFileLabel()} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID`,{telemetryMessage:`user account fetch permission denied`}):new y(`Failed to automatically retrieve account IDs for the logged in user.
46
- You may have incorrect permissions on your API token, or your authentication may have expired. Try running \`${e.commands.login}\` to re-authenticate. You can also skip this account check by adding an \`account_id\` in your ${e.getConfigFileLabel()} file, or by setting the value of CLOUDFLARE_ACCOUNT_ID`,{telemetryMessage:`user account fetch permission denied`})}else throw a.reason;let o=new Set(a.value.map(e=>e.account.id)),s=i.value.filter(e=>o.has(e.id));if(s.length===0&&r)throw new y(`Failed to automatically retrieve account IDs for the logged in user.
47
- In a non-interactive environment, it is mandatory to specify an account ID, either by assigning its value to CLOUDFLARE_ACCOUNT_ID, or as \`account_id\` in your ${e.getConfigFileLabel()} file.
48
- Alternatively, try running \`${e.commands.login}\` to re-authenticate.`,{telemetryMessage:`user account fetch empty`});return s}n(j,`fetchAllAccounts`);function M(e){let t=m.getActiveTemporaryAccount();return t?t.account.id:e.account_id?e.account_id:ee()||k()?.id}n(M,`getActiveAccountId`);async function N(n){let r=M(n);if(r)return r;let i=await j(n);if(i.length===1)return O({id:i[0].id,name:i[0].name}),i[0].id;try{let e=await t.select(`Select an account`,{choices:i.map(e=>({title:e.name,value:e.id}))}),n=i.find(t=>t.id===e);if(!n)throw Error(`Selected account not found in accounts list`);return O({id:n.id,name:n.name}),e}catch(n){if(t.isNoDefaultValueProvidedError(n)){let t=se();throw new y(`More than one account available but unable to select one in non-interactive mode.
49
- Please set the appropriate \`account_id\` in your ${e.getConfigFileLabel()} file or assign it to the \`CLOUDFLARE_ACCOUNT_ID\` environment variable.
50
- Available accounts are (\`<name>\`: \`<account_id>\`):
51
- ${i.map(e=>` \`${t?`(redacted)`:e.name}\`: \`${e.id}\``).join(`
52
- `)}`,{telemetryMessage:`user account selection unavailable`})}throw n}}n(N,`getOrSelectAccountId`);async function fe(e){if(m.isTemporaryAllowed()){if(le(e)!==`public`)throw new y(`Temporary accounts aren't available when the compliance region is not set to public.`,{telemetryMessage:`user temporary account unavailable in compliance region`});if(v())throw new y("You're already authenticated with Cloudflare, so `--temporary` can't be used. Temporary preview accounts are only for unauthenticated use. Either remove `--temporary` to use your existing account, or log out (and unset CLOUDFLARE_API_TOKEN) first.",{telemetryMessage:`user temporary account already authenticated`});let{account:t,cached:n}=await m.activateTemporaryAccount();return Bt(i,t,n),t.account.id}let t=await w(e);if(!t.loggedIn)throw t.reason===`no-credentials-non-interactive`||t.reason===`token-expired-non-interactive`?new y(`In a non-interactive environment, it's necessary to set a CLOUDFLARE_API_TOKEN environment variable for ${a} to work. Please go to https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ for instructions on how to create an api token, and assign its value to CLOUDFLARE_API_TOKEN.`,{telemetryMessage:`user auth missing api token non interactive`}):new y(`Did not login, quitting...`,{telemetryMessage:`user login cancelled`});let n=await N(e);if(!n)throw new y(`No account id found, quitting...`,{telemetryMessage:`user auth missing account id`});return n}return n(fe,`requireAuth`),{setProfile:h,getActiveProfile:g,getCredentialStore:_,setTemporaryAllowed:te,getAPIToken:v,requireApiToken:b,login:S,logout:C,loginOrRefreshIfRequired:w,getOAuthTokenFromLocalState:ue,getScopes:T,readAuthCredentials:E,writeAuthCredentials:de,getActiveAccountId:M,getOrSelectAccountId:N,getAccountFromCache:k,fetchAllAccounts:j,requireAuth:fe}}n(Vt,`createCloudflareAuth`);var Ht=`profiles/directory-bindings.json`,Ut=`.enc`;function Wt(e){let{logger:t,getConfigPath:r,keyringServiceName:a,format:s}=e,c=`.${s}`;function l(e){return i(r(),e,s)}n(l,`plaintextPath`);function u(e){return o(r(),e)}n(u,`encryptedPath`);function p(){return L.dirname(l(`default`))}n(p,`getProfileConfigDirectory`);let m={exists(e){return P(l(e))||P(u(e))},list(){let e=p();if(!P(e))return[];let t=new Set;for(let n of ge(e))n.endsWith(c)?t.add(n.slice(0,-c.length)):n.endsWith(Ut)&&t.add(n.slice(0,-Ut.length));return[...t]},delete(e){let{backendAvailable:n,encryptedFileExisted:i}=d({serviceName:a,configPath:r(),profile:e,format:s});X(s,()=>l(e)).clear(),i&&!n&&t.warn(`Removed the credential files for profile "${e}", but the keyring backend was not reachable on this host so its keyring entry could not be cleared. Clear it manually if it persists.`)}};function h(){return L.join(r(),Ht)}return n(h,`getDirectoryBindingsPath`),f({configs:m,bindings:{read(){try{let e=F(h(),`utf-8`);return JSON.parse(e)}catch{return{}}},write(e){let t=h();he(L.dirname(t),{recursive:!0}),I(t,JSON.stringify(e,null,` `),`utf-8`)}}})}n(Wt,`createCloudflareProfileStore`);function Gt(e){let{loginCommand:t,createProfileCommand:r,keyringServiceName:i,getConfigPath:c,format:l,preferences:u}=e,{readUserPreferences:f,updateUserPreferences:p}=u;function m(e){return e??`default`}n(m,`describeProfile`);function h(e){let t=[];P(o(c()))&&t.push(void 0);let n=Wt({logger:e,getConfigPath:c,keyringServiceName:i,format:l});for(let e of n.configs.list()){try{s(e)}catch{continue}P(o(c(),e))&&t.push(e)}return t}n(h,`listEncryptedProfiles`);function ee(e){let n=h(e);if(n.length===0)return;let a=[],o=[];for(let t of n)try{let{backendAvailable:e}=d({serviceName:i,configPath:c(),profile:t,format:l});a.push(m(t)),e||o.push(m(t))}catch(n){e.warn(`Failed to remove encrypted credentials for profile "${m(t)}": ${n instanceof Error?n.message:String(n)}. You may need to clear them manually.`)}if(a.length>0){let n=r?`Re-authenticate with \`${t}\` (default profile) or \`${r} <name>\` (named profiles).`:`Re-authenticate with \`${t}\`.`;e.log(`Removed encrypted credentials for ${a.map(e=>`"${e}"`).join(`, `)}. ${n}`)}o.length>0&&e.warn(`The keyring backend was not reachable on this host, so the keyring entry for ${o.map(e=>`"${e}"`).join(`, `)} could not be cleared. Clear it manually if it persists.`)}n(ee,`scrubAllEncryptedProfiles`);function g(e,t){let{logger:n,getCredentialStore:r}=t,i=f().keyring_enabled===!0,o=a();if(o!==void 0&&o!==e&&n.warn(`CLOUDFLARE_AUTH_USE_KEYRING=${o} overrides ${e?`enabling`:`disabling`} keyring storage for this command.`),!e&&o!==!0&&ee(n),p({keyring_enabled:e}),e&&o!==!1)try{r().kind!==`encrypted-file`&&(p({keyring_enabled:i}),n.warn(`Keyring storage isn't available on this host (see warning above), so it was not enabled. Try again once the keyring backend is reachable.`))}catch(e){throw p({keyring_enabled:i}),e}return{enabled:f().keyring_enabled===!0}}return n(g,`setKeyringPreference`),{setKeyringPreference:g}}n(Gt,`createKeyringPreference`);function Kt(e){let{getConfigPath:t,format:r}=e;function a(e){return i(t(),e,r)}n(a,`getAuthConfigFilePath`);function s(e){return o(t(),e)}n(s,`getEncryptedAuthConfigFilePath`);function c(e){return X(r,()=>a(e))}n(c,`defaultAuthConfigStorage`);function l(e,t){c(t).write(e)}n(l,`writeAuthConfigFile`);function u(e){return c(e).read()}return n(u,`readAuthConfigFile`),{getAuthConfigFilePath:a,getEncryptedAuthConfigFilePath:s,defaultAuthConfigStorage:c,readAuthConfigFile:u,writeAuthConfigFile:l}}n(Kt,`createAuthConfigFileHelpers`);var qt=`cloudflare`,Jt=`cf`,Yt=`http://localhost:8877/oauth/callback`,Xt={granted:{url:`https://welcome.developers.workers.dev/cf-oauth-consent-granted`},denied:{url:`https://welcome.developers.workers.dev/cf-oauth-consent-denied`,error:"Error: Consent denied. You must grant consent to cf in order to login.\nIf you don't want to do this consider passing an API token via the `CLOUDFLARE_API_TOKEN` environment variable"}},Zt=v({variableName:`CLOUDFLARE_CLIENT_ID`,defaultValue:n(()=>`cbca97e7-c331-4cdd-8fd8-e25a451b98bf`,`defaultValue`)});function Z(){return x({appName:`cloudflare`,leadingDot:!1,useLegacyHomeDir:!1})}n(Z,`getCfConfigPath`);var Qt=`openid.offline.user:read.account:read.access:read.access:write.agw:read.agw:run.agw:write.ai:read.ai:write.ai-search:read.ai-search:run.ai-search:write.aiaudit:read.aiaudit:write.aig:read.aig:write.auditlogs:read.browser:read.browser:write.cfone:read.cfone:write.cloudchamber:write.connectivity:admin.connectivity:bind.connectivity:read.constellation:write.containers:write.d1:write.dex:read.dex:write.dns_analytics:read.dns_records:edit.dns_records:read.dns_settings:read.firstpartytags:write.images:read.images:write.lb:edit.lb:read.logpush:read.logpush:write.mcp_portals:read.mcp_portals:write.notebook-examples:read.notification:read.notification:write.pages:read.pages:write.pipelines:read.pipelines:setup.pipelines:write.query_cache:write.queues:write.r2_catalog:write.radar:read.rag:read.rag:write.registrar:read.registrar:write.secrets_store:read.secrets_store:write.sso-connector:read.sso-connector:write.ssl_certs:write.teams:pii.teams:read.teams:secure_location.teams:write.url_scanner:read.url_scanner:write.vectorize:write.workers:read.workers:write.workers_builds:read.workers_builds:write.workers_deployments:read.workers_kv:write.workers_observability:read.workers_observability:write.workers_observability_telemetry:write.workers_routes:write.workers_scripts:write.workers_tail:read.zone:read`.split(`.`),$t=[...Qt];function en(e){$t=e}n(en,`setLoginScopeKeys`);var tn=new Set(Qt);function nn(e){return e.every(e=>tn.has(e))}n(nn,`validateScopeKeys`);function rn(){let e=b();return e===`production`?`cloudflare-temporary-account.json`:`cloudflare-temporary-account.${e}.json`}n(rn,`getTemporaryAccountConfigFile`);function an(){return L.join(Z(),rn())}n(an,`getCfTemporaryAccountConfigPath`);function on(e){return X(`json`,e)}n(on,`createJsonFileStorage`);var{getAuthConfigFilePath:sn,getEncryptedAuthConfigFilePath:cn,defaultAuthConfigStorage:ln,readAuthConfigFile:un,writeAuthConfigFile:dn}=Kt({getConfigPath:Z,format:`json`}),Q={cliName:Jt,commands:{login:`cf auth login`,whoami:`cf auth whoami`},keyringServiceName:qt,clientId:Zt,consent:Xt,redirectUri:Yt,allowGlobalAuthKey:!1,getConfigPath:Z,getTemporaryAccountConfigPath:an,fileFormat:`json`,accountCachePrefix:`cloudflare-account`,cacheNamespace:`cloudflare`,getConfigFileLabel:n(()=>`cf config`,`getConfigFileLabel`),getDefaultScopeKeys:n(()=>$t,`getDefaultScopeKeys`)},fn=ut(Z),{readUserPreferences:pn,updateUserPreferences:mn}=fn;function hn(e){return Vt(Q,e)}n(hn,`createCfAuth`);function gn(e){return Wt({logger:e.logger,getConfigPath:Z,keyringServiceName:qt,format:`json`})}n(gn,`createCfProfileStore`);var _n=Gt({loginCommand:Q.commands.login,createProfileCommand:Q.commands.createProfile,keyringServiceName:qt,getConfigPath:Z,format:`json`,preferences:fn});function vn(e,t){return _n.setKeyringPreference(e,t)}n(vn,`setKeyringPreference`);var yn=t({getActiveProfile:()=>Dn,getConfigPath:()=>Nn,getProfileStore:()=>On,getValidToken:()=>An,isOAuthLoggedIn:()=>jn,login:()=>wn,logout:()=>Tn,readAuthCredentials:()=>Mn,resolveProfile:()=>kn,setProfile:()=>En});const bn={debug:(...e)=>{process.env.DEBUG&&console.error(...e)},info:(...e)=>console.error(...e),log:(...e)=>console.error(...e),warn:(...e)=>console.error(...e),error:(...e)=>console.error(...e)};var xn=class extends Error{};async function Sn(e){if(V())throw new xn;h(_);let t=await A({message:e});return(k(t)||typeof t!=`string`)&&process.exit(130),t}async function Cn(e,t){if(V())throw new xn;h(_);let n=await O({message:e,options:t.choices.map(({title:e,value:t})=>({label:e,value:t}))});return(k(n)||typeof n!=`string`)&&process.exit(130),n}const $=hn({logger:bn,userAgent:g,prompt:Sn,select:Cn,isNoDefaultValueProvidedError:e=>e instanceof xn});function wn(e){if(e?.scopes&&!nn(e.scopes))throw Error(`One or more of the requested scopes are not valid cf OAuth scopes.`);return $.login({compliance_region:nt()},{browser:e?.browser??!0,...e?.scopes&&{scopes:e.scopes},...e?.profile&&{profile:e.profile}})}function Tn(e){return $.logout(e)}function En(e){$.setProfile(e)}function Dn(){return $.getActiveProfile()}function On(){return gn({logger:bn})}function kn(e,t=process.cwd()){let n=On().resolve({profile:e,cwd:t});return En(n),n}function An(){return $.getOAuthTokenFromLocalState()}function jn(){return $.readAuthCredentials()?.oauth_token!==void 0}function Mn(){return $.readAuthCredentials()}function Nn(){return $.getCredentialStore().path()}export{it as C,Fe as D,ze as E,V as O,Ge as S,Be as T,nt as _,jn as a,Ze as b,yn as c,et as d,$e as f,Ke as g,U as h,An as i,Pe as k,Mn as l,at as m,Nn as n,wn as o,Qe as p,On as r,Tn as s,Dn as t,En as u,We as v,Ve as w,Ye as x,lt as y};
@@ -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(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled field`}).option(`name`,{type:`string`,description:`The name field`}).option(`skip-preflight-check`,{type:`boolean`,description:`The skipPreflightCheck 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 h={command:`create`,describe:`Create a new Workers Observability Telemetry Destination.`,builder:m,handler:async i=>{if(i.dryRun){l({command:`cf observability destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({configuration:{type:d(i[`configuration-type`],`configuration-type`,`text`),url:d(i[`configuration-url`],`configuration-url`,`text`)},enabled:i.enabled,name:d(i.name,`name`,`text`),skipPreflightCheck:i[`skip-preflight-check`]}):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.observability.destinations.create({...e,account_id:m})),{successLabel:`Created`});return}if(i[`configuration-type`]===void 0&&(i[`configuration-type`]=await n(`configuration-type`,`The configuration.type field`,[`logpush`])),i[`configuration-url`]===void 0&&(i[`configuration-url`]=await e(`configuration-url`,`The configuration.url field`)),i.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);i.name===void 0&&(i.name=await e(`name`,`The name field`));let h=s({configuration:{type:d(i[`configuration-type`],`configuration-type`,`text`),url:d(i[`configuration-url`],`configuration-url`,`text`)},enabled:i.enabled,name:d(i.name,`name`,`text`),skipPreflightCheck:i[`skip-preflight-check`]});c(await u(`Creating`,async()=>p.observability.destinations.create({...h,account_id:m})),{successLabel:`Created`})}};function g(e){return e.positional(`slug`,{type:`string`,description:`Slug`,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 <slug>`,describe:`Delete a Workers Observability Telemetry Destination.`,builder:g,handler:async e=>{if(e.dryRun){l({command:`cf observability destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/destinations/${e.slug==null?`<slug>`:encodeURIComponent(String(e.slug))}`,pathParams:{slug:String(e.slug??``)},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.observability.destinations.delete({account_id:o,slug:e.slug})),{successLabel:`Deleted`})}};function v(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List your Workers Observability Telemetry Destinations.`,builder:p(v),handler:async e=>{let n={page:e.page,perPage:e[`per-page`],order:e.order,orderBy:e[`order-by`]};if(e.dryRun){l({command:`cf observability destinations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/destinations`,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.observability.destinations.list({account_id:o,...n})),{successLabel:`Loaded`})}};function b(e){return e.positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).option(`configuration-url`,{type:`string`,description:`The configuration.url field`}).option(`enabled`,{type:`boolean`,description:`The enabled 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 x={command:`update <slug>`,describe:`Update an existing Workers Observability Telemetry Destination.`,builder:b,handler:async i=>{if(i.dryRun){l({command:`cf observability destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/destinations/${i.slug==null?`<slug>`:encodeURIComponent(String(i.slug))}`,pathParams:{slug:String(i.slug??``)},bodyKind:`json`,body:i.body===void 0?s({configuration:{type:d(i[`configuration-type`],`configuration-type`,`text`),url:d(i[`configuration-url`],`configuration-url`,`text`)},enabled:i.enabled}):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.observability.destinations.update({...e,account_id:m,slug:i.slug})),{successLabel:`Updated`});return}if(i[`configuration-type`]===void 0&&(i[`configuration-type`]=await n(`configuration-type`,`The configuration.type field`,[`logpush`])),i[`configuration-url`]===void 0&&(i[`configuration-url`]=await e(`configuration-url`,`The configuration.url field`)),i.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h=s({configuration:{type:d(i[`configuration-type`],`configuration-type`,`text`),url:d(i[`configuration-url`],`configuration-url`,`text`)},enabled:i.enabled});c(await u(`Updating`,async()=>p.observability.destinations.update({...h,account_id:m,slug:i.slug})),{successLabel:`Updated`})}},S={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const w={command:`create`,describe:`Persist query for later use.`,builder:C,handler:async n=>{if(n.dryRun){l({command:`cf observability queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`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.observability.queries.create({...e,account_id:p})),{successLabel:`Created`});return}n.description===void 0&&(n.description=await e(`description`,`The description field`)),n.name===void 0&&(n.name=await e(`name`,`Query name`)),n[`parameters-order-by-value`]===void 0&&(n[`parameters-order-by-value`]=await e(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});c(await u(`Creating`,async()=>i.observability.queries.create({...m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,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 E={command:`delete <queryId>`,describe:`Delete a saved query.`,builder:T,handler:async e=>{if(e.dryRun){l({command:`cf observability queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-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.
4
- `);return}c(await u(`Deleting`,async()=>n.observability.queries.delete({account_id:o,queryId:e[`query-id`]})),{successLabel:`Deleted`})}};function D(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`Query name`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Set the Datasets to query. Leave it empty to query all the datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Set a Flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Set a limit on the number of results / records returned by the query`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`The parameters.needle.isRegex field`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`The parameters.needle.matchCase field`}).option(`parameters-order-by-order`,{type:`string`,description:`Set the order of the results`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Configure which Calculation to order the results by.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specify the new contents of the query.`})}const O={command:`edit <queryId>`,describe:`Update saved query.`,builder:D,handler:async n=>{if(n.dryRun){l({command:`cf observability queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries/${n[`query-id`]==null?`<query-id>`:encodeURIComponent(String(n[`query-id`]))}`,pathParams:{"query-id":String(n[`query-id`]??``)},bodyKind:`json`,body:n.body===void 0?s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`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(`Updating`,async()=>i.observability.queries.edit({...e,account_id:p,queryId:n[`query-id`]})),{successLabel:`Updated`});return}n.description===void 0&&(n.description=await e(`description`,`The description field`)),n.name===void 0&&(n.name=await e(`name`,`Query name`)),n[`parameters-order-by-value`]===void 0&&(n[`parameters-order-by-value`]=await e(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=s({description:d(n.description,`description`,`text`),name:d(n.name,`name`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});c(await u(`Updating`,async()=>i.observability.queries.edit({...m,account_id:p,queryId:n[`query-id`]})),{successLabel:`Updated`})}};function k(e){return e.positional(`query-id`,{type:`string`,description:`QueryId`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <queryId>`,describe:`Retrieve a saved query.`,builder:k,handler:async e=>{if(e.dryRun){l({command:`cf observability queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries/${e[`query-id`]==null?`<query-id>`:encodeURIComponent(String(e[`query-id`]))}`,pathParams:{"query-id":String(e[`query-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.observability.queries.get({account_id:i,queryId:e[`query-id`]})),{successLabel:`Loaded`})}};function j(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`PerPage`}).option(`order`,{type:`string`,description:`Order`,choices:[`asc`,`desc`]}).option(`order-by`,{type:`string`,description:`OrderBy`,choices:[`created`,`updated`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`List saved queries.`,builder:p(j),handler:async e=>{let n={page:e.page,perPage:e[`per-page`],order:e.order,orderBy:e[`order-by`]};if(e.dryRun){l({command:`cf observability queries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/queries`,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.observability.queries.list({account_id:o,...n})),{successLabel:`Loaded`})}},N={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(w).command(E).command(O).command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`from`,{type:`number`,description:`The from field`}).option(`key-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`key-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`limit`,{type:`number`,description:`Advanced usage: set limit=1000+ to retrieve comprehensive key options without needing additional filtering.`}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`to`,{type:`number`,description:`The to field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Find keys in your telemetry events matching a specific filter or needle.`})}const F={command:`keys`,describe:`List all the keys in your telemetry events.`,builder:P,handler:async e=>{if(e.dryRun){l({command:`cf observability telemetry keys`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/telemetry/keys`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({datasets:e.datasets,from:e.from,keyNeedle:{isRegex:e[`key-needle-is-regex`],matchCase:e[`key-needle-match-case`]},limit:e.limit,needle:{isRegex:e[`needle-is-regex`],matchCase:e[`needle-match-case`]},to:e.to}):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.observability.telemetry.keys({...t,account_id:i})),{successLabel:`Created`});return}let d=s({datasets:e.datasets,from:e.from,keyNeedle:{isRegex:e[`key-needle-is-regex`],matchCase:e[`key-needle-match-case`]},limit:e.limit,needle:{isRegex:e[`needle-is-regex`],matchCase:e[`needle-match-case`]},to:e.to});c(await u(`Creating`,async()=>n.observability.telemetry.keys({...d,account_id:i})),{successLabel:`Created`})}};function I(e){return e.option(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`dry`,{type:`boolean`,description:`When true, executes the query without persisting the results. Useful for validation or previewing.`,default:!1}).option(`granularity`,{type:`number`,description:`Number of time-series buckets. Only used when view is 'calculations'. Omit to let the system auto-detect an appropriate granularity.`}).option(`ignore-series`,{type:`boolean`,description:`When true, omits time-series data from the response and returns only aggregated values. Reduces response size when series are not needed.`,default:!1}).option(`limit`,{type:`number`,description:`Maximum number of events to return when view is 'events'. Also controls the number of group-by rows when view is 'calculations'.`,default:50}).option(`offset`,{type:`string`,description:`Cursor for pagination in event, trace, and invocation views. Pass the $metadata.id of the last returned item to fetch the next page.`}).option(`offset-by`,{type:`number`,description:`Numeric offset for paginating grouped/pattern results (top-N lists). Use together with limit. Not used by cursor-based pagination.`}).option(`offset-direction`,{type:`string`,description:`Pagination direction: 'next' for forward, 'prev' for backward.`}).option(`parameters-datasets`,{type:`string`,array:!0,description:`Datasets to query. Leave empty to query all available datasets.`}).option(`parameters-filter-combination`,{type:`string`,description:`Logical operator for combining top-level filters: 'and' (all must match) or 'or' (any must match). Defaults to 'and'.`,choices:[`and`,`or`,`AND`,`OR`]}).option(`parameters-limit`,{type:`number`,description:`Maximum number of group-by rows to return in calculation results. A value of 10 is a sensible default for most use cases.`}).option(`parameters-needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`parameters-needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`parameters-order-by-order`,{type:`string`,description:`Sort direction: 'asc' for ascending, 'desc' for descending.`,choices:[`asc`,`desc`]}).option(`parameters-order-by-value`,{type:`string`,description:`Alias of the calculation to order results by. Must match the alias (or operator) of a calculation in the query.`}).option(`query-id`,{type:`string`,description:`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`}).option(`timeframe-from`,{type:`number`,description:`Start timestamp for the query timeframe (Unix timestamp in milliseconds)`}).option(`timeframe-to`,{type:`number`,description:`End timestamp for the query timeframe (Unix timestamp in milliseconds)`}).option(`view`,{type:`string`,description:`Controls the shape of the response. 'events': individual log lines matching the query. 'calculations': aggregated metrics (count, avg, p99, etc.) with optional group-by breakdowns and time-series. 'invocations': events grouped by request ID. 'traces': distributed trace summaries. 'agents': Durable Object agent summaries.`,choices:[`traces`,`events`,`calculations`,`invocations`,`requests`,`agents`],default:`calculations`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query your observability events, requests, and traces to build visualizations and identify insights.`}).check(e=>{if([`parameters-datasets`,`parameters-filter-combination`,`parameters-limit`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`parameters-order-by-value`].some(t=>e[t]!==void 0)){let t=[`parameters-order-by-value`].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 --parameters-* flag is set`)}return!0})}const L={command:`query`,describe:`Run a temporary or saved query.`,builder:I,handler:async n=>{if(n.dryRun){l({command:`cf observability telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({chart:n.chart,compare:n.compare,dry:n.dry,granularity:n.granularity,ignoreSeries:n[`ignore-series`],limit:n.limit,offset:d(n.offset,`offset`,`text`),offsetBy:n[`offset-by`],offsetDirection:d(n[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(n[`query-id`],`query-id`,`text`),timeframe:{from:n[`timeframe-from`],to:n[`timeframe-to`]},view:d(n.view,`view`,`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(`Loading`,async()=>i.observability.telemetry.query({...e,account_id:p})),{successLabel:`Loaded`});return}if(n[`query-id`]===void 0&&(n[`query-id`]=await e(`query-id`,`Identifier for the query. When parameters are omitted, this ID is used to load a previously saved query's parameters. When providing parameters inline, pass any identifier (e.g. an ad-hoc ID).`)),n[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(n[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=s({chart:n.chart,compare:n.compare,dry:n.dry,granularity:n.granularity,ignoreSeries:n[`ignore-series`],limit:n.limit,offset:d(n.offset,`offset`,`text`),offsetBy:n[`offset-by`],offsetDirection:d(n[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:n[`parameters-datasets`],filterCombination:d(n[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:n[`parameters-limit`],needle:{isRegex:n[`parameters-needle-is-regex`],matchCase:n[`parameters-needle-match-case`]},orderBy:{order:d(n[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:d(n[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:d(n[`query-id`],`query-id`,`text`),timeframe:{from:n[`timeframe-from`],to:n[`timeframe-to`]},view:d(n.view,`view`,`text`)});c(await u(`Loading`,async()=>i.observability.telemetry.query({...m,account_id:p})),{successLabel:`Loaded`})}};function R(e){return e.option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`key`,{type:`string`,description:`The key field`}).option(`limit`,{type:`number`,description:`The limit field`,default:50}).option(`needle-is-regex`,{type:`boolean`,description:`When true, treats the value as a regular expression (RE2 syntax).`}).option(`needle-match-case`,{type:`boolean`,description:`When true, performs a case-sensitive search. Defaults to case-insensitive.`}).option(`timeframe-from`,{type:`number`,description:`The timeframe.from field`}).option(`timeframe-to`,{type:`number`,description:`The timeframe.to field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`string`,`boolean`,`number`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Retrieve values from your telemetry events.`})}const z={command:`values`,describe:`List unique values found in your events.`,builder:R,handler:async i=>{if(i.dryRun){l({command:`cf observability telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({datasets:i.datasets,key:d(i.key,`key`,`text`),limit:i.limit,needle:{isRegex:i[`needle-is-regex`],matchCase:i[`needle-match-case`]},timeframe:{from:i[`timeframe-from`],to:i[`timeframe-to`]},type:d(i.type,`type`,`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.observability.telemetry.values({...e,account_id:m})),{successLabel:`Created`});return}if(i.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(i.key===void 0&&(i.key=await e(`key`,`The key field`)),i[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(i[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);i.type===void 0&&(i.type=await n(`type`,`The type field`,[`string`,`boolean`,`number`]));let h=s({datasets:i.datasets,key:d(i.key,`key`,`text`),limit:i.limit,needle:{isRegex:i[`needle-is-regex`],matchCase:i[`needle-match-case`]},timeframe:{from:i[`timeframe-from`],to:i[`timeframe-to`]},type:d(i.type,`type`,`text`)});c(await u(`Creating`,async()=>p.observability.telemetry.values({...h,account_id:m})),{successLabel:`Created`})}},B={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(F).command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`observability`,describe:`observability`,builder:e=>e.command(S).command(N).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
@@ -1,41 +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";import{t as f}from"./cli-types-BeyOc81z.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:p,handler:async e=>{if(e.dryRun){c({command:`cf organizations account-organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/organizations`,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.organizations.accountOrganizations.list({account_id:a})),{successLabel:`Loaded`})}},h={command:`account-organizations`,describe:`Operations for account-organizations`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`References an Organization in the Cloudflare data model.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].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 --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].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 --profile-* flag is set`)}return!0})}const _={command:`create`,describe:`Create a new organization for a user. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:g,handler:async t=>{if(t.dryRun){c({command:`cf organizations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`text`),parent:{id:u(t[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(t[`profile-business-address`],`profile-business-address`,`text`),business_email:u(t[`profile-business-email`],`profile-business-email`,`text`),business_name:u(t[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(t[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(t[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(t.body)});return}let n=await i(t);if(t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.organizations.create({...e})),{successLabel:`Created`});return}t.name===void 0&&(t.name=await e(`name`,`The name field`));let r=o({name:u(t.name,`name`,`text`),parent:{id:u(t[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(t[`profile-business-address`],`profile-business-address`,`text`),business_email:u(t[`profile-business-email`],`profile-business-email`,`text`),business_name:u(t[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(t[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(t[`profile-external-metadata`],`profile-external-metadata`,`text`)}});s(await l(`Creating`,async()=>n.organizations.create({...r})),{successLabel:`Created`})}};function v(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,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 y={command:`delete <organization-id>`,describe:`Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/) **Access Control:** Restricted to enterprise organizations.`,builder:v,handler:async e=>{if(e.dryRun){c({command:`cf organizations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await i(e);if(!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}s(await l(`Deleting`,async()=>t.organizations.delete({organization_id:e[`organization-id`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <organization-id>`,describe:`Retrieve the details of a certain organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:b,handler:async e=>{if(e.dryRun){c({command:`cf organizations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await i(e);s(await l(`Loading`,async()=>t.organizations.get({organization_id:e[`organization-id`]})),{successLabel:`Loaded`})}};function S(e){return e.option(`id`,{type:`string`,description:`Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements
4
- by repeating the query value.`}).option(`name`,{type:`string`,description:`(case-sensitive) Filter the list of organizations to where the name is equal to a
5
- particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name starts with a
6
- particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name ends with a particular
7
- string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name contains a particular
8
- string.`}).option(`containing-account`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
9
- account.`}).option(`containing-user`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
10
- user.
11
-
12
- IMPORTANT: Just because an organization "contains" a user is not a
13
- representation of any authorization or privilege to manage any resources
14
- therein. An organization "containing" a user simply means the user is managed by
15
- that organization.`}).option(`containing-organization`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
16
- organization.`}).option(`parent-id`,{type:`string`,description:`Filter the list of organizations to the ones that are a sub-organization
17
- of the specified organization.
18
-
19
- "null" is a valid value to provide for this parameter. It means "where
20
- an organization has no parent (i.e. it is a 'root' organization)."`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
21
- provided will retrieve the next page.
22
-
23
- Parameters used to filter the retrieved list must remain in subsequent
24
- requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Retrieve a list of organizations a particular user has access to. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f(S),handler:async e=>{let t={id:e.id,name:e.name,"name.startsWith":e[`name-starts-with`],"name.endsWith":e[`name-ends-with`],"name.contains":e[`name-contains`],"containing.account":e[`containing-account`],"containing.user":e[`containing-user`],"containing.organization":e[`containing-organization`],"parent.id":e[`parent-id`],page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){c({command:`cf organizations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.organizations.list(t)),{successLabel:`Loaded`})}};function w(e){return e.positional(`organization-id`,{type:`string`,description:`The unique id that identifies the organization.`,demandOption:!0}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:`Filters by the actor context.`}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor's user ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an organization.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:`Filters out audit logs by the actor context.`}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor's user ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an organization.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <organization-id>`,describe:`Gets a list of audit logs for an organization.`,builder:f(w),handler:async e=>{let t={action_result:e[`action-result`],action_type:e[`action-type`],actor_context:e[`actor-context`],actor_email:e[`actor-email`],actor_id:e[`actor-id`],actor_ip_address:e[`actor-ip-address`],actor_token_id:e[`actor-token-id`],actor_token_name:e[`actor-token-name`],actor_type:e[`actor-type`],id:e.id,raw_cf_ray_id:e[`raw-cf-ray-id`],raw_method:e[`raw-method`],raw_status_code:e[`raw-status-code`],raw_uri:e[`raw-uri`],resource_id:e[`resource-id`],resource_product:e[`resource-product`],resource_type:e[`resource-type`],resource_scope:e[`resource-scope`],"action_result.not":e[`action-result-not`],"action_type.not":e[`action-type-not`],"actor_context.not":e[`actor-context-not`],"actor_email.not":e[`actor-email-not`],"actor_id.not":e[`actor-id-not`],"actor_ip_address.not":e[`actor-ip-address-not`],"actor_token_id.not":e[`actor-token-id-not`],"actor_token_name.not":e[`actor-token-name-not`],"actor_type.not":e[`actor-type-not`],"id.not":e[`id-not`],"raw_cf_ray_id.not":e[`raw-cf-ray-id-not`],"raw_method.not":e[`raw-method-not`],"raw_status_code.not":e[`raw-status-code-not`],"raw_uri.not":e[`raw-uri-not`],"resource_id.not":e[`resource-id-not`],"resource_product.not":e[`resource-product-not`],"resource_type.not":e[`resource-type-not`],"resource_scope.not":e[`resource-scope-not`],since:e.since,before:e.before,direction:e.direction,limit:e.limit,cursor:e.cursor};if(e.dryRun){c({command:`cf organizations logs audit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/logs/audit`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.organizations.logs.audit.get({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},E={command:`audit`,describe:`Logs operations`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,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 k={command:`create <organization-id>`,describe:`Batch create multiple memberships that grant access to a specific Organization.`,builder:O,handler:async e=>{if(e.dryRun){c({command:`cf organizations members-batch-create create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members:batchCreate`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let t=await i(e);if(e.body){let n=a(e.body);s(await l(`Creating`,async()=>t.organizations.membersBatchCreate.create({...n,organization_id:e[`organization-id`]})),{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.`)}},A={command:`members-batch-create`,describe:`Operations for members-batch-create`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`member-status`,{type:`string`,description:`The member.status field`,choices:[`active`,`canceled`]}).option(`member-user-email`,{type:`string`,description:`The member.user.email 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 M={command:`create <organization-id>`,describe:`Create a membership that grants access to a specific Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:j,handler:async t=>{if(t.dryRun){c({command:`cf organizations members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${t[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(t[`organization-id`]))}/members`,pathParams:{"organization-id":String(t[`organization-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({member:{status:u(t[`member-status`],`member-status`,`text`),user:{email:u(t[`member-user-email`],`member-user-email`,`text`)}}}):a(t.body)});return}let n=await i(t);if(t.body){let e=a(t.body);s(await l(`Creating`,async()=>n.organizations.members.create({...e,organization_id:t[`organization-id`]})),{successLabel:`Created`});return}t[`member-user-email`]===void 0&&(t[`member-user-email`]=await e(`member-user-email`,`The member.user.email field`));let r=o({member:{status:u(t[`member-status`],`member-status`,`text`),user:{email:u(t[`member-user-email`],`member-user-email`,`text`)}}});s(await l(`Creating`,async()=>n.organizations.members.create({...r,organization_id:t[`organization-id`]})),{successLabel:`Created`})}};function N(e){return e.positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization 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}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`delete <member-id>`,describe:`Delete a membership to a particular Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:N,handler:async e=>{if(e.dryRun){c({command:`cf organizations members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-id":String(e[`member-id`]??``)},bodyKind:`json`,body:e.body===void 0?void 0:a(e.body)});return}let t=await i(e);if(!await r({force:!!e.force})){process.stderr.write(`Aborted.
25
- `);return}if(e.body){let n=a(e.body);s(await l(`Deleting`,async()=>t.organizations.members.delete({...n,organization_id:e[`organization-id`],member_id:e[`member-id`]})),{successLabel:`Deleted`});return}s(await l(`Deleting`,async()=>t.organizations.members.delete({organization_id:e[`organization-id`],member_id:e[`member-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <member-id>`,describe:`Retrieve a single membership from an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:F,handler:async e=>{if(e.dryRun){c({command:`cf organizations members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members/${e[`member-id`]==null?`<member-id>`:encodeURIComponent(String(e[`member-id`]))}`,pathParams:{"organization-id":String(e[`organization-id`]??``),"member-id":String(e[`member-id`]??``)},bodyKind:`none`});return}let t=await i(e);s(await l(`Loading`,async()=>t.organizations.members.get({organization_id:e[`organization-id`],member_id:e[`member-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter the list of memberships by membership status.`}).option(`user-email`,{type:`string`,description:`Filter the list of memberships for a specific email.`}).option(`user-email-contains`,{type:`string`,description:`Filter the list of memberships for a specific email that contains a substring.`}).option(`user-email-starts-with`,{type:`string`,description:`Filter the list of memberships for a specific email that starts with a substring.`}).option(`user-email-ends-with`,{type:`string`,description:`Filter the list of memberships for a specific email that ends with a substring.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
26
- provided will retrieve the next page.
27
-
28
- Parameters used to filter the retrieved list must remain in subsequent
29
- requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`List memberships for an Organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f(L),handler:async e=>{let t={status:e.status,"user.email":e[`user-email`],"user.email.contains":e[`user-email-contains`],"user.email.startsWith":e[`user-email-starts-with`],"user.email.endsWith":e[`user-email-ends-with`],page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){c({command:`cf organizations members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/members`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.organizations.members.list({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},z={command:`members`,describe:`Operations for members`,builder:e=>e.command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname is equal to
30
- a particular string.`}).option(`account-pubname-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname starts with
31
- a particular string.`}).option(`account-pubname-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname ends with
32
- a particular string.`}).option(`account-pubname-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname contains
33
- a particular string.`}).option(`name`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name is equal to a
34
- particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name starts with a
35
- particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name ends with a particular
36
- string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name contains a particular
37
- string.`}).option(`order-by`,{type:`string`,description:"Field to order results by. Currently supported values: `account_name`.\nWhen not specified, results are ordered by internal account ID.",choices:[`account_name`]}).option(`direction`,{type:`string`,description:"Sort direction for the order_by field. Valid values: `asc`, `desc`.\nDefaults to `asc` when order_by is specified.",choices:[`asc`,`desc`]}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
38
- provided will retrieve the next page.
39
-
40
- Parameters used to filter the retrieved list must remain in subsequent
41
- requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get <organization-id>`,describe:`Retrieve a list of accounts that belong to a specific organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:f(B),handler:async e=>{let t={account_pubname:e[`account-pubname`],"account_pubname.startsWith":e[`account-pubname-starts-with`],"account_pubname.endsWith":e[`account-pubname-ends-with`],"account_pubname.contains":e[`account-pubname-contains`],name:e.name,"name.startsWith":e[`name-starts-with`],"name.endsWith":e[`name-ends-with`],"name.contains":e[`name-contains`],order_by:e[`order-by`],direction:e.direction,page_token:e[`page-token`],page_size:e[`page-size`]};if(e.dryRun){c({command:`cf organizations organization-accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.organizations.organizationAccounts.get({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},H={command:`organization-accounts`,describe:`Operations for organization-accounts`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get <organization-id>`,describe:`Get an organizations profile if it exists. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:U,handler:async e=>{if(e.dryRun){c({command:`cf organizations organization-profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/profile`,pathParams:{"organization-id":String(e[`organization-id`]??``)},bodyKind:`none`});return}let t=await i(e);s(await l(`Loading`,async()=>t.organizations.organizationProfile.get({organization_id:e[`organization-id`]})),{successLabel:`Loaded`})}};function G(e){return e.positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`update <organization-id>`,describe:`Modify organization profile. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:G,handler:async t=>{if(t.dryRun){c({command:`cf organizations organization-profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${t[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(t[`organization-id`]))}/profile`,pathParams:{"organization-id":String(t[`organization-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({business_address:u(t[`business-address`],`business-address`,`text`),business_email:u(t[`business-email`],`business-email`,`text`),business_name:u(t[`business-name`],`business-name`,`text`),business_phone:u(t[`business-phone`],`business-phone`,`text`),external_metadata:u(t[`external-metadata`],`external-metadata`,`text`)}):a(t.body)});return}let n=await i(t);if(t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.organizations.organizationProfile.update({body:e,organization_id:t[`organization-id`]})),{successLabel:`Updated`});return}t[`business-address`]===void 0&&(t[`business-address`]=await e(`business-address`,`The business_address field`)),t[`business-email`]===void 0&&(t[`business-email`]=await e(`business-email`,`The business_email field`)),t[`business-name`]===void 0&&(t[`business-name`]=await e(`business-name`,`The business_name field`)),t[`business-phone`]===void 0&&(t[`business-phone`]=await e(`business-phone`,`The business_phone field`)),t[`external-metadata`]===void 0&&(t[`external-metadata`]=await e(`external-metadata`,`The external_metadata field`));let r=o({business_address:u(t[`business-address`],`business-address`,`text`),business_email:u(t[`business-email`],`business-email`,`text`),business_name:u(t[`business-name`],`business-name`,`text`),business_phone:u(t[`business-phone`],`business-phone`,`text`),external_metadata:u(t[`external-metadata`],`external-metadata`,`text`)});s(await l(`Updating`,async()=>n.organizations.organizationProfile.update({body:r,organization_id:t[`organization-id`]})),{successLabel:`Updated`})}},q={command:`organization-profile`,describe:`Operations for organization-profile`,builder:e=>e.command(W).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`Lists all organization shares.`,builder:f(J),handler:async e=>{let t={status:e.status,kind:e.kind,target_type:e[`target-type`],resource_types:e[`resource-types`],order:e.order,direction:e.direction,page:e.page,per_page:e[`per-page`]};if(e.dryRun){c({command:`cf organizations shares list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${e[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(e[`organization-id`]))}/shares`,pathParams:{"organization-id":String(e[`organization-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e);s(await l(`Loading`,async()=>n.organizations.shares.list({organization_id:e[`organization-id`],...t})),{successLabel:`Loaded`})}},X={command:`shares`,describe:`Operations for shares`,builder:e=>e.command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Z(e){return e.positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new details of the organization. Only accepts updates to "name" currently.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].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 --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].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 --profile-* flag is set`)}return!0})}const Q={command:`update <organization-id>`,describe:`Modify organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:Z,handler:async t=>{if(t.dryRun){c({command:`cf organizations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${t[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(t[`organization-id`]))}`,pathParams:{"organization-id":String(t[`organization-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({name:u(t.name,`name`,`text`),parent:{id:u(t[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(t[`profile-business-address`],`profile-business-address`,`text`),business_email:u(t[`profile-business-email`],`profile-business-email`,`text`),business_name:u(t[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(t[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(t[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(t.body)});return}let n=await i(t);if(t.body){let e=a(t.body);s(await l(`Updating`,async()=>n.organizations.update({body:e,organization_id:t[`organization-id`]})),{successLabel:`Updated`});return}t.name===void 0&&(t.name=await e(`name`,`The name field`));let r=o({name:u(t.name,`name`,`text`),parent:{id:u(t[`parent-id`],`parent-id`,`text`)},profile:{business_address:u(t[`profile-business-address`],`profile-business-address`,`text`),business_email:u(t[`profile-business-email`],`profile-business-email`,`text`),business_name:u(t[`profile-business-name`],`profile-business-name`,`text`),business_phone:u(t[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:u(t[`profile-external-metadata`],`profile-external-metadata`,`text`)}});s(await l(`Updating`,async()=>n.organizations.update({body:r,organization_id:t[`organization-id`]})),{successLabel:`Updated`})}},$={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(_).command(y).command(x).command(C).command(Q).command(h).command(D).command(z).command(A).command(H).command(q).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{E as e,T 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"./cli-types-BeyOc81z.mjs";function d(e){return e.option(`csr`,{type:`string`,description:`The Certificate Signing Request (CSR). Must be newline-encoded.`}).option(`hostnames`,{type:`string`,array:!0,description:"Array of hostnames or wildcard names bound to the certificate.\nHostnames must be fully qualified domain names (FQDNs) belonging to zones on your account (e.g., `example.com` or `sub.example.com`). Wildcards are supported only as a `*.` prefix for a single level (e.g., `*.example.com`). Double wildcards (`*.*.example.com`) and interior wildcards (`foo.*.example.com`) are not allowed. The wildcard suffix must be a multi-label domain (`*.example.com` is valid, but `*.com` is not). Unicode/IDN hostnames are accepted and automatically converted to punycode."}).option(`request-type`,{type:`string`,description:`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,choices:[`origin-rsa`,`origin-ecc`,`keyless-certificate`]}).option(`requested-validity`,{type:`number`,description:`The number of days for which the certificate should be valid.`,default:5475}).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 f={command:`create`,describe:`Create an Origin CA certificate. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:d,handler:async n=>{if(n.dryRun){s({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:n.body===void 0?a({csr:l(n.csr,`csr`,`text`),hostnames:n.hostnames,request_type:l(n[`request-type`],`request-type`,`text`),requested_validity:n[`requested-validity`]}):i(n.body)});return}let u=await r(n);if(n.body){let e=i(n.body);o(await c(`Creating`,async()=>u.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(n.csr===void 0&&(n.csr=await e(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),n.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);n[`request-type`]===void 0&&(n[`request-type`]=await t(`request-type`,`Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).`,[`origin-rsa`,`origin-ecc`,`keyless-certificate`]));let d=a({csr:l(n.csr,`csr`,`text`),hostnames:n.hostnames,request_type:l(n[`request-type`],`request-type`,`text`),requested_validity:n[`requested-validity`]});o(await c(`Creating`,async()=>u.originCaCertificates.create({...d})),{successLabel:`Created`})}};function p(e){return e.positional(`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 m={command:`delete <certificate-id>`,describe:`Revoke an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:p,handler:async e=>{if(e.dryRun){s({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let t=await r(e);if(!await n({force:!!e.force})){process.stderr.write(`Aborted.
3
- `);return}o(await c(`Deleting`,async()=>t.originCaCertificates.delete({certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function h(e){return e.positional(`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 g={command:`get <certificate-id>`,describe:`Get an existing Origin CA certificate by its serial number. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:h,handler:async e=>{if(e.dryRun){s({command:`cf origin-ca-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`certificate-id`]??``)},bodyKind:`none`});return}let t=await r(e);o(await c(`Loading`,async()=>t.originCaCertificates.get({certificate_id:e[`certificate-id`]})),{successLabel:`Loaded`})}};function _(e){return e.option(`zone-id`,{type:`string`,description:`Identifier.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`List all existing Origin CA certificates for a given zone. You can use an Origin CA Key as your User Service Key or an API token when calling this endpoint ([see above](#requests)).`,builder:u(_),handler:async e=>{let t={zone_id:e[`zone-id`],page:e.page,per_page:e[`per-page`],limit:e.limit,offset:e.offset};if(e.dryRun){s({command:`cf origin-ca-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},query:t,bodyKind:`none`});return}let n=await r(e);o(await c(`Loading`,async()=>n.originCaCertificates.list(t)),{successLabel:`Loaded`})}},y={command:`origin-ca-certificates`,describe:`Free Cloudflare-signed certificates installed on your origin server for Full (strict) SSL mode`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{T as e,x as t}from"./oauth-Bk-F-tIO.mjs";import{n}from"./auth-CSC4yhEJ.mjs";import{n as r,t as i}from"./body-parser-DWSy7uZ8.mjs";import{t as a}from"./output-B6fBFRqe.mjs";import{n as o,t as s}from"./progress-DrDErV9w.mjs";import{n as c}from"./input-validation-_fMCApaH.mjs";function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised.`,builder:l,handler:async e=>{if(e.dryRun){o({command:`cf origin-post-quantum-encryption get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let r=await n(e),i=await t({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,a(await s(`Loading`,async()=>r.originPostQuantumEncryption.get({zone_id:i})),{successLabel:`Loaded`})}};function d(e){return e.option(`value`,{type:`string`,description:`Value of the Origin Post Quantum Encryption Setting.`,choices:[`preferred`,`supported`,`off`]}).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 f={command:`update`,describe:`Instructs Cloudflare to use Post-Quantum (PQ) key agreement algorithms when connecting to your origin. Preferred instructs Cloudflare to opportunistically send a Post-Quantum keyshare in the first message to the origin (for fastest connections when the origin supports and prefers PQ), supported means that PQ algorithms are advertised but only used when requested by the origin, and off means that PQ algorithms are not advertised.`,builder:d,handler:async l=>{if(l.dryRun){o({command:`cf origin-post-quantum-encryption update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?i({value:c(l.value,`value`,`text`)}):r(l.body)});return}let u=await n(l),d=await t({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=r(l.body);a(await s(`Updating`,async()=>u.originPostQuantumEncryption.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await e(`value`,`Value of the Origin Post Quantum Encryption Setting.`,[`preferred`,`supported`,`off`]));let f=i({value:c(l.value,`value`,`text`)});a(await s(`Updating`,async()=>u.originPostQuantumEncryption.update({...f,zone_id:d})),{successLabel:`Updated`})}},p={command:`origin-post-quantum-encryption`,describe:`Enable post-quantum key exchange for connections between Cloudflare and your origin server`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,4 +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(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of associations per page.`}).option(`status`,{type:`string`,description:`Filter associations by status. Use comma-separated values to filter by multiple statuses, or "all" to include every status. Defaults to "active" if not provided.`,choices:[`active`,`pending_deployment`,`pending_deletion`,`deleted`,`deployment_timed_out`,`deletion_timed_out`,`all`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`list`,describe:`List certificate ID - hostname associations for the given zone. Shows which hostnames are associated to which certificates for authenticated origin pulls.`,builder:d(f),handler:async e=>{let t={page:e.page,per_page:e[`per-page`],status:e.status};if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-associations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,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.originTlsClientAuth.hostnameAssociations.list({zone_id:a,...t})),{successLabel:`Loaded`})}},m={command:`hostname-associations`,describe:`Operations for hostname-associations`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`certificate`,{type:`string`,description:`The hostname certificate.`}).option(`private-key`,{type:`string`,description:`The hostname certificate's private key.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Upload a certificate to be used for client authentication on a hostname. 10 hostname certificates per zone are allowed.`,builder:h,handler:async t=>{if(t.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({certificate:u(t.certificate,`certificate`,`text`),private_key:u(t[`private-key`],`private-key`,`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.originTlsClientAuth.hostnameCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await e(`certificate`,`The hostname certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await e(`private-key`,`The hostname certificate's private key.`,{kind:`secret`}));let f=o({certificate:u(t.certificate,`certificate`,`text`),private_key:u(t[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>r.originTlsClientAuth.hostnameCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function _(e){return e.positional(`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 v={command:`delete <certificate-id>`,describe:"Removes a client certificate used for authenticated origin pulls on a specific hostname. Note: Before deleting the certificate, you must first invalidate the hostname for client authentication by sending a PUT request with `enabled` set to null. After invalidating the association, the certificate can be safely deleted.",builder:_,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`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.
3
- `);return}s(await l(`Deleting`,async()=>r.originTlsClientAuth.hostnameCertificates.delete({zone_id:a,certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function y(e){return e.positional(`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 b={command:`get <certificate-id>`,describe:`Get the certificate by ID to be used for client authentication on a hostname.`,builder:y,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`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.originTlsClientAuth.hostnameCertificates.get({zone_id:r,certificate_id:e[`certificate-id`]})),{successLabel:`Loaded`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:`Lists all client certificates configured for per-hostname authenticated origin pulls on the zone.`,builder:x,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostname-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates`,pathParams:{"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.originTlsClientAuth.hostnameCertificates.list({zone_id:r})),{successLabel:`Loaded`})}},C={command:`hostname-certificates`,describe:`Operations for hostname-certificates`,builder:e=>e.command(g).command(v).command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`hostname`,{type:`string`,description:`The hostname on the origin for which the client certificate uploaded will be used.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <hostname>`,describe:`Retrieves the client certificate authentication status for a specific hostname, showing whether authenticated origin pulls are enabled.`,builder:w,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{hostname:String(e.hostname??``),"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.originTlsClientAuth.hostnames.get({zone_id:r,hostname:e.hostname})),{successLabel:`Loaded`})}};function E(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 D={command:`update`,describe:`Associate a hostname to a certificate and enable, disable or invalidate the association. If disabled, client certificate will not be sent to the hostname even if activated at the zone level. 100 maximum associations on a single certificate are allowed. Note: Use a null value for parameter *enabled* to invalidate the association.`,builder:E,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth hostnames update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,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.originTlsClientAuth.hostnames.update({...n,zone_id:o})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>r(t,`PUT`,`/zones/${e.zoneId}/origin_tls_client_auth/hostnames`)),{successLabel:`Updated`})}},O={command:`hostnames`,describe:`Operations for hostnames`,builder:e=>e.command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get`,describe:`Get whether zone-level authenticated origin pulls is enabled or not. It is false by default.`,builder:k,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"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.originTlsClientAuth.settings.get({zone_id:r})),{successLabel:`Loaded`})}};function j(e){return e.option(`enabled`,{type:`boolean`,description:`Indicates whether zone-level authenticated origin pulls is enabled.`}).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`,describe:`Enable or disable zone-level authenticated origin pulls. 'enabled' should be set true either before/after the certificate is uploaded to see the certificate in use.`,builder:j,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?o({enabled:e.enabled}):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.originTlsClientAuth.settings.update({...n,zone_id:r})),{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({enabled:e.enabled});s(await l(`Updating`,async()=>t.originTlsClientAuth.settings.update({...u,zone_id:r})),{successLabel:`Updated`})}},N={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`certificate`,{type:`string`,description:`The zone's leaf certificate.`}).option(`private-key`,{type:`string`,description:`The zone's private key.`}).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 F={command:`create`,describe:`Upload your own certificate you want Cloudflare to use for edge-to-origin communication to override the shared certificate. Please note that it is important to keep only one certificate active. Also, make sure to enable zone-level authenticated origin pulls by making a PUT call to settings endpoint to see the uploaded certificate in use.`,builder:P,handler:async t=>{if(t.dryRun){c({command:`cf origin-tls-client-auth zone-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?o({certificate:u(t.certificate,`certificate`,`text`),private_key:u(t[`private-key`],`private-key`,`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.originTlsClientAuth.zoneCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await e(`certificate`,`The zone's leaf certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await e(`private-key`,`The zone's private key.`,{kind:`secret`}));let f=o({certificate:u(t.certificate,`certificate`,`text`),private_key:u(t[`private-key`],`private-key`,`text`)});s(await l(`Creating`,async()=>r.originTlsClientAuth.zoneCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function I(e){return e.positional(`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 L={command:`delete <certificate-id>`,describe:`Removes a client certificate used for zone-level authenticated origin pulls.`,builder:I,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth zone-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`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.originTlsClientAuth.zoneCertificates.delete({zone_id:a,certificate_id:e[`certificate-id`]})),{successLabel:`Deleted`})}};function R(e){return e.positional(`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 z={command:`get <certificate-id>`,describe:`Retrieves details for a specific client certificate used in zone-level authenticated origin pulls.`,builder:R,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth zone-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth/${e[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(e[`certificate-id`]))}`,pathParams:{"certificate-id":String(e[`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.originTlsClientAuth.zoneCertificates.get({zone_id:r,certificate_id:e[`certificate-id`]})),{successLabel:`Loaded`})}};function B(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`list`,describe:`Lists all client certificates configured for zone-level authenticated origin pulls.`,builder:B,handler:async e=>{if(e.dryRun){c({command:`cf origin-tls-client-auth zone-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/origin_tls_client_auth`,pathParams:{"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.originTlsClientAuth.zoneCertificates.list({zone_id:r})),{successLabel:`Loaded`})}},H={command:`zone-certificates`,describe:`Operations for zone-certificates`,builder:e=>e.command(F).command(L).command(z).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},U={command:`origin-tls-client-auth`,describe:`Authenticated Origin Pulls — require Cloudflare to present a client certificate when connecting to your origin`,builder:e=>e.command(m).command(C).command(O).command(N).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};