cf 0.10.0 → 0.12.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/README.md +15 -5
- package/dist/_meta/agent-context.json +13 -5
- package/dist/_meta/commands.json +2393 -262
- package/dist/_meta/hand-written-commands.json +960 -0
- package/dist/_meta/schemas.json +1882 -155
- package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-D40QFl-y.mjs} +2 -2
- package/dist/{access-lhLJo1v2.mjs → access-Dl2IU1ID.mjs} +1 -1
- package/dist/account-CPbieCZ4.mjs +2 -0
- package/dist/{account-tags-B88TotoH.mjs → account-tags-skfP7H8k.mjs} +4 -4
- package/dist/{accounts-BSIAT_iP.mjs → accounts-CSgR6909.mjs} +12 -12
- package/dist/{acm-VULm1djv.mjs → acm-CVvCTaNk.mjs} +1 -1
- package/dist/{addressing-BHPBIkRY.mjs → addressing-Uq5hEDDP.mjs} +11 -11
- package/dist/{agent-context-KBy48G1b.mjs → agent-context-BvuDdaJb.mjs} +1 -1
- package/dist/agent-memory-BrHMIU0E.mjs +6 -0
- package/dist/ai-audit-BoZuL84i.mjs +2 -0
- package/dist/ai-gateway-DE50Jem1.mjs +13 -0
- package/dist/ai-search-Fx7NHCHB.mjs +7 -0
- package/dist/ai-security-DyLbY9kv.mjs +4 -0
- package/dist/ai-v2fP1r0s.mjs +5 -0
- package/dist/{alerting-Bl8OqViR.mjs → alerting-5mFZjTcD.mjs} +1 -1
- package/dist/analytics-BygTfozw.mjs +3 -0
- package/dist/analytics_engine-4L-q362P.mjs +2 -0
- package/dist/{api-security-4FVrD4n8.mjs → api-security-DjFsRYWx.mjs} +20 -20
- package/dist/argo-TzXPN7tz.mjs +2 -0
- package/dist/args-CDgWUP4J.mjs +2 -0
- package/dist/{artifacts-CVDGnr2V.mjs → artifacts-dEw2UUBV.mjs} +1 -1
- package/dist/audit-logs-CqY7zzwv.mjs +2 -0
- package/dist/auth-CPLdkOC7.mjs +5 -0
- package/dist/{auth-MQEamPN9.mjs → auth-DY_Y2bXC.mjs} +3 -3
- package/dist/billing-DHQuRT8S.mjs +3 -0
- package/dist/body-parser-BGVbwPeM.mjs +2 -0
- package/dist/bot-management-CfqG79hF.mjs +5 -0
- package/dist/botnet-feed-BOeNnDoH.mjs +3 -0
- package/dist/brand-protection-DYttrKIM.mjs +3 -0
- package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
- package/dist/browser-run-373D4e1i.mjs +4 -0
- package/dist/build-D0ir_S70.mjs +2 -0
- package/dist/{cache-VyWK1SjY.mjs → cache-DJXBmc3w.mjs} +1 -1
- package/dist/{calls-BxoRYxs4.mjs → calls-COO0Eoz1.mjs} +1 -1
- package/dist/certificate-authorities-DbHLmKbd.mjs +2 -0
- package/dist/cf-yPz_IqW6.mjs +18 -0
- package/dist/chunk-LQW53VED-9MACsvSG.mjs +119 -0
- package/dist/chunk-QBZBEHZB-yeyhVUeD.mjs +2 -0
- package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
- package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-HOmA37et.mjs} +1 -1
- package/dist/cloud-connector-C7hw1c1f.mjs +2 -0
- package/dist/cloudforce-one-DLOj76q4.mjs +36 -0
- package/dist/command-BV87D4tR.mjs +2 -0
- package/dist/{completions-BHE4pRjB.mjs → completions-BnD46cXe.mjs} +3 -3
- package/dist/config.d.mts +1451 -1366
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-DY-z_LrH.mjs +2 -0
- package/dist/connector-telemetry-events-DCXmcAc9.mjs +2 -0
- package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +2 -0
- package/dist/{connectors-BqxYMMtQ.mjs → connectors-fEOn-J_i.mjs} +1 -1
- package/dist/containers-BDBsEs7-.mjs +58 -0
- package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-Cmj9--XY.mjs} +1 -1
- package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
- package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
- package/dist/custom-certificates-C5qrlyhb.mjs +5 -0
- package/dist/custom-csrs-BgOnTbBW.mjs +3 -0
- package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
- package/dist/custom-nameservers-2ZajBkRC.mjs +3 -0
- package/dist/custom-pages-Buki_Cb8.mjs +3 -0
- package/dist/d1-n2in0cSF.mjs +20 -0
- package/dist/data-security-DzOQMkv3.mjs +7 -0
- package/dist/dcv-delegation-BTP9LCOm.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-BUSz35vq.mjs +2 -0
- package/dist/deploy-input-BvD9aRP1.mjs +2 -0
- package/dist/dev-DY_DquQx.mjs +4 -0
- package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
- package/dist/{directory-BlH6N6Qy.mjs → directory-BeiSyg8A.mjs} +1 -1
- package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
- package/dist/dist-BBx1io2f.mjs +2 -0
- package/dist/dist-Cb9TJ2VV.mjs +9 -0
- package/dist/dist-DV7LR38l.mjs +387 -0
- package/dist/dist-DvizctjW.mjs +48 -0
- package/dist/{dls-BF5iN78p.mjs → dls-BwoU29mS.mjs} +1 -1
- package/dist/{dns-CeCTNqRk.mjs → dns-DISAfuzj.mjs} +13 -13
- package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
- package/dist/dry-run-ILZRVpnp.mjs +2 -0
- package/dist/durable-objects-DhDL3San.mjs +2 -0
- package/dist/email-auth-BROqK6-C.mjs +2 -0
- package/dist/email-routing-BZXHDAOO.mjs +6 -0
- package/dist/email-security-DVumybrk.mjs +18 -0
- package/dist/email-sending-CDQ3_wyz.mjs +7 -0
- package/dist/fieldExtractors-Cy1rxHEF.mjs +3 -0
- package/dist/{firewall-CBPGJ43p.mjs → firewall-C0g5X7Zd.mjs} +9 -9
- package/dist/flagship-fFBiZUz-.mjs +4 -0
- package/dist/{fraud-BIhS8pLf.mjs → fraud-CjIETOaM.mjs} +1 -1
- package/dist/google-tag-gateway-hPa5IHUx.mjs +2 -0
- package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-CoycpTf9.mjs} +1 -1
- package/dist/{hostnames-Bx0mykMR.mjs → hostnames-x_Yezxpr.mjs} +1 -1
- package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
- package/dist/iam-Bk7K_PPO.mjs +6 -0
- package/dist/images-BAEFb9q1.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/{intel-B-9Z_sJs.mjs → intel-DDkyJVaP.mjs} +1 -1
- package/dist/interactive-CRnq-B5I.mjs +11 -0
- package/dist/{interactive-DtsCYfrK.mjs → interactive-cytQzL94.mjs} +1 -1
- package/dist/ips-DU0ti0i0.mjs +2 -0
- package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
- package/dist/keys-DqldTZqH.mjs +2 -0
- package/dist/{kv-BFDUCnft.mjs → kv-CcfCfnwq.mjs} +1 -1
- package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
- package/dist/load-balancers-Dg4pDad1.mjs +6 -0
- package/dist/{local-D-aVNu6A.mjs → local-DGiIS1uM.mjs} +1 -1
- package/dist/local-runtime--IQr44qq.mjs +2 -0
- package/dist/logexplorer-Bu2mG5rh.mjs +17 -0
- package/dist/logo-matches-CWUzxY7G.mjs +2 -0
- package/dist/logos-BTfdkDPi.mjs +3 -0
- package/dist/{logpush-BK34mMQs.mjs → logpush-BZyay3h2.mjs} +1 -1
- package/dist/{logs-CLAqX9h2.mjs → logs-BqF7jjQO.mjs} +1 -1
- package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +4 -4
- package/dist/magic-network-monitoring-D0FnkjuN.mjs +4 -0
- package/dist/magic-transit-B5skt0G7.mjs +111 -0
- package/dist/managed-transforms-B6X_crcJ.mjs +3 -0
- package/dist/matches-DeYaB4I0.mjs +2 -0
- package/dist/mcp-ChjBiMx2.mjs +4 -0
- package/dist/mesh-DRVAFLBX.mjs +4 -0
- package/dist/{moq-qmuVPAO0.mjs → moq-DE7VDEFS.mjs} +1 -1
- package/dist/mtls-certificates-Cbc3uAkN.mjs +3 -0
- package/dist/{network-D74cSy3t.mjs → network-CDPZNFbn.mjs} +1 -1
- package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
- package/dist/oauth-DAa7SwkM.mjs +14 -0
- package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
- package/dist/oauth-scopes-BE6xF4_h.mjs +2 -0
- package/dist/observability-DnyI8rPJ.mjs +4 -0
- package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +3 -3
- package/dist/{organization-NX7yCZrq.mjs → organization-yh0mSUdI.mjs} +6 -6
- package/dist/organizations-B3aU-RCG.mjs +2 -0
- package/dist/origin-ca-certificates-BaNWfVqf.mjs +3 -0
- package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +2 -0
- package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +4 -0
- package/dist/{output-DrpYYfnB.mjs → output-BqDR9h74.mjs} +1 -1
- package/dist/page-rules-CzbyXbt6.mjs +27 -0
- package/dist/pages-CX8yefTI.mjs +14 -0
- package/dist/pay-per-crawl-v4vBOMWD.mjs +4 -0
- package/dist/pipelines-BZ1KGupx.mjs +6 -0
- package/dist/precursor-D42A9ay5.mjs +4 -0
- package/dist/progress-jYW64HY7.mjs +2 -0
- package/dist/project-settings-BN7tL0c7.mjs +3 -0
- package/dist/prompt-CyATfGUu.mjs +3 -0
- package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
- package/dist/queries-xvETUjUE.mjs +3 -0
- package/dist/queues-CpqHDtxF.mjs +6 -0
- package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
- package/dist/r2-jhmLvD1z.mjs +24 -0
- package/dist/radar-C2J16wpX.mjs +2 -0
- package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
- package/dist/raw-fetch-CNKIypJ7.mjs +2 -0
- package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
- package/dist/registrar-BI5ewTAk.mjs +23 -0
- package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-al1znWMc.mjs} +4 -4
- package/dist/{registry-Bck_zFkz.mjs → registry-5-I2XLwF.mjs} +1 -1
- package/dist/reporting-CxsdHAH3.mjs +2 -0
- package/dist/request-tracers-DJJCncft.mjs +2 -0
- package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
- package/dist/resource-tagging-aTtpX5e5.mjs +2 -0
- package/dist/rules-PpsDU89Q.mjs +4 -0
- package/dist/rulesets-DP12Aqik.mjs +5 -0
- package/dist/rum-DxvpzJYc.mjs +4 -0
- package/dist/{schema-B34Q9tLF.mjs → schema-DlLbiOJj.mjs} +1 -1
- package/dist/schema-flags-CTfQVGCs.mjs +5 -0
- package/dist/schemas-BFCBlp_W.mjs +65 -0
- package/dist/{scim-CcSyfKCH.mjs → scim-DJ4AVU20.mjs} +1 -1
- package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
- package/dist/security-center-008FMs_z.mjs +2 -0
- package/dist/{security-txt-DqnFpjMI.mjs → security-txt-CqcfrhlN.mjs} +1 -1
- package/dist/{share-BuwYUzOL.mjs → share-D5fzsVAJ.mjs} +4 -4
- package/dist/{deploy-input-CrvuoDGJ.mjs → shared-DlKGNPiT.mjs} +97 -99
- package/dist/smart-shield-DpFscIk8.mjs +4 -0
- package/dist/snippets-CCKgI2ZX.mjs +4 -0
- package/dist/spawn-C3_tJ3RB.mjs +526 -0
- package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-LmdqY3ki.mjs} +1 -1
- package/dist/{speed-cw31yFva.mjs → speed-CEK36h3A.mjs} +1 -1
- package/dist/src-CEb2fgtT.mjs +108 -0
- package/dist/{ssl-CsEhRVTO.mjs → ssl-ChHUyaQm.mjs} +1 -1
- package/dist/startup-profile-Dpxg-MjV.mjs +17 -0
- package/dist/{state-Bb5Cbc_L.mjs → state-DeX23Kmg.mjs} +1 -1
- package/dist/{stream-DFOao6Gu.mjs → stream-DfUSELMX.mjs} +13 -13
- package/dist/submit-DF2G5CIz.mjs +2 -0
- package/dist/tags-nFJJHlLJ.mjs +2 -0
- package/dist/tenant-CRLw1oRU.mjs +2 -0
- package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +3 -0
- package/dist/{tools-BHfBOZOU.mjs → tools-j8UGEtP1.mjs} +1 -1
- package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CMQeBgmb.mjs} +1 -1
- package/dist/tunnels-iVA3MrdS.mjs +2 -0
- package/dist/turnstile-DQHP6-_b.mjs +23 -0
- package/dist/{ui-DE8CNn6c.mjs → ui-DJFcf61J.mjs} +1 -1
- package/dist/url-info-BVgdb_pf.mjs +2 -0
- package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
- package/dist/url-scanner-DwuDZLPk.mjs +2 -0
- package/dist/user-I_MbB_KX.mjs +12 -0
- package/dist/values-S-Q7-5o8.mjs +2 -0
- package/dist/{vectorize-CVKu7lEt.mjs → vectorize-CNZdF_0A.mjs} +1 -1
- package/dist/waiting-rooms-Bo-OSsxu.mjs +11 -0
- package/dist/{web-assets-C2s9kzWf.mjs → web-assets-tlFzKdNL.mjs} +1 -1
- package/dist/web3-CdbfoZ2x.mjs +4 -0
- package/dist/workers-DQ9Q7czn.mjs +28 -0
- package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
- package/dist/{workflows-B-kGHxFu.mjs → workflows-BhEy-crm.mjs} +1 -1
- package/dist/zaraz-DbKvA_8C.mjs +2 -0
- package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DrHCPVOc.mjs} +67 -66
- package/dist/zone-D2zrbJI2.mjs +2 -0
- package/dist/zones-DrpxQ_-A.mjs +21 -0
- package/package.json +12 -8
- package/dist/account-CYRm3yoN.mjs +0 -2
- package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
- package/dist/ai-audit-BWZGvbca.mjs +0 -2
- package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
- package/dist/ai-search-BmdskMjR.mjs +0 -7
- package/dist/ai-security-CsmfcaUx.mjs +0 -4
- package/dist/ai-viHB1tgI.mjs +0 -5
- package/dist/analytics-vOxw8Hy0.mjs +0 -3
- package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
- package/dist/argo-CQfCgazW.mjs +0 -2
- package/dist/args-DlUhyGU0.mjs +0 -2
- package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
- package/dist/auth-D0xZxAEa.mjs +0 -5
- package/dist/billing-aJgapeRm.mjs +0 -3
- package/dist/body-parser-C-c9gfH1.mjs +0 -2
- package/dist/bot-management-Y2q5d-pi.mjs +0 -5
- package/dist/botnet-feed-DANJqfmE.mjs +0 -3
- package/dist/brand-protection-CjpZWBjp.mjs +0 -3
- package/dist/browser-run-BFn9h2Tz.mjs +0 -4
- package/dist/build-DcflwvqN.mjs +0 -2
- package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
- package/dist/cf-C7DU4819.mjs +0 -18
- package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
- package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
- package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
- package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
- package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
- package/dist/containers-CKW081JA.mjs +0 -54
- package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
- package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
- package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
- package/dist/custom-pages-M7jA2Hit.mjs +0 -3
- package/dist/d1-BFvMd6-S.mjs +0 -20
- package/dist/data-security-Bji4Or_j.mjs +0 -7
- package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
- package/dist/deploy-CZ7bgNDu.mjs +0 -2
- package/dist/dev-V10MG-Bg.mjs +0 -4
- package/dist/dist-CgrMkXFx.mjs +0 -72
- package/dist/durable-objects-D8FQORrL.mjs +0 -2
- package/dist/email-auth-DJK0Eb30.mjs +0 -2
- package/dist/email-routing-NpmiKIrl.mjs +0 -6
- package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
- package/dist/email-sending-dn-353Nx.mjs +0 -7
- package/dist/fieldExtractors-ahysj57J.mjs +0 -3
- package/dist/flagship-BusjRNIb.mjs +0 -4
- package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
- package/dist/iam-Cj63Kjc6.mjs +0 -6
- package/dist/images-CBWXCDhy.mjs +0 -8
- package/dist/ips-qs9eGJnI.mjs +0 -2
- package/dist/keys-D7N0j4-x.mjs +0 -2
- package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
- package/dist/local-runtime-Dh3keC5v.mjs +0 -2
- package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
- package/dist/logo-matches-CJcthPHf.mjs +0 -2
- package/dist/logos-BS65zN8q.mjs +0 -3
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
- package/dist/magic-transit-BtsFePMx.mjs +0 -111
- package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
- package/dist/matches-InA1hwII.mjs +0 -2
- package/dist/mcp-mJ7bekNJ.mjs +0 -4
- package/dist/mesh-BK4S1Ezy.mjs +0 -4
- package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
- package/dist/oauth-B0ETkNcX.mjs +0 -15
- package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
- package/dist/observability-BWE0Gg3V.mjs +0 -4
- package/dist/organizations-DLhiRt8g.mjs +0 -2
- package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
- package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
- package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
- package/dist/page-rules-BSz1gO-_.mjs +0 -18
- package/dist/pages-DVDogxPs.mjs +0 -14
- package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
- package/dist/pipelines-BszRk4sM.mjs +0 -6
- package/dist/precursor-BPNjQr76.mjs +0 -4
- package/dist/progress-CsHIt3Tp.mjs +0 -2
- package/dist/prompt-DdegNPpg.mjs +0 -3
- package/dist/queries-JL1H1Biz.mjs +0 -3
- package/dist/queues-DpkYdRUE.mjs +0 -6
- package/dist/r2-CKozthw_.mjs +0 -24
- package/dist/radar-C-92vggG.mjs +0 -2
- package/dist/raw-fetch-CteyTOM2.mjs +0 -2
- package/dist/registrar-DKKN0M29.mjs +0 -21
- package/dist/reporting-fg_GKXe1.mjs +0 -2
- package/dist/request-tracers-CkMya96z.mjs +0 -2
- package/dist/resource-tagging-z48JGHCq.mjs +0 -2
- package/dist/rules-BTmNjDN-.mjs +0 -4
- package/dist/rulesets-CsoSM-17.mjs +0 -5
- package/dist/rum-DB4iO2q5.mjs +0 -4
- package/dist/schema-flags-iGoOriJt.mjs +0 -5
- package/dist/security-center-DFKeHq5c.mjs +0 -2
- package/dist/session-D6KHthHf.mjs +0 -2
- package/dist/shared-VppSAQf4.mjs +0 -2
- package/dist/smart-shield-D6X8L7p8.mjs +0 -4
- package/dist/snippets-DIpc9pb_.mjs +0 -4
- package/dist/spawn-O1RS01vr.mjs +0 -523
- package/dist/src-D_HETJNy.mjs +0 -108
- package/dist/submit--xTzyNPy.mjs +0 -2
- package/dist/tags-efICDkah.mjs +0 -2
- package/dist/tenant-CerHuToJ.mjs +0 -2
- package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
- package/dist/triggers-BEsiiKAf.mjs +0 -2
- package/dist/tunnels-D0J8lJoI.mjs +0 -2
- package/dist/turnstile-CFmtY5bn.mjs +0 -23
- package/dist/url-info-DBCeRWwb.mjs +0 -2
- package/dist/url-scanner-CNyvg65L.mjs +0 -2
- package/dist/user-bifVEQq5.mjs +0 -12
- package/dist/values-OxkdP1tV.mjs +0 -2
- package/dist/versions-BVL-Ludh.mjs +0 -2
- package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
- package/dist/web3-y_cY91V_.mjs +0 -4
- package/dist/workers-jDcq14GH.mjs +0 -24
- package/dist/zaraz-27zwjLvv.mjs +0 -2
- package/dist/zone-BJix2KQ9.mjs +0 -2
- package/dist/zones-Bkj5i92c.mjs +0 -21
- /package/dist/{alerts-CRmjqOZi.mjs → alerts-9PR5sQ_z.mjs} +0 -0
- /package/dist/{autorag-BD7cu5NU.mjs → autorag-Bevo1kIH.mjs} +0 -0
- /package/dist/{brands-BhALBkX2.mjs → brands-C4M04Man.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
- /package/dist/{clear-BgF8No7D.mjs → clear-DS0eRXOc.mjs} +0 -0
- /package/dist/{cli-types-BsTty22w.mjs → cli-types-C3nVfpSG.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
- /package/dist/{domain-info-C50W5GhA.mjs → domain-info-BUiaGCEq.mjs} +0 -0
- /package/dist/{health-BFNZqiAm.mjs → health-vX6Ml2Na.mjs} +0 -0
- /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-1esLElok.mjs} +0 -0
- /package/dist/{internal-BTeSewwB.mjs → internal-ROz7anul.mjs} +0 -0
- /package/dist/{live-Dkiyu30_.mjs → live-CSxvigCS.mjs} +0 -0
- /package/dist/{metadata-8AkOftcB.mjs → metadata-DEqBUaSv.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
- /package/dist/{ready-TKOkKeRg.mjs → ready-6G9zVGPJ.mjs} +0 -0
- /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
- /package/dist/{refute-BVz9nMyd.mjs → refute-DjkmLSNe.mjs} +0 -0
- /package/dist/{resolve-CeBbH6Pq.mjs → resolve-DEvdeprv.mjs} +0 -0
- /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-545qLcGs.mjs} +0 -0
- /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-DRQiVufl.mjs} +0 -0
- /package/dist/{search-DGNc37HK.mjs → search-CXbqFoqe.mjs} +0 -0
- /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-rU_nvgFA.mjs} +0 -0
- /package/dist/{submission-info-FjUolE6A.mjs → submission-info-D6PgXNQP.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
- /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-XkFyu8H5.mjs} +0 -0
- /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
- /package/dist/{verify-DS1PWAJe.mjs → verify-CM1NakP0.mjs} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{a as e}from"./theme-CrIBazAF.mjs";import{n as t,t as n}from"./local-DGiIS1uM.mjs";import{f as r,g as i}from"./oauth-DAa7SwkM.mjs";import{a,o,r as s}from"./auth-DY_Y2bXC.mjs";import{t as c}from"./output-BqDR9h74.mjs";import{t as l}from"./dry-run-ILZRVpnp.mjs";import{t as u}from"./progress-jYW64HY7.mjs";import{n as d,t as f}from"./body-parser-BGVbwPeM.mjs";import{n as p,t as m}from"./input-validation-1esLElok.mjs";import{a as h,i as g,n as _}from"./prompt-CyATfGUu.mjs";import{t as v}from"./cli-types-C3nVfpSG.mjs";import{n as y}from"./raw-fetch-CNKIypJ7.mjs";import{_ as b,c as x,d as S,f as C,g as w,h as ee,i as T,l as E,m as D,n as O,o as k,p as A,r as j,s as M,t as N}from"./schema-flags-CTfQVGCs.mjs";const P=`ai-model-schema`;async function F(e,t,n,r){let i=w(P,[t,e]);if(i)return{ok:!0,schema:i};let a;try{let i=await n();if(r===void 0)a=await i.ai.getModelSchema({account_id:t,model:e});else{let n=r-Date.now();if(n<=0)return{ok:!1,reason:`the request timed out`};a=await i.ai.getModelSchema({account_id:t,model:e},{timeoutInSeconds:n/1e3,maxRetries:0})}}catch(e){return{ok:!1,reason:D(e)}}let o=ee(a,`input`);return o?(b(P,[t,e],o),{ok:!0,schema:o}):{ok:!1,reason:`the API returned no input schema`}}const I="Run `cf ai models list` to see the models you can run.",L=[`model-name`,`modelName`];let R;function z(e){return R=e,e.positional(`model-name`,{type:`string`,description:`Model ID, e.g. @cf/meta/llama-3.1-8b-instruct`}).option(`body`,{type:`string`,description:`Raw JSON request body, or @path to a JSON file`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).strictOptions(!1).help(!1).option(`help`,{type:`boolean`,alias:`h`,description:`Show help, including this model's input flags`}).epilogue(`Input flags depend on the model: run \`cf ai run <model> --help\`.\n${I}`)}async function B(n){n.local&&console.log(`${t}\n`),R?.showHelp(`log`);let r=n[`model-name`];if(!r||n.local)return;let i=Date.now()+A,a=await o(i);if(!a){console.log(`\n${e.muted(`Set \`CLOUDFLARE_ACCOUNT_ID\` or sign in with \`cf auth login\` to see the input flags for ${r}.`)}`);return}let c=await F(r,a,()=>s(n),i);console.log(c.ok?`\n${k(x(c.schema),`Input flags for ${r}`)}`:`\n${e.muted(`Could not load the input flags for ${r}: ${c.reason}.`)}`)}const V={command:`run [model-name]`,describe:"Run inference on a Workers AI model. Input flags are model-specific — see `cf ai run <model> --help`",builder:z,handler:async e=>{if(e.help){await B(e);return}if(e.local)throw Error(t);let n=e[`model-name`];if(!n)throw Error(`A model is required: cf ai run <model>. ${I}`);let o=e.dryRun?await i()??`<account-id>`:await r(),f=n.split(`/`).map(encodeURIComponent).join(`/`),p;if(e.body!==void 0){if(E(e,L).length>0)throw Error(`--body cannot be combined with model input flags. Pass one or the other.`);p=d(e.body)}else{let t=await F(n,o,()=>s(e));if(!t.ok)throw Error(`Could not load the input schema for ${n}: ${t.reason}.\nPass the request body directly instead: cf ai run ${n} --body '{…}'`);let r=x(t.schema),i=E(e,[...L,...O(r)]);if(i.length>0)throw Error(`${i.map(e=>`Unknown flag --${e}`).join(`
|
|
3
|
+
`)}\n\nRun \`cf ai run ${n} --help\` for this model's input flags.`);let a=new Set;for(;;){let t=T(r,e).find(e=>!a.has(e.name)&&(e.choices!==void 0||e.type===`string`));if(!t)break;a.add(t.name),t.choices?e[t.name]=await g(t.name,M(t),t.choices,t.choiceLabels):e[t.name]=await h(t.name,M(t))}let c=j(t.schema),l=N(r,e,{reserved:L}),u=l.errors.length===0?c?S(t.schema,l.body):C(t.schema,l.body):l.errors;if(u.length>0)throw Error(`${u.join(`
|
|
4
|
+
`)}\n\nRun \`cf ai run ${n} --help\` for this model's input flags.`);p=l.body}if(e.dryRun){l({command:`cf ai run`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${o}/ai/run/${f}`,pathParams:{"model-name":n},bodyKind:`json`,body:p});return}let m=await s(e);e.accountId=o;let _=await u(`Running`,async()=>a(m,`POST`,`/accounts/${o}/ai/run/${f}`,{body:p,preserveNonJsonBytes:!0}));if(Buffer.isBuffer(_)){y(_);return}c(_,{successLabel:`Ran`})}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Searches Workers AI models by author or organization name.`,builder:H,handler:async e=>{if(e.dryRun){l({command:`cf ai authors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/authors/search`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.authors.list({account_id:a})),{successLabel:`Loaded`})}},W={command:`authors`,describe:`Operations for authors`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Finetune asset file upload.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`file-name`,{type:`string`,description:`Name of the file (adapter_config.json or adapter_model.safetensors).`})}const K={command:`create <finetune-id>`,describe:`Uploads training data assets for a Workers AI fine-tuning job.`,builder:G,handler:async e=>{if(e.dryRun){l({command:`cf ai finetunes assets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,pathParams:{"finetune-id":String(e[`finetune-id`]??``)},bodyKind:`multipart`,body:{body:e.body,file:e.file,"file-name":e[`file-name`]}});return}let t=await s(e),o=e.local?n:await r();if(e.accountId=o,e.file!==void 0||e.body!==void 0||e[`file-name`]!==void 0){let n=new FormData;if(e.file){let t=m(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);e[`file-name`]!==void 0&&n.append(`file_name`,String(p(e[`file-name`],`file-name`,`text`)??``)),c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/finetunes/${encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=p(e.body,`body`,`binary`);c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/finetunes/${encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function q(e){return e.positional(`file-name`,{type:`string`,description:`File name`,demandOption:!0}).option(`finetune-id`,{type:`string`,description:`Finetune ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`download <file-name>`,describe:`Returns a pre-signed R2 URL for downloading a finetune asset file.`,builder:q,handler:async e=>{if(e.dryRun){l({command:`cf ai finetunes assets download`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}/finetune-assets/${e[`file-name`]==null?`<file-name>`:encodeURIComponent(String(e[`file-name`]))}`,pathParams:{"finetune-id":String(e[`finetune-id`]??``),"file-name":String(e[`file-name`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.finetunes.assets.download({account_id:a,finetune_id:e[`finetune-id`],file_name:e[`file-name`]})),{successLabel:`Loaded`})}},te={command:`assets`,describe:`Operations for finetunes.assets`,builder:e=>e.command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.option(`description`,{type:`string`,description:`The description field`}).option(`model`,{type:`string`,description:`The model field`}).option(`name`,{type:`string`,description:`The name field`}).option(`public`,{type:`boolean`,description:`The public field`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`create`,describe:`Creates a new fine-tuning job for a Workers AI model using custom training data.`,builder:Y,handler:async e=>{if(e.dryRun){l({command:`cf ai finetunes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`json`,body:e.body===void 0?f({description:p(e.description,`description`,`text`),model:p(e.model,`model`,`text`),name:p(e.name,`name`,`text`),public:e.public}):d(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=d(e.body);c(await u(`Creating`,async()=>t.ai.finetunes.create({...n,account_id:a})),{successLabel:`Created`});return}e.model===void 0&&(e.model=await h(`model`,`The model field`)),e.name===void 0&&(e.name=await h(`name`,`The name field`));let o=f({description:p(e.description,`description`,`text`),model:p(e.model,`model`,`text`),name:p(e.name,`name`,`text`),public:e.public});c(await u(`Creating`,async()=>t.ai.finetunes.create({...o,account_id:a})),{successLabel:`Created`})}};function Z(e){return e.positional(`finetune-id`,{type:`string`,description:`Finetune 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 Q={command:`delete <finetune-id>`,describe:`Delete a finetune. Any in-flight requests referencing the lora will fail after the files are deleted.`,builder:Z,handler:async e=>{if(e.dryRun){l({command:`cf ai finetunes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes/${e[`finetune-id`]==null?`<finetune-id>`:encodeURIComponent(String(e[`finetune-id`]))}`,pathParams:{"finetune-id":String(e[`finetune-id`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}c(await u(`Deleting`,async()=>t.ai.finetunes.delete({account_id:a,finetune_id:e[`finetune-id`]})),{successLabel:`Deleted`})}};function ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`list`,describe:`Lists all fine-tuning jobs created by the account, including status and metrics.`,builder:ne,handler:async e=>{if(e.dryRun){l({command:`cf ai finetunes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.finetunes.list({account_id:a})),{successLabel:`Loaded`})}};function ie(e){return e.option(`limit`,{type:`number`,description:`Pagination Limit.`}).option(`offset`,{type:`number`,description:`Pagination Offset.`}).option(`order-by`,{type:`string`,description:`Order By Column Name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`Lists publicly available fine-tuned models that can be used with Workers AI.`,builder:ie,handler:async e=>{let t={limit:e.limit,offset:e.offset,orderBy:e[`order-by`]};if(e.dryRun){l({command:`cf ai finetunes public list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/finetunes/public`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.ai.finetunes.public.list({account_id:o,...t})),{successLabel:`Loaded`})}},oe={command:`public`,describe:`Operations for finetunes.public`,builder:e=>e.command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},se={command:`finetunes`,describe:`Operations for finetunes`,builder:e=>e.command(X).command(Q).command(re).command(te).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.option(`model`,{type:`string`,description:`Model Name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`getModelSchema`,describe:`Retrieves the input and output JSON schema definition for a Workers AI model.`,builder:ce,handler:async e=>{let t={model:e.model};if(e.dryRun){l({command:`cf ai getModelSchema`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/models/schema`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.ai.getModelSchema({account_id:o,...t})),{successLabel:`Loaded`})}};function ue(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`listMarkdownSupportedFormats`,describe:`Lists all file formats supported for conversion to Markdown.`,builder:ue,handler:async e=>{if(e.dryRun){l({command:`cf ai listMarkdownSupportedFormats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/tomarkdown/supported`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.listMarkdownSupportedFormats({account_id:a})),{successLabel:`Loaded`})}};function fe(e){return e.option(`per-page`,{type:`number`,description:`Per page`}).option(`page`,{type:`number`,description:`Page`}).option(`task`,{type:`string`,description:`Filter by Task Name.`}).option(`author`,{type:`string`,description:`Filter by Author.`}).option(`source`,{type:`number`,description:`Filter by Source Id.`}).option(`hide-experimental`,{type:`boolean`,description:`Filter to hide experimental models.`}).option(`search`,{type:`string`,description:`Search.`}).option(`include-deprecated`,{type:`boolean`,description:`If true, include models for up to three months after their deprecation date. Defaults to false.`}).option(`format`,{type:`string`,description:`If set, return models in the requested marketplace format instead of the default response.`,choices:[`openrouter`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`Searches Workers AI models by name or description.`,builder:v(fe),handler:async e=>{let t={per_page:e[`per-page`],page:e.page,task:e.task,author:e.author,source:e.source,hide_experimental:e[`hide-experimental`],search:e.search,include_deprecated:e[`include-deprecated`],format:e.format};if(e.dryRun){l({command:`cf ai models list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/models/search`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,c(await u(`Loading`,async()=>a.ai.models.list({account_id:o,...t})),{successLabel:`Loaded`})}},$={command:`models`,describe:`Operations for models`,builder:e=>e.command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.positional(`model-name`,{type:`string`,description:`Model name`,demandOption:!0}).option(`text`,{type:`string`,description:`The text that you want to classify`}).option(`guidance`,{type:`number`,description:`Controls how closely the generated image should adhere to the prompt; higher values make the image more aligned with the prompt`}).option(`height`,{type:`number`,description:`The height of the generated image in pixels`}).option(`image`,{type:`string`,array:!0,description:`For use with img2img tasks. An array of integers that represent the image data constrained to 8-bit unsigned integer values`}).option(`image-b64`,{type:`string`,description:`For use with img2img tasks. A base64-encoded string of the input image`}).option(`mask`,{type:`string`,array:!0,description:`An array representing An array of integers that represent mask image data for inpainting constrained to 8-bit unsigned integer values`}).option(`negative-prompt`,{type:`string`,description:`Text describing elements to avoid in the generated image`}).option(`num-steps`,{type:`number`,description:`The number of diffusion steps; higher values can improve quality but take longer`}).option(`prompt`,{type:`string`,description:`A text description of the image you want to generate`}).option(`seed`,{type:`number`,description:`Random seed for reproducibility of the image generation`}).option(`strength`,{type:`number`,description:`A value between 0 and 1 indicating how strongly to apply the transformation during img2img tasks; lower values make the output closer to the input image`}).option(`width`,{type:`number`,description:`The width of the generated image in pixels`}).option(`lang`,{type:`string`,description:`The speech language (e.g., 'en' for English, 'fr' for French). Defaults to 'en' if not specified`}).option(`source-lang`,{type:`string`,description:`The language code of the source text (e.g., 'en' for English). Defaults to 'en' if not specified`}).option(`target-lang`,{type:`string`,description:`The language code to translate the text into (e.g., 'es' for Spanish)`}).option(`input-text`,{type:`string`,description:`The text that you want the model to summarize`}).option(`max-length`,{type:`number`,description:`The maximum length of the generated summary in tokens`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`text`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).conflicts(`guidance`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`height`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`image`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`,`prompt`]).conflicts(`image-b64`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`mask`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`negative-prompt`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`num-steps`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`prompt`,[`text`,`source-lang`,`target-lang`,`input-text`,`max-length`,`image`]).conflicts(`seed`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`strength`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`width`,[`text`,`lang`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`lang`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`seed`,`strength`,`width`,`source-lang`,`target-lang`,`input-text`,`max-length`]).conflicts(`source-lang`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).conflicts(`target-lang`,[`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`input-text`,`max-length`]).implies(`target-lang`,[`text`]).conflicts(`input-text`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`source-lang`,`target-lang`]).conflicts(`max-length`,[`text`,`guidance`,`height`,`image`,`image-b64`,`mask`,`negative-prompt`,`num-steps`,`prompt`,`seed`,`strength`,`width`,`lang`,`source-lang`,`target-lang`])}const he={command:`runModel <model-name>`,describe:`This endpoint provides users with the capability to run specific AI models on-demand. By submitting the required input data, users can receive real-time predictions or results generated by the chosen AI model. The endpoint supports various AI model types, ensuring flexibility and adaptability for diverse use cases. Model specific inputs available in [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).`,builder:me,handler:async e=>{if(e.dryRun){l({command:`cf ai runModel`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/run/${e[`model-name`]==null?`<model-name>`:encodeURIComponent(String(e[`model-name`]))}`,pathParams:{"model-name":String(e[`model-name`]??``)},bodyKind:`json`,body:e.body===void 0?f({text:p(e.text,`text`,`text`),guidance:e.guidance,height:e.height,image:e.image,image_b64:p(e[`image-b64`],`image-b64`,`text`),mask:e.mask,negative_prompt:p(e[`negative-prompt`],`negative-prompt`,`text`),num_steps:e[`num-steps`],prompt:p(e.prompt,`prompt`,`text`),seed:e.seed,strength:e.strength,width:e.width,lang:p(e.lang,`lang`,`text`),source_lang:p(e[`source-lang`],`source-lang`,`text`),target_lang:p(e[`target-lang`],`target-lang`,`text`),input_text:p(e[`input-text`],`input-text`,`text`),max_length:e[`max-length`]}):d(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=d(e.body);c(await u(`Creating`,async()=>t.ai.runModel({body:n,account_id:a,model_name:e[`model-name`]})),{successLabel:`Created`});return}let o=f({text:p(e.text,`text`,`text`),guidance:e.guidance,height:e.height,image:e.image,image_b64:p(e[`image-b64`],`image-b64`,`text`),mask:e.mask,negative_prompt:p(e[`negative-prompt`],`negative-prompt`,`text`),num_steps:e[`num-steps`],prompt:p(e.prompt,`prompt`,`text`),seed:e.seed,strength:e.strength,width:e.width,lang:p(e.lang,`lang`,`text`),source_lang:p(e[`source-lang`],`source-lang`,`text`),target_lang:p(e[`target-lang`],`target-lang`,`text`),input_text:p(e[`input-text`],`input-text`,`text`),max_length:e[`max-length`]});c(await u(`Creating`,async()=>t.ai.runModel({body:o,account_id:a,model_name:e[`model-name`]})),{successLabel:`Created`})}};function ge(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _e={command:`list`,describe:`Searches Workers AI models by task type (e.g., text-generation, embeddings).`,builder:ge,handler:async e=>{if(e.dryRun){l({command:`cf ai tasks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/tasks/search`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,c(await u(`Loading`,async()=>t.ai.tasks.list({account_id:a})),{successLabel:`Loaded`})}},ve={command:`tasks`,describe:`Operations for tasks`,builder:e=>e.command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(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`}).option(`files`,{type:`string`,description:`The files`})}const be={command:`toMarkdown`,describe:`Converts uploaded files into Markdown format using Workers AI.`,builder:ye,handler:async e=>{if(e.dryRun){l({command:`cf ai toMarkdown`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/ai/tomarkdown`,pathParams:{},bodyKind:`multipart`,body:{body:e.body,file:e.file,files:e.files}});return}let t=await s(e),o=e.local?n:await r();if(e.accountId=o,e.file!==void 0||e.body!==void 0||e.files!==void 0){let n=new FormData;if(e.file){let t=m(e.file);n.append(`file`,new Blob([t]),e.file.split(/[\\/]/).filter(Boolean).pop())}else e.body!==void 0&&n.append(`file`,e.body);if(e.files!==void 0){let t=typeof e.files==`string`?p(e.files,`files`,`text`):e.files;n.append(`files`,typeof t==`string`?t:JSON.stringify(t))}c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/tomarkdown`,{body:n})),{successLabel:`Created`});return}if(e.body){let n=p(e.body,`body`,`binary`);c(await u(`Creating`,async()=>a(t,`POST`,`/accounts/${o}/ai/tomarkdown`,{body:n,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(e.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},xe={command:`ai`,describe:`ai`,builder:e=>e.command(le).command(de).command(V).command(he).command(be).command(W).command(se).command($).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{xe as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{a as u,i as d,n as f}from"./prompt-CyATfGUu.mjs";import{n as p,t as m}from"./raw-fetch-CNKIypJ7.mjs";function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ee={command:`list`,describe:`Gets a list of all alert types for which an account is eligible.`,builder:h,handler:async s=>{if(s.dryRun){a({command:`cf alerting available-alerts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/available_alerts`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.alerting.availableAlerts.list({account_id:l})),{successLabel:`Loaded`})}},g={command:`available-alerts`,describe:`Operations for available-alerts`,builder:e=>e.command(ee).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`Get a list of all delivery mechanism types for which an account is eligible.`,builder:_,handler:async s=>{if(s.dryRun){a({command:`cf alerting destinations eligible get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/eligible`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.alerting.destinations.eligible.get({account_id:l})),{successLabel:`Loaded`})}},y={command:`eligible`,describe:`Operations for destinations.eligible`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`create`,describe:`Creates a new token for integrating with PagerDuty.`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf alerting destinations pagerduty create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/pagerduty/connect`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.alerting.destinations.pagerduty.create({account_id:l})),{successLabel:`Created`})}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete`,describe:`Deletes all the PagerDuty Services connected to the account.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf alerting destinations pagerduty delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/pagerduty`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes all PagerDuty services connected to the account.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.alerting.destinations.pagerduty.delete({account_id:l})),{successLabel:`Deleted`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Get a list of all configured PagerDuty services.`,builder:w,handler:async s=>{if(s.dryRun){a({command:`cf alerting destinations pagerduty get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/pagerduty`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.alerting.destinations.pagerduty.get({account_id:l})),{successLabel:`Loaded`})}};function E(e){return e.positional(`token-id`,{type:`string`,description:`The token integration key`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`link <token-id>`,describe:`Links PagerDuty with the account using the integration token.`,builder:E,handler:async s=>{if(s.dryRun){a({command:`cf alerting destinations pagerduty link`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/pagerduty/connect/${s[`token-id`]==null?`<token-id>`:encodeURIComponent(String(s[`token-id`]))}`,pathParams:{"token-id":String(s[`token-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.alerting.destinations.pagerduty.link({account_id:l,token_id:s[`token-id`]})),{successLabel:`Loaded`})}},O={command:`pagerduty`,describe:`Operations for destinations.pagerduty`,builder:e=>e.command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.option(`name`,{type:`string`,description:`The name of the webhook destination. This will be included in the request body when you receive a webhook notification.`}).option(`secret`,{type:`string`,description:"Optional secret that will be passed in the `cf-webhook-auth` header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body."}).option(`url`,{type:`string`,description:`The POST endpoint to call when dispatching a notification.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`create`,describe:`Creates a new webhook destination.`,builder:k,handler:async d=>{if(d.dryRun){a({command:`cf alerting destinations webhooks create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/webhooks`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`),secret:l(d.secret,`secret`,`text`),url:l(d.url,`url`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.alerting.destinations.webhooks.create({...e,account_id:p})),{successLabel:`Created`});return}d.name===void 0&&(d.name=await u(`name`,`The name of the webhook destination. This will be included in the request body when you receive a webhook notification.`)),d.url===void 0&&(d.url=await u(`url`,`The POST endpoint to call when dispatching a notification.`));let m=c({name:l(d.name,`name`,`text`),secret:l(d.secret,`secret`,`text`),url:l(d.url,`url`,`text`)});i(await o(`Creating`,async()=>f.alerting.destinations.webhooks.create({...m,account_id:p})),{successLabel:`Created`})}};function j(e){return e.positional(`webhook-id`,{type:`string`,description:`The unique identifier of a webhook`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const M={command:`delete <webhook-id>`,describe:`Delete a configured webhook destination.`,builder:j,handler:async s=>{if(s.dryRun){a({command:`cf alerting destinations webhooks delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes the webhook destination.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}i(await o(`Deleting`,async()=>c.alerting.destinations.webhooks.delete({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Deleted`})}};function N(e){return e.positional(`webhook-id`,{type:`string`,description:`The unique identifier of a webhook`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get <webhook-id>`,describe:`Get details for a single webhooks destination.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf alerting destinations webhooks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.alerting.destinations.webhooks.get({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Loaded`})}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Gets a list of all configured webhook destinations.`,builder:F,handler:async s=>{if(s.dryRun){a({command:`cf alerting destinations webhooks list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/webhooks`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.alerting.destinations.webhooks.list({account_id:l})),{successLabel:`Loaded`})}};function L(e){return e.positional(`webhook-id`,{type:`string`,description:`The unique identifier of a webhook`,demandOption:!0}).option(`name`,{type:`string`,description:`The name of the webhook destination. This will be included in the request body when you receive a webhook notification.`}).option(`secret`,{type:`string`,description:"Optional secret that will be passed in the `cf-webhook-auth` header when dispatching generic webhook notifications or formatted for supported destinations. Secrets are not returned in any API response body."}).option(`url`,{type:`string`,description:`The POST endpoint to call when dispatching a notification.`}).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:`update <webhook-id>`,describe:`Update a webhook destination.`,builder:L,handler:async d=>{if(d.dryRun){a({command:`cf alerting destinations webhooks update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/destinations/webhooks/${d[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(d[`webhook-id`]))}`,pathParams:{"webhook-id":String(d[`webhook-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({name:l(d.name,`name`,`text`),secret:l(d.secret,`secret`,`text`),url:l(d.url,`url`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.alerting.destinations.webhooks.update({...e,account_id:p,webhook_id:d[`webhook-id`]})),{successLabel:`Updated`});return}d.name===void 0&&(d.name=await u(`name`,`The name of the webhook destination. This will be included in the request body when you receive a webhook notification.`)),d.url===void 0&&(d.url=await u(`url`,`The POST endpoint to call when dispatching a notification.`));let m=c({name:l(d.name,`name`,`text`),secret:l(d.secret,`secret`,`text`),url:l(d.url,`url`,`text`)});i(await o(`Updating`,async()=>f.alerting.destinations.webhooks.update({...m,account_id:p,webhook_id:d[`webhook-id`]})),{successLabel:`Updated`})}},z={command:`webhooks`,describe:`Operations for destinations.webhooks`,builder:e=>e.command(A).command(M).command(P).command(I).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`destinations`,describe:`Operations for destinations`,builder:e=>e.command(y).command(O).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`before`,{type:`string`,description:`Limit the returned results to history records older than the specified date. This must be a timestamp that conforms to RFC3339.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`since`,{type:`string`,description:`Limit the returned results to history records newer than the specified date. This must be a timestamp that conforms to RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`list`,describe:"Gets a list of history records for notifications sent to an account. The records are displayed for last `x` number of days based on the zone plan (free = 30, pro = 30, biz = 30, ent = 90).",builder:V,handler:async s=>{let c={per_page:s[`per-page`],before:s.before,page:s.page,since:s.since};if(s.dryRun){a({command:`cf alerting history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.alerting.history.list({account_id:u,...c})),{successLabel:`Loaded`})}},U={command:`history`,describe:`Operations for history`,builder:e=>e.command(H).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function te(e){return e.option(`alert-interval`,{type:`string`,description:`Optional specification of how often to re-alert from the same incident, not support on all alert types.`}).option(`alert-type`,{type:`string`,description:`Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.`,choices:`abuse_report_alert.access_custom_certificate_expiration_type.advanced_ddos_attack_l4_alert.advanced_ddos_attack_l7_alert.advanced_http_alert_error.bgp_hijack_notification.billing_usage_alert.block_notification_block_removed.block_notification_new_block.block_notification_review_rejected.bot_traffic_basic_alert.brand_protection_alert.brand_protection_digest.clickhouse_alert_fw_anomaly.clickhouse_alert_fw_ent_anomaly.cloudforce_one_request_notification.cni_maintenance_notification.custom_analytics.custom_bot_detection_alert.custom_ssl_certificate_event_type.dedicated_ssl_certificate_event_type.device_connectivity_anomaly_alert.dos_attack_l4.dos_attack_l7.expiring_service_token_alert.failing_logpush_job_disabled_alert.fbm_auto_advertisement.fbm_dosd_attack.fbm_volumetric_attack.health_check_status_notification.hostname_aop_custom_certificate_expiration_type.http_alert_edge_error.http_alert_origin_error.image_notification.image_resizing_notification.incident_alert.load_balancing_health_alert.load_balancing_pool_enablement_alert.logo_match_alert.magic_tunnel_health_check_event.magic_wan_tunnel_health.maintenance_event_notification.mtls_certificate_store_certificate_expiration_type.pages_event_alert.radar_notification.real_origin_monitoring.scriptmonitor_alert_new_code_change_detections.scriptmonitor_alert_new_hosts.scriptmonitor_alert_new_malicious_hosts.scriptmonitor_alert_new_malicious_scripts.scriptmonitor_alert_new_malicious_url.scriptmonitor_alert_new_max_length_resource_url.scriptmonitor_alert_new_resources.secondary_dns_all_primaries_failing.secondary_dns_primaries_failing.secondary_dns_warning.secondary_dns_zone_successfully_updated.secondary_dns_zone_validation_warning.security_insights_alert.sentinel_alert.stream_live_notifications.synthetic_test_latency_alert.synthetic_test_low_availability_alert.traffic_anomalies_alert.tunnel_health_event.tunnel_update_event.universal_ssl_event_type.web_analytics_metrics_update.zone_aop_custom_certificate_expiration_type`.split(`.`)}).option(`description`,{type:`string`,description:`Optional description for the Notification policy.`}).option(`enabled`,{type:`boolean`,description:`Whether or not the Notification policy is enabled.`,default:!0}).option(`filters-actions`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-affected-asns`,{type:`string`,array:!0,description:`Used for configuring radar_notification`}).option(`filters-affected-components`,{type:`string`,array:!0,description:`Used for configuring incident_alert`}).option(`filters-affected-locations`,{type:`string`,array:!0,description:`Used for configuring radar_notification`}).option(`filters-airport-code`,{type:`string`,array:!0,description:`Used for configuring maintenance_event_notification`}).option(`filters-alert-trigger-preferences`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-alert-trigger-preferences-value`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-enabled`,{type:`string`,array:!0,description:`Used for configuring load_balancing_pool_enablement_alert`}).option(`filters-environment`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-event`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-event-source`,{type:`string`,array:!0,description:`Used for configuring load_balancing_health_alert`}).option(`filters-event-type`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-group-by`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-health-check-id`,{type:`string`,array:!0,description:`Used for configuring health_check_status_notification`}).option(`filters-incident-impact`,{type:`string`,array:!0,description:`Used for configuring incident_alert`}).option(`filters-input-id`,{type:`string`,array:!0,description:`Used for configuring stream_live_notifications`}).option(`filters-insight-class`,{type:`string`,array:!0,description:`Used for configuring security_insights_alert`}).option(`filters-limit`,{type:`string`,array:!0,description:`Used for configuring billing_usage_alert`}).option(`filters-logo-tag`,{type:`string`,array:!0,description:`Used for configuring logo_match_alert`}).option(`filters-megabits-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-new-health`,{type:`string`,array:!0,description:`Used for configuring load_balancing_health_alert`}).option(`filters-new-status`,{type:`string`,array:!0,description:`Used for configuring tunnel_health_event`}).option(`filters-packets-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-pool-id`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-pop-names`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-product`,{type:`string`,array:!0,description:`Used for configuring billing_usage_alert`}).option(`filters-project-id`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-protocol`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-query-tag`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-requests-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-selectors`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-services`,{type:`string`,array:!0,description:`Used for configuring clickhouse_alert_fw_ent_anomaly`}).option(`filters-slo`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-status`,{type:`string`,array:!0,description:`Used for configuring health_check_status_notification`}).option(`filters-target-hostname`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-target-ip`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-target-zone-name`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-traffic-exclusions`,{type:`string`,array:!0,description:`Used for configuring traffic_anomalies_alert`}).option(`filters-tunnel-id`,{type:`string`,array:!0,description:`Used for configuring tunnel_health_event`}).option(`filters-tunnel-name`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-type`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-where`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-zones`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`name`,{type:`string`,description:`Name of the policy.`}).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:`Creates a new Notification policy.`,builder:te,handler:async f=>{if(f.dryRun){a({command:`cf alerting policies create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/policies`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({alert_interval:l(f[`alert-interval`],`alert-interval`,`text`),alert_type:l(f[`alert-type`],`alert-type`,`text`),description:l(f.description,`description`,`text`),enabled:f.enabled,filters:{actions:f[`filters-actions`],affected_asns:f[`filters-affected-asns`],affected_components:f[`filters-affected-components`],affected_locations:f[`filters-affected-locations`],airport_code:f[`filters-airport-code`],alert_trigger_preferences:f[`filters-alert-trigger-preferences`],alert_trigger_preferences_value:f[`filters-alert-trigger-preferences-value`],enabled:f[`filters-enabled`],environment:f[`filters-environment`],event:f[`filters-event`],event_source:f[`filters-event-source`],event_type:f[`filters-event-type`],group_by:f[`filters-group-by`],health_check_id:f[`filters-health-check-id`],incident_impact:f[`filters-incident-impact`],input_id:f[`filters-input-id`],insight_class:f[`filters-insight-class`],limit:f[`filters-limit`],logo_tag:f[`filters-logo-tag`],megabits_per_second:f[`filters-megabits-per-second`],new_health:f[`filters-new-health`],new_status:f[`filters-new-status`],packets_per_second:f[`filters-packets-per-second`],pool_id:f[`filters-pool-id`],pop_names:f[`filters-pop-names`],product:f[`filters-product`],project_id:f[`filters-project-id`],protocol:f[`filters-protocol`],query_tag:f[`filters-query-tag`],requests_per_second:f[`filters-requests-per-second`],selectors:f[`filters-selectors`],services:f[`filters-services`],slo:f[`filters-slo`],status:f[`filters-status`],target_hostname:f[`filters-target-hostname`],target_ip:f[`filters-target-ip`],target_zone_name:f[`filters-target-zone-name`],traffic_exclusions:f[`filters-traffic-exclusions`],tunnel_id:f[`filters-tunnel-id`],tunnel_name:f[`filters-tunnel-name`],type:f[`filters-type`],where:f[`filters-where`],zones:f[`filters-zones`]},name:l(f.name,`name`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.alerting.policies.create({...e,account_id:m})),{successLabel:`Created`});return}if(f[`alert-type`]===void 0&&(f[`alert-type`]=await d(`alert-type`,`Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.`,`abuse_report_alert.access_custom_certificate_expiration_type.advanced_ddos_attack_l4_alert.advanced_ddos_attack_l7_alert.advanced_http_alert_error.bgp_hijack_notification.billing_usage_alert.block_notification_block_removed.block_notification_new_block.block_notification_review_rejected.bot_traffic_basic_alert.brand_protection_alert.brand_protection_digest.clickhouse_alert_fw_anomaly.clickhouse_alert_fw_ent_anomaly.cloudforce_one_request_notification.cni_maintenance_notification.custom_analytics.custom_bot_detection_alert.custom_ssl_certificate_event_type.dedicated_ssl_certificate_event_type.device_connectivity_anomaly_alert.dos_attack_l4.dos_attack_l7.expiring_service_token_alert.failing_logpush_job_disabled_alert.fbm_auto_advertisement.fbm_dosd_attack.fbm_volumetric_attack.health_check_status_notification.hostname_aop_custom_certificate_expiration_type.http_alert_edge_error.http_alert_origin_error.image_notification.image_resizing_notification.incident_alert.load_balancing_health_alert.load_balancing_pool_enablement_alert.logo_match_alert.magic_tunnel_health_check_event.magic_wan_tunnel_health.maintenance_event_notification.mtls_certificate_store_certificate_expiration_type.pages_event_alert.radar_notification.real_origin_monitoring.scriptmonitor_alert_new_code_change_detections.scriptmonitor_alert_new_hosts.scriptmonitor_alert_new_malicious_hosts.scriptmonitor_alert_new_malicious_scripts.scriptmonitor_alert_new_malicious_url.scriptmonitor_alert_new_max_length_resource_url.scriptmonitor_alert_new_resources.secondary_dns_all_primaries_failing.secondary_dns_primaries_failing.secondary_dns_warning.secondary_dns_zone_successfully_updated.secondary_dns_zone_validation_warning.security_insights_alert.sentinel_alert.stream_live_notifications.synthetic_test_latency_alert.synthetic_test_low_availability_alert.traffic_anomalies_alert.tunnel_health_event.tunnel_update_event.universal_ssl_event_type.web_analytics_metrics_update.zone_aop_custom_certificate_expiration_type`.split(`.`))),f.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);f.name===void 0&&(f.name=await u(`name`,`Name of the policy.`));let h=c({alert_interval:l(f[`alert-interval`],`alert-interval`,`text`),alert_type:l(f[`alert-type`],`alert-type`,`text`),description:l(f.description,`description`,`text`),enabled:f.enabled,filters:{actions:f[`filters-actions`],affected_asns:f[`filters-affected-asns`],affected_components:f[`filters-affected-components`],affected_locations:f[`filters-affected-locations`],airport_code:f[`filters-airport-code`],alert_trigger_preferences:f[`filters-alert-trigger-preferences`],alert_trigger_preferences_value:f[`filters-alert-trigger-preferences-value`],enabled:f[`filters-enabled`],environment:f[`filters-environment`],event:f[`filters-event`],event_source:f[`filters-event-source`],event_type:f[`filters-event-type`],group_by:f[`filters-group-by`],health_check_id:f[`filters-health-check-id`],incident_impact:f[`filters-incident-impact`],input_id:f[`filters-input-id`],insight_class:f[`filters-insight-class`],limit:f[`filters-limit`],logo_tag:f[`filters-logo-tag`],megabits_per_second:f[`filters-megabits-per-second`],new_health:f[`filters-new-health`],new_status:f[`filters-new-status`],packets_per_second:f[`filters-packets-per-second`],pool_id:f[`filters-pool-id`],pop_names:f[`filters-pop-names`],product:f[`filters-product`],project_id:f[`filters-project-id`],protocol:f[`filters-protocol`],query_tag:f[`filters-query-tag`],requests_per_second:f[`filters-requests-per-second`],selectors:f[`filters-selectors`],services:f[`filters-services`],slo:f[`filters-slo`],status:f[`filters-status`],target_hostname:f[`filters-target-hostname`],target_ip:f[`filters-target-ip`],target_zone_name:f[`filters-target-zone-name`],traffic_exclusions:f[`filters-traffic-exclusions`],tunnel_id:f[`filters-tunnel-id`],tunnel_name:f[`filters-tunnel-name`],type:f[`filters-type`],where:f[`filters-where`],zones:f[`filters-zones`]},name:l(f.name,`name`,`text`)});i(await o(`Creating`,async()=>p.alerting.policies.create({...h,account_id:m})),{successLabel:`Created`})}};function G(e){return e.positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,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 K={command:`delete <policy-id>`,describe:`Delete a Notification policy.`,builder:G,handler:async s=>{if(s.dryRun){a({command:`cf alerting policies delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes the notification policy.`})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}i(await o(`Deleting`,async()=>c.alerting.policies.delete({account_id:l,policy_id:s[`policy-id`]})),{successLabel:`Deleted`})}};function q(e){return e.positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`email`,{type:`string`,description:`Email`,demandOption:!0}).option(`token`,{type:`string`,description:`Token`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`details <policy-id>`,describe:`Shows details for unsubscribing an email address from a notification policy.`,builder:q,handler:async i=>{let s={email:i.email,token:i.token};if(i.dryRun){a({command:`cf alerting policies email details`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/policies/${i[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(i[`policy-id`]))}/email/unsubscribe`,pathParams:{"policy-id":String(i[`policy-id`]??``)},query:s,bodyKind:`none`});return}await r(i);let c=i.local?e:await t();i.accountId=c;let l=new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();p((await o(`Loading`,async()=>m(`/accounts/${c}/alerting/v3/policies/${encodeURIComponent(String(i[`policy-id`]))}/email/unsubscribe${l?`?`+l:``}`,{method:`GET`,local:i.local===!0,persistTo:i.persistTo}))).toString(`utf-8`))}};function Y(e){return e.positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`email`,{type:`string`,description:`Email`,demandOption:!0}).option(`token`,{type:`string`,description:`Token`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`unsubscribe <policy-id>`,describe:`Unsubscribes an email address from a notification policy.`,builder:Y,handler:async i=>{let s={email:i.email,token:i.token};if(i.dryRun){a({command:`cf alerting policies email unsubscribe`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/policies/${i[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(i[`policy-id`]))}/email/unsubscribe`,pathParams:{"policy-id":String(i[`policy-id`]??``)},query:s,bodyKind:`none`});return}await r(i);let c=i.local?e:await t();i.accountId=c;let l=new URLSearchParams(Object.entries(s).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();p((await o(`Creating`,async()=>m(`/accounts/${c}/alerting/v3/policies/${encodeURIComponent(String(i[`policy-id`]))}/email/unsubscribe${l?`?`+l:``}`,{method:`POST`,local:i.local===!0,persistTo:i.persistTo}))).toString(`utf-8`))}},Z={command:`email`,describe:`Operations for policies.email`,builder:e=>e.command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <policy-id>`,describe:`Get details for a single policy.`,builder:Q,handler:async s=>{if(s.dryRun){a({command:`cf alerting policies get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.alerting.policies.get({account_id:l,policy_id:s[`policy-id`]})),{successLabel:`Loaded`})}};function re(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`list`,describe:`Get a list of all Notification policies.`,builder:re,handler:async s=>{if(s.dryRun){a({command:`cf alerting policies list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/policies`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.alerting.policies.list({account_id:l})),{successLabel:`Loaded`})}};function ae(e){return e.positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`severity`,{type:`number`,description:`Severity level for the test alert. Defaults to INFO (1) if omitted.`}).option(`source`,{type:`string`,description:`Source identifier for the test alert.`}).option(`state-correlation-id`,{type:`string`,description:`Correlation ID for stateful test alerts. Required when state_event is set.`}).option(`state-event`,{type:`number`,description:`State event type for stateful test alerts. Use with state_correlation_id.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Optional configuration for the test notification. When omitted, a default INFO-severity test alert is sent.`})}const oe={command:`test <policy-id>`,describe:`Send a test notification for a policy to verify delivery mechanisms are working as expected.`,builder:ae,handler:async u=>{if(u.dryRun){a({command:`cf alerting policies test`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/policies/${u[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(u[`policy-id`]))}/test`,pathParams:{"policy-id":String(u[`policy-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({severity:u.severity,source:l(u.source,`source`,`text`),state_correlation_id:l(u[`state-correlation-id`],`state-correlation-id`,`text`),state_event:u[`state-event`]}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.alerting.policies.test({...e,account_id:f,policy_id:u[`policy-id`]})),{successLabel:`Created`});return}let p=c({severity:u.severity,source:l(u.source,`source`,`text`),state_correlation_id:l(u[`state-correlation-id`],`state-correlation-id`,`text`),state_event:u[`state-event`]});i(await o(`Creating`,async()=>d.alerting.policies.test({...p,account_id:f,policy_id:u[`policy-id`]})),{successLabel:`Created`})}};function se(e){return e.positional(`policy-id`,{type:`string`,description:`The unique identifier of a notification policy`,demandOption:!0}).option(`alert-interval`,{type:`string`,description:`Optional specification of how often to re-alert from the same incident, not support on all alert types.`}).option(`alert-type`,{type:`string`,description:`Refers to which event will trigger a Notification dispatch. You can use the endpoint to get available alert types which then will give you a list of possible values.`,choices:`abuse_report_alert.access_custom_certificate_expiration_type.advanced_ddos_attack_l4_alert.advanced_ddos_attack_l7_alert.advanced_http_alert_error.bgp_hijack_notification.billing_usage_alert.block_notification_block_removed.block_notification_new_block.block_notification_review_rejected.bot_traffic_basic_alert.brand_protection_alert.brand_protection_digest.clickhouse_alert_fw_anomaly.clickhouse_alert_fw_ent_anomaly.cloudforce_one_request_notification.cni_maintenance_notification.custom_analytics.custom_bot_detection_alert.custom_ssl_certificate_event_type.dedicated_ssl_certificate_event_type.device_connectivity_anomaly_alert.dos_attack_l4.dos_attack_l7.expiring_service_token_alert.failing_logpush_job_disabled_alert.fbm_auto_advertisement.fbm_dosd_attack.fbm_volumetric_attack.health_check_status_notification.hostname_aop_custom_certificate_expiration_type.http_alert_edge_error.http_alert_origin_error.image_notification.image_resizing_notification.incident_alert.load_balancing_health_alert.load_balancing_pool_enablement_alert.logo_match_alert.magic_tunnel_health_check_event.magic_wan_tunnel_health.maintenance_event_notification.mtls_certificate_store_certificate_expiration_type.pages_event_alert.radar_notification.real_origin_monitoring.scriptmonitor_alert_new_code_change_detections.scriptmonitor_alert_new_hosts.scriptmonitor_alert_new_malicious_hosts.scriptmonitor_alert_new_malicious_scripts.scriptmonitor_alert_new_malicious_url.scriptmonitor_alert_new_max_length_resource_url.scriptmonitor_alert_new_resources.secondary_dns_all_primaries_failing.secondary_dns_primaries_failing.secondary_dns_warning.secondary_dns_zone_successfully_updated.secondary_dns_zone_validation_warning.security_insights_alert.sentinel_alert.stream_live_notifications.synthetic_test_latency_alert.synthetic_test_low_availability_alert.traffic_anomalies_alert.tunnel_health_event.tunnel_update_event.universal_ssl_event_type.web_analytics_metrics_update.zone_aop_custom_certificate_expiration_type`.split(`.`)}).option(`description`,{type:`string`,description:`Optional description for the Notification policy.`}).option(`enabled`,{type:`boolean`,description:`Whether or not the Notification policy is enabled.`}).option(`filters-actions`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-affected-asns`,{type:`string`,array:!0,description:`Used for configuring radar_notification`}).option(`filters-affected-components`,{type:`string`,array:!0,description:`Used for configuring incident_alert`}).option(`filters-affected-locations`,{type:`string`,array:!0,description:`Used for configuring radar_notification`}).option(`filters-airport-code`,{type:`string`,array:!0,description:`Used for configuring maintenance_event_notification`}).option(`filters-alert-trigger-preferences`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-alert-trigger-preferences-value`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-enabled`,{type:`string`,array:!0,description:`Used for configuring load_balancing_pool_enablement_alert`}).option(`filters-environment`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-event`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-event-source`,{type:`string`,array:!0,description:`Used for configuring load_balancing_health_alert`}).option(`filters-event-type`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-group-by`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-health-check-id`,{type:`string`,array:!0,description:`Used for configuring health_check_status_notification`}).option(`filters-incident-impact`,{type:`string`,array:!0,description:`Used for configuring incident_alert`}).option(`filters-input-id`,{type:`string`,array:!0,description:`Used for configuring stream_live_notifications`}).option(`filters-insight-class`,{type:`string`,array:!0,description:`Used for configuring security_insights_alert`}).option(`filters-limit`,{type:`string`,array:!0,description:`Used for configuring billing_usage_alert`}).option(`filters-logo-tag`,{type:`string`,array:!0,description:`Used for configuring logo_match_alert`}).option(`filters-megabits-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-new-health`,{type:`string`,array:!0,description:`Used for configuring load_balancing_health_alert`}).option(`filters-new-status`,{type:`string`,array:!0,description:`Used for configuring tunnel_health_event`}).option(`filters-packets-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-pool-id`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-pop-names`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-product`,{type:`string`,array:!0,description:`Used for configuring billing_usage_alert`}).option(`filters-project-id`,{type:`string`,array:!0,description:`Used for configuring pages_event_alert`}).option(`filters-protocol`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-query-tag`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-requests-per-second`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-selectors`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-services`,{type:`string`,array:!0,description:`Used for configuring clickhouse_alert_fw_ent_anomaly`}).option(`filters-slo`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-status`,{type:`string`,array:!0,description:`Used for configuring health_check_status_notification`}).option(`filters-target-hostname`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-target-ip`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l4_alert`}).option(`filters-target-zone-name`,{type:`string`,array:!0,description:`Used for configuring advanced_ddos_attack_l7_alert`}).option(`filters-traffic-exclusions`,{type:`string`,array:!0,description:`Used for configuring traffic_anomalies_alert`}).option(`filters-tunnel-id`,{type:`string`,array:!0,description:`Used for configuring tunnel_health_event`}).option(`filters-tunnel-name`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-type`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-where`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`filters-zones`,{type:`string`,array:!0,description:`Usage depends on specific alert type`}).option(`name`,{type:`string`,description:`Name of the policy.`}).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 ce={command:`update <policy-id>`,describe:`Update a Notification policy.`,builder:se,handler:async u=>{if(u.dryRun){a({command:`cf alerting policies update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/policies/${u[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(u[`policy-id`]))}`,pathParams:{"policy-id":String(u[`policy-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({alert_interval:l(u[`alert-interval`],`alert-interval`,`text`),alert_type:l(u[`alert-type`],`alert-type`,`text`),description:l(u.description,`description`,`text`),enabled:u.enabled,filters:{actions:u[`filters-actions`],affected_asns:u[`filters-affected-asns`],affected_components:u[`filters-affected-components`],affected_locations:u[`filters-affected-locations`],airport_code:u[`filters-airport-code`],alert_trigger_preferences:u[`filters-alert-trigger-preferences`],alert_trigger_preferences_value:u[`filters-alert-trigger-preferences-value`],enabled:u[`filters-enabled`],environment:u[`filters-environment`],event:u[`filters-event`],event_source:u[`filters-event-source`],event_type:u[`filters-event-type`],group_by:u[`filters-group-by`],health_check_id:u[`filters-health-check-id`],incident_impact:u[`filters-incident-impact`],input_id:u[`filters-input-id`],insight_class:u[`filters-insight-class`],limit:u[`filters-limit`],logo_tag:u[`filters-logo-tag`],megabits_per_second:u[`filters-megabits-per-second`],new_health:u[`filters-new-health`],new_status:u[`filters-new-status`],packets_per_second:u[`filters-packets-per-second`],pool_id:u[`filters-pool-id`],pop_names:u[`filters-pop-names`],product:u[`filters-product`],project_id:u[`filters-project-id`],protocol:u[`filters-protocol`],query_tag:u[`filters-query-tag`],requests_per_second:u[`filters-requests-per-second`],selectors:u[`filters-selectors`],services:u[`filters-services`],slo:u[`filters-slo`],status:u[`filters-status`],target_hostname:u[`filters-target-hostname`],target_ip:u[`filters-target-ip`],target_zone_name:u[`filters-target-zone-name`],traffic_exclusions:u[`filters-traffic-exclusions`],tunnel_id:u[`filters-tunnel-id`],tunnel_name:u[`filters-tunnel-name`],type:u[`filters-type`],where:u[`filters-where`],zones:u[`filters-zones`]},name:l(u.name,`name`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.alerting.policies.update({...e,account_id:f,policy_id:u[`policy-id`]})),{successLabel:`Updated`});return}let p=c({alert_interval:l(u[`alert-interval`],`alert-interval`,`text`),alert_type:l(u[`alert-type`],`alert-type`,`text`),description:l(u.description,`description`,`text`),enabled:u.enabled,filters:{actions:u[`filters-actions`],affected_asns:u[`filters-affected-asns`],affected_components:u[`filters-affected-components`],affected_locations:u[`filters-affected-locations`],airport_code:u[`filters-airport-code`],alert_trigger_preferences:u[`filters-alert-trigger-preferences`],alert_trigger_preferences_value:u[`filters-alert-trigger-preferences-value`],enabled:u[`filters-enabled`],environment:u[`filters-environment`],event:u[`filters-event`],event_source:u[`filters-event-source`],event_type:u[`filters-event-type`],group_by:u[`filters-group-by`],health_check_id:u[`filters-health-check-id`],incident_impact:u[`filters-incident-impact`],input_id:u[`filters-input-id`],insight_class:u[`filters-insight-class`],limit:u[`filters-limit`],logo_tag:u[`filters-logo-tag`],megabits_per_second:u[`filters-megabits-per-second`],new_health:u[`filters-new-health`],new_status:u[`filters-new-status`],packets_per_second:u[`filters-packets-per-second`],pool_id:u[`filters-pool-id`],pop_names:u[`filters-pop-names`],product:u[`filters-product`],project_id:u[`filters-project-id`],protocol:u[`filters-protocol`],query_tag:u[`filters-query-tag`],requests_per_second:u[`filters-requests-per-second`],selectors:u[`filters-selectors`],services:u[`filters-services`],slo:u[`filters-slo`],status:u[`filters-status`],target_hostname:u[`filters-target-hostname`],target_ip:u[`filters-target-ip`],target_zone_name:u[`filters-target-zone-name`],traffic_exclusions:u[`filters-traffic-exclusions`],tunnel_id:u[`filters-tunnel-id`],tunnel_name:u[`filters-tunnel-name`],type:u[`filters-type`],where:u[`filters-where`],zones:u[`filters-zones`]},name:l(u.name,`name`,`text`)});i(await o(`Updating`,async()=>d.alerting.policies.update({...p,account_id:f,policy_id:u[`policy-id`]})),{successLabel:`Updated`})}},le={command:`policies`,describe:`Operations for policies`,builder:e=>e.command(W).command(K).command(ne).command(ie).command(oe).command(ce).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const de={command:`create`,describe:`Creates a new silence for an account.`,builder:ue,handler:async c=>{if(c.dryRun){a({command:`cf alerting silences create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/silences`,pathParams:{},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Creating`,async()=>l.alerting.silences.create({body:e,account_id:u})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function fe(e){return e.positional(`silence-id`,{type:`string`,description:`Silence 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 pe={command:`delete <silence-id>`,describe:`Deletes an existing silence for an account.`,builder:fe,handler:async s=>{if(s.dryRun){a({command:`cf alerting silences delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/alerting/v3/silences/${s[`silence-id`]==null?`<silence-id>`:encodeURIComponent(String(s[`silence-id`]))}`,pathParams:{"silence-id":String(s[`silence-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes the notification silence.`})){process.stderr.write(`Aborted.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,r as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{a as f}from"./prompt-CyATfGUu.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Retrieves Argo Smart Routing analytics broken down by geographic points of presence (PoPs). Shows latency improvements and routing efficiency per location.`,builder:p,handler:async e=>{if(e.dryRun){o({command:`cf analytics latency colos get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/analytics/latency/colos`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.analytics.latency.colos.get({zone_id:n})),{successLabel:`Loaded`})}},h={command:`colos`,describe:`Operations for latency.colos`,builder:e=>e.command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`bins`,{type:`string`,description:`Bins`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Retrieves aggregate Argo Smart Routing analytics for a zone, including latency improvements, bandwidth savings, and routing statistics.`,builder:g,handler:async e=>{let t={bins:e.bins};if(e.dryRun){o({command:`cf analytics latency get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/analytics/latency`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.analytics.latency.get({zone_id:c,...t})),{successLabel:`Loaded`})}},v={command:`latency`,describe:`Operations for latency`,builder:e=>e.command(_).command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`filters`,{type:`string`,description:"Filters to apply. `findingType = content` is applied automatically for CASB data. Provide as a JSON array of objects or @path/to/file.json."}).option(`from`,{type:`string`,description:`Start of the query time range (inclusive). RFC3339.`}).option(`n`,{type:`number`,description:`Maximum number of integrations to return.`}).option(`to`,{type:`string`,description:`End of the query time range (exclusive). RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Returns the top N integrations for content findings.`})}const b={command:`topN`,describe:`Returns the top N integrations ranked by total content findings.`,builder:y,handler:async r=>{if(r.dryRun){o({command:`cf analytics query data-security content-findings topN`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/analytics/query/data-security/content-findings/top-n`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),n:r.n,to:d(r.to,`to`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.analytics.query.dataSecurity.contentFindings.topN({...e,account_id:m})),{successLabel:`Created`});return}if(r.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(r.from===void 0&&(r.from=await f(`from`,`Start of the query time range (inclusive). RFC3339.`)),r.n===void 0)throw Error(`--n is required (or pass --body with this field set).`);r.to===void 0&&(r.to=await f(`to`,`End of the query time range (exclusive). RFC3339.`));let h=u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),n:r.n,to:d(r.to,`to`,`text`)});a(await s(`Creating`,async()=>p.analytics.query.dataSecurity.contentFindings.topN({...h,account_id:m})),{successLabel:`Created`})}},x={command:`content-findings`,describe:`Operations for query.data-security.content-findings`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`filters`,{type:`string`,description:`Filters to apply. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:`Start of the query time range (inclusive). RFC3339.`}).option(`to`,{type:`string`,description:`End of the query time range (exclusive). RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query for aggregate findings summary.`})}const C={command:`summary`,describe:`Returns aggregate current-period and previous-period totals for CASB findings.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf analytics query data-security findings summary`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/analytics/query/data-security/findings/summary`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),to:d(r.to,`to`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.analytics.query.dataSecurity.findings.summary({...e,account_id:m})),{successLabel:`Created`});return}if(r.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);r.from===void 0&&(r.from=await f(`from`,`Start of the query time range (inclusive). RFC3339.`)),r.to===void 0&&(r.to=await f(`to`,`End of the query time range (exclusive). RFC3339.`));let h=u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),to:d(r.to,`to`,`text`)});a(await s(`Creating`,async()=>p.analytics.query.dataSecurity.findings.summary({...h,account_id:m})),{successLabel:`Created`})}};function w(e){return e.option(`filters`,{type:`string`,description:`Filters to apply. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:`Start of the query time range (inclusive). RFC3339.`}).option(`to`,{type:`string`,description:`End of the query time range (exclusive). RFC3339.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Query for findings timeseries.`})}const T={command:`timeseries`,describe:`Returns merged time-bucketed CASB findings.`,builder:w,handler:async r=>{if(r.dryRun){o({command:`cf analytics query data-security findings timeseries`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/analytics/query/data-security/findings/timeseries`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),to:d(r.to,`to`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.analytics.query.dataSecurity.findings.timeseries({...e,account_id:m})),{successLabel:`Created`});return}if(r.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);r.from===void 0&&(r.from=await f(`from`,`Start of the query time range (inclusive). RFC3339.`)),r.to===void 0&&(r.to=await f(`to`,`End of the query time range (exclusive). RFC3339.`));let h=u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),to:d(r.to,`to`,`text`)});a(await s(`Creating`,async()=>p.analytics.query.dataSecurity.findings.timeseries({...h,account_id:m})),{successLabel:`Created`})}},E={command:`findings`,describe:`Operations for query.data-security.findings`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`data-security`,describe:`Operations for query.data-security`,builder:e=>e.command(x).command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const k={command:`summary <dataset>`,describe:`Returns aggregate summary stats for a dataset. Includes current-period and previous-period totals for trend comparison.`,builder:O,handler:async r=>{if(r.dryRun){o({command:`cf analytics query summary`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/analytics/query/${r.dataset==null?`<dataset>`:encodeURIComponent(String(r.dataset))}/summary`,pathParams:{dataset:String(r.dataset??``)},bodyKind:`json`,body:r.body===void 0?u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),groupBy:r[`group-by`],stats:r.stats,to:d(r.to,`to`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.analytics.query.summary({...e,account_id:m,dataset:r.dataset})),{successLabel:`Created`});return}if(r.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(r.from===void 0&&(r.from=await f(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),r[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(r.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);r.to===void 0&&(r.to=await f(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`));let h=u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),groupBy:r[`group-by`],stats:r.stats,to:d(r.to,`to`,`text`)});a(await s(`Creating`,async()=>p.analytics.query.summary({...h,account_id:m,dataset:r.dataset})),{successLabel:`Created`})}};function A(e){return e.positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`resolution`,{type:`string`,description:`Time bucket size for grouping results. Controls the granularity of the returned time slots.
|
|
3
|
+
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const j={command:`timeseries <dataset>`,describe:"Returns time-bucketed analytics data for a dataset. Includes time slots, each containing the requested stats, group-by dimensions, and resolution-controlled bucket size (e.g. `hour`, `day`).",builder:A,handler:async r=>{if(r.dryRun){o({command:`cf analytics query timeseries`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/analytics/query/${r.dataset==null?`<dataset>`:encodeURIComponent(String(r.dataset))}/timeseries`,pathParams:{dataset:String(r.dataset??``)},bodyKind:`json`,body:r.body===void 0?u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),groupBy:r[`group-by`],stats:r.stats,to:d(r.to,`to`,`text`),resolution:d(r.resolution,`resolution`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.analytics.query.timeseries({...e,account_id:m,dataset:r.dataset})),{successLabel:`Created`});return}if(r.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(r.from===void 0&&(r.from=await f(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),r[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(r.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);r.to===void 0&&(r.to=await f(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`)),r.resolution===void 0&&(r.resolution=await f(`resolution`,`Time bucket size for grouping results. Controls the granularity of the returned time slots. `));let h=u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),groupBy:r[`group-by`],stats:r.stats,to:d(r.to,`to`,`text`),resolution:d(r.resolution,`resolution`,`text`)});a(await s(`Creating`,async()=>p.analytics.query.timeseries({...h,account_id:m,dataset:r.dataset})),{successLabel:`Created`})}};function M(e){return e.positional(`dataset`,{type:`string`,description:"Dataset name to query. Examples: `access-logins`, `gateway-http`, `gateway-dns`, `gateway-http`, `shadow-it`.",demandOption:!0}).option(`filters`,{type:`string`,description:`Filters to apply before aggregating results. Provide as a JSON array of objects or @path/to/file.json.`}).option(`from`,{type:`string`,description:"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`)."}).option(`group-by`,{type:`string`,array:!0,description:`Specifies the column names to group results by. Requires valid columns for the target dataset.`}).option(`stats`,{type:`string`,array:!0,description:"Specifies the stat names to include in results. Requires valid stats for the target dataset (e.g. `attemptsTotal`, `bytesTotal`)."}).option(`to`,{type:`string`,description:`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`}).option(`n`,{type:`number`,description:`Maximum number of results to return.`}).option(`order-by`,{type:`string`,description:`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Defines fields that all query types share.`})}const N={command:`topN <dataset>`,describe:`Returns the top N results for a dataset by a specified stat. Includes an array of result rows, each containing the requested stats and group-by dimensions.`,builder:M,handler:async r=>{if(r.dryRun){o({command:`cf analytics query topN`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/analytics/query/${r.dataset==null?`<dataset>`:encodeURIComponent(String(r.dataset))}/top-n`,pathParams:{dataset:String(r.dataset??``)},bodyKind:`json`,body:r.body===void 0?u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),groupBy:r[`group-by`],stats:r.stats,to:d(r.to,`to`,`text`),n:r.n,orderBy:d(r[`order-by`],`order-by`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.analytics.query.topN({...e,account_id:m,dataset:r.dataset})),{successLabel:`Created`});return}if(r.filters===void 0)throw Error(`--filters is required (or pass --body with this field set).`);if(r.from===void 0&&(r.from=await f(`from`,"The start of the query time range (inclusive). RFC3339 format with timezone is required (e.g. `2024-11-05T00:00:00Z`).")),r[`group-by`]===void 0)throw Error(`--group-by is required (or pass --body with this field set).`);if(r.stats===void 0)throw Error(`--stats is required (or pass --body with this field set).`);if(r.to===void 0&&(r.to=await f(`to`,`Specifies the end of the query time range (exclusive). Requires RFC3339 format with timezone.`)),r.n===void 0)throw Error(`--n is required (or pass --body with this field set).`);r[`order-by`]===void 0&&(r[`order-by`]=await f(`order-by`,`Specifies the stat name for sorting results in descending order. Requires a valid stat for the target dataset.`));let h=u({filters:l(r.filters,`filters`),from:d(r.from,`from`,`text`),groupBy:r[`group-by`],stats:r.stats,to:d(r.to,`to`,`text`),n:r.n,orderBy:d(r[`order-by`],`order-by`,`text`)});a(await s(`Creating`,async()=>p.analytics.query.topN({...h,account_id:m,dataset:r.dataset})),{successLabel:`Created`})}},P={command:`query`,describe:`Operations for query`,builder:e=>e.command(k).command(j).command(N).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`analytics`,describe:`Zone-level traffic analytics — dashboard summaries, per-colo breakdowns, and Argo latency metrics`,builder:e=>e.command(v).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{F as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{a as r,r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,t as l}from"./input-validation-1esLElok.mjs";function u(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 d={command:`query`,describe:`Executes a SQL query against Workers Analytics Engine data. Pass the SQL query in the request body as plain text. The response uses newline-delimited JSON (NDJSON) by default, or a single JSON object when the query includes a FORMAT JSON clause. Prefer this method for longer queries that may exceed URL length limits.`,builder:u,handler:async u=>{if(u.dryRun){o({command:`cf analytics_engine sql query`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/analytics_engine/sql`,pathParams:{},bodyKind:`octet-stream`,body:u.body});return}let d=await i(u),f=u.local?e:await t();if(u.accountId=f,u.file){let e=l(u.file);a(await s(`Loading`,async()=>r(d,`POST`,`/accounts/${f}/analytics_engine/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}if(u.body){let e=c(u.body,`body`,`binary`);a(await s(`Loading`,async()=>r(d,`POST`,`/accounts/${f}/analytics_engine/sql`,{body:e,headers:{"Content-Type":`text/plain`}})),{successLabel:`Loaded`});return}a(await s(`Loading`,async()=>d.analyticsEngine.sql.query({account_id:f})),{successLabel:`Loaded`})}},f={command:`sql`,describe:`Operations for sql`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`analytics_engine`,describe:`analytics_engine`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|