cf 0.9.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (363) hide show
  1. package/README.md +20 -5
  2. package/dist/_meta/agent-context.json +46 -39
  3. package/dist/_meta/commands.json +9358 -10581
  4. package/dist/_meta/hand-written-commands.json +784 -0
  5. package/dist/_meta/schemas.json +14870 -14667
  6. package/dist/abuse-reports-sDBTV0qZ.mjs +8 -0
  7. package/dist/{access-CxyW_sIW.mjs → access-DcNzuCue.mjs} +1 -1
  8. package/dist/account-BX90zXn5.mjs +2 -0
  9. package/dist/account-tags-Bz3JG5hI.mjs +9 -0
  10. package/dist/accounts-DCuW3xyZ.mjs +28 -0
  11. package/dist/{acm-CHacxa3s.mjs → acm-zjfShZLS.mjs} +1 -1
  12. package/dist/{addressing-BnqNmmYN.mjs → addressing-DORQ64Ux.mjs} +11 -11
  13. package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-BgPR_aQr.mjs} +1 -1
  14. package/dist/agent-memory-C0hAUMeC.mjs +6 -0
  15. package/dist/ai-BpEBGMT2.mjs +5 -0
  16. package/dist/ai-audit-DnU3vn3E.mjs +2 -0
  17. package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
  18. package/dist/ai-search-DKbN9Tyd.mjs +7 -0
  19. package/dist/ai-security-C_I5lo58.mjs +4 -0
  20. package/dist/{alerting-qa8SkXlD.mjs → alerting-4T8gmZs-.mjs} +4 -4
  21. package/dist/analytics-Bxh4TCP7.mjs +3 -0
  22. package/dist/analytics_engine-fV56bjVN.mjs +2 -0
  23. package/dist/{api-security-MfHbfZyf.mjs → api-security-COk_i184.mjs} +20 -20
  24. package/dist/argo-DIRfvxvv.mjs +2 -0
  25. package/dist/args-DlUhyGU0.mjs +2 -0
  26. package/dist/artifacts-BBfXNfUg.mjs +4 -0
  27. package/dist/audit-logs-BlOrlAWe.mjs +2 -0
  28. package/dist/{auth-DuLchM18.mjs → auth-D3X9HYhD.mjs} +3 -3
  29. package/dist/auth-DPhNN3Ly.mjs +5 -0
  30. package/dist/billing-B9e4PnvN.mjs +3 -0
  31. package/dist/body-parser-BshbixEq.mjs +2 -0
  32. package/dist/bot-management-D2JVeS-V.mjs +5 -0
  33. package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
  34. package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
  35. package/dist/{browser-extension-q79xHrVW.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
  36. package/dist/browser-run-CHGOCTdG.mjs +4 -0
  37. package/dist/build-D0FhOj40.mjs +8 -0
  38. package/dist/{cache-Cl7vKJwH.mjs → cache-C6V7PbQM.mjs} +1 -1
  39. package/dist/{calls-DtK_ANxq.mjs → calls-Bye8Tyy-.mjs} +1 -1
  40. package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
  41. package/dist/cf-Ds4JFovl.mjs +18 -0
  42. package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
  43. package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
  44. package/dist/{client-certificates-BtPU9GsQ.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
  45. package/dist/{client-side-security-DAn-3jwp.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
  46. package/dist/cloud-connector-CL1jPQud.mjs +2 -0
  47. package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
  48. package/dist/command-C9VP3xaA.mjs +2 -0
  49. package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
  50. package/dist/config.d.mts +1460 -1348
  51. package/dist/config.mjs +1 -1
  52. package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
  53. package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
  54. package/dist/connector-telemetry-events-latest-BbpcII3_.mjs +2 -0
  55. package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
  56. package/dist/connector-telemetry-snapshots-latest-DuCiimXl.mjs +2 -0
  57. package/dist/{connectors-Bo6ZT8PT.mjs → connectors-BQwyBJ4_.mjs} +1 -1
  58. package/dist/containers-BrQtGiNp.mjs +58 -0
  59. package/dist/{content-scan-D03UfK2X.mjs → content-scan-DNzhXYkY.mjs} +1 -1
  60. package/dist/{csamScanner-DgS-7ADh.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
  61. package/dist/{ct-alerting-8AKtNnUg.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
  62. package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
  63. package/dist/custom-csrs-bhClr2SU.mjs +3 -0
  64. package/dist/custom-hostnames-C0eiGvG9.mjs +5 -0
  65. package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
  66. package/dist/custom-pages-DTINMR30.mjs +3 -0
  67. package/dist/d1-sKdExJYF.mjs +20 -0
  68. package/dist/data-security-mV3a6UfW.mjs +7 -0
  69. package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
  70. package/dist/delegate.mjs +1 -1
  71. package/dist/{deploy-DGlmjPTS.mjs → deploy-BL59O1O1.mjs} +1 -1
  72. package/dist/deploy-input-Dz6q-__n.mjs +2 -0
  73. package/dist/{dev-BbLV0Ti-.mjs → dev-BDaavgH1.mjs} +2 -2
  74. package/dist/diagnostics-CJV6qWUA.mjs +3 -0
  75. package/dist/{directory-CCndFkbQ.mjs → directory-B5zCMusW.mjs} +1 -1
  76. package/dist/{dispatch-namespaces-C48JQ9EA.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
  77. package/dist/dist-BHi7UhXO.mjs +72 -0
  78. package/dist/dist-BWpErtDM.mjs +384 -0
  79. package/dist/{dls-BBq99pjI.mjs → dls-t0hnIe_P.mjs} +1 -1
  80. package/dist/dns-C8FC2hbh.mjs +29 -0
  81. package/dist/{dns-firewall-DdwVtm12.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
  82. package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
  83. package/dist/dry-run-DL2V6yFm.mjs +2 -0
  84. package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
  85. package/dist/email-auth-BmYrl0pO.mjs +2 -0
  86. package/dist/email-routing-CF3_Z957.mjs +6 -0
  87. package/dist/email-security-F7OYcMkZ.mjs +18 -0
  88. package/dist/email-sending-EyU3WvGQ.mjs +7 -0
  89. package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
  90. package/dist/firewall-8YWWy4iB.mjs +11 -0
  91. package/dist/flagship-C4x0l-8J.mjs +4 -0
  92. package/dist/{fraud-AH47n-wL.mjs → fraud-HR_SdUx3.mjs} +1 -1
  93. package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
  94. package/dist/{healthchecks-DfEUG007.mjs → healthchecks-4qOvjrTN.mjs} +2 -2
  95. package/dist/{hostnames-DQUiD3Vr.mjs → hostnames-DehdYOMz.mjs} +1 -1
  96. package/dist/{hyperdrive-RyQboMWI.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
  97. package/dist/iam-DR72hmii.mjs +6 -0
  98. package/dist/images-CeKc5JPh.mjs +8 -0
  99. package/dist/index.mjs +1 -1
  100. package/dist/intel-DtFix9WL.mjs +8 -0
  101. package/dist/{interactive-mV8PABm6.mjs → interactive-C7M55Wxx.mjs} +1 -1
  102. package/dist/ips-CtWCjXAN.mjs +2 -0
  103. package/dist/{keyless-certificates-oNu5jWKF.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
  104. package/dist/keys-BmhG6Kn1.mjs +2 -0
  105. package/dist/{kv-Bi9B4E0A.mjs → kv-BuVPAuZP.mjs} +1 -1
  106. package/dist/{leaked-credential-checks-DKRjBLcr.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
  107. package/dist/load-balancers-CylN-l7n.mjs +6 -0
  108. package/dist/{local-DTyuGwTw.mjs → local-Be3lg_9E.mjs} +1 -1
  109. package/dist/{local-runtime-IAXhEugU.mjs → local-runtime-Ce7k598H.mjs} +1 -1
  110. package/dist/logexplorer-CvRPoKbj.mjs +17 -0
  111. package/dist/logo-matches-Heuft3yF.mjs +2 -0
  112. package/dist/logos-DRYjGBDq.mjs +3 -0
  113. package/dist/logpush-Dve9jOMp.mjs +4 -0
  114. package/dist/{logs-DmWWL5f9.mjs → logs-SC86FE89.mjs} +1 -1
  115. package/dist/{magic-cloud-networking-XbTa6P52.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
  116. package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
  117. package/dist/magic-transit-BK_3asH2.mjs +111 -0
  118. package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
  119. package/dist/matches-Iss9Fo4R.mjs +2 -0
  120. package/dist/mcp-8wxXT6JU.mjs +4 -0
  121. package/dist/mesh-Bf9UAS4J.mjs +4 -0
  122. package/dist/{moq-CJpE-eNj.mjs → moq-ZKMFOeVz.mjs} +1 -1
  123. package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
  124. package/dist/{network-D2WRXCDe.mjs → network-B1lBARU9.mjs} +1 -1
  125. package/dist/{network-interconnects-Clq4X1U8.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
  126. package/dist/oauth-DuEONNgC.mjs +14 -0
  127. package/dist/{oauth-clients-hilWfAlm.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
  128. package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
  129. package/dist/observability-Jya7-zkl.mjs +4 -0
  130. package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
  131. package/dist/{organization-D41rIvJa.mjs → organization-CYxYV4e0.mjs} +6 -6
  132. package/dist/organizations-SacGUW44.mjs +2 -0
  133. package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
  134. package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
  135. package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
  136. package/dist/{output-DgW1hQGX.mjs → output-Ccqw2WOb.mjs} +1 -1
  137. package/dist/page-rules-BqEyFR2c.mjs +27 -0
  138. package/dist/pages-CQ7ZVWk1.mjs +14 -0
  139. package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
  140. package/dist/pipelines-6De2Pe2C.mjs +6 -0
  141. package/dist/precursor-iwK-1P_d.mjs +4 -0
  142. package/dist/progress-BqQcF5QH.mjs +2 -0
  143. package/dist/project-settings-C_1-JI6Y.mjs +3 -0
  144. package/dist/prompt-B0sWIs9c.mjs +3 -0
  145. package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
  146. package/dist/queries-c7zvnfEQ.mjs +3 -0
  147. package/dist/queues-BU6y16qS.mjs +6 -0
  148. package/dist/r2-Jo3QMahK.mjs +24 -0
  149. package/dist/{r2-data-catalog-DLtf9d6o.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
  150. package/dist/radar-DIYAMEof.mjs +2 -0
  151. package/dist/{rate-limits-B1YjnGue.mjs → rate-limits-DewOcznT.mjs} +1 -1
  152. package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
  153. package/dist/realtimekit-cnZEVNDn.mjs +7 -0
  154. package/dist/registrar-BsWr_aPM.mjs +23 -0
  155. package/dist/{registrar-sandbox-0i1T3zne.mjs → registrar-sandbox-BlcpUyIH.mjs} +6 -6
  156. package/dist/{registry-DDcSvd8H.mjs → registry-jifR3_Y6.mjs} +1 -1
  157. package/dist/reporting--1AyTV7k.mjs +2 -0
  158. package/dist/request-tracers-C_VX7X6-.mjs +2 -0
  159. package/dist/{resource-sharing-Ctdi9D-j.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
  160. package/dist/resource-tagging-C33U6T74.mjs +2 -0
  161. package/dist/rules-BfjzALMi.mjs +4 -0
  162. package/dist/rulesets-3i_1Vwt-.mjs +5 -0
  163. package/dist/rum-CjmIckiR.mjs +4 -0
  164. package/dist/{schema-BeXPWeK9.mjs → schema-1mwmslUV.mjs} +1 -1
  165. package/dist/schema-flags-llLJuFFw.mjs +5 -0
  166. package/dist/{scim-BgGsmHrL.mjs → scim-pApmzA5B.mjs} +1 -1
  167. package/dist/sdk-ZctLa5jW.mjs +3 -0
  168. package/dist/{secrets-store-BCpFhYFv.mjs → secrets-store-DBC9WJau.mjs} +1 -1
  169. package/dist/security-center-Djm06dq-.mjs +2 -0
  170. package/dist/{security-txt-Be2Bif0z.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
  171. package/dist/{share-Bz2tFTUP.mjs → share-Dj-MNXrw.mjs} +4 -4
  172. package/dist/shared-BJvq4DkR.mjs +290 -0
  173. package/dist/smart-shield--8EpJjrF.mjs +4 -0
  174. package/dist/snippets-Dyz0PH60.mjs +4 -0
  175. package/dist/{spawn-CHkoow5W.mjs → spawn-C5Z7oWdp.mjs} +108 -112
  176. package/dist/{spectrum-BA0a42eM.mjs → spectrum-rAHWz8rH.mjs} +1 -1
  177. package/dist/{speed-mmOjxOzo.mjs → speed-BKepWBXj.mjs} +1 -1
  178. package/dist/src-gJma71Ec.mjs +108 -0
  179. package/dist/{ssl-Yr6kELqg.mjs → ssl-KdFiY3ev.mjs} +1 -1
  180. package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
  181. package/dist/{state-DZC531l2.mjs → state-Cu3cItUg.mjs} +1 -1
  182. package/dist/{stream-Cu0kYWbc.mjs → stream-CKJ6Tb0M.mjs} +13 -13
  183. package/dist/submit-BxbKKhBn.mjs +2 -0
  184. package/dist/tags-DA8dq9fx.mjs +2 -0
  185. package/dist/tenant-DLXw48hS.mjs +2 -0
  186. package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
  187. package/dist/{tools-D2Xxfkrc.mjs → tools-x8bj9E6b.mjs} +1 -1
  188. package/dist/{tunnel-CDYkWjnt.mjs → tunnel-CNQA5Flp.mjs} +1 -1
  189. package/dist/tunnels-CC10EOsU.mjs +2 -0
  190. package/dist/turnstile-CH58hnf4.mjs +23 -0
  191. package/dist/{ui-DIpjthrV.mjs → ui-CmnnBm_O.mjs} +1 -1
  192. package/dist/url-info-BpCgdUtL.mjs +2 -0
  193. package/dist/{url-normalization-BeKkOZz7.mjs → url-normalization-BzuynEy1.mjs} +1 -1
  194. package/dist/url-scanner-APIZbhB7.mjs +2 -0
  195. package/dist/user-2-NGebfI.mjs +12 -0
  196. package/dist/values-S_bNv819.mjs +2 -0
  197. package/dist/{vectorize-CjXfiFH4.mjs → vectorize-Bv7feLBC.mjs} +1 -1
  198. package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
  199. package/dist/{web-assets-BzM5vVzy.mjs → web-assets-C1UmOyzD.mjs} +1 -1
  200. package/dist/web3-GnUocVYH.mjs +4 -0
  201. package/dist/workers-J1-PLwdl.mjs +28 -0
  202. package/dist/{workers-builds-B44wc67O.mjs → workers-builds-DCHmWOMS.mjs} +4 -4
  203. package/dist/{workflows-rFuQWClt.mjs → workflows-CArfEI2c.mjs} +2 -2
  204. package/dist/zaraz-mg2YlR3_.mjs +2 -0
  205. package/dist/zero-trust-DVdUPtj1.mjs +93 -0
  206. package/dist/zone-DMAfrDJX.mjs +2 -0
  207. package/dist/zones-CNwxUi7I.mjs +21 -0
  208. package/package.json +10 -7
  209. package/dist/abuse-reports-CzDAjFpo.mjs +0 -8
  210. package/dist/account-Dd4-tDYJ.mjs +0 -2
  211. package/dist/account-tags-65fAlHrf.mjs +0 -9
  212. package/dist/accounts-Bp5KGc6r.mjs +0 -28
  213. package/dist/agent-memory-D--BQS0W.mjs +0 -6
  214. package/dist/ai-BnVlQDiI.mjs +0 -5
  215. package/dist/ai-audit-CfpDKXkD.mjs +0 -2
  216. package/dist/ai-gateway-oG4j_oYN.mjs +0 -13
  217. package/dist/ai-search-B2l3B_jn.mjs +0 -7
  218. package/dist/ai-security-byjIIrfl.mjs +0 -4
  219. package/dist/analytics-DeIKjC9n.mjs +0 -3
  220. package/dist/analytics_engine-BnECMIWJ.mjs +0 -2
  221. package/dist/argo-DFerMyXF.mjs +0 -2
  222. package/dist/artifacts-CtyEYYDa.mjs +0 -4
  223. package/dist/audit-logs-retFtvow.mjs +0 -2
  224. package/dist/auth-aazs91XL.mjs +0 -5
  225. package/dist/billing-CxQVqpGZ.mjs +0 -3
  226. package/dist/body-parser-CYD7PKFC.mjs +0 -2
  227. package/dist/bot-management-Rli7v7tg.mjs +0 -5
  228. package/dist/botnet-feed-Cw6XSEf8.mjs +0 -3
  229. package/dist/brand-protection-CTvnHGfV.mjs +0 -3
  230. package/dist/browser-run-FwtwnBzA.mjs +0 -4
  231. package/dist/build-Dji9BYmV.mjs +0 -2
  232. package/dist/certificate-authorities-DZP1RzAs.mjs +0 -2
  233. package/dist/cf-oSz9pud_.mjs +0 -18
  234. package/dist/chunk-LQW53VED-Xakf_rUn.mjs +0 -499
  235. package/dist/cloud-connector-BpVcvhjZ.mjs +0 -2
  236. package/dist/cloudforce-one-2PecncfX.mjs +0 -30
  237. package/dist/connector-interrupts-ollUcksZ.mjs +0 -2
  238. package/dist/connector-telemetry-events-D5_3X7XW.mjs +0 -2
  239. package/dist/connector-telemetry-snapshots-CJ9gLRFR.mjs +0 -2
  240. package/dist/containers-Bog7j0Hw.mjs +0 -54
  241. package/dist/custom-certificates-4y35UC1X.mjs +0 -5
  242. package/dist/custom-csrs-DwBrLh-H.mjs +0 -4
  243. package/dist/custom-hostnames-CDIAnsRa.mjs +0 -5
  244. package/dist/custom-nameservers-stk7ymnP.mjs +0 -3
  245. package/dist/custom-pages-vfDxrXbt.mjs +0 -4
  246. package/dist/d1-Cllm-iTT.mjs +0 -20
  247. package/dist/data-security-rnoSCEdL.mjs +0 -7
  248. package/dist/dcv-delegation-DCRCOL6l.mjs +0 -2
  249. package/dist/deploy-input-DhCo1I0I.mjs +0 -242
  250. package/dist/diagnostics-D5Yo2xqx.mjs +0 -3
  251. package/dist/dist-COfwjT96.mjs +0 -72
  252. package/dist/dns-DdQYtenF.mjs +0 -29
  253. package/dist/durable-objects-BvxXBht_.mjs +0 -2
  254. package/dist/email-CGOC_evd.mjs +0 -2
  255. package/dist/email-auth-DFvXKSkg.mjs +0 -2
  256. package/dist/email-routing-QBRPBlyl.mjs +0 -6
  257. package/dist/email-security-BFagcRPP.mjs +0 -18
  258. package/dist/email-sending-Ddhe7xjN.mjs +0 -7
  259. package/dist/filters-CGisPGD1.mjs +0 -4
  260. package/dist/firewall-DD8U-Brd.mjs +0 -11
  261. package/dist/flagship-FJHc4mFi.mjs +0 -4
  262. package/dist/google-tag-gateway-149kbuG_.mjs +0 -2
  263. package/dist/iam-BhHYhMXO.mjs +0 -6
  264. package/dist/images-CDViyKtZ.mjs +0 -8
  265. package/dist/intel-YHZbPlS3.mjs +0 -8
  266. package/dist/ips-BpCdldFx.mjs +0 -2
  267. package/dist/keys-yYtv7Ztr.mjs +0 -2
  268. package/dist/load-balancers-jRCN75mX.mjs +0 -7
  269. package/dist/logexplorer-kO8CULiK.mjs +0 -24
  270. package/dist/logo-matches-LyDAYPbI.mjs +0 -2
  271. package/dist/logos-O9f5bGSB.mjs +0 -3
  272. package/dist/logpush-dtXLu3Ck.mjs +0 -5
  273. package/dist/magic-network-monitoring-CpfkgZMp.mjs +0 -4
  274. package/dist/magic-transit-DwgZeIj-.mjs +0 -111
  275. package/dist/managed-transforms-DCmogkxv.mjs +0 -3
  276. package/dist/matches-BAeN8VM1.mjs +0 -2
  277. package/dist/mcp-DKZ2D050.mjs +0 -4
  278. package/dist/media-CnxgOViL.mjs +0 -2
  279. package/dist/mesh-CzIPtuaM.mjs +0 -4
  280. package/dist/mtls-certificates-Bbm_1lQI.mjs +0 -3
  281. package/dist/oauth-BPizUUqP.mjs +0 -15
  282. package/dist/oauth-scopes-CmbgsPYd.mjs +0 -2
  283. package/dist/observability-DXYgDdU5.mjs +0 -4
  284. package/dist/organizations-eNzfOwlP.mjs +0 -2
  285. package/dist/origin-ca-certificates-DaiAmw45.mjs +0 -3
  286. package/dist/origin-post-quantum-encryption-7YztBged.mjs +0 -2
  287. package/dist/origin-tls-client-auth-DRwURM8s.mjs +0 -4
  288. package/dist/page-rules-B2Csdc4h.mjs +0 -18
  289. package/dist/pages-BAL6Q7OY.mjs +0 -14
  290. package/dist/pay-per-crawl-C-1-ZAtn.mjs +0 -4
  291. package/dist/pipelines-cyQOuFLb.mjs +0 -6
  292. package/dist/precursor-BrweY39h.mjs +0 -4
  293. package/dist/progress-B84wYh91.mjs +0 -2
  294. package/dist/prompt-CDtLWxNv.mjs +0 -3
  295. package/dist/queries-oM8uGZy5.mjs +0 -3
  296. package/dist/queues-CTx04ZNw.mjs +0 -6
  297. package/dist/r2-CnlIUn7R.mjs +0 -24
  298. package/dist/radar-CGNgGh8v.mjs +0 -2
  299. package/dist/raw-fetch-Dz-QBoP_.mjs +0 -2
  300. package/dist/realtimekit-BPwzhNS9.mjs +0 -7
  301. package/dist/registrar-BEcb90RX.mjs +0 -21
  302. package/dist/reporting-CLbjHlnw.mjs +0 -2
  303. package/dist/request-tracers-BcKpofP1.mjs +0 -2
  304. package/dist/resource-tagging-DGEyVTDN.mjs +0 -2
  305. package/dist/rules-CmuB5rIN.mjs +0 -4
  306. package/dist/rulesets-CGaMq8vG.mjs +0 -8
  307. package/dist/rum-QT6EP4JK.mjs +0 -4
  308. package/dist/schema-flags-DHryz6SF.mjs +0 -5
  309. package/dist/sdk-m4xeaua4.mjs +0 -3
  310. package/dist/security-center-BNm4uPVB.mjs +0 -2
  311. package/dist/session-Ckt20hHa.mjs +0 -2
  312. package/dist/shared-BzPQog8H.mjs +0 -2
  313. package/dist/smart-shield-SODkOUyO.mjs +0 -4
  314. package/dist/snippets-B5jY8v_7.mjs +0 -4
  315. package/dist/src-CHW7s5IS.mjs +0 -108
  316. package/dist/submit-Dl_27e0n.mjs +0 -2
  317. package/dist/tags-Cdo_Pwtr.mjs +0 -2
  318. package/dist/tenant-EX-ANl6X.mjs +0 -2
  319. package/dist/tenant-custom-nameservers-BPHUeckw.mjs +0 -3
  320. package/dist/triggers-Bf9hbP3h.mjs +0 -2
  321. package/dist/tunnels-CgyX8R2J.mjs +0 -2
  322. package/dist/turnstile-BUtzlW-0.mjs +0 -23
  323. package/dist/url-info-CJsa1Oc9.mjs +0 -2
  324. package/dist/url-scanner-Cz-yl0_3.mjs +0 -2
  325. package/dist/user-BxHjEqpd.mjs +0 -12
  326. package/dist/values-C43NurfT.mjs +0 -2
  327. package/dist/versions-BFbc90Wu.mjs +0 -2
  328. package/dist/waiting-rooms-C5jSQv_r.mjs +0 -11
  329. package/dist/web3-Ctv9HGiR.mjs +0 -4
  330. package/dist/workers-D-YbIedB.mjs +0 -24
  331. package/dist/zaraz-BA6kY-b6.mjs +0 -2
  332. package/dist/zero-trust-DOFLlUz1.mjs +0 -102
  333. package/dist/zone-B_rgejLV.mjs +0 -2
  334. package/dist/zone-tags-BWdza4rH.mjs +0 -9
  335. package/dist/zones-DTWO7Vvn.mjs +0 -21
  336. /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
  337. /package/dist/{alerts-B85uj2Vx.mjs → alerts-15-IW4jE.mjs} +0 -0
  338. /package/dist/{autorag-Do9l_LyY.mjs → autorag-CFwRkEKw.mjs} +0 -0
  339. /package/dist/{brands-DateHCdd.mjs → brands-BgT1vu9B.mjs} +0 -0
  340. /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
  341. /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
  342. /package/dist/{clear-CB2kgcEB.mjs → clear-BlCK85Me.mjs} +0 -0
  343. /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
  344. /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C7LBxPBt.mjs} +0 -0
  345. /package/dist/{health-buY5f5pp.mjs → health-DZFfafkX.mjs} +0 -0
  346. /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
  347. /package/dist/{internal-CwyoJUHh.mjs → internal-BKHC2D1Y.mjs} +0 -0
  348. /package/dist/{live-wEpA5V_n.mjs → live-DwCvDmaH.mjs} +0 -0
  349. /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
  350. /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
  351. /package/dist/{ready-CBSCPiHE.mjs → ready-D9H2zHHI.mjs} +0 -0
  352. /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
  353. /package/dist/{refute-u7ZPQJZy.mjs → refute-2W8NLCN4.mjs} +0 -0
  354. /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-B8CyM1mi.mjs} +0 -0
  355. /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
  356. /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-CWhta3x7.mjs} +0 -0
  357. /package/dist/{search-D9WDwnV4.mjs → search-DZmBQJL9.mjs} +0 -0
  358. /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-CQrmWgz5.mjs} +0 -0
  359. /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-C98A0bqq.mjs} +0 -0
  360. /package/dist/{theme-BePJemMn.mjs → theme-CrIBazAF.mjs} +0 -0
  361. /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-BZoaFoDE.mjs} +0 -0
  362. /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
  363. /package/dist/{verify-2yi0H93r.mjs → verify-4e4L9IRk.mjs} +0 -0
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{h as e}from"./oauth-BPizUUqP.mjs";import{r as t}from"./auth-DuLchM18.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-B84wYh91.mjs";import{n as a}from"./body-parser-CYD7PKFC.mjs";import{n as o}from"./prompt-CDtLWxNv.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 a=>{if(a.dryRun){r({command:`cf managed-transforms delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});if(a.zoneId=c,!await o({force:!!a.force})){process.stderr.write(`Aborted.
3
- `);return}n(await i(`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})}const u={command:`list`,describe:`Fetches a list of all Managed Transforms.`,builder:l,handler:async a=>{if(a.dryRun){r({command:`cf managed-transforms list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.managedTransforms.list({zone_id:s})),{successLabel:`Loaded`})}};function d(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 f={command:`update`,describe:`Updates the status of one or more Managed Transforms.`,builder:d,handler:async o=>{if(o.dryRun){r({command:`cf managed-transforms update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/managed_headers`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:a(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=a(o.body);n(await i(`Updating`,async()=>s.managedTransforms.update({...e,zone_id:c})),{successLabel:`Updated`});return}n(await i(`Updating`,async()=>s.managedTransforms.update({zone_id:c})),{successLabel:`Updated`})}},p={command:`managed-transforms`,describe:`managed-transforms`,builder:e=>e.command(c).command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";function s(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get`,describe:`Return matches as CSV for string queries based on ID`,builder:s,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){a({command:`cf matches download get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/matches/download`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.matches.download.get({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`download`,describe:`Operations for download`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function u(e){return e.option(`id`,{type:`string`,description:`ID`}).option(`offset`,{type:`number`,description:`Offset`}).option(`limit`,{type:`number`,description:`Limit`}).option(`include-domain-id`,{type:`boolean`,description:`Include domain ID`}).option(`include-dismissed`,{type:`boolean`,description:`Include dismissed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const d={command:`get`,describe:`Return matches for string queries based on ID`,builder:u,handler:async s=>{let c={id:s.id,offset:s.offset,limit:s.limit,include_domain_id:s[`include-domain-id`],include_dismissed:s[`include-dismissed`]};if(s.dryRun){a({command:`cf matches get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/brand-protection/matches`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.matches.get({account_id:u,...c})),{successLabel:`Loaded`})}},f={command:`matches`,describe:`matches`,builder:e=>e.command(d).command(l).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-CDtLWxNv.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`account-tool-call-timeseries`,describe:`Returns daily or monthly tool-call counts across the account.`,builder:p(m),handler:async s=>{let c={granularity:s.granularity,aggregate:s.aggregate,tz:s.tz,days:s.days};if(s.dryRun){a({command:`cf mcp portals account-tool-call-timeseries`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/tool-calls/timeseries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.accountToolCallTimeseries({account_id:u,...c})),{successLabel:`Loaded`})}};function g(e){return e.option(`allow-code-mode`,{type:`boolean`,description:"Deprecated: use `code_mode` for new integrations. `true` maps to any non-off Code Mode policy; `false` maps to `code_mode: off`. If both fields are sent, they must be consistent or the request returns a 400."}).option(`code-mode`,{type:`string`,description:"Code Mode policy for this portal. `off`: Code Mode is unavailable; query parameters are ignored. `opt_in`: Code Mode is off by default; clients turn it on with `?codemode=search_and_execute`. `default_on`: Code Mode is on by default; clients can opt out with `?codemode=off`. `enforced`: Code Mode is always on; query parameters are ignored. Defaults to `opt_in` when omitted on create. If both `code_mode` and `allow_code_mode` are sent, they must be consistent or the request returns a 400.",choices:[`off`,`opt_in`,`default_on`,`enforced`]}).option(`description`,{type:`string`,description:`Optional description of the MCP portal.`}).option(`hostname`,{type:`string`,description:`Hostname where the MCP portal is available.`}).option(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`}).option(`name`,{type:`string`,description:`Display name for the MCP portal.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound MCP traffic through Zero Trust Secure Web Gateway.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Creates a new MCP portal for managing AI tool access through Cloudflare Access.`,builder:g,handler:async d=>{if(d.dryRun){a({command:`cf mcp portals create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({allow_code_mode:d[`allow-code-mode`],code_mode:l(d[`code-mode`],`code-mode`,`text`),description:l(d.description,`description`,`text`),hostname:l(d.hostname,`hostname`,`text`),id:l(d.id,`id`,`text`),name:l(d.name,`name`,`text`),secure_web_gateway:d[`secure-web-gateway`]}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.mcp.portals.create({...e,account_id:p})),{successLabel:`Created`});return}d.hostname===void 0&&(d.hostname=await u(`hostname`,`Hostname where the MCP portal is available.`)),d.id===void 0&&(d.id=await u(`id`,`Unique identifier for the MCP portal.`)),d.name===void 0&&(d.name=await u(`name`,`Display name for the MCP portal.`));let m=c({allow_code_mode:d[`allow-code-mode`],code_mode:l(d[`code-mode`],`code-mode`,`text`),description:l(d.description,`description`,`text`),hostname:l(d.hostname,`hostname`,`text`),id:l(d.id,`id`,`text`),name:l(d.name,`name`,`text`),secure_web_gateway:d[`secure-web-gateway`]});i(await o(`Creating`,async()=>f.mcp.portals.create({...m,account_id:p})),{successLabel:`Created`})}};function v(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,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 <id>`,describe:`Deletes an MCP portal from the account.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf mcp portals delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation permanently deletes the MCP portal.`})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>c.mcp.portals.delete({account_id:l,id:s.id})),{successLabel:`Deleted`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id, name, hostname`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists all MCP portals configured for the account.`,builder:b,handler:async s=>{let c={page:s.page,per_page:s[`per-page`],search:s.search};if(s.dryRun){a({command:`cf mcp portals list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`portal-id`,{type:`string`,description:`Portal ID`,demandOption:!0}).option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`portal-tool-call-timeseries <portal-id>`,describe:`Returns daily or monthly tool-call counts for a portal.`,builder:p(S),handler:async s=>{let c={granularity:s.granularity,aggregate:s.aggregate,tz:s.tz,days:s.days};if(s.dryRun){a({command:`cf mcp portals portal-tool-call-timeseries`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/portals/${s[`portal-id`]==null?`<portal-id>`:encodeURIComponent(String(s[`portal-id`]))}/tool-calls/timeseries`,pathParams:{"portal-id":String(s[`portal-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.portals.portalToolCallTimeseries({account_id:u,portal_id:s[`portal-id`],...c})),{successLabel:`Loaded`})}};function w(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`read <id>`,describe:`Read the details of a single MCP Portal, including its configured servers.`,builder:w,handler:async s=>{if(s.dryRun){a({command:`cf mcp portals read`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mcp.portals.read({account_id:l,id:s.id})),{successLabel:`Loaded`})}};function E(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP portal.`,demandOption:!0}).option(`allow-code-mode`,{type:`boolean`,description:"Deprecated: use `code_mode` for new integrations. `true` maps to any non-off Code Mode policy; `false` maps to `code_mode: off`. If both fields are sent, they must be consistent or the request returns a 400."}).option(`code-mode`,{type:`string`,description:"Code Mode policy for this portal. `off`: Code Mode is unavailable; query parameters are ignored. `opt_in`: Code Mode is off by default; clients turn it on with `?codemode=search_and_execute`. `default_on`: Code Mode is on by default; clients can opt out with `?codemode=off`. `enforced`: Code Mode is always on; query parameters are ignored. Defaults to `opt_in` when omitted on create. If both `code_mode` and `allow_code_mode` are sent, they must be consistent or the request returns a 400.",choices:[`off`,`opt_in`,`default_on`,`enforced`]}).option(`description`,{type:`string`,description:`Optional description of the MCP portal.`}).option(`hostname`,{type:`string`,description:`Hostname where the MCP portal is available.`}).option(`name`,{type:`string`,description:`Display name for the MCP portal.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound MCP traffic through Zero Trust Secure Web Gateway.`}).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 <id>`,describe:`Updates an MCP portal configuration.`,builder:E,handler:async u=>{if(u.dryRun){a({command:`cf mcp portals update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/portals/${u.id==null?`<id>`:encodeURIComponent(String(u.id))}`,pathParams:{id:String(u.id??``)},bodyKind:`json`,body:u.body===void 0?c({allow_code_mode:u[`allow-code-mode`],code_mode:l(u[`code-mode`],`code-mode`,`text`),description:l(u.description,`description`,`text`),hostname:l(u.hostname,`hostname`,`text`),name:l(u.name,`name`,`text`),secure_web_gateway:u[`secure-web-gateway`]}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.mcp.portals.update({...e,account_id:f,id:u.id})),{successLabel:`Updated`});return}let p=c({allow_code_mode:u[`allow-code-mode`],code_mode:l(u[`code-mode`],`code-mode`,`text`),description:l(u.description,`description`,`text`),hostname:l(u.hostname,`hostname`,`text`),name:l(u.name,`name`,`text`),secure_web_gateway:u[`secure-web-gateway`]});i(await o(`Updating`,async()=>d.mcp.portals.update({...p,account_id:f,id:u.id})),{successLabel:`Updated`})}},O={command:`portals`,describe:`Manage MCP portals, attached servers, and Code Mode settings`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`auth-credentials`,{type:`string`,description:'Static credential for the upstream MCP server. For auth_type "bearer", either a raw token string (e.g. "sk-abc123"), which is wrapped server-side as `Authorization: Bearer <token>`, or a JSON-encoded object of the form `{"headers":{"Header-Name":"value",...}}` for custom or multiple static headers (e.g. Cloudflare Access service tokens: `{"headers":{"cf-access-client-id":"...","cf-access-client-secret":"..."}}`).'}).option(`auth-type`,{type:`string`,description:`Authentication method used to connect to the upstream MCP server.`,choices:[`oauth`,`bearer`,`unauthenticated`]}).option(`client-secret`,{type:`string`,description:`Pre-registered OAuth client_secret. Write-only - accepted on create/update when auth_credentials.auth_mode is 'manual'. Stored AES-GCM-encrypted in server_oauth_secrets; never returned by read endpoints.`}).option(`description`,{type:`string`,description:`Optional description of the MCP server.`}).option(`hostname`,{type:`string`,description:`URL of the upstream MCP endpoint.`}).option(`id`,{type:`string`,description:`Unique identifier for the MCP server.`}).option(`is-shared-oauth-callback-enabled`,{type:`boolean`,description:`When true, the gateway worker uses the shared Cloudflare-owned OAuth callback endpoint as the redirect_uri for upstream on-behalf OAuth, instead of the customer portal hostname. Defaults to false (off); opt in per server by setting true.`,default:!1}).option(`name`,{type:`string`,description:`Display name for the MCP server.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound traffic to this MCP server through Zero Trust Secure Web Gateway.`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`create`,describe:`Creates a new MCP server for connecting to an upstream MCP endpoint.`,builder:k,handler:async f=>{if(f.dryRun){a({command:`cf mcp servers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({auth_credentials:l(f[`auth-credentials`],`auth-credentials`,`text`),auth_type:l(f[`auth-type`],`auth-type`,`text`),client_secret:l(f[`client-secret`],`client-secret`,`text`),description:l(f.description,`description`,`text`),hostname:l(f.hostname,`hostname`,`text`),id:l(f.id,`id`,`text`),is_shared_oauth_callback_enabled:f[`is-shared-oauth-callback-enabled`],name:l(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`]}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.mcp.servers.create({...e,account_id:m})),{successLabel:`Created`});return}f[`auth-type`]===void 0&&(f[`auth-type`]=await d(`auth-type`,`Authentication method used to connect to the upstream MCP server.`,[`oauth`,`bearer`,`unauthenticated`])),f.hostname===void 0&&(f.hostname=await u(`hostname`,`URL of the upstream MCP endpoint.`)),f.id===void 0&&(f.id=await u(`id`,`Unique identifier for the MCP server.`)),f.name===void 0&&(f.name=await u(`name`,`Display name for the MCP server.`));let h=c({auth_credentials:l(f[`auth-credentials`],`auth-credentials`,`text`),auth_type:l(f[`auth-type`],`auth-type`,`text`),client_secret:l(f[`client-secret`],`client-secret`,`text`),description:l(f.description,`description`,`text`),hostname:l(f.hostname,`hostname`,`text`),id:l(f.id,`id`,`text`),is_shared_oauth_callback_enabled:f[`is-shared-oauth-callback-enabled`],name:l(f.name,`name`,`text`),secure_web_gateway:f[`secure-web-gateway`]});i(await o(`Creating`,async()=>p.mcp.servers.create({...h,account_id:m})),{successLabel:`Created`})}};function j(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const M={command:`delete <id>`,describe:`Deletes an MCP server from the account.`,builder:j,handler:async s=>{if(s.dryRun){a({command:`cf mcp servers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation permanently deletes the MCP server, removes it from every portal, and deletes its stored OAuth secrets.`})){process.stderr.write(`Aborted.
4
- `);return}i(await o(`Deleting`,async()=>c.mcp.servers.delete({account_id:l,id:s.id})),{successLabel:`Deleted`})}};function N(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`search`,{type:`string`,description:`Search by id, name`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Lists all MCP servers configured for the account.`,builder:N,handler:async s=>{let c={page:s.page,per_page:s[`per-page`],search:s.search};if(s.dryRun){a({command:`cf mcp servers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.servers.list({account_id:u,...c})),{successLabel:`Loaded`})}};function F(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`read <id>`,describe:`Retrieves an MCP server's configuration and capability sync state.`,builder:F,handler:async s=>{if(s.dryRun){a({command:`cf mcp servers read`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mcp.servers.read({account_id:l,id:s.id})),{successLabel:`Loaded`})}};function L(e){return e.positional(`server-id`,{type:`string`,description:`Server ID`,demandOption:!0}).option(`granularity`,{type:`string`,description:`Granularity`,choices:[`daily`,`monthly`]}).option(`aggregate`,{type:`string`,description:`Aggregate`,choices:[`true`,`false`]}).option(`tz`,{type:`string`,description:`Tz`}).option(`days`,{type:`number`,description:`Daily trailing-window size; defaults to 7 and is ignored for monthly`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`server-tool-call-timeseries <server-id>`,describe:`Returns daily or monthly tool-call counts for a server.`,builder:p(L),handler:async s=>{let c={granularity:s.granularity,aggregate:s.aggregate,tz:s.tz,days:s.days};if(s.dryRun){a({command:`cf mcp servers server-tool-call-timeseries`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/analytics/servers/${s[`server-id`]==null?`<server-id>`:encodeURIComponent(String(s[`server-id`]))}/tool-calls/timeseries`,pathParams:{"server-id":String(s[`server-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mcp.servers.serverToolCallTimeseries({account_id:u,server_id:s[`server-id`],...c})),{successLabel:`Loaded`})}};function z(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`sync <id>`,describe:`Syncs an MCP server's capabilities and returns the updated server state, including any connection errors.`,builder:z,handler:async s=>{if(s.dryRun){a({command:`cf mcp servers sync`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/sync`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.mcp.servers.sync({account_id:l,id:s.id})),{successLabel:`Created`})}};function V(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the MCP server.`,demandOption:!0}).option(`auth-credentials`,{type:`string`,description:'Static credential for the upstream MCP server. For auth_type "bearer", either a raw token string (e.g. "sk-abc123"), which is wrapped server-side as `Authorization: Bearer <token>`, or a JSON-encoded object of the form `{"headers":{"Header-Name":"value",...}}` for custom or multiple static headers (e.g. Cloudflare Access service tokens: `{"headers":{"cf-access-client-id":"...","cf-access-client-secret":"..."}}`).'}).option(`client-secret`,{type:`string`,description:`Pre-registered OAuth client_secret. Write-only - accepted on create/update when auth_credentials.auth_mode is 'manual'. Stored AES-GCM-encrypted in server_oauth_secrets; never returned by read endpoints.`}).option(`description`,{type:`string`,description:`Optional description of the MCP server.`}).option(`is-shared-oauth-callback-enabled`,{type:`boolean`,description:`When true, the gateway worker uses the shared Cloudflare-owned OAuth callback endpoint as the redirect_uri for upstream on-behalf OAuth, instead of the customer portal hostname. Defaults to false (off); opt in per server by setting true.`}).option(`name`,{type:`string`,description:`Display name for the MCP server.`}).option(`secure-web-gateway`,{type:`boolean`,description:`Route outbound traffic to this MCP server through Zero Trust Secure Web Gateway.`}).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:`update <id>`,describe:`Updates an MCP server's configuration and credentials.`,builder:V,handler:async u=>{if(u.dryRun){a({command:`cf mcp servers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/access/ai-controls/mcp/servers/${u.id==null?`<id>`:encodeURIComponent(String(u.id))}`,pathParams:{id:String(u.id??``)},bodyKind:`json`,body:u.body===void 0?c({auth_credentials:l(u[`auth-credentials`],`auth-credentials`,`text`),client_secret:l(u[`client-secret`],`client-secret`,`text`),description:l(u.description,`description`,`text`),is_shared_oauth_callback_enabled:u[`is-shared-oauth-callback-enabled`],name:l(u.name,`name`,`text`),secure_web_gateway:u[`secure-web-gateway`]}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.mcp.servers.update({...e,account_id:f,id:u.id})),{successLabel:`Updated`});return}let p=c({auth_credentials:l(u[`auth-credentials`],`auth-credentials`,`text`),client_secret:l(u[`client-secret`],`client-secret`,`text`),description:l(u.description,`description`,`text`),is_shared_oauth_callback_enabled:u[`is-shared-oauth-callback-enabled`],name:l(u.name,`name`,`text`),secure_web_gateway:u[`secure-web-gateway`]});i(await o(`Updating`,async()=>d.mcp.servers.update({...p,account_id:f,id:u.id})),{successLabel:`Updated`})}},U={command:`servers`,describe:`Manage upstream MCP servers, credentials, capabilities, and sync state`,builder:e=>e.command(A).command(M).command(P).command(I).command(R).command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},W={command:`mcp`,describe:`mcp`,builder:e=>e.command(O).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{W as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- const e={command:`media`,describe:`media`,builder:e=>e.demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{e as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-CDtLWxNv.mjs";import{t as p}from"./cli-types-BWdZbsFE.mjs";function m(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <tunnel-id>`,describe:`Gets the high-availability configuration for a WARP Connector tunnel.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes configurations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.configurations.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function g(e){return e.positional(`tunnel-id`,{type:`string`,description:`UUID of the tunnel.`,demandOption:!0}).option(`config-fnr-id`,{type:`string`,description:`Floating Network Resource ID — the secondary ENI that is moved between nodes on failover.`}).option(`ha-mode`,{type:`string`,description:"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",choices:[`none`,`disabled`,`aws`,`local`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`update <tunnel-id>`,describe:`Adds or updates the high-availability configuration for a WARP Connector tunnel.`,builder:g,handler:async u=>{if(u.dryRun){a({command:`cf mesh nodes configurations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}/configurations`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({config:{fnr_id:l(u[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:l(u[`ha-mode`],`ha-mode`,`text`)}):s(u.body)});return}let f=await r(u),p=u.local?e:await t();if(u.accountId=p,u.body){let e=s(u.body);i(await o(`Updating`,async()=>f.mesh.nodes.configurations.update({...e,account_id:p,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}u[`ha-mode`]===void 0&&(u[`ha-mode`]=await d(`ha-mode`,"High-availability mode for the WARP Connector tunnel. `none` means HA is enabled but no provider is configured yet (newly created tunnels default to this). `disabled` means HA is explicitly turned off. `aws` uses AWS ENI move for failover. `local` uses virtual IPs (VIPs) on the local interface.",[`none`,`disabled`,`aws`,`local`]));let m=c({config:{fnr_id:l(u[`config-fnr-id`],`config-fnr-id`,`text`)},ha_mode:l(u[`ha-mode`],`ha-mode`,`text`)});i(await o(`Updating`,async()=>f.mesh.nodes.configurations.update({...m,account_id:p,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}},v={command:`configurations`,describe:`Operations for nodes.configurations`,builder:e=>e.command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`tunnel-id`,{type:`string`,description:`Tunnel ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`list`,describe:`Fetches connection details for a WARP Connector Tunnel.`,builder:y,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes connections list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connections`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.connections.list({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},x={command:`connections`,describe:`Operations for nodes.connections`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.positional(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`,demandOption:!0}).option(`tunnel-id`,{type:`string`,description:`Tunnel ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <connector-id>`,describe:`Fetches connector and connection details for a WARP Connector Tunnel.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``),"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.connectors.get({account_id:l,tunnel_id:s[`tunnel-id`],connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},w={command:`connectors`,describe:`Operations for nodes.connectors`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`ha`,{type:`boolean`,description:`Indicates that the tunnel will be created to be highly available. If omitted, defaults to false.`,default:!1}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const E={command:`create`,describe:`Creates a new Warp Connector Tunnel in an account.`,builder:T,handler:async d=>{if(d.dryRun){a({command:`cf mesh nodes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ha:d.ha,name:l(d.name,`name`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.mesh.nodes.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`A user-friendly name for a tunnel.`));let m=c({ha:d.ha,name:l(d.name,`name`,`text`)});i(await o(`Creating`,async()=>f.mesh.nodes.create({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.positional(`tunnel-id`,{type:`string`,description:`Tunnel ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const O={command:`delete <tunnel-id>`,describe:`Deletes a Warp Connector Tunnel from an account.`,builder:D,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation permanently deletes a Mesh node (Warp Connector Tunnel).`})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>c.mesh.nodes.delete({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Deleted`})}};function k(e){return e.positional(`tunnel-id`,{type:`string`,description:`Tunnel ID`,demandOption:!0}).option(`name`,{type:`string`,description:`A user-friendly name for a tunnel.`}).option(`tunnel-secret`,{type:`string`,description:`Sets the password required to run a locally-managed tunnel. Must be at least 32 bytes and encoded as a base64 string.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`edit <tunnel-id>`,describe:`Updates an existing Warp Connector Tunnel.`,builder:k,handler:async u=>{if(u.dryRun){a({command:`cf mesh nodes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${u[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(u[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(u[`tunnel-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.mesh.nodes.edit({...e,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`});return}let p=c({name:l(u.name,`name`,`text`),tunnel_secret:l(u[`tunnel-secret`],`tunnel-secret`,`text`)});i(await o(`Updating`,async()=>d.mesh.nodes.edit({...p,account_id:f,tunnel_id:u[`tunnel-id`]})),{successLabel:`Updated`})}};function j(e){return e.positional(`tunnel-id`,{type:`string`,description:`Tunnel ID`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`UUID of the Cloudflare Tunnel connector.`}).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 M={command:`failover <tunnel-id>`,describe:`Triggers a manual failover for a specific WARP Connector Tunnel, setting the specified client as the active connector. The tunnel must be configured for high availability (HA) and the client must be linked to the tunnel.`,builder:j,handler:async d=>{if(d.dryRun){a({command:`cf mesh nodes failover`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${d[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(d[`tunnel-id`]))}/failover`,pathParams:{"tunnel-id":String(d[`tunnel-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({client_id:l(d[`connector-id`],`connector-id`,`text`)}):s(d.body)});return}let p=await r(d),m=d.local?e:await t();if(d.accountId=m,!await f({force:!!d.force,message:`This operation triggers a manual failover, changing the active connector for a Mesh node.`})){process.stderr.write(`Aborted.
4
- `);return}if(d.body){let e=s(d.body);i(await o(`Deleting`,async()=>p.mesh.nodes.failover({...e,account_id:m,tunnel_id:d[`tunnel-id`]})),{successLabel:`Deleted`});return}d[`connector-id`]===void 0&&(d[`connector-id`]=await u(`connector-id`,`UUID of the Cloudflare Tunnel connector.`));let h=c({client_id:l(d[`connector-id`],`connector-id`,`text`)});i(await o(`Deleting`,async()=>p.mesh.nodes.failover({...h,account_id:m,tunnel_id:d[`tunnel-id`]})),{successLabel:`Deleted`})}};function N(e){return e.positional(`tunnel-id`,{type:`string`,description:`Tunnel ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <tunnel-id>`,describe:`Fetches a single Warp Connector Tunnel.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}};function F(e){return e.option(`name`,{type:`string`,description:`A user-friendly name for the tunnel.`}).option(`is-deleted`,{type:`boolean`,description:"If `true`, only include deleted tunnels. If `false`, exclude deleted tunnels. If empty, all tunnels will be included."}).option(`existed-at`,{type:`string`,description:`If provided, include only resources that were created (and not deleted) before this time. URL encoded.`}).option(`uuid`,{type:`string`,description:`UUID of the tunnel.`}).option(`was-active-at`,{type:`string`,description:`Was active at`}).option(`was-inactive-at`,{type:`string`,description:`Was inactive at`}).option(`include-prefix`,{type:`string`,description:`Include prefix`}).option(`exclude-prefix`,{type:`string`,description:`Exclude prefix`}).option(`status`,{type:`string`,description:"The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).",choices:[`inactive`,`degraded`,`healthy`,`down`]}).option(`per-page`,{type:`number`,description:`Number of results to display.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Lists and filters Warp Connector Tunnels in an account.`,builder:p(F),handler:async s=>{let c={name:s.name,is_deleted:s[`is-deleted`],existed_at:s[`existed-at`],uuid:s.uuid,was_active_at:s[`was-active-at`],was_inactive_at:s[`was-inactive-at`],include_prefix:s[`include-prefix`],exclude_prefix:s[`exclude-prefix`],status:s.status,per_page:s[`per-page`],page:s.page};if(s.dryRun){a({command:`cf mesh nodes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mesh.nodes.list({account_id:u,...c})),{successLabel:`Loaded`})}};function L(e){return e.positional(`tunnel-id`,{type:`string`,description:`Tunnel ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <tunnel-id>`,describe:`Gets the token used to associate warp device with a specific Warp Connector tunnel.`,builder:L,handler:async s=>{if(s.dryRun){a({command:`cf mesh nodes token get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/warp_connector/${s[`tunnel-id`]==null?`<tunnel-id>`:encodeURIComponent(String(s[`tunnel-id`]))}/token`,pathParams:{"tunnel-id":String(s[`tunnel-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mesh.nodes.token.get({account_id:l,tunnel_id:s[`tunnel-id`]})),{successLabel:`Loaded`})}},z={command:`token`,describe:`Operations for nodes.token`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`nodes`,describe:`Operations for nodes`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).command(I).command(v).command(x).command(w).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`mesh`,describe:`mesh`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{V as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,n as d}from"./prompt-CDtLWxNv.mjs";import{t as f}from"./cli-types-BWdZbsFE.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 s=>{if(s.dryRun){a({command:`cf mtls-certificates associations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}/associations`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mtlsCertificates.associations.get({account_id:l,mtls_certificate_id:s[`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 d=>{if(d.dryRun){a({command:`cf mtls-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.mtlsCertificates.create({...e,account_id:p})),{successLabel:`Created`});return}if(d.ca===void 0)throw Error(`--ca is required (or pass --body with this field set).`);d.certificates===void 0&&(d.certificates=await u(`certificates`,`The uploaded root CA certificate.`));let m=c({ca:d.ca,certificates:l(d.certificates,`certificates`,`text`),name:l(d.name,`name`,`text`),private_key:l(d[`private-key`],`private-key`,`text`)});i(await o(`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 s=>{if(s.dryRun){a({command:`cf mtls-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await d({force:!!s.force})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>c.mtlsCertificates.delete({account_id:l,mtls_certificate_id:s[`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 s=>{if(s.dryRun){a({command:`cf mtls-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates/${s[`mtls-certificate-id`]==null?`<mtls-certificate-id>`:encodeURIComponent(String(s[`mtls-certificate-id`]))}`,pathParams:{"mtls-certificate-id":String(s[`mtls-certificate-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.mtlsCertificates.get({account_id:l,mtls_certificate_id:s[`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 s=>{let c={type:s.type};if(s.dryRun){a({command:`cf mtls-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/mtls_certificates`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.mtlsCertificates.list({account_id:u,...c})),{successLabel:`Loaded`})}},w={command:`mtls-certificates`,describe:`mtls-certificates`,builder:e=>e.command(_).command(y).command(x).command(C).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
@@ -1,15 +0,0 @@
1
- #!/usr/bin/env node
2
- import{n as e}from"./chunk-vbHwaUoU.mjs";import{a as t,i as n,t as r}from"./session-Ckt20hHa.mjs";import{t as i}from"./resolve-XgxRJ-Ys.mjs";import{f as a,n as o,u as s,v as c}from"./interactive-mV8PABm6.mjs";import{a as l,n as u,t as d}from"./cf-oSz9pud_.mjs";import{statSync as f}from"node:fs";import{dirname as p,join as m,resolve as h}from"node:path";const g=`cloudflare.config.ts`;let _;function v(e=process.cwd()){let t=h(e);for(;;){let e=m(t,g);try{if(f(e).isFile())return e}catch{}let n=p(t);if(n===t)return null;t=n}}async function y(e=process.cwd()){let t=h(e);_=void 0;let n=v(t);if(!n)return _={startDir:t,result:null},null;let{loadAndValidateConfig:r}=await import(`./dist-COfwjT96.mjs`).then(e=>e.a),i=await r(n,{mode:void 0},{include:[`settings`]});if(!i.result.success){let e=i.result.error.issues.map(e=>{let t=e.path.filter(e=>typeof e!=`symbol`).join(`.`);return` - ${t?`${t}: `:``}${e.message}`}).join(`
3
- `);throw Error(`Invalid ${g}:\n${e}`)}let a=i.result.data.settings,o={path:n,settings:a?.type===`settings`?a:void 0};return _={startDir:t,result:o},o}function b(e=process.cwd()){let t=h(e);return _?.startDir===t?_.result:void 0}function x(e,t){if(t)return{value:t,source:`flag`};let n=process.env[e];if(n)return{value:n,source:`env`}}async function S(){let e=process.env.CLOUDFLARE_ACCOUNT_ID;if(e)return{value:e,source:`env`};let t=b(),n=t===void 0?await y():t;if(n?.settings?.accountId)return{value:n.settings.accountId,source:`settings`,path:n.path}}async function C(){let e=await S();if(e)return e.value;let{getActiveAccountId:t}=await Promise.resolve().then(()=>F);try{return t()}catch{return}}async function w(){let e=await S();e&&T(e.value,P(e,`accountId`));let{getOrSelectAccountId:t}=await Promise.resolve().then(()=>F);return t(e?.value)}function T(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 E(e,t,n){if(e?.zoneId)return D(e.zoneId,t);let r=x(`CLOUDFLARE_ZONE_ID`,e?.zone);if(r){if(!n?.quiet&&r.source!==`flag`){let e=P(r);console.error(`Using zone: ${r.value} (from ${e})`)}return D(r.value,t)}throw Error(`No zone specified.
4
-
5
- Please provide one of the following:
6
- 1. Zone as a positional argument: cf dns records list <zone>
7
- 2. --zone flag (or -z): cf dns records list --zone example.com
8
- 3. CLOUDFLARE_ZONE_ID environment variable`)}async function D(e,t){if(i(e)||!t)return e;let{resolveZoneId:n}=await import(`./resolve-XgxRJ-Ys.mjs`).then(e=>e.n);return n(t,await w(),e)}function O(e){if(e?.scriptName)return e.scriptName;throw Error("Required Worker name missing. Please specify the Worker name with `--worker <name>`.")}const k=[`public`,`fedramp_high`];let A=!1;async function j(){let e=b(),t=(e===void 0?await y():e)?.settings?.complianceRegion,n=N(t,`cloudflare.config.ts`),r=process.env.CLOUDFLARE_COMPLIANCE_REGION,i=N(r,`CLOUDFLARE_COMPLIANCE_REGION`);return i?(n&&n!==i&&!A&&(A=!0,console.warn(`The compliance region was resolved to "${r}" from the \`CLOUDFLARE_COMPLIANCE_REGION\` environment variable, which takes precedence over the configured value "${t}" in \`cloudflare.config.ts\`.`)),i):n}async function M(){return await j()??`public`}function N(e,t){switch(e){case`fedramp-high`:return`fedramp_high`;case`fedramp_high`:case`public`:case void 0:return e;default:throw Error(`Invalid compliance region "${e}" from ${t}. Valid values are: ${k.join(`, `)}`)}}function P(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`settings`:return`cloudflare.config.ts`}}var F=e({fetchAuthorizedAccounts:()=>U,getActiveAccountId:()=>H,getActiveProfile:()=>q,getConfigPath:()=>$,getOrSelectAccountId:()=>V,getProfileStore:()=>J,getValidToken:()=>X,isOAuthLoggedIn:()=>Z,login:()=>W,logout:()=>G,readAuthCredentials:()=>Q,resolveProfile:()=>Y,setProfile:()=>K});const I={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 L=class extends Error{};async function R(e){if(o())throw new L;r(t);let n=await a({message:e});return(c(n)||typeof n!=`string`)&&process.exit(130),n}async function z(e,n){if(o())throw new L;r(t);let i=await s({message:e,options:n.choices.map(({title:e,value:t})=>({label:e,value:t}))});return(c(i)||typeof i!=`string`)&&process.exit(130),I.log(`To have cf automatically use this account for future commands in this project, you can update your \`cloudflare.config.ts\`:
9
-
10
- import { defineSettings } from "cf/config";
11
-
12
- export const settings = defineSettings({
13
- accountId: "${i}",
14
- });
15
- `),i}const B=d({logger:I,userAgent:n,prompt:R,select:z,isNoDefaultValueProvidedError:e=>e instanceof L});async function V(e){return B.getOrSelectAccountId({account_id:e,compliance_region:await M()})}function H(){return B.getActiveAccountId({})}async function U(){return B.fetchAllAccounts({compliance_region:await M()},{throwOnEmpty:!1})}async function W(e){if(e?.scopes&&!l(e.scopes))throw Error(`One or more of the requested scopes are not valid cf OAuth scopes.`);return B.login({compliance_region:await M()},{browser:e?.browser??!0,...e?.scopes&&{scopes:e.scopes},...e?.profile&&{profile:e.profile}})}function G(e){return B.logout(e)}function K(e){B.setProfile(e)}function q(){return B.getActiveProfile()}function J(){return u({logger:I})}function Y(e,t=process.cwd()){let n=J().resolve({profile:e,cwd:t});return K(n),n}function X(){return B.getOAuthTokenFromLocalState()}function Z(){return B.readAuthCredentials()?.oauth_token!==void 0}function Q(){return B.readAuthCredentials()}function $(){return B.getCredentialStore().path()}export{X as a,G as c,K as d,w as f,C as g,E as h,J as i,F as l,O as m,q as n,Z as o,M as p,$ as r,W as s,U as t,Q as u};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./auth-DuLchM18.mjs";import{t}from"./output-DgW1hQGX.mjs";import{n,t as r}from"./progress-B84wYh91.mjs";function i(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const a={command:`list`,describe:`List all available OAuth scopes. This endpoint requires authentication but has no authorization role requirements.`,builder:i,handler:async i=>{if(i.dryRun){n({command:`cf oauth-scopes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/oauth/scopes`,pathParams:{},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.oauthScopes.list()),{successLabel:`Loaded`})}},o={command:`oauth-scopes`,describe:`oauth-scopes`,builder:e=>e.command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{o as default};
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import{t as e}from"./local-DTyuGwTw.mjs";import{f as t,g as n}from"./oauth-BPizUUqP.mjs";import{r}from"./auth-DuLchM18.mjs";import{t as i}from"./output-DgW1hQGX.mjs";import{n as a,t as o}from"./progress-B84wYh91.mjs";import{n as s,t as c}from"./body-parser-CYD7PKFC.mjs";import{n as l}from"./input-validation-BBKJRoRB.mjs";import{a as u,i as d,n as f}from"./prompt-CDtLWxNv.mjs";import{t as p}from"./cli-types-BWdZbsFE.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 f=>{if(f.dryRun){a({command:`cf observability destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled,name:l(f.name,`name`,`text`),skipPreflightCheck:f[`skip-preflight-check`]}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.observability.destinations.create({...e,account_id:m})),{successLabel:`Created`});return}if(f[`configuration-type`]===void 0&&(f[`configuration-type`]=await d(`configuration-type`,`The configuration.type field`,[`logpush`])),f[`configuration-url`]===void 0&&(f[`configuration-url`]=await u(`configuration-url`,`The configuration.url field`)),f.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);f.name===void 0&&(f.name=await u(`name`,`The name field`));let h=c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled,name:l(f.name,`name`,`text`),skipPreflightCheck:f[`skip-preflight-check`]});i(await o(`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 s=>{if(s.dryRun){a({command:`cf observability destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/destinations/${s.slug==null?`<slug>`:encodeURIComponent(String(s.slug))}`,pathParams:{slug:String(s.slug??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes the destination.`})){process.stderr.write(`Aborted.
3
- `);return}i(await o(`Deleting`,async()=>c.observability.destinations.delete({account_id:l,slug:s.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 s=>{let c={page:s.page,perPage:s[`per-page`],order:s.order,orderBy:s[`order-by`]};if(s.dryRun){a({command:`cf observability destinations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/destinations`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.observability.destinations.list({account_id:u,...c})),{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 f=>{if(f.dryRun){a({command:`cf observability destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/destinations/${f.slug==null?`<slug>`:encodeURIComponent(String(f.slug))}`,pathParams:{slug:String(f.slug??``)},bodyKind:`json`,body:f.body===void 0?c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Updating`,async()=>p.observability.destinations.update({...e,account_id:m,slug:f.slug})),{successLabel:`Updated`});return}if(f[`configuration-type`]===void 0&&(f[`configuration-type`]=await d(`configuration-type`,`The configuration.type field`,[`logpush`])),f[`configuration-url`]===void 0&&(f[`configuration-url`]=await u(`configuration-url`,`The configuration.url field`)),f.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let h=c({configuration:{type:l(f[`configuration-type`],`configuration-type`,`text`),url:l(f[`configuration-url`],`configuration-url`,`text`)},enabled:f.enabled});i(await o(`Updating`,async()=>p.observability.destinations.update({...h,account_id:m,slug:f.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 d=>{if(d.dryRun){a({command:`cf observability queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({description:l(d.description,`description`,`text`),name:l(d.name,`name`,`text`),parameters:{datasets:d[`parameters-datasets`],filterCombination:l(d[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:d[`parameters-limit`],needle:{isRegex:d[`parameters-needle-is-regex`],matchCase:d[`parameters-needle-match-case`]},orderBy:{order:l(d[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(d[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.observability.queries.create({...e,account_id:p})),{successLabel:`Created`});return}d.description===void 0&&(d.description=await u(`description`,`The description field`)),d.name===void 0&&(d.name=await u(`name`,`Query name`)),d[`parameters-order-by-value`]===void 0&&(d[`parameters-order-by-value`]=await u(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=c({description:l(d.description,`description`,`text`),name:l(d.name,`name`,`text`),parameters:{datasets:d[`parameters-datasets`],filterCombination:l(d[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:d[`parameters-limit`],needle:{isRegex:d[`parameters-needle-is-regex`],matchCase:d[`parameters-needle-match-case`]},orderBy:{order:l(d[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(d[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});i(await o(`Creating`,async()=>f.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 s=>{if(s.dryRun){a({command:`cf observability queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries/${s[`query-id`]==null?`<query-id>`:encodeURIComponent(String(s[`query-id`]))}`,pathParams:{"query-id":String(s[`query-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes the saved query.`})){process.stderr.write(`Aborted.
4
- `);return}i(await o(`Deleting`,async()=>c.observability.queries.delete({account_id:l,queryId:s[`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 d=>{if(d.dryRun){a({command:`cf observability queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries/${d[`query-id`]==null?`<query-id>`:encodeURIComponent(String(d[`query-id`]))}`,pathParams:{"query-id":String(d[`query-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({description:l(d.description,`description`,`text`),name:l(d.name,`name`,`text`),parameters:{datasets:d[`parameters-datasets`],filterCombination:l(d[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:d[`parameters-limit`],needle:{isRegex:d[`parameters-needle-is-regex`],matchCase:d[`parameters-needle-match-case`]},orderBy:{order:l(d[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(d[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.observability.queries.edit({...e,account_id:p,queryId:d[`query-id`]})),{successLabel:`Updated`});return}d.description===void 0&&(d.description=await u(`description`,`The description field`)),d.name===void 0&&(d.name=await u(`name`,`Query name`)),d[`parameters-order-by-value`]===void 0&&(d[`parameters-order-by-value`]=await u(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let m=c({description:l(d.description,`description`,`text`),name:l(d.name,`name`,`text`),parameters:{datasets:d[`parameters-datasets`],filterCombination:l(d[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:d[`parameters-limit`],needle:{isRegex:d[`parameters-needle-is-regex`],matchCase:d[`parameters-needle-match-case`]},orderBy:{order:l(d[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(d[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}});i(await o(`Updating`,async()=>f.observability.queries.edit({...m,account_id:p,queryId:d[`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 s=>{if(s.dryRun){a({command:`cf observability queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries/${s[`query-id`]==null?`<query-id>`:encodeURIComponent(String(s[`query-id`]))}`,pathParams:{"query-id":String(s[`query-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.observability.queries.get({account_id:l,queryId:s[`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 s=>{let c={page:s.page,perPage:s[`per-page`],order:s.order,orderBy:s[`order-by`]};if(s.dryRun){a({command:`cf observability queries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/queries`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.observability.queries.list({account_id:u,...c})),{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(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`chart-type`,{type:`string`,description:`Controls the SQL shape and response payload for the 'calculations' view. Omitted or 'timeseries_and_aggregate': current behaviour — both the time-series and aggregate queries. 'timeseries': time-series only. 'aggregate': aggregate only. 'distribution': a bucketed 2D histogram (time × value buckets) returned in 'distribution' instead of 'calculations'. 'distribution' is not compatible with 'compare' — combining them returns a 400.`,choices:[`timeseries_and_aggregate`,`timeseries`,`aggregate`,`distribution`]}).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`distribution-scale`,{type:`string`,description:`Value-axis bucketing for chartType 'distribution'. Omitted or 'log': geometric buckets, best for heavy-tailed latency. 'linear': fixed-width buckets, clearer for narrow or additive ranges. Ignored for other chartTypes. The response echoes the scheme used in distribution.bucketMode.`,choices:[`log`,`linear`]}).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, invocation, and agent views. Pass the $metadata.id of the last event, the trace cursor, or AgentRun.id 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': agent-specific trace 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:`Create a sharable link to a query result.`}).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 F={command:`create`,describe:`Shared queries store the results of a previously run query, allowing you to share the results with others.`,builder:P,handler:async d=>{if(d.dryRun){a({command:`cf observability shared-queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/shared/query`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({chart:d.chart,chartType:l(d[`chart-type`],`chart-type`,`text`),compare:d.compare,distributionScale:l(d[`distribution-scale`],`distribution-scale`,`text`),dry:d.dry,granularity:d.granularity,ignoreSeries:d[`ignore-series`],limit:d.limit,offset:l(d.offset,`offset`,`text`),offsetBy:d[`offset-by`],offsetDirection:l(d[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:d[`parameters-datasets`],filterCombination:l(d[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:d[`parameters-limit`],needle:{isRegex:d[`parameters-needle-is-regex`],matchCase:d[`parameters-needle-match-case`]},orderBy:{order:l(d[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(d[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:l(d[`query-id`],`query-id`,`text`),timeframe:{from:d[`timeframe-from`],to:d[`timeframe-to`]},view:l(d.view,`view`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.observability.sharedQueries.create({...e,account_id:p})),{successLabel:`Created`});return}if(d[`query-id`]===void 0&&(d[`query-id`]=await u(`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).`)),d[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(d[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=c({chart:d.chart,chartType:l(d[`chart-type`],`chart-type`,`text`),compare:d.compare,distributionScale:l(d[`distribution-scale`],`distribution-scale`,`text`),dry:d.dry,granularity:d.granularity,ignoreSeries:d[`ignore-series`],limit:d.limit,offset:l(d.offset,`offset`,`text`),offsetBy:d[`offset-by`],offsetDirection:l(d[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:d[`parameters-datasets`],filterCombination:l(d[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:d[`parameters-limit`],needle:{isRegex:d[`parameters-needle-is-regex`],matchCase:d[`parameters-needle-match-case`]},orderBy:{order:l(d[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(d[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:l(d[`query-id`],`query-id`,`text`),timeframe:{from:d[`timeframe-from`],to:d[`timeframe-to`]},view:l(d.view,`view`,`text`)});i(await o(`Creating`,async()=>f.observability.sharedQueries.create({...m,account_id:p})),{successLabel:`Created`})}};function I(e){return e.positional(`id`,{type:`string`,description:`Specify the ID of the shared query.`,demandOption:!0}).option(`view`,{type:`string`,description:`Select the view of the query result to return, defaults to events.`,choices:[`events`,`invocations`,`calculations`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <id>`,describe:`Shared queries store the results of a previously run query, allowing you to share the results with others.`,builder:p(I),handler:async s=>{let c={view:s.view};if(s.dryRun){a({command:`cf observability shared-queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/shared/query/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.observability.sharedQueries.get({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},R={command:`shared-queries`,describe:`Operations for shared-queries`,builder:e=>e.command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(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 B={command:`keys`,describe:`List all the keys in your telemetry events.`,builder:z,handler:async l=>{if(l.dryRun){a({command:`cf observability telemetry keys`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/telemetry/keys`,pathParams:{},bodyKind:`json`,body:l.body===void 0?c({datasets:l.datasets,from:l.from,keyNeedle:{isRegex:l[`key-needle-is-regex`],matchCase:l[`key-needle-match-case`]},limit:l.limit,needle:{isRegex:l[`needle-is-regex`],matchCase:l[`needle-match-case`]},to:l.to}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.observability.telemetry.keys({...e,account_id:d})),{successLabel:`Created`});return}let f=c({datasets:l.datasets,from:l.from,keyNeedle:{isRegex:l[`key-needle-is-regex`],matchCase:l[`key-needle-match-case`]},limit:l.limit,needle:{isRegex:l[`needle-is-regex`],matchCase:l[`needle-match-case`]},to:l.to});i(await o(`Creating`,async()=>u.observability.telemetry.keys({...f,account_id:d})),{successLabel:`Created`})}};function V(e){return e.option(`chart`,{type:`boolean`,description:`When true, includes time-series data in the response.`}).option(`chart-type`,{type:`string`,description:`Controls the SQL shape and response payload for the 'calculations' view. Omitted or 'timeseries_and_aggregate': current behaviour — both the time-series and aggregate queries. 'timeseries': time-series only. 'aggregate': aggregate only. 'distribution': a bucketed 2D histogram (time × value buckets) returned in 'distribution' instead of 'calculations'. 'distribution' is not compatible with 'compare' — combining them returns a 400.`,choices:[`timeseries_and_aggregate`,`timeseries`,`aggregate`,`distribution`]}).option(`compare`,{type:`boolean`,description:`When true, includes a comparison dataset from the previous time period of equal length.`}).option(`distribution-scale`,{type:`string`,description:`Value-axis bucketing for chartType 'distribution'. Omitted or 'log': geometric buckets, best for heavy-tailed latency. 'linear': fixed-width buckets, clearer for narrow or additive ranges. Ignored for other chartTypes. The response echoes the scheme used in distribution.bucketMode.`,choices:[`log`,`linear`]}).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, invocation, and agent views. Pass the $metadata.id of the last event, the trace cursor, or AgentRun.id 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': agent-specific trace 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 H={command:`query`,describe:`Run a temporary or saved query.`,builder:V,handler:async d=>{if(d.dryRun){a({command:`cf observability telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({chart:d.chart,chartType:l(d[`chart-type`],`chart-type`,`text`),compare:d.compare,distributionScale:l(d[`distribution-scale`],`distribution-scale`,`text`),dry:d.dry,granularity:d.granularity,ignoreSeries:d[`ignore-series`],limit:d.limit,offset:l(d.offset,`offset`,`text`),offsetBy:d[`offset-by`],offsetDirection:l(d[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:d[`parameters-datasets`],filterCombination:l(d[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:d[`parameters-limit`],needle:{isRegex:d[`parameters-needle-is-regex`],matchCase:d[`parameters-needle-match-case`]},orderBy:{order:l(d[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(d[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:l(d[`query-id`],`query-id`,`text`),timeframe:{from:d[`timeframe-from`],to:d[`timeframe-to`]},view:l(d.view,`view`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Loading`,async()=>f.observability.telemetry.query({...e,account_id:p})),{successLabel:`Loaded`});return}if(d[`query-id`]===void 0&&(d[`query-id`]=await u(`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).`)),d[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(d[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let m=c({chart:d.chart,chartType:l(d[`chart-type`],`chart-type`,`text`),compare:d.compare,distributionScale:l(d[`distribution-scale`],`distribution-scale`,`text`),dry:d.dry,granularity:d.granularity,ignoreSeries:d[`ignore-series`],limit:d.limit,offset:l(d.offset,`offset`,`text`),offsetBy:d[`offset-by`],offsetDirection:l(d[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:d[`parameters-datasets`],filterCombination:l(d[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:d[`parameters-limit`],needle:{isRegex:d[`parameters-needle-is-regex`],matchCase:d[`parameters-needle-match-case`]},orderBy:{order:l(d[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:l(d[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:l(d[`query-id`],`query-id`,`text`),timeframe:{from:d[`timeframe-from`],to:d[`timeframe-to`]},view:l(d.view,`view`,`text`)});i(await o(`Loading`,async()=>f.observability.telemetry.query({...m,account_id:p})),{successLabel:`Loaded`})}};function U(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 W={command:`values`,describe:`List unique values found in your events.`,builder:U,handler:async f=>{if(f.dryRun){a({command:`cf observability telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({datasets:f.datasets,key:l(f.key,`key`,`text`),limit:f.limit,needle:{isRegex:f[`needle-is-regex`],matchCase:f[`needle-match-case`]},timeframe:{from:f[`timeframe-from`],to:f[`timeframe-to`]},type:l(f.type,`type`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.observability.telemetry.values({...e,account_id:m})),{successLabel:`Created`});return}if(f.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(f.key===void 0&&(f.key=await u(`key`,`The key field`)),f[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(f[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);f.type===void 0&&(f.type=await d(`type`,`The type field`,[`string`,`boolean`,`number`]));let h=c({datasets:f.datasets,key:l(f.key,`key`,`text`),limit:f.limit,needle:{isRegex:f[`needle-is-regex`],matchCase:f[`needle-match-case`]},timeframe:{from:f[`timeframe-from`],to:f[`timeframe-to`]},type:l(f.type,`type`,`text`)});i(await o(`Creating`,async()=>p.observability.telemetry.values({...h,account_id:m})),{successLabel:`Created`})}},G={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(B).command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`observability`,describe:`observability`,builder:e=>e.command(S).command(N).command(R).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{K as default};
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./auth-DuLchM18.mjs";import{t}from"./output-DgW1hQGX.mjs";import{n,t as r}from"./progress-B84wYh91.mjs";import{t as i}from"./cli-types-BWdZbsFE.mjs";function a(e){return e.positional(`organization-id`,{type:`string`,description:`Identifies the Cloudflare organization.`,demandOption:!0}).option(`from`,{type:`string`,description:"Start date for the usage query (ISO 8601). Required if `to` is set. When omitted along with `to`, defaults to the start of the current month. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`to`,{type:`string`,description:"End date for the usage query (ISO 8601). Required if `from` is set. When omitted along with `from`, defaults to today. Filters by charge period (when consumption happened), not billing period. The maximum date range is 31 days."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`get <organization-id>`,describe:"Returns cost and usage data for all accounts within an organization, aligned with the [FinOps FOCUS v1.3](https://focus.finops.org/focus-specification/v1-3/) Cost and Usage dataset specification. Each record represents one billable metric for one account on one day. This includes all metered usage, including usage that falls within free-tier allowances and may result in zero cost. The response includes usage for every account belonging to the specified organization. **Note:** Cost and pricing fields are not yet populated and will be absent from responses until billing integration is complete. When `from` and `to` are omitted, defaults to the start of the current month through today. The maximum date range is 31 days.",builder:a,handler:async i=>{let a={from:i.from,to:i.to};if(i.dryRun){n({command:`cf organizations billing usage get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/billable/usage`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.billing.usage.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}},s={command:`usage`,describe:`Operations for billing.usage`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},c={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(s).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function l(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.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).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.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).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 u={command:`get <organization-id>`,describe:`Gets a list of audit logs for an organization.`,builder:i(l),handler:async i=>{let a={action_result:i[`action-result`],action_type:i[`action-type`],actor_context:i[`actor-context`],actor_email:i[`actor-email`],actor_id:i[`actor-id`],actor_ip_address:i[`actor-ip-address`],actor_token_id:i[`actor-token-id`],actor_token_name:i[`actor-token-name`],actor_type:i[`actor-type`],id:i.id,raw_cf_ray_id:i[`raw-cf-ray-id`],raw_method:i[`raw-method`],raw_status_code:i[`raw-status-code`],raw_uri:i[`raw-uri`],resource_id:i[`resource-id`],resource_product:i[`resource-product`],resource_type:i[`resource-type`],resource_scope:i[`resource-scope`],"action_result.not":i[`action-result-not`],"action_type.not":i[`action-type-not`],"actor_context.not":i[`actor-context-not`],"actor_email.not":i[`actor-email-not`],"actor_id.not":i[`actor-id-not`],"actor_ip_address.not":i[`actor-ip-address-not`],"actor_token_id.not":i[`actor-token-id-not`],"actor_token_name.not":i[`actor-token-name-not`],"actor_type.not":i[`actor-type-not`],"id.not":i[`id-not`],"raw_cf_ray_id.not":i[`raw-cf-ray-id-not`],"raw_method.not":i[`raw-method-not`],"raw_status_code.not":i[`raw-status-code-not`],"raw_uri.not":i[`raw-uri-not`],"resource_id.not":i[`resource-id-not`],"resource_product.not":i[`resource-product-not`],"resource_type.not":i[`resource-type-not`],"resource_scope.not":i[`resource-scope-not`],since:i.since,before:i.before,direction:i.direction,limit:i.limit,cursor:i.cursor};if(i.dryRun){n({command:`cf organizations logs audit get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/logs/audit`,pathParams:{"organization-id":String(i[`organization-id`]??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.logs.audit.get({organization_id:i[`organization-id`],...a})),{successLabel:`Loaded`})}};function d(e){return e.positional(`id`,{type:`string`,description:`The ID of the audit log to fetch resource history for.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`The unique ID that identifies the organization.`,demandOption:!0}).option(`action-time`,{type:`string`,description:"RFC3339 timestamp of the source audit log entry's action time. Used to narrow the source-entry lookup window. Provide the `action.time` value from the audit log identified by `id`.",demandOption:!0}).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 f={command:`history <id>`,describe:"Returns the chronological change history for the resource identified by the given organization-scoped audit log entry. The endpoint first locates the source audit log entry by `id` (using `action_time` to narrow the lookup window), derives identifying filters from that entry, and then returns matching audit logs within the `since`/`before` window. The `result_info.history_status` field indicates the quality of the resource identification used: - `exact`: Resource was identified by the resource URI. - `approximate`: Resource was identified without the resource URI. - `unavailable`: The source audit log entry did not contain enough information to identify the resource; an empty result is returned.",builder:i(d),handler:async i=>{let a={action_time:i[`action-time`],since:i.since,before:i.before,direction:i.direction,limit:i.limit,cursor:i.cursor};if(i.dryRun){n({command:`cf organizations logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${i[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(i[`organization-id`]))}/logs/audit/${i.id==null?`<id>`:encodeURIComponent(String(i.id))}/history`,pathParams:{"organization-id":String(i[`organization-id`]??``),id:String(i.id??``)},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.organizations.logs.audit.history({organization_id:i[`organization-id`],id:i.id,...a})),{successLabel:`Loaded`})}},p={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},m={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`organizations`,describe:`Multi-user organizations that group accounts, members, and shared settings under a single entity`,builder:e=>e.command(c).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- import{r as e}from"./auth-DuLchM18.mjs";import{t}from"./output-DgW1hQGX.mjs";import{n,t as r}from"./progress-B84wYh91.mjs";import{n as i,t as a}from"./body-parser-CYD7PKFC.mjs";import{n as o}from"./input-validation-BBKJRoRB.mjs";import{a as s,i as c,n as l}from"./prompt-CDtLWxNv.mjs";import{t as u}from"./cli-types-BWdZbsFE.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 l=>{if(l.dryRun){n({command:`cf origin-ca-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},bodyKind:`json`,body:l.body===void 0?a({csr:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]}):i(l.body)});return}let u=await e(l);if(l.body){let e=i(l.body);t(await r(`Creating`,async()=>u.originCaCertificates.create({...e})),{successLabel:`Created`});return}if(l.csr===void 0&&(l.csr=await s(`csr`,`The Certificate Signing Request (CSR). Must be newline-encoded.`)),l.hostnames===void 0)throw Error(`--hostnames is required (or pass --body with this field set).`);l[`request-type`]===void 0&&(l[`request-type`]=await c(`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:o(l.csr,`csr`,`text`),hostnames:l.hostnames,request_type:o(l[`request-type`],`request-type`,`text`),requested_validity:l[`requested-validity`]});t(await r(`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 i=>{if(i.dryRun){n({command:`cf origin-ca-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"certificate-id":String(i[`certificate-id`]??``)},bodyKind:`none`});return}let a=await e(i);if(!await l({force:!!i.force})){process.stderr.write(`Aborted.
3
- `);return}t(await r(`Deleting`,async()=>a.originCaCertificates.delete({certificate_id:i[`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 i=>{if(i.dryRun){n({command:`cf origin-ca-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates/${i[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(i[`certificate-id`]))}`,pathParams:{"certificate-id":String(i[`certificate-id`]??``)},bodyKind:`none`});return}let a=await e(i);t(await r(`Loading`,async()=>a.originCaCertificates.get({certificate_id:i[`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 i=>{let a={zone_id:i[`zone-id`],page:i.page,per_page:i[`per-page`],limit:i.limit,offset:i.offset};if(i.dryRun){n({command:`cf origin-ca-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/certificates`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.originCaCertificates.list(a)),{successLabel:`Loaded`})}},y={command:`origin-ca-certificates`,describe:`origin-ca-certificates`,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{h as e}from"./oauth-BPizUUqP.mjs";import{r as t}from"./auth-DuLchM18.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-B84wYh91.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{i as c}from"./prompt-CDtLWxNv.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 a=>{if(a.dryRun){r({command:`cf origin-post-quantum-encryption get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/cache/origin_post_quantum_encryption`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.originPostQuantumEncryption.get({zone_id:s})),{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){r({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?o({value:s(l.value,`value`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Updating`,async()=>u.originPostQuantumEncryption.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.value===void 0&&(l.value=await c(`value`,`Value of the Origin Post Quantum Encryption Setting.`,[`preferred`,`supported`,`off`]));let f=o({value:s(l.value,`value`,`text`)});n(await i(`Updating`,async()=>u.originPostQuantumEncryption.update({...f,zone_id:d})),{successLabel:`Updated`})}},p={command:`origin-post-quantum-encryption`,describe:`origin-post-quantum-encryption`,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{h as e}from"./oauth-BPizUUqP.mjs";import{a as t,r as n}from"./auth-DuLchM18.mjs";import{t as r}from"./output-DgW1hQGX.mjs";import{n as i,t as a}from"./progress-B84wYh91.mjs";import{n as o,t as s}from"./body-parser-CYD7PKFC.mjs";import{n as c}from"./input-validation-BBKJRoRB.mjs";import{a as l,n as u}from"./prompt-CDtLWxNv.mjs";import{t as d}from"./cli-types-BWdZbsFE.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 t=>{let o={page:t.page,per_page:t[`per-page`],status:t.status};if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-associations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.originTlsClientAuth.hostnameAssociations.list({zone_id:c,...o})),{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){i({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?s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.originTlsClientAuth.hostnameCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The hostname certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await l(`private-key`,`The hostname certificate's private key.`,{kind:`secret`}));let f=s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Creating`,async()=>u.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}r(await a(`Deleting`,async()=>o.originTlsClientAuth.hostnameCertificates.delete({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/certificates/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.hostnameCertificates.get({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostname-certificates list`,method:`GET`,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:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.hostnameCertificates.list({zone_id:s})),{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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/hostnames/${t.hostname==null?`<hostname>`:encodeURIComponent(String(t.hostname))}`,pathParams:{hostname:String(t.hostname??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.hostnames.get({zone_id:s,hostname:t.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 s=>{if(s.dryRun){i({command:`cf origin-tls-client-auth hostnames update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/origin_tls_client_auth/hostnames`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Updating`,async()=>c.originTlsClientAuth.hostnames.update({...e,zone_id:l})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(c,`PUT`,`/zones/${s.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.settings.get({zone_id:s})),{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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/settings`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({enabled:t.enabled}):o(t.body)});return}let c=await n(t),l=await e({zone:t.zone},c,{quiet:t.quiet});if(t.zoneId=l,t.body){let e=o(t.body);r(await a(`Updating`,async()=>c.originTlsClientAuth.settings.update({...e,zone_id:l})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=s({enabled:t.enabled});r(await a(`Updating`,async()=>c.originTlsClientAuth.settings.update({...u,zone_id:l})),{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){i({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?s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Creating`,async()=>u.originTlsClientAuth.zoneCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}t.certificate===void 0&&(t.certificate=await l(`certificate`,`The zone's leaf certificate.`)),t[`private-key`]===void 0&&(t[`private-key`]=await l(`private-key`,`The zone's private key.`,{kind:`secret`}));let f=s({certificate:c(t.certificate,`certificate`,`text`),private_key:c(t[`private-key`],`private-key`,`text`)});r(await a(`Creating`,async()=>u.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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});if(t.zoneId=s,!await u({force:!!t.force})){process.stderr.write(`Aborted.
4
- `);return}r(await a(`Deleting`,async()=>o.originTlsClientAuth.zoneCertificates.delete({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/origin_tls_client_auth/${t[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(t[`certificate-id`]))}`,pathParams:{"certificate-id":String(t[`certificate-id`]??``),"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.zoneCertificates.get({zone_id:s,certificate_id:t[`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 t=>{if(t.dryRun){i({command:`cf origin-tls-client-auth zone-certificates list`,method:`GET`,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:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.originTlsClientAuth.zoneCertificates.list({zone_id:s})),{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:`origin-tls-client-auth`,builder:e=>e.command(m).command(C).command(O).command(N).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{U as default};
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- import{h as e}from"./oauth-BPizUUqP.mjs";import{r as t}from"./auth-DuLchM18.mjs";import{t as n}from"./output-DgW1hQGX.mjs";import{n as r,t as i}from"./progress-B84wYh91.mjs";import{n as a,t as o}from"./body-parser-CYD7PKFC.mjs";import{n as s}from"./input-validation-BBKJRoRB.mjs";import{n as c}from"./prompt-CDtLWxNv.mjs";import{t as l}from"./cli-types-BWdZbsFE.mjs";function u(e){return e.option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
3
- over another. A higher number indicates a higher priority. For example,
4
- if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
5
- specific Page Rule to take precedence (rule B: \`/images/special/*\`),
6
- specify a higher priority for rule B so it overrides rule A.
7
- `,default:1}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`],default:`disabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`create`,describe:`Creates a new Page Rule.`,builder:u,handler:async c=>{if(c.dryRun){r({command:`cf page-rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/pagerules`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({priority:c.priority,status:s(c.status,`status`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.pageRules.create({...e,zone_id:u})),{successLabel:`Created`});return}let d=o({priority:c.priority,status:s(c.status,`status`,`text`)});n(await i(`Creating`,async()=>l.pageRules.create({...d,zone_id:u})),{successLabel:`Created`})}};function f(e){return e.positional(`pagerule-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 p={command:`delete <pagerule-id>`,describe:`Deletes an existing Page Rule.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf page-rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/pagerules/${a[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(a[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(a[`pagerule-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await c({force:!!a.force})){process.stderr.write(`Aborted.
8
- `);return}n(await i(`Deleting`,async()=>o.pageRules.delete({zone_id:s,pagerule_id:a[`pagerule-id`]})),{successLabel:`Deleted`})}};function m(e){return e.positional(`pagerule-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
9
- over another. A higher number indicates a higher priority. For example,
10
- if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
11
- specific Page Rule to take precedence (rule B: \`/images/special/*\`),
12
- specify a higher priority for rule B so it overrides rule A.
13
- `}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`edit <pagerule-id>`,describe:`Updates one or more fields of an existing Page Rule.`,builder:m,handler:async c=>{if(c.dryRun){r({command:`cf page-rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/pagerules/${c[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(c[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(c[`pagerule-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({priority:c.priority,status:s(c.status,`status`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.pageRules.edit({...e,zone_id:u,pagerule_id:c[`pagerule-id`]})),{successLabel:`Updated`});return}let d=o({priority:c.priority,status:s(c.status,`status`,`text`)});n(await i(`Updating`,async()=>l.pageRules.edit({...d,zone_id:u,pagerule_id:c[`pagerule-id`]})),{successLabel:`Updated`})}};function g(e){return e.positional(`pagerule-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <pagerule-id>`,describe:`Fetches the details of a Page Rule.`,builder:g,handler:async a=>{if(a.dryRun){r({command:`cf page-rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/pagerules/${a[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(a[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(a[`pagerule-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.pageRules.get({zone_id:s,pagerule_id:a[`pagerule-id`]})),{successLabel:`Loaded`})}};function v(e){return e.option(`order`,{type:`string`,description:`The field used to sort returned Page Rules.`,choices:[`status`,`priority`]}).option(`direction`,{type:`string`,description:`The direction used to sort returned Page Rules.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:"When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.",choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`Fetches Page Rules in a zone.`,builder:l(v),handler:async a=>{let o={order:a.order,direction:a.direction,match:a.match,status:a.status};if(a.dryRun){r({command:`cf page-rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/pagerules`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.pageRules.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function b(e){return e.positional(`pagerule-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`priority`,{type:`number`,description:`The priority of the rule, used to define which Page Rule is processed
14
- over another. A higher number indicates a higher priority. For example,
15
- if you have a catch-all Page Rule (rule A: \`/images/*\`) but want a more
16
- specific Page Rule to take precedence (rule B: \`/images/special/*\`),
17
- specify a higher priority for rule B so it overrides rule A.
18
- `}).option(`status`,{type:`string`,description:`The status of the Page Rule.`,choices:[`active`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`update <pagerule-id>`,describe:`Replaces the configuration of an existing Page Rule. The configuration of the updated Page Rule will exactly match the data passed in the API request.`,builder:b,handler:async c=>{if(c.dryRun){r({command:`cf page-rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/pagerules/${c[`pagerule-id`]==null?`<pagerule-id>`:encodeURIComponent(String(c[`pagerule-id`]))}`,pathParams:{"pagerule-id":String(c[`pagerule-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({priority:c.priority,status:s(c.status,`status`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.pageRules.update({...e,zone_id:u,pagerule_id:c[`pagerule-id`]})),{successLabel:`Updated`});return}let d=o({priority:c.priority,status:s(c.status,`status`,`text`)});n(await i(`Updating`,async()=>l.pageRules.update({...d,zone_id:u,pagerule_id:c[`pagerule-id`]})),{successLabel:`Updated`})}},S={command:`page-rules`,describe:`page-rules`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{S as default};