cf 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +78 -41
- package/dist/_meta/commands.json +19888 -21071
- package/dist/_meta/schemas.json +14305 -15328
- package/dist/abuse-reports-BsF9JZPW.mjs +8 -0
- package/dist/account-D8mYiWxQ.mjs +2 -0
- package/dist/accounts-CJci1Oez.mjs +23 -0
- package/dist/acm-CmCd985Q.mjs +3 -0
- package/dist/addressing-R7p6TRBe.mjs +12 -0
- package/dist/{agent-context-DMPfi54f.mjs → agent-context-Bzl5PGW-.mjs} +1 -1
- package/dist/ai-BzJg0RIX.mjs +3 -0
- package/dist/ai-audit-B0vJNOZG.mjs +2 -0
- package/dist/ai-gateway-D3vJR3My.mjs +10 -0
- package/dist/ai-search-CNg7W7U4.mjs +7 -0
- package/dist/alerting-_sdM0B0S.mjs +6 -0
- package/dist/alerts-dpT6Qsdu.mjs +2 -0
- package/dist/{analytics-DSSRDZz8.mjs → analytics-BFBJhDrP.mjs} +1 -1
- package/dist/analytics_engine-CWhFvyeK.mjs +2 -0
- package/dist/api-gateway-D4AIEtUq.mjs +33 -0
- package/dist/argo-Bjk6nFfs.mjs +2 -0
- package/dist/artifacts-Ba4b3iOa.mjs +4 -0
- package/dist/{audit-logs-BuExU_nz.mjs → audit-logs-BE0T5All.mjs} +1 -1
- package/dist/{auth-CSC4yhEJ.mjs → auth-CZ0E51rF.mjs} +3 -3
- package/dist/auth-D_zyQbDR.mjs +5 -0
- package/dist/autorag-Cnpp8PAG.mjs +2 -0
- package/dist/billing-Dz6Zj8Eq.mjs +2 -0
- package/dist/bot-management-pFwIbFi-.mjs +5 -0
- package/dist/botnet-feed-BY9uGChY.mjs +3 -0
- package/dist/brand-protection-DkPAk2Cz.mjs +3 -0
- package/dist/brands-CGpk9nZB.mjs +2 -0
- package/dist/browser-extension-D9P6Yv8i.mjs +3 -0
- package/dist/browser-run-DhHtz4y3.mjs +4 -0
- package/dist/build-CWuStmDi.mjs +2 -0
- package/dist/cache-DVhkiIGK.mjs +5 -0
- package/dist/calls-95zjvIcO.mjs +4 -0
- package/dist/certificate-authorities-BowBqbVq.mjs +2 -0
- package/dist/cf-BLT7uKJF.mjs +18 -0
- package/dist/chunk-2SIGYDH3-qXx_zE6v.mjs +397 -0
- package/dist/clear-DXx8WBAN.mjs +2 -0
- package/dist/client-certificates-D6mE4vJu.mjs +3 -0
- package/dist/cloud-connector-DmwsjeFN.mjs +2 -0
- package/dist/cloudforce-one-CG3TT7IN.mjs +23 -0
- package/dist/{completions-DOeHPdCG.mjs → completions-DMc_PlIw.mjs} +2 -2
- package/dist/connectivity-DJkE3crz.mjs +3 -0
- package/dist/connector-interrupts-DTgQ7onV.mjs +2 -0
- package/dist/connector-telemetry-events-D0rTHDou.mjs +2 -0
- package/dist/connector-telemetry-snapshots--0QmD3z6.mjs +2 -0
- package/dist/connectors-zWaZTi2A.mjs +3 -0
- package/dist/content-scanning-CGvGf04y.mjs +4 -0
- package/dist/ct-alerting-ebSPSWNC.mjs +3 -0
- package/dist/custom-certificates-CWUrPYLP.mjs +5 -0
- package/dist/custom-csrs-CRtdrF9R.mjs +4 -0
- package/dist/custom-hostnames-CVQSksqq.mjs +5 -0
- package/dist/custom-nameservers-BRwbIdsX.mjs +3 -0
- package/dist/custom-pages-Ci8sTQX7.mjs +4 -0
- package/dist/d1-78Ym1P6D.mjs +4 -0
- package/dist/data-security-zmFoMwRU.mjs +6 -0
- package/dist/{dcv-delegation-Bgf86J-r.mjs → dcv-delegation-Dd4FZ2IG.mjs} +1 -1
- package/dist/{deploy-dVrgDUOp.mjs → deploy-CVvkZFjR.mjs} +1 -1
- package/dist/{dev-C01_Lby6.mjs → dev-DSslyDXx.mjs} +1 -1
- package/dist/diagnostics-B8Ev5m_o.mjs +3 -0
- package/dist/dispatch-namespaces-Dm5vGeEP.mjs +7 -0
- package/dist/dist-B7hsuvbF.mjs +57 -0
- package/dist/dist-BH-4NQOV.mjs +134 -0
- package/dist/dns-D7VAaCyO.mjs +29 -0
- package/dist/dns-firewall-ByLCsf0q.mjs +57 -0
- package/dist/domain-info-CRvKc2Lg.mjs +2 -0
- package/dist/durable-objects-BIpvyu9m.mjs +2 -0
- package/dist/email-auth-Cx--s8W4.mjs +2 -0
- package/dist/email-routing-CiDbivcN.mjs +10 -0
- package/dist/email-security-BYeAuSc6.mjs +12 -0
- package/dist/email-sending-Dg2rSmHH.mjs +4 -0
- package/dist/filters-DZ8YnQ90.mjs +4 -0
- package/dist/firewall-DEd1hs_I.mjs +11 -0
- package/dist/flagship-DVw7xGoP.mjs +4 -0
- package/dist/{fraud-C03MtdZb.mjs → fraud-BbGS3FZs.mjs} +2 -2
- package/dist/google-tag-gateway-CBnRGYQR.mjs +2 -0
- package/dist/healthchecks-Da9N3ix4.mjs +4 -0
- package/dist/hostnames-mimZu2tB.mjs +3 -0
- package/dist/hyperdrive-BNdvxOos.mjs +21 -0
- package/dist/iam-DGQ-OgRl.mjs +6 -0
- package/dist/images-CI6Iy9ho.mjs +7 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-BDB-aRtU.mjs +3 -0
- package/dist/internal-Czlp5Ekb.mjs +2 -0
- package/dist/{ips-nv9INuWZ.mjs → ips-B9UuPvsY.mjs} +1 -1
- package/dist/keyless-certificates-Ua9uJgPt.mjs +3 -0
- package/dist/kv-BHerx4dZ.mjs +5 -0
- package/dist/leaked-credential-checks-B8Vunj9h.mjs +3 -0
- package/dist/live-Ce7dZW7p.mjs +2 -0
- package/dist/load-balancers-DSjS5WKw.mjs +6 -0
- package/dist/logexplorer-DBIfTlRP.mjs +24 -0
- package/dist/logo-matches-C00iGpzW.mjs +2 -0
- package/dist/logos-CJLhx1go.mjs +3 -0
- package/dist/logpush-Cr1U-eK-.mjs +5 -0
- package/dist/logs-DMvtchc6.mjs +3 -0
- package/dist/magic-cloud-networking-FQfO8QWH.mjs +5 -0
- package/dist/magic-network-monitoring-CDd70fJQ.mjs +4 -0
- package/dist/magic-transit-DiKiPUax.mjs +110 -0
- package/dist/managed-transforms-fPVUTrAv.mjs +3 -0
- package/dist/matches-B0yHbQ2I.mjs +2 -0
- package/dist/moq-UgBawOXe.mjs +13 -0
- package/dist/mtls-certificates-xKUbC5EL.mjs +3 -0
- package/dist/network-interconnects-BJzOE2ny.mjs +41 -0
- package/dist/oauth-DBJ5GSFk.mjs +40 -0
- package/dist/observability-B-1y36QS.mjs +4 -0
- package/dist/organization-Dq3PClZ7.mjs +41 -0
- package/dist/organizations-AhsQkHyX.mjs +2 -0
- package/dist/origin-ca-certificates-CRgF0UyU.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BXTx7DPa.mjs +2 -0
- package/dist/origin-tls-client-auth-BDw5q-6G.mjs +4 -0
- package/dist/{page-rules-EZHJePmn.mjs → page-rules-DqYQ23eg.mjs} +5 -5
- package/dist/{page-shield-CXJioWPs.mjs → page-shield-DKdlZOLO.mjs} +5 -5
- package/dist/pages-BsXF11Kv.mjs +11 -0
- package/dist/pay-per-crawl-BGAwuAP3.mjs +2 -0
- package/dist/pipelines-D_QhSnGW.mjs +6 -0
- package/dist/progress-O88q63Bk.mjs +2 -0
- package/dist/prompt-DTAWiEm2.mjs +3 -0
- package/dist/queries-CAE95-OH.mjs +3 -0
- package/dist/queues-BBz35Mqd.mjs +6 -0
- package/dist/r2-Zp99S5xF.mjs +21 -0
- package/dist/r2-data-catalog-BeVLZwrE.mjs +16 -0
- package/dist/radar-Cij-XVQJ.mjs +2 -0
- package/dist/rate-limit-analytics-CGviSPnJ.mjs +2 -0
- package/dist/rate-limits-DSdToIWv.mjs +5 -0
- package/dist/raw-fetch-DgezeshQ.mjs +2 -0
- package/dist/ready-DMpJvyaz.mjs +2 -0
- package/dist/realtime-kit-9rJcapfM.mjs +18 -0
- package/dist/recent-submissions-LS5IM-bm.mjs +2 -0
- package/dist/refute-BGTpr5sy.mjs +2 -0
- package/dist/registrar-CXViZlah.mjs +83 -0
- package/dist/registrar-sandbox-CvQyjXLJ.mjs +83 -0
- package/dist/request-tracers-DATfBnE9.mjs +2 -0
- package/dist/{resolve-C3h-mwp7.mjs → resolve-Bs2sMRYS.mjs} +1 -1
- package/dist/resource-sharing-Cmhn6ghR.mjs +3 -0
- package/dist/resource-tagging-BTn05AOj.mjs +16 -0
- package/dist/rules-ens3OHme.mjs +4 -0
- package/dist/rulesets-bkreZRao.mjs +8 -0
- package/dist/rum-CpgXFcwl.mjs +4 -0
- package/dist/scan-logo-DUDIZJ2A.mjs +2 -0
- package/dist/scan-page-BqoQTk3R.mjs +2 -0
- package/dist/{schema-BR31o4P6.mjs → schema-DCF4yEp_.mjs} +1 -1
- package/dist/schema-validation-Ca6o94ts.mjs +24 -0
- package/dist/scim-C4oT8TMc.mjs +4 -0
- package/dist/sdk-pQ5kaGUX.mjs +3 -0
- package/dist/search-C4T5riPh.mjs +2 -0
- package/dist/secrets-store-CWEuiDNo.mjs +7 -0
- package/dist/security-center-BOvm7xy6.mjs +2 -0
- package/dist/security-txt-BCAUBctN.mjs +3 -0
- package/dist/session-B1ARgLG7.mjs +2 -0
- package/dist/share-DhmVspmL.mjs +5 -0
- package/dist/shared-Bod3-Exx.mjs +990 -0
- package/dist/signed-url-DA509wgp.mjs +2 -0
- package/dist/smart-shield-DZm4fn6z.mjs +3 -0
- package/dist/snippets-oQ0u26-z.mjs +4 -0
- package/dist/{spawn-CCGzKlC4.mjs → spawn-ChG5Xi9Z.mjs} +1 -1
- package/dist/{spectrum-pVGxb7u5.mjs → spectrum-Cnkee5Ww.mjs} +6 -6
- package/dist/speed-DqNnvLBD.mjs +4 -0
- package/dist/{src-DU7FBCOX.mjs → src-By-zTCHz.mjs} +9 -9
- package/dist/ssl-tS3CYZsZ.mjs +15 -0
- package/dist/state-OsdDJvdj.mjs +2 -0
- package/dist/stream-Bud9Os5V.mjs +14 -0
- package/dist/submission-info-DfIXmu-M.mjs +2 -0
- package/dist/submit-BtP8she2.mjs +2 -0
- package/dist/tenant-CMwHa-tU.mjs +2 -0
- package/dist/token-validation-BYC7HTok.mjs +10 -0
- package/dist/{tools-D_hfUU_Z.mjs → tools-Dru4l8yh.mjs} +1 -1
- package/dist/total-queries-DdLBNJzd.mjs +2 -0
- package/dist/tracked-domains-BbaY-IuY.mjs +2 -0
- package/dist/turnstile-CP4nScaL.mjs +23 -0
- package/dist/{ui-erjBdVKL.mjs → ui-BNoF0KpD.mjs} +2 -2
- package/dist/url-info-Chs9h7Y-.mjs +2 -0
- package/dist/url-normalization-XYxW5Gj0.mjs +3 -0
- package/dist/url-scanner-D4pYNlO-.mjs +2 -0
- package/dist/user-DtefniLc.mjs +11 -0
- package/dist/vectorize-BeAY2g-7.mjs +4 -0
- package/dist/verify-D7J3F_NZ.mjs +2 -0
- package/dist/{versions-CBHwWPAM.mjs → versions-dMW3bLVv.mjs} +1 -1
- package/dist/waiting-rooms-K78HeeTg.mjs +11 -0
- package/dist/web3-Dhw79l4S.mjs +4 -0
- package/dist/workers-builds-CuOAB3u4.mjs +7 -0
- package/dist/workers-l3zMNOU6.mjs +20 -0
- package/dist/workflows-rb7RYBKP.mjs +6 -0
- package/dist/zaraz-CHecMYuo.mjs +2 -0
- package/dist/zero-trust-DAZoa-Aj.mjs +117 -0
- package/dist/zone-BnnqJwW-.mjs +2 -0
- package/dist/zones-DpI2YikF.mjs +21 -0
- package/package.json +3 -1
- package/dist/abuse-reports-Ina5TlsU.mjs +0 -8
- package/dist/accounts-B_joQcMi.mjs +0 -22
- package/dist/acm-_kIHqYME.mjs +0 -3
- package/dist/addressing-CaFlw8y1.mjs +0 -12
- package/dist/ai-CqnhNb_c.mjs +0 -2
- package/dist/ai-gateway-pgYGI519.mjs +0 -8
- package/dist/ai-search-eqQMPQol.mjs +0 -7
- package/dist/ai_gateway--vuVLnOm.mjs +0 -4
- package/dist/alerting-CPxHiYHb.mjs +0 -6
- package/dist/analytics_engine-gWyfnsCs.mjs +0 -2
- package/dist/api-gateway-BXXGFCVR.mjs +0 -33
- package/dist/argo-aC6A3JyX.mjs +0 -2
- package/dist/artifacts-HD4V2xpK.mjs +0 -4
- package/dist/auth-D5hNsOFq.mjs +0 -5
- package/dist/billing-COaghyxl.mjs +0 -2
- package/dist/bot-management-DmEzeV1Y.mjs +0 -5
- package/dist/botnet-feed-ByEAXAkw.mjs +0 -3
- package/dist/brand-protection-dPrGe8sL.mjs +0 -3
- package/dist/browser-rendering-BiSGnpBf.mjs +0 -4
- package/dist/build-HuS9-R0V.mjs +0 -1054
- package/dist/cache-CY-7Lt71.mjs +0 -5
- package/dist/calls-wOQGDWPl.mjs +0 -4
- package/dist/certificate-authorities-CtqzAtxQ.mjs +0 -2
- package/dist/client-certificates-CRf41xLe.mjs +0 -3
- package/dist/cloud-connector-BA5IRZUP.mjs +0 -2
- package/dist/cloudforce-one-Bq_qPAWs.mjs +0 -21
- package/dist/config-B5k-XbwS.mjs +0 -2
- package/dist/connectivity-Bx3MgTHX.mjs +0 -3
- package/dist/connector-interrupts-D7ylweJZ.mjs +0 -2
- package/dist/connector-telemetry-events-6izV1kbP.mjs +0 -2
- package/dist/connector-telemetry-snapshots-BnjKbyxX.mjs +0 -2
- package/dist/connectors-DRt4e6d_.mjs +0 -3
- package/dist/content-scanning-Cd2vy5Sz.mjs +0 -4
- package/dist/context-jpewmual.mjs +0 -2
- package/dist/custom-certificates-DYE-9epx.mjs +0 -5
- package/dist/custom-hostnames-CtuTdFcX.mjs +0 -5
- package/dist/custom-nameservers-CWqA51in.mjs +0 -3
- package/dist/custom-pages-DeUKEFGe.mjs +0 -4
- package/dist/d1-DvWY9Gp4.mjs +0 -4
- package/dist/data-security-BPo6dIWu.mjs +0 -6
- package/dist/diagnostics-6nKPmVgz.mjs +0 -3
- package/dist/dispatch-namespaces-64lXx2WJ.mjs +0 -7
- package/dist/dist-C6zxsVdY.mjs +0 -306
- package/dist/dist-t_YrL25p.mjs +0 -82
- package/dist/dns-ClciFGxx.mjs +0 -29
- package/dist/dns-firewall-DfUmXDCe.mjs +0 -57
- package/dist/durable-objects-CMaYZ-YU.mjs +0 -2
- package/dist/email-routing-CGXhFqF5.mjs +0 -10
- package/dist/email-security-D5viPq8S.mjs +0 -8
- package/dist/email-sending-C2jpc3gh.mjs +0 -3
- package/dist/filters-bzsFcWt0.mjs +0 -4
- package/dist/firewall-DYZcTtIC.mjs +0 -11
- package/dist/google-tag-gateway-Dfy887yA.mjs +0 -2
- package/dist/healthchecks-DRoAlWgr.mjs +0 -4
- package/dist/hostnames-CFgIVI3s.mjs +0 -3
- package/dist/hyperdrive-C7-gwTSV.mjs +0 -18
- package/dist/iam-DqVPzGrb.mjs +0 -6
- package/dist/images-BYfl4YgR.mjs +0 -7
- package/dist/intel-duTEPIHc.mjs +0 -3
- package/dist/keyless-certificates-CRCDVd3g.mjs +0 -3
- package/dist/kv-CZoV4tiv.mjs +0 -5
- package/dist/leaked-credential-checks-DNIBg7Pe.mjs +0 -3
- package/dist/load-balancers--OMg0HNt.mjs +0 -6
- package/dist/logpush-C0_lZTyY.mjs +0 -4
- package/dist/logs-BtpWZQfV.mjs +0 -3
- package/dist/magic-cloud-networking-u6rwYbGg.mjs +0 -5
- package/dist/magic-network-monitoring-CKgQyRj4.mjs +0 -4
- package/dist/magic-transit-CLhMcJ_-.mjs +0 -89
- package/dist/managed-transforms-D0Z2mlth.mjs +0 -3
- package/dist/mtls-certificates-BL65NK5T.mjs +0 -3
- package/dist/network-interconnects-Bgu9gmaG.mjs +0 -36
- package/dist/oauth-Bk-F-tIO.mjs +0 -52
- package/dist/observability-BynRbTF4.mjs +0 -4
- package/dist/organizations-BqJHyvMK.mjs +0 -41
- package/dist/origin-ca-certificates-BGvYwm3C.mjs +0 -3
- package/dist/origin-post-quantum-encryption-9KOE8YPI.mjs +0 -2
- package/dist/origin-tls-client-auth-d3snC3vr.mjs +0 -4
- package/dist/pages-D4aYteKk.mjs +0 -11
- package/dist/pipelines-G8Iusxq-.mjs +0 -6
- package/dist/progress-DrDErV9w.mjs +0 -2
- package/dist/queues-DEkbKqZX.mjs +0 -6
- package/dist/r2-CV0IkCAW.mjs +0 -21
- package/dist/r2-data-catalog-NtqGC_a_.mjs +0 -14
- package/dist/radar-D986zPJr.mjs +0 -2
- package/dist/rate-limits-B2wRsUX1.mjs +0 -5
- package/dist/raw-fetch-_n0lMAnD.mjs +0 -2
- package/dist/realtime-kit-Ld3c5eU6.mjs +0 -18
- package/dist/registrar-CDIwTz3G.mjs +0 -46
- package/dist/request-tracers-D7SFMDik.mjs +0 -2
- package/dist/resource-sharing-YIQ04jXE.mjs +0 -5
- package/dist/resource-tagging-Bd6Y03sg.mjs +0 -16
- package/dist/rules-DHjLP5Kx.mjs +0 -4
- package/dist/rulesets-q4QABpKs.mjs +0 -8
- package/dist/rum-SmT4HZmM.mjs +0 -4
- package/dist/schema-validation-vVetgC_P.mjs +0 -24
- package/dist/scim-ChOkZpNx.mjs +0 -3
- package/dist/sdk-DhIhH6GB.mjs +0 -5
- package/dist/secrets-store-BAK9G12O.mjs +0 -25
- package/dist/security-center-eScuYDKP.mjs +0 -2
- package/dist/security-txt-x7R4gmQu.mjs +0 -3
- package/dist/session-DHYCE-PM.mjs +0 -93
- package/dist/shared-BAjo72Lz.mjs +0 -2
- package/dist/smart-shield-CWlSsNi8.mjs +0 -3
- package/dist/snippets-DrlgYJYp.mjs +0 -4
- package/dist/speed-ZFrMWDgd.mjs +0 -4
- package/dist/ssl-9JY05sYt.mjs +0 -15
- package/dist/stream-tRU39b8K.mjs +0 -14
- package/dist/tenants-HLGUazms.mjs +0 -2
- package/dist/token-validation-_VdamKpz.mjs +0 -10
- package/dist/turnstile-BRzXd28B.mjs +0 -23
- package/dist/url-normalization-D-NxuLtN.mjs +0 -3
- package/dist/url-scanner-BzzR6iDx.mjs +0 -2
- package/dist/user-C4omq__w.mjs +0 -10
- package/dist/vectorize-By6EqcNR.mjs +0 -4
- package/dist/waiting-rooms-u6KwrzWd.mjs +0 -11
- package/dist/web3-DQ5dmE9W.mjs +0 -4
- package/dist/workers-D8Be7_as.mjs +0 -18
- package/dist/workers-builds-BE3W3qNk.mjs +0 -7
- package/dist/workflows-BWWufqFA.mjs +0 -4
- package/dist/zaraz-Bsa9AvVL.mjs +0 -2
- package/dist/zero-trust-UNVZFnKu.mjs +0 -118
- package/dist/zero_trust-B0_Rk4p2.mjs +0 -3
- package/dist/zones-BXtdwt6E.mjs +0 -21
- /package/dist/{body-parser-DWSy7uZ8.mjs → body-parser-BO6mfo_W.mjs} +0 -0
- /package/dist/{cli-types-BeyOc81z.mjs → cli-types-CFw6Xygp.mjs} +0 -0
- /package/dist/{input-validation-_fMCApaH.mjs → input-validation-BwUR9z8e.mjs} +0 -0
- /package/dist/{lib-4PQI6yRW.mjs → lib-Og5sB51C.mjs} +0 -0
- /package/dist/{local-CYc9q7l2.mjs → local-C6TLPAT6.mjs} +0 -0
- /package/dist/{metadata-OOwvpR8m.mjs → metadata-Cnyws6iO.mjs} +0 -0
- /package/dist/{open-YWOUIZ5Y-3jqSKAB1.mjs → open-YWOUIZ5Y-CFRcYALi.mjs} +0 -0
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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};
|
package/dist/logs-BtpWZQfV.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
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};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{i as a,n as o}from"./auth-CSC4yhEJ.mjs";import{n as s,r as c,t as l}from"./body-parser-DWSy7uZ8.mjs";import{t as u}from"./output-B6fBFRqe.mjs";import{n as d,t as f}from"./progress-DrDErV9w.mjs";import{n as p}from"./input-validation-_fMCApaH.mjs";import{t as m}from"./local-CYc9q7l2.mjs";import{t as h}from"./cli-types-BeyOc81z.mjs";import{n as g,t as _}from"./raw-fetch-_n0lMAnD.mjs";function v(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`description`,{type:`string`,description:`The description field`}).option(`destination-type`,{type:`string`,description:`The destination_type field`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ee={command:`create`,describe:`Create a new Catalog Sync (Closed Beta).`,builder:v,handler:async i=>{let h={};if(i.forwarded!==void 0&&(h.forwarded=String(i.forwarded)),i.dryRun){d({command:`cf magic-cloud-networking catalog-syncs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`json`,body:i.body===void 0?l({description:p(i.description,`description`,`text`),destination_type:p(i[`destination-type`],`destination-type`,`text`),name:p(i.name,`name`,`text`),policy:p(i.policy,`policy`,`text`),update_mode:p(i[`update-mode`],`update-mode`,`text`)}):s(i.body)});return}let g=await o(i),_=i.local?m:await r(g);if(i.accountId=_,i.body){let e=s(i.body);u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}i[`destination-type`]===void 0&&(i[`destination-type`]=await n(`destination-type`,`The destination_type field`,[`NONE`,`ZERO_TRUST_LIST`])),i.name===void 0&&(i.name=await e(`name`,`The name field`)),i[`update-mode`]===void 0&&(i[`update-mode`]=await n(`update-mode`,`The update_mode field`,[`AUTO`,`MANUAL`]));let v={};i.description!==void 0&&c(v,[`description`],p(i.description,`description`,`text`)),i[`destination-type`]!==void 0&&c(v,[`destination_type`],p(i[`destination-type`],`destination-type`,`text`)),i.name!==void 0&&c(v,[`name`],p(i.name,`name`,`text`)),i.policy!==void 0&&c(v,[`policy`],p(i.policy,`policy`,`text`)),i[`update-mode`]!==void 0&&c(v,[`update_mode`],p(i[`update-mode`],`update-mode`,`text`)),u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/catalog-syncs`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function te(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`delete-destination`,{type:`boolean`,description:`Delete destination`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const y={command:`delete <sync-id>`,describe:`Delete a Catalog Sync (Closed Beta).`,builder:te,handler:async e=>{let n={delete_destination:e[`delete-destination`]};if(e.dryRun){d({command:`cf magic-cloud-networking catalog-syncs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/catalog-syncs/${e[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(e[`sync-id`]))}`,pathParams:{"sync-id":String(e[`sync-id`]??``)},query:n,bodyKind:`none`});return}let a=await o(e),s=e.local?m:await r(a);if(e.accountId=s,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}u(await f(`Deleting`,async()=>a.magicCloudNetworking.catalogSyncs.delete({account_id:s,sync_id:e[`sync-id`],...n})),{successLabel:`Deleted`})}};function b(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).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:`edit <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:b,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking catalog-syncs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/catalog-syncs/${e[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(e[`sync-id`]))}`,pathParams:{"sync-id":String(e[`sync-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({description:p(e.description,`description`,`text`),name:p(e.name,`name`,`text`),policy:p(e.policy,`policy`,`text`),update_mode:p(e[`update-mode`],`update-mode`,`text`)}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.catalogSyncs.edit({body:t,account_id:i,sync_id:e[`sync-id`]})),{successLabel:`Updated`});return}let a=l({description:p(e.description,`description`,`text`),name:p(e.name,`name`,`text`),policy:p(e.policy,`policy`,`text`),update_mode:p(e[`update-mode`],`update-mode`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.catalogSyncs.edit({body:a,account_id:i,sync_id:e[`sync-id`]})),{successLabel:`Updated`})}};function S(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <sync-id>`,describe:`Read a Catalog Sync (Closed Beta).`,builder:S,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking catalog-syncs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/catalog-syncs/${e[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(e[`sync-id`]))}`,pathParams:{"sync-id":String(e[`sync-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,u(await f(`Loading`,async()=>n.magicCloudNetworking.catalogSyncs.get({account_id:i,sync_id:e[`sync-id`]})),{successLabel:`Loaded`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List Catalog Syncs (Closed Beta).`,builder:w,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking catalog-syncs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/catalog-syncs`,pathParams:{},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,u(await f(`Loading`,async()=>n.magicCloudNetworking.catalogSyncs.list({account_id:i})),{successLabel:`Loaded`})}};function E(e){return e.option(`destination-type`,{type:`string`,description:`Specify type of destination, omit to return all.`,choices:[`NONE`,`ZERO_TRUST_LIST`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`list`,describe:`List prebuilt catalog sync policies (Closed Beta).`,builder:h(E),handler:async e=>{let n={destination_type:e[`destination-type`]};if(e.dryRun){d({command:`cf magic-cloud-networking catalog-syncs prebuilt-policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/catalog-syncs/prebuilt-policies`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,u(await f(`Loading`,async()=>i.magicCloudNetworking.catalogSyncs.prebuiltPolicies.list({account_id:a,...n})),{successLabel:`Loaded`})}},O={command:`prebuilt-policies`,describe:`Synchronize cloud resource inventories from AWS, Azure, and GCP into a unified catalog`,builder:e=>e.command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`refresh <sync-id>`,describe:`Refresh a Catalog Sync's destination by running the sync policy against latest resource catalog (Closed Beta).`,builder:k,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking catalog-syncs refresh`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/catalog-syncs/${e[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(e[`sync-id`]))}/refresh`,pathParams:{"sync-id":String(e[`sync-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,u(await f(`Creating`,async()=>n.magicCloudNetworking.catalogSyncs.refresh({account_id:i,sync_id:e[`sync-id`]})),{successLabel:`Created`})}};function j(e){return e.positional(`sync-id`,{type:`string`,description:`Sync ID`,demandOption:!0}).option(`description`,{type:`string`,description:`The description field`}).option(`name`,{type:`string`,description:`The name field`}).option(`policy`,{type:`string`,description:`The policy field`}).option(`update-mode`,{type:`string`,description:`The update_mode field`,choices:[`AUTO`,`MANUAL`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`update <sync-id>`,describe:`Update a Catalog Sync (Closed Beta).`,builder:j,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking catalog-syncs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/catalog-syncs/${e[`sync-id`]==null?`<sync-id>`:encodeURIComponent(String(e[`sync-id`]))}`,pathParams:{"sync-id":String(e[`sync-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({description:p(e.description,`description`,`text`),name:p(e.name,`name`,`text`),policy:p(e.policy,`policy`,`text`),update_mode:p(e[`update-mode`],`update-mode`,`text`)}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.catalogSyncs.update({body:t,account_id:i,sync_id:e[`sync-id`]})),{successLabel:`Updated`});return}let a=l({description:p(e.description,`description`,`text`),name:p(e.name,`name`,`text`),policy:p(e.policy,`policy`,`text`),update_mode:p(e[`update-mode`],`update-mode`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.catalogSyncs.update({body:a,account_id:i,sync_id:e[`sync-id`]})),{successLabel:`Updated`})}},N={command:`catalog-syncs`,describe:`Synchronize cloud resource inventories from AWS, Azure, and GCP into a unified catalog`,builder:e=>e.command(ee).command(y).command(x).command(C).command(T).command(A).command(M).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`create`,describe:`Create a new Cloud Integration (Closed Beta).`,builder:P,handler:async i=>{let h={};if(i.forwarded!==void 0&&(h.forwarded=String(i.forwarded)),i.dryRun){d({command:`cf magic-cloud-networking cloud-integrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/providers`,pathParams:{},bodyKind:`json`,body:i.body===void 0?l({cloud_type:p(i[`cloud-type`],`cloud-type`,`text`),description:p(i.description,`description`,`text`),friendly_name:p(i[`friendly-name`],`friendly-name`,`text`)}):s(i.body)});return}let g=await o(i),_=i.local?m:await r(g);if(i.accountId=_,i.body){let e=s(i.body);u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}i[`cloud-type`]===void 0&&(i[`cloud-type`]=await n(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`,`CLOUDFLARE`])),i[`friendly-name`]===void 0&&(i[`friendly-name`]=await e(`friendly-name`,`The friendly_name field`));let v={};i[`cloud-type`]!==void 0&&c(v,[`cloud_type`],p(i[`cloud-type`],`cloud-type`,`text`)),i.description!==void 0&&c(v,[`description`],p(i.description,`description`,`text`)),i[`friendly-name`]!==void 0&&c(v,[`friendly_name`],p(i[`friendly-name`],`friendly-name`,`text`)),u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/providers`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function I(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const L={command:`delete <provider-id>`,describe:`Delete a Cloud Integration (Closed Beta).`,builder:I,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking cloud-integrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/providers/${e[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(e[`provider-id`]))}`,pathParams:{"provider-id":String(e[`provider-id`]??``)},bodyKind:`none`});return}let n=await o(e),a=e.local?m:await r(n);if(e.accountId=a,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}u(await f(`Deleting`,async()=>n.magicCloudNetworking.cloudIntegrations.delete({account_id:a,provider_id:e[`provider-id`]})),{successLabel:`Deleted`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`discover-all`,describe:`Run discovery for all Cloud Integrations in an account (Closed Beta).`,builder:R,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking cloud-integrations discover-all`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/providers/discover`,pathParams:{},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,u(await f(`Creating`,async()=>n.magicCloudNetworking.cloudIntegrations.discoverAll({account_id:i})),{successLabel:`Created`})}};function B(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`discover <provider-id>`,describe:`Run discovery for a Cloud Integration (Closed Beta).`,builder:B,handler:async e=>{let n={v2:e.v2};if(e.dryRun){d({command:`cf magic-cloud-networking cloud-integrations discover`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/providers/${e[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(e[`provider-id`]))}/discover`,pathParams:{"provider-id":String(e[`provider-id`]??``)},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,u(await f(`Creating`,async()=>i.magicCloudNetworking.cloudIntegrations.discover({account_id:a,provider_id:e[`provider-id`],...n})),{successLabel:`Created`})}};function H(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const U={command:`edit <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:H,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking cloud-integrations edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/providers/${e[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(e[`provider-id`]))}`,pathParams:{"provider-id":String(e[`provider-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({aws_arn:p(e[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:p(e[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:p(e[`azure-tenant-id`],`azure-tenant-id`,`text`),description:p(e.description,`description`,`text`),friendly_name:p(e[`friendly-name`],`friendly-name`,`text`),gcp_project_id:p(e[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:p(e[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.cloudIntegrations.edit({body:t,account_id:i,provider_id:e[`provider-id`]})),{successLabel:`Updated`});return}let a=l({aws_arn:p(e[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:p(e[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:p(e[`azure-tenant-id`],`azure-tenant-id`,`text`),description:p(e.description,`description`,`text`),friendly_name:p(e[`friendly-name`],`friendly-name`,`text`),gcp_project_id:p(e[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:p(e[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.cloudIntegrations.edit({body:a,account_id:i,provider_id:e[`provider-id`]})),{successLabel:`Updated`})}};function W(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <provider-id>`,describe:`Read a Cloud Integration (Closed Beta).`,builder:W,handler:async e=>{let n={status:e.status};if(e.dryRun){d({command:`cf magic-cloud-networking cloud-integrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/providers/${e[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(e[`provider-id`]))}`,pathParams:{"provider-id":String(e[`provider-id`]??``)},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,u(await f(`Loading`,async()=>i.magicCloudNetworking.cloudIntegrations.get({account_id:a,provider_id:e[`provider-id`],...n})),{successLabel:`Loaded`})}};function K(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`initial-setup <provider-id>`,describe:`Get initial configuration to complete Cloud Integration setup (Closed Beta).`,builder:K,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking cloud-integrations initial-setup`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/providers/${e[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(e[`provider-id`]))}/initial_setup`,pathParams:{"provider-id":String(e[`provider-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,u(await f(`Loading`,async()=>n.magicCloudNetworking.cloudIntegrations.initialSetup({account_id:i,provider_id:e[`provider-id`]})),{successLabel:`Loaded`})}};function J(e){return e.option(`status`,{type:`boolean`,description:`Status`}).option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List Cloud Integrations (Closed Beta).`,builder:J,handler:async e=>{let n={status:e.status,order_by:e[`order-by`],desc:e.desc,cloudflare:e.cloudflare};if(e.dryRun){d({command:`cf magic-cloud-networking cloud-integrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/providers`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,u(await f(`Loading`,async()=>i.magicCloudNetworking.cloudIntegrations.list({account_id:a,...n})),{successLabel:`Loaded`})}};function X(e){return e.positional(`provider-id`,{type:`string`,description:`Provider ID`,demandOption:!0}).option(`aws-arn`,{type:`string`,description:`The aws_arn field`}).option(`azure-subscription-id`,{type:`string`,description:`The azure_subscription_id field`}).option(`azure-tenant-id`,{type:`string`,description:`The azure_tenant_id field`}).option(`description`,{type:`string`,description:`The description field`}).option(`friendly-name`,{type:`string`,description:`The friendly_name field`}).option(`gcp-project-id`,{type:`string`,description:`The gcp_project_id field`}).option(`gcp-service-account-email`,{type:`string`,description:`The gcp_service_account_email field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`update <provider-id>`,describe:`Update a Cloud Integration (Closed Beta).`,builder:X,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking cloud-integrations update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/providers/${e[`provider-id`]==null?`<provider-id>`:encodeURIComponent(String(e[`provider-id`]))}`,pathParams:{"provider-id":String(e[`provider-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({aws_arn:p(e[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:p(e[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:p(e[`azure-tenant-id`],`azure-tenant-id`,`text`),description:p(e.description,`description`,`text`),friendly_name:p(e[`friendly-name`],`friendly-name`,`text`),gcp_project_id:p(e[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:p(e[`gcp-service-account-email`],`gcp-service-account-email`,`text`)}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.cloudIntegrations.update({body:t,account_id:i,provider_id:e[`provider-id`]})),{successLabel:`Updated`});return}let a=l({aws_arn:p(e[`aws-arn`],`aws-arn`,`text`),azure_subscription_id:p(e[`azure-subscription-id`],`azure-subscription-id`,`text`),azure_tenant_id:p(e[`azure-tenant-id`],`azure-tenant-id`,`text`),description:p(e.description,`description`,`text`),friendly_name:p(e[`friendly-name`],`friendly-name`,`text`),gcp_project_id:p(e[`gcp-project-id`],`gcp-project-id`,`text`),gcp_service_account_email:p(e[`gcp-service-account-email`],`gcp-service-account-email`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.cloudIntegrations.update({body:a,account_id:i,provider_id:e[`provider-id`]})),{successLabel:`Updated`})}},Q={command:`cloud-integrations`,describe:`Cloud provider credentials and integrations for resource discovery and on-ramp provisioning`,builder:e=>e.command(F).command(L).command(V).command(z).command(U).command(G).command(q).command(Y).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const re={command:`edit`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:ne,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps address-spaces edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({prefixes:e.prefixes}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.edit({body:t,account_id:i})),{successLabel:`Updated`});return}if(e.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let a=l({prefixes:e.prefixes});u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.edit({body:a,account_id:i})),{successLabel:`Updated`})}};function ie(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Read the Magic WAN Address Space (Closed Beta).`,builder:ie,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps address-spaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,u(await f(`Loading`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.list({account_id:i})),{successLabel:`Loaded`})}};function oe(e){return e.option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const se={command:`update`,describe:`Update the Magic WAN Address Space (Closed Beta).`,builder:oe,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps address-spaces update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/magic_wan_address_space`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({prefixes:e.prefixes}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.update({body:t,account_id:i})),{successLabel:`Updated`});return}if(e.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);let a=l({prefixes:e.prefixes});u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.addressSpaces.update({body:a,account_id:i})),{successLabel:`Updated`})}},ce={command:`address-spaces`,describe:`On-ramp connections that bridge cloud VPCs/VNets to your Cloudflare network`,builder:e=>e.command(re).command(ae).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function le(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`apply <onramp-id>`,describe:`Apply an On-ramp (Closed Beta).`,builder:le,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps apply`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/${e[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(e[`onramp-id`]))}/apply`,pathParams:{"onramp-id":String(e[`onramp-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,u(await f(`Creating`,async()=>n.magicCloudNetworking.onRamps.apply({account_id:i,onramp_id:e[`onramp-id`]})),{successLabel:`Created`})}};function de(e){return e.option(`forwarded`,{type:`string`,description:`The forwarded header`}).option(`adopted-hub-id`,{type:`string`,description:`The adopted_hub_id field`}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`cloud-asn`,{type:`number`,description:`Sets the cloud-side ASN. If unset or zero, the cloud's default ASN takes effect.`}).option(`cloud-type`,{type:`string`,description:`The cloud_type field`,choices:[`AWS`,`AZURE`,`GOOGLE`]}).option(`description`,{type:`string`,description:`The description field`}).option(`dynamic-routing`,{type:`boolean`,description:`Enables BGP routing. When enabling this feature, set both install_routes_in_cloud and install_routes_in_magic_wan to false.`}).option(`hub-provider-id`,{type:`string`,description:`The hub_provider_id field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`region`,{type:`string`,description:`The region field`}).option(`type`,{type:`string`,description:`The type field`,choices:[`OnrampTypeSingle`,`OnrampTypeHub`]}).option(`vpc`,{type:`string`,description:`The vpc field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`create`,describe:`Create a new On-ramp (Closed Beta).`,builder:de,handler:async i=>{let h={};if(i.forwarded!==void 0&&(h.forwarded=String(i.forwarded)),i.dryRun){d({command:`cf magic-cloud-networking on-ramps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},bodyKind:`json`,body:i.body===void 0?l({adopted_hub_id:p(i[`adopted-hub-id`],`adopted-hub-id`,`text`),attached_hubs:i[`attached-hubs`],attached_vpcs:i[`attached-vpcs`],cloud_asn:i[`cloud-asn`],cloud_type:p(i[`cloud-type`],`cloud-type`,`text`),description:p(i.description,`description`,`text`),dynamic_routing:i[`dynamic-routing`],hub_provider_id:p(i[`hub-provider-id`],`hub-provider-id`,`text`),install_routes_in_cloud:i[`install-routes-in-cloud`],install_routes_in_magic_wan:i[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:i[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:i[`manage-vpc-to-hub-attachments`],name:p(i.name,`name`,`text`),region:p(i.region,`region`,`text`),type:p(i.type,`type`,`text`),vpc:p(i.vpc,`vpc`,`text`)}):s(i.body)});return}let g=await o(i),_=i.local?m:await r(g);if(i.accountId=_,i.body){let e=s(i.body);u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:e,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`});return}if(i[`cloud-type`]===void 0&&(i[`cloud-type`]=await n(`cloud-type`,`The cloud_type field`,[`AWS`,`AZURE`,`GOOGLE`])),i[`dynamic-routing`]===void 0)throw Error(`--dynamic-routing is required (or pass --body with this field set).`);if(i[`install-routes-in-cloud`]===void 0)throw Error(`--install-routes-in-cloud is required (or pass --body with this field set).`);if(i[`install-routes-in-magic-wan`]===void 0)throw Error(`--install-routes-in-magic-wan is required (or pass --body with this field set).`);i.name===void 0&&(i.name=await e(`name`,`The name field`)),i.type===void 0&&(i.type=await n(`type`,`The type field`,[`OnrampTypeSingle`,`OnrampTypeHub`]));let v={};i[`adopted-hub-id`]!==void 0&&c(v,[`adopted_hub_id`],p(i[`adopted-hub-id`],`adopted-hub-id`,`text`)),i[`attached-hubs`]!==void 0&&c(v,[`attached_hubs`],i[`attached-hubs`]),i[`attached-vpcs`]!==void 0&&c(v,[`attached_vpcs`],i[`attached-vpcs`]),i[`cloud-asn`]!==void 0&&c(v,[`cloud_asn`],i[`cloud-asn`]),i[`cloud-type`]!==void 0&&c(v,[`cloud_type`],p(i[`cloud-type`],`cloud-type`,`text`)),i.description!==void 0&&c(v,[`description`],p(i.description,`description`,`text`)),i[`dynamic-routing`]!==void 0&&c(v,[`dynamic_routing`],i[`dynamic-routing`]),i[`hub-provider-id`]!==void 0&&c(v,[`hub_provider_id`],p(i[`hub-provider-id`],`hub-provider-id`,`text`)),i[`install-routes-in-cloud`]!==void 0&&c(v,[`install_routes_in_cloud`],i[`install-routes-in-cloud`]),i[`install-routes-in-magic-wan`]!==void 0&&c(v,[`install_routes_in_magic_wan`],i[`install-routes-in-magic-wan`]),i[`manage-hub-to-hub-attachments`]!==void 0&&c(v,[`manage_hub_to_hub_attachments`],i[`manage-hub-to-hub-attachments`]),i[`manage-vpc-to-hub-attachments`]!==void 0&&c(v,[`manage_vpc_to_hub_attachments`],i[`manage-vpc-to-hub-attachments`]),i.name!==void 0&&c(v,[`name`],p(i.name,`name`,`text`)),i.region!==void 0&&c(v,[`region`],p(i.region,`region`,`text`)),i.type!==void 0&&c(v,[`type`],p(i.type,`type`,`text`)),i.vpc!==void 0&&c(v,[`vpc`],p(i.vpc,`vpc`,`text`)),u(await f(`Creating`,async()=>a(g,`POST`,`/accounts/${_}/magic/cloud/onramps`,{body:Object.keys(v).length>0?v:void 0,headers:Object.keys(h).length>0?h:void 0})),{successLabel:`Created`})}};function pe(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`destroy`,{type:`boolean`,description:`Destroy`}).option(`force`,{type:`boolean`,description:`Force`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`delete <onramp-id>`,describe:`Delete an On-ramp (Closed Beta).`,builder:pe,handler:async e=>{let n={destroy:e.destroy,force:e.force};if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/${e[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(e[`onramp-id`]))}`,pathParams:{"onramp-id":String(e[`onramp-id`]??``)},query:n,bodyKind:`none`});return}let a=await o(e),s=e.local?m:await r(a);if(e.accountId=s,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}u(await f(`Deleting`,async()=>a.magicCloudNetworking.onRamps.delete({account_id:s,onramp_id:e[`onramp-id`],...n})),{successLabel:`Deleted`})}};function he(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ge={command:`edit <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:he,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/${e[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(e[`onramp-id`]))}`,pathParams:{"onramp-id":String(e[`onramp-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({attached_hubs:e[`attached-hubs`],attached_vpcs:e[`attached-vpcs`],description:p(e.description,`description`,`text`),install_routes_in_cloud:e[`install-routes-in-cloud`],install_routes_in_magic_wan:e[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:e[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:e[`manage-vpc-to-hub-attachments`],name:p(e.name,`name`,`text`),vpc:p(e.vpc,`vpc`,`text`)}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.edit({body:t,account_id:i,onramp_id:e[`onramp-id`]})),{successLabel:`Updated`});return}let a=l({attached_hubs:e[`attached-hubs`],attached_vpcs:e[`attached-vpcs`],description:p(e.description,`description`,`text`),install_routes_in_cloud:e[`install-routes-in-cloud`],install_routes_in_magic_wan:e[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:e[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:e[`manage-vpc-to-hub-attachments`],name:p(e.name,`name`,`text`),vpc:p(e.vpc,`vpc`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.edit({body:a,account_id:i,onramp_id:e[`onramp-id`]})),{successLabel:`Updated`})}};function _e(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const ve={command:`export <onramp-id>`,describe:`Export an On-ramp to terraform ready file(s) (Closed Beta).`,builder:_e,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps export`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/${e[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(e[`onramp-id`]))}/export`,pathParams:{"onramp-id":String(e[`onramp-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i;let a=await f(`Loading`,async()=>_(`/accounts/${i}/magic/cloud/onramps/${encodeURIComponent(String(e[`onramp-id`]))}/export`,{method:`POST`,localEndpoint:e.local?e.localEndpoint:void 0}));g(e.text===!0?a.toString(`utf-8`):a)}};function ye(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`post-apply-resources`,{type:`boolean`,description:`Post apply resources`}).option(`planned-resources`,{type:`boolean`,description:`Planned resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`get <onramp-id>`,describe:`Read an On-ramp (Closed Beta).`,builder:ye,handler:async e=>{let n={status:e.status,vpcs:e.vpcs,post_apply_resources:e[`post-apply-resources`],planned_resources:e[`planned-resources`]};if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/${e[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(e[`onramp-id`]))}`,pathParams:{"onramp-id":String(e[`onramp-id`]??``)},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,u(await f(`Loading`,async()=>i.magicCloudNetworking.onRamps.get({account_id:a,onramp_id:e[`onramp-id`],...n})),{successLabel:`Loaded`})}};function xe(e){return e.option(`order-by`,{type:`string`,description:`One of ["updated_at", "id", "cloud_type", "name"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`status`,{type:`boolean`,description:`Status`}).option(`vpcs`,{type:`boolean`,description:`Vpcs`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List On-ramps (Closed Beta).`,builder:xe,handler:async e=>{let n={order_by:e[`order-by`],desc:e.desc,status:e.status,vpcs:e.vpcs};if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,u(await f(`Loading`,async()=>i.magicCloudNetworking.onRamps.list({account_id:a,...n})),{successLabel:`Loaded`})}};function Ce(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`plan <onramp-id>`,describe:`Plan an On-ramp (Closed Beta).`,builder:Ce,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/${e[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(e[`onramp-id`]))}/plan`,pathParams:{"onramp-id":String(e[`onramp-id`]??``)},bodyKind:`none`});return}let n=await o(e),i=e.local?m:await r(n);e.accountId=i,u(await f(`Creating`,async()=>n.magicCloudNetworking.onRamps.plan({account_id:i,onramp_id:e[`onramp-id`]})),{successLabel:`Created`})}};function Te(e){return e.positional(`onramp-id`,{type:`string`,description:`Onramp ID`,demandOption:!0}).option(`attached-hubs`,{type:`string`,array:!0,description:`The attached_hubs field`}).option(`attached-vpcs`,{type:`string`,array:!0,description:`The attached_vpcs field`}).option(`description`,{type:`string`,description:`The description field`}).option(`install-routes-in-cloud`,{type:`boolean`,description:`The install_routes_in_cloud field`}).option(`install-routes-in-magic-wan`,{type:`boolean`,description:`The install_routes_in_magic_wan field`}).option(`manage-hub-to-hub-attachments`,{type:`boolean`,description:`The manage_hub_to_hub_attachments field`}).option(`manage-vpc-to-hub-attachments`,{type:`boolean`,description:`The manage_vpc_to_hub_attachments field`}).option(`name`,{type:`string`,description:`The name field`}).option(`vpc`,{type:`string`,description:`The vpc field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ee={command:`update <onramp-id>`,describe:`Update an On-ramp (Closed Beta).`,builder:Te,handler:async e=>{if(e.dryRun){d({command:`cf magic-cloud-networking on-ramps update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/onramps/${e[`onramp-id`]==null?`<onramp-id>`:encodeURIComponent(String(e[`onramp-id`]))}`,pathParams:{"onramp-id":String(e[`onramp-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({attached_hubs:e[`attached-hubs`],attached_vpcs:e[`attached-vpcs`],description:p(e.description,`description`,`text`),install_routes_in_cloud:e[`install-routes-in-cloud`],install_routes_in_magic_wan:e[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:e[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:e[`manage-vpc-to-hub-attachments`],name:p(e.name,`name`,`text`),vpc:p(e.vpc,`vpc`,`text`)}):s(e.body)});return}let n=await o(e),i=e.local?m:await r(n);if(e.accountId=i,e.body){let t=s(e.body);u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.update({body:t,account_id:i,onramp_id:e[`onramp-id`]})),{successLabel:`Updated`});return}let a=l({attached_hubs:e[`attached-hubs`],attached_vpcs:e[`attached-vpcs`],description:p(e.description,`description`,`text`),install_routes_in_cloud:e[`install-routes-in-cloud`],install_routes_in_magic_wan:e[`install-routes-in-magic-wan`],manage_hub_to_hub_attachments:e[`manage-hub-to-hub-attachments`],manage_vpc_to_hub_attachments:e[`manage-vpc-to-hub-attachments`],name:p(e.name,`name`,`text`),vpc:p(e.vpc,`vpc`,`text`)});u(await f(`Updating`,async()=>n.magicCloudNetworking.onRamps.update({body:a,account_id:i,onramp_id:e[`onramp-id`]})),{successLabel:`Updated`})}},De={command:`on-ramps`,describe:`On-ramp connections that bridge cloud VPCs/VNets to your Cloudflare network`,builder:e=>e.command(ue).command(fe).command(me).command(ge).command(ve).command(be).command(Se).command(we).command(Ee).command(ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const Oe={command:`export`,describe:`Export resources in the Resource Catalog as a JSON file (Closed Beta).`,builder:$,handler:async e=>{let n={provider_id:e[`provider-id`],resource_type:e[`resource-type`],resource_id:e[`resource-id`],region:e.region,resource_group:e[`resource-group`],search:e.search,order_by:e[`order-by`],desc:e.desc,v2:e.v2};if(e.dryRun){d({command:`cf magic-cloud-networking resources export`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/resources/export`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a;let s=new URLSearchParams(Object.entries(n).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),c=await f(`Loading`,async()=>_(`/accounts/${a}/magic/cloud/resources/export${s?`?`+s:``}`,{method:`GET`,localEndpoint:e.local?e.localEndpoint:void 0}));g(e.text===!0?c.toString(`utf-8`):c)}};function ke(e){return e.positional(`resource-id`,{type:`string`,description:`Resource ID`,demandOption:!0}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`get <resource-id>`,describe:`Read an resource from the Resource Catalog (Closed Beta).`,builder:ke,handler:async e=>{let n={v2:e.v2};if(e.dryRun){d({command:`cf magic-cloud-networking resources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/resources/${e[`resource-id`]==null?`<resource-id>`:encodeURIComponent(String(e[`resource-id`]))}`,pathParams:{"resource-id":String(e[`resource-id`]??``)},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,u(await f(`Loading`,async()=>i.magicCloudNetworking.resources.get({account_id:a,resource_id:e[`resource-id`],...n})),{successLabel:`Loaded`})}};function je(e){return e.option(`provider-id`,{type:`string`,description:`Provider ID`}).option(`resource-type`,{type:`string`,description:`Resource type`}).option(`resource-id`,{type:`string`,description:`Resource ID`}).option(`region`,{type:`string`,description:`Region`}).option(`resource-group`,{type:`string`,description:`Resource group`}).option(`managed`,{type:`boolean`,description:`Managed`}).option(`search`,{type:`string`,description:`Search`}).option(`order-by`,{type:`string`,description:`One of ["id", "resource_type", "region"].`}).option(`desc`,{type:`boolean`,description:`Desc`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`cloudflare`,{type:`boolean`,description:`Cloudflare`}).option(`v2`,{type:`boolean`,description:`V2`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`list`,describe:`List resources in the Resource Catalog (Closed Beta).`,builder:h(je),handler:async e=>{let n={provider_id:e[`provider-id`],resource_type:e[`resource-type`],resource_id:e[`resource-id`],region:e.region,resource_group:e[`resource-group`],managed:e.managed,search:e.search,order_by:e[`order-by`],desc:e.desc,per_page:e[`per-page`],page:e.page,cloudflare:e.cloudflare,v2:e.v2};if(e.dryRun){d({command:`cf magic-cloud-networking resources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/resources`,pathParams:{},query:n,bodyKind:`none`});return}let i=await o(e),a=e.local?m:await r(i);e.accountId=a,u(await f(`Loading`,async()=>i.magicCloudNetworking.resources.list({account_id:a,...n})),{successLabel:`Loaded`})}};function Ne(e){return e.option(`policy`,{type:`string`,description:`The policy field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`policy-preview`,describe:`Preview Rego query result against the latest resource catalog (Closed Beta).`,builder:Ne,handler:async n=>{if(n.dryRun){d({command:`cf magic-cloud-networking resources policy-preview`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/magic/cloud/resources/policy-preview`,pathParams:{},bodyKind:`json`,body:n.body===void 0?l({policy:p(n.policy,`policy`,`text`)}):s(n.body)});return}let i=await o(n),a=n.local?m:await r(i);if(n.accountId=a,n.body){let e=s(n.body);u(await f(`Creating`,async()=>i.magicCloudNetworking.resources.policyPreview({...e,account_id:a})),{successLabel:`Created`});return}n.policy===void 0&&(n.policy=await e(`policy`,`The policy field`));let c=l({policy:p(n.policy,`policy`,`text`)});u(await f(`Creating`,async()=>i.magicCloudNetworking.resources.policyPreview({...c,account_id:a})),{successLabel:`Created`})}},Fe={command:`resources`,describe:`Discovered cloud resources (VPCs, subnets, route tables) from connected cloud accounts`,builder:e=>e.command(Oe).command(Ae).command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`magic-cloud-networking`,describe:`Multi-cloud networking — discover cloud resources, manage on-ramps, and automate cross-cloud connectivity`,builder:e=>e.command(N).command(Q).command(De).command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ie as default};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{E as e,S as t,T as n,g as r,w as i}from"./oauth-Bk-F-tIO.mjs";import{n as a}from"./auth-CSC4yhEJ.mjs";import{n as o,t as s}from"./body-parser-DWSy7uZ8.mjs";import{t as c}from"./output-B6fBFRqe.mjs";import{n as l,t as u}from"./progress-DrDErV9w.mjs";import{n as d}from"./input-validation-_fMCApaH.mjs";import{t as f}from"./local-CYc9q7l2.mjs";function p(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`,default:1}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const m={command:`create`,describe:`Create a new network monitoring configuration.`,builder:p,handler:async n=>{if(n.dryRun){l({command:`cf magic-network-monitoring configs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({default_sampling:n[`default-sampling`],name:d(n.name,`name`,`text`),router_ips:n[`router-ips`]}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Creating`,async()=>i.magicNetworkMonitoring.configs.create({...e,account_id:p})),{successLabel:`Created`});return}if(n[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await e(`name`,`The account name.`));let m=s({default_sampling:n[`default-sampling`],name:d(n.name,`name`,`text`),router_ips:n[`router-ips`]});c(await u(`Creating`,async()=>i.magicNetworkMonitoring.configs.create({...m,account_id:p})),{successLabel:`Created`})}};function h(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 g={command:`delete`,describe:`Delete an existing network monitoring configuration.`,builder:h,handler:async e=>{if(e.dryRun){l({command:`cf magic-network-monitoring configs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}c(await u(`Deleting`,async()=>n.magicNetworkMonitoring.configs.delete({account_id:o})),{successLabel:`Deleted`})}};function _(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`edit`,describe:`Update fields in an existing network monitoring configuration.`,builder:_,handler:async e=>{if(e.dryRun){l({command:`cf magic-network-monitoring configs edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:e.body===void 0?s({default_sampling:e[`default-sampling`],name:d(e.name,`name`,`text`),router_ips:e[`router-ips`]}):o(e.body)});return}let n=await a(e),i=e.local?f:await r(n);if(e.accountId=i,e.body){let t=o(e.body);c(await u(`Updating`,async()=>n.magicNetworkMonitoring.configs.edit({...t,account_id:i})),{successLabel:`Updated`});return}let p=s({default_sampling:e[`default-sampling`],name:d(e.name,`name`,`text`),router_ips:e[`router-ips`]});c(await u(`Updating`,async()=>n.magicNetworkMonitoring.configs.edit({...p,account_id:i})),{successLabel:`Updated`})}};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:`Lists default sampling, router IPs, warp devices, and rules for account.`,builder:y,handler:async e=>{if(e.dryRun){l({command:`cf magic-network-monitoring configs full get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/config/full`,pathParams:{},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.magicNetworkMonitoring.configs.full.get({account_id:i})),{successLabel:`Loaded`})}},x={command:`full`,describe:`Account-level monitoring configuration — sampling rates, thresholds, and notification settings`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Lists default sampling, router IPs and warp devices for account.`,builder:S,handler:async e=>{if(e.dryRun){l({command:`cf magic-network-monitoring configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.magicNetworkMonitoring.configs.get({account_id:i})),{successLabel:`Loaded`})}};function w(e){return e.option(`default-sampling`,{type:`number`,description:`Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.`}).option(`name`,{type:`string`,description:`The account name.`}).option(`router-ips`,{type:`string`,array:!0,description:`The router_ips field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const T={command:`update`,describe:`Update an existing network monitoring configuration, requires the entire configuration to be updated at once.`,builder:w,handler:async n=>{if(n.dryRun){l({command:`cf magic-network-monitoring configs update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/config`,pathParams:{},bodyKind:`json`,body:n.body===void 0?s({default_sampling:n[`default-sampling`],name:d(n.name,`name`,`text`),router_ips:n[`router-ips`]}):o(n.body)});return}let i=await a(n),p=n.local?f:await r(i);if(n.accountId=p,n.body){let e=o(n.body);c(await u(`Updating`,async()=>i.magicNetworkMonitoring.configs.update({...e,account_id:p})),{successLabel:`Updated`});return}if(n[`default-sampling`]===void 0)throw Error(`--default-sampling is required (or pass --body with this field set).`);n.name===void 0&&(n.name=await e(`name`,`The account name.`));let m=s({default_sampling:n[`default-sampling`],name:d(n.name,`name`,`text`),router_ips:n[`router-ips`]});c(await u(`Updating`,async()=>i.magicNetworkMonitoring.configs.update({...m,account_id:p})),{successLabel:`Updated`})}},E={command:`configs`,describe:`Account-level monitoring configuration — sampling rates, thresholds, and notification settings`,builder:e=>e.command(m).command(g).command(v).command(C).command(T).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`edit <rule-id>`,describe:`Update advertisement for rule.`,builder:D,handler:async e=>{if(e.dryRun){l({command:`cf magic-network-monitoring rules advertisements edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}/advertisement`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Updating`,async()=>n.magicNetworkMonitoring.rules.advertisements.edit({account_id:i,rule_id:e[`rule-id`]})),{successLabel:`Updated`})}},k={command:`advertisements`,describe:`Monitoring rules that define traffic thresholds and trigger alerts or prefix advertisements`,builder:e=>e.command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`],default:`1m`}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const j={command:`create`,describe:`Create network monitoring rules for account. Currently only supports creating a single rule per API request.`,builder:A,handler:async i=>{if(i.dryRun){l({command:`cf magic-network-monitoring rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({automatic_advertisement:i[`automatic-advertisement`],bandwidth_threshold:i[`bandwidth-threshold`],duration:d(i.duration,`duration`,`text`),name:d(i.name,`name`,`text`),packet_threshold:i[`packet-threshold`],prefix_match:d(i[`prefix-match`],`prefix-match`,`text`),prefixes:i.prefixes,type:d(i.type,`type`,`text`),zscore_sensitivity:d(i[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(i[`zscore-target`],`zscore-target`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Creating`,async()=>p.magicNetworkMonitoring.rules.create({body:e,account_id:m})),{successLabel:`Created`});return}if(i[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(i.name===void 0&&(i.name=await e(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),i.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);i.type===void 0&&(i.type=await n(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=s({automatic_advertisement:i[`automatic-advertisement`],bandwidth_threshold:i[`bandwidth-threshold`],duration:d(i.duration,`duration`,`text`),name:d(i.name,`name`,`text`),packet_threshold:i[`packet-threshold`],prefix_match:d(i[`prefix-match`],`prefix-match`,`text`),prefixes:i.prefixes,type:d(i.type,`type`,`text`),zscore_sensitivity:d(i[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(i[`zscore-target`],`zscore-target`,`text`)});c(await u(`Creating`,async()=>p.magicNetworkMonitoring.rules.create({body:h,account_id:m})),{successLabel:`Created`})}};function M(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const N={command:`delete <rule-id>`,describe:`Delete a network monitoring rule for account.`,builder:M,handler:async e=>{if(e.dryRun){l({command:`cf magic-network-monitoring rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await a(e),o=e.local?f:await r(n);if(e.accountId=o,!await i({force:!!e.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}c(await u(`Deleting`,async()=>n.magicNetworkMonitoring.rules.delete({account_id:o,rule_id:e[`rule-id`]})),{successLabel:`Deleted`})}};function P(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const F={command:`edit <rule-id>`,describe:`Update a network monitoring rule for account.`,builder:P,handler:async i=>{if(i.dryRun){l({command:`cf magic-network-monitoring rules edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/rules/${i[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(i[`rule-id`]))}`,pathParams:{"rule-id":String(i[`rule-id`]??``)},bodyKind:`json`,body:i.body===void 0?s({automatic_advertisement:i[`automatic-advertisement`],bandwidth_threshold:i[`bandwidth-threshold`],duration:d(i.duration,`duration`,`text`),name:d(i.name,`name`,`text`),packet_threshold:i[`packet-threshold`],prefix_match:d(i[`prefix-match`],`prefix-match`,`text`),prefixes:i.prefixes,type:d(i.type,`type`,`text`),zscore_sensitivity:d(i[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(i[`zscore-target`],`zscore-target`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Updating`,async()=>p.magicNetworkMonitoring.rules.edit({body:e,account_id:m,rule_id:i[`rule-id`]})),{successLabel:`Updated`});return}if(i[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(i.name===void 0&&(i.name=await e(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),i.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);i.type===void 0&&(i.type=await n(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=s({automatic_advertisement:i[`automatic-advertisement`],bandwidth_threshold:i[`bandwidth-threshold`],duration:d(i.duration,`duration`,`text`),name:d(i.name,`name`,`text`),packet_threshold:i[`packet-threshold`],prefix_match:d(i[`prefix-match`],`prefix-match`,`text`),prefixes:i.prefixes,type:d(i.type,`type`,`text`),zscore_sensitivity:d(i[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(i[`zscore-target`],`zscore-target`,`text`)});c(await u(`Updating`,async()=>p.magicNetworkMonitoring.rules.edit({body:h,account_id:m,rule_id:i[`rule-id`]})),{successLabel:`Updated`})}};function I(e){return e.positional(`rule-id`,{type:`string`,description:`The id of the rule. Must be unique.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get <rule-id>`,describe:`List a single network monitoring rule for account.`,builder:I,handler:async e=>{if(e.dryRun){l({command:`cf magic-network-monitoring rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/rules/${e[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(e[`rule-id`]))}`,pathParams:{"rule-id":String(e[`rule-id`]??``)},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.magicNetworkMonitoring.rules.get({account_id:i,rule_id:e[`rule-id`]})),{successLabel:`Loaded`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`Lists network monitoring rules for account.`,builder:R,handler:async e=>{if(e.dryRun){l({command:`cf magic-network-monitoring rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Loading`,async()=>n.magicNetworkMonitoring.rules.list({account_id:i})),{successLabel:`Loaded`})}};function B(e){return e.option(`automatic-advertisement`,{type:`boolean`,description:`Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.`}).option(`bandwidth-threshold`,{type:`number`,description:`The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`duration`,{type:`string`,description:`The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values ["1m","5m","10m","15m","20m","30m","45m","60m"].`,choices:[`1m`,`5m`,`10m`,`15m`,`20m`,`30m`,`45m`,`60m`]}).option(`name`,{type:`string`,description:`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`}).option(`packet-threshold`,{type:`number`,description:`The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.`}).option(`prefix-match`,{type:`string`,description:`Prefix match type to be applied for a prefix auto advertisement when using an advanced_ddos rule.`,choices:[`exact`,`subnet`,`supernet`]}).option(`prefixes`,{type:`string`,array:!0,description:`The prefixes field`}).option(`type`,{type:`string`,description:`MNM rule type.`,choices:[`threshold`,`zscore`,`advanced_ddos`]}).option(`zscore-sensitivity`,{type:`string`,description:`Level of sensitivity set for zscore rules.`,choices:[`low`,`medium`,`high`]}).option(`zscore-target`,{type:`string`,description:`Target of the zscore rule analysis.`,choices:[`bits`,`packets`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`update`,describe:`Update network monitoring rules for account.`,builder:B,handler:async i=>{if(i.dryRun){l({command:`cf magic-network-monitoring rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/rules`,pathParams:{},bodyKind:`json`,body:i.body===void 0?s({automatic_advertisement:i[`automatic-advertisement`],bandwidth_threshold:i[`bandwidth-threshold`],duration:d(i.duration,`duration`,`text`),name:d(i.name,`name`,`text`),packet_threshold:i[`packet-threshold`],prefix_match:d(i[`prefix-match`],`prefix-match`,`text`),prefixes:i.prefixes,type:d(i.type,`type`,`text`),zscore_sensitivity:d(i[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(i[`zscore-target`],`zscore-target`,`text`)}):o(i.body)});return}let p=await a(i),m=i.local?f:await r(p);if(i.accountId=m,i.body){let e=o(i.body);c(await u(`Updating`,async()=>p.magicNetworkMonitoring.rules.update({body:e,account_id:m})),{successLabel:`Updated`});return}if(i[`automatic-advertisement`]===void 0)throw Error(`--automatic-advertisement is required (or pass --body with this field set).`);if(i.name===void 0&&(i.name=await e(`name`,`The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (_), dash (-), period (.), and tilde (~). You can’t have a space in the rule name. Max 256 characters.`)),i.prefixes===void 0)throw Error(`--prefixes is required (or pass --body with this field set).`);i.type===void 0&&(i.type=await n(`type`,`MNM rule type.`,[`threshold`,`zscore`,`advanced_ddos`]));let h=s({automatic_advertisement:i[`automatic-advertisement`],bandwidth_threshold:i[`bandwidth-threshold`],duration:d(i.duration,`duration`,`text`),name:d(i.name,`name`,`text`),packet_threshold:i[`packet-threshold`],prefix_match:d(i[`prefix-match`],`prefix-match`,`text`),prefixes:i.prefixes,type:d(i.type,`type`,`text`),zscore_sensitivity:d(i[`zscore-sensitivity`],`zscore-sensitivity`,`text`),zscore_target:d(i[`zscore-target`],`zscore-target`,`text`)});c(await u(`Updating`,async()=>p.magicNetworkMonitoring.rules.update({body:h,account_id:m})),{successLabel:`Updated`})}},H={command:`rules`,describe:`Monitoring rules that define traffic thresholds and trigger alerts or prefix advertisements`,builder:e=>e.command(j).command(N).command(F).command(L).command(z).command(V).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`create`,describe:`Generate authentication token for VPC flow logs export.`,builder:U,handler:async e=>{if(e.dryRun){l({command:`cf magic-network-monitoring vpc-flows tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${t()??`<account-id>`}/mnm/vpc-flows/token`,pathParams:{},bodyKind:`none`});return}let n=await a(e),i=e.local?f:await r(n);e.accountId=i,c(await u(`Creating`,async()=>n.magicNetworkMonitoring.vpcFlows.tokens.create({account_id:i})),{successLabel:`Created`})}},G={command:`tokens`,describe:`Ingest VPC flow logs from cloud providers for network visibility and anomaly detection`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},K={command:`vpc-flows`,describe:`Operations for vpc-flows`,builder:e=>e.command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},q={command:`magic-network-monitoring`,describe:`Flow-based network traffic monitoring with configurable alerting rules and VPC flow ingestion`,builder:e=>e.command(E).command(H).command(K).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{q as default};
|