cf 1.0.0-beta.13 → 1.0.0-beta.14

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 (257) hide show
  1. package/dist/_meta/commands.json +1562 -1776
  2. package/dist/_meta/hand-written-commands.json +342 -22
  3. package/dist/_meta/schemas.json +611 -956
  4. package/dist/abuse-reports-CVv52Q2w.mjs +24 -0
  5. package/dist/access-k1QjF5rE.mjs +2 -0
  6. package/dist/{account-tags-CaXDDeZ4.mjs → account-tags-RhvWOkOf.mjs} +4 -4
  7. package/dist/{accounts-BALwxDQY.mjs → accounts--3lrEkmu.mjs} +9 -15
  8. package/dist/{acm-CP9EaXQN.mjs → acm-BJxINEcu.mjs} +2 -2
  9. package/dist/{addressing-DRlaxqrI.mjs → addressing-BqByG9JW.mjs} +55 -43
  10. package/dist/{agent-memory-vGhlfZBx.mjs → agent-memory-D4dQMGbh.mjs} +2 -2
  11. package/dist/{ai-CJtbWfB9.mjs → ai-CRkQ4pjC.mjs} +1 -1
  12. package/dist/{ai-audit-C0BJNqZZ.mjs → ai-audit-fMSn4c5L.mjs} +1 -1
  13. package/dist/{ai-gateway-BQtv3U3x.mjs → ai-gateway-CbhvQK4L.mjs} +4 -4
  14. package/dist/ai-search-CvVSnOA0.mjs +79 -0
  15. package/dist/{ai-security-CFTaYk_X.mjs → ai-security-Z_qpI92I.mjs} +1 -1
  16. package/dist/{alerting-1hun27JC.mjs → alerting-CpbCB8br.mjs} +3 -3
  17. package/dist/{analytics-DXUSjvzT.mjs → analytics-DkY9dOP1.mjs} +3 -3
  18. package/dist/{analytics_engine-CQsnL09C.mjs → analytics_engine-DE_jvlx_.mjs} +1 -1
  19. package/dist/{api-security-BXhrfR6-.mjs → api-security-BHnOU5MM.mjs} +25 -25
  20. package/dist/{argo-LPUCTnee.mjs → argo-DhC5L_aN.mjs} +3 -3
  21. package/dist/{artifacts-Dt6easua.mjs → artifacts-CrIupY7P.mjs} +3 -3
  22. package/dist/{audit-logs-CVznAM2Z.mjs → audit-logs-BjeBxTox.mjs} +1 -1
  23. package/dist/{auth-eQr-kQCH.mjs → auth-BNYfOMl0.mjs} +1 -1
  24. package/dist/{auth-CGLsxbc6.mjs → auth-CAWalgW0.mjs} +1 -1
  25. package/dist/auth-DOwC01PW.mjs +2 -0
  26. package/dist/{auth-token-pNQrX_9O.mjs → auth-token-Dop0wLCw.mjs} +1 -1
  27. package/dist/{autoconfig-sD7Frryg.mjs → autoconfig-RQ3HS4m1.mjs} +1 -1
  28. package/dist/{basin-catalog-ZQICw-zF.mjs → basin-catalog-DZ7QV-_N.mjs} +3 -3
  29. package/dist/{billing-Dy1-dV_B.mjs → billing-BFyte9fL.mjs} +3 -3
  30. package/dist/bot-management-DXcbV3am.mjs +9 -0
  31. package/dist/{botnet-feed-xb98Cj3Y.mjs → botnet-feed-bGGp_cwX.mjs} +1 -1
  32. package/dist/{brand-protection-Ck3okE2k.mjs → brand-protection-DN36XkxH.mjs} +2 -2
  33. package/dist/{browser-run-DJGJSzFX.mjs → browser-run-hHD1RT43.mjs} +3 -3
  34. package/dist/build-BhpWYgNm.mjs +2 -0
  35. package/dist/{build-HmSXqjGn.mjs → build-CCe7IrWT.mjs} +1 -1
  36. package/dist/{builds-CYxcZtkG.mjs → builds-6aO61R9R.mjs} +4 -4
  37. package/dist/{cache-D9tSfovH.mjs → cache-C5YJpMqi.mjs} +6 -6
  38. package/dist/{certificate-authorities-CpiveTFC.mjs → certificate-authorities-CbqDAktQ.mjs} +1 -1
  39. package/dist/{cf-BxsXrVeh.mjs → cf-oRSQKirD.mjs} +1 -1
  40. package/dist/{chunk-DSGVRFIS-C1_SEtRK.mjs → chunk-DSGVRFIS-CPI5cYtB.mjs} +1 -1
  41. package/dist/{chunk-NDZDTP46-Bjx_wtJe.mjs → chunk-NDZDTP46-Civns3WA.mjs} +1 -1
  42. package/dist/{cli-DeJc9U8z.mjs → cli-ht4q6i2y.mjs} +1 -1
  43. package/dist/{client-certificates-CF6YZyvP.mjs → client-certificates-balaN_my.mjs} +1 -1
  44. package/dist/{client-side-security-BLoe9kS5.mjs → client-side-security-3_4Ermmg.mjs} +3 -3
  45. package/dist/{cloud-connector-DXRUHsjt.mjs → cloud-connector-avx27sLw.mjs} +1 -1
  46. package/dist/{cloudflared--1Ws1RJy.mjs → cloudflared-D83U8Yn3.mjs} +1 -1
  47. package/dist/{cloudforce-one-CBLxXi6v.mjs → cloudforce-one-CXdeqJ9l.mjs} +126 -168
  48. package/dist/{command-Dh7RmjFu.mjs → command-9VAc7b30.mjs} +1 -1
  49. package/dist/{command-Cu7dcaHT.mjs → command-B_Ixlz8Q.mjs} +1 -1
  50. package/dist/{command-oNVwyjGB.mjs → command-BtDY_MKv.mjs} +1 -1
  51. package/dist/{command-CG6RvZs0.mjs → command-CUNMrMou.mjs} +1 -1
  52. package/dist/{command-D3fyhdy-.mjs → command-Ckb9FufU.mjs} +1 -1
  53. package/dist/{command-BDe67N_n.mjs → command-CtVUNm__.mjs} +1 -1
  54. package/dist/{command-DUhX8Dcr.mjs → command-CyJQ40fc.mjs} +1 -1
  55. package/dist/{command-UiHLJ8Ji.mjs → command-DPX9sJVi.mjs} +1 -1
  56. package/dist/{command-BlIb6RR2.mjs → command-DXaRn1ls.mjs} +1 -1
  57. package/dist/{command-CcuLC6CJ.mjs → command-DjEJaOwV.mjs} +1 -1
  58. package/dist/{command-_rqD0hXF.mjs → command-DtgJilOK.mjs} +1 -1
  59. package/dist/{command-BvfKhMl7.mjs → command-OHov3PEc.mjs} +1 -1
  60. package/dist/{command-DwXiDOeH.mjs → command-OWe3v69l.mjs} +1 -1
  61. package/dist/{command-83uVfXh9.mjs → command-SmWD-MeI.mjs} +1 -1
  62. package/dist/{completions-D06AO7A8.mjs → completions-CuqAO3N_.mjs} +1 -1
  63. package/dist/{connector-interrupts-DelTmNyw.mjs → connector-interrupts-ftd10Du-.mjs} +1 -1
  64. package/dist/{connector-telemetry-events-BwxR3G8d.mjs → connector-telemetry-events-TwDZYdEM.mjs} +1 -1
  65. package/dist/{connector-telemetry-snapshots-Bqq-hrpJ.mjs → connector-telemetry-snapshots-CZxkOuC3.mjs} +1 -1
  66. package/dist/{connectors-D-m3rEpk.mjs → connectors-6lVSr-fd.mjs} +1 -1
  67. package/dist/containers-Dqs_ZnO2.mjs +78 -0
  68. package/dist/containers-ncw3bd3a.mjs +376 -0
  69. package/dist/{content-scan-W0BNzbQp.mjs → content-scan-BWFbqfQ0.mjs} +3 -3
  70. package/dist/{context-q7UaYK69.mjs → context-BBLtgdR1.mjs} +1 -1
  71. package/dist/{cps-BZ6hqRb5.mjs → cps-C5phNoVU.mjs} +2 -2
  72. package/dist/{csamScanner-Bo1t3CLh.mjs → csamScanner-BwZNZu0A.mjs} +3 -3
  73. package/dist/{ct-alerting-E03faC7p.mjs → ct-alerting-DPp3qLqO.mjs} +1 -1
  74. package/dist/{custom-certificates-CUySSPzi.mjs → custom-certificates-pfpZcr06.mjs} +5 -5
  75. package/dist/{custom-csrs-gNpWkJPQ.mjs → custom-csrs-DrvGRAkl.mjs} +2 -2
  76. package/dist/{custom-hostnames-abGBAbx7.mjs → custom-hostnames-wGtmFbz1.mjs} +3 -3
  77. package/dist/{custom-nameservers-BgNXol1P.mjs → custom-nameservers-HTG6MPKv.mjs} +1 -1
  78. package/dist/{custom-pages-DMKX3aoD.mjs → custom-pages-DqEHBSVt.mjs} +2 -2
  79. package/dist/d1-EQMUlHTJ.mjs +94 -0
  80. package/dist/{dcv-delegation-B5YUEWu0.mjs → dcv-delegation-D6nj0Z5N.mjs} +1 -1
  81. package/dist/{deploy-CWNm1-5v.mjs → deploy-B22sEVHd.mjs} +1 -1
  82. package/dist/{deploy-context-Dr6bxNcB.mjs → deploy-context-DmG9rgPO.mjs} +1 -1
  83. package/dist/{deploy-input-Cc0_2QlW.mjs → deploy-input-BCjcuP6u.mjs} +1 -1
  84. package/dist/{dev-ZA8itQE7.mjs → dev-ClhhXuNU.mjs} +1 -1
  85. package/dist/diagnostics-tqHjq-Pl.mjs +15 -0
  86. package/dist/dist-DmRM6WSZ.mjs +449 -0
  87. package/dist/{dls-DIl16mLp.mjs → dls-BEHj4X9T.mjs} +1 -1
  88. package/dist/{dns-firewall-BZwJXHLj.mjs → dns-firewall-zwbkutyf.mjs} +1 -1
  89. package/dist/{dns-QUpgljRG.mjs → dns-n4mfYBZg.mjs} +3 -3
  90. package/dist/{durable-objects-BCj4ykpU.mjs → durable-objects-CQ2dHhho.mjs} +1 -1
  91. package/dist/{email-auth-DlHIYhCk.mjs → email-auth-DOi6yOt3.mjs} +1 -1
  92. package/dist/{email-routing-UKVS4DYy.mjs → email-routing-WcSPt22u.mjs} +5 -5
  93. package/dist/{email-security-CZjfRIg0.mjs → email-security-BXu3OGay.mjs} +15 -15
  94. package/dist/{email-sending-Dquc880C.mjs → email-sending-B9zTlIjt.mjs} +2 -2
  95. package/dist/{fieldExtractors-BbwDRquU.mjs → fieldExtractors-B37m2lKW.mjs} +1 -1
  96. package/dist/{firewall--mTfDnCJ.mjs → firewall-CRtYO0Ha.mjs} +5 -5
  97. package/dist/{flagship-cfoSwwM9.mjs → flagship-DvTFZSay.mjs} +3 -3
  98. package/dist/{fraud-Dcsq3EYK.mjs → fraud-uSyibsit.mjs} +5 -5
  99. package/dist/{google-tag-gateway-DPKSkZQi.mjs → google-tag-gateway-BFXiiokq.mjs} +1 -1
  100. package/dist/hand-written-dry-run-B82fRl2N.mjs +2 -0
  101. package/dist/{healthchecks-D78hIIBC.mjs → healthchecks-27u7b7Jb.mjs} +5 -5
  102. package/dist/{hostnames-sF999-6H.mjs → hostnames-DvaUSzsj.mjs} +1 -1
  103. package/dist/hyperdrive-BzJvPdu6.mjs +37 -0
  104. package/dist/{iam-Bvg_PayW.mjs → iam-Dl3cU9GI.mjs} +1 -1
  105. package/dist/{images-DI_lEZ4L.mjs → images-C2OkI1j7.mjs} +6 -6
  106. package/dist/index.mjs +1 -1
  107. package/dist/{init-1w_mcgk3.mjs → init-Da8pe296.mjs} +1 -1
  108. package/dist/{intel-BxElBUMP.mjs → intel-DoB1g_K7.mjs} +2 -2
  109. package/dist/{ips-DWoaKxi7.mjs → ips-BRt68epr.mjs} +1 -1
  110. package/dist/{k2-tFjaftl-.mjs → k2-_eq5ZY2t.mjs} +1 -1
  111. package/dist/{keyless-certificates-BrvxHU4J.mjs → keyless-certificates-DaO2yqYu.mjs} +2 -2
  112. package/dist/{keys-DcwTYKRf.mjs → keys-7BQ3Zq6Y.mjs} +1 -1
  113. package/dist/{kv-htXS-7uP.mjs → kv-BTYCXKML.mjs} +4 -4
  114. package/dist/{lazy-command-BDiIwpss.mjs → lazy-command-CDWwCsD2.mjs} +1 -1
  115. package/dist/{leaked-credential-checks-bvGrLOmQ.mjs → leaked-credential-checks-CPHOK_dE.mjs} +1 -1
  116. package/dist/load-balancers-Bu9pd2SV.mjs +76 -0
  117. package/dist/{local-DlT72Xpn.mjs → local-BcPM4I0s.mjs} +1 -1
  118. package/dist/local-BundUuDT.mjs +2 -0
  119. package/dist/{local-runtime-CokO6qaX.mjs → local-runtime-BHKyRlCP.mjs} +1 -1
  120. package/dist/{login-Ccw-mYwT.mjs → login-BBYC_BtH.mjs} +1 -1
  121. package/dist/{login-BGF_I_LT.mjs → login-D2uoWhWh.mjs} +1 -1
  122. package/dist/{logo-matches-tE8LTKgg.mjs → logo-matches-Bc1DQ4-g.mjs} +1 -1
  123. package/dist/{logos-Bj845Mcw.mjs → logos-X5B8z7Iv.mjs} +1 -1
  124. package/dist/{logpush-Cs8JdvKi.mjs → logpush-C2ENi1et.mjs} +3 -3
  125. package/dist/{logs-C92XZvNu.mjs → logs-BKDz7kBW.mjs} +1 -1
  126. package/dist/{magic-cloud-networking-hNp5MMw-.mjs → magic-cloud-networking-B60Gld8A.mjs} +6 -6
  127. package/dist/{magic-network-monitoring-68GuWAnv.mjs → magic-network-monitoring-CxXI3Y-H.mjs} +4 -4
  128. package/dist/{magic-transit-DNd7gu4j.mjs → magic-transit-ZCSaCbl8.mjs} +171 -168
  129. package/dist/{managed-defense-B_wCAuFD.mjs → managed-defense-DrxMb7xi.mjs} +1 -1
  130. package/dist/{managed-transforms-DZdxHPOh.mjs → managed-transforms-AI7KrRU1.mjs} +1 -1
  131. package/dist/{matches-B65CkflD.mjs → matches-rPMLS3Ip.mjs} +1 -1
  132. package/dist/{mcp-DrJW5ayK.mjs → mcp-DXUMvEWt.mjs} +4 -4
  133. package/dist/{mesh-DfVzYTn1.mjs → mesh-MmBCQ37q.mjs} +2 -2
  134. package/dist/{monetization-BGaI8CMO.mjs → monetization-DQE5VtUO.mjs} +2 -2
  135. package/dist/{mtls-certificates-BsU2emDD.mjs → mtls-certificates-DwkEb-Hy.mjs} +1 -1
  136. package/dist/{network-BEMD8P0U.mjs → network-BcfobxQY.mjs} +1 -1
  137. package/dist/{network-interconnects-DMu_fcbo.mjs → network-interconnects-BU3tN_Ab.mjs} +10 -6
  138. package/dist/{o11y-C1a4gDGF.mjs → o11y-BBv7nedp.mjs} +13 -13
  139. package/dist/{oauth-Bj5Ne1o8.mjs → oauth-BUr8bPwo.mjs} +1 -1
  140. package/dist/{oauth-clients-p4Etdqy_.mjs → oauth-clients-qWVImhHE.mjs} +3 -3
  141. package/dist/{oauth-mspHHU5U.mjs → oauth-n8um6MFk.mjs} +1 -1
  142. package/dist/{oauth-scopes-B2IabFza.mjs → oauth-scopes-CdeIgJIx.mjs} +1 -1
  143. package/dist/organization-CJeOVWH7.mjs +71 -0
  144. package/dist/{organizations-5S6xEp7T.mjs → organizations-BpfoqZcG.mjs} +1 -1
  145. package/dist/{origin-ca-certificates-_VJAoK1D.mjs → origin-ca-certificates-Bimf07RF.mjs} +2 -2
  146. package/dist/{origin-post-quantum-encryption-GcldDsT2.mjs → origin-post-quantum-encryption-CM-If38w.mjs} +2 -2
  147. package/dist/{origin-tls-client-auth-DZHld9fA.mjs → origin-tls-client-auth-BPwYPhc9.mjs} +1 -1
  148. package/dist/{page-rules-o1tAMMsD.mjs → page-rules-DOeekMrj.mjs} +4 -4
  149. package/dist/pages-Bn0Sg1ay.mjs +54 -0
  150. package/dist/{pay-per-crawl-BsnOxGYU.mjs → pay-per-crawl-qJpseNNx.mjs} +1 -1
  151. package/dist/{pay-per-use-BXWMCSyE.mjs → pay-per-use-C1MWKJ4O.mjs} +3 -3
  152. package/dist/pipelines-rCwXQw6S.mjs +44 -0
  153. package/dist/{precursor-B6DjBib6.mjs → precursor-Bk8Pp6jT.mjs} +2 -2
  154. package/dist/previews-BEheHO3T.mjs +4 -0
  155. package/dist/{progress-BtkTVcHI.mjs → progress-CQqDtgmF.mjs} +1 -1
  156. package/dist/{prompt-RlgRrmbm.mjs → prompt-C8FyienX.mjs} +1 -1
  157. package/dist/{queries-yLwoJRHV.mjs → queries-DJ8looyq.mjs} +1 -1
  158. package/dist/{queues-CnJRaE1o.mjs → queues-BBH9Q-Tt.mjs} +7 -7
  159. package/dist/{r2-CuC6-zQX.mjs → r2-CdJKpP2w.mjs} +13 -13
  160. package/dist/{radar-DrQLcbkq.mjs → radar-CdvQL4xm.mjs} +1 -1
  161. package/dist/raw-fetch-DbXN3SlE.mjs +2 -0
  162. package/dist/{realtime-CjsnzHxD.mjs → realtime-onrXppzh.mjs} +9 -9
  163. package/dist/{registrar-BgOsxTnX.mjs → registrar-CbEBc5IE.mjs} +2 -2
  164. package/dist/{registrar-sandbox-3ikBD9fB.mjs → registrar-sandbox-BJhn1HFT.mjs} +3 -3
  165. package/dist/{registry-CHowrQsZ.mjs → registry-PI6sO95I.mjs} +1 -1
  166. package/dist/{reporting-hE127s5r.mjs → reporting-bXZY6obP.mjs} +1 -1
  167. package/dist/{request-headers-DiJeDAn1.mjs → request-headers-D8L95bEQ.mjs} +1 -1
  168. package/dist/{request-tracers-BCwLxmPN.mjs → request-tracers-CihskC2A.mjs} +1 -1
  169. package/dist/{resource-sharing-2qvWUuMa.mjs → resource-sharing-DDqcCHVs.mjs} +2 -2
  170. package/dist/{resource-tagging-Dwx7iL3v.mjs → resource-tagging-D63RpBce.mjs} +1 -1
  171. package/dist/{rules-DxVQ6jIg.mjs → rules-CAW0-Wde.mjs} +1 -1
  172. package/dist/{rulesets-Cdh8YjI9.mjs → rulesets-CPir63Qc.mjs} +3 -3
  173. package/dist/{rum-a4CMq4Qu.mjs → rum-BfwTcuup.mjs} +1 -1
  174. package/dist/{run-BvHwWWUX.mjs → run-CW2Cgi0S.mjs} +1 -1
  175. package/dist/run-DEynXvCc.mjs +2 -0
  176. package/dist/{schema-flags-BzoBGPWk.mjs → schema-flags-BTItUu1K.mjs} +1 -1
  177. package/dist/{scim-B8XlXl8v.mjs → scim-CtZ1FeQE.mjs} +1 -1
  178. package/dist/{secrets-store-Cqhedh_i.mjs → secrets-store-BIuBYUJT.mjs} +1 -1
  179. package/dist/{security-insights-le2-DteL.mjs → security-insights-DfUus0bs.mjs} +3 -3
  180. package/dist/{security-txt-cCArWXur.mjs → security-txt-CgZOsAIZ.mjs} +1 -1
  181. package/dist/{session-C1BhT1ZJ.mjs → session-BcM8Vyyx.mjs} +1 -1
  182. package/dist/{shared-BPjcpXuA.mjs → shared-CpS23WwR.mjs} +1 -1
  183. package/dist/{smart-shield-Csyh8hwB.mjs → smart-shield-ClgB7r-9.mjs} +5 -5
  184. package/dist/{snippets-DUWx25q6.mjs → snippets-DLO3iFAg.mjs} +1 -1
  185. package/dist/{spawn-IysxuTNW.mjs → spawn-D07wH-MH.mjs} +1 -1
  186. package/dist/{spectrum-Da3UYSOR.mjs → spectrum-B6qkjR_Z.mjs} +5 -5
  187. package/dist/{speed-NxlMnB2e.mjs → speed-DX5X2EIR.mjs} +1 -1
  188. package/dist/sql-CF044HDW.mjs +4 -0
  189. package/dist/src-BMATTZU_.mjs +125 -0
  190. package/dist/{ssl-BtaX2WEJ.mjs → ssl-CM-rChEC.mjs} +5 -5
  191. package/dist/{startup-profile-CdJWgNjd.mjs → startup-profile-CrtCP-6-.mjs} +1 -1
  192. package/dist/startup-profile-D662WI9s.mjs +2 -0
  193. package/dist/state-D7uNYnoi.mjs +2 -0
  194. package/dist/{state-BDSvdSdP.mjs → state-DIiIGEtR.mjs} +1 -1
  195. package/dist/{stream-C1Ijjzn4.mjs → stream-5EmUOQvy.mjs} +3 -3
  196. package/dist/{submit-MdkuU_Pt.mjs → submit-lEAaRSMR.mjs} +1 -1
  197. package/dist/{tags-CA1xMM96.mjs → tags-CX23P4jg.mjs} +1 -1
  198. package/dist/telemetry-0Y5hAtCX.mjs +2 -0
  199. package/dist/{telemetry-Cm39QJ-M.mjs → telemetry-ZlCi5Xhc.mjs} +1 -1
  200. package/dist/{tenant-BB6Oszcl.mjs → tenant-DnI7QziH.mjs} +1 -1
  201. package/dist/{tenant-custom-nameservers-BsbgYAEo.mjs → tenant-custom-nameservers-MR0dlcGm.mjs} +1 -1
  202. package/dist/{tunnels-CRFtyHWz.mjs → tunnels-NzYpsfi_.mjs} +15 -15
  203. package/dist/{turnstile-DBXWo_Xe.mjs → turnstile-M7sKCEz3.mjs} +11 -11
  204. package/dist/{update-check-CMXSdres.mjs → update-check-HFkPml6x.mjs} +1 -1
  205. package/dist/update-check-aTutXNRd.mjs +2 -0
  206. package/dist/update-check-worker.mjs +1 -1
  207. package/dist/{url-info-t-XAs0Mk.mjs → url-info-Dos9VOXV.mjs} +1 -1
  208. package/dist/{url-normalization-Cs4F8e0a.mjs → url-normalization-CZbFOq_v.mjs} +2 -2
  209. package/dist/{url-scanner-CBIoDbTx.mjs → url-scanner-B7quLPGW.mjs} +2 -2
  210. package/dist/{user-CevdOMoa.mjs → user-rXca0J9M.mjs} +12 -12
  211. package/dist/{values-CjNlkbIh.mjs → values-D-rrZrDa.mjs} +1 -1
  212. package/dist/{vectorize-9d9tPmg5.mjs → vectorize-D2tf_oA8.mjs} +4 -4
  213. package/dist/version-BGnqDvNR.mjs +2 -0
  214. package/dist/waiting-rooms-DrA3-0bw.mjs +53 -0
  215. package/dist/{web-assets-BHot_MU8.mjs → web-assets-DQAfvPT9.mjs} +3 -3
  216. package/dist/{web3-CYfWAF6b.mjs → web3-MI0GQDnu.mjs} +5 -5
  217. package/dist/workers-By6Pf8fv.mjs +40 -0
  218. package/dist/{workers-builds-Dw7ho3So.mjs → workers-builds-6YsWsCmC.mjs} +2 -2
  219. package/dist/{workers-for-platforms-A3yjyLh3.mjs → workers-for-platforms-DL8fC1qR.mjs} +2 -2
  220. package/dist/workers-vpc-BYx6sbgd.mjs +13 -0
  221. package/dist/workflows-ByQLnV0E.mjs +52 -0
  222. package/dist/{zaraz-BsD2dMI3.mjs → zaraz-CgbpmA85.mjs} +1 -1
  223. package/dist/{zero-trust-CA3iGQbG.mjs → zero-trust-CpjTkkWt.mjs} +42 -42
  224. package/dist/{zone-D2M4EZD0.mjs → zone-DnKIe6po.mjs} +1 -1
  225. package/dist/{zones-BoOC_JzC.mjs → zones--5ZzsDmQ.mjs} +15 -15
  226. package/package.json +12 -12
  227. package/dist/abuse-reports-BjU1s8cf.mjs +0 -24
  228. package/dist/access-C_G2MZnA.mjs +0 -2
  229. package/dist/ai-search-DGU1Y5By.mjs +0 -79
  230. package/dist/auth-CrmVwfpJ.mjs +0 -2
  231. package/dist/bot-management-DTgPwL7O.mjs +0 -9
  232. package/dist/build-B1L6xrgC.mjs +0 -2
  233. package/dist/containers-CVNfEjJs.mjs +0 -78
  234. package/dist/containers-DeoZyeQe.mjs +0 -375
  235. package/dist/d1-CE08YqYk.mjs +0 -93
  236. package/dist/diagnostics-UMbG6m4n.mjs +0 -15
  237. package/dist/dist-BHEmAAHr.mjs +0 -487
  238. package/dist/hyperdrive-qWACKfA4.mjs +0 -37
  239. package/dist/load-balancers-BNTUt4yG.mjs +0 -76
  240. package/dist/local-DlDumOSC.mjs +0 -2
  241. package/dist/organization-CdXt7AVZ.mjs +0 -75
  242. package/dist/pages-CmiOhjSl.mjs +0 -54
  243. package/dist/pipelines-DWLQC0F6.mjs +0 -44
  244. package/dist/previews-dUKEBGSM.mjs +0 -4
  245. package/dist/raw-fetch-B4NvWuZD.mjs +0 -2
  246. package/dist/run-CkbrPJPx.mjs +0 -2
  247. package/dist/sql-CNdHAlQ8.mjs +0 -4
  248. package/dist/src-JfLDUxFr.mjs +0 -125
  249. package/dist/startup-profile-B2l0ChVu.mjs +0 -2
  250. package/dist/state-JB4_BU1o.mjs +0 -2
  251. package/dist/telemetry-BsYO3nxG.mjs +0 -2
  252. package/dist/update-check-C2oVEbXx.mjs +0 -2
  253. package/dist/version-BdVUXLnK.mjs +0 -2
  254. package/dist/waiting-rooms--5WmrWb3.mjs +0 -53
  255. package/dist/workers-S17M0n3h.mjs +0 -40
  256. package/dist/workers-vpc-BZ2xXtC3.mjs +0 -13
  257. package/dist/workflows-BgGrVpSR.mjs +0 -43
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{i as t,n}from"./auth-CGLsxbc6.mjs";import{a as r,i,t as a}from"./context-q7UaYK69.mjs";import{t as o}from"./output-BOe-3AQG.mjs";import{t as s}from"./dry-run-DRj2_uV3.mjs";import{t as c}from"./progress-BtkTVcHI.mjs";import{t as l}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-DkHKPkJ7.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,i as g,n as _}from"./prompt-RlgRrmbm.mjs";import{t as v}from"./cli-types-9oYmRTHJ.mjs";function y(e){return e.usage(`$0 o11y agents sessions list
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{i as t,n}from"./auth-CAWalgW0.mjs";import{a as r,i,t as a}from"./context-BBLtgdR1.mjs";import{t as o}from"./output-BOe-3AQG.mjs";import{t as s}from"./dry-run-DRj2_uV3.mjs";import{t as c}from"./progress-CQqDtgmF.mjs";import{t as l}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-DkHKPkJ7.mjs";import{n as m}from"./input-validation-D7z60HJH.mjs";import{a as h,i as g,n as _}from"./prompt-C8FyienX.mjs";import{t as v}from"./cli-types-9oYmRTHJ.mjs";function y(e){return e.usage(`$0 o11y agents sessions list
3
3
 
4
4
  List the Sessions of one Agent in one Worker service observed in the window, most recently active first. A Session groups the Traces containing an invocation of the Agent with the same gen_ai.conversation.id. Results describe observed activity in the window, not complete history.`).option(`service`,{type:`string`,description:`Worker service that emitted the Agent invocations.`,demandOption:!0}).option(`agent`,{type:`string`,description:`Agent name reported by the invocations (gen_ai.agent.name).`,demandOption:!0}).option(`from`,{type:`number`,description:`Start of the window, as Unix epoch milliseconds. Clamped to the 7-day retention period.`,demandOption:!0}).option(`to`,{type:`number`,description:`End of the window, as Unix epoch milliseconds. Must be later than from.`,demandOption:!0}).option(`cursor`,{type:`string`,description:`Opaque cursor returned in result_info.cursors.after.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`list`,describe:`List Agent sessions`,builder:y,handler:async t=>l({command:`o11y agents sessions list`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={service:t.service,agent:t.agent,from:t.from,to:t.to,cursor:t.cursor,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf o11y agents sessions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/agents/sessions`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.observability.agents.sessions.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function te(e){return e.usage(`$0 o11y agents sessions runs <conversationId>
5
5
 
6
6
  List the Trace-level runs of one Session, newest invocation first. A run is a Trace containing an invocation of the Agent in the Conversation; the Agent need not own the Trace.`).positional(`conversation-id`,{type:`string`,description:`GenAI conversation identifier (gen_ai.conversation.id) of the Session.`,demandOption:!0}).option(`service`,{type:`string`,description:`Worker service that emitted the Agent invocations.`,demandOption:!0}).option(`agent`,{type:`string`,description:`Agent name reported by the invocations (gen_ai.agent.name).`,demandOption:!0}).option(`from`,{type:`number`,description:`Start of the window, as Unix epoch milliseconds. Clamped to the 7-day retention period.`,demandOption:!0}).option(`to`,{type:`number`,description:`End of the window, as Unix epoch milliseconds. Must be later than from.`,demandOption:!0}).option(`cursor`,{type:`string`,description:`Opaque cursor returned in result_info.cursors.after.`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`runs <conversationId>`,describe:`List Agent session runs`,builder:te,handler:async t=>l({command:`o11y agents sessions runs`,classification:{safeFlags:[`dry-run`]}},t,async()=>{let i={service:t.service,agent:t.agent,from:t.from,to:t.to,cursor:t.cursor,per_page:t[`per-page`]};if(t.dryRun){let e=await r();s({command:`cf o11y agents sessions runs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/agents/sessions/${t[`conversation-id`]==null?`<conversation-id>`:encodeURIComponent(String(t[`conversation-id`]))}/runs`,pathParams:{"conversation-id":String(t[`conversation-id`]??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.observability.agents.sessions.runs({account_id:u,conversationId:t[`conversation-id`],...i}));o(d,{successLabel:`Loaded`})})},x={command:`sessions`,describe:`Operations for agents.sessions`,builder:e=>e.command(ee).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},S={command:`agents`,describe:`Operations for agents`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.usage(`$0 o11y destinations create
7
7
 
8
- Create a new Workers Observability Telemetry Destination.`).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 w={command:`create`,describe:`Create Destination`,builder:C,handler:async t=>l({command:`o11y destinations create`,classification:{safeFlags:[`configuration-type`,`enabled`,`skip-preflight-check`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({configuration:{type:m(t[`configuration-type`],`configuration-type`,`text`),url:m(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled,name:m(t.name,`name`,`text`),skipPreflightCheck:t[`skip-preflight-check`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.destinations.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`configuration-type`]===void 0&&(t[`configuration-type`]=await g(`configuration-type`,`The configuration.type field`,[`logpush`])),t[`configuration-url`]===void 0&&(t[`configuration-url`]=await h(`configuration-url`,`The configuration.url field`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await h(`name`,`The name field`));let u=p({configuration:{type:m(t[`configuration-type`],`configuration-type`,`text`),url:m(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled,name:m(t.name,`name`,`text`),skipPreflightCheck:t[`skip-preflight-check`]}),f=await c(`Creating`,async()=>i.observability.destinations.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function T(e){return e.usage(`$0 o11y destinations delete <slug>
8
+ Create a new Workers Observability Telemetry Destination.`).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).coerce(`configuration-type`,e=>m(e,`configuration-type`,`text`)).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 w={command:`create`,describe:`Create Destination`,builder:C,handler:async t=>l({command:`o11y destinations create`,classification:{safeFlags:[`configuration-type`,`enabled`,`skip-preflight-check`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y destinations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/destinations`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({configuration:{type:t[`configuration-type`],url:m(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled,name:m(t.name,`name`,`text`),skipPreflightCheck:t[`skip-preflight-check`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.destinations.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`configuration-type`]===void 0&&(t[`configuration-type`]=await g(`configuration-type`,`The configuration.type field`,[`logpush`])),t[`configuration-url`]===void 0&&(t[`configuration-url`]=await h(`configuration-url`,`The configuration.url field`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);t.name===void 0&&(t.name=await h(`name`,`The name field`));let u=p({configuration:{type:t[`configuration-type`],url:m(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled,name:m(t.name,`name`,`text`),skipPreflightCheck:t[`skip-preflight-check`]}),f=await c(`Creating`,async()=>i.observability.destinations.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function T(e){return e.usage(`$0 o11y destinations delete <slug>
9
9
 
10
10
  Delete a Workers Observability Telemetry Destination.`).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 E={command:`delete <slug>`,describe:`Delete Destination`,builder:T,handler:async t=>l({command:`o11y destinations delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y destinations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/destinations/${t.slug==null?`<slug>`:encodeURIComponent(String(t.slug))}`,pathParams:{slug:String(t.slug??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await _({force:!!t.force})){process.stderr.write(`Aborted.
11
11
  `);return}let u=await c(`Deleting`,async()=>i.observability.destinations.delete({account_id:l,slug:t.slug}));o(u,{successLabel:`Deleted`})})};function D(e){return e.usage(`$0 o11y destinations list
12
12
 
13
13
  List your Workers Observability Telemetry Destinations.`).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 O={command:`list`,describe:`Get Destinations`,builder:v(D),handler:async t=>l({command:`o11y destinations list`,classification:{safeFlags:[`order`,`order-by`,`dry-run`]}},t,async()=>{let i={page:t.page,perPage:t[`per-page`],order:t.order,orderBy:t[`order-by`]};if(t.dryRun){let e=await r();s({command:`cf o11y destinations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/destinations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.observability.destinations.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})};function k(e){return e.usage(`$0 o11y destinations update <slug>
14
14
 
15
- Update an existing Workers Observability Telemetry Destination.`).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 A={command:`update <slug>`,describe:`Update Destination`,builder:k,handler:async t=>l({command:`o11y destinations update`,classification:{safeFlags:[`configuration-type`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/destinations/${t.slug==null?`<slug>`:encodeURIComponent(String(t.slug))}`,pathParams:{slug:String(t.slug??``)},bodyKind:`json`,body:t.body===void 0?p({configuration:{type:m(t[`configuration-type`],`configuration-type`,`text`),url:m(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.observability.destinations.update({...e,account_id:l,slug:t.slug}));o(n,{successLabel:`Updated`});return}if(t[`configuration-type`]===void 0&&(t[`configuration-type`]=await g(`configuration-type`,`The configuration.type field`,[`logpush`])),t[`configuration-url`]===void 0&&(t[`configuration-url`]=await h(`configuration-url`,`The configuration.url field`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({configuration:{type:m(t[`configuration-type`],`configuration-type`,`text`),url:m(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled}),f=await c(`Updating`,async()=>i.observability.destinations.update({...u,account_id:l,slug:t.slug}));o(f,{successLabel:`Updated`})})},j={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(w).command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.usage(`$0 o11y issues add <groupId>
15
+ Update an existing Workers Observability Telemetry Destination.`).positional(`slug`,{type:`string`,description:`Slug`,demandOption:!0}).option(`configuration-type`,{type:`string`,description:`The configuration.type field`,choices:[`logpush`]}).coerce(`configuration-type`,e=>m(e,`configuration-type`,`text`)).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 A={command:`update <slug>`,describe:`Update Destination`,builder:k,handler:async t=>l({command:`o11y destinations update`,classification:{safeFlags:[`configuration-type`,`enabled`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y destinations update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/destinations/${t.slug==null?`<slug>`:encodeURIComponent(String(t.slug))}`,pathParams:{slug:String(t.slug??``)},bodyKind:`json`,body:t.body===void 0?p({configuration:{type:t[`configuration-type`],url:m(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.observability.destinations.update({...e,account_id:l,slug:t.slug}));o(n,{successLabel:`Updated`});return}if(t[`configuration-type`]===void 0&&(t[`configuration-type`]=await g(`configuration-type`,`The configuration.type field`,[`logpush`])),t[`configuration-url`]===void 0&&(t[`configuration-url`]=await h(`configuration-url`,`The configuration.url field`)),t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=p({configuration:{type:t[`configuration-type`],url:m(t[`configuration-url`],`configuration-url`,`text`)},enabled:t.enabled}),f=await c(`Updating`,async()=>i.observability.destinations.update({...u,account_id:l,slug:t.slug}));o(f,{successLabel:`Updated`})})},j={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(w).command(E).command(O).command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.usage(`$0 o11y issues add <groupId>
16
16
 
17
17
  Add one or more ungrouped issues to an existing issue group.`).positional(`group-id`,{type:`string`,description:`GroupId`,demandOption:!0}).option(`issue-ids`,{type:`string`,array:!0,description:`The issueIds 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 N={command:`add <groupId>`,describe:`Add issue group members`,builder:M,handler:async t=>l({command:`o11y issues add`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y issues add`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/issues/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}/members`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({issueIds:t[`issue-ids`]}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.issues.add({...e,account_id:l,groupId:t[`group-id`]}));o(n,{successLabel:`Created`});return}if(t[`issue-ids`]===void 0)throw Error(`--issue-ids is required (or pass --body with this field set).`);let u=p({issueIds:t[`issue-ids`]}),f=await c(`Creating`,async()=>i.observability.issues.add({...u,account_id:l,groupId:t[`group-id`]}));o(f,{successLabel:`Created`})})};function P(e){return e.usage(`$0 o11y issues automations create
18
18
 
@@ -45,24 +45,24 @@ Retrieve aggregate issue counts for the account.`).option(`service`,{type:`strin
45
45
  Dissolve an issue group and restore its members as standalone issues.`).positional(`group-id`,{type:`string`,description:`GroupId`,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 le={command:`ungroup <groupId>`,describe:`Dissolve an issue group`,builder:ce,handler:async t=>l({command:`o11y issues ungroup`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y issues ungroup`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/issues/groups/${t[`group-id`]==null?`<group-id>`:encodeURIComponent(String(t[`group-id`]))}`,pathParams:{"group-id":String(t[`group-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await _({force:!!t.force})){process.stderr.write(`Aborted.
46
46
  `);return}let u=await c(`Deleting`,async()=>i.observability.issues.ungroup({account_id:l,groupId:t[`group-id`]}));o(u,{successLabel:`Deleted`})})};function ue(e){return e.usage(`$0 o11y issues update <issueId>
47
47
 
48
- Modify an issue status or group title.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`status`,{type:`string`,description:`The status field`,choices:[`active`,`resolved`,`ignored`]}).option(`title`,{type:`string`,description:`The title field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Modify an issue status or group title.`})}const de={command:`update <issueId>`,describe:`Modify an issue`,builder:ue,handler:async t=>l({command:`o11y issues update`,classification:{safeFlags:[`status`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y issues update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/issues/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({status:m(t.status,`status`,`text`),title:m(t.title,`title`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.observability.issues.update({...e,account_id:l,issueId:t[`issue-id`]}));o(n,{successLabel:`Updated`});return}let u=p({status:m(t.status,`status`,`text`),title:m(t.title,`title`,`text`)}),f=await c(`Updating`,async()=>i.observability.issues.update({...u,account_id:l,issueId:t[`issue-id`]}));o(f,{successLabel:`Updated`})})},fe={command:`issues`,describe:`Operations for issues`,builder:e=>e.command(N).command(K).command(J).command(X).command(Q).command(re).command(ae).command(se).command(le).command(de).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.usage(`$0 o11y metrics-export list
48
+ Modify an issue status or group title.`).positional(`issue-id`,{type:`string`,description:`IssueId`,demandOption:!0}).option(`status`,{type:`string`,description:`The status field`,choices:[`active`,`resolved`,`ignored`]}).coerce(`status`,e=>m(e,`status`,`text`)).option(`title`,{type:`string`,description:`The title field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Modify an issue status or group title.`})}const de={command:`update <issueId>`,describe:`Modify an issue`,builder:ue,handler:async t=>l({command:`o11y issues update`,classification:{safeFlags:[`status`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y issues update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/issues/${t[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(t[`issue-id`]))}`,pathParams:{"issue-id":String(t[`issue-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({status:t.status,title:m(t.title,`title`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.observability.issues.update({...e,account_id:l,issueId:t[`issue-id`]}));o(n,{successLabel:`Updated`});return}let u=p({status:t.status,title:m(t.title,`title`,`text`)}),f=await c(`Updating`,async()=>i.observability.issues.update({...u,account_id:l,issueId:t[`issue-id`]}));o(f,{successLabel:`Updated`})})},fe={command:`issues`,describe:`Operations for issues`,builder:e=>e.command(N).command(K).command(J).command(X).command(Q).command(re).command(ae).command(se).command(le).command(de).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.usage(`$0 o11y metrics-export list
49
49
 
50
50
  List resources configured for Workers Observability metrics export.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`List Metrics Exports`,builder:pe,handler:async i=>l({command:`o11y metrics-export list`,classification:{safeFlags:[`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf o11y metrics-export list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/metricsexport`,pathParams:{},bodyKind:`none`});return}let l=await n(i),u=i.local?e:await a();i.accountId=u;let d=await c(`Loading`,async()=>t(l,`GET`,`/accounts/${u}/workers/observability/metricsexport`));o(d,{successLabel:`Loaded`})})};function he(e){return e.usage(`$0 o11y metrics-export upsert
51
51
 
52
- Create or replace resources configured for Workers Observability metrics export.`).option(`requester-requester-id`,{type:`string`,description:`The requester.requesterId field`}).option(`requester-requester-type`,{type:`string`,description:`The requester.requesterType field`,choices:[`workers`]}).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json.`}).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 ge={command:`upsert`,describe:`Upsert Metrics Exports`,builder:he,handler:async i=>l({command:`o11y metrics-export upsert`,classification:{safeFlags:[`requester-requester-type`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf o11y metrics-export upsert`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/metricsexport`,pathParams:{},bodyKind:`json`,body:i.body===void 0?p({requester:{requesterId:m(i[`requester-requester-id`],`requester-requester-id`,`text`),requesterType:m(i[`requester-requester-type`],`requester-requester-type`,`text`)},resources:f(i.resources,`resources`)}):d(i.body)});return}let l=await n(i),_=i.local?e:await a();if(i.accountId=_,i.body){let e=d(i.body),n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${_}/workers/observability/metricsexport`,{body:e}));o(n,{successLabel:`Created`});return}if(i[`requester-requester-id`]===void 0&&(i[`requester-requester-id`]=await h(`requester-requester-id`,`The requester.requesterId field`)),i[`requester-requester-type`]===void 0&&(i[`requester-requester-type`]=await g(`requester-requester-type`,`The requester.requesterType field`,[`workers`])),i.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let v={};i[`requester-requester-id`]!==void 0&&u(v,[`requester`,`requesterId`],m(i[`requester-requester-id`],`requester-requester-id`,`text`)),i[`requester-requester-type`]!==void 0&&u(v,[`requester`,`requesterType`],m(i[`requester-requester-type`],`requester-requester-type`,`text`)),i.resources!==void 0&&u(v,[`resources`],f(i.resources,`resources`));let y=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${_}/workers/observability/metricsexport`,{body:Object.keys(v).length>0?v:void 0}));o(y,{successLabel:`Created`})})},_e={command:`metrics-export`,describe:`Operations for metrics-export`,builder:e=>e.command(me).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.usage(`$0 o11y queries create
52
+ Create or replace resources configured for Workers Observability metrics export.`).option(`requester-requester-id`,{type:`string`,description:`The requester.requesterId field`}).option(`requester-requester-type`,{type:`string`,description:`The requester.requesterType field`,choices:[`workers`]}).coerce(`requester-requester-type`,e=>m(e,`requester-requester-type`,`text`)).option(`resources`,{type:`string`,description:`The resources field. Provide as a JSON array of objects or @path/to/file.json.`}).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 ge={command:`upsert`,describe:`Upsert Metrics Exports`,builder:he,handler:async i=>l({command:`o11y metrics-export upsert`,classification:{safeFlags:[`requester-requester-type`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf o11y metrics-export upsert`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/metricsexport`,pathParams:{},bodyKind:`json`,body:i.body===void 0?p({requester:{requesterId:m(i[`requester-requester-id`],`requester-requester-id`,`text`),requesterType:i[`requester-requester-type`]},resources:f(i.resources,`resources`)}):d(i.body)});return}let l=await n(i),_=i.local?e:await a();if(i.accountId=_,i.body){let e=d(i.body),n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${_}/workers/observability/metricsexport`,{body:e}));o(n,{successLabel:`Created`});return}if(i[`requester-requester-id`]===void 0&&(i[`requester-requester-id`]=await h(`requester-requester-id`,`The requester.requesterId field`)),i[`requester-requester-type`]===void 0&&(i[`requester-requester-type`]=await g(`requester-requester-type`,`The requester.requesterType field`,[`workers`])),i.resources===void 0)throw Error(`--resources is required (or pass --body with this field set).`);let v={};i[`requester-requester-id`]!==void 0&&u(v,[`requester`,`requesterId`],m(i[`requester-requester-id`],`requester-requester-id`,`text`)),i[`requester-requester-type`]!==void 0&&u(v,[`requester`,`requesterType`],i[`requester-requester-type`]),i.resources!==void 0&&u(v,[`resources`],f(i.resources,`resources`));let y=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${_}/workers/observability/metricsexport`,{body:Object.keys(v).length>0?v:void 0}));o(y,{successLabel:`Created`})})},_e={command:`metrics-export`,describe:`Operations for metrics-export`,builder:e=>e.command(me).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.usage(`$0 o11y queries create
53
53
 
54
- Persist query for later use.`).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 ye={command:`create`,describe:`Save query`,builder:ve,handler:async t=>l({command:`o11y queries create`,classification:{safeFlags:[`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:m(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:m(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.queries.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.description===void 0&&(t.description=await h(`description`,`The description field`)),t.name===void 0&&(t.name=await h(`name`,`Query name`)),t[`parameters-order-by-value`]===void 0&&(t[`parameters-order-by-value`]=await h(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:m(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:m(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}),f=await c(`Creating`,async()=>i.observability.queries.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function be(e){return e.usage(`$0 o11y queries delete <queryId>
54
+ Persist query for later use.`).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`]}).coerce(`parameters-filter-combination`,e=>m(e,`parameters-filter-combination`,`text`)).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`]}).coerce(`parameters-order-by-order`,e=>m(e,`parameters-order-by-order`,`text`)).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 ye={command:`create`,describe:`Save query`,builder:ve,handler:async t=>l({command:`o11y queries create`,classification:{safeFlags:[`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/queries`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:t[`parameters-filter-combination`],limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:t[`parameters-order-by-order`],value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.queries.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}t.description===void 0&&(t.description=await h(`description`,`The description field`)),t.name===void 0&&(t.name=await h(`name`,`Query name`)),t[`parameters-order-by-value`]===void 0&&(t[`parameters-order-by-value`]=await h(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:t[`parameters-filter-combination`],limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:t[`parameters-order-by-order`],value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}),f=await c(`Creating`,async()=>i.observability.queries.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function be(e){return e.usage(`$0 o11y queries delete <queryId>
55
55
 
56
56
  Delete a saved query.`).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 xe={command:`delete <queryId>`,describe:`Delete query`,builder:be,handler:async t=>l({command:`o11y queries delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y queries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,!await _({force:!!t.force})){process.stderr.write(`Aborted.
57
57
  `);return}let u=await c(`Deleting`,async()=>i.observability.queries.delete({account_id:l,queryId:t[`query-id`]}));o(u,{successLabel:`Deleted`})})};function Se(e){return e.usage(`$0 o11y queries edit <queryId>
58
58
 
59
- Update saved query.`).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 Ce={command:`edit <queryId>`,describe:`Update query`,builder:Se,handler:async t=>l({command:`o11y queries edit`,classification:{safeFlags:[`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:m(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:m(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.observability.queries.edit({...e,account_id:l,queryId:t[`query-id`]}));o(n,{successLabel:`Updated`});return}t.description===void 0&&(t.description=await h(`description`,`The description field`)),t.name===void 0&&(t.name=await h(`name`,`Query name`)),t[`parameters-order-by-value`]===void 0&&(t[`parameters-order-by-value`]=await h(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:m(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:m(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}),f=await c(`Updating`,async()=>i.observability.queries.edit({...u,account_id:l,queryId:t[`query-id`]}));o(f,{successLabel:`Updated`})})};function we(e){return e.usage(`$0 o11y queries get <queryId>
59
+ Update saved query.`).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`]}).coerce(`parameters-filter-combination`,e=>m(e,`parameters-filter-combination`,`text`)).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`]}).coerce(`parameters-order-by-order`,e=>m(e,`parameters-order-by-order`,`text`)).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 Ce={command:`edit <queryId>`,describe:`Update query`,builder:Se,handler:async t=>l({command:`o11y queries edit`,classification:{safeFlags:[`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y queries edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-id`]??``)},bodyKind:`json`,body:t.body===void 0?p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:t[`parameters-filter-combination`],limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:t[`parameters-order-by-order`],value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Updating`,async()=>i.observability.queries.edit({...e,account_id:l,queryId:t[`query-id`]}));o(n,{successLabel:`Updated`});return}t.description===void 0&&(t.description=await h(`description`,`The description field`)),t.name===void 0&&(t.name=await h(`name`,`Query name`)),t[`parameters-order-by-value`]===void 0&&(t[`parameters-order-by-value`]=await h(`parameters-order-by-value`,`Configure which Calculation to order the results by.`));let u=p({description:m(t.description,`description`,`text`),name:m(t.name,`name`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:t[`parameters-filter-combination`],limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:t[`parameters-order-by-order`],value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}}}),f=await c(`Updating`,async()=>i.observability.queries.edit({...u,account_id:l,queryId:t[`query-id`]}));o(f,{successLabel:`Updated`})})};function we(e){return e.usage(`$0 o11y queries get <queryId>
60
60
 
61
61
  Retrieve a saved query.`).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 Te={command:`get <queryId>`,describe:`Get query`,builder:we,handler:async t=>l({command:`o11y queries get`,classification:{safeFlags:[`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/queries/${t[`query-id`]==null?`<query-id>`:encodeURIComponent(String(t[`query-id`]))}`,pathParams:{"query-id":String(t[`query-id`]??``)},bodyKind:`none`});return}let i=await n(t),l=t.local?e:await a();t.accountId=l;let u=await c(`Loading`,async()=>i.observability.queries.get({account_id:l,queryId:t[`query-id`]}));o(u,{successLabel:`Loaded`})})};function Ee(e){return e.usage(`$0 o11y queries list
62
62
 
63
63
  List saved queries.`).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 De={command:`list`,describe:`List queries`,builder:v(Ee),handler:async t=>l({command:`o11y queries list`,classification:{safeFlags:[`order`,`order-by`,`dry-run`]}},t,async()=>{let i={page:t.page,perPage:t[`per-page`],order:t.order,orderBy:t[`order-by`]};if(t.dryRun){let e=await r();s({command:`cf o11y queries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/queries`,pathParams:{},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.observability.queries.list({account_id:u,...i}));o(d,{successLabel:`Loaded`})})},Oe={command:`queries`,describe:`Operations for queries`,builder:e=>e.command(ye).command(xe).command(Ce).command(Te).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ke(e){return e.usage(`$0 o11y shared-queries create
64
64
 
65
- Shared queries store the results of a previously run query, allowing you to share the results with others.`).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(`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 Ae={command:`create`,describe:`Create a sharable link to a query result`,builder:ke,handler:async t=>l({command:`o11y shared-queries create`,classification:{safeFlags:[`chart`,`chart-type`,`compare`,`distribution-scale`,`ignore-series`,`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`view`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y shared-queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/shared/query`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({chart:t.chart,chartType:m(t[`chart-type`],`chart-type`,`text`),compare:t.compare,distributionScale:m(t[`distribution-scale`],`distribution-scale`,`text`),granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:m(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:m(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:m(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:m(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:m(t.view,`view`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.sharedQueries.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`query-id`]===void 0&&(t[`query-id`]=await h(`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).`)),t[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(t[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let u=p({chart:t.chart,chartType:m(t[`chart-type`],`chart-type`,`text`),compare:t.compare,distributionScale:m(t[`distribution-scale`],`distribution-scale`,`text`),granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:m(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:m(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:m(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:m(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:m(t.view,`view`,`text`)}),f=await c(`Creating`,async()=>i.observability.sharedQueries.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function je(e){return e.usage(`$0 o11y shared-queries get <id>
65
+ Shared queries store the results of a previously run query, allowing you to share the results with others.`).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`]}).coerce(`chart-type`,e=>m(e,`chart-type`,`text`)).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`]}).coerce(`distribution-scale`,e=>m(e,`distribution-scale`,`text`)).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`]}).coerce(`parameters-filter-combination`,e=>m(e,`parameters-filter-combination`,`text`)).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`]}).coerce(`parameters-order-by-order`,e=>m(e,`parameters-order-by-order`,`text`)).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`}).coerce(`view`,e=>m(e,`view`,`text`)).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 Ae={command:`create`,describe:`Create a sharable link to a query result`,builder:ke,handler:async t=>l({command:`o11y shared-queries create`,classification:{safeFlags:[`chart`,`chart-type`,`compare`,`distribution-scale`,`ignore-series`,`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`view`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y shared-queries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/shared/query`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({chart:t.chart,chartType:t[`chart-type`],compare:t.compare,distributionScale:t[`distribution-scale`],granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:m(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:m(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:t[`parameters-filter-combination`],limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:t[`parameters-order-by-order`],value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:t.view}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.sharedQueries.create({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t[`query-id`]===void 0&&(t[`query-id`]=await h(`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).`)),t[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(t[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let u=p({chart:t.chart,chartType:t[`chart-type`],compare:t.compare,distributionScale:t[`distribution-scale`],granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:m(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:m(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:t[`parameters-filter-combination`],limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:t[`parameters-order-by-order`],value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:t.view}),f=await c(`Creating`,async()=>i.observability.sharedQueries.create({...u,account_id:l}));o(f,{successLabel:`Created`})})};function je(e){return e.usage(`$0 o11y shared-queries get <id>
66
66
 
67
67
  Shared queries store the results of a previously run query, allowing you to share the results with others.`).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 Me={command:`get <id>`,describe:`View a query that has been shared`,builder:v(je),handler:async t=>l({command:`o11y shared-queries get`,classification:{safeFlags:[`view`,`dry-run`]}},t,async()=>{let i={view:t.view};if(t.dryRun){let e=await r();s({command:`cf o11y shared-queries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/shared/query/${t.id==null?`<id>`:encodeURIComponent(String(t.id))}`,pathParams:{id:String(t.id??``)},query:i,bodyKind:`none`});return}let l=await n(t),u=t.local?e:await a();t.accountId=u;let d=await c(`Loading`,async()=>l.observability.sharedQueries.get({account_id:u,id:t.id,...i}));o(d,{successLabel:`Loaded`})})},Ne={command:`shared-queries`,describe:`Operations for shared-queries`,builder:e=>e.command(Ae).command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Pe(e){return e.usage(`$0 o11y telemetry heartbeat
68
68
 
@@ -70,11 +70,11 @@ Notify live tail that user is still eligible to receive live events.`).option(`s
70
70
 
71
71
  List all the keys in your telemetry events.`).option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`filters`,{type:`string`,description:`Apply filters to narrow key discovery. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. Provide as a JSON array of objects or @path/to/file.json.`}).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 Le={command:`keys`,describe:`List keys`,builder:Ie,handler:async t=>l({command:`o11y telemetry keys`,classification:{safeFlags:[`key-needle-is-regex`,`key-needle-match-case`,`needle-is-regex`,`needle-match-case`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y telemetry keys`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/telemetry/keys`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({datasets:t.datasets,filters:f(t.filters,`filters`),from:t.from,keyNeedle:{isRegex:t[`key-needle-is-regex`],matchCase:t[`key-needle-match-case`]},limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},to:t.to}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.telemetry.keys({...e,account_id:l}));o(n,{successLabel:`Created`});return}let u=p({datasets:t.datasets,filters:f(t.filters,`filters`),from:t.from,keyNeedle:{isRegex:t[`key-needle-is-regex`],matchCase:t[`key-needle-match-case`]},limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},to:t.to}),m=await c(`Creating`,async()=>i.observability.telemetry.keys({...u,account_id:l}));o(m,{successLabel:`Created`})})};function Re(e){return e.usage(`$0 o11y telemetry live-tail
72
72
 
73
- Prepare websocket server for live tail.`).option(`filter-combination`,{type:`string`,description:`Set a flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`],default:`and`}).option(`filters`,{type:`string`,description:`Apply filters to the query. Supports nested groups via kind: 'group'. Provide as a JSON array of objects or @path/to/file.json.`}).option(`script-id`,{type:`string`,description:`The scriptId field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create websocket server for live tail.`})}const ze={command:`live-tail`,describe:`Prepare live tail`,builder:Re,handler:async i=>l({command:`o11y telemetry live-tail`,classification:{safeFlags:[`filter-combination`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf o11y telemetry live-tail`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/telemetry/live-tail`,pathParams:{},bodyKind:`json`,body:i.body===void 0?p({filterCombination:m(i[`filter-combination`],`filter-combination`,`text`),filters:f(i.filters,`filters`),scriptId:m(i[`script-id`],`script-id`,`text`)}):d(i.body)});return}let l=await n(i),h=i.local?e:await a();if(i.accountId=h,i.body){let e=d(i.body),n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${h}/workers/observability/telemetry/live-tail`,{body:e}));o(n,{successLabel:`Created`});return}let g={};i[`filter-combination`]!==void 0&&u(g,[`filterCombination`],m(i[`filter-combination`],`filter-combination`,`text`)),i.filters!==void 0&&u(g,[`filters`],f(i.filters,`filters`)),i[`script-id`]!==void 0&&u(g,[`scriptId`],m(i[`script-id`],`script-id`,`text`));let _=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${h}/workers/observability/telemetry/live-tail`,{body:Object.keys(g).length>0?g:void 0}));o(_,{successLabel:`Created`})})};function Be(e){return e.usage(`$0 o11y telemetry query
73
+ Prepare websocket server for live tail.`).option(`filter-combination`,{type:`string`,description:`Set a flag to describe how to combine the filters on the query.`,choices:[`and`,`or`,`AND`,`OR`],default:`and`}).coerce(`filter-combination`,e=>m(e,`filter-combination`,`text`)).option(`filters`,{type:`string`,description:`Apply filters to the query. Supports nested groups via kind: 'group'. Provide as a JSON array of objects or @path/to/file.json.`}).option(`script-id`,{type:`string`,description:`The scriptId field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Create websocket server for live tail.`})}const ze={command:`live-tail`,describe:`Prepare live tail`,builder:Re,handler:async i=>l({command:`o11y telemetry live-tail`,classification:{safeFlags:[`filter-combination`,`dry-run`]}},i,async()=>{if(i.dryRun){let e=await r();s({command:`cf o11y telemetry live-tail`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/telemetry/live-tail`,pathParams:{},bodyKind:`json`,body:i.body===void 0?p({filterCombination:i[`filter-combination`],filters:f(i.filters,`filters`),scriptId:m(i[`script-id`],`script-id`,`text`)}):d(i.body)});return}let l=await n(i),h=i.local?e:await a();if(i.accountId=h,i.body){let e=d(i.body),n=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${h}/workers/observability/telemetry/live-tail`,{body:e}));o(n,{successLabel:`Created`});return}let g={};i[`filter-combination`]!==void 0&&u(g,[`filterCombination`],i[`filter-combination`]),i.filters!==void 0&&u(g,[`filters`],f(i.filters,`filters`)),i[`script-id`]!==void 0&&u(g,[`scriptId`],m(i[`script-id`],`script-id`,`text`));let _=await c(`Creating`,async()=>t(l,`POST`,`/accounts/${h}/workers/observability/telemetry/live-tail`,{body:Object.keys(g).length>0?g:void 0}));o(_,{successLabel:`Created`})})};function Be(e){return e.usage(`$0 o11y telemetry query
74
74
 
75
- Run a temporary or saved query.`).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(`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 Ve={command:`query`,describe:`Run a query`,builder:Be,handler:async t=>l({command:`o11y telemetry query`,classification:{safeFlags:[`chart`,`chart-type`,`compare`,`distribution-scale`,`ignore-series`,`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`view`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({chart:t.chart,chartType:m(t[`chart-type`],`chart-type`,`text`),compare:t.compare,distributionScale:m(t[`distribution-scale`],`distribution-scale`,`text`),granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:m(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:m(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:m(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:m(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:m(t.view,`view`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Loading`,async()=>i.observability.telemetry.query({...e,account_id:l}));o(n,{successLabel:`Loaded`});return}if(t[`query-id`]===void 0&&(t[`query-id`]=await h(`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).`)),t[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(t[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let u=p({chart:t.chart,chartType:m(t[`chart-type`],`chart-type`,`text`),compare:t.compare,distributionScale:m(t[`distribution-scale`],`distribution-scale`,`text`),granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:m(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:m(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:m(t[`parameters-filter-combination`],`parameters-filter-combination`,`text`),limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:m(t[`parameters-order-by-order`],`parameters-order-by-order`,`text`),value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:m(t.view,`view`,`text`)}),f=await c(`Loading`,async()=>i.observability.telemetry.query({...u,account_id:l}));o(f,{successLabel:`Loaded`})})};function He(e){return e.usage(`$0 o11y telemetry values
75
+ Run a temporary or saved query.`).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`]}).coerce(`chart-type`,e=>m(e,`chart-type`,`text`)).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`]}).coerce(`distribution-scale`,e=>m(e,`distribution-scale`,`text`)).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`]}).coerce(`parameters-filter-combination`,e=>m(e,`parameters-filter-combination`,`text`)).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`]}).coerce(`parameters-order-by-order`,e=>m(e,`parameters-order-by-order`,`text`)).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`}).coerce(`view`,e=>m(e,`view`,`text`)).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 Ve={command:`query`,describe:`Run a query`,builder:Be,handler:async t=>l({command:`o11y telemetry query`,classification:{safeFlags:[`chart`,`chart-type`,`compare`,`distribution-scale`,`ignore-series`,`parameters-filter-combination`,`parameters-needle-is-regex`,`parameters-needle-match-case`,`parameters-order-by-order`,`view`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y telemetry query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/telemetry/query`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({chart:t.chart,chartType:t[`chart-type`],compare:t.compare,distributionScale:t[`distribution-scale`],granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:m(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:m(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:t[`parameters-filter-combination`],limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:t[`parameters-order-by-order`],value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:t.view}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Loading`,async()=>i.observability.telemetry.query({...e,account_id:l}));o(n,{successLabel:`Loaded`});return}if(t[`query-id`]===void 0&&(t[`query-id`]=await h(`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).`)),t[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(t[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);let u=p({chart:t.chart,chartType:t[`chart-type`],compare:t.compare,distributionScale:t[`distribution-scale`],granularity:t.granularity,ignoreSeries:t[`ignore-series`],limit:t.limit,offset:m(t.offset,`offset`,`text`),offsetBy:t[`offset-by`],offsetDirection:m(t[`offset-direction`],`offset-direction`,`text`),parameters:{datasets:t[`parameters-datasets`],filterCombination:t[`parameters-filter-combination`],limit:t[`parameters-limit`],needle:{isRegex:t[`parameters-needle-is-regex`],matchCase:t[`parameters-needle-match-case`]},orderBy:{order:t[`parameters-order-by-order`],value:m(t[`parameters-order-by-value`],`parameters-order-by-value`,`text`)}},queryId:m(t[`query-id`],`query-id`,`text`),timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},view:t.view}),f=await c(`Loading`,async()=>i.observability.telemetry.query({...u,account_id:l}));o(f,{successLabel:`Loaded`})})};function He(e){return e.usage(`$0 o11y telemetry values
76
76
 
77
- List unique values found in your events.`).option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`filters`,{type:`string`,description:`Apply filters before listing values. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. Provide as a JSON array of objects or @path/to/file.json.`}).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 Ue={command:`values`,describe:`List values`,builder:He,handler:async t=>l({command:`o11y telemetry values`,classification:{safeFlags:[`needle-is-regex`,`needle-match-case`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({datasets:t.datasets,filters:f(t.filters,`filters`),key:m(t.key,`key`,`text`),limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},type:m(t.type,`type`,`text`)}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.telemetry.values({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(t.key===void 0&&(t.key=await h(`key`,`The key field`)),t[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(t[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);t.type===void 0&&(t.type=await g(`type`,`The type field`,[`string`,`boolean`,`number`]));let u=p({datasets:t.datasets,filters:f(t.filters,`filters`),key:m(t.key,`key`,`text`),limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},type:m(t.type,`type`,`text`)}),_=await c(`Creating`,async()=>i.observability.telemetry.values({...u,account_id:l}));o(_,{successLabel:`Created`})})},We={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(Fe).command(Le).command(ze).command(Ve).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ge(e){return e.usage(`$0 o11y tracing rules delete
77
+ List unique values found in your events.`).option(`datasets`,{type:`string`,array:!0,description:`Leave this empty to use the default datasets`}).option(`filters`,{type:`string`,description:`Apply filters before listing values. Supports nested groups via kind: 'group'. Maximum nesting depth is 4. Provide as a JSON array of objects or @path/to/file.json.`}).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`]}).coerce(`type`,e=>m(e,`type`,`text`)).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 Ue={command:`values`,describe:`List values`,builder:He,handler:async t=>l({command:`o11y telemetry values`,classification:{safeFlags:[`needle-is-regex`,`needle-match-case`,`type`,`dry-run`]}},t,async()=>{if(t.dryRun){let e=await r();s({command:`cf o11y telemetry values`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/telemetry/values`,pathParams:{},bodyKind:`json`,body:t.body===void 0?p({datasets:t.datasets,filters:f(t.filters,`filters`),key:m(t.key,`key`,`text`),limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},type:t.type}):d(t.body)});return}let i=await n(t),l=t.local?e:await a();if(t.accountId=l,t.body){let e=d(t.body),n=await c(`Creating`,async()=>i.observability.telemetry.values({...e,account_id:l}));o(n,{successLabel:`Created`});return}if(t.datasets===void 0)throw Error(`--datasets is required (or pass --body with this field set).`);if(t.key===void 0&&(t.key=await h(`key`,`The key field`)),t[`timeframe-from`]===void 0)throw Error(`--timeframe-from is required (or pass --body with this field set).`);if(t[`timeframe-to`]===void 0)throw Error(`--timeframe-to is required (or pass --body with this field set).`);t.type===void 0&&(t.type=await g(`type`,`The type field`,[`string`,`boolean`,`number`]));let u=p({datasets:t.datasets,filters:f(t.filters,`filters`),key:m(t.key,`key`,`text`),limit:t.limit,needle:{isRegex:t[`needle-is-regex`],matchCase:t[`needle-match-case`]},timeframe:{from:t[`timeframe-from`],to:t[`timeframe-to`]},type:t.type}),_=await c(`Creating`,async()=>i.observability.telemetry.values({...u,account_id:l}));o(_,{successLabel:`Created`})})},We={command:`telemetry`,describe:`Operations for telemetry`,builder:e=>e.command(Fe).command(Le).command(ze).command(Ve).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ge(e){return e.usage(`$0 o11y tracing rules delete
78
78
 
79
79
  Delete every sampling override from a zone's managed Cloudflare Traces ruleset.`).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 Ke={command:`delete`,describe:`Delete zone trace rules`,builder:Ge,handler:async e=>l({command:`o11y tracing rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},e,async()=>{if(e.dryRun){s({command:`cf o11y tracing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,!await _({force:!!e.force})){process.stderr.write(`Aborted.
80
80
  `);return}let a=await c(`Deleting`,async()=>t.observability.tracing.rules.delete({zone_id:r}));o(a,{successLabel:`Deleted`})})};function qe(e){return e.usage(`$0 o11y tracing rules get
@@ -88,6 +88,6 @@ Reset the zone-level Cloudflare Traces settings to their defaults while preservi
88
88
 
89
89
  Retrieve the zone-level Cloudflare Traces settings.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const et={command:`get`,describe:`View zone tracing settings`,builder:$e,handler:async e=>l({command:`o11y tracing settings get`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf o11y tracing settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r;let a=await c(`Loading`,async()=>t.observability.tracing.settings.get({zone_id:r}));o(a,{successLabel:`Loaded`})})};function tt(e){return e.usage(`$0 o11y tracing settings update
90
90
 
91
- Update the zone-level Cloudflare Traces settings.`).option(`destinations`,{type:`string`,array:!0,description:`Up to 100 OpenTelemetry destination identifiers that receive traces.`}).option(`enabled`,{type:`boolean`,description:`Whether Cloudflare Traces is enabled for the zone.`}).option(`forward-context`,{type:`boolean`,description:`Whether trace context is sent externally or across a zone boundary.`}).option(`persist`,{type:`boolean`,description:`Whether traces are persisted in Cloudflare.`}).option(`propagation-policy`,{type:`string`,description:`When inbound trace context may be continued. Authenticated propagation is not supported yet.`,choices:[`accept`,`authenticated`,`reject`]}).option(`sampling-ratio`,{type:`number`,description:`The ratio of requests sampled for tracing, from 0 to 1.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update zone tracing settings`})}const nt={command:`update`,describe:`Update zone tracing settings`,builder:tt,handler:async e=>l({command:`o11y tracing settings update`,classification:{safeFlags:[`enabled`,`forward-context`,`persist`,`propagation-policy`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf o11y tracing settings update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({destinations:e.destinations,enabled:e.enabled,forward_context:e[`forward-context`],persist:e.persist,propagation_policy:m(e[`propagation-policy`],`propagation-policy`,`text`),sampling_ratio:e[`sampling-ratio`]}):d(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=d(e.body),i=await c(`Updating`,async()=>t.observability.tracing.settings.update({...n,zone_id:r}));o(i,{successLabel:`Updated`});return}let a=p({destinations:e.destinations,enabled:e.enabled,forward_context:e[`forward-context`],persist:e.persist,propagation_policy:m(e[`propagation-policy`],`propagation-policy`,`text`),sampling_ratio:e[`sampling-ratio`]}),l=await c(`Updating`,async()=>t.observability.tracing.settings.update({...a,zone_id:r}));o(l,{successLabel:`Updated`})})},rt={command:`settings`,describe:`Operations for tracing.settings`,builder:e=>e.command(Qe).command(et).command(nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},it={command:`tracing`,describe:`Operations for tracing`,builder:e=>e.command(Xe).command(rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function at(e){return e.usage(`$0 o11y usage
91
+ Update the zone-level Cloudflare Traces settings.`).option(`destinations`,{type:`string`,array:!0,description:`Up to 100 OpenTelemetry destination identifiers that receive traces.`}).option(`enabled`,{type:`boolean`,description:`Whether Cloudflare Traces is enabled for the zone.`}).option(`forward-context`,{type:`boolean`,description:`Whether trace context is sent externally or across a zone boundary.`}).option(`persist`,{type:`boolean`,description:`Whether traces are persisted in Cloudflare.`}).option(`propagation-policy`,{type:`string`,description:`When inbound trace context may be continued. Authenticated propagation is not supported yet.`,choices:[`accept`,`authenticated`,`reject`]}).coerce(`propagation-policy`,e=>m(e,`propagation-policy`,`text`)).option(`sampling-ratio`,{type:`number`,description:`The ratio of requests sampled for tracing, from 0 to 1.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Update zone tracing settings`})}const nt={command:`update`,describe:`Update zone tracing settings`,builder:tt,handler:async e=>l({command:`o11y tracing settings update`,classification:{safeFlags:[`enabled`,`forward-context`,`persist`,`propagation-policy`,`dry-run`]}},e,async()=>{if(e.dryRun){s({command:`cf o11y tracing settings update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/observability/tracing/settings`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?p({destinations:e.destinations,enabled:e.enabled,forward_context:e[`forward-context`],persist:e.persist,propagation_policy:e[`propagation-policy`],sampling_ratio:e[`sampling-ratio`]}):d(e.body)});return}let t=await n(e),r=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=d(e.body),i=await c(`Updating`,async()=>t.observability.tracing.settings.update({...n,zone_id:r}));o(i,{successLabel:`Updated`});return}let a=p({destinations:e.destinations,enabled:e.enabled,forward_context:e[`forward-context`],persist:e.persist,propagation_policy:e[`propagation-policy`],sampling_ratio:e[`sampling-ratio`]}),l=await c(`Updating`,async()=>t.observability.tracing.settings.update({...a,zone_id:r}));o(l,{successLabel:`Updated`})})},rt={command:`settings`,describe:`Operations for tracing.settings`,builder:e=>e.command(Qe).command(et).command(nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},it={command:`tracing`,describe:`Operations for tracing`,builder:e=>e.command(Xe).command(rt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function at(e){return e.usage(`$0 o11y usage
92
92
 
93
- Event counts broken down by dataset and service, bucketed by day, for up to 90 days. The top-level events field is the sum of all breakdown counts.`).option(`from`,{type:`string`,description:`Unix timestamp in milliseconds for the start of the range.`,demandOption:!0}).option(`to`,{type:`string`,description:`Unix timestamp in milliseconds for the end of the range.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`usage`,describe:`Get event count`,builder:at,handler:async i=>l({command:`o11y usage`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={from:i.from,to:i.to};if(i.dryRun){let e=await r();s({command:`cf o11y usage`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/usage`,pathParams:{},query:l,bodyKind:`none`});return}let u=await n(i),d=i.local?e:await a();i.accountId=d;let f=await c(`Loading`,async()=>t(u,`GET`,`/accounts/${d}/workers/observability/usage`,{query:l}));o(f,{successLabel:`Loaded`})})},st={command:`o11y`,describe:`o11y`,builder:e=>e.command(ot).command(S).command(j).command(fe).command(_e).command(Oe).command(Ne).command(We).command(it).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{st as default};
93
+ Event counts and sizes broken down by dataset and service, bucketed by day, for up to 90 days. The top-level events field is the sum of all breakdown counts.`).option(`from`,{type:`string`,description:`Unix timestamp in milliseconds for the start of the range.`,demandOption:!0}).option(`to`,{type:`string`,description:`Unix timestamp in milliseconds for the end of the range.`,demandOption:!0}).option(`tz`,{type:`string`,description:`IANA timezone used to align daily bins to local midnight (e.g. 'America/Chicago'). Defaults to UTC.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`usage`,describe:`Get event count`,builder:at,handler:async i=>l({command:`o11y usage`,classification:{safeFlags:[`dry-run`]}},i,async()=>{let l={from:i.from,to:i.to,tz:i.tz};if(i.dryRun){let e=await r();s({command:`cf o11y usage`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/workers/observability/usage`,pathParams:{},query:l,bodyKind:`none`});return}let u=await n(i),d=i.local?e:await a();i.accountId=d;let f=await c(`Loading`,async()=>t(u,`GET`,`/accounts/${d}/workers/observability/usage`,{query:l}));o(f,{successLabel:`Loaded`})})},st={command:`o11y`,describe:`o11y`,builder:e=>e.command(ot).command(S).command(j).command(fe).command(_e).command(Oe).command(Ne).command(We).command(it).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{st as default};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t,t as n}from"./version-BdVUXLnK.mjs";import{t as r}from"./session-C1BhT1ZJ.mjs";import{a as i,n as a,t as o}from"./cf-BxsXrVeh.mjs";import{i as s,o as c,s as l}from"./dist-uRuGmkMB.mjs";import{n as u}from"./interactive-BW9T1D1q.mjs";import{n as d}from"./context-q7UaYK69.mjs";const f={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 p=class extends Error{};async function m(n){if(u())throw new p;r(t);let i=await c({message:n});if(l(i)||typeof i!=`string`)throw new e(130,{cancelled:!0});return i}async function h(n,i){if(u())throw new p;r(t);let a=await s({message:n,options:i.choices.map(({title:e,value:t})=>({label:e,value:t}))});if(l(a)||typeof a!=`string`)throw new e(130,{cancelled:!0});return f.log(`To have cf automatically use this account for future commands in this project, you can update your \`cloudflare.config.ts\`:
2
+ import{t as e}from"./cli-exit-CstFZ1eJ.mjs";import{n as t,t as n}from"./version-BGnqDvNR.mjs";import{t as r}from"./session-BcM8Vyyx.mjs";import{a as i,n as a,t as o}from"./cf-oRSQKirD.mjs";import{i as s,o as c,s as l}from"./dist-uRuGmkMB.mjs";import{n as u}from"./interactive-BW9T1D1q.mjs";import{n as d}from"./context-BBLtgdR1.mjs";const f={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 p=class extends Error{};async function m(n){if(u())throw new p;r(t);let i=await c({message:n});if(l(i)||typeof i!=`string`)throw new e(130,{cancelled:!0});return i}async function h(n,i){if(u())throw new p;r(t);let a=await s({message:n,options:i.choices.map(({title:e,value:t})=>({label:e,value:t}))});if(l(a)||typeof a!=`string`)throw new e(130,{cancelled:!0});return f.log(`To have cf automatically use this account for future commands in this project, you can update your \`cloudflare.config.ts\`:
3
3
 
4
4
  import { defineConfig } from "cf/config";
5
5
 
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import{t as e}from"./local-DlT72Xpn.mjs";import{n as t}from"./auth-CGLsxbc6.mjs";import{a as n,t as r}from"./context-q7UaYK69.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-BtkTVcHI.mjs";import{t as s}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";import{n as c,t as l}from"./body-parser-DkHKPkJ7.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{a as d,i as f,n as p}from"./prompt-RlgRrmbm.mjs";function m(e){return e.usage(`$0 oauth-clients create
2
+ import{t as e}from"./local-BcPM4I0s.mjs";import{n as t}from"./auth-CAWalgW0.mjs";import{a as n,t as r}from"./context-BBLtgdR1.mjs";import{t as i}from"./output-BOe-3AQG.mjs";import{t as a}from"./dry-run-DRj2_uV3.mjs";import{t as o}from"./progress-CQqDtgmF.mjs";import{t as s}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{n as c,t as l}from"./body-parser-DkHKPkJ7.mjs";import{n as u}from"./input-validation-D7z60HJH.mjs";import{a as d,i as f,n as p}from"./prompt-C8FyienX.mjs";function m(e){return e.usage(`$0 oauth-clients create
3
3
 
4
- Create a new OAuth client for an account.`).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).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 OAuth Client`,builder:m,handler:async p=>s({command:`oauth-clients create`,classification:{safeFlags:[`token-endpoint-auth-method`,`dry-run`]}},p,async()=>{if(p.dryRun){let e=await n();a({command:`cf oauth-clients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`json`,body:p.body===void 0?l({allowed_cors_origins:p[`allowed-cors-origins`],client_name:u(p[`client-name`],`client-name`,`text`),client_uri:u(p[`client-uri`],`client-uri`,`text`),grant_types:p[`grant-types`],logo_uri:u(p[`logo-uri`],`logo-uri`,`text`),optional_scopes:p[`optional-scopes`],policy_uri:u(p[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:p[`post-logout-redirect-uris`],redirect_uris:p[`redirect-uris`],response_types:p[`response-types`],scopes:p.scopes,token_endpoint_auth_method:u(p[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(p[`tos-uri`],`tos-uri`,`text`)}):c(p.body)});return}let s=await t(p),m=p.local?e:await r();if(p.accountId=m,p.body){let e=c(p.body),t=await o(`Creating`,async()=>s.oauthClients.create({...e,account_id:m}));i(t,{successLabel:`Created`});return}if(p[`client-name`]===void 0&&(p[`client-name`]=await d(`client-name`,`Human-readable name of the OAuth client.`)),p[`grant-types`]===void 0)throw Error(`--grant-types is required (or pass --body with this field set).`);if(p[`redirect-uris`]===void 0)throw Error(`--redirect-uris is required (or pass --body with this field set).`);if(p[`response-types`]===void 0)throw Error(`--response-types is required (or pass --body with this field set).`);if(p.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);p[`token-endpoint-auth-method`]===void 0&&(p[`token-endpoint-auth-method`]=await f(`token-endpoint-auth-method`,`The authentication method the client uses at the token endpoint.`,[`none`,`client_secret_basic`,`client_secret_post`]));let h=l({allowed_cors_origins:p[`allowed-cors-origins`],client_name:u(p[`client-name`],`client-name`,`text`),client_uri:u(p[`client-uri`],`client-uri`,`text`),grant_types:p[`grant-types`],logo_uri:u(p[`logo-uri`],`logo-uri`,`text`),optional_scopes:p[`optional-scopes`],policy_uri:u(p[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:p[`post-logout-redirect-uris`],redirect_uris:p[`redirect-uris`],response_types:p[`response-types`],scopes:p.scopes,token_endpoint_auth_method:u(p[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(p[`tos-uri`],`tos-uri`,`text`)}),g=await o(`Creating`,async()=>s.oauthClients.create({...h,account_id:m}));i(g,{successLabel:`Created`})})};function g(e){return e.usage(`$0 oauth-clients delete-rotated-secret <oauth-client-id>
4
+ Create a new OAuth client for an account.`).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).coerce(`token-endpoint-auth-method`,e=>u(e,`token-endpoint-auth-method`,`text`)).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).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 OAuth Client`,builder:m,handler:async p=>s({command:`oauth-clients create`,classification:{safeFlags:[`token-endpoint-auth-method`,`dry-run`]}},p,async()=>{if(p.dryRun){let e=await n();a({command:`cf oauth-clients create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`json`,body:p.body===void 0?l({allowed_cors_origins:p[`allowed-cors-origins`],client_name:u(p[`client-name`],`client-name`,`text`),client_uri:u(p[`client-uri`],`client-uri`,`text`),grant_types:p[`grant-types`],logo_uri:u(p[`logo-uri`],`logo-uri`,`text`),optional_scopes:p[`optional-scopes`],policy_uri:u(p[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:p[`post-logout-redirect-uris`],redirect_uris:p[`redirect-uris`],response_types:p[`response-types`],scopes:p.scopes,token_endpoint_auth_method:p[`token-endpoint-auth-method`],tos_uri:u(p[`tos-uri`],`tos-uri`,`text`)}):c(p.body)});return}let s=await t(p),m=p.local?e:await r();if(p.accountId=m,p.body){let e=c(p.body),t=await o(`Creating`,async()=>s.oauthClients.create({...e,account_id:m}));i(t,{successLabel:`Created`});return}if(p[`client-name`]===void 0&&(p[`client-name`]=await d(`client-name`,`Human-readable name of the OAuth client.`)),p[`grant-types`]===void 0)throw Error(`--grant-types is required (or pass --body with this field set).`);if(p[`redirect-uris`]===void 0)throw Error(`--redirect-uris is required (or pass --body with this field set).`);if(p[`response-types`]===void 0)throw Error(`--response-types is required (or pass --body with this field set).`);if(p.scopes===void 0)throw Error(`--scopes is required (or pass --body with this field set).`);p[`token-endpoint-auth-method`]===void 0&&(p[`token-endpoint-auth-method`]=await f(`token-endpoint-auth-method`,`The authentication method the client uses at the token endpoint.`,[`none`,`client_secret_basic`,`client_secret_post`]));let h=l({allowed_cors_origins:p[`allowed-cors-origins`],client_name:u(p[`client-name`],`client-name`,`text`),client_uri:u(p[`client-uri`],`client-uri`,`text`),grant_types:p[`grant-types`],logo_uri:u(p[`logo-uri`],`logo-uri`,`text`),optional_scopes:p[`optional-scopes`],policy_uri:u(p[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:p[`post-logout-redirect-uris`],redirect_uris:p[`redirect-uris`],response_types:p[`response-types`],scopes:p.scopes,token_endpoint_auth_method:p[`token-endpoint-auth-method`],tos_uri:u(p[`tos-uri`],`tos-uri`,`text`)}),g=await o(`Creating`,async()=>s.oauthClients.create({...h,account_id:m}));i(g,{successLabel:`Created`})})};function g(e){return e.usage(`$0 oauth-clients delete-rotated-secret <oauth-client-id>
5
5
 
6
6
  Removes the old client secret after a rotation, keeping only the new one. Use this after you have updated your client configuration to use the new secret. The \`has_rotated_secret\` field on the client indicates whether there is an old secret to delete.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,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-rotated-secret <oauth-client-id>`,describe:`Delete Rotated OAuth Client Secret`,builder:g,handler:async c=>s({command:`oauth-clients delete-rotated-secret`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf oauth-clients delete-rotated-secret`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();if(c.accountId=l,!await p({force:!!c.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
7
7
  `);return}let u=await o(`Deleting`,async()=>s.oauthClients.deleteRotatedSecret({account_id:l,oauth_client_id:c[`oauth-client-id`]}));i(u,{successLabel:`Deleted`})})};function v(e){return e.usage(`$0 oauth-clients delete <oauth-client-id>
@@ -13,4 +13,4 @@ Get details of a specific OAuth client.`).positional(`oauth-client-id`,{type:`st
13
13
 
14
14
  List all OAuth clients for an account.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`List OAuth Clients`,builder:S,handler:async c=>s({command:`oauth-clients list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf oauth-clients list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/oauth_clients`,pathParams:{},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Loading`,async()=>s.oauthClients.list({account_id:l}));i(u,{successLabel:`Loaded`})})};function w(e){return e.usage("$0 oauth-clients rotate-secret <oauth-client-id>\n\nCreates a second client secret so you can update your client configuration before deleting the old one. The `has_rotated_secret` field on the client will be set to `true`.").positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`rotate-secret <oauth-client-id>`,describe:`Rotate OAuth Client Secret`,builder:w,handler:async c=>s({command:`oauth-clients rotate-secret`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){let e=await n();a({command:`cf oauth-clients rotate-secret`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/oauth_clients/${c[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(c[`oauth-client-id`]))}/rotate_secret`,pathParams:{"oauth-client-id":String(c[`oauth-client-id`]??``)},bodyKind:`none`});return}let s=await t(c),l=c.local?e:await r();c.accountId=l;let u=await o(`Creating`,async()=>s.oauthClients.rotateSecret({account_id:l,oauth_client_id:c[`oauth-client-id`]}));i(u,{successLabel:`Created`})})};function E(e){return e.usage(`$0 oauth-clients update <oauth-client-id>
15
15
 
16
- Update an existing OAuth client. Only include fields you want to update.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).option(`visibility`,{type:`string`,description:"Promote the OAuth client from private to public visibility. Only `public` is accepted; demotion to `private` is not supported. Promotion requires a non-empty client name, logo URI, verified client URI host, and at least one non-identity scope.",choices:[`public`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial update request for an OAuth client. Only include fields you want to update.`})}const D={command:`update <oauth-client-id>`,describe:`Update OAuth Client`,builder:E,handler:async d=>s({command:`oauth-clients update`,classification:{safeFlags:[`token-endpoint-auth-method`,`visibility`,`dry-run`]}},d,async()=>{if(d.dryRun){let e=await n();a({command:`cf oauth-clients update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/oauth_clients/${d[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(d[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(d[`oauth-client-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({allowed_cors_origins:d[`allowed-cors-origins`],client_name:u(d[`client-name`],`client-name`,`text`),client_uri:u(d[`client-uri`],`client-uri`,`text`),grant_types:d[`grant-types`],logo_uri:u(d[`logo-uri`],`logo-uri`,`text`),optional_scopes:d[`optional-scopes`],policy_uri:u(d[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:d[`post-logout-redirect-uris`],redirect_uris:d[`redirect-uris`],response_types:d[`response-types`],scopes:d.scopes,token_endpoint_auth_method:u(d[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(d[`tos-uri`],`tos-uri`,`text`),visibility:u(d.visibility,`visibility`,`text`)}):c(d.body)});return}let s=await t(d),f=d.local?e:await r();if(d.accountId=f,d.body){let e=c(d.body),t=await o(`Updating`,async()=>s.oauthClients.update({...e,account_id:f,oauth_client_id:d[`oauth-client-id`]}));i(t,{successLabel:`Updated`});return}let p=l({allowed_cors_origins:d[`allowed-cors-origins`],client_name:u(d[`client-name`],`client-name`,`text`),client_uri:u(d[`client-uri`],`client-uri`,`text`),grant_types:d[`grant-types`],logo_uri:u(d[`logo-uri`],`logo-uri`,`text`),optional_scopes:d[`optional-scopes`],policy_uri:u(d[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:d[`post-logout-redirect-uris`],redirect_uris:d[`redirect-uris`],response_types:d[`response-types`],scopes:d.scopes,token_endpoint_auth_method:u(d[`token-endpoint-auth-method`],`token-endpoint-auth-method`,`text`),tos_uri:u(d[`tos-uri`],`tos-uri`,`text`),visibility:u(d.visibility,`visibility`,`text`)}),m=await o(`Updating`,async()=>s.oauthClients.update({...p,account_id:f,oauth_client_id:d[`oauth-client-id`]}));i(m,{successLabel:`Updated`})})},O={command:`oauth-clients`,describe:`oauth-clients`,builder:e=>e.command(h).command(y).command(_).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{O as default};
16
+ Update an existing OAuth client. Only include fields you want to update.`).positional(`oauth-client-id`,{type:`string`,description:`The unique identifier for an OAuth client.`,demandOption:!0}).option(`allowed-cors-origins`,{type:`string`,array:!0,description:`Array of allowed CORS origins.`}).option(`client-name`,{type:`string`,description:`Human-readable name of the OAuth client.`}).option(`client-uri`,{type:`string`,description:`URL of the home page of the client.`}).option(`grant-types`,{type:`string`,array:!0,description:"Array of OAuth grant types the client is allowed to use. `authorization_code` is required; `refresh_token` may be included optionally."}).option(`logo-uri`,{type:`string`,description:`URL of the client's logo.`}).option(`optional-scopes`,{type:`string`,array:!0,description:"Scopes that the authorizing user may decline during consent. Each value must also appear in `scopes`. The scopes `openid`, `offline`, and `offline_access` cannot be optional."}).option(`policy-uri`,{type:`string`,description:`URL that points to a privacy policy document.`}).option(`post-logout-redirect-uris`,{type:`string`,array:!0,description:`Array of allowed post-logout redirect URIs.`}).option(`redirect-uris`,{type:`string`,array:!0,description:`Array of allowed redirect URIs for the client.`}).option(`response-types`,{type:`string`,array:!0,description:`Array of OAuth response types the client is allowed to use.`}).option(`scopes`,{type:`string`,array:!0,description:"Array of OAuth scopes the client is allowed to request. Colon-delimited scopes are not accepted. Dot-delimited scopes are validated against available OAuth API scopes; simple identity scopes are allowed. Protocol scopes `offline_access` and `openid` are added or removed automatically based on `grant_types` and `response_types`."}).option(`token-endpoint-auth-method`,{type:`string`,description:`The authentication method the client uses at the token endpoint.`,choices:[`none`,`client_secret_basic`,`client_secret_post`]}).coerce(`token-endpoint-auth-method`,e=>u(e,`token-endpoint-auth-method`,`text`)).option(`tos-uri`,{type:`string`,description:`URL that points to a terms of service document.`}).option(`visibility`,{type:`string`,description:"Promote the OAuth client from private to public visibility. Only `public` is accepted; demotion to `private` is not supported. Promotion requires a non-empty client name, logo URI, verified client URI host, and at least one non-identity scope.",choices:[`public`]}).coerce(`visibility`,e=>u(e,`visibility`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Partial update request for an OAuth client. Only include fields you want to update.`})}const D={command:`update <oauth-client-id>`,describe:`Update OAuth Client`,builder:E,handler:async d=>s({command:`oauth-clients update`,classification:{safeFlags:[`token-endpoint-auth-method`,`visibility`,`dry-run`]}},d,async()=>{if(d.dryRun){let e=await n();a({command:`cf oauth-clients update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${e??`<account-id>`}/oauth_clients/${d[`oauth-client-id`]==null?`<oauth-client-id>`:encodeURIComponent(String(d[`oauth-client-id`]))}`,pathParams:{"oauth-client-id":String(d[`oauth-client-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({allowed_cors_origins:d[`allowed-cors-origins`],client_name:u(d[`client-name`],`client-name`,`text`),client_uri:u(d[`client-uri`],`client-uri`,`text`),grant_types:d[`grant-types`],logo_uri:u(d[`logo-uri`],`logo-uri`,`text`),optional_scopes:d[`optional-scopes`],policy_uri:u(d[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:d[`post-logout-redirect-uris`],redirect_uris:d[`redirect-uris`],response_types:d[`response-types`],scopes:d.scopes,token_endpoint_auth_method:d[`token-endpoint-auth-method`],tos_uri:u(d[`tos-uri`],`tos-uri`,`text`),visibility:d.visibility}):c(d.body)});return}let s=await t(d),f=d.local?e:await r();if(d.accountId=f,d.body){let e=c(d.body),t=await o(`Updating`,async()=>s.oauthClients.update({...e,account_id:f,oauth_client_id:d[`oauth-client-id`]}));i(t,{successLabel:`Updated`});return}let p=l({allowed_cors_origins:d[`allowed-cors-origins`],client_name:u(d[`client-name`],`client-name`,`text`),client_uri:u(d[`client-uri`],`client-uri`,`text`),grant_types:d[`grant-types`],logo_uri:u(d[`logo-uri`],`logo-uri`,`text`),optional_scopes:d[`optional-scopes`],policy_uri:u(d[`policy-uri`],`policy-uri`,`text`),post_logout_redirect_uris:d[`post-logout-redirect-uris`],redirect_uris:d[`redirect-uris`],response_types:d[`response-types`],scopes:d.scopes,token_endpoint_auth_method:d[`token-endpoint-auth-method`],tos_uri:u(d[`tos-uri`],`tos-uri`,`text`),visibility:d.visibility}),m=await o(`Updating`,async()=>s.oauthClients.update({...p,account_id:f,oauth_client_id:d[`oauth-client-id`]}));i(m,{successLabel:`Updated`})})},O={command:`oauth-clients`,describe:`oauth-clients`,builder:e=>e.command(h).command(y).command(_).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{O as default};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import{a as e,f as t,n}from"./oauth-Bj5Ne1o8.mjs";export{n as getActiveAccountId,e as getOrSelectAccountId,t as resolveProfile};
2
+ import{a as e,f as t,n}from"./oauth-BUr8bPwo.mjs";export{n as getActiveAccountId,e as getOrSelectAccountId,t as resolveProfile};
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{n as e}from"./auth-CGLsxbc6.mjs";import{t}from"./output-BOe-3AQG.mjs";import{t as n}from"./dry-run-DRj2_uV3.mjs";import{t as r}from"./progress-BtkTVcHI.mjs";import{t as i}from"./run-BvHwWWUX.mjs";import"./telemetry-BsYO3nxG.mjs";function a(e){return e.usage(`$0 oauth-scopes list
2
+ import{n as e}from"./auth-CAWalgW0.mjs";import{t}from"./output-BOe-3AQG.mjs";import{t as n}from"./dry-run-DRj2_uV3.mjs";import{t as r}from"./progress-CQqDtgmF.mjs";import{t as i}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";function a(e){return e.usage(`$0 oauth-scopes list
3
3
 
4
4
  List all available OAuth scopes. This endpoint requires authentication but has no authorization role requirements.`).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`list`,describe:`List OAuth Scopes`,builder:a,handler:async a=>i({command:`oauth-scopes list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf oauth-scopes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/oauth/scopes`,pathParams:{},bodyKind:`none`});return}let i=await e(a),o=await r(`Loading`,async()=>i.oauthScopes.list());t(o,{successLabel:`Loaded`})})},s={command:`oauth-scopes`,describe:`oauth-scopes`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{s as default};
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ import{n as e}from"./auth-CAWalgW0.mjs";import{t}from"./output-BOe-3AQG.mjs";import{t as n}from"./dry-run-DRj2_uV3.mjs";import{t as r}from"./progress-CQqDtgmF.mjs";import{t as i}from"./run-CW2Cgi0S.mjs";import"./telemetry-0Y5hAtCX.mjs";import{n as a,r as o,t as s}from"./body-parser-DkHKPkJ7.mjs";import{n as c}from"./input-validation-D7z60HJH.mjs";import{a as l,i as u,n as d}from"./prompt-C8FyienX.mjs";import{t as f}from"./cli-types-9oYmRTHJ.mjs";function p(e){return e.usage(`$0 organization account list
3
+
4
+ Retrieve the accounts immediately attached to a specific organization. Accounts attached to sub-organizations are not included. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.read\` is required. User API Tokens are not currently supported.`).option(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a list of accounts for.`,demandOption:!0}).option(`account-pubname`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname is equal to
5
+ a particular string.`}).option(`account-pubname-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname starts with
6
+ a particular string.`}).option(`account-pubname-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname ends with
7
+ a particular string.`}).option(`account-pubname-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the account_pubname contains
8
+ a particular string.`}).option(`name`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name is equal to a
9
+ particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name starts with a
10
+ particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name ends with a particular
11
+ string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of accounts to where the name contains a particular
12
+ string.`}).option(`order-by`,{type:`string`,description:"Field to order results by. Currently supported values: `account_name`.\nWhen not specified, results are ordered by internal account ID.",choices:[`account_name`]}).option(`direction`,{type:`string`,description:"Sort direction for the order_by field. Valid values: `asc`, `desc`.\nDefaults to `asc` when order_by is specified.",choices:[`asc`,`desc`]}).option(`include-tags`,{type:`boolean`,description:`Include Account tags from the resource tag mirror. Omit this parameter to preserve the existing Account response shape.`}).option(`include-total`,{type:`boolean`,description:`Whether to calculate and return the exact result_info.total_size for cursor
13
+ pagination. Defaults to true. When false, total_size is omitted. page_size and
14
+ include_total may change between pages; next_page_token remains the authoritative
15
+ continuation signal.
16
+ Legacy page/per_page requests always calculate total_count.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
17
+ provided will retrieve the next page.
18
+
19
+ Parameters used to filter the retrieved list must remain in subsequent
20
+ requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`list`,describe:`List organization accounts`,builder:f(p),handler:async a=>i({command:`organization account list`,classification:{safeFlags:[`order-by`,`direction`,`include-tags`,`include-total`,`dry-run`]}},a,async()=>{let i={account_pubname:a[`account-pubname`],"account_pubname.startsWith":a[`account-pubname-starts-with`],"account_pubname.endsWith":a[`account-pubname-ends-with`],"account_pubname.contains":a[`account-pubname-contains`],name:a.name,"name.startsWith":a[`name-starts-with`],"name.endsWith":a[`name-ends-with`],"name.contains":a[`name-contains`],order_by:a[`order-by`],direction:a.direction,include_tags:a[`include-tags`],include_total:a[`include-total`],page_token:a[`page-token`],page_size:a[`page-size`]};if(a.dryRun){n({command:`cf organization account list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/accounts`,pathParams:{"organization-id":String(a[`organization-id`]??``)},query:i,bodyKind:`none`});return}let o=await e(a),s=await r(`Loading`,async()=>o.organization.account.list({organization_id:a[`organization-id`],...i}));t(s,{successLabel:`Loaded`})})},h={command:`account`,describe:`Operations for account`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.usage(`$0 organization create
21
+
22
+ Create a new organization for a user. Sub-organization creation availability depends on the organization's capabilities. Authentication: Use a Global API key, or a User API Token with the \`User Details Write\` permission.`).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`References an Organization in the Cloudflare data model.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const _={command:`create`,describe:`Create organization`,builder:g,handler:async o=>i({command:`organization create`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},bodyKind:`json`,body:o.body===void 0?s({name:c(o.name,`name`,`text`),parent:{id:c(o[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(o[`profile-business-address`],`profile-business-address`,`text`),business_email:c(o[`profile-business-email`],`profile-business-email`,`text`),business_name:c(o[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(o[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(o[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body),n=await r(`Creating`,async()=>i.organization.create({...e}));t(n,{successLabel:`Created`});return}o.name===void 0&&(o.name=await l(`name`,`The name field`));let u=s({name:c(o.name,`name`,`text`),parent:{id:c(o[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(o[`profile-business-address`],`profile-business-address`,`text`),business_email:c(o[`profile-business-email`],`profile-business-email`,`text`),business_name:c(o[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(o[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(o[`profile-external-metadata`],`profile-external-metadata`,`text`)}}),d=await r(`Creating`,async()=>i.organization.create({...u}));t(d,{successLabel:`Created`})})};function v(e){return e.usage(`$0 organization delete <organization-id>
23
+
24
+ Delete an organization. The organization MUST be empty before deleting. It must not contain any sub-organizations, accounts, members or users. Sub-organization deletion availability depends on the organization's capabilities. **Access Control:** Restricted to enterprise organizations. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.update\` is required. User API Tokens are not currently supported.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <organization-id>`,describe:`Delete organization`,builder:v,handler:async a=>i({command:`organization delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},a,async()=>{if(a.dryRun){n({command:`cf organization delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`none`});return}let i=await e(a);if(!await d({force:!!a.force,message:`Delete this empty organization? This action cannot be undone.`})){process.stderr.write(`Aborted.
25
+ `);return}let o=await r(`Deleting`,async()=>i.organization.delete({organization_id:a[`organization-id`]}));t(o,{successLabel:`Deleted`})})};function b(e){return e.usage("$0 organization get <organization-id>\n\nRetrieve the details of a certain organization. Authentication: A Global API key for a user with `com.cloudflare.api.tenant.unit.read` is required. User API Tokens are not currently supported and return HTTP `403` with error code `10000`.").positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <organization-id>`,describe:`Get organization`,builder:b,handler:async a=>i({command:`organization get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf organization get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`none`});return}let i=await e(a),o=await r(`Loading`,async()=>i.organization.get({organization_id:a[`organization-id`]}));t(o,{successLabel:`Loaded`})})};function S(e){return e.usage(`$0 organization invite update <member-code>
26
+
27
+ Accept or reject an invitation to a specific organization. Authentication: A Global API key for the invited user is required. User API Tokens are not currently supported. No additional permission is required; the invitation must belong to the authenticated user.`).positional(`member-code`,{type:`string`,description:`The invitation code to accept or reject.`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`The ID of the organization associated with the invitation.`,demandOption:!0}).option(`status`,{type:`string`,description:`The status field`,choices:[`accept`,`reject`]}).coerce(`status`,e=>c(e,`status`,`text`)).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"The invitation action. Use `accept` to join the organization or `reject` to decline the invitation."})}const C={command:`update <member-code>`,describe:`Handle organization invite`,builder:S,handler:async o=>i({command:`organization invite update`,classification:{safeFlags:[`status`,`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization invite update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${o[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(o[`organization-id`]))}/invites/${o[`member-code`]==null?`<member-code>`:encodeURIComponent(String(o[`member-code`]))}`,pathParams:{"organization-id":String(o[`organization-id`]??``),"member-code":String(o[`member-code`]??``)},bodyKind:`json`,body:o.body===void 0?s({status:o.status}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body),n=await r(`Updating`,async()=>i.organization.invite.update({...e,organization_id:o[`organization-id`],member_code:o[`member-code`]}));t(n,{successLabel:`Updated`});return}o.status===void 0&&(o.status=await u(`status`,`The status field`,[`accept`,`reject`]));let c=s({status:o.status}),l=await r(`Updating`,async()=>i.organization.invite.update({...c,organization_id:o[`organization-id`],member_code:o[`member-code`]}));t(l,{successLabel:`Updated`})})},w={command:`invite`,describe:`Operations for invite`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.usage("$0 organization list\n\nRetrieve a list of organizations a particular user has access to. Authentication: Use a Global API key, or a User API Token with the `User Details Read` or `User Details Write` permission.").option(`id`,{type:`string`,description:`Only return organizations with the specified IDs (ex. id=foo&id=bar). Send multiple elements
28
+ by repeating the query value.`}).option(`name`,{type:`string`,description:`(case-sensitive) Filter the list of organizations to where the name is equal to a
29
+ particular string.`}).option(`name-starts-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name starts with a
30
+ particular string.`}).option(`name-ends-with`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name ends with a particular
31
+ string.`}).option(`name-contains`,{type:`string`,description:`(case-insensitive) Filter the list of organizations to where the name contains a particular
32
+ string.`}).option(`containing-account`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
33
+ account.`}).option(`containing-user`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
34
+ user.
35
+
36
+ IMPORTANT: Just because an organization "contains" a user is not a
37
+ representation of any authorization or privilege to manage any resources
38
+ therein. An organization "containing" a user simply means the user is managed by
39
+ that organization.`}).option(`containing-organization`,{type:`string`,description:`Filter the list of organizations to the ones that contain this particular
40
+ organization.`}).option(`parent-id`,{type:`string`,description:`Filter the list of organizations to the ones that are a sub-organization
41
+ of the specified organization.
42
+
43
+ "null" is a valid value to provide for this parameter. It means "where
44
+ an organization has no parent (i.e. it is a 'root' organization)."`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
45
+ provided will retrieve the next page.
46
+
47
+ Parameters used to filter the retrieved list must remain in subsequent
48
+ requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List organizations the user has access to`,builder:f(T),handler:async a=>i({command:`organization list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{let i={id:a.id,name:a.name,"name.startsWith":a[`name-starts-with`],"name.endsWith":a[`name-ends-with`],"name.contains":a[`name-contains`],"containing.account":a[`containing-account`],"containing.user":a[`containing-user`],"containing.organization":a[`containing-organization`],"parent.id":a[`parent-id`],page_token:a[`page-token`],page_size:a[`page-size`]};if(a.dryRun){n({command:`cf organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations`,pathParams:{},query:i,bodyKind:`none`});return}let o=await e(a),s=await r(`Loading`,async()=>o.organization.list(i));t(s,{successLabel:`Loaded`})})};function D(e){return e.usage(`$0 organization member batch create <organization-id>
49
+
50
+ Batch create multiple memberships that grant access to a specific Organization. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.member.create\` is required. User API Tokens are not currently supported.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`members`,{type:`string`,description:`The members field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`create <organization-id>`,describe:`Batch create organization members`,builder:D,handler:async c=>i({command:`organization member batch create`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){n({command:`cf organization member batch create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${c[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(c[`organization-id`]))}/members:batchCreate`,pathParams:{"organization-id":String(c[`organization-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({members:o(c.members,`members`)}):a(c.body)});return}let i=await e(c);if(c.body){let e=a(c.body),n=await r(`Creating`,async()=>i.organization.member.batch.create({...e,organization_id:c[`organization-id`]}));t(n,{successLabel:`Created`});return}if(c.members===void 0)throw Error(`--members is required (or pass --body with this field set).`);let l=s({members:o(c.members,`members`)}),u=await r(`Creating`,async()=>i.organization.member.batch.create({...l,organization_id:c[`organization-id`]}));t(u,{successLabel:`Created`})})},k={command:`batch`,describe:`Operations for member.batch`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.usage(`$0 organization member create <organization-id>
51
+
52
+ Create a membership that grants access to a specific Organization. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.member.create\` is required. User API Tokens are not currently supported.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`member-status`,{type:`string`,description:`The member.status field`,choices:[`active`,`canceled`]}).coerce(`member-status`,e=>c(e,`member-status`,`text`)).option(`member-user-email`,{type:`string`,description:`The member.user.email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`create <organization-id>`,describe:`Create organization member`,builder:A,handler:async o=>i({command:`organization member create`,classification:{safeFlags:[`member-status`,`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization member create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/organizations/${o[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(o[`organization-id`]))}/members`,pathParams:{"organization-id":String(o[`organization-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({member:{status:o[`member-status`],user:{email:c(o[`member-user-email`],`member-user-email`,`text`)}}}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body),n=await r(`Creating`,async()=>i.organization.member.create({...e,organization_id:o[`organization-id`]}));t(n,{successLabel:`Created`});return}o[`member-user-email`]===void 0&&(o[`member-user-email`]=await l(`member-user-email`,`The member.user.email field`));let u=s({member:{status:o[`member-status`],user:{email:c(o[`member-user-email`],`member-user-email`,`text`)}}}),d=await r(`Creating`,async()=>i.organization.member.create({...u,organization_id:o[`organization-id`]}));t(d,{successLabel:`Created`})})};function M(e){return e.usage(`$0 organization member delete <member-id>
53
+
54
+ Delete a membership to a particular Organization. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.member.delete\` is required. User API Tokens are not currently supported.`).positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const N={command:`delete <member-id>`,describe:`Delete organization member`,builder:M,handler:async a=>i({command:`organization member delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},a,async()=>{if(a.dryRun){n({command:`cf organization member delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members/${a[`member-id`]==null?`<member-id>`:encodeURIComponent(String(a[`member-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``),"member-id":String(a[`member-id`]??``)},bodyKind:`none`});return}let i=await e(a);if(!await d({force:!!a.force,message:`Delete this organization membership? The member will lose access to this organization and its sub-organizations.`})){process.stderr.write(`Aborted.
55
+ `);return}let o=await r(`Deleting`,async()=>i.organization.member.delete({organization_id:a[`organization-id`],member_id:a[`member-id`]}));t(o,{successLabel:`Deleted`})})};function P(e){return e.usage(`$0 organization member get <member-id>
56
+
57
+ Retrieve a single membership from an Organization. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.member.read\` is required. User API Tokens are not currently supported.`).positional(`member-id`,{type:`string`,description:`Organization Member ID`,demandOption:!0}).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <member-id>`,describe:`Get organization member`,builder:P,handler:async a=>i({command:`organization member get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf organization member get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members/${a[`member-id`]==null?`<member-id>`:encodeURIComponent(String(a[`member-id`]))}`,pathParams:{"organization-id":String(a[`organization-id`]??``),"member-id":String(a[`member-id`]??``)},bodyKind:`none`});return}let i=await e(a),o=await r(`Loading`,async()=>i.organization.member.get({organization_id:a[`organization-id`],member_id:a[`member-id`]}));t(o,{successLabel:`Loaded`})})};function I(e){return e.usage(`$0 organization member list
58
+
59
+ List memberships for an Organization. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.member.list\` is required. User API Tokens are not currently supported.`).option(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter the list of memberships by membership status.`}).option(`user-email`,{type:`string`,description:`Filter the list of memberships for a specific email.`}).option(`user-email-contains`,{type:`string`,description:`Filter the list of memberships for a specific email that contains a substring.`}).option(`user-email-starts-with`,{type:`string`,description:`Filter the list of memberships for a specific email that starts with a substring.`}).option(`user-email-ends-with`,{type:`string`,description:`Filter the list of memberships for a specific email that ends with a substring.`}).option(`page-token`,{type:`string`,description:`An opaque token returned from the last list response that when
60
+ provided will retrieve the next page.
61
+
62
+ Parameters used to filter the retrieved list must remain in subsequent
63
+ requests with a page token.`}).option(`page-size`,{type:`number`,description:`The amount of items to return. Defaults to 10.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List organization members`,builder:f(I),handler:async a=>i({command:`organization member list`,classification:{safeFlags:[`dry-run`]}},a,async()=>{let i={status:a.status,"user.email":a[`user-email`],"user.email.contains":a[`user-email-contains`],"user.email.startsWith":a[`user-email-starts-with`],"user.email.endsWith":a[`user-email-ends-with`],page_token:a[`page-token`],page_size:a[`page-size`]};if(a.dryRun){n({command:`cf organization member list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/members`,pathParams:{"organization-id":String(a[`organization-id`]??``)},query:i,bodyKind:`none`});return}let o=await e(a),s=await r(`Loading`,async()=>o.organization.member.list({organization_id:a[`organization-id`],...i}));t(s,{successLabel:`Loaded`})})},R={command:`member`,describe:`Operations for member`,builder:e=>e.command(j).command(N).command(F).command(L).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.usage(`$0 organization profile get <organization-id>
64
+
65
+ Get an organizations profile if it exists. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.read\` is required. User API Tokens are not currently supported.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to retrieve a profile for.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get <organization-id>`,describe:`Get organization profile`,builder:z,handler:async a=>i({command:`organization profile get`,classification:{safeFlags:[`dry-run`]}},a,async()=>{if(a.dryRun){n({command:`cf organization profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/profile`,pathParams:{"organization-id":String(a[`organization-id`]??``)},bodyKind:`none`});return}let i=await e(a),o=await r(`Loading`,async()=>i.organization.profile.get({organization_id:a[`organization-id`]}));t(o,{successLabel:`Loaded`})})};function V(e){return e.usage(`$0 organization profile update <organization-id>
66
+
67
+ Modify organization profile. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.update\` is required. User API Tokens are not currently supported.`).positional(`organization-id`,{type:`string`,description:`Organization ID`,demandOption:!0}).option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`update <organization-id>`,describe:`Modify organization profile.`,builder:V,handler:async o=>i({command:`organization profile update`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${o[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(o[`organization-id`]))}/profile`,pathParams:{"organization-id":String(o[`organization-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({business_address:c(o[`business-address`],`business-address`,`text`),business_email:c(o[`business-email`],`business-email`,`text`),business_name:c(o[`business-name`],`business-name`,`text`),business_phone:c(o[`business-phone`],`business-phone`,`text`),external_metadata:c(o[`external-metadata`],`external-metadata`,`text`)}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body),n=await r(`Updating`,async()=>i.organization.profile.update({...e,organization_id:o[`organization-id`]}));t(n,{successLabel:`Updated`});return}o[`business-address`]===void 0&&(o[`business-address`]=await l(`business-address`,`The business_address field`)),o[`business-email`]===void 0&&(o[`business-email`]=await l(`business-email`,`The business_email field`)),o[`business-name`]===void 0&&(o[`business-name`]=await l(`business-name`,`The business_name field`)),o[`business-phone`]===void 0&&(o[`business-phone`]=await l(`business-phone`,`The business_phone field`)),o[`external-metadata`]===void 0&&(o[`external-metadata`]=await l(`external-metadata`,`The external_metadata field`));let u=s({business_address:c(o[`business-address`],`business-address`,`text`),business_email:c(o[`business-email`],`business-email`,`text`),business_name:c(o[`business-name`],`business-name`,`text`),business_phone:c(o[`business-phone`],`business-phone`,`text`),external_metadata:c(o[`external-metadata`],`external-metadata`,`text`)}),d=await r(`Updating`,async()=>i.organization.profile.update({...u,organization_id:o[`organization-id`]}));t(d,{successLabel:`Updated`})})},U={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(B).command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function W(e){return e.usage(`$0 organization share list
68
+
69
+ Lists all organization shares.`).option(`organization-id`,{type:`string`,description:`Organization identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Filter shares by status.`,choices:[`active`,`deleting`,`deleted`]}).option(`kind`,{type:`string`,description:`Filter shares by kind.`,choices:[`sent`,`received`]}).option(`target-type`,{type:`string`,description:`Filter shares by target_type.`,choices:[`account`,`organization`]}).option(`resource-types`,{type:`string`,description:`Filter share resources by resource_types.`}).option(`order`,{type:`string`,description:`Order shares by values in the given field.`,choices:[`name`,`created`]}).option(`direction`,{type:`string`,description:`Direction to sort objects.`,choices:[`asc`,`desc`]}).option(`page`,{type:`number`,description:"Page number. Defaults to `1` when `per_page` is supplied without\n`page`. May be omitted entirely along with `per_page` to receive a\nnon-paginated response."}).option(`per-page`,{type:`number`,description:"Number of objects to return per page. Defaults to `20` when `page`\nis supplied without `per_page`. May be omitted entirely along with\n`page` to receive a non-paginated response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`list`,describe:`List organization shares`,builder:f(W),handler:async a=>i({command:`organization share list`,classification:{safeFlags:[`status`,`kind`,`target-type`,`order`,`direction`,`dry-run`]}},a,async()=>{let i={status:a.status,kind:a.kind,target_type:a[`target-type`],resource_types:a[`resource-types`],order:a.order,direction:a.direction,page:a.page,per_page:a[`per-page`]};if(a.dryRun){n({command:`cf organization share list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/organizations/${a[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(a[`organization-id`]))}/shares`,pathParams:{"organization-id":String(a[`organization-id`]??``)},query:i,bodyKind:`none`});return}let o=await e(a),s=await r(`Loading`,async()=>o.organization.share.list({organization_id:a[`organization-id`],...i}));t(s,{successLabel:`Loaded`})})},K={command:`share`,describe:`Operations for share`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function q(e){return e.usage(`$0 organization update <organization-id>
70
+
71
+ Update an organization's name. Authentication: A Global API key for a user with \`com.cloudflare.api.tenant.unit.update\` is required. User API Tokens are not currently supported.`).positional(`organization-id`,{type:`string`,description:`The ID of the organization to modify.`,demandOption:!0}).option(`name`,{type:`string`,description:`The name field`}).option(`parent-id`,{type:`string`,description:`The parent.id field`}).option(`profile-business-address`,{type:`string`,description:`The profile.business_address field`}).option(`profile-business-email`,{type:`string`,description:`The profile.business_email field`}).option(`profile-business-name`,{type:`string`,description:`The profile.business_name field`}).option(`profile-business-phone`,{type:`string`,description:`The profile.business_phone field`}).option(`profile-external-metadata`,{type:`string`,description:`The profile.external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The new details of the organization. Only accepts updates to "name" currently.`}).check(e=>{if([`parent-id`].some(t=>e[t]!==void 0)){let t=[`parent-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --parent-* flag is set`)}return!0}).check(e=>{if([`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].some(t=>e[t]!==void 0)){let t=[`profile-business-address`,`profile-business-email`,`profile-business-name`,`profile-business-phone`,`profile-external-metadata`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --profile-* flag is set`)}return!0})}const J={command:`update <organization-id>`,describe:`Update organization`,builder:q,handler:async o=>i({command:`organization update`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){n({command:`cf organization update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/organizations/${o[`organization-id`]==null?`<organization-id>`:encodeURIComponent(String(o[`organization-id`]))}`,pathParams:{"organization-id":String(o[`organization-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({name:c(o.name,`name`,`text`),parent:{id:c(o[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(o[`profile-business-address`],`profile-business-address`,`text`),business_email:c(o[`profile-business-email`],`profile-business-email`,`text`),business_name:c(o[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(o[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(o[`profile-external-metadata`],`profile-external-metadata`,`text`)}}):a(o.body)});return}let i=await e(o);if(o.body){let e=a(o.body),n=await r(`Updating`,async()=>i.organization.update({body:e,organization_id:o[`organization-id`]}));t(n,{successLabel:`Updated`});return}o.name===void 0&&(o.name=await l(`name`,`The name field`));let u=s({name:c(o.name,`name`,`text`),parent:{id:c(o[`parent-id`],`parent-id`,`text`)},profile:{business_address:c(o[`profile-business-address`],`profile-business-address`,`text`),business_email:c(o[`profile-business-email`],`profile-business-email`,`text`),business_name:c(o[`profile-business-name`],`profile-business-name`,`text`),business_phone:c(o[`profile-business-phone`],`profile-business-phone`,`text`),external_metadata:c(o[`profile-external-metadata`],`profile-external-metadata`,`text`)}}),d=await r(`Updating`,async()=>i.organization.update({body:u,organization_id:o[`organization-id`]}));t(d,{successLabel:`Updated`})})},Y={command:`organization`,describe:`organization`,builder:e=>e.command(_).command(y).command(x).command(E).command(J).command(h).command(w).command(R).command(U).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Y as default};