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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
3
|
-
`);return}
|
|
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,n as p}from"./prompt-CyATfGUu.mjs";import{t as m}from"./cli-types-C3nVfpSG.mjs";import{n as h,t as g}from"./raw-fetch-CNKIypJ7.mjs";function ee(e){return e.option(`category-id`,{type:`number`,description:`Returns the category ID.`}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`human-id`,{type:`string`,description:`Returns the human readable ID.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`name`,{type:`string`,description:`Returns the application name.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).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 te={command:`create`,describe:`Create a custom application for an account.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf accounts applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({category_id:r[`category-id`],hostnames:r.hostnames,human_id:d(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:d(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):c(r.body)});return}let l=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.applications.create({...e,account_id:p})),{successLabel:`Created`});return}if(r[`category-id`]===void 0)throw Error(`--category-id is required (or pass --body with this field set).`);r[`human-id`]===void 0&&(r[`human-id`]=await f(`human-id`,`Returns the human readable ID.`)),r.name===void 0&&(r.name=await f(`name`,`Returns the application name.`));let m=u({category_id:r[`category-id`],hostnames:r.hostnames,human_id:d(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:d(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});a(await s(`Creating`,async()=>l.accounts.applications.create({...m,account_id:p})),{successLabel:`Created`})}};function _(e){return e.positional(`id`,{type:`string`,description:`Application 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 v={command:`delete <id>`,describe:`Delete a custom application and all of its versions. Deletion is rejected when other resources reference the application.`,builder:_,handler:async r=>{if(r.dryRun){o({command:`cf accounts applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}a(await s(`Deleting`,async()=>c.accounts.applications.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})}};function y(e){return e.option(`filter`,{type:`string`,description:`Filter applications using key:value format. Supported filter keys:
|
|
4
4
|
- name: Filter by application name (e.g., name:HR)
|
|
5
5
|
- id: Filter by application ID (e.g., id:498)
|
|
6
6
|
- human_id: Filter by human-readable ID (e.g., human_id:HR)
|
|
@@ -14,15 +14,15 @@ import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oaut
|
|
|
14
14
|
.`}).option(`limit`,{type:`number`,description:`Limit of number of results to return (max 250).`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`order-by`,{type:`string`,description:`Order results using field:direction format. Supported fields are name, id, human_id,
|
|
15
15
|
category_id, application_type, application_confidence_score, and gen_ai_score.
|
|
16
16
|
Supported directions are asc and desc. Ignored when search is provided; results are
|
|
17
|
-
ranked by relevance instead.`}).option(`search`,{type:`string`,description:`Fuzzy search across application name and hostnames. Results are ranked by relevance. Must be between 2 and 200 characters. Can be combined with filter parameters.`}).option(`fields`,{type:`string`,description:"Return only the listed properties on each application, as a comma-separated list.\nUse this to keep responses small when you only need part of each application — for\nexample populating a picker with `fields=id,name` instead of downloading every\nhostname and IP subnet.\n\nOmit this parameter to receive the full application object.\n\n`id` is always returned.\n\nSelectable properties: `id`, `name`, `human_id`, `version`, `hostnames`,\n`support_domains`, `ip_subnets`, `port_protocols`, `supported`, `gen_ai_score`,\n`application_confidence_score`, `created_at`, `updated_at`, `review_status`.\n\nUnknown or empty property names return `400`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`applications`,describe:"List the applications available to an account, both the applications Cloudflare curates and the custom applications the account has defined. Results are paginated. Use `filter` and `search` to narrow the list, `order_by` to sort it, and `fields` to reduce each result to only the properties you need. The authenticated principal must have access to the account identified by `account_id`.",builder:y,handler:async r=>{let i={filter:r.filter,limit:r.limit,offset:r.offset,order_by:r[`order-by`],search:r.search,fields:r.fields};if(r.dryRun){s({command:`cf accounts applications get applications`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.applications.get.applications({account_id:u,...i})),{successLabel:`Loaded`})}};function x(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`id <id>`,describe:`Get application by ID.`,builder:x,handler:async r=>{if(r.dryRun){s({command:`cf accounts applications get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.applications.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})}},C={command:`by`,describe:`Operations for applications.get.by`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`get`,describe:`Operations for applications.get`,builder:e=>e.command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Updates the network matchers for the application. Omitted matcher lists are left unchanged; send an empty array to clear a list.`})}const E={command:`update <id>`,describe:`Replace the network matchers for a custom application and create a new version.`,builder:T,handler:async r=>{if(r.dryRun){s({command:`cf accounts applications update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?u({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):l(r.body)});return}let i=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.applications.update({...e,account_id:d,id:r.id})),{successLabel:`Updated`});return}let f=u({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});o(await c(`Updating`,async()=>i.accounts.applications.update({...f,account_id:d,id:r.id})),{successLabel:`Updated`})}},D={command:`applications`,describe:`Applications operations`,builder:e=>e.command(g).command(v).command(E).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`createSetupIntent`,describe:`Creates a Stripe setup intent for adding a payment method to an account. Returns a client secret for frontend payment method collection.`,builder:O,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing createSetupIntent`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/client-secret`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.accounts.billing.createSetupIntent({account_id:l})),{successLabel:`Created`})}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`getBadDebt`,describe:`Gets bad debt information for an account, including outstanding invoices and total debt amount.`,builder:A,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing getBadDebt`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/bad-debt`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getBadDebt({account_id:l})),{successLabel:`Loaded`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`getCredits`,describe:`Gets the credit balance and eligibility for an account.`,builder:M,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing getCredits`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/credits`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getCredits({account_id:l})),{successLabel:`Loaded`})}};function P(e){return e.positional(`receipt-id`,{type:`string`,description:`Receipt identifier.`,demandOption:!0}).option(`doctype`,{type:`string`,description:`The document type to generate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const F={command:`getReceiptPdf <receipt-id>`,describe:`Downloads a receipt as a PDF document.`,builder:P,handler:async r=>{let i={doctype:r.doctype};if(r.dryRun){s({command:`cf accounts billing getReceiptPdf`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/receipts/${r[`receipt-id`]==null?`<receipt-id>`:encodeURIComponent(String(r[`receipt-id`]))}/pdf`,pathParams:{"receipt-id":String(r[`receipt-id`]??``)},query:i,bodyKind:`none`});return}await a(r);let o=r.local?e:await t();r.accountId=o;let l=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await c(`Loading`,async()=>ee(`/accounts/${o}/receipts/${encodeURIComponent(String(r[`receipt-id`]))}/pdf${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));h(r.text===!0?u.toString(`utf-8`):u)}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`getUnpaidInvoices`,describe:`Gets unpaid invoice information for an account.`,builder:I,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing getUnpaidInvoices`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/unpaid-invoice`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.getUnpaidInvoices({account_id:l})),{successLabel:`Loaded`})}};function R(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`status`,{type:`string`,description:`Filter billing history by status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`Gets the billing history for an account.`,builder:R,handler:async r=>{let i={page:r.page,per_page:r[`per-page`],status:r.status};if(r.dryRun){s({command:`cf accounts billing history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/history`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.billing.history.list({account_id:u,...i})),{successLabel:`Loaded`})}},B={command:`history`,describe:`Operations for billing.history`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`payBadDebt`,describe:`Pays outstanding bad debt for an account. Discovers all debt automatically and handles invoice deduplication.`,builder:V,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payBadDebt`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-bad-debt`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...e,account_id:f})),{successLabel:`Created`});return}let p=u({payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...p,account_id:f})),{successLabel:`Created`})}};function U(e){return e.option(`invoice-id`,{type:`string`,description:`The identifier of the invoice to pay.`}).option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).option(`validate-payment-method`,{type:`boolean`,description:`Whether to validate the payment method before processing.`}).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:`payInvoice`,describe:`Pays an outstanding invoice for an account. Returns a Stripe client secret when Strong Customer Authentication (SCA) is required to complete the payment.`,builder:U,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payInvoice`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-invoice`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({invoice_id:d(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...e,account_id:f})),{successLabel:`Created`});return}let p=u({invoice_id:d(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]});o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...p,account_id:f})),{successLabel:`Created`})}};function G(e){return e.option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing zip code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`create`,describe:`Creates a new payment method for an account.`,builder:G,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:p,account_id:f})),{successLabel:`Created`})}};function q(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const J={command:`delete <payment-method-id>`,describe:`Deletes a payment method from an account.`,builder:q,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
18
|
-
`);return}o(await c(`Deleting`,async()=>i.accounts.billing.paymentMethods.delete({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Deleted`})}};function Y(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <payment-method-id>`,describe:`Gets a specific payment method for an account.`,builder:Y,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.billing.paymentMethods.get({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Loaded`})}};function Z(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`Lists all payment methods for an account.`,builder:Z,handler:async r=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf accounts billing payment-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.billing.paymentMethods.list({account_id:u,...i})),{successLabel:`Loaded`})}};function ne(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`setDefault <payment-method-id>`,describe:`Sets a payment method as the default for an account.`,builder:ne,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods setDefault`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}/set-as-default`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.setDefault({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Created`})}};function ie(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing zip code.`}).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 ae={command:`update <payment-method-id>`,describe:`Updates a payment method for an account.`,builder:ie,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing payment-methods update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.billing.paymentMethods.update({body:e,account_id:f,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`});return}let p=u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)});o(await c(`Updating`,async()=>i.accounts.billing.paymentMethods.update({body:p,account_id:f,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`})}},oe={command:`payment-methods`,describe:`Operations for billing.payment-methods`,builder:e=>e.command(K).command(J).command(X).command(Q).command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.option(`toggle`,{type:`boolean`,description:`Whether to enable or disable PDF invoice generation.`}).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:`togglePdfInvoices`,describe:`Toggles PDF invoice generation for an account.`,builder:se,handler:async r=>{if(r.dryRun){s({command:`cf accounts billing togglePdfInvoices`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/invoices`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({toggle:r.toggle}):l(r.body)});return}let i=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.billing.togglePdfInvoices({...e,account_id:d})),{successLabel:`Updated`});return}let f=u({toggle:r.toggle});o(await c(`Updating`,async()=>i.accounts.billing.togglePdfInvoices({...f,account_id:d})),{successLabel:`Updated`})}},le={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(H).command(W).command(ce).command(B).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.positional(`id`,{type:`string`,description:`Application category ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`id <id>`,describe:`Get application category by ID.`,builder:ue,handler:async r=>{if(r.dryRun){s({command:`cf accounts categories get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.categories.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})}},fe={command:`by`,describe:`Operations for categories.get.by`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.option(`limit`,{type:`number`,description:`Limit of number of results to return.`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`categories`,describe:`List application categories.`,builder:pe,handler:async r=>{let i={limit:r.limit,offset:r.offset};if(r.dryRun){s({command:`cf accounts categories get categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.categories.get.categories({account_id:u,...i})),{successLabel:`Loaded`})}},he={command:`get`,describe:`Operations for categories.get`,builder:e=>e.command(me).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`categories`,describe:`Categories operations`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.option(`name`,{type:`string`,description:`Account name`}).option(`unit-id`,{type:`string`,description:`Tenant unit ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Parameters for account creation`})}const ve={command:`create`,describe:`Create an account (only available for tenant admins at this time)`,builder:_e,handler:async e=>{if(e.dryRun){s({command:`cf accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`),unit:{id:d(e[`unit-id`],`unit-id`,`text`)}}):l(e.body)});return}let t=await a(e);if(e.body){let n=l(e.body);o(await c(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await f(`name`,`Account name`));let n=u({name:d(e.name,`name`,`text`),unit:{id:d(e[`unit-id`],`unit-id`,`text`)}});o(await c(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`})}};function ye(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 be={command:`delete`,describe:`Delete a specific account (only available for tenant admins at this time). This is a permanent operation that will delete any zones or other resources under the account`,builder:ye,handler:async r=>{if(r.dryRun){s({command:`cf accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
19
|
-
`);return}o(await c(`Deleting`,async()=>i.accounts.delete({account_id:l})),{successLabel:`Deleted`})}};function xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:xe,handler:async r=>{if(r.dryRun){s({command:`cf accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.get({account_id:l})),{successLabel:`Loaded`})}};function Ce(e){return e.option(`name`,{type:`string`,description:`Name of the account.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:m(Ce),handler:async e=>{let t={name:e.name,page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){s({command:`cf accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},query:t,bodyKind:`none`});return}let n=await a(e);o(await c(`Loading`,async()=>n.accounts.list(t)),{successLabel:`Loaded`})}};function Te(e){return e.positional(`id`,{type:`string`,description:`The ID of the audit log to fetch resource history for.`,demandOption:!0}).option(`action-time`,{type:`string`,description:"RFC3339 timestamp of the source audit log entry's action time. Used to narrow the source-entry lookup window. Provide the `action.time` value from the audit log identified by `id`.",demandOption:!0}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`history <id>`,describe:"Returns the chronological change history for the resource identified by the given audit log entry. The endpoint first locates the source audit log entry by `id` (using `action_time` to narrow the lookup window), derives identifying filters from that entry, and then returns matching audit logs within the `since`/`before` window. The `result_info.history_status` field indicates the quality of the resource identification used: - `exact`: Resource was identified by the resource URI. - `approximate`: Resource was identified without the resource URI. - `unavailable`: The source audit log entry did not contain enough information to identify the resource; an empty result is returned.",builder:m(Te),handler:async r=>{let i={action_time:r[`action-time`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){s({command:`cf accounts logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/history`,pathParams:{id:String(r.id??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.logs.audit.history({account_id:u,id:r.id,...i})),{successLabel:`Loaded`})}};function De(e){return e.option(`account-name`,{type:`string`,description:`Filters by the account name.`}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:"Filters by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`audit-log-id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`product-category`,{type:`string`,description:`Filters audit logs by one or more predefined product categories. Each product category expands into a curated set of resource_product values and is unioned with any explicit resource_product filter. Matched case-insensitively; unknown product categories return 400. Repeatable. Use the audit log product categories endpoint to discover the available values.`}).option(`zone-id`,{type:`string`,description:`Filters by the zone ID.`}).option(`zone-name`,{type:`string`,description:`Filters by the zone name associated with the change.`}).option(`account-name-not`,{type:`string`,description:`Filters out audit logs by the account name.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:"Filters out audit logs by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`audit-log-id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id-not`,{type:`string`,description:`Filters out audit logs by the zone ID.`}).option(`zone-name-not`,{type:`string`,description:`Filters out audit logs by the zone name associated with the change.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:m(De),handler:async r=>{let i={account_name:r[`account-name`],action_result:r[`action-result`],action_type:r[`action-type`],actor_context:r[`actor-context`],actor_email:r[`actor-email`],actor_id:r[`actor-id`],actor_ip_address:r[`actor-ip-address`],actor_token_id:r[`actor-token-id`],actor_token_name:r[`actor-token-name`],actor_type:r[`actor-type`],audit_log_id:r[`audit-log-id`],id:r.id,raw_cf_ray_id:r[`raw-cf-ray-id`],raw_method:r[`raw-method`],raw_status_code:r[`raw-status-code`],raw_uri:r[`raw-uri`],resource_id:r[`resource-id`],resource_product:r[`resource-product`],resource_type:r[`resource-type`],resource_scope:r[`resource-scope`],product_category:r[`product-category`],zone_id:r[`zone-id`],zone_name:r[`zone-name`],"account_name.not":r[`account-name-not`],"action_result.not":r[`action-result-not`],"action_type.not":r[`action-type-not`],"actor_context.not":r[`actor-context-not`],"actor_email.not":r[`actor-email-not`],"actor_id.not":r[`actor-id-not`],"actor_ip_address.not":r[`actor-ip-address-not`],"actor_token_id.not":r[`actor-token-id-not`],"actor_token_name.not":r[`actor-token-name-not`],"actor_type.not":r[`actor-type-not`],"audit_log_id.not":r[`audit-log-id-not`],"id.not":r[`id-not`],"raw_cf_ray_id.not":r[`raw-cf-ray-id-not`],"raw_method.not":r[`raw-method-not`],"raw_status_code.not":r[`raw-status-code-not`],"raw_uri.not":r[`raw-uri-not`],"resource_id.not":r[`resource-id-not`],"resource_product.not":r[`resource-product-not`],"resource_type.not":r[`resource-type-not`],"resource_scope.not":r[`resource-scope-not`],"zone_id.not":r[`zone-id-not`],"zone_name.not":r[`zone-name-not`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){s({command:`cf accounts logs audit list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.logs.audit.list({account_id:u,...i})),{successLabel:`Loaded`})}};function ke(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`product-categories`,describe:`Lists the available audit log product categories and the resource products each one expands to. Use these values with the product_category filter on the account audit logs endpoint.`,builder:ke,handler:async r=>{if(r.dryRun){s({command:`cf accounts logs audit product-categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/product_categories`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.logs.audit.productCategories({account_id:l})),{successLabel:`Loaded`})}},je={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(Ee).command(Oe).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Me={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ne(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`roles`,{type:`string`,array:!0,description:`Array of roles associated with this member.`}).option(`status`,{type:`string`,description:`Status of the member invitation. If not provided during creation, defaults to 'pending'.
|
|
17
|
+
ranked by relevance instead.`}).option(`search`,{type:`string`,description:`Fuzzy search across application name and hostnames. Results are ranked by relevance. Must be between 2 and 200 characters. Can be combined with filter parameters.`}).option(`fields`,{type:`string`,description:"Return only the listed properties on each application, as a comma-separated list.\nUse this to keep responses small when you only need part of each application — for\nexample populating a picker with `fields=id,name` instead of downloading every\nhostname and IP subnet.\n\nOmit this parameter to receive the full application object.\n\n`id` is always returned.\n\nSelectable properties: `id`, `name`, `human_id`, `version`, `hostnames`,\n`support_domains`, `ip_subnets`, `port_protocols`, `supported`, `gen_ai_score`,\n`application_confidence_score`, `created_at`, `updated_at`, `review_status`.\n\nUnknown or empty property names return `400`."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`applications`,describe:"List the applications available to an account, both the applications Cloudflare curates and the custom applications the account has defined. Results are paginated. Use `filter` and `search` to narrow the list, `order_by` to sort it, and `fields` to reduce each result to only the properties you need. The authenticated principal must have access to the account identified by `account_id`.",builder:y,handler:async r=>{let c={filter:r.filter,limit:r.limit,offset:r.offset,order_by:r[`order-by`],search:r.search,fields:r.fields};if(r.dryRun){o({command:`cf accounts applications get applications`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.applications.get.applications({account_id:u,...c})),{successLabel:`Loaded`})}};function x(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`id <id>`,describe:`Get application by ID.`,builder:x,handler:async r=>{if(r.dryRun){o({command:`cf accounts applications get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.applications.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})}},C={command:`by`,describe:`Operations for applications.get.by`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`get`,describe:`Operations for applications.get`,builder:e=>e.command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Updates the network matchers for the application. Omitted matcher lists are left unchanged; send an empty array to clear a list.`})}const E={command:`update <id>`,describe:`Replace the network matchers for a custom application and create a new version.`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf accounts applications update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?u({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.accounts.applications.update({...e,account_id:d,id:r.id})),{successLabel:`Updated`});return}let f=u({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});a(await s(`Updating`,async()=>l.accounts.applications.update({...f,account_id:d,id:r.id})),{successLabel:`Updated`})}},D={command:`applications`,describe:`Applications operations`,builder:e=>e.command(te).command(v).command(E).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`createSetupIntent`,describe:`Creates a Stripe setup intent for adding a payment method to an account. Returns a client secret for frontend payment method collection.`,builder:O,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing createSetupIntent`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/client-secret`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.accounts.billing.createSetupIntent({account_id:l})),{successLabel:`Created`})}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`getBadDebt`,describe:`Gets bad debt information for an account, including outstanding invoices and total debt amount.`,builder:A,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing getBadDebt`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/bad-debt`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.billing.getBadDebt({account_id:l})),{successLabel:`Loaded`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`getCredits`,describe:`Gets the credit balance and eligibility for an account.`,builder:M,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing getCredits`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/credits`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.billing.getCredits({account_id:l})),{successLabel:`Loaded`})}};function P(e){return e.positional(`receipt-id`,{type:`string`,description:`Receipt identifier.`,demandOption:!0}).option(`doctype`,{type:`string`,description:`The document type to generate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const F={command:`getReceiptPdf <receipt-id>`,describe:`Downloads a receipt as a PDF document.`,builder:P,handler:async r=>{let a={doctype:r.doctype};if(r.dryRun){o({command:`cf accounts billing getReceiptPdf`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/receipts/${r[`receipt-id`]==null?`<receipt-id>`:encodeURIComponent(String(r[`receipt-id`]))}/pdf`,pathParams:{"receipt-id":String(r[`receipt-id`]??``)},query:a,bodyKind:`none`});return}await i(r);let c=r.local?e:await t();r.accountId=c;let l=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await s(`Loading`,async()=>g(`/accounts/${c}/receipts/${encodeURIComponent(String(r[`receipt-id`]))}/pdf${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));h(r.text===!0?u.toString(`utf-8`):u)}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`getUnpaidInvoices`,describe:`Gets unpaid invoice information for an account.`,builder:I,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing getUnpaidInvoices`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/unpaid-invoice`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.billing.getUnpaidInvoices({account_id:l})),{successLabel:`Loaded`})}};function R(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`status`,{type:`string`,description:`Filter billing history by status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`Gets the billing history for an account.`,builder:R,handler:async r=>{let c={page:r.page,per_page:r[`per-page`],status:r.status};if(r.dryRun){o({command:`cf accounts billing history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.billing.history.list({account_id:u,...c})),{successLabel:`Loaded`})}},B={command:`history`,describe:`Operations for billing.history`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`payBadDebt`,describe:`Pays outstanding bad debt for an account. Discovers all debt automatically and handles invoice deduplication.`,builder:V,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payBadDebt`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-bad-debt`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.billing.payBadDebt({...e,account_id:f})),{successLabel:`Created`});return}let p=u({payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`)});a(await s(`Creating`,async()=>l.accounts.billing.payBadDebt({...p,account_id:f})),{successLabel:`Created`})}};function U(e){return e.option(`invoice-id`,{type:`string`,description:`The identifier of the invoice to pay.`}).option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).option(`validate-payment-method`,{type:`boolean`,description:`Whether to validate the payment method before processing.`}).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:`payInvoice`,describe:`Pays an outstanding invoice for an account. Returns a Stripe client secret when Strong Customer Authentication (SCA) is required to complete the payment.`,builder:U,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payInvoice`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-invoice`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({invoice_id:d(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.billing.payInvoice({...e,account_id:f})),{successLabel:`Created`});return}let p=u({invoice_id:d(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]});a(await s(`Creating`,async()=>l.accounts.billing.payInvoice({...p,account_id:f})),{successLabel:`Created`})}};function G(e){return e.option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing zip code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`create`,describe:`Creates a new payment method for an account.`,builder:G,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.billing.paymentMethods.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)});a(await s(`Creating`,async()=>l.accounts.billing.paymentMethods.create({body:p,account_id:f})),{successLabel:`Created`})}};function q(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const J={command:`delete <payment-method-id>`,describe:`Deletes a payment method from an account.`,builder:q,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
18
|
+
`);return}a(await s(`Deleting`,async()=>c.accounts.billing.paymentMethods.delete({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Deleted`})}};function Y(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <payment-method-id>`,describe:`Gets a specific payment method for an account.`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.billing.paymentMethods.get({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Loaded`})}};function Z(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`Lists all payment methods for an account.`,builder:Z,handler:async r=>{let c={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf accounts billing payment-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.billing.paymentMethods.list({account_id:u,...c})),{successLabel:`Loaded`})}};function ne(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`setDefault <payment-method-id>`,describe:`Sets a payment method as the default for an account.`,builder:ne,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods setDefault`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}/set-as-default`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.accounts.billing.paymentMethods.setDefault({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Created`})}};function ie(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing zip code.`}).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 ae={command:`update <payment-method-id>`,describe:`Updates a payment method for an account.`,builder:ie,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.accounts.billing.paymentMethods.update({body:e,account_id:f,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`});return}let p=u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)});a(await s(`Updating`,async()=>l.accounts.billing.paymentMethods.update({body:p,account_id:f,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`})}},oe={command:`payment-methods`,describe:`Operations for billing.payment-methods`,builder:e=>e.command(K).command(J).command(X).command(Q).command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.option(`toggle`,{type:`boolean`,description:`Whether to enable or disable PDF invoice generation.`}).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:`togglePdfInvoices`,describe:`Toggles PDF invoice generation for an account.`,builder:se,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing togglePdfInvoices`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/invoices`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({toggle:r.toggle}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.accounts.billing.togglePdfInvoices({...e,account_id:d})),{successLabel:`Updated`});return}let f=u({toggle:r.toggle});a(await s(`Updating`,async()=>l.accounts.billing.togglePdfInvoices({...f,account_id:d})),{successLabel:`Updated`})}},le={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(H).command(W).command(ce).command(B).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.positional(`id`,{type:`string`,description:`Application category ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`id <id>`,describe:`Get application category by ID.`,builder:ue,handler:async r=>{if(r.dryRun){o({command:`cf accounts categories get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.categories.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})}},fe={command:`by`,describe:`Operations for categories.get.by`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.option(`limit`,{type:`number`,description:`Limit of number of results to return.`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`categories`,describe:`List application categories.`,builder:pe,handler:async r=>{let c={limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf accounts categories get categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.categories.get.categories({account_id:u,...c})),{successLabel:`Loaded`})}},he={command:`get`,describe:`Operations for categories.get`,builder:e=>e.command(me).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`categories`,describe:`Categories operations`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.option(`name`,{type:`string`,description:`Account name`}).option(`unit-id`,{type:`string`,description:`Tenant unit ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Parameters for account creation`})}const ve={command:`create`,describe:`Create an account (only available for tenant admins at this time)`,builder:_e,handler:async e=>{if(e.dryRun){o({command:`cf accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`),unit:{id:d(e[`unit-id`],`unit-id`,`text`)}}):c(e.body)});return}let t=await i(e);if(e.body){let n=c(e.body);a(await s(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await f(`name`,`Account name`));let n=u({name:d(e.name,`name`,`text`),unit:{id:d(e[`unit-id`],`unit-id`,`text`)}});a(await s(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`})}};function ye(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 be={command:`delete`,describe:`Delete a specific account (only available for tenant admins at this time). This is a permanent operation that will delete any zones or other resources under the account`,builder:ye,handler:async r=>{if(r.dryRun){o({command:`cf accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
19
|
+
`);return}a(await s(`Deleting`,async()=>c.accounts.delete({account_id:l})),{successLabel:`Deleted`})}};function xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:xe,handler:async r=>{if(r.dryRun){o({command:`cf accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.get({account_id:l})),{successLabel:`Loaded`})}};function Ce(e){return e.option(`name`,{type:`string`,description:`Name of the account.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:m(Ce),handler:async e=>{let t={name:e.name,page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){o({command:`cf accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e);a(await s(`Loading`,async()=>n.accounts.list(t)),{successLabel:`Loaded`})}};function Te(e){return e.positional(`id`,{type:`string`,description:`The ID of the audit log to fetch resource history for.`,demandOption:!0}).option(`action-time`,{type:`string`,description:"RFC3339 timestamp of the source audit log entry's action time. Used to narrow the source-entry lookup window. Provide the `action.time` value from the audit log identified by `id`.",demandOption:!0}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`history <id>`,describe:"Returns the chronological change history for the resource identified by the given audit log entry. The endpoint first locates the source audit log entry by `id` (using `action_time` to narrow the lookup window), derives identifying filters from that entry, and then returns matching audit logs within the `since`/`before` window. The `result_info.history_status` field indicates the quality of the resource identification used: - `exact`: Resource was identified by the resource URI. - `approximate`: Resource was identified without the resource URI. - `unavailable`: The source audit log entry did not contain enough information to identify the resource; an empty result is returned.",builder:m(Te),handler:async r=>{let c={action_time:r[`action-time`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf accounts logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/history`,pathParams:{id:String(r.id??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.logs.audit.history({account_id:u,id:r.id,...c})),{successLabel:`Loaded`})}};function De(e){return e.option(`account-name`,{type:`string`,description:`Filters by the account name.`}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:"Filters by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`audit-log-id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`product-category`,{type:`string`,description:`Filters audit logs by one or more predefined product categories. Each product category expands into a curated set of resource_product values and is unioned with any explicit resource_product filter. Matched case-insensitively; unknown product categories return 400. Repeatable. Use the audit log product categories endpoint to discover the available values.`}).option(`zone-id`,{type:`string`,description:`Filters by the zone ID.`}).option(`zone-name`,{type:`string`,description:`Filters by the zone name associated with the change.`}).option(`account-name-not`,{type:`string`,description:`Filters out audit logs by the account name.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:"Filters out audit logs by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`audit-log-id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id-not`,{type:`string`,description:`Filters out audit logs by the zone ID.`}).option(`zone-name-not`,{type:`string`,description:`Filters out audit logs by the zone name associated with the change.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:m(De),handler:async r=>{let c={account_name:r[`account-name`],action_result:r[`action-result`],action_type:r[`action-type`],actor_context:r[`actor-context`],actor_email:r[`actor-email`],actor_id:r[`actor-id`],actor_ip_address:r[`actor-ip-address`],actor_token_id:r[`actor-token-id`],actor_token_name:r[`actor-token-name`],actor_type:r[`actor-type`],audit_log_id:r[`audit-log-id`],id:r.id,raw_cf_ray_id:r[`raw-cf-ray-id`],raw_method:r[`raw-method`],raw_status_code:r[`raw-status-code`],raw_uri:r[`raw-uri`],resource_id:r[`resource-id`],resource_product:r[`resource-product`],resource_type:r[`resource-type`],resource_scope:r[`resource-scope`],product_category:r[`product-category`],zone_id:r[`zone-id`],zone_name:r[`zone-name`],"account_name.not":r[`account-name-not`],"action_result.not":r[`action-result-not`],"action_type.not":r[`action-type-not`],"actor_context.not":r[`actor-context-not`],"actor_email.not":r[`actor-email-not`],"actor_id.not":r[`actor-id-not`],"actor_ip_address.not":r[`actor-ip-address-not`],"actor_token_id.not":r[`actor-token-id-not`],"actor_token_name.not":r[`actor-token-name-not`],"actor_type.not":r[`actor-type-not`],"audit_log_id.not":r[`audit-log-id-not`],"id.not":r[`id-not`],"raw_cf_ray_id.not":r[`raw-cf-ray-id-not`],"raw_method.not":r[`raw-method-not`],"raw_status_code.not":r[`raw-status-code-not`],"raw_uri.not":r[`raw-uri-not`],"resource_id.not":r[`resource-id-not`],"resource_product.not":r[`resource-product-not`],"resource_type.not":r[`resource-type-not`],"resource_scope.not":r[`resource-scope-not`],"zone_id.not":r[`zone-id-not`],"zone_name.not":r[`zone-name-not`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf accounts logs audit list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.logs.audit.list({account_id:u,...c})),{successLabel:`Loaded`})}};function ke(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`product-categories`,describe:`Lists the available audit log product categories and the resource products each one expands to. Use these values with the product_category filter on the account audit logs endpoint.`,builder:ke,handler:async r=>{if(r.dryRun){o({command:`cf accounts logs audit product-categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/product_categories`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.logs.audit.productCategories({account_id:l})),{successLabel:`Loaded`})}},je={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(Ee).command(Oe).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Me={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ne(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`roles`,{type:`string`,array:!0,description:`Array of roles associated with this member.`}).option(`status`,{type:`string`,description:`Status of the member invitation. If not provided during creation, defaults to 'pending'.
|
|
20
20
|
Changing from 'accepted' back to 'pending' will trigger a replacement of the member resource in Terraform.
|
|
21
|
-
`,choices:[`accepted`,`pending`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pe={command:`create`,describe:`Add a user to the list of members for this account.`,builder:Ne,handler:async r=>{if(r.dryRun){
|
|
22
|
-
`);return}o(await c(`Deleting`,async()=>i.accounts.members.delete({account_id:l,member_id:r[`member-id`]})),{successLabel:`Deleted`})}};function Le(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`get <member-id>`,describe:`Get information about a specific member of an account.`,builder:Le,handler:async r=>{if(r.dryRun){s({command:`cf accounts members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.members.get({account_id:l,member_id:r[`member-id`]})),{successLabel:`Loaded`})}};function ze(e){return e.option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`user.first_name`,`user.last_name`,`user.email`,`status`]}).option(`status`,{type:`string`,description:`A member's status in the account.`,choices:[`accepted`,`pending`,`rejected`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`list`,describe:`List all members of an account.`,builder:m(ze),handler:async r=>{let i={order:r.order,status:r.status,page:r.page,per_page:r[`per-page`],direction:r.direction};if(r.dryRun){s({command:`cf accounts members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.accounts.members.list({account_id:u,...i})),{successLabel:`Loaded`})}};function Ve(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const He={command:`update <member-id>`,describe:`Modify an account member.`,builder:Ve,handler:async r=>{if(r.dryRun){s({command:`cf accounts members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:l(r.body)});return}let u=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Updating`,async()=>u.accounts.members.update({body:e,account_id:d,member_id:r[`member-id`]})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>i(u,`PUT`,`/accounts/${d}/members/${encodeURIComponent(String(r[`member-id`]))}`)),{successLabel:`Updated`})}},Ue={command:`members`,describe:`Operations for members`,builder:e=>e.command(Pe).command(Ie).command(Re).command(Be).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function We(e){return e.option(`subscription-ids`,{type:`string`,array:!0,description:`List of subscription identifiers to cancel downgrades for.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ge={command:`cancelDelayedDowngrade`,describe:`Cancels pending delayed downgrades for the specified subscriptions.`,builder:We,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions cancelDelayedDowngrade`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/cancel-downgrade`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({subscription_ids:r[`subscription-ids`]}):l(r.body)});return}let i=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.subscriptions.cancelDelayedDowngrade({...e,account_id:d})),{successLabel:`Created`});return}let f=u({subscription_ids:r[`subscription-ids`]});o(await c(`Creating`,async()=>i.accounts.subscriptions.cancelDelayedDowngrade({...f,account_id:d})),{successLabel:`Created`})}};function Ke(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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 qe={command:`create`,describe:`Creates an account or zone subscription.`,builder:Ke,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf accounts subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/subscriptions`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:i.body===void 0?u({app:{install_id:d(i[`app-install-id`],`app-install-id`,`text`)},frequency:d(i.frequency,`frequency`,`text`),rate_plan:{currency:d(i[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:i[`rate-plan-externally-managed`],id:d(i[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:i[`rate-plan-is-contract`],public_name:d(i[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(i[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:i[`rate-plan-sets`]}}):l(i.body)});return}let f=await a(i),p=i.zone===void 0?`accounts`:`zones`,m=p===`zones`?await r({zone:i.zone},f,{quiet:i.quiet}):i.local?e:await t();if(p===`zones`?i.zoneId=m:i.accountId=m,i.body){let e=l(i.body);o(await c(`Creating`,async()=>f.accounts.subscriptions.create({body:e,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Created`});return}let h=u({app:{install_id:d(i[`app-install-id`],`app-install-id`,`text`)},frequency:d(i.frequency,`frequency`,`text`),rate_plan:{currency:d(i[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:i[`rate-plan-externally-managed`],id:d(i[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:i[`rate-plan-is-contract`],public_name:d(i[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(i[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:i[`rate-plan-sets`]}});o(await c(`Creating`,async()=>f.accounts.subscriptions.create({body:h,account_or_zone:p,account_or_zone_id:m})),{successLabel:`Created`})}};function Je(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`other`,{type:`string`,description:`Additional cancellation details.`}).option(`reason-code`,{type:`string`,array:!0,description:`The cancellation reason codes.`}).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 Ye={command:`createCancelReason <subscription-identifier>`,describe:`Records a cancellation reason for an account subscription.`,builder:Je,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions createCancelReason`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}/cancel-reason`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({other:d(r.other,`other`,`text`),reason_code:r[`reason-code`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.subscriptions.createCancelReason({...e,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`});return}let p=u({other:d(r.other,`other`,`text`),reason_code:r[`reason-code`]});o(await c(`Creating`,async()=>i.accounts.subscriptions.createCancelReason({...p,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`})}};function Xe(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,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 Ze={command:`delete <subscription-identifier>`,describe:`Deletes an account's subscription.`,builder:Xe,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
23
|
-
`);return}o(await c(`Deleting`,async()=>i.accounts.subscriptions.delete({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Deleted`})}};function Qe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $e={command:`get`,describe:`Lists all of an account or zone's subscriptions.`,builder:Qe,handler:async i=>{if(i.dryRun){let e=i.zone===void 0?await n():void 0,t=i.zone===void 0?`accounts`:`zones`,r=i.zone??e??`<account-id>`;s({command:`cf accounts subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/subscriptions`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();u===`zones`?i.zoneId=d:i.accountId=d,o(await c(`Loading`,async()=>l.accounts.subscriptions.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function et(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tt={command:`getByIdentifier <subscription-identifier>`,describe:`Gets an account subscription by identifier.`,builder:et,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions getByIdentifier`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.subscriptions.getByIdentifier({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Loaded`})}};function nt(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`getCancelReason <subscription-identifier>`,describe:`Gets the cancellation reason for an account subscription.`,builder:nt,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions getCancelReason`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}/cancel-reason`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.subscriptions.getCancelReason({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Loaded`})}};function it(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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 at={command:`update <subscription-identifier>`,describe:`Updates an account subscription.`,builder:it,handler:async r=>{if(r.dryRun){s({command:`cf accounts subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({app:{install_id:d(r[`app-install-id`],`app-install-id`,`text`)},frequency:d(r.frequency,`frequency`,`text`),rate_plan:{currency:d(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:d(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:d(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.accounts.subscriptions.update({body:e,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`});return}let p=u({app:{install_id:d(r[`app-install-id`],`app-install-id`,`text`)},frequency:d(r.frequency,`frequency`,`text`),rate_plan:{currency:d(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:d(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:d(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}});o(await c(`Updating`,async()=>i.accounts.subscriptions.update({body:p,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`})}},ot={command:`subscriptions`,describe:`View and manage plan subscriptions attached to this account`,builder:e=>e.command(Ge).command(qe).command(Ye).command(Ze).command($e).command(tt).command(rt).command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).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 ct={command:`create`,describe:`Create a new Account Owned API token.`,builder:st,handler:async r=>{if(r.dryRun){s({command:`cf accounts tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.accounts.tokens.create({body:e,account_id:p})),{successLabel:`Created`});return}r.name===void 0&&(r.name=await f(`name`,`Token name.`));let m=u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`)});o(await c(`Creating`,async()=>i.accounts.tokens.create({body:m,account_id:p})),{successLabel:`Created`})}};function lt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,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 ut={command:`delete <token-id>`,describe:`Destroy an Account Owned API token.`,builder:lt,handler:async r=>{if(r.dryRun){s({command:`cf accounts tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
24
|
-
`);return}
|
|
21
|
+
`,choices:[`accepted`,`pending`]}).option(`policies`,{type:`string`,description:`Array of policies associated with this member. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`roles`,[`policies`]).conflicts(`policies`,[`roles`])}const Pe={command:`create`,describe:`Add a user to the list of members for this account.`,builder:Ne,handler:async r=>{if(r.dryRun){o({command:`cf accounts members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({email:d(r.email,`email`,`text`),roles:r.roles,status:d(r.status,`status`,`text`),policies:l(r.policies,`policies`)}):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.accounts.members.create({body:e,account_id:m})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await f(`email`,`The contact email address of the user.`));let h=u({email:d(r.email,`email`,`text`),roles:r.roles,status:d(r.status,`status`,`text`),policies:l(r.policies,`policies`)});a(await s(`Creating`,async()=>p.accounts.members.create({body:h,account_id:m})),{successLabel:`Created`})}};function Fe(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,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 Ie={command:`delete <member-id>`,describe:`Remove a member from an account.`,builder:Fe,handler:async r=>{if(r.dryRun){o({command:`cf accounts members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure you want to remove this user from the account?`})){process.stderr.write(`Aborted.
|
|
22
|
+
`);return}a(await s(`Deleting`,async()=>c.accounts.members.delete({account_id:l,member_id:r[`member-id`]})),{successLabel:`Deleted`})}};function Le(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`get <member-id>`,describe:`Get information about a specific member of an account.`,builder:Le,handler:async r=>{if(r.dryRun){o({command:`cf accounts members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.members.get({account_id:l,member_id:r[`member-id`]})),{successLabel:`Loaded`})}};function ze(e){return e.option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`user.first_name`,`user.last_name`,`user.email`,`status`]}).option(`status`,{type:`string`,description:`A member's status in the account.`,choices:[`accepted`,`pending`,`rejected`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`list`,describe:`List all members of an account.`,builder:m(ze),handler:async r=>{let c={order:r.order,status:r.status,page:r.page,per_page:r[`per-page`],direction:r.direction};if(r.dryRun){o({command:`cf accounts members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.members.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Ve(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`roles`,{type:`string`,description:`Roles assigned to this member. Provide as a JSON array of objects or @path/to/file.json.`}).option(`policies`,{type:`string`,description:`Array of policies associated with this member. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`roles`,[`policies`]).conflicts(`policies`,[`roles`])}const He={command:`update <member-id>`,describe:`Modify an account member.`,builder:Ve,handler:async r=>{if(r.dryRun){o({command:`cf accounts members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({roles:l(r.roles,`roles`),policies:l(r.policies,`policies`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.accounts.members.update({body:e,account_id:f,member_id:r[`member-id`]})),{successLabel:`Updated`});return}let p=u({roles:l(r.roles,`roles`),policies:l(r.policies,`policies`)});a(await s(`Updating`,async()=>d.accounts.members.update({body:p,account_id:f,member_id:r[`member-id`]})),{successLabel:`Updated`})}},Ue={command:`members`,describe:`Operations for members`,builder:e=>e.command(Pe).command(Ie).command(Re).command(Be).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function We(e){return e.option(`subscription-ids`,{type:`string`,array:!0,description:`List of subscription identifiers to cancel downgrades for.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ge={command:`cancelDelayedDowngrade`,describe:`Cancels pending delayed downgrades for the specified subscriptions.`,builder:We,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions cancelDelayedDowngrade`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/cancel-downgrade`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({subscription_ids:r[`subscription-ids`]}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.subscriptions.cancelDelayedDowngrade({...e,account_id:d})),{successLabel:`Created`});return}let f=u({subscription_ids:r[`subscription-ids`]});a(await s(`Creating`,async()=>l.accounts.subscriptions.cancelDelayedDowngrade({...f,account_id:d})),{successLabel:`Created`})}};function Ke(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`component-values`,{type:`string`,description:`Configurable component values for the subscription. Provide as a JSON array of objects or @path/to/file.json.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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 qe={command:`create`,describe:`Creates an account or zone subscription.`,builder:Ke,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf accounts subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/subscriptions`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?u({app:{install_id:d(f[`app-install-id`],`app-install-id`,`text`)},component_values:l(f[`component-values`],`component-values`),frequency:d(f.frequency,`frequency`,`text`),rate_plan:{currency:d(f[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:f[`rate-plan-externally-managed`],id:d(f[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:f[`rate-plan-is-contract`],public_name:d(f[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(f[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:f[`rate-plan-sets`]}}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.accounts.subscriptions.create({body:e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}let g=u({app:{install_id:d(f[`app-install-id`],`app-install-id`,`text`)},component_values:l(f[`component-values`],`component-values`),frequency:d(f.frequency,`frequency`,`text`),rate_plan:{currency:d(f[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:f[`rate-plan-externally-managed`],id:d(f[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:f[`rate-plan-is-contract`],public_name:d(f[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(f[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:f[`rate-plan-sets`]}});a(await s(`Creating`,async()=>p.accounts.subscriptions.create({body:g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function Je(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`other`,{type:`string`,description:`Additional cancellation details.`}).option(`reason-code`,{type:`string`,array:!0,description:`The cancellation reason codes.`}).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 Ye={command:`createCancelReason <subscription-identifier>`,describe:`Records a cancellation reason for an account subscription.`,builder:Je,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions createCancelReason`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}/cancel-reason`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({other:d(r.other,`other`,`text`),reason_code:r[`reason-code`]}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.subscriptions.createCancelReason({...e,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`});return}let p=u({other:d(r.other,`other`,`text`),reason_code:r[`reason-code`]});a(await s(`Creating`,async()=>l.accounts.subscriptions.createCancelReason({...p,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`})}};function Xe(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,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 Ze={command:`delete <subscription-identifier>`,describe:`Deletes an account's subscription.`,builder:Xe,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
23
|
+
`);return}a(await s(`Deleting`,async()=>c.accounts.subscriptions.delete({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Deleted`})}};function Qe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $e={command:`get`,describe:`Lists all of an account or zone's subscriptions.`,builder:Qe,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf accounts subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/subscriptions`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.accounts.subscriptions.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function et(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tt={command:`getByIdentifier <subscription-identifier>`,describe:`Gets an account subscription by identifier.`,builder:et,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions getByIdentifier`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.subscriptions.getByIdentifier({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Loaded`})}};function nt(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`getCancelReason <subscription-identifier>`,describe:`Gets the cancellation reason for an account subscription.`,builder:nt,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions getCancelReason`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}/cancel-reason`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.subscriptions.getCancelReason({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Loaded`})}};function it(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`component-values`,{type:`string`,description:`Configurable component values for the subscription. Provide as a JSON array of objects or @path/to/file.json.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).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 at={command:`update <subscription-identifier>`,describe:`Updates an account subscription.`,builder:it,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({app:{install_id:d(r[`app-install-id`],`app-install-id`,`text`)},component_values:l(r[`component-values`],`component-values`),frequency:d(r.frequency,`frequency`,`text`),rate_plan:{currency:d(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:d(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:d(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.accounts.subscriptions.update({body:e,account_id:p,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`});return}let m=u({app:{install_id:d(r[`app-install-id`],`app-install-id`,`text`)},component_values:l(r[`component-values`],`component-values`),frequency:d(r.frequency,`frequency`,`text`),rate_plan:{currency:d(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:d(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:d(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}});a(await s(`Updating`,async()=>f.accounts.subscriptions.update({body:m,account_id:p,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`})}},ot={command:`subscriptions`,describe:`View and manage plan subscriptions attached to this account`,builder:e=>e.command(Ge).command(qe).command(Ye).command(Ze).command($e).command(tt).command(rt).command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).option(`policies`,{type:`string`,description:`List of access policies assigned to the token. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ct={command:`create`,describe:`Create a new Account Owned API token.`,builder:st,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),policies:l(r.policies,`policies`)}):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.accounts.tokens.create({body:e,account_id:m})),{successLabel:`Created`});return}if(r.name===void 0&&(r.name=await f(`name`,`Token name.`)),r.policies===void 0)throw Error(`--policies is required (or pass --body with this field set).`);let h=u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),policies:l(r.policies,`policies`)});a(await s(`Creating`,async()=>p.accounts.tokens.create({body:h,account_id:m})),{successLabel:`Created`})}};function lt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,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 ut={command:`delete <token-id>`,describe:`Destroy an Account Owned API token.`,builder:lt,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
24
|
+
`);return}a(await s(`Deleting`,async()=>c.accounts.tokens.delete({account_id:l,token_id:r[`token-id`]})),{successLabel:`Deleted`})}};function dt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ft={command:`get <token-id>`,describe:`Get information about a specific Account Owned API token.`,builder:dt,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.tokens.get({account_id:l,token_id:r[`token-id`]})),{successLabel:`Loaded`})}};function $(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`include-expired`,{type:`boolean`,description:`When true, includes recently-expired tokens in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pt={command:`list`,describe:`List all Account Owned API tokens created for this account. Results include active, disabled, and recently-expired tokens when include_expired is set to true.`,builder:m($),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],direction:r.direction,include_expired:r[`include-expired`]};if(r.dryRun){o({command:`cf accounts tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.tokens.list({account_id:u,...c})),{successLabel:`Loaded`})}};function mt(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
|
|
25
25
|
The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group.
|
|
26
|
-
The value must be URL-encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ht={command:`list`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:mt,handler:async r=>{let
|
|
27
|
-
`);return}
|
|
28
|
-
Two-Factor Authentication is enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tt={command:`update`,describe:`Update an existing account.`,builder:wt,handler:async r=>{if(r.dryRun){
|
|
26
|
+
The value must be URL-encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ht={command:`list`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:mt,handler:async r=>{let c={name:r.name,scope:r.scope};if(r.dryRun){o({command:`cf accounts tokens permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/permission_groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.tokens.permissionGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}},gt={command:`permission-groups`,describe:`Operations for tokens.permission-groups`,builder:e=>e.command(ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _t(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,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 vt={command:`roll <token-id>`,describe:`Roll the Account Owned API token secret.`,builder:_t,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens roll`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}/value`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Rolling this token will invalidate the current secret and generate a new one. Any integrations using the current secret will stop working.`})){process.stderr.write(`Aborted.
|
|
27
|
+
`);return}a(await s(`Deleting`,async()=>c.accounts.tokens.roll({account_id:l,token_id:r[`token-id`]})),{successLabel:`Deleted`})}};function yt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).option(`policies`,{type:`string`,description:`List of access policies assigned to the token. Provide as a JSON array of objects or @path/to/file.json.`}).option(`status`,{type:`string`,description:`Status of the token.`,choices:[`active`,`disabled`,`expired`]}).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 bt={command:`update <token-id>`,describe:`Update an existing token.`,builder:yt,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),policies:l(r.policies,`policies`),status:d(r.status,`status`,`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(`Updating`,async()=>p.accounts.tokens.update({body:e,account_id:m,token_id:r[`token-id`]})),{successLabel:`Updated`});return}if(r.name===void 0&&(r.name=await f(`name`,`Token name.`)),r.policies===void 0)throw Error(`--policies is required (or pass --body with this field set).`);let h=u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),policies:l(r.policies,`policies`),status:d(r.status,`status`,`text`)});a(await s(`Updating`,async()=>p.accounts.tokens.update({body:h,account_id:m,token_id:r[`token-id`]})),{successLabel:`Updated`})}};function xt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`verify`,describe:`Test whether a token works.`,builder:xt,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens verify`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/verify`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.tokens.verify({account_id:l})),{successLabel:`Loaded`})}},Ct={command:`tokens`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(ct).command(ut).command(ft).command(pt).command(vt).command(bt).command(St).command(gt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function wt(e){return e.option(`id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`Account name`}).option(`settings-abuse-contact-email`,{type:`string`,description:`Sets an abuse contact email to notify for abuse reports.`}).option(`settings-enforce-twofactor`,{type:`boolean`,description:`Indicates whether membership in this account requires that
|
|
28
|
+
Two-Factor Authentication is enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tt={command:`update`,describe:`Update an existing account.`,builder:wt,handler:async r=>{if(r.dryRun){o({command:`cf accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({id:d(r.id,`id`,`text`),name:d(r.name,`name`,`text`),settings:{abuse_contact_email:d(r[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:r[`settings-enforce-twofactor`]}}):c(r.body)});return}let l=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.accounts.update({body:e,account_id:p})),{successLabel:`Updated`});return}r.id===void 0&&(r.id=await f(`id`,`Identifier`)),r.name===void 0&&(r.name=await f(`name`,`Account name`));let m=u({id:d(r.id,`id`,`text`),name:d(r.name,`name`,`text`),settings:{abuse_contact_email:d(r[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:r[`settings-enforce-twofactor`]}});a(await s(`Updating`,async()=>l.accounts.update({body:m,account_id:p})),{successLabel:`Updated`})}},Et={command:`accounts`,describe:`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,builder:e=>e.command(ve).command(be).command(Se).command(we).command(Tt).command(D).command(le).command(ge).command(Me).command(Ue).command(ot).command(Ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Et as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-DAa7SwkM.mjs";import{r as t}from"./auth-DY_Y2bXC.mjs";import{t as n}from"./output-BqDR9h74.mjs";import{t as r}from"./dry-run-ILZRVpnp.mjs";import{t as i}from"./progress-jYW64HY7.mjs";import{n as a,t as o}from"./body-parser-BGVbwPeM.mjs";import{n as s}from"./input-validation-1esLElok.mjs";import{a as c,n as l}from"./prompt-CyATfGUu.mjs";function u(e){return e.option(`certificate`,{type:`string`,description:`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`create`,describe:`Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`,builder:u,handler:async l=>{if(l.dryRun){r({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({certificate:s(l.certificate,`certificate`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.acm.customTrustStore.create({...e,zone_id:d})),{successLabel:`Created`});return}l.certificate===void 0&&(l.certificate=await c(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let f=o({certificate:s(l.certificate,`certificate`,`text`)});n(await i(`Creating`,async()=>u.acm.customTrustStore.create({...f,zone_id:d})),{successLabel:`Created`})}};function f(e){return e.positional(`custom-origin-trust-store-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <custom-origin-trust-store-id>`,describe:`Removes a root CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/custom_trust_store/${a[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(a[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(a[`custom-origin-trust-store-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>o.acm.customTrustStore.delete({zone_id:s,custom_origin_trust_store_id:a[`custom-origin-trust-store-id`]})),{successLabel:`Deleted`})}};function m(e){return e.positional(`custom-origin-trust-store-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <custom-origin-trust-store-id>`,describe:`Retrieves details about a specific root CA certificate in the custom origin trust store, including expiration and subject information.`,builder:m,handler:async a=>{if(a.dryRun){r({command:`cf acm custom-trust-store get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/custom_trust_store/${a[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(a[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(a[`custom-origin-trust-store-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.acm.customTrustStore.get({zone_id:s,custom_origin_trust_store_id:a[`custom-origin-trust-store-id`]})),{successLabel:`Loaded`})}};function g(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Get Custom Origin Trust Store for a Zone.`,builder:g,handler:async a=>{let o={page:a.page,per_page:a[`per-page`],limit:a.limit,offset:a.offset};if(a.dryRun){r({command:`cf acm custom-trust-store list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.acm.customTrustStore.list({zone_id:c,...o})),{successLabel:`Loaded`})}},v={command:`custom-trust-store`,describe:`Operations for custom-trust-store`,builder:e=>e.command(d).command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`certificate-authority`,{type:`string`,description:`The Certificate Authority that Total TLS certificates will be issued through.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`enabled`,{type:`boolean`,description:`If enabled, Total TLS will order a hostname specific TLS certificate for any proxied A, AAAA, or CNAME record in your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`edit`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:y,handler:async c=>{if(c.dryRun){r({command:`cf acm total-tls edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({certificate_authority:s(c[`certificate-authority`],`certificate-authority`,`text`),enabled:c.enabled}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.acm.totalTls.edit({...e,zone_id:u})),{successLabel:`Created`});return}if(c.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=o({certificate_authority:s(c[`certificate-authority`],`certificate-authority`,`text`),enabled:c.enabled});n(await i(`Creating`,async()=>l.acm.totalTls.edit({...d,zone_id:u})),{successLabel:`Created`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Get Total TLS Settings for a Zone.`,builder:x,handler:async a=>{if(a.dryRun){r({command:`cf acm total-tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.acm.totalTls.get({zone_id:s})),{successLabel:`Loaded`})}},C={command:`total-tls`,describe:`Operations for total-tls`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`acm`,describe:`acm`,builder:e=>e.command(v).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|