cf 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +7 -1
  2. package/dist/_meta/agent-context.json +26 -21
  3. package/dist/_meta/commands.json +7696 -18100
  4. package/dist/_meta/schemas.json +6411 -13925
  5. package/dist/{abuse-reports-dMIfUJ8v.mjs → abuse-reports-Ina5TlsU.mjs} +2 -2
  6. package/dist/{accounts-Kx1epdA1.mjs → accounts-B_joQcMi.mjs} +9 -9
  7. package/dist/{acm-Utu252kC.mjs → acm-_kIHqYME.mjs} +2 -2
  8. package/dist/{addressing-CBq7Z7Vq.mjs → addressing-CaFlw8y1.mjs} +10 -10
  9. package/dist/{agent-context-BGTU299M.mjs → agent-context-DMPfi54f.mjs} +1 -1
  10. package/dist/ai-CqnhNb_c.mjs +2 -0
  11. package/dist/ai-gateway-pgYGI519.mjs +8 -0
  12. package/dist/ai-search-eqQMPQol.mjs +7 -0
  13. package/dist/ai_gateway--vuVLnOm.mjs +4 -0
  14. package/dist/{alerting-CqmEIaKn.mjs → alerting-CPxHiYHb.mjs} +5 -5
  15. package/dist/{analytics-Dv-X8x7D.mjs → analytics-DSSRDZz8.mjs} +1 -1
  16. package/dist/analytics_engine-gWyfnsCs.mjs +2 -0
  17. package/dist/{api-gateway-CNv0IHTU.mjs → api-gateway-BXXGFCVR.mjs} +10 -10
  18. package/dist/argo-aC6A3JyX.mjs +2 -0
  19. package/dist/artifacts-HD4V2xpK.mjs +4 -0
  20. package/dist/audit-logs-BuExU_nz.mjs +2 -0
  21. package/dist/auth-CSC4yhEJ.mjs +9 -0
  22. package/dist/auth-D5hNsOFq.mjs +5 -0
  23. package/dist/billing-COaghyxl.mjs +2 -0
  24. package/dist/bot-management-DmEzeV1Y.mjs +5 -0
  25. package/dist/botnet-feed-ByEAXAkw.mjs +3 -0
  26. package/dist/brand-protection-dPrGe8sL.mjs +3 -0
  27. package/dist/browser-rendering-BiSGnpBf.mjs +4 -0
  28. package/dist/{build-DYkGW4dh.mjs → build-HuS9-R0V.mjs} +131 -131
  29. package/dist/{cache-DsoW6Xwv.mjs → cache-CY-7Lt71.mjs} +4 -4
  30. package/dist/calls-wOQGDWPl.mjs +4 -0
  31. package/dist/certificate-authorities-CtqzAtxQ.mjs +2 -0
  32. package/dist/chunk-6IEM75FG-BEjRFMGh.mjs +2 -0
  33. package/dist/client-certificates-CRf41xLe.mjs +3 -0
  34. package/dist/cloud-connector-BA5IRZUP.mjs +2 -0
  35. package/dist/{cloudforce-one-2Bhz8YdW.mjs → cloudforce-one-Bq_qPAWs.mjs} +20 -20
  36. package/dist/{completions-BwRpZQVn.mjs → completions-DOeHPdCG.mjs} +2 -2
  37. package/dist/config-B5k-XbwS.mjs +2 -0
  38. package/dist/connectivity-Bx3MgTHX.mjs +3 -0
  39. package/dist/connector-interrupts-D7ylweJZ.mjs +2 -0
  40. package/dist/connector-telemetry-events-6izV1kbP.mjs +2 -0
  41. package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +2 -0
  42. package/dist/connectors-DRt4e6d_.mjs +3 -0
  43. package/dist/content-scanning-Cd2vy5Sz.mjs +4 -0
  44. package/dist/context-jpewmual.mjs +2 -0
  45. package/dist/{custom-certificates-aAiEguR7.mjs → custom-certificates-DYE-9epx.mjs} +3 -3
  46. package/dist/{custom-hostnames-AG5yBHIi.mjs → custom-hostnames-CtuTdFcX.mjs} +4 -4
  47. package/dist/custom-nameservers-CWqA51in.mjs +3 -0
  48. package/dist/custom-pages-DeUKEFGe.mjs +4 -0
  49. package/dist/d1-DvWY9Gp4.mjs +4 -0
  50. package/dist/data-security-BPo6dIWu.mjs +6 -0
  51. package/dist/dcv-delegation-Bgf86J-r.mjs +2 -0
  52. package/dist/{deploy-CQial3kN.mjs → deploy-dVrgDUOp.mjs} +1 -1
  53. package/dist/{dev-B38LfCTl.mjs → dev-C01_Lby6.mjs} +1 -1
  54. package/dist/diagnostics-6nKPmVgz.mjs +3 -0
  55. package/dist/{dispatch-namespaces-DmHvoBOg.mjs → dispatch-namespaces-64lXx2WJ.mjs} +6 -6
  56. package/dist/dist-C6zxsVdY.mjs +306 -0
  57. package/dist/{dist-AIcZFk0U.mjs → dist-t_YrL25p.mjs} +7 -7
  58. package/dist/{dns-VMhQSr5n.mjs → dns-ClciFGxx.mjs} +13 -13
  59. package/dist/dns-firewall-DfUmXDCe.mjs +57 -0
  60. package/dist/durable-objects-CMaYZ-YU.mjs +2 -0
  61. package/dist/{email-routing-tIR2SFu-.mjs → email-routing-CGXhFqF5.mjs} +9 -9
  62. package/dist/{email-security-Ca1id3rZ.mjs → email-security-D5viPq8S.mjs} +7 -7
  63. package/dist/email-sending-C2jpc3gh.mjs +3 -0
  64. package/dist/{filters-A4dg_a68.mjs → filters-bzsFcWt0.mjs} +3 -3
  65. package/dist/{firewall-DWPQgYd9.mjs → firewall-DYZcTtIC.mjs} +10 -10
  66. package/dist/{fraud-BMkSsJGU.mjs → fraud-C03MtdZb.mjs} +1 -1
  67. package/dist/google-tag-gateway-Dfy887yA.mjs +2 -0
  68. package/dist/{healthchecks-CtIfrFql.mjs → healthchecks-DRoAlWgr.mjs} +3 -3
  69. package/dist/hostnames-CFgIVI3s.mjs +3 -0
  70. package/dist/hyperdrive-C7-gwTSV.mjs +18 -0
  71. package/dist/iam-DqVPzGrb.mjs +6 -0
  72. package/dist/images-BYfl4YgR.mjs +7 -0
  73. package/dist/index.mjs +1 -1
  74. package/dist/intel-duTEPIHc.mjs +3 -0
  75. package/dist/{ips-K4bzaGqd.mjs → ips-nv9INuWZ.mjs} +1 -1
  76. package/dist/keyless-certificates-CRCDVd3g.mjs +3 -0
  77. package/dist/{kv-8o27w_pY.mjs → kv-CZoV4tiv.mjs} +4 -4
  78. package/dist/leaked-credential-checks-DNIBg7Pe.mjs +3 -0
  79. package/dist/{load-balancers-DtG8nj25.mjs → load-balancers--OMg0HNt.mjs} +5 -5
  80. package/dist/{logpush-4L0njy1d.mjs → logpush-C0_lZTyY.mjs} +3 -3
  81. package/dist/{logs-B_Yp95hv.mjs → logs-BtpWZQfV.mjs} +2 -2
  82. package/dist/magic-cloud-networking-u6rwYbGg.mjs +5 -0
  83. package/dist/{magic-network-monitoring-BnwvM4-I.mjs → magic-network-monitoring-CKgQyRj4.mjs} +3 -3
  84. package/dist/{magic-transit-CXDyvhxq.mjs → magic-transit-CLhMcJ_-.mjs} +32 -33
  85. package/dist/managed-transforms-D0Z2mlth.mjs +3 -0
  86. package/dist/mtls-certificates-BL65NK5T.mjs +3 -0
  87. package/dist/{network-interconnects-rrr7red3.mjs → network-interconnects-Bgu9gmaG.mjs} +5 -5
  88. package/dist/oauth-Bk-F-tIO.mjs +52 -0
  89. package/dist/{observability-DWvpqnQJ.mjs → observability-BynRbTF4.mjs} +3 -3
  90. package/dist/open-YWOUIZ5Y-3jqSKAB1.mjs +4 -0
  91. package/dist/{organizations-T77D50Sq.mjs → organizations-BqJHyvMK.mjs} +3 -3
  92. package/dist/origin-ca-certificates-BGvYwm3C.mjs +3 -0
  93. package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +2 -0
  94. package/dist/{origin-tls-client-auth-CaVW1Ztp.mjs → origin-tls-client-auth-d3snC3vr.mjs} +3 -3
  95. package/dist/{output-BJFNwj7b.mjs → output-B6fBFRqe.mjs} +1 -1
  96. package/dist/{page-rules-CjZPTMQX.mjs → page-rules-EZHJePmn.mjs} +4 -4
  97. package/dist/{page-shield-D5RRNJCY.mjs → page-shield-CXJioWPs.mjs} +5 -5
  98. package/dist/{pages-CWJtJnL0.mjs → pages-D4aYteKk.mjs} +8 -8
  99. package/dist/{pipelines-B0L_7j9e.mjs → pipelines-G8Iusxq-.mjs} +5 -5
  100. package/dist/progress-DrDErV9w.mjs +2 -0
  101. package/dist/queues-DEkbKqZX.mjs +6 -0
  102. package/dist/{r2-DQIcyRtA.mjs → r2-CV0IkCAW.mjs} +9 -9
  103. package/dist/r2-data-catalog-NtqGC_a_.mjs +14 -0
  104. package/dist/radar-D986zPJr.mjs +2 -0
  105. package/dist/{rate-limits-DcrQV6Ar.mjs → rate-limits-B2wRsUX1.mjs} +3 -3
  106. package/dist/raw-fetch-_n0lMAnD.mjs +2 -0
  107. package/dist/{realtime-kit-CaquuVOE.mjs → realtime-kit-Ld3c5eU6.mjs} +9 -9
  108. package/dist/{registrar-Ko-xZemf.mjs → registrar-CDIwTz3G.mjs} +6 -6
  109. package/dist/request-tracers-D7SFMDik.mjs +2 -0
  110. package/dist/resource-sharing-YIQ04jXE.mjs +5 -0
  111. package/dist/{resource-tagging-C3qtLzCz.mjs → resource-tagging-Bd6Y03sg.mjs} +7 -7
  112. package/dist/rules-DHjLP5Kx.mjs +4 -0
  113. package/dist/{rulesets-CBgpeSvJ.mjs → rulesets-q4QABpKs.mjs} +7 -7
  114. package/dist/rum-SmT4HZmM.mjs +4 -0
  115. package/dist/{schema-D16TgWBg.mjs → schema-BR31o4P6.mjs} +1 -1
  116. package/dist/{schema-validation-Dgv_opM3.mjs → schema-validation-vVetgC_P.mjs} +5 -5
  117. package/dist/{scim-DdSEr4kZ.mjs → scim-ChOkZpNx.mjs} +2 -2
  118. package/dist/{session-COHHdS7A.mjs → sdk-DhIhH6GB.mjs} +4 -4
  119. package/dist/{secrets-store-7BfyvJLb.mjs → secrets-store-BAK9G12O.mjs} +12 -12
  120. package/dist/security-center-eScuYDKP.mjs +2 -0
  121. package/dist/security-txt-x7R4gmQu.mjs +3 -0
  122. package/dist/session-DHYCE-PM.mjs +93 -0
  123. package/dist/shared-BAjo72Lz.mjs +2 -0
  124. package/dist/{smart-shield-TeWZFnH2.mjs → smart-shield-CWlSsNi8.mjs} +2 -2
  125. package/dist/snippets-DrlgYJYp.mjs +4 -0
  126. package/dist/{spawn-DcppKGI5.mjs → spawn-CCGzKlC4.mjs} +1 -1
  127. package/dist/{spectrum-CTTZID8u.mjs → spectrum-pVGxb7u5.mjs} +6 -6
  128. package/dist/speed-ZFrMWDgd.mjs +4 -0
  129. package/dist/src-DU7FBCOX.mjs +108 -0
  130. package/dist/ssl-9JY05sYt.mjs +15 -0
  131. package/dist/stream-tRU39b8K.mjs +14 -0
  132. package/dist/{tenants-Bd7NGQ_m.mjs → tenants-HLGUazms.mjs} +1 -1
  133. package/dist/{token-validation-DAgtFOvs.mjs → token-validation-_VdamKpz.mjs} +4 -4
  134. package/dist/{tools-DXQmfFuE.mjs → tools-D_hfUU_Z.mjs} +1 -1
  135. package/dist/{turnstile-cfdaO4ca.mjs → turnstile-BRzXd28B.mjs} +4 -4
  136. package/dist/{ui-D4KtlMh9.mjs → ui-erjBdVKL.mjs} +1 -1
  137. package/dist/url-normalization-D-NxuLtN.mjs +3 -0
  138. package/dist/url-scanner-BzzR6iDx.mjs +2 -0
  139. package/dist/{user-CAo-yCJA.mjs → user-C4omq__w.mjs} +2 -2
  140. package/dist/vectorize-By6EqcNR.mjs +4 -0
  141. package/dist/{versions-CUwWJWmy.mjs → versions-CBHwWPAM.mjs} +1 -1
  142. package/dist/{waiting-rooms-Dln5ICg5.mjs → waiting-rooms-u6KwrzWd.mjs} +6 -6
  143. package/dist/{web3-HQJRm38W.mjs → web3-DQ5dmE9W.mjs} +3 -3
  144. package/dist/{workers-Dg7ddG2Q.mjs → workers-D8Be7_as.mjs} +14 -14
  145. package/dist/workers-builds-BE3W3qNk.mjs +7 -0
  146. package/dist/{workflows-VquuSh2J.mjs → workflows-BWWufqFA.mjs} +3 -3
  147. package/dist/zaraz-Bsa9AvVL.mjs +2 -0
  148. package/dist/{zero-trust-CP96wnSh.mjs → zero-trust-UNVZFnKu.mjs} +87 -87
  149. package/dist/zero_trust-B0_Rk4p2.mjs +3 -0
  150. package/dist/zones-BXtdwt6E.mjs +21 -0
  151. package/package.json +4 -4
  152. package/dist/ai-DOOKLPkG.mjs +0 -2
  153. package/dist/ai-gateway-Cj1T3avF.mjs +0 -8
  154. package/dist/ai-search-CQF_Sn7d.mjs +0 -7
  155. package/dist/ai_gateway-C3fH22C0.mjs +0 -4
  156. package/dist/analytics_engine-DdXVR8z2.mjs +0 -2
  157. package/dist/argo-CX_A4kcn.mjs +0 -2
  158. package/dist/audit-logs-BfBf3oo-.mjs +0 -2
  159. package/dist/auth-SyWhMmPu.mjs +0 -6
  160. package/dist/auth-ffdf9yR0.mjs +0 -135
  161. package/dist/autorag-BuGhGTeZ.mjs +0 -2
  162. package/dist/billing-PoG81XaQ.mjs +0 -2
  163. package/dist/bot-management-CFvtVx62.mjs +0 -5
  164. package/dist/botnet-feed-B-M4Yu0W.mjs +0 -3
  165. package/dist/brand-protection-D05Eg-_6.mjs +0 -3
  166. package/dist/browser-rendering-xu8F_Rrv.mjs +0 -4
  167. package/dist/calls-CZbO7TyR.mjs +0 -4
  168. package/dist/certificate-authorities-D2yr7_3t.mjs +0 -2
  169. package/dist/client-certificates-MJcDsTId.mjs +0 -3
  170. package/dist/cloud-connector-DWOrN2eM.mjs +0 -2
  171. package/dist/config-DYzlVxcB.mjs +0 -2
  172. package/dist/connectivity-BX8C7tvK.mjs +0 -3
  173. package/dist/content-scanning-r6uzMO1r.mjs +0 -4
  174. package/dist/context-DGlHRGWM.mjs +0 -2
  175. package/dist/custom-nameservers-D1DtlRue.mjs +0 -3
  176. package/dist/custom-pages-DQCi2plU.mjs +0 -4
  177. package/dist/d1-DbnYhw45.mjs +0 -4
  178. package/dist/data-security-D_EtYBfo.mjs +0 -6
  179. package/dist/dcv-delegation-CHspSzTI.mjs +0 -2
  180. package/dist/diagnostics-BJQGjVJn.mjs +0 -3
  181. package/dist/dist-DNBSHor6.mjs +0 -301
  182. package/dist/dns-firewall-B4DVXFBQ.mjs +0 -57
  183. package/dist/durable-objects-CTboySEo.mjs +0 -2
  184. package/dist/email-sending-DwWKc5jC.mjs +0 -3
  185. package/dist/google-tag-gateway-BGD49nRC.mjs +0 -2
  186. package/dist/hostnames-BiomxukN.mjs +0 -3
  187. package/dist/hyperdrive-Da104VaQ.mjs +0 -18
  188. package/dist/iam-BIGKo0WW.mjs +0 -6
  189. package/dist/images-BO8FbDAa.mjs +0 -5
  190. package/dist/intel-CY6_79v8.mjs +0 -3
  191. package/dist/keyless-certificates-CZC-L8gM.mjs +0 -3
  192. package/dist/leaked-credential-checks-qLzRyu85.mjs +0 -3
  193. package/dist/magic-cloud-networking-CSOM3EM-.mjs +0 -5
  194. package/dist/managed-transforms-D15yVbZx.mjs +0 -3
  195. package/dist/mtls-certificates-D8k0AXWK.mjs +0 -3
  196. package/dist/origin-ca-certificates-DXIvD8H5.mjs +0 -3
  197. package/dist/origin-post-quantum-encryption-C8oOczyV.mjs +0 -2
  198. package/dist/progress-CrCGTq7N.mjs +0 -2
  199. package/dist/queues-CN6DPhRR.mjs +0 -6
  200. package/dist/r2-data-catalog-Bbo93TJx.mjs +0 -14
  201. package/dist/radar-Bxb0WX8V.mjs +0 -2
  202. package/dist/raw-fetch-Dlccg0Tr.mjs +0 -2
  203. package/dist/request-tracers-DOW_reTJ.mjs +0 -2
  204. package/dist/resource-sharing-D7TX0JV0.mjs +0 -5
  205. package/dist/rules-BXRADHL5.mjs +0 -4
  206. package/dist/rum-BjPptTUP.mjs +0 -4
  207. package/dist/security-center-DAy6AKtT.mjs +0 -2
  208. package/dist/security-txt-xAMb7K6Y.mjs +0 -3
  209. package/dist/shared-AGtpXwwL.mjs +0 -2
  210. package/dist/snippets-CCSsCXVs.mjs +0 -4
  211. package/dist/speed-CuzTE0AL.mjs +0 -4
  212. package/dist/src-BW6vfAwE.mjs +0 -108
  213. package/dist/ssl-BWA2LdwC.mjs +0 -15
  214. package/dist/stream-GFsIZ-pP.mjs +0 -14
  215. package/dist/url-normalization-B5RN4nLD.mjs +0 -3
  216. package/dist/url-scanner-BrZ1L9OC.mjs +0 -2
  217. package/dist/vectorize-C7_oQlaI.mjs +0 -4
  218. package/dist/workers-builds-AVfx8IyL.mjs +0 -7
  219. package/dist/zaraz-xYSWIV4P.mjs +0 -2
  220. package/dist/zones-BSgmZ9WC.mjs +0 -21
  221. /package/dist/{body-parser-DKa8Ipg1.mjs → body-parser-DWSy7uZ8.mjs} +0 -0
  222. /package/dist/{cli-types-CRIDdDw3.mjs → cli-types-BeyOc81z.mjs} +0 -0
  223. /package/dist/{input-validation-zEO81MWN.mjs → input-validation-_fMCApaH.mjs} +0 -0
  224. /package/dist/{lib-Eu1wXxuh.mjs → lib-4PQI6yRW.mjs} +0 -0
  225. /package/dist/{local-VJaJ3BZ1.mjs → local-CYc9q7l2.mjs} +0 -0
  226. /package/dist/{metadata-5VwHPW6C.mjs → metadata-OOwvpR8m.mjs} +0 -0
  227. /package/dist/{resolve-4-OSeHlK.mjs → resolve-C3h-mwp7.mjs} +0 -0
  228. /package/dist/{theme-BklJDrb2.mjs → theme-DbNbIY4d.mjs} +0 -0
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,S as n,T as r,_ as i,n as a}from"./auth-ffdf9yR0.mjs";import{n as o,t as s}from"./body-parser-DKa8Ipg1.mjs";import{t as c}from"./output-BJFNwj7b.mjs";import{n as l,t as u}from"./progress-CrCGTq7N.mjs";import{n as d}from"./input-validation-zEO81MWN.mjs";import{t as f}from"./local-VJaJ3BZ1.mjs";import{t as p}from"./cli-types-CRIDdDw3.mjs";function m(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:p(m),handler:async t=>{if(t.dryRun){l({command:`cf logpush account-datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}/fields`,pathParams:{"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.logpush.accountDatasets.fields.get({account_id:r,dataset_id:t[`dataset-id`]})),{successLabel:`Loaded`})}},h={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account for a dataset.`,builder:p(g),handler:async t=>{if(t.dryRun){l({command:`cf logpush account-datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}/jobs`,pathParams:{"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.logpush.accountDatasets.jobs.get({account_id:r,dataset_id:t[`dataset-id`]})),{successLabel:`Loaded`})}},v={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(h).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Creates a new Logpush job for an account.`,builder:b,handler:async n=>{if(n.dryRun){l({command:`cf logpush account-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({dataset:d(n.dataset,`dataset`,`text`),destination_conf:d(n[`destination-conf`],`destination-conf`,`text`),enabled:n.enabled,filter:d(n.filter,`filter`,`text`),frequency:d(n.frequency,`frequency`,`text`),kind:d(n.kind,`kind`,`text`),logpull_options:d(n[`logpull-options`],`logpull-options`,`text`),name:d(n.name,`name`,`text`),output_options:{"CVE-2021-44228":n[`output-options-cve-2021-44228`],batch_prefix:d(n[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(n[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(n[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:n[`output-options-field-names`],merge_subrequests:n[`output-options-merge-subrequests`],output_type:d(n[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(n[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(n[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(n[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(n[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:n[`output-options-sample-rate`],timestamp_format:d(n[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(n[`ownership-challenge`],`ownership-challenge`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.logpush.accountJobs.create({...e,account_id:p})),{successLabel:`Created`});return}n[`destination-conf`]===void 0&&(n[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=s({dataset:d(n.dataset,`dataset`,`text`),destination_conf:d(n[`destination-conf`],`destination-conf`,`text`),enabled:n.enabled,filter:d(n.filter,`filter`,`text`),frequency:d(n.frequency,`frequency`,`text`),kind:d(n.kind,`kind`,`text`),logpull_options:d(n[`logpull-options`],`logpull-options`,`text`),name:d(n.name,`name`,`text`),output_options:{"CVE-2021-44228":n[`output-options-cve-2021-44228`],batch_prefix:d(n[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(n[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(n[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:n[`output-options-field-names`],merge_subrequests:n[`output-options-merge-subrequests`],output_type:d(n[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(n[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(n[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(n[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(n[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:n[`output-options-sample-rate`],timestamp_format:d(n[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(n[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Creating`,async()=>r.logpush.accountJobs.create({...m,account_id:p})),{successLabel:`Created`})}};function S(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:p(S),handler:async t=>{if(t.dryRun){l({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/jobs/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}`,pathParams:{"job-id":String(t[`job-id`]??``)},bodyKind:`none`});return}let n=await a(t),o=t.local?f:await i(n);if(t.accountId=o,!await r({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}c(await u(`Deleting`,async()=>n.logpush.accountJobs.delete({account_id:o,job_id:t[`job-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:p(w),handler:async t=>{if(t.dryRun){l({command:`cf logpush account-jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/jobs/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}`,pathParams:{"job-id":String(t[`job-id`]??``)},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.logpush.accountJobs.get({account_id:r,job_id:t[`job-id`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`Lists Logpush jobs for an account.`,builder:E,handler:async t=>{if(t.dryRun){l({command:`cf logpush account-jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`none`});return}let n=await a(t),r=t.local?f:await i(n);t.accountId=r,c(await u(`Loading`,async()=>n.logpush.accountJobs.list({account_id:r})),{successLabel:`Loaded`})}};function O(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`]}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`]}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:p(O),handler:async t=>{if(t.dryRun){l({command:`cf logpush account-jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/jobs/${t[`job-id`]==null?`<job-id>`:encodeURIComponent(String(t[`job-id`]))}`,pathParams:{"job-id":String(t[`job-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`),enabled:t.enabled,filter:d(t.filter,`filter`,`text`),frequency:d(t.frequency,`frequency`,`text`),kind:d(t.kind,`kind`,`text`),logpull_options:d(t[`logpull-options`],`logpull-options`,`text`),name:d(t.name,`name`,`text`),output_options:{"CVE-2021-44228":t[`output-options-cve-2021-44228`],batch_prefix:d(t[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(t[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(t[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:t[`output-options-field-names`],merge_subrequests:t[`output-options-merge-subrequests`],output_type:d(t[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(t[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(t[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(t[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(t[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:t[`output-options-sample-rate`],timestamp_format:d(t[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(t[`ownership-challenge`],`ownership-challenge`,`text`)}):o(t.body)});return}let n=await a(t),r=t.local?f:await i(n);if(t.accountId=r,t.body){let e=o(t.body);c(await u(`Updating`,async()=>n.logpush.accountJobs.update({...e,account_id:r,job_id:t[`job-id`]})),{successLabel:`Updated`});return}let p=s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`),enabled:t.enabled,filter:d(t.filter,`filter`,`text`),frequency:d(t.frequency,`frequency`,`text`),kind:d(t.kind,`kind`,`text`),logpull_options:d(t[`logpull-options`],`logpull-options`,`text`),name:d(t.name,`name`,`text`),output_options:{"CVE-2021-44228":t[`output-options-cve-2021-44228`],batch_prefix:d(t[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(t[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(t[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:t[`output-options-field-names`],merge_subrequests:t[`output-options-merge-subrequests`],output_type:d(t[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(t[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(t[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(t[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(t[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:t[`output-options-sample-rate`],timestamp_format:d(t[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(t[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Updating`,async()=>n.logpush.accountJobs.update({...p,account_id:r,job_id:t[`job-id`]})),{successLabel:`Updated`})}},A={command:`account-jobs`,describe:`Operations for account-jobs`,builder:e=>e.command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:j,handler:async n=>{if(n.dryRun){l({command:`cf logpush account-ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/ownership`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({destination_conf:d(n[`destination-conf`],`destination-conf`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.logpush.accountOwnership.create({...e,account_id:p})),{successLabel:`Created`});return}n[`destination-conf`]===void 0&&(n[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=s({destination_conf:d(n[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>r.logpush.accountOwnership.create({...m,account_id:p})),{successLabel:`Created`})}};function N(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create`,describe:`Validates ownership challenge of the destination.`,builder:N,handler:async n=>{if(n.dryRun){l({command:`cf logpush account-ownership validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/ownership/validate`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({destination_conf:d(n[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(n[`ownership-challenge`],`ownership-challenge`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.logpush.accountOwnership.validate.create({...e,account_id:p})),{successLabel:`Created`});return}n[`destination-conf`]===void 0&&(n[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),n[`ownership-challenge`]===void 0&&(n[`ownership-challenge`]=await t(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let m=s({destination_conf:d(n[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(n[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Creating`,async()=>r.logpush.accountOwnership.validate.create({...m,account_id:p})),{successLabel:`Created`})}},F={command:`validate`,describe:`Operations for account-ownership.validate`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`account-ownership`,describe:`Operations for account-ownership`,builder:e=>e.command(M).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`destination-exists-delete`,describe:`Checks if there is an existing job with a destination.`,builder:L,handler:async n=>{if(n.dryRun){l({command:`cf logpush account-validate destination-exists-delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/validate/destination/exists`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({destination_conf:d(n[`destination-conf`],`destination-conf`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.logpush.accountValidate.destinationExistsDelete({...e,account_id:p})),{successLabel:`Created`});return}n[`destination-conf`]===void 0&&(n[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=s({destination_conf:d(n[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>r.logpush.accountValidate.destinationExistsDelete({...m,account_id:p})),{successLabel:`Created`})}};function z(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`delete`,describe:`Validates destination.`,builder:z,handler:async n=>{if(n.dryRun){l({command:`cf logpush account-validate destination delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/validate/destination`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({destination_conf:d(n[`destination-conf`],`destination-conf`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.logpush.accountValidate.destination.delete({...e,account_id:p})),{successLabel:`Created`});return}n[`destination-conf`]===void 0&&(n[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=s({destination_conf:d(n[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>r.logpush.accountValidate.destination.delete({...m,account_id:p})),{successLabel:`Created`})}},V={command:`destination`,describe:`Operations for account-validate.destination`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).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 U={command:`create`,describe:`Validates logpull origin with logpull_options.`,builder:H,handler:async n=>{if(n.dryRun){l({command:`cf logpush account-validate origin create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logpush/validate/origin`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({logpull_options:d(n[`logpull-options`],`logpull-options`,`text`)}):o(n.body)});return}let r=await a(n),p=n.local?f:await i(r);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>r.logpush.accountValidate.origin.create({...e,account_id:p})),{successLabel:`Created`});return}n[`logpull-options`]===void 0&&(n[`logpull-options`]=await t(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let m=s({logpull_options:d(n[`logpull-options`],`logpull-options`,`text`)});c(await u(`Creating`,async()=>r.logpush.accountValidate.origin.create({...m,account_id:p})),{successLabel:`Created`})}},W={command:`origin`,describe:`Operations for account-validate.origin`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`account-validate`,describe:`Operations for account-validate`,builder:e=>e.command(R).command(V).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:p(K),handler:async e=>{if(e.dryRun){l({command:`cf logpush datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/fields`,pathParams:{"dataset-id":String(e[`dataset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.logpush.datasets.fields.get({zone_id:r,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},J={command:`fields`,describe:`Operations for datasets.fields`,builder:e=>e.command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <dataset-id>`,describe:`Lists Logpush jobs for a zone for a dataset.`,builder:p(Y),handler:async e=>{if(e.dryRun){l({command:`cf logpush datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/jobs`,pathParams:{"dataset-id":String(e[`dataset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.logpush.datasets.jobs.get({zone_id:r,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},te={command:`jobs`,describe:`Operations for datasets.jobs`,builder:e=>e.command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Z={command:`datasets`,describe:`Operations for datasets`,builder:e=>e.command(J).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.option(`fields`,{type:`string`,description:`Comma-separated list of fields.`}).option(`filter`,{type:`string`,description:`Filters to drill down into specific events.`}).option(`sample`,{type:`number`,description:`The sample parameter is the sample rate of the records set by the client: "sample": 1 is 100% of records "sample": 10 is 10% and so on.`}).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 ne={command:`create`,describe:`Creates a new Instant Logs job for a zone.`,builder:Q,handler:async e=>{if(e.dryRun){l({command:`cf logpush edge create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({fields:d(e.fields,`fields`,`text`),filter:d(e.filter,`filter`,`text`),sample:e.sample}):o(e.body)});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=o(e.body);c(await u(`Creating`,async()=>t.logpush.edge.create({...n,zone_id:r})),{successLabel:`Created`});return}let i=s({fields:d(e.fields,`fields`,`text`),filter:d(e.filter,`filter`,`text`),sample:e.sample});c(await u(`Creating`,async()=>t.logpush.edge.create({...i,zone_id:r})),{successLabel:`Created`})}};function re(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get`,describe:`Lists Instant Logs jobs for a zone.`,builder:re,handler:async e=>{if(e.dryRun){l({command:`cf logpush edge get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.logpush.edge.get({zone_id:r})),{successLabel:`Loaded`})}},ae={command:`edge`,describe:`Operations for edge`,builder:e=>e.command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 se={command:`create`,describe:`Creates a new Logpush job for a zone.`,builder:oe,handler:async e=>{if(e.dryRun){l({command:`cf logpush jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({dataset:d(e.dataset,`dataset`,`text`),destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:d(e.filter,`filter`,`text`),frequency:d(e.frequency,`frequency`,`text`),kind:d(e.kind,`kind`,`text`),logpull_options:d(e[`logpull-options`],`logpull-options`,`text`),name:d(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:d(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:d(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:d(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.logpush.jobs.create({...t,zone_id:i})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=s({dataset:d(e.dataset,`dataset`,`text`),destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:d(e.filter,`filter`,`text`),frequency:d(e.frequency,`frequency`,`text`),kind:d(e.kind,`kind`,`text`),logpull_options:d(e[`logpull-options`],`logpull-options`,`text`),name:d(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:d(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:d(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:d(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Creating`,async()=>r.logpush.jobs.create({...f,zone_id:i})),{successLabel:`Created`})}};function ce(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,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:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:p(ce),handler:async e=>{if(e.dryRun){l({command:`cf logpush jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),i=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=i,!await r({force:!!e.force})){process.stderr.write(`Aborted.
4
- `);return}c(await u(`Deleting`,async()=>t.logpush.jobs.delete({zone_id:i,job_id:e[`job-id`]})),{successLabel:`Deleted`})}};function ue(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:p(ue),handler:async e=>{if(e.dryRun){l({command:`cf logpush jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.logpush.jobs.get({zone_id:r,job_id:e[`job-id`]})),{successLabel:`Loaded`})}};function fe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`Lists Logpush jobs for a zone.`,builder:fe,handler:async e=>{if(e.dryRun){l({command:`cf logpush jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,c(await u(`Loading`,async()=>t.logpush.jobs.list({zone_id:r})),{successLabel:`Loaded`})}};function me(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`]}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`]}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 he={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:p(me),handler:async e=>{if(e.dryRun){l({command:`cf logpush jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:d(e.filter,`filter`,`text`),frequency:d(e.frequency,`frequency`,`text`),kind:d(e.kind,`kind`,`text`),logpull_options:d(e[`logpull-options`],`logpull-options`,`text`),name:d(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:d(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:d(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:d(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)}):o(e.body)});return}let t=await a(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=o(e.body);c(await u(`Updating`,async()=>t.logpush.jobs.update({...n,zone_id:r,job_id:e[`job-id`]})),{successLabel:`Updated`});return}let i=s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:d(e.filter,`filter`,`text`),frequency:d(e.frequency,`frequency`,`text`),kind:d(e.kind,`kind`,`text`),logpull_options:d(e[`logpull-options`],`logpull-options`,`text`),name:d(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:d(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:d(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:d(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Updating`,async()=>t.logpush.jobs.update({...i,zone_id:r,job_id:e[`job-id`]})),{successLabel:`Updated`})}},ge={command:`jobs`,describe:`Operations for jobs`,builder:e=>e.command(se).command(le).command(de).command(pe).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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 ve={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:_e,handler:async e=>{if(e.dryRun){l({command:`cf logpush ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/ownership`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.logpush.ownership.create({...t,zone_id:i})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>r.logpush.ownership.create({...f,zone_id:i})),{successLabel:`Created`})}};function ye(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 be={command:`validate`,describe:`Validates ownership challenge of the destination.`,builder:ye,handler:async e=>{if(e.dryRun){l({command:`cf logpush ownership validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/ownership/validate`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.logpush.ownership.validate({...t,zone_id:i})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),e[`ownership-challenge`]===void 0&&(e[`ownership-challenge`]=await t(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let f=s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Creating`,async()=>r.logpush.ownership.validate({...f,zone_id:i})),{successLabel:`Created`})}},$={command:`ownership`,describe:`Operations for ownership`,builder:e=>e.command(ve).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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 Se={command:`destination-exists`,describe:`Checks if there is an existing job with a destination.`,builder:xe,handler:async e=>{if(e.dryRun){l({command:`cf logpush validate destination-exists`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/validate/destination/exists`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.logpush.validate.destinationExists({...t,zone_id:i})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>r.logpush.validate.destinationExists({...f,zone_id:i})),{successLabel:`Created`})}};function Ce(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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 we={command:`destination`,describe:`Validates destination.`,builder:Ce,handler:async e=>{if(e.dryRun){l({command:`cf logpush validate destination`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/validate/destination`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.logpush.validate.destination({...t,zone_id:i})),{successLabel:`Created`});return}e[`destination-conf`]===void 0&&(e[`destination-conf`]=await t(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>r.logpush.validate.destination({...f,zone_id:i})),{successLabel:`Created`})}};function Te(e){return e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`origin`,describe:`Validates logpull origin with logpull_options.`,builder:Te,handler:async e=>{if(e.dryRun){l({command:`cf logpush validate origin`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/validate/origin`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({logpull_options:d(e[`logpull-options`],`logpull-options`,`text`)}):o(e.body)});return}let r=await a(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=o(e.body);c(await u(`Creating`,async()=>r.logpush.validate.origin({...t,zone_id:i})),{successLabel:`Created`});return}e[`logpull-options`]===void 0&&(e[`logpull-options`]=await t(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let f=s({logpull_options:d(e[`logpull-options`],`logpull-options`,`text`)});c(await u(`Creating`,async()=>r.logpush.validate.origin({...f,zone_id:i})),{successLabel:`Created`})}},De={command:`validate`,describe:`Operations for validate`,builder:e=>e.command(we).command(Se).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Oe={command:`logpush`,describe:`Push Cloudflare logs to external storage destinations — R2, S3, Splunk, Datadog, and more`,builder:e=>e.command(y).command(A).command(I).command(G).command(Z).command(ae).command(ge).command($).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Oe as default};
2
+ import{E as e,S as t,g as n,w as r,x as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";import{t as p}from"./cli-types-BeyOc81z.mjs";function m(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:p(m),handler:async e=>{if(e.dryRun){l({command:`cf logpush account-datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/fields`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?f:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.logpush.accountDatasets.fields.get({account_id:i,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},h={command:`fields`,describe:`Operations for account-datasets.fields`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <dataset-id>`,describe:`Lists Logpush jobs for an account for a dataset.`,builder:p(g),handler:async e=>{if(e.dryRun){l({command:`cf logpush account-datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/jobs`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?f:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.logpush.accountDatasets.jobs.get({account_id:i,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},v={command:`jobs`,describe:`Operations for account-datasets.jobs`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},y={command:`account-datasets`,describe:`Operations for account-datasets`,builder:e=>e.command(h).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`create`,describe:`Creates a new Logpush job for an account.`,builder:b,handler:async r=>{if(r.dryRun){l({command:`cf logpush account-jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({dataset:d(r.dataset,`dataset`,`text`),destination_conf:d(r[`destination-conf`],`destination-conf`,`text`),enabled:r.enabled,filter:d(r.filter,`filter`,`text`),frequency:d(r.frequency,`frequency`,`text`),kind:d(r.kind,`kind`,`text`),logpull_options:d(r[`logpull-options`],`logpull-options`,`text`),name:d(r.name,`name`,`text`),output_options:{"CVE-2021-44228":r[`output-options-cve-2021-44228`],batch_prefix:d(r[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(r[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(r[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:r[`output-options-field-names`],merge_subrequests:r[`output-options-merge-subrequests`],output_type:d(r[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(r[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(r[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(r[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(r[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:r[`output-options-sample-rate`],timestamp_format:d(r[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(r[`ownership-challenge`],`ownership-challenge`,`text`)}):o(r.body)});return}let i=await a(r),p=r.local?f:await n(i);if(r.accountId=p,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.logpush.accountJobs.create({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=s({dataset:d(r.dataset,`dataset`,`text`),destination_conf:d(r[`destination-conf`],`destination-conf`,`text`),enabled:r.enabled,filter:d(r.filter,`filter`,`text`),frequency:d(r.frequency,`frequency`,`text`),kind:d(r.kind,`kind`,`text`),logpull_options:d(r[`logpull-options`],`logpull-options`,`text`),name:d(r.name,`name`,`text`),output_options:{"CVE-2021-44228":r[`output-options-cve-2021-44228`],batch_prefix:d(r[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(r[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(r[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:r[`output-options-field-names`],merge_subrequests:r[`output-options-merge-subrequests`],output_type:d(r[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(r[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(r[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(r[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(r[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:r[`output-options-sample-rate`],timestamp_format:d(r[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(r[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Creating`,async()=>i.logpush.accountJobs.create({...m,account_id:p})),{successLabel:`Created`})}};function S(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:p(S),handler:async e=>{if(e.dryRun){l({command:`cf logpush account-jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let i=await a(e),o=e.local?f:await n(i);if(e.accountId=o,!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
+ `);return}c(await u(`Deleting`,async()=>i.logpush.accountJobs.delete({account_id:o,job_id:e[`job-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:p(w),handler:async e=>{if(e.dryRun){l({command:`cf logpush account-jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`none`});return}let r=await a(e),i=e.local?f:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.logpush.accountJobs.get({account_id:i,job_id:e[`job-id`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`Lists Logpush jobs for an account.`,builder:E,handler:async e=>{if(e.dryRun){l({command:`cf logpush account-jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/jobs`,pathParams:{},bodyKind:`none`});return}let r=await a(e),i=e.local?f:await n(r);e.accountId=i,c(await u(`Loading`,async()=>r.logpush.accountJobs.list({account_id:i})),{successLabel:`Loaded`})}};function O(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`]}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`]}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:p(O),handler:async e=>{if(e.dryRun){l({command:`cf logpush account-jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:d(e.filter,`filter`,`text`),frequency:d(e.frequency,`frequency`,`text`),kind:d(e.kind,`kind`,`text`),logpull_options:d(e[`logpull-options`],`logpull-options`,`text`),name:d(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:d(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:d(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:d(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)}):o(e.body)});return}let r=await a(e),i=e.local?f:await n(r);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>r.logpush.accountJobs.update({...t,account_id:i,job_id:e[`job-id`]})),{successLabel:`Updated`});return}let p=s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:d(e.filter,`filter`,`text`),frequency:d(e.frequency,`frequency`,`text`),kind:d(e.kind,`kind`,`text`),logpull_options:d(e[`logpull-options`],`logpull-options`,`text`),name:d(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:d(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:d(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:d(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Updating`,async()=>r.logpush.accountJobs.update({...p,account_id:i,job_id:e[`job-id`]})),{successLabel:`Updated`})}},A={command:`account-jobs`,describe:`Operations for account-jobs`,builder:e=>e.command(x).command(C).command(T).command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:j,handler:async r=>{if(r.dryRun){l({command:`cf logpush account-ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/ownership`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({destination_conf:d(r[`destination-conf`],`destination-conf`,`text`)}):o(r.body)});return}let i=await a(r),p=r.local?f:await n(i);if(r.accountId=p,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.logpush.accountOwnership.create({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=s({destination_conf:d(r[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>i.logpush.accountOwnership.create({...m,account_id:p})),{successLabel:`Created`})}};function N(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const P={command:`create`,describe:`Validates ownership challenge of the destination.`,builder:N,handler:async r=>{if(r.dryRun){l({command:`cf logpush account-ownership validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/ownership/validate`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({destination_conf:d(r[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(r[`ownership-challenge`],`ownership-challenge`,`text`)}):o(r.body)});return}let i=await a(r),p=r.local?f:await n(i);if(r.accountId=p,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.logpush.accountOwnership.validate.create({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),r[`ownership-challenge`]===void 0&&(r[`ownership-challenge`]=await e(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let m=s({destination_conf:d(r[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(r[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Creating`,async()=>i.logpush.accountOwnership.validate.create({...m,account_id:p})),{successLabel:`Created`})}},F={command:`validate`,describe:`Operations for account-ownership.validate`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`account-ownership`,describe:`Operations for account-ownership`,builder:e=>e.command(M).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const R={command:`destination-exists-delete`,describe:`Checks if there is an existing job with a destination.`,builder:L,handler:async r=>{if(r.dryRun){l({command:`cf logpush account-validate destination-exists-delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/validate/destination/exists`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({destination_conf:d(r[`destination-conf`],`destination-conf`,`text`)}):o(r.body)});return}let i=await a(r),p=r.local?f:await n(i);if(r.accountId=p,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.logpush.accountValidate.destinationExistsDelete({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=s({destination_conf:d(r[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>i.logpush.accountValidate.destinationExistsDelete({...m,account_id:p})),{successLabel:`Created`})}};function z(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const B={command:`delete`,describe:`Validates destination.`,builder:z,handler:async r=>{if(r.dryRun){l({command:`cf logpush account-validate destination delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/validate/destination`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({destination_conf:d(r[`destination-conf`],`destination-conf`,`text`)}):o(r.body)});return}let i=await a(r),p=r.local?f:await n(i);if(r.accountId=p,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.logpush.accountValidate.destination.delete({...e,account_id:p})),{successLabel:`Created`});return}r[`destination-conf`]===void 0&&(r[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let m=s({destination_conf:d(r[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>i.logpush.accountValidate.destination.delete({...m,account_id:p})),{successLabel:`Created`})}},V={command:`destination`,describe:`Operations for account-validate.destination`,builder:e=>e.command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).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 U={command:`create`,describe:`Validates logpull origin with logpull_options.`,builder:H,handler:async r=>{if(r.dryRun){l({command:`cf logpush account-validate origin create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logpush/validate/origin`,pathParams:{},bodyKind:`json`,body:r.body===void 0?s({logpull_options:d(r[`logpull-options`],`logpull-options`,`text`)}):o(r.body)});return}let i=await a(r),p=r.local?f:await n(i);if(r.accountId=p,r.body){let e=o(r.body);c(await u(`Creating`,async()=>i.logpush.accountValidate.origin.create({...e,account_id:p})),{successLabel:`Created`});return}r[`logpull-options`]===void 0&&(r[`logpull-options`]=await e(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let m=s({logpull_options:d(r[`logpull-options`],`logpull-options`,`text`)});c(await u(`Creating`,async()=>i.logpush.accountValidate.origin.create({...m,account_id:p})),{successLabel:`Created`})}},W={command:`origin`,describe:`Operations for account-validate.origin`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},G={command:`account-validate`,describe:`Operations for account-validate`,builder:e=>e.command(R).command(V).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <dataset-id>`,describe:`Lists all fields available for a dataset. The response result is. an object with key-value pairs, where keys are field names, and values are descriptions.`,builder:p(K),handler:async e=>{if(e.dryRun){l({command:`cf logpush datasets fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/fields`,pathParams:{"dataset-id":String(e[`dataset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Loading`,async()=>t.logpush.datasets.fields.get({zone_id:n,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},J={command:`fields`,describe:`Operations for datasets.fields`,builder:e=>e.command(q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`dataset-id`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <dataset-id>`,describe:`Lists Logpush jobs for a zone for a dataset.`,builder:p(Y),handler:async e=>{if(e.dryRun){l({command:`cf logpush datasets jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}/jobs`,pathParams:{"dataset-id":String(e[`dataset-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Loading`,async()=>t.logpush.datasets.jobs.get({zone_id:n,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}},te={command:`jobs`,describe:`Operations for datasets.jobs`,builder:e=>e.command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Z={command:`datasets`,describe:`Operations for datasets`,builder:e=>e.command(J).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.option(`fields`,{type:`string`,description:`Comma-separated list of fields.`}).option(`filter`,{type:`string`,description:`Filters to drill down into specific events.`}).option(`sample`,{type:`number`,description:`The sample parameter is the sample rate of the records set by the client: "sample": 1 is 100% of records "sample": 10 is 10% and so on.`}).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 ne={command:`create`,describe:`Creates a new Instant Logs job for a zone.`,builder:Q,handler:async e=>{if(e.dryRun){l({command:`cf logpush edge create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({fields:d(e.fields,`fields`,`text`),filter:d(e.filter,`filter`,`text`),sample:e.sample}):o(e.body)});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=o(e.body);c(await u(`Creating`,async()=>t.logpush.edge.create({...r,zone_id:n})),{successLabel:`Created`});return}let r=s({fields:d(e.fields,`fields`,`text`),filter:d(e.filter,`filter`,`text`),sample:e.sample});c(await u(`Creating`,async()=>t.logpush.edge.create({...r,zone_id:n})),{successLabel:`Created`})}};function re(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get`,describe:`Lists Instant Logs jobs for a zone.`,builder:re,handler:async e=>{if(e.dryRun){l({command:`cf logpush edge get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/edge/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Loading`,async()=>t.logpush.edge.get({zone_id:n})),{successLabel:`Loaded`})}},ae={command:`edge`,describe:`Operations for edge`,builder:e=>e.command(ne).command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return e.option(`dataset`,{type:`string`,description:`Name of the dataset. A list of supported datasets can be found on the [Developer Docs](https://developers.cloudflare.com/logs/reference/log-fields/).`,choices:`access_requests.audit_logs.audit_logs_v2.biso_user_actions.casb_findings.device_posture_results.dex_application_tests.dex_device_state_events.dlp_forensic_copies.dns_firewall_logs.dns_logs.email_security_alerts.email_security_post_delivery_events.firewall_events.gateway_dns.gateway_http.gateway_network.http_requests.ipsec_logs.magic_ids_detections.mcp_portal_logs.mnm_flow_logs.nel_reports.network_analytics_logs.page_shield_events.sinkhole_http_logs.spectrum_events.ssh_logs.turnstile_events.warp_config_changes.warp_toggle_changes.websocket_analytics.workers_trace_events.zaraz_events.zero_trust_network_sessions`.split(`.`),default:`http_requests`}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`,default:!1}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`],default:`high`}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`],default:``}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 se={command:`create`,describe:`Creates a new Logpush job for a zone.`,builder:oe,handler:async t=>{if(t.dryRun){l({command:`cf logpush jobs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/jobs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({dataset:d(t.dataset,`dataset`,`text`),destination_conf:d(t[`destination-conf`],`destination-conf`,`text`),enabled:t.enabled,filter:d(t.filter,`filter`,`text`),frequency:d(t.frequency,`frequency`,`text`),kind:d(t.kind,`kind`,`text`),logpull_options:d(t[`logpull-options`],`logpull-options`,`text`),name:d(t.name,`name`,`text`),output_options:{"CVE-2021-44228":t[`output-options-cve-2021-44228`],batch_prefix:d(t[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(t[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(t[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:t[`output-options-field-names`],merge_subrequests:t[`output-options-merge-subrequests`],output_type:d(t[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(t[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(t[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(t[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(t[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:t[`output-options-sample-rate`],timestamp_format:d(t[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(t[`ownership-challenge`],`ownership-challenge`,`text`)}):o(t.body)});return}let n=await a(t),r=await i({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.logpush.jobs.create({...e,zone_id:r})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=s({dataset:d(t.dataset,`dataset`,`text`),destination_conf:d(t[`destination-conf`],`destination-conf`,`text`),enabled:t.enabled,filter:d(t.filter,`filter`,`text`),frequency:d(t.frequency,`frequency`,`text`),kind:d(t.kind,`kind`,`text`),logpull_options:d(t[`logpull-options`],`logpull-options`,`text`),name:d(t.name,`name`,`text`),output_options:{"CVE-2021-44228":t[`output-options-cve-2021-44228`],batch_prefix:d(t[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(t[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(t[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:t[`output-options-field-names`],merge_subrequests:t[`output-options-merge-subrequests`],output_type:d(t[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(t[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(t[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(t[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(t[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:t[`output-options-sample-rate`],timestamp_format:d(t[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(t[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Creating`,async()=>n.logpush.jobs.create({...f,zone_id:r})),{successLabel:`Created`})}};function ce(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,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:`delete <job-id>`,describe:`Deletes a Logpush job.`,builder:p(ce),handler:async e=>{if(e.dryRun){l({command:`cf logpush jobs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await r({force:!!e.force})){process.stderr.write(`Aborted.
4
+ `);return}c(await u(`Deleting`,async()=>t.logpush.jobs.delete({zone_id:n,job_id:e[`job-id`]})),{successLabel:`Deleted`})}};function ue(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <job-id>`,describe:`Gets the details of a Logpush job.`,builder:p(ue),handler:async e=>{if(e.dryRun){l({command:`cf logpush jobs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Loading`,async()=>t.logpush.jobs.get({zone_id:n,job_id:e[`job-id`]})),{successLabel:`Loaded`})}};function fe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`Lists Logpush jobs for a zone.`,builder:fe,handler:async e=>{if(e.dryRun){l({command:`cf logpush jobs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,c(await u(`Loading`,async()=>t.logpush.jobs.list({zone_id:n})),{successLabel:`Loaded`})}};function me(e){return e.positional(`job-id`,{type:`string`,description:`Unique id of the job.`,demandOption:!0}).option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`enabled`,{type:`boolean`,description:`Flag that indicates if the job is enabled.`}).option(`filter`,{type:`string`,description:`The filters to select the events to include and/or remove from your logs. For more information, refer to [Filters](https://developers.cloudflare.com/logs/reference/filters/).`}).option(`frequency`,{type:`string`,description:"This field is deprecated. Please use `max_upload_*` parameters instead. . The frequency at which Cloudflare sends batches of logs to your destination. Setting frequency to high sends your logs in larger quantities of smaller files. Setting frequency to low sends logs in smaller quantities of larger files.",choices:[`high`,`low`]}).option(`kind`,{type:`string`,description:`The kind parameter (optional) is used to differentiate between Logpush and Edge Log Delivery jobs (when supported by the dataset).`,choices:[`edge`]}).option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`name`,{type:`string`,description:`Optional human readable job name. Not unique. Cloudflare suggests. that you set this to a meaningful string, like the domain name, to make it easier to identify your job.`}).option(`output-options-cve-2021-44228`,{type:`boolean`,description:"If set to true, will cause all occurrences of `${` in the generated files to be replaced with `x{`."}).option(`output-options-batch-prefix`,{type:`string`,description:`String to be prepended before each batch.`}).option(`output-options-batch-suffix`,{type:`string`,description:`String to be appended after each batch.`}).option(`output-options-field-delimiter`,{type:`string`,description:"String to join fields. This field be ignored when `record_template` is set."}).option(`output-options-field-names`,{type:`string`,array:!0,description:`List of field names to be included in the Logpush output. For the moment, there is no option to add all fields at once, so you must specify all the fields names you are interested in.`}).option(`output-options-merge-subrequests`,{type:`boolean`,description:"If set to true, subrequests will be merged into the parent request. Only supported for the `http_requests` dataset."}).option(`output-options-output-type`,{type:`string`,description:"Specifies the output type, such as `ndjson` or `csv`. This sets default values for the rest of the settings, depending on the chosen output type. Some formatting rules, like string quoting, are different between output types.",choices:[`ndjson`,`csv`]}).option(`output-options-record-delimiter`,{type:`string`,description:`String to be inserted in-between the records as separator.`}).option(`output-options-record-prefix`,{type:`string`,description:`String to be prepended before each record.`}).option(`output-options-record-suffix`,{type:`string`,description:`String to be appended after each record.`}).option(`output-options-record-template`,{type:`string`,description:"String to use as template for each record instead of the default json key value mapping. All fields used in the template must be present in `field_names` as well, otherwise they will end up as null. Format as a Go `text/template` without any standard functions, like conditionals, loops, sub-templates, etc."}).option(`output-options-sample-rate`,{type:`number`,description:"Floating number to specify sampling rate. Sampling is applied on top of filtering, and regardless of the current `sample_interval` of the data."}).option(`output-options-timestamp-format`,{type:`string`,description:"String to specify the format for timestamps, such as `unixnano`, `unix`, `rfc3339`, `rfc3339ms` or `rfc3339ns`.",choices:[`unixnano`,`unix`,`rfc3339`,`rfc3339ms`,`rfc3339ns`]}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 he={command:`update <job-id>`,describe:`Updates a Logpush job.`,builder:p(me),handler:async e=>{if(e.dryRun){l({command:`cf logpush jobs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logpush/jobs/${e[`job-id`]==null?`<job-id>`:encodeURIComponent(String(e[`job-id`]))}`,pathParams:{"job-id":String(e[`job-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:d(e.filter,`filter`,`text`),frequency:d(e.frequency,`frequency`,`text`),kind:d(e.kind,`kind`,`text`),logpull_options:d(e[`logpull-options`],`logpull-options`,`text`),name:d(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:d(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:d(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:d(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)}):o(e.body)});return}let t=await a(e),n=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=o(e.body);c(await u(`Updating`,async()=>t.logpush.jobs.update({...r,zone_id:n,job_id:e[`job-id`]})),{successLabel:`Updated`});return}let r=s({destination_conf:d(e[`destination-conf`],`destination-conf`,`text`),enabled:e.enabled,filter:d(e.filter,`filter`,`text`),frequency:d(e.frequency,`frequency`,`text`),kind:d(e.kind,`kind`,`text`),logpull_options:d(e[`logpull-options`],`logpull-options`,`text`),name:d(e.name,`name`,`text`),output_options:{"CVE-2021-44228":e[`output-options-cve-2021-44228`],batch_prefix:d(e[`output-options-batch-prefix`],`output-options-batch-prefix`,`text`),batch_suffix:d(e[`output-options-batch-suffix`],`output-options-batch-suffix`,`text`),field_delimiter:d(e[`output-options-field-delimiter`],`output-options-field-delimiter`,`text`),field_names:e[`output-options-field-names`],merge_subrequests:e[`output-options-merge-subrequests`],output_type:d(e[`output-options-output-type`],`output-options-output-type`,`text`),record_delimiter:d(e[`output-options-record-delimiter`],`output-options-record-delimiter`,`text`),record_prefix:d(e[`output-options-record-prefix`],`output-options-record-prefix`,`text`),record_suffix:d(e[`output-options-record-suffix`],`output-options-record-suffix`,`text`),record_template:d(e[`output-options-record-template`],`output-options-record-template`,`text`),sample_rate:e[`output-options-sample-rate`],timestamp_format:d(e[`output-options-timestamp-format`],`output-options-timestamp-format`,`text`)},ownership_challenge:d(e[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Updating`,async()=>t.logpush.jobs.update({...r,zone_id:n,job_id:e[`job-id`]})),{successLabel:`Updated`})}},ge={command:`jobs`,describe:`Operations for jobs`,builder:e=>e.command(se).command(le).command(de).command(pe).command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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 ve={command:`create`,describe:`Gets a new ownership challenge sent to your destination.`,builder:_e,handler:async t=>{if(t.dryRun){l({command:`cf logpush ownership create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/ownership`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`)}):o(t.body)});return}let n=await a(t),r=await i({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.logpush.ownership.create({...e,zone_id:r})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>n.logpush.ownership.create({...f,zone_id:r})),{successLabel:`Created`})}};function ye(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).option(`ownership-challenge`,{type:`string`,description:`Ownership challenge token to prove destination ownership.`}).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 be={command:`validate`,describe:`Validates ownership challenge of the destination.`,builder:ye,handler:async t=>{if(t.dryRun){l({command:`cf logpush ownership validate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/ownership/validate`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(t[`ownership-challenge`],`ownership-challenge`,`text`)}):o(t.body)});return}let n=await a(t),r=await i({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.logpush.ownership.validate({...e,zone_id:r})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`})),t[`ownership-challenge`]===void 0&&(t[`ownership-challenge`]=await e(`ownership-challenge`,`Ownership challenge token to prove destination ownership.`,{kind:`secret`}));let f=s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`),ownership_challenge:d(t[`ownership-challenge`],`ownership-challenge`,`text`)});c(await u(`Creating`,async()=>n.logpush.ownership.validate({...f,zone_id:r})),{successLabel:`Created`})}},$={command:`ownership`,describe:`Operations for ownership`,builder:e=>e.command(ve).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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 Se={command:`destination-exists`,describe:`Checks if there is an existing job with a destination.`,builder:xe,handler:async t=>{if(t.dryRun){l({command:`cf logpush validate destination-exists`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/validate/destination/exists`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`)}):o(t.body)});return}let n=await a(t),r=await i({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.logpush.validate.destinationExists({...e,zone_id:r})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>n.logpush.validate.destinationExists({...f,zone_id:r})),{successLabel:`Created`})}};function Ce(e){return e.option(`destination-conf`,{type:`string`,description:`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`}).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 we={command:`destination`,describe:`Validates destination.`,builder:Ce,handler:async t=>{if(t.dryRun){l({command:`cf logpush validate destination`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/validate/destination`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`)}):o(t.body)});return}let n=await a(t),r=await i({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.logpush.validate.destination({...e,zone_id:r})),{successLabel:`Created`});return}t[`destination-conf`]===void 0&&(t[`destination-conf`]=await e(`destination-conf`,`Uniquely identifies a resource (such as an s3 bucket) where data. will be pushed. Additional configuration parameters supported by the destination may be included.`,{kind:`secret`}));let f=s({destination_conf:d(t[`destination-conf`],`destination-conf`,`text`)});c(await u(`Creating`,async()=>n.logpush.validate.destination({...f,zone_id:r})),{successLabel:`Created`})}};function Te(e){return e.option(`logpull-options`,{type:`string`,description:"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`origin`,describe:`Validates logpull origin with logpull_options.`,builder:Te,handler:async t=>{if(t.dryRun){l({command:`cf logpush validate origin`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logpush/validate/origin`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({logpull_options:d(t[`logpull-options`],`logpull-options`,`text`)}):o(t.body)});return}let n=await a(t),r=await i({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=o(t.body);c(await u(`Creating`,async()=>n.logpush.validate.origin({...e,zone_id:r})),{successLabel:`Created`});return}t[`logpull-options`]===void 0&&(t[`logpull-options`]=await e(`logpull-options`,"This field is deprecated. Use `output_options` instead. Configuration string. It specifies things like requested fields and timestamp formats. If migrating from the logpull api, copy the url (full url or just the query string) of your call here, and logpush will keep on making this call for you, setting start and end times appropriately."));let f=s({logpull_options:d(t[`logpull-options`],`logpull-options`,`text`)});c(await u(`Creating`,async()=>n.logpush.validate.origin({...f,zone_id:r})),{successLabel:`Created`})}},De={command:`validate`,describe:`Operations for validate`,builder:e=>e.command(we).command(Se).command(Ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Oe={command:`logpush`,describe:`Push Cloudflare logs to external storage destinations — R2, S3, Splunk, Datadog, and more`,builder:e=>e.command(y).command(A).command(I).command(G).command(Z).command(ae).command(ge).command($).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Oe as default};
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{C as e,D as t,S as n,T as r,_ as i,i as a,n as o}from"./auth-ffdf9yR0.mjs";import{n as s,t as c}from"./body-parser-DKa8Ipg1.mjs";import{t as l}from"./output-BJFNwj7b.mjs";import{n as u,t as d}from"./progress-CrCGTq7N.mjs";import{n as f,t as p}from"./input-validation-zEO81MWN.mjs";import{t as m}from"./local-VJaJ3BZ1.mjs";import{t as h}from"./cli-types-CRIDdDw3.mjs";function ee(e){return e.option(`allow-out-of-region-access`,{type:`boolean`,description:`Allow out of region access`}).option(`regions`,{type:`string`,description:`Name of the region.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Updates CMB config.`,builder:ee,handler:async t=>{if(t.dryRun){u({command:`cf logs control cmb config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`json`,body:t.body===void 0?c({allow_out_of_region_access:t[`allow-out-of-region-access`],regions:f(t.regions,`regions`,`text`)}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.logs.control.cmb.config.create({body:e,account_id:r})),{successLabel:`Created`});return}let a=c({allow_out_of_region_access:t[`allow-out-of-region-access`],regions:f(t.regions,`regions`,`text`)});l(await d(`Creating`,async()=>n.logs.control.cmb.config.create({body:a,account_id:r})),{successLabel:`Created`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete`,describe:`Deletes CMB config.`,builder:_,handler:async t=>{if(t.dryRun){u({command:`cf logs control cmb config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let n=await o(t),a=t.local?m:await i(n);if(t.accountId=a,!await r({force:!!t.force})){process.stderr.write(`Aborted.
3
- `);return}l(await d(`Deleting`,async()=>n.logs.control.cmb.config.delete({account_id:a})),{successLabel:`Deleted`})}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Gets CMB config.`,builder:y,handler:async t=>{if(t.dryRun){u({command:`cf logs control cmb config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.logs.control.cmb.config.get({account_id:r})),{successLabel:`Loaded`})}},x={command:`config`,describe:`Log control operations`,builder:e=>e.command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},S={command:`cmb`,describe:`Operations for control.cmb`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`flag`,{type:`boolean`,description:`The log retention flag for Logpull API.`}).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:`Updates log retention flag for Logpull API.`,builder:C,handler:async e=>{if(e.dryRun){u({command:`cf logs control retention create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({flag:e.flag}):s(e.body)});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);l(await d(`Creating`,async()=>t.logs.control.retention.create({body:n,zone_id:r})),{successLabel:`Created`});return}let i=c({flag:e.flag});l(await d(`Creating`,async()=>t.logs.control.retention.create({body:i,zone_id:r})),{successLabel:`Created`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Gets log retention flag for Logpull API.`,builder:T,handler:async e=>{if(e.dryRun){u({command:`cf logs control retention get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.logs.control.retention.get({zone_id:r})),{successLabel:`Loaded`})}},D={command:`retention`,describe:`Log control operations`,builder:e=>e.command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`control`,describe:`Operations for control`,builder:e=>e.command(S).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`start`,{type:`string`,description:`Start time in RFC3339 format.`,demandOption:!0}).option(`end`,{type:`string`,description:`End time in RFC3339 format.`,demandOption:!0}).option(`bucket`,{type:`string`,description:`R2 bucket name.`,demandOption:!0}).option(`prefix`,{type:`string`,description:`R2 bucket prefix logs are stored under.`}).option(`limit`,{type:`number`,description:`Maximum number of results to return.`}).option(`r2-access-key-id`,{type:`string`,description:`The R2-Access-Key-Id header`,demandOption:!0}).option(`r2-secret-access-key`,{type:`string`,description:`The R2-Secret-Access-Key header`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get`,describe:`Lists R2 objects containing logs matching the provided query parameters.`,builder:k,handler:async t=>{let n={start:t.start,end:t.end,bucket:t.bucket,prefix:t.prefix,limit:t.limit},r={};if(t[`r2-access-key-id`]!==void 0&&(r[`R2-Access-Key-Id`]=String(t[`r2-access-key-id`])),t[`r2-secret-access-key`]!==void 0&&(r[`R2-Secret-Access-Key`]=String(t[`r2-secret-access-key`])),t.dryRun){u({command:`cf logs list get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/list`,pathParams:{},query:n,bodyKind:`none`});return}let s=await o(t),c=t.local?m:await i(s);t.accountId=c,l(await d(`Loading`,async()=>a(s,`GET`,`/accounts/${c}/logs/list`,{query:n,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Loaded`})}},j={command:`list`,describe:`Operations for list`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Returns all dataset types that this account can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account. When creating or updating a dataset, only fields available to your account can be enabled. If you request a field that is not available, you will receive an error.`,builder:M,handler:async t=>{if(t.dryRun){u({command:`cf logs log-explorer datasets accounts available list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/explorer/datasets/available`,pathParams:{},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.logs.logExplorer.datasets.accounts.available.list({account_id:r})),{successLabel:`Loaded`})}},P={command:`available`,describe:`Operations for log-explorer.datasets.accounts.available`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`create`,describe:"Create a new Log Explorer dataset for the account. Use the `/accounts/{account_id}/logs/explorer/datasets/available` endpoint to list dataset types you can create along with their available fields. The `fields` property is optional. If not specified, all available fields will be enabled. For zone-level datasets use the zone-scoped endpoint: POST /zones/{zone_id}/logs/explorer/datasets For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/",builder:F,handler:async n=>{if(n.dryRun){u({command:`cf logs log-explorer datasets accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/explorer/datasets`,pathParams:{},bodyKind:`json`,body:n.body===void 0?c({dataset:f(n.dataset,`dataset`,`text`)}):s(n.body)});return}let r=await o(n),a=n.local?m:await i(r);if(n.accountId=a,n.body){let e=s(n.body);l(await d(`Creating`,async()=>r.logs.logExplorer.datasets.accounts.create({body:e,account_id:a})),{successLabel:`Created`});return}n.dataset===void 0&&(n.dataset=await t(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let p=c({dataset:f(n.dataset,`dataset`,`text`)});l(await d(`Creating`,async()=>r.logs.logExplorer.datasets.accounts.create({body:p,account_id:a})),{successLabel:`Created`})}};function L(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <dataset-id>`,describe:`Retrieve a single Log Explorer dataset by ID for the account.`,builder:L,handler:async t=>{if(t.dryRun){u({command:`cf logs log-explorer datasets accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/explorer/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}`,pathParams:{"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`none`});return}let n=await o(t),r=t.local?m:await i(n);t.accountId=r,l(await d(`Loading`,async()=>n.logs.logExplorer.datasets.accounts.get({account_id:r,dataset_id:t[`dataset-id`]})),{successLabel:`Loaded`})}};function z(e){return e.option(`include-zones`,{type:`boolean`,description:`Set to true to include zone-scoped datasets belonging to this account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:"Returns all Log Explorer datasets configured for the account. Pass `include_zones=true` to also include zone-level datasets that belong to this account. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration.",builder:z,handler:async t=>{let n={include_zones:t[`include-zones`]};if(t.dryRun){u({command:`cf logs log-explorer datasets accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/explorer/datasets`,pathParams:{},query:n,bodyKind:`none`});return}let r=await o(t),a=t.local?m:await i(r);t.accountId=a,l(await d(`Loading`,async()=>r.logs.logExplorer.datasets.accounts.list({account_id:a,...n})),{successLabel:`Loaded`})}};function V(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable or disable log ingest for this dataset.`}).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 <dataset-id>`,describe:`Updates the enabled state and/or field configuration of an account dataset.`,builder:V,handler:async t=>{if(t.dryRun){u({command:`cf logs log-explorer datasets accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/explorer/datasets/${t[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(t[`dataset-id`]))}`,pathParams:{"dataset-id":String(t[`dataset-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({enabled:t.enabled}):s(t.body)});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.body){let e=s(t.body);l(await d(`Updating`,async()=>n.logs.logExplorer.datasets.accounts.update({body:e,account_id:r,dataset_id:t[`dataset-id`]})),{successLabel:`Updated`});return}if(t.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let a=c({enabled:t.enabled});l(await d(`Updating`,async()=>n.logs.logExplorer.datasets.accounts.update({body:a,account_id:r,dataset_id:t[`dataset-id`]})),{successLabel:`Updated`})}},U={command:`accounts`,describe:`Operations for log-explorer.datasets.accounts`,builder:e=>e.command(I).command(R).command(B).command(H).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`Returns all dataset types that this zone can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account. When creating or updating a dataset, only fields available to your account can be enabled. If you request a field that is not available, you will receive an error.`,builder:te,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets zones available list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/datasets/available`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.logs.logExplorer.datasets.zones.available.list({zone_id:r})),{successLabel:`Loaded`})}},G={command:`available`,describe:`Operations for log-explorer.datasets.zones.available`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).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 q={command:`create`,describe:"Create a new Log Explorer dataset for the zone. Use the `/zones/{zone_id}/logs/explorer/datasets/available` endpoint to list dataset types you can create along with their available fields. The `fields` property is optional. If not specified, all available fields will be enabled. For account-level datasets use the account-scoped endpoint: POST /accounts/{account_id}/logs/explorer/datasets For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/",builder:K,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/datasets`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({dataset:f(e.dataset,`dataset`,`text`)}):s(e.body)});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});if(e.zoneId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>r.logs.logExplorer.datasets.zones.create({body:t,zone_id:i})),{successLabel:`Created`});return}e.dataset===void 0&&(e.dataset=await t(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let a=c({dataset:f(e.dataset,`dataset`,`text`)});l(await d(`Creating`,async()=>r.logs.logExplorer.datasets.zones.create({body:a,zone_id:i})),{successLabel:`Created`})}};function J(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get <dataset-id>`,describe:`Retrieve a single Log Explorer dataset by ID for the zone.`,builder:J,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets zones get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.logs.logExplorer.datasets.zones.get({zone_id:r,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:"Returns all Log Explorer datasets configured for the zone. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration.",builder:X,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/datasets`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.logs.logExplorer.datasets.zones.list({zone_id:r})),{successLabel:`Loaded`})}};function Q(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable or disable log ingest for this dataset.`}).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 ne={command:`update <dataset-id>`,describe:`Updates the enabled state and/or field configuration of a zone dataset.`,builder:Q,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets zones update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled}):s(e.body)});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.body){let n=s(e.body);l(await d(`Updating`,async()=>t.logs.logExplorer.datasets.zones.update({body:n,zone_id:r,dataset_id:e[`dataset-id`]})),{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let i=c({enabled:e.enabled});l(await d(`Updating`,async()=>t.logs.logExplorer.datasets.zones.update({body:i,zone_id:r,dataset_id:e[`dataset-id`]})),{successLabel:`Updated`})}},re={command:`zones`,describe:`Operations for log-explorer.datasets.zones`,builder:e=>e.command(q).command(Y).command(Z).command(ne).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ie={command:`datasets`,describe:`Operations for log-explorer.datasets`,builder:e=>e.command(U).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const oe={command:`sql`,describe:`Run a SQL query against account-level datasets. Timestamp fields are RFC3339 strings. Filter with: WHERE {timestamp_field} >= now() - INTERVAL '30' DAY WHERE {timestamp_field} >= '2026-04-01T00:00:00Z' WHERE {timestamp_field} BETWEEN '2026-04-01T00:00:00Z' AND '2026-04-30T23:59:59Z' Check /accounts/{account_id}/logs/explorer/datasets to see enabled account level datasets. Zone-level datasets will not appear here. Check /accounts/{account_id}/logs/explorer/datasets/available for the schemas, and the name of the timestamp fields. For zone-level datasets use the zone-scoped endpoint: POST /zones/{zone_id}/logs/explorer/query/sql For more information about the datasets, and the meaning of each field, check out https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/`,builder:ae,handler:async t=>{if(t.dryRun){u({command:`cf logs log-explorer query accounts sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/explorer/query/sql`,pathParams:{},bodyKind:`octet-stream`,body:t.body});return}let n=await o(t),r=t.local?m:await i(n);if(t.accountId=r,t.file){let e=p(t.file);l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}if(t.body){let e=f(t.body,`body`,`binary`);l(await d(`Creating`,async()=>a(n,`POST`,`/accounts/${r}/logs/explorer/query/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>n.logs.logExplorer.query.accounts.sql({account_id:r})),{successLabel:`Created`})}},se={command:`accounts`,describe:`Operations for log-explorer.query.accounts`,builder:e=>e.command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const le={command:`sql`,describe:`Run a SQL query against zone-level datasets. Timestamp fields are RFC3339 strings. Filter with: WHERE {timestamp_field} >= now() - INTERVAL '30' DAY WHERE {timestamp_field} >= '2026-04-01T00:00:00Z' WHERE {timestamp_field} BETWEEN '2026-04-01T00:00:00Z' AND '2026-04-30T23:59:59Z' Check /zones/{zone_id}/logs/explorer/datasets to see enabled zone level datasets. Check /zones/{zone_id}/logs/explorer/datasets/available for the schemas and the name of the timestamp fields. For account-level datasets use the account-scoped endpoint: POST /accounts/{account_id}/logs/explorer/query/sql For more information about the datasets, and the meaning of each field, check out https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/`,builder:ce,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer query zones sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/query/sql`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`octet-stream`,body:e.body});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=r,e.file){let n=p(e.file);l(await d(`Creating`,async()=>a(t,`POST`,`/zones/${e.zoneId}/logs/explorer/query/sql`,{body:n,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}if(e.body){let n=f(e.body,`body`,`binary`);l(await d(`Creating`,async()=>a(t,`POST`,`/zones/${e.zoneId}/logs/explorer/query/sql`,{body:n,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>t.logs.logExplorer.query.zones.sql({zone_id:r})),{successLabel:`Created`})}},ue={command:`zones`,describe:`Operations for log-explorer.query.zones`,builder:e=>e.command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`query`,describe:`Operations for log-explorer.query`,builder:e=>e.command(se).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fe={command:`log-explorer`,describe:`Operations for log-explorer`,builder:e=>e.command(ie).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.positional(`ray-id`,{type:`string`,description:`Ray identifier.`,demandOption:!0}).option(`fields`,{type:`string`,description:"The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified."}).option(`timestamps`,{type:`string`,description:"By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings.",choices:[`unix`,`unixnano`,`rfc3339`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get <ray-id>`,describe:"The `/rayids` api route allows lookups by specific rayid. The rayids route will return zero, one, or more records (ray ids are not unique).",builder:h(pe),handler:async e=>{let t={fields:e.fields,timestamps:e.timestamps};if(e.dryRun){u({command:`cf logs rayid get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/rayids/${e[`ray-id`]==null?`<ray-id>`:encodeURIComponent(String(e[`ray-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"ray-id":String(e[`ray-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.logs.rayid.get({zone_id:i,ray_id:e[`ray-id`],...t})),{successLabel:`Loaded`})}},me={command:`rayid`,describe:`Operations for rayid`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function he(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`get`,describe:`Lists all fields available. The response is json object with key-value pairs, where keys are field names, and values are descriptions.`,builder:he,handler:async e=>{if(e.dryRun){u({command:`cf logs received fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/received/fields`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),r=await n({zone:e.zone},t,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>t.logs.received.fields.get({zone_id:r})),{successLabel:`Loaded`})}},_e={command:`fields`,describe:`Received log operations`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.option(`start`,{type:`string`,description:`Sets the (inclusive) beginning of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. At this point in time, it cannot exceed a time in the past greater than seven days.`}).option(`end`,{type:`string`,description:"Sets the (exclusive) end of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. `end` must be at least five minutes earlier than now and must be later than `start`. Difference between `start` and `end` must be not greater than one hour.",demandOption:!0}).option(`fields`,{type:`string`,description:"The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified."}).option(`sample`,{type:`number`,description:"When `?sample=` is provided, a sample of matching records is returned. If `sample=0.1` then 10% of records will be returned. Sampling is random: repeated calls will not only return different records, but likely will also vary slightly in number of returned records. When `?count=` is also specified, `count` is applied to the number of returned records, not the sampled records. So, with `sample=0.05` and `count=7`, when there is a total of 100 records available, approximately five will be returned. When there are 1000 records, seven will be returned. When there are 10,000 records, seven will be returned."}).option(`count`,{type:`number`,description:"When `?count=` is provided, the response will contain up to `count` results. Since results are not sorted, you are likely to get different data for repeated requests. `count` must be an integer > 0."}).option(`timestamps`,{type:`string`,description:"By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings.",choices:[`unix`,`unixnano`,`rfc3339`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get`,describe:'The `/received` api route allows customers to retrieve their edge HTTP logs. The basic access pattern is "give me all the logs for zone Z for minute M", where the minute M refers to the time records were received at Cloudflare\'s central data center. `start` is inclusive, and `end` is exclusive. Because of that, to get all data, at minutely cadence, starting at 10AM, the proper values are: `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap will be handled properly.',builder:h(ve),handler:async e=>{let t={start:e.start,end:e.end,fields:e.fields,sample:e.sample,count:e.count,timestamps:e.timestamps};if(e.dryRun){u({command:`cf logs received get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/received`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let r=await o(e),i=await n({zone:e.zone},r,{quiet:e.quiet});e.zoneId=i,l(await d(`Loading`,async()=>r.logs.received.get({zone_id:i,...t})),{successLabel:`Loaded`})}},be={command:`received`,describe:`Received log operations`,builder:e=>e.command(ye).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`start`,{type:`string`,description:`Start time in RFC3339 format.`,demandOption:!0}).option(`end`,{type:`string`,description:`End time in RFC3339 format.`,demandOption:!0}).option(`bucket`,{type:`string`,description:`R2 bucket name.`,demandOption:!0}).option(`prefix`,{type:`string`,description:`R2 bucket prefix logs are stored under.`}).option(`r2-access-key-id`,{type:`string`,description:`The R2-Access-Key-Id header`,demandOption:!0}).option(`r2-secret-access-key`,{type:`string`,description:`The R2-Secret-Access-Key header`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get`,describe:`Returns logs stored in R2 that match the provided query parameters.`,builder:xe,handler:async t=>{let n={start:t.start,end:t.end,bucket:t.bucket,prefix:t.prefix},r={};if(t[`r2-access-key-id`]!==void 0&&(r[`R2-Access-Key-Id`]=String(t[`r2-access-key-id`])),t[`r2-secret-access-key`]!==void 0&&(r[`R2-Secret-Access-Key`]=String(t[`r2-secret-access-key`])),t.dryRun){u({command:`cf logs retrieve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${e()??`<account-id>`}/logs/retrieve`,pathParams:{},query:n,bodyKind:`none`});return}let s=await o(t),c=t.local?m:await i(s);t.accountId=c,l(await d(`Loading`,async()=>a(s,`GET`,`/accounts/${c}/logs/retrieve`,{query:n,headers:Object.keys(r).length>0?r:void 0})),{successLabel:`Loaded`})}},Ce={command:`retrieve`,describe:`Operations for retrieve`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},we={command:`logs`,describe:`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,builder:e=>e.command(O).command(j).command(fe).command(me).command(be).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{we as default};
2
+ import{E as e,S as t,g as n,w as r,x as i}from"./oauth-Bk-F-tIO.mjs";import{i as a,n as o}from"./auth-CSC4yhEJ.mjs";import{n as s,t as c}from"./body-parser-DWSy7uZ8.mjs";import{t as l}from"./output-B6fBFRqe.mjs";import{n as u,t as d}from"./progress-DrDErV9w.mjs";import{n as f,t as p}from"./input-validation-_fMCApaH.mjs";import{t as m}from"./local-CYc9q7l2.mjs";import{t as h}from"./cli-types-BeyOc81z.mjs";function ee(e){return e.option(`allow-out-of-region-access`,{type:`boolean`,description:`Allow out of region access`}).option(`regions`,{type:`string`,description:`Name of the region.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`create`,describe:`Updates CMB config.`,builder:ee,handler:async e=>{if(e.dryRun){u({command:`cf logs control cmb config create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`json`,body:e.body===void 0?c({allow_out_of_region_access:e[`allow-out-of-region-access`],regions:f(e.regions,`regions`,`text`)}):s(e.body)});return}let r=await o(e),i=e.local?m:await n(r);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Creating`,async()=>r.logs.control.cmb.config.create({body:t,account_id:i})),{successLabel:`Created`});return}let a=c({allow_out_of_region_access:e[`allow-out-of-region-access`],regions:f(e.regions,`regions`,`text`)});l(await d(`Creating`,async()=>r.logs.control.cmb.config.create({body:a,account_id:i})),{successLabel:`Created`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete`,describe:`Deletes CMB config.`,builder:_,handler:async e=>{if(e.dryRun){u({command:`cf logs control cmb config delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let i=await o(e),a=e.local?m:await n(i);if(e.accountId=a,!await r({force:!!e.force})){process.stderr.write(`Aborted.
3
+ `);return}l(await d(`Deleting`,async()=>i.logs.control.cmb.config.delete({account_id:a})),{successLabel:`Deleted`})}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Gets CMB config.`,builder:y,handler:async e=>{if(e.dryRun){u({command:`cf logs control cmb config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/control/cmb/config`,pathParams:{},bodyKind:`none`});return}let r=await o(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.logs.control.cmb.config.get({account_id:i})),{successLabel:`Loaded`})}},x={command:`config`,describe:`Log control operations`,builder:e=>e.command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},S={command:`cmb`,describe:`Operations for control.cmb`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function C(e){return e.option(`flag`,{type:`boolean`,description:`The log retention flag for Logpull API.`}).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:`Updates log retention flag for Logpull API.`,builder:C,handler:async e=>{if(e.dryRun){u({command:`cf logs control retention create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({flag:e.flag}):s(e.body)});return}let t=await o(e),n=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Creating`,async()=>t.logs.control.retention.create({body:r,zone_id:n})),{successLabel:`Created`});return}let r=c({flag:e.flag});l(await d(`Creating`,async()=>t.logs.control.retention.create({body:r,zone_id:n})),{successLabel:`Created`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Gets log retention flag for Logpull API.`,builder:T,handler:async e=>{if(e.dryRun){u({command:`cf logs control retention get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/control/retention/flag`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.logs.control.retention.get({zone_id:n})),{successLabel:`Loaded`})}},D={command:`retention`,describe:`Log control operations`,builder:e=>e.command(w).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`control`,describe:`Operations for control`,builder:e=>e.command(S).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`start`,{type:`string`,description:`Start time in RFC3339 format.`,demandOption:!0}).option(`end`,{type:`string`,description:`End time in RFC3339 format.`,demandOption:!0}).option(`bucket`,{type:`string`,description:`R2 bucket name.`,demandOption:!0}).option(`prefix`,{type:`string`,description:`R2 bucket prefix logs are stored under.`}).option(`limit`,{type:`number`,description:`Maximum number of results to return.`}).option(`r2-access-key-id`,{type:`string`,description:`The R2-Access-Key-Id header`,demandOption:!0}).option(`r2-secret-access-key`,{type:`string`,description:`The R2-Secret-Access-Key header`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get`,describe:`Lists R2 objects containing logs matching the provided query parameters.`,builder:k,handler:async e=>{let r={start:e.start,end:e.end,bucket:e.bucket,prefix:e.prefix,limit:e.limit},i={};if(e[`r2-access-key-id`]!==void 0&&(i[`R2-Access-Key-Id`]=String(e[`r2-access-key-id`])),e[`r2-secret-access-key`]!==void 0&&(i[`R2-Secret-Access-Key`]=String(e[`r2-secret-access-key`])),e.dryRun){u({command:`cf logs list get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/list`,pathParams:{},query:r,bodyKind:`none`});return}let s=await o(e),c=e.local?m:await n(s);e.accountId=c,l(await d(`Loading`,async()=>a(s,`GET`,`/accounts/${c}/logs/list`,{query:r,headers:Object.keys(i).length>0?i:void 0})),{successLabel:`Loaded`})}},j={command:`list`,describe:`Operations for list`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`Returns all dataset types that this account can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account. When creating or updating a dataset, only fields available to your account can be enabled. If you request a field that is not available, you will receive an error.`,builder:M,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets accounts available list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/explorer/datasets/available`,pathParams:{},bodyKind:`none`});return}let r=await o(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.logs.logExplorer.datasets.accounts.available.list({account_id:i})),{successLabel:`Loaded`})}},P={command:`available`,describe:`Operations for log-explorer.datasets.accounts.available`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function F(e){return e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const I={command:`create`,describe:"Create a new Log Explorer dataset for the account. Use the `/accounts/{account_id}/logs/explorer/datasets/available` endpoint to list dataset types you can create along with their available fields. The `fields` property is optional. If not specified, all available fields will be enabled. For zone-level datasets use the zone-scoped endpoint: POST /zones/{zone_id}/logs/explorer/datasets For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/",builder:F,handler:async r=>{if(r.dryRun){u({command:`cf logs log-explorer datasets accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/explorer/datasets`,pathParams:{},bodyKind:`json`,body:r.body===void 0?c({dataset:f(r.dataset,`dataset`,`text`)}):s(r.body)});return}let i=await o(r),a=r.local?m:await n(i);if(r.accountId=a,r.body){let e=s(r.body);l(await d(`Creating`,async()=>i.logs.logExplorer.datasets.accounts.create({body:e,account_id:a})),{successLabel:`Created`});return}r.dataset===void 0&&(r.dataset=await e(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let p=c({dataset:f(r.dataset,`dataset`,`text`)});l(await d(`Creating`,async()=>i.logs.logExplorer.datasets.accounts.create({body:p,account_id:a})),{successLabel:`Created`})}};function L(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`get <dataset-id>`,describe:`Retrieve a single Log Explorer dataset by ID for the account.`,builder:L,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/explorer/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let r=await o(e),i=e.local?m:await n(r);e.accountId=i,l(await d(`Loading`,async()=>r.logs.logExplorer.datasets.accounts.get({account_id:i,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}};function z(e){return e.option(`include-zones`,{type:`boolean`,description:`Set to true to include zone-scoped datasets belonging to this account.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`list`,describe:"Returns all Log Explorer datasets configured for the account. Pass `include_zones=true` to also include zone-level datasets that belong to this account. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration.",builder:z,handler:async e=>{let r={include_zones:e[`include-zones`]};if(e.dryRun){u({command:`cf logs log-explorer datasets accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/explorer/datasets`,pathParams:{},query:r,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await n(i);e.accountId=a,l(await d(`Loading`,async()=>i.logs.logExplorer.datasets.accounts.list({account_id:a,...r})),{successLabel:`Loaded`})}};function V(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable or disable log ingest for this dataset.`}).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 <dataset-id>`,describe:`Updates the enabled state and/or field configuration of an account dataset.`,builder:V,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/explorer/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled}):s(e.body)});return}let r=await o(e),i=e.local?m:await n(r);if(e.accountId=i,e.body){let t=s(e.body);l(await d(`Updating`,async()=>r.logs.logExplorer.datasets.accounts.update({body:t,account_id:i,dataset_id:e[`dataset-id`]})),{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let a=c({enabled:e.enabled});l(await d(`Updating`,async()=>r.logs.logExplorer.datasets.accounts.update({body:a,account_id:i,dataset_id:e[`dataset-id`]})),{successLabel:`Updated`})}},U={command:`accounts`,describe:`Operations for log-explorer.datasets.accounts`,builder:e=>e.command(I).command(R).command(B).command(H).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`Returns all dataset types that this zone can create. Each entry includes the dataset schema and timestamp field. The schema shows all possible fields for a dataset. However, not all fields may be available for your account. When creating or updating a dataset, only fields available to your account can be enabled. If you request a field that is not available, you will receive an error.`,builder:te,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets zones available list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/datasets/available`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.logs.logExplorer.datasets.zones.available.list({zone_id:n})),{successLabel:`Loaded`})}},G={command:`available`,describe:`Operations for log-explorer.datasets.zones.available`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`dataset`,{type:`string`,description:"Dataset type name to create (e.g. `http_requests`)."}).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 q={command:`create`,describe:"Create a new Log Explorer dataset for the zone. Use the `/zones/{zone_id}/logs/explorer/datasets/available` endpoint to list dataset types you can create along with their available fields. The `fields` property is optional. If not specified, all available fields will be enabled. For account-level datasets use the account-scoped endpoint: POST /accounts/{account_id}/logs/explorer/datasets For dataset field definitions, see: https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/",builder:K,handler:async t=>{if(t.dryRun){u({command:`cf logs log-explorer datasets zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/logs/explorer/datasets`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?c({dataset:f(t.dataset,`dataset`,`text`)}):s(t.body)});return}let n=await o(t),r=await i({zone:t.zone},n,{quiet:t.quiet});if(t.zoneId=r,t.body){let e=s(t.body);l(await d(`Creating`,async()=>n.logs.logExplorer.datasets.zones.create({body:e,zone_id:r})),{successLabel:`Created`});return}t.dataset===void 0&&(t.dataset=await e(`dataset`,"Dataset type name to create (e.g. `http_requests`)."));let a=c({dataset:f(t.dataset,`dataset`,`text`)});l(await d(`Creating`,async()=>n.logs.logExplorer.datasets.zones.create({body:a,zone_id:r})),{successLabel:`Created`})}};function J(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`get <dataset-id>`,describe:`Retrieve a single Log Explorer dataset by ID for the zone.`,builder:J,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets zones get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.logs.logExplorer.datasets.zones.get({zone_id:n,dataset_id:e[`dataset-id`]})),{successLabel:`Loaded`})}};function X(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`list`,describe:"Returns all Log Explorer datasets configured for the zone. List responses omit the `fields` property; use the single-dataset endpoint to retrieve field configuration.",builder:X,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/datasets`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.logs.logExplorer.datasets.zones.list({zone_id:n})),{successLabel:`Loaded`})}};function Q(e){return e.positional(`dataset-id`,{type:`string`,description:`Log Explorer dataset ID.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether to enable or disable log ingest for this dataset.`}).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 ne={command:`update <dataset-id>`,describe:`Updates the enabled state and/or field configuration of a zone dataset.`,builder:Q,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer datasets zones update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/datasets/${e[`dataset-id`]==null?`<dataset-id>`:encodeURIComponent(String(e[`dataset-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"dataset-id":String(e[`dataset-id`]??``)},bodyKind:`json`,body:e.body===void 0?c({enabled:e.enabled}):s(e.body)});return}let t=await o(e),n=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=s(e.body);l(await d(`Updating`,async()=>t.logs.logExplorer.datasets.zones.update({body:r,zone_id:n,dataset_id:e[`dataset-id`]})),{successLabel:`Updated`});return}if(e.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let r=c({enabled:e.enabled});l(await d(`Updating`,async()=>t.logs.logExplorer.datasets.zones.update({body:r,zone_id:n,dataset_id:e[`dataset-id`]})),{successLabel:`Updated`})}},re={command:`zones`,describe:`Operations for log-explorer.datasets.zones`,builder:e=>e.command(q).command(Y).command(Z).command(ne).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ie={command:`datasets`,describe:`Operations for log-explorer.datasets`,builder:e=>e.command(U).command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const oe={command:`sql`,describe:`Run a SQL query against account-level datasets. Timestamp fields are RFC3339 strings. Filter with: WHERE {timestamp_field} >= now() - INTERVAL '30' DAY WHERE {timestamp_field} >= '2026-04-01T00:00:00Z' WHERE {timestamp_field} BETWEEN '2026-04-01T00:00:00Z' AND '2026-04-30T23:59:59Z' Check /accounts/{account_id}/logs/explorer/datasets to see enabled account level datasets. Zone-level datasets will not appear here. Check /accounts/{account_id}/logs/explorer/datasets/available for the schemas, and the name of the timestamp fields. For zone-level datasets use the zone-scoped endpoint: POST /zones/{zone_id}/logs/explorer/query/sql For more information about the datasets, and the meaning of each field, check out https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/`,builder:ae,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer query accounts sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/explorer/query/sql`,pathParams:{},bodyKind:`octet-stream`,body:e.body});return}let r=await o(e),i=e.local?m:await n(r);if(e.accountId=i,e.file){let t=p(e.file);l(await d(`Creating`,async()=>a(r,`POST`,`/accounts/${i}/logs/explorer/query/sql`,{body:t,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}if(e.body){let t=f(e.body,`body`,`binary`);l(await d(`Creating`,async()=>a(r,`POST`,`/accounts/${i}/logs/explorer/query/sql`,{body:t,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>r.logs.logExplorer.query.accounts.sql({account_id:i})),{successLabel:`Created`})}},se={command:`accounts`,describe:`Operations for log-explorer.query.accounts`,builder:e=>e.command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const le={command:`sql`,describe:`Run a SQL query against zone-level datasets. Timestamp fields are RFC3339 strings. Filter with: WHERE {timestamp_field} >= now() - INTERVAL '30' DAY WHERE {timestamp_field} >= '2026-04-01T00:00:00Z' WHERE {timestamp_field} BETWEEN '2026-04-01T00:00:00Z' AND '2026-04-30T23:59:59Z' Check /zones/{zone_id}/logs/explorer/datasets to see enabled zone level datasets. Check /zones/{zone_id}/logs/explorer/datasets/available for the schemas and the name of the timestamp fields. For account-level datasets use the account-scoped endpoint: POST /accounts/{account_id}/logs/explorer/query/sql For more information about the datasets, and the meaning of each field, check out https://developers.cloudflare.com/logs/logpush/logpush-job/datasets/`,builder:ce,handler:async e=>{if(e.dryRun){u({command:`cf logs log-explorer query zones sql`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/explorer/query/sql`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`octet-stream`,body:e.body});return}let t=await o(e),n=await i({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.file){let n=p(e.file);l(await d(`Creating`,async()=>a(t,`POST`,`/zones/${e.zoneId}/logs/explorer/query/sql`,{body:n,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}if(e.body){let n=f(e.body,`body`,`binary`);l(await d(`Creating`,async()=>a(t,`POST`,`/zones/${e.zoneId}/logs/explorer/query/sql`,{body:n,headers:{"Content-Type":`text/plain`}})),{successLabel:`Created`});return}l(await d(`Creating`,async()=>t.logs.logExplorer.query.zones.sql({zone_id:n})),{successLabel:`Created`})}},ue={command:`zones`,describe:`Operations for log-explorer.query.zones`,builder:e=>e.command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`query`,describe:`Operations for log-explorer.query`,builder:e=>e.command(se).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},fe={command:`log-explorer`,describe:`Operations for log-explorer`,builder:e=>e.command(ie).command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.positional(`ray-id`,{type:`string`,description:`Ray identifier.`,demandOption:!0}).option(`fields`,{type:`string`,description:"The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified."}).option(`timestamps`,{type:`string`,description:"By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings.",choices:[`unix`,`unixnano`,`rfc3339`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`get <ray-id>`,describe:"The `/rayids` api route allows lookups by specific rayid. The rayids route will return zero, one, or more records (ray ids are not unique).",builder:h(pe),handler:async e=>{let t={fields:e.fields,timestamps:e.timestamps};if(e.dryRun){u({command:`cf logs rayid get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/rayids/${e[`ray-id`]==null?`<ray-id>`:encodeURIComponent(String(e[`ray-id`]))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),"ray-id":String(e[`ray-id`]??``)},query:t,bodyKind:`none`});return}let n=await o(e),r=await i({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>n.logs.rayid.get({zone_id:r,ray_id:e[`ray-id`],...t})),{successLabel:`Loaded`})}},me={command:`rayid`,describe:`Operations for rayid`,builder:e=>e.command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function he(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`get`,describe:`Lists all fields available. The response is json object with key-value pairs, where keys are field names, and values are descriptions.`,builder:he,handler:async e=>{if(e.dryRun){u({command:`cf logs received fields get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/received/fields`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await i({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,l(await d(`Loading`,async()=>t.logs.received.fields.get({zone_id:n})),{successLabel:`Loaded`})}},_e={command:`fields`,describe:`Received log operations`,builder:e=>e.command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ve(e){return e.option(`start`,{type:`string`,description:`Sets the (inclusive) beginning of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. At this point in time, it cannot exceed a time in the past greater than seven days.`}).option(`end`,{type:`string`,description:"Sets the (exclusive) end of the requested time frame. This can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp that conforms to RFC 3339. `end` must be at least five minutes earlier than now and must be later than `start`. Difference between `start` and `end` must be not greater than one hour.",demandOption:!0}).option(`fields`,{type:`string`,description:"The `/received` route by default returns a limited set of fields, and allows customers to override the default field set by specifying individual fields. The reasons for this are: 1. Most customers require only a small subset of fields, but that subset varies from customer to customer; 2. Flat schema is much easier to work with downstream (importing into BigTable etc); 3. Performance (time to process, file size). If `?fields=` is not specified, default field set is returned. This default field set may change at any time. When `?fields=` is provided, each record is returned with the specified fields. `fields` must be specified as a comma separated list without any whitespaces, and all fields must exist. The order in which fields are specified does not matter, and the order of fields in the response is not specified."}).option(`sample`,{type:`number`,description:"When `?sample=` is provided, a sample of matching records is returned. If `sample=0.1` then 10% of records will be returned. Sampling is random: repeated calls will not only return different records, but likely will also vary slightly in number of returned records. When `?count=` is also specified, `count` is applied to the number of returned records, not the sampled records. So, with `sample=0.05` and `count=7`, when there is a total of 100 records available, approximately five will be returned. When there are 1000 records, seven will be returned. When there are 10,000 records, seven will be returned."}).option(`count`,{type:`number`,description:"When `?count=` is provided, the response will contain up to `count` results. Since results are not sorted, you are likely to get different data for repeated requests. `count` must be an integer > 0."}).option(`timestamps`,{type:`string`,description:"By default, timestamps in responses are returned as Unix nanosecond integers. The `?timestamps=` argument can be set to change the format in which response timestamps are returned. Possible values are: `unix`, `unixnano`, `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; `rfc3339` returns timestamps as strings.",choices:[`unix`,`unixnano`,`rfc3339`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get`,describe:'The `/received` api route allows customers to retrieve their edge HTTP logs. The basic access pattern is "give me all the logs for zone Z for minute M", where the minute M refers to the time records were received at Cloudflare\'s central data center. `start` is inclusive, and `end` is exclusive. Because of that, to get all data, at minutely cadence, starting at 10AM, the proper values are: `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap will be handled properly.',builder:h(ve),handler:async e=>{let t={start:e.start,end:e.end,fields:e.fields,sample:e.sample,count:e.count,timestamps:e.timestamps};if(e.dryRun){u({command:`cf logs received get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/logs/received`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await o(e),r=await i({zone:e.zone},n,{quiet:e.quiet});e.zoneId=r,l(await d(`Loading`,async()=>n.logs.received.get({zone_id:r,...t})),{successLabel:`Loaded`})}},be={command:`received`,describe:`Received log operations`,builder:e=>e.command(ye).command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`start`,{type:`string`,description:`Start time in RFC3339 format.`,demandOption:!0}).option(`end`,{type:`string`,description:`End time in RFC3339 format.`,demandOption:!0}).option(`bucket`,{type:`string`,description:`R2 bucket name.`,demandOption:!0}).option(`prefix`,{type:`string`,description:`R2 bucket prefix logs are stored under.`}).option(`r2-access-key-id`,{type:`string`,description:`The R2-Access-Key-Id header`,demandOption:!0}).option(`r2-secret-access-key`,{type:`string`,description:`The R2-Secret-Access-Key header`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get`,describe:`Returns logs stored in R2 that match the provided query parameters.`,builder:xe,handler:async e=>{let r={start:e.start,end:e.end,bucket:e.bucket,prefix:e.prefix},i={};if(e[`r2-access-key-id`]!==void 0&&(i[`R2-Access-Key-Id`]=String(e[`r2-access-key-id`])),e[`r2-secret-access-key`]!==void 0&&(i[`R2-Secret-Access-Key`]=String(e[`r2-secret-access-key`])),e.dryRun){u({command:`cf logs retrieve get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/logs/retrieve`,pathParams:{},query:r,bodyKind:`none`});return}let s=await o(e),c=e.local?m:await n(s);e.accountId=c,l(await d(`Loading`,async()=>a(s,`GET`,`/accounts/${c}/logs/retrieve`,{query:r,headers:Object.keys(i).length>0?i:void 0})),{successLabel:`Loaded`})}},Ce={command:`retrieve`,describe:`Operations for retrieve`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},we={command:`logs`,describe:`Log control, retention, and raw log access — CMB config, ray ID lookups, and received fields`,builder:e=>e.command(O).command(j).command(fe).command(me).command(be).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{we as default};