cf 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +55 -55
- package/dist/_meta/commands.json +24282 -24542
- package/dist/_meta/hand-written-commands.json +53 -12
- package/dist/_meta/schemas.json +27680 -28212
- package/dist/abuse-reports-BbaHw4ST.mjs +8 -0
- package/dist/access-D6Xz892p.mjs +11 -0
- package/dist/account-DvxcqeaK.mjs +2 -0
- package/dist/account-tags-CeqfEWpz.mjs +9 -0
- package/dist/accounts-Bx-8BMH9.mjs +30 -0
- package/dist/acm--0opdSGE.mjs +3 -0
- package/dist/addressing-BS1ynzLA.mjs +13 -0
- package/dist/agent-context-BPhyrSns.mjs +8 -0
- package/dist/agent-memory-DczzpEw5.mjs +6 -0
- package/dist/ai-CDdCTcQl.mjs +5 -0
- package/dist/ai-audit-Bx9KMQYh.mjs +2 -0
- package/dist/ai-gateway-BSXJEaYS.mjs +13 -0
- package/dist/ai-search-DRQj1aMu.mjs +7 -0
- package/dist/ai-security-C_Rb0lGT.mjs +4 -0
- package/dist/alerting-BAR9eFs2.mjs +6 -0
- package/dist/analytics-BaUZwNc5.mjs +4 -0
- package/dist/analytics_engine-DkEzlhfT.mjs +2 -0
- package/dist/api-security-jA0lOk6a.mjs +50 -0
- package/dist/argo-Cz4pDagx.mjs +2 -0
- package/dist/artifacts-BcLTGfAv.mjs +5 -0
- package/dist/audit-logs-DbIv4n6u.mjs +2 -0
- package/dist/auth-rW5d3jtr.mjs +5 -0
- package/dist/auth-tvDdC1J-.mjs +8 -0
- package/dist/billing-Md87QjqW.mjs +3 -0
- package/dist/bot-management-VHMo4hpU.mjs +5 -0
- package/dist/botnet-feed-BHqfo3sa.mjs +3 -0
- package/dist/brand-protection-HUeR6Pof.mjs +3 -0
- package/dist/browser-extension-199oZg3X.mjs +3 -0
- package/dist/browser-run-DDasyux-.mjs +4 -0
- package/dist/build-0QlYUfFS.mjs +2 -0
- package/dist/builds-B-lXn6JR.mjs +9 -0
- package/dist/cache-CevKpiTM.mjs +9 -0
- package/dist/certificate-authorities-DAg-aO1B.mjs +2 -0
- package/dist/{cf-yPz_IqW6.mjs → cf-C11NGkjx.mjs} +1 -1
- package/dist/{chunk-LQW53VED-9MACsvSG.mjs → chunk-LQW53VED-CoECHA3R.mjs} +1 -1
- package/dist/{chunk-QBZBEHZB-yeyhVUeD.mjs → chunk-QBZBEHZB-BuiXJn8j.mjs} +1 -1
- package/dist/client-certificates-Bay7oPLE.mjs +3 -0
- package/dist/client-side-security-CbU9xn0k.mjs +37 -0
- package/dist/cloud-connector-AH2ClcSL.mjs +2 -0
- package/dist/cloudforce-one-DwOfS75V.mjs +32 -0
- package/dist/{command-BV87D4tR.mjs → command-CMzMsll4.mjs} +1 -1
- package/dist/{completions-BnD46cXe.mjs → completions-nPO9PdSu.mjs} +1 -1
- package/dist/config-B8lwPpVl.mjs +2 -0
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-DcLrqM2V.mjs +2 -0
- package/dist/connector-telemetry-events-PrJWgNs9.mjs +2 -0
- package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +2 -0
- package/dist/connectors-CEAy30E-.mjs +3 -0
- package/dist/containers-BsbDqbSn.mjs +58 -0
- package/dist/content-scan-BdK936iO.mjs +4 -0
- package/dist/cps-oP97-qkm.mjs +2 -0
- package/dist/csamScanner-DUNN4INg.mjs +6 -0
- package/dist/ct-alerting-dV_gsV2w.mjs +3 -0
- package/dist/custom-certificates-DYspvjo4.mjs +5 -0
- package/dist/custom-csrs-DjSWLQRu.mjs +3 -0
- package/dist/custom-hostnames-df1lH6IY.mjs +5 -0
- package/dist/custom-nameservers-CLTbN-9R.mjs +3 -0
- package/dist/custom-pages-DzKnSgL3.mjs +3 -0
- package/dist/d1-JBEqjJoj.mjs +20 -0
- package/dist/data-security-CIktWnXt.mjs +7 -0
- package/dist/dcv-delegation-_r6Vc6VL.mjs +2 -0
- package/dist/{deploy-BUSz35vq.mjs → deploy-QTGENpOM.mjs} +1 -1
- package/dist/{deploy-input-BvD9aRP1.mjs → deploy-input-C7W1Bsji.mjs} +1 -1
- package/dist/{dev-DY_DquQx.mjs → dev-CAubuxCc.mjs} +1 -1
- package/dist/diagnostics-B0DRh714.mjs +3 -0
- package/dist/{dist-DV7LR38l.mjs → dist-12KzRsBM.mjs} +36 -36
- package/dist/{dist-BBx1io2f.mjs → dist-BCVqQpg2.mjs} +1 -1
- package/dist/dist-Cp3uJN1x.mjs +48 -0
- package/dist/dist-DW5BPGFs.mjs +57 -0
- package/dist/{dist-Cb9TJ2VV.mjs → dist-S9K_8gq9.mjs} +1 -1
- package/dist/dls-CFzTHcZM.mjs +3 -0
- package/dist/dns-Dw6u-NV1.mjs +29 -0
- package/dist/dns-firewall-CIPptslp.mjs +57 -0
- package/dist/{dot-prop-6SRZBKHT-wwGHcwAa.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
- package/dist/dry-run-DiVy1lVo.mjs +2 -0
- package/dist/durable-objects-CCkeqqBq.mjs +2 -0
- package/dist/email-auth-kdxO51Oz.mjs +2 -0
- package/dist/email-routing-BLggZdQq.mjs +6 -0
- package/dist/email-security-DjADlgdM.mjs +18 -0
- package/dist/email-sending-Cz7E7GoP.mjs +7 -0
- package/dist/error-sanitization-DfLijlBJ.mjs +2 -0
- package/dist/fieldExtractors-BWaMi6lD.mjs +3 -0
- package/dist/firewall-5t6OBIOl.mjs +8 -0
- package/dist/flagship-CzG_VoNR.mjs +4 -0
- package/dist/fraud-UOg_69Ob.mjs +20 -0
- package/dist/google-tag-gateway-DirkD-Q2.mjs +2 -0
- package/dist/healthchecks-BkHZGTp1.mjs +4 -0
- package/dist/hostnames-EUYOZm21.mjs +3 -0
- package/dist/hyperdrive-ZoLJlJCL.mjs +21 -0
- package/dist/iam-BQ2xSgYN.mjs +6 -0
- package/dist/images-CkEq6ScP.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-DDWEdGyl.mjs +8 -0
- package/dist/interactive-B2E03Fs-.mjs +11 -0
- package/dist/interactive-_B-EqD0Y.mjs +23 -0
- package/dist/ips-54Qmy-Uw.mjs +2 -0
- package/dist/keyless-certificates-CXHLc3Qz.mjs +3 -0
- package/dist/keys-rvI4TC3Z.mjs +2 -0
- package/dist/kv-CAeN1zBy.mjs +5 -0
- package/dist/leaked-credential-checks-CbbwtG-p.mjs +4 -0
- package/dist/lifecycle-XswDq0ZB.mjs +2 -0
- package/dist/load-balancers-BFwdwAIU.mjs +6 -0
- package/dist/{local-DGiIS1uM.mjs → local-C6XsFD_W.mjs} +1 -1
- package/dist/{local-runtime--IQr44qq.mjs → local-runtime-BUGCbx8r.mjs} +1 -1
- package/dist/logexplorer-D8rOPB5I.mjs +17 -0
- package/dist/logo-matches-Y3PxVn7t.mjs +2 -0
- package/dist/logos-BN8SvJhS.mjs +3 -0
- package/dist/logpush-BnLA4WVm.mjs +4 -0
- package/dist/logs-CDo7Y5sA.mjs +3 -0
- package/dist/magic-cloud-networking-wPuLwu-F.mjs +5 -0
- package/dist/magic-network-monitoring-BNERUpxS.mjs +4 -0
- package/dist/magic-transit-6tvVOECW.mjs +111 -0
- package/dist/managed-defense-AYwBOYIH.mjs +2 -0
- package/dist/managed-transforms-HZZNrkC7.mjs +3 -0
- package/dist/matches-Dp91L3dL.mjs +2 -0
- package/dist/mcp-P7pcieiT.mjs +4 -0
- package/dist/mesh-DjFrk6PL.mjs +4 -0
- package/dist/mtls-certificates-DZMoef2H.mjs +3 -0
- package/dist/network-7cd1U6-I.mjs +6 -0
- package/dist/network-interconnects-CQ7cPZjK.mjs +41 -0
- package/dist/oauth-DH3kMXSs.mjs +14 -0
- package/dist/oauth-clients-P9t-eMnx.mjs +4 -0
- package/dist/oauth-scopes-C3r9Qh_y.mjs +2 -0
- package/dist/observability-M1DnLhMR.mjs +10 -0
- package/dist/{open-PBXRGS4R-DIiYQyU9.mjs → open-PBXRGS4R-DARSUDEI.mjs} +1 -1
- package/dist/organization-cUE7GDCt.mjs +45 -0
- package/dist/organizations-C-Hcpd0w.mjs +2 -0
- package/dist/origin-ca-certificates-C8cJMyQH.mjs +3 -0
- package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +2 -0
- package/dist/origin-tls-client-auth-BsjR5EAV.mjs +4 -0
- package/dist/{output-BqDR9h74.mjs → output-COcSQsfn.mjs} +1 -1
- package/dist/page-rules-B-zq1EUb.mjs +27 -0
- package/dist/pages-B6YpkPos.mjs +14 -0
- package/dist/pay-per-crawl-B4wx0lUb.mjs +4 -0
- package/dist/pipelines-BJc_RylD.mjs +6 -0
- package/dist/precursor-CLQu7suY.mjs +4 -0
- package/dist/progress-V6SZV3Ux.mjs +2 -0
- package/dist/prompt-DjRTpML4.mjs +3 -0
- package/dist/queries-DSrrket-.mjs +3 -0
- package/dist/queues-Tf7kPBpn.mjs +7 -0
- package/dist/r2-DmKNnxtC.mjs +25 -0
- package/dist/r2-data-catalog-DBxoifOq.mjs +16 -0
- package/dist/radar-Csk7Ab-b.mjs +2 -0
- package/dist/rate-limits-cdChIg_S.mjs +2 -0
- package/dist/raw-fetch-BVYQR6C5.mjs +2 -0
- package/dist/realtime-CDehZVhV.mjs +20 -0
- package/dist/registrar-sandbox-BxVdfnam.mjs +56 -0
- package/dist/registrar-vflzeNQ9.mjs +43 -0
- package/dist/{registry-5-I2XLwF.mjs → registry-CWUfXloz.mjs} +1 -1
- package/dist/reporting-BaPZ1PHN.mjs +2 -0
- package/dist/request-headers-CC4eHmI2.mjs +3 -0
- package/dist/request-tracers-C_UVBexV.mjs +2 -0
- package/dist/resource-sharing-CoB4S9j1.mjs +6 -0
- package/dist/resource-tagging-CUiUC5g4.mjs +2 -0
- package/dist/rules-4O8076_s.mjs +4 -0
- package/dist/rulesets-C84MxTYo.mjs +5 -0
- package/dist/rum-Bvwkrntx.mjs +4 -0
- package/dist/run-CRfinkSe.mjs +2 -0
- package/dist/schema-C8hU6G9R.mjs +2 -0
- package/dist/{schema-flags-CTfQVGCs.mjs → schema-flags-DC4c6dka.mjs} +1 -1
- package/dist/scim-BvxQmde6.mjs +4 -0
- package/dist/{sdk-ZctLa5jW.mjs → sdk-C12y5qCN.mjs} +2 -2
- package/dist/secrets-store-DOKWiC-j.mjs +7 -0
- package/dist/security-center-Bhy_aC-w.mjs +2 -0
- package/dist/security-txt-L7HJ9tq5.mjs +3 -0
- package/dist/{shared-DlKGNPiT.mjs → shared-YJtB5KZB.mjs} +17 -17
- package/dist/smart-shield-COMXuQ1S.mjs +4 -0
- package/dist/snippets-DffQhlKt.mjs +4 -0
- package/dist/{spawn-C3_tJ3RB.mjs → spawn-C1AISA2V.mjs} +3 -3
- package/dist/spectrum-Cmf7SqQE.mjs +63 -0
- package/dist/speed-m8cdhLFS.mjs +4 -0
- package/dist/src-C8phrg-8.mjs +109 -0
- package/dist/ssl-D4ffsdSw.mjs +15 -0
- package/dist/{startup-profile-Dpxg-MjV.mjs → startup-profile-Dx95Y5cl.mjs} +1 -1
- package/dist/state-CHif8Y5I.mjs +2 -0
- package/dist/stream-DPF5fojV.mjs +16 -0
- package/dist/submit-Br8hfP0_.mjs +2 -0
- package/dist/tags-Bnt4JuxQ.mjs +2 -0
- package/dist/telemetry-Ch1vCICm.mjs +2 -0
- package/dist/telemetry-DjGNSlkU.mjs +5 -0
- package/dist/tenant-D8u0CxoC.mjs +2 -0
- package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +3 -0
- package/dist/{tools-j8UGEtP1.mjs → tools-D9RZkZRc.mjs} +1 -1
- package/dist/tunnels-BkNPpTHa.mjs +5 -0
- package/dist/turnstile-MgwRECJv.mjs +23 -0
- package/dist/ui-DQSZeaG5.mjs +5 -0
- package/dist/url-info-Ddp7MgcI.mjs +2 -0
- package/dist/url-normalization-3ptK9ntV.mjs +3 -0
- package/dist/url-scanner-Psb9ollR.mjs +2 -0
- package/dist/user-DWdshcIu.mjs +12 -0
- package/dist/values-CDKQL1z2.mjs +2 -0
- package/dist/vectorize-CTYYUyQj.mjs +4 -0
- package/dist/waiting-rooms-BUdmwXDY.mjs +11 -0
- package/dist/web-assets-CpDwDEx8.mjs +8 -0
- package/dist/web3-YsjDyAzH.mjs +4 -0
- package/dist/workers-BKKxaZcz.mjs +6 -0
- package/dist/workers-builds-BWo5vUA9.mjs +2 -0
- package/dist/workers-for-platforms-ASJsxYdM.mjs +5 -0
- package/dist/workers-vpc-RkTnRvA2.mjs +3 -0
- package/dist/workflows-KrIFI9ns.mjs +5 -0
- package/dist/zaraz-DglXbVzZ.mjs +2 -0
- package/dist/zero-trust-RilTdSjX.mjs +91 -0
- package/dist/zone-DsBtVkvT.mjs +2 -0
- package/dist/zones-BFxvWFQW.mjs +44 -0
- package/package.json +1 -1
- package/dist/abuse-reports-D40QFl-y.mjs +0 -8
- package/dist/access-Dl2IU1ID.mjs +0 -11
- package/dist/account-CPbieCZ4.mjs +0 -2
- package/dist/account-tags-skfP7H8k.mjs +0 -9
- package/dist/accounts-CSgR6909.mjs +0 -28
- package/dist/acm-CVvCTaNk.mjs +0 -3
- package/dist/addressing-Uq5hEDDP.mjs +0 -13
- package/dist/agent-context-BvuDdaJb.mjs +0 -8
- package/dist/agent-memory-BrHMIU0E.mjs +0 -6
- package/dist/ai-audit-BoZuL84i.mjs +0 -2
- package/dist/ai-gateway-DE50Jem1.mjs +0 -13
- package/dist/ai-search-Fx7NHCHB.mjs +0 -7
- package/dist/ai-security-DyLbY9kv.mjs +0 -4
- package/dist/ai-v2fP1r0s.mjs +0 -5
- package/dist/alerting-5mFZjTcD.mjs +0 -6
- package/dist/analytics-BygTfozw.mjs +0 -3
- package/dist/analytics_engine-4L-q362P.mjs +0 -2
- package/dist/api-security-DjFsRYWx.mjs +0 -50
- package/dist/argo-TzXPN7tz.mjs +0 -2
- package/dist/args-CDgWUP4J.mjs +0 -2
- package/dist/artifacts-dEw2UUBV.mjs +0 -4
- package/dist/audit-logs-CqY7zzwv.mjs +0 -2
- package/dist/auth-CPLdkOC7.mjs +0 -5
- package/dist/auth-DY_Y2bXC.mjs +0 -9
- package/dist/billing-DHQuRT8S.mjs +0 -3
- package/dist/bot-management-CfqG79hF.mjs +0 -5
- package/dist/botnet-feed-BOeNnDoH.mjs +0 -3
- package/dist/brand-protection-DYttrKIM.mjs +0 -3
- package/dist/browser-extension-CTUCdgfn.mjs +0 -3
- package/dist/browser-run-373D4e1i.mjs +0 -4
- package/dist/build-D0ir_S70.mjs +0 -2
- package/dist/cache-DJXBmc3w.mjs +0 -7
- package/dist/calls-COO0Eoz1.mjs +0 -4
- package/dist/certificate-authorities-DbHLmKbd.mjs +0 -2
- package/dist/client-certificates-RBRqYP3f.mjs +0 -3
- package/dist/client-side-security-HOmA37et.mjs +0 -37
- package/dist/cloud-connector-C7hw1c1f.mjs +0 -2
- package/dist/cloudforce-one-DLOj76q4.mjs +0 -36
- package/dist/connector-interrupts-DY-z_LrH.mjs +0 -2
- package/dist/connector-telemetry-events-DCXmcAc9.mjs +0 -2
- package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +0 -2
- package/dist/connectors-fEOn-J_i.mjs +0 -3
- package/dist/containers-BDBsEs7-.mjs +0 -58
- package/dist/content-scan-Cmj9--XY.mjs +0 -4
- package/dist/csamScanner-BRXyMCyH.mjs +0 -6
- package/dist/ct-alerting-9AvYys-f.mjs +0 -3
- package/dist/custom-certificates-C5qrlyhb.mjs +0 -5
- package/dist/custom-csrs-BgOnTbBW.mjs +0 -3
- package/dist/custom-hostnames-CbQD9aYo.mjs +0 -5
- package/dist/custom-nameservers-2ZajBkRC.mjs +0 -3
- package/dist/custom-pages-Buki_Cb8.mjs +0 -3
- package/dist/d1-n2in0cSF.mjs +0 -20
- package/dist/data-security-DzOQMkv3.mjs +0 -7
- package/dist/dcv-delegation-BTP9LCOm.mjs +0 -2
- package/dist/diagnostics-BvHV8kQb.mjs +0 -3
- package/dist/directory-BeiSyg8A.mjs +0 -3
- package/dist/dispatch-namespaces-Dp8Jjpwy.mjs +0 -7
- package/dist/dist-DvizctjW.mjs +0 -48
- package/dist/dls-BwoU29mS.mjs +0 -3
- package/dist/dns-DISAfuzj.mjs +0 -29
- package/dist/dns-firewall-wBcCx_ua.mjs +0 -57
- package/dist/dry-run-ILZRVpnp.mjs +0 -2
- package/dist/durable-objects-DhDL3San.mjs +0 -2
- package/dist/email-auth-BROqK6-C.mjs +0 -2
- package/dist/email-routing-BZXHDAOO.mjs +0 -6
- package/dist/email-security-DVumybrk.mjs +0 -18
- package/dist/email-sending-CDQ3_wyz.mjs +0 -7
- package/dist/fieldExtractors-Cy1rxHEF.mjs +0 -3
- package/dist/firewall-C0g5X7Zd.mjs +0 -11
- package/dist/flagship-fFBiZUz-.mjs +0 -4
- package/dist/fraud-CjIETOaM.mjs +0 -20
- package/dist/google-tag-gateway-hPa5IHUx.mjs +0 -2
- package/dist/healthchecks-CoycpTf9.mjs +0 -4
- package/dist/hostnames-x_Yezxpr.mjs +0 -3
- package/dist/hyperdrive-BlfrTwSq.mjs +0 -21
- package/dist/iam-Bk7K_PPO.mjs +0 -6
- package/dist/images-BAEFb9q1.mjs +0 -8
- package/dist/intel-DDkyJVaP.mjs +0 -8
- package/dist/interactive-CRnq-B5I.mjs +0 -11
- package/dist/interactive-cytQzL94.mjs +0 -78
- package/dist/ips-DU0ti0i0.mjs +0 -2
- package/dist/keyless-certificates-E1P9jBTb.mjs +0 -3
- package/dist/keys-DqldTZqH.mjs +0 -2
- package/dist/kv-CcfCfnwq.mjs +0 -5
- package/dist/leaked-credential-checks-CqmKaEbd.mjs +0 -4
- package/dist/load-balancers-Dg4pDad1.mjs +0 -6
- package/dist/logexplorer-Bu2mG5rh.mjs +0 -17
- package/dist/logo-matches-CWUzxY7G.mjs +0 -2
- package/dist/logos-BTfdkDPi.mjs +0 -3
- package/dist/logpush-BZyay3h2.mjs +0 -4
- package/dist/logs-BqF7jjQO.mjs +0 -3
- package/dist/magic-cloud-networking-Dhd8pTyM.mjs +0 -5
- package/dist/magic-network-monitoring-D0FnkjuN.mjs +0 -4
- package/dist/magic-transit-B5skt0G7.mjs +0 -111
- package/dist/managed-transforms-B6X_crcJ.mjs +0 -3
- package/dist/matches-DeYaB4I0.mjs +0 -2
- package/dist/mcp-ChjBiMx2.mjs +0 -4
- package/dist/mesh-DRVAFLBX.mjs +0 -4
- package/dist/moq-DE7VDEFS.mjs +0 -13
- package/dist/mtls-certificates-Cbc3uAkN.mjs +0 -3
- package/dist/network-CDPZNFbn.mjs +0 -6
- package/dist/network-interconnects-CMRs_chR.mjs +0 -41
- package/dist/oauth-DAa7SwkM.mjs +0 -14
- package/dist/oauth-clients-DAI_gcuL.mjs +0 -4
- package/dist/oauth-scopes-BE6xF4_h.mjs +0 -2
- package/dist/observability-DnyI8rPJ.mjs +0 -4
- package/dist/organization-yh0mSUdI.mjs +0 -41
- package/dist/organizations-B3aU-RCG.mjs +0 -2
- package/dist/origin-ca-certificates-BaNWfVqf.mjs +0 -3
- package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +0 -2
- package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +0 -4
- package/dist/page-rules-CzbyXbt6.mjs +0 -27
- package/dist/pages-CX8yefTI.mjs +0 -14
- package/dist/pay-per-crawl-v4vBOMWD.mjs +0 -4
- package/dist/pipelines-BZ1KGupx.mjs +0 -6
- package/dist/precursor-D42A9ay5.mjs +0 -4
- package/dist/progress-jYW64HY7.mjs +0 -2
- package/dist/project-settings-BN7tL0c7.mjs +0 -3
- package/dist/prompt-CyATfGUu.mjs +0 -3
- package/dist/queries-xvETUjUE.mjs +0 -3
- package/dist/queues-CpqHDtxF.mjs +0 -6
- package/dist/r2-data-catalog-DgKmlTKR.mjs +0 -16
- package/dist/r2-jhmLvD1z.mjs +0 -24
- package/dist/radar-C2J16wpX.mjs +0 -2
- package/dist/rate-limits-CoH9Xma0.mjs +0 -5
- package/dist/raw-fetch-CNKIypJ7.mjs +0 -2
- package/dist/realtimekit-CDs0Z5WW.mjs +0 -7
- package/dist/registrar-BI5ewTAk.mjs +0 -23
- package/dist/registrar-sandbox-al1znWMc.mjs +0 -61
- package/dist/reporting-CxsdHAH3.mjs +0 -2
- package/dist/request-tracers-DJJCncft.mjs +0 -2
- package/dist/resource-sharing-qQGn8AEn.mjs +0 -3
- package/dist/resource-tagging-aTtpX5e5.mjs +0 -2
- package/dist/rules-PpsDU89Q.mjs +0 -4
- package/dist/rulesets-DP12Aqik.mjs +0 -5
- package/dist/rum-DxvpzJYc.mjs +0 -4
- package/dist/schema-DlLbiOJj.mjs +0 -2
- package/dist/scim-DJ4AVU20.mjs +0 -4
- package/dist/secrets-store-D6KDNo_s.mjs +0 -7
- package/dist/security-center-008FMs_z.mjs +0 -2
- package/dist/security-txt-CqcfrhlN.mjs +0 -3
- package/dist/share-D5fzsVAJ.mjs +0 -5
- package/dist/smart-shield-DpFscIk8.mjs +0 -4
- package/dist/snippets-CCKgI2ZX.mjs +0 -4
- package/dist/spectrum-LmdqY3ki.mjs +0 -7
- package/dist/speed-CEK36h3A.mjs +0 -4
- package/dist/src-CEb2fgtT.mjs +0 -108
- package/dist/ssl-ChHUyaQm.mjs +0 -15
- package/dist/state-DeX23Kmg.mjs +0 -2
- package/dist/stream-DfUSELMX.mjs +0 -14
- package/dist/submit-DF2G5CIz.mjs +0 -2
- package/dist/tags-nFJJHlLJ.mjs +0 -2
- package/dist/tenant-CRLw1oRU.mjs +0 -2
- package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +0 -3
- package/dist/tunnel-CMQeBgmb.mjs +0 -5
- package/dist/tunnels-iVA3MrdS.mjs +0 -2
- package/dist/turnstile-DQHP6-_b.mjs +0 -23
- package/dist/ui-DJFcf61J.mjs +0 -5
- package/dist/url-info-BVgdb_pf.mjs +0 -2
- package/dist/url-normalization-BTcxLxIQ.mjs +0 -3
- package/dist/url-scanner-DwuDZLPk.mjs +0 -2
- package/dist/user-I_MbB_KX.mjs +0 -12
- package/dist/values-S-Q7-5o8.mjs +0 -2
- package/dist/vectorize-CNZdF_0A.mjs +0 -4
- package/dist/waiting-rooms-Bo-OSsxu.mjs +0 -11
- package/dist/web-assets-tlFzKdNL.mjs +0 -8
- package/dist/web3-CdbfoZ2x.mjs +0 -4
- package/dist/workers-DQ9Q7czn.mjs +0 -28
- package/dist/workers-builds-CGRhYx-x.mjs +0 -9
- package/dist/workflows-BhEy-crm.mjs +0 -5
- package/dist/zaraz-DbKvA_8C.mjs +0 -2
- package/dist/zero-trust-DrHCPVOc.mjs +0 -93
- package/dist/zone-D2zrbJI2.mjs +0 -2
- package/dist/zones-DrpxQ_-A.mjs +0 -21
- /package/dist/{Page-9ry_XAVC.mjs → Page-C-JHZnIy.mjs} +0 -0
- /package/dist/{alerts-9PR5sQ_z.mjs → alerts-B2SJO4nd.mjs} +0 -0
- /package/dist/{autorag-Bevo1kIH.mjs → autorag-iNjZXw1n.mjs} +0 -0
- /package/dist/{body-parser-BGVbwPeM.mjs → body-parser-DIlfApuJ.mjs} +0 -0
- /package/dist/{brands-C4M04Man.mjs → brands-BrVnNrT3.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-C3w62dek.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
- /package/dist/{chunk-Q72B4Q5Z-DVMMVVEs.mjs → chunk-Q72B4Q5Z-CPy_WJKU.mjs} +0 -0
- /package/dist/{clear-DS0eRXOc.mjs → clear-an9o3dJ3.mjs} +0 -0
- /package/dist/{cli-types-C3nVfpSG.mjs → cli-types-CrSoSMPF.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-CKKG6_pD.mjs → connector-telemetry-events-latest-BqWfopFc.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-Bv5OddJr.mjs → connector-telemetry-snapshots-latest-C1m9U1En.mjs} +0 -0
- /package/dist/{domain-info-BUiaGCEq.mjs → domain-info-B0Ykqv5l.mjs} +0 -0
- /package/dist/{health-vX6Ml2Na.mjs → health-CIUg1C5o.mjs} +0 -0
- /package/dist/{input-validation-1esLElok.mjs → input-validation-BxchZ9jE.mjs} +0 -0
- /package/dist/{internal-ROz7anul.mjs → internal-DmpATljO.mjs} +0 -0
- /package/dist/{live-CSxvigCS.mjs → live-B66u3_0g.mjs} +0 -0
- /package/dist/{metadata-DEqBUaSv.mjs → metadata-D062SVyy.mjs} +0 -0
- /package/dist/{public-BMg6-Hxh-DgIH5obr.mjs → public-BMg6-Hxh-BfUOZTDP.mjs} +0 -0
- /package/dist/{rate-limit-analytics-CgHgKjmV.mjs → rate-limit-analytics-BknoecoM.mjs} +0 -0
- /package/dist/{ready-6G9zVGPJ.mjs → ready-C-H2cwp_.mjs} +0 -0
- /package/dist/{recent-submissions-B3Smh-QM.mjs → recent-submissions-DyuH_n5u.mjs} +0 -0
- /package/dist/{refute-DjkmLSNe.mjs → refute-uSlzkQKq.mjs} +0 -0
- /package/dist/{resolve-DEvdeprv.mjs → resolve-B8CyM1mi.mjs} +0 -0
- /package/dist/{scan-logo-545qLcGs.mjs → scan-logo-DMk--WT7.mjs} +0 -0
- /package/dist/{scan-page-DRQiVufl.mjs → scan-page-DEHnAOJo.mjs} +0 -0
- /package/dist/{schemas-BFCBlp_W.mjs → schemas-O_ZNaF8R.mjs} +0 -0
- /package/dist/{search-CXbqFoqe.mjs → search-BlKeSfVD.mjs} +0 -0
- /package/dist/{signed-url-rU_nvgFA.mjs → signed-url-CiGmGkLQ.mjs} +0 -0
- /package/dist/{submission-info-D6PgXNQP.mjs → submission-info-DHlTHDrs.mjs} +0 -0
- /package/dist/{theme-CrIBazAF.mjs → theme-CeVf-5qG.mjs} +0 -0
- /package/dist/{total-queries-XkFyu8H5.mjs → total-queries-D5WvVfYi.mjs} +0 -0
- /package/dist/{tracked-domains-CmcRXHj_.mjs → tracked-domains-9deBK9bp.mjs} +0 -0
- /package/dist/{verify-CM1NakP0.mjs → verify-S-TmhUDr.mjs} +0 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,r as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{a as f,i as p}from"./prompt-DjRTpML4.mjs";import{t as m}from"./cli-types-CrSoSMPF.mjs";function h(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`eligibility <report-id>`,describe:`Returns whether the report is currently appealable, along with the signals behind that decision: whether it already has an open appeal, how many appeals have been submitted against it, and whether it has at least one mitigation that an appeal could reverse.`,builder:h,handler:async c=>s({command:`abuse-reports appeals eligibility`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf abuse-reports appeals eligibility`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/appeals/eligibility`,pathParams:{"report-id":String(c[`report-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.abuseReports.appeals.eligibility({account_id:l,report_id:c[`report-id`]})),{successLabel:`Loaded`})})},_={command:`appeals`,describe:`Operations for appeals`,builder:e=>e.command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.positional(`report-param`,{type:`string`,description:`The report type to be submitted. Example: abuse_general`,demandOption:!0}).option(`act`,{type:`string`,description:`The act field`,choices:[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`]}).option(`comments`,{type:`string`,description:`Any additional comments about the infringement not exceeding 2000 characters`}).option(`company`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email`,{type:`string`,description:`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`email2`,{type:`string`,description:"Should match the value provided in `email`"}).option(`name`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`reported-country`,{type:`string`,description:`Text containing 2 characters`}).option(`reported-user-agent`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`tele`,{type:`string`,description:`Text not exceeding 20 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`title`,{type:`string`,description:`Text not exceeding 255 characters`}).option(`urls`,{type:`string`,description:`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`address1`,{type:`string`,description:`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agent-name`,{type:`string`,description:`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`agree`,{type:`number`,description:"Can be `0` for false or `1` for true. Must be value: 1 for DMCA reports"}).option(`city`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`country`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
|
|
3
|
+
`}).option(`host-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
4
|
+
`,choices:[`send`,`send-anon`]}).option(`original-work`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).
|
|
5
|
+
`}).option(`owner-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
6
|
+
`,choices:[`send`,`send-anon`,`none`]}).option(`signature`,{type:`string`,description:`Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports`}).option(`state`,{type:`string`,description:`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`}).option(`justification`,{type:`string`,description:`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters.
|
|
7
|
+
`}).option(`trademark-number`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-office`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`trademark-symbol`,{type:`string`,description:`Text not exceeding 1000 characters`}).option(`destination-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of destination IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ports-protocols`,{type:`string`,description:`A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. The total size of the field should not exceed 2000 characters. Each individual port/protocol should not exceed 100 characters. The list should not have more than 30 unique ports and protocols.`}).option(`source-ips`,{type:`string`,description:`A list of IP addresses separated by ‘\\n’ (new line character). The list of source IPs should not exceed 30 IP addresses. Each one of the IP addresses ought to be unique.`}).option(`ncmec-notification`,{type:`string`,description:`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous.
|
|
8
|
+
`,choices:[`send`,`send-anon`]}).option(`reg-who-request-reg-who-authorization-statement`,{type:`string`,description:`Optional authorization statement or power of attorney per RDP 10.2.1.3.`}).option(`reg-who-request-reg-who-good-faith-affirmation`,{type:`boolean`,description:`Affirmation that the request is made in good faith per RDP 10.2.4. Must be true.`}).option(`reg-who-request-reg-who-lawful-processing-agreement`,{type:`boolean`,description:`Agreement to process data lawfully per RDP 10.2.5. Must be true.`}).option(`reg-who-request-reg-who-legal-basis`,{type:`string`,description:`Legal rights and rationale for the request per RDP 10.2.3. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-request-type`,{type:`string`,description:`The type of WHOIS data request per RDP procedure.`,choices:[`disclosure`,`invalid_whois`]}).option(`reg-who-request-reg-who-requested-data-elements`,{type:`string`,array:!0,description:`The specific WHOIS data elements being requested per RDP 10.2.2. Required for all WHOIS requests.`}).option(`reg-who-request-reg-who-requestor-type`,{type:`string`,description:`The nature of the requestor per RDP 10.2.1.2.`,choices:[`government`,`corporation`,`individual`]}).option(`ncsei-subject-representation`,{type:`boolean`,description:`If the submitter is the target of NCSEI in the URLs of the abuse report.`}).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(`address1`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`address1`,[`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agent-name`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agent-name`,[`address1`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`agree`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`agree`,[`address1`,`agent-name`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`city`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`city`,[`address1`,`agent-name`,`agree`,`country`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`country`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`original-work`]).implies(`country`,[`address1`,`agent-name`,`agree`,`city`,`host-notification`,`original-work`,`signature`,`state`]).conflicts(`host-notification`,[`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).conflicts(`original-work`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`,`country`]).implies(`original-work`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`signature`,`state`]).conflicts(`signature`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`signature`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`state`]).conflicts(`state`,[`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`state`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`]).conflicts(`justification`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`trademark-number`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-number`,[`host-notification`,`justification`,`trademark-office`,`trademark-symbol`]).conflicts(`trademark-office`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-office`,[`host-notification`,`justification`,`trademark-number`,`trademark-symbol`]).conflicts(`trademark-symbol`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`trademark-symbol`,[`host-notification`,`justification`,`trademark-number`,`trademark-office`]).conflicts(`destination-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ports-protocols`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`source-ips`,[`address1`,`agent-name`,`agree`,`city`,`country`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).conflicts(`ncmec-notification`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`]).implies(`ncmec-notification`,[`host-notification`,`justification`]).conflicts(`reg-who-request-reg-who-authorization-statement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-good-faith-affirmation`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-lawful-processing-agreement`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-legal-basis`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-request-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requested-data-elements`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`reg-who-request-reg-who-requestor-type`,[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]).conflicts(`ncsei-subject-representation`,[`address1`,`agent-name`,`agree`,`city`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`]).implies(`ncsei-subject-representation`,[`host-notification`]).check(e=>{if([`reg-who-request-reg-who-authorization-statement`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`,`reg-who-request-reg-who-requestor-type`].some(t=>e[t]!==void 0)){let t={"reg-who-request-reg-who-good-faith-affirmation":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-lawful-processing-agreement":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-legal-basis":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-request-type":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`],"reg-who-request-reg-who-requested-data-elements":[`address1`,`agent-name`,`agree`,`city`,`country`,`host-notification`,`original-work`,`signature`,`state`,`justification`,`trademark-number`,`trademark-office`,`trademark-symbol`,`destination-ips`,`ports-protocols`,`source-ips`,`ncmec-notification`,`ncsei-subject-representation`]},n=[`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-legal-basis`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requested-data-elements`].filter(n=>e[n]===void 0&&!(t[n]??[]).some(t=>e[t]!==void 0));if(n.length>0)throw Error(`${n.map(e=>`--`+e).join(`, `)} ${n.length===1?`is`:`are`} required when any --reg_who_request-* flag is set`)}return!0})}const y={command:`create <report-param>`,describe:"Submit an abuse report of a particular type. Requires the abuse-reports entitlement on the account (Enterprise accounts have it by default; other accounts must request access) and an API token with the `Account > Abuse Reports > Edit` permission. If the account is not entitled, the request is rejected with an HTTP `401` response (see below).",builder:v,handler:async l=>s({command:`abuse-reports create`,classification:{safeFlags:[`act`,`host-notification`,`owner-notification`,`ncmec-notification`,`reg-who-request-reg-who-good-faith-affirmation`,`reg-who-request-reg-who-lawful-processing-agreement`,`reg-who-request-reg-who-request-type`,`reg-who-request-reg-who-requestor-type`,`ncsei-subject-representation`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf abuse-reports create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${l[`report-param`]==null?`<report-param>`:encodeURIComponent(String(l[`report-param`]))}`,pathParams:{"report-param":String(l[`report-param`]??``)},bodyKind:`json`,body:l.body===void 0?u({act:d(l.act,`act`,`text`),comments:d(l.comments,`comments`,`text`),company:d(l.company,`company`,`text`),email:d(l.email,`email`,`text`),email2:d(l.email2,`email2`,`text`),name:d(l.name,`name`,`text`),reported_country:d(l[`reported-country`],`reported-country`,`text`),reported_user_agent:d(l[`reported-user-agent`],`reported-user-agent`,`text`),tele:d(l.tele,`tele`,`text`),title:d(l.title,`title`,`text`),urls:d(l.urls,`urls`,`text`),address1:d(l.address1,`address1`,`text`),agent_name:d(l[`agent-name`],`agent-name`,`text`),agree:l.agree,city:d(l.city,`city`,`text`),country:d(l.country,`country`,`text`),host_notification:d(l[`host-notification`],`host-notification`,`text`),original_work:d(l[`original-work`],`original-work`,`text`),owner_notification:d(l[`owner-notification`],`owner-notification`,`text`),signature:d(l.signature,`signature`,`text`),state:d(l.state,`state`,`text`),justification:d(l.justification,`justification`,`text`),trademark_number:d(l[`trademark-number`],`trademark-number`,`text`),trademark_office:d(l[`trademark-office`],`trademark-office`,`text`),trademark_symbol:d(l[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:d(l[`destination-ips`],`destination-ips`,`text`),ports_protocols:d(l[`ports-protocols`],`ports-protocols`,`text`),source_ips:d(l[`source-ips`],`source-ips`,`text`),ncmec_notification:d(l[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:d(l[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:l[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:l[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:d(l[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:d(l[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:l[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:d(l[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:l[`ncsei-subject-representation`]}):c(l.body)});return}let s=await r(l),m=l.local?e:await t();if(l.accountId=m,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.abuseReports.create({body:e,account_id:m,report_param:l[`report-param`]})),{successLabel:`Created`});return}if(l.act===void 0&&(l.act=await p(`act`,`The act field`,[`abuse_dmca`,`abuse_trademark`,`abuse_general`,`abuse_phishing`,`abuse_children`,`abuse_threat`,`abuse_registrar_whois`,`abuse_ncsei`])),l.email===void 0&&(l.email=await f(`email`,`A valid email of the abuse reporter. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),l.email2===void 0&&(l.email2=await f(`email2`,"Should match the value provided in `email`")),l.name===void 0&&(l.name=await f(`name`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),l.urls===void 0&&(l.urls=await f(`urls`,`A list of valid URLs separated by ‘\\n’ (new line character). The list of the URLs should not exceed 250 URLs. All URLs should have the same hostname. Each URL should be unique. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`)),l[`owner-notification`]===void 0&&(l[`owner-notification`]=await p(`owner-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,[`send`,`send-anon`,`none`])),l.act===`abuse_dmca`&&l.address1===void 0&&(l.address1=await f(`address1`,`Text not exceeding 100 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --address1`})),l.act===`abuse_dmca`&&l[`agent-name`]===void 0&&(l[`agent-name`]=await f(`agent-name`,`The name of the copyright holder. Text not exceeding 60 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --agent-name`})),l.act===`abuse_dmca`&&l.agree===void 0)throw Error(`--agree is required (or pass --body with this field set).`);if(l.act===`abuse_dmca`&&l.city===void 0&&(l.city=await f(`city`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --city`})),l.act===`abuse_dmca`&&l.country===void 0&&(l.country=await f(`country`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). `,{question:`Enter value for --country`})),l.act===`abuse_dmca`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_dmca`&&l[`original-work`]===void 0&&(l[`original-work`]=await f(`original-work`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/). `,{question:`Enter value for --original-work`})),l.act===`abuse_dmca`&&l.signature===void 0&&(l.signature=await f(`signature`,`Required for DMCA reports, should be same as Name. An affirmation that all information in the report is true and accurate while agreeing to the policies of Cloudflare's abuse reports`,{question:`Enter value for --signature`})),l.act===`abuse_dmca`&&l.state===void 0&&(l.state=await f(`state`,`Text not exceeding 255 characters. This field may be released by Cloudflare to third parties such as the Lumen Database (https://lumendatabase.org/).`,{question:`Enter value for --state`})),l.act===`abuse_trademark`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_trademark`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_trademark`&&l[`trademark-number`]===void 0&&(l[`trademark-number`]=await f(`trademark-number`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-number`})),l.act===`abuse_trademark`&&l[`trademark-office`]===void 0&&(l[`trademark-office`]=await f(`trademark-office`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-office`})),l.act===`abuse_trademark`&&l[`trademark-symbol`]===void 0&&(l[`trademark-symbol`]=await f(`trademark-symbol`,`Text not exceeding 1000 characters`,{question:`Enter value for --trademark-symbol`})),l.act===`abuse_general`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_general`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_phishing`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_phishing`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_children`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_children`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_children`&&l[`ncmec-notification`]===void 0&&(l[`ncmec-notification`]=await f(`ncmec-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --ncmec-notification`})),l.act===`abuse_threat`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_threat`&&l.justification===void 0&&(l.justification=await f(`justification`,`A detailed description of the infringement, including any necessary access details and the exact steps needed to view the content, not exceeding 5000 characters. `,{question:`Enter value for --justification`})),l.act===`abuse_ncsei`&&l[`host-notification`]===void 0&&(l[`host-notification`]=await f(`host-notification`,`Notification type based on the abuse type. NOTE: Copyright (DMCA) and Trademark reports cannot be anonymous. `,{question:`Enter value for --host-notification`})),l.act===`abuse_ncsei`&&l[`ncsei-subject-representation`]===void 0)throw Error(`--ncsei-subject-representation is required (or pass --body with this field set).`);let h=u({act:d(l.act,`act`,`text`),comments:d(l.comments,`comments`,`text`),company:d(l.company,`company`,`text`),email:d(l.email,`email`,`text`),email2:d(l.email2,`email2`,`text`),name:d(l.name,`name`,`text`),reported_country:d(l[`reported-country`],`reported-country`,`text`),reported_user_agent:d(l[`reported-user-agent`],`reported-user-agent`,`text`),tele:d(l.tele,`tele`,`text`),title:d(l.title,`title`,`text`),urls:d(l.urls,`urls`,`text`),address1:d(l.address1,`address1`,`text`),agent_name:d(l[`agent-name`],`agent-name`,`text`),agree:l.agree,city:d(l.city,`city`,`text`),country:d(l.country,`country`,`text`),host_notification:d(l[`host-notification`],`host-notification`,`text`),original_work:d(l[`original-work`],`original-work`,`text`),owner_notification:d(l[`owner-notification`],`owner-notification`,`text`),signature:d(l.signature,`signature`,`text`),state:d(l.state,`state`,`text`),justification:d(l.justification,`justification`,`text`),trademark_number:d(l[`trademark-number`],`trademark-number`,`text`),trademark_office:d(l[`trademark-office`],`trademark-office`,`text`),trademark_symbol:d(l[`trademark-symbol`],`trademark-symbol`,`text`),destination_ips:d(l[`destination-ips`],`destination-ips`,`text`),ports_protocols:d(l[`ports-protocols`],`ports-protocols`,`text`),source_ips:d(l[`source-ips`],`source-ips`,`text`),ncmec_notification:d(l[`ncmec-notification`],`ncmec-notification`,`text`),reg_who_request:{reg_who_authorization_statement:d(l[`reg-who-request-reg-who-authorization-statement`],`reg-who-request-reg-who-authorization-statement`,`text`),reg_who_good_faith_affirmation:l[`reg-who-request-reg-who-good-faith-affirmation`],reg_who_lawful_processing_agreement:l[`reg-who-request-reg-who-lawful-processing-agreement`],reg_who_legal_basis:d(l[`reg-who-request-reg-who-legal-basis`],`reg-who-request-reg-who-legal-basis`,`text`),reg_who_request_type:d(l[`reg-who-request-reg-who-request-type`],`reg-who-request-reg-who-request-type`,`text`),reg_who_requested_data_elements:l[`reg-who-request-reg-who-requested-data-elements`],reg_who_requestor_type:d(l[`reg-who-request-reg-who-requestor-type`],`reg-who-request-reg-who-requestor-type`,`text`)},ncsei_subject_representation:l[`ncsei-subject-representation`]});i(await o(`Creating`,async()=>s.abuseReports.create({body:h,account_id:m,report_param:l[`report-param`]})),{successLabel:`Created`})})};function b(e){return e.positional(`report-id`,{type:`string`,description:`Public report code.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number to retrieve (default 1).`}).option(`per-page`,{type:`number`,description:`Number of emails per page (default 20, max 100).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list-submitted <report-id>`,describe:`List successful emails sent to the submitter of a report submitted by the account. Does not include emails sent to customers or hosts.`,builder:b,handler:async c=>s({command:`abuse-reports emails list-submitted`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf abuse-reports emails list-submitted`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/submitted/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/emails`,pathParams:{"report-id":String(c[`report-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.emails.listSubmitted({account_id:u,report_id:c[`report-id`],...s})),{successLabel:`Loaded`})})};function S(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number to retrieve (default 1)`}).option(`per-page`,{type:`number`,description:`Number of emails per page (default 20, max 100)`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`List emails sent to the customer for an abuse report. Returns all successful customer emails sent for the specified abuse report. Does not include emails sent to hosts or submitters.`,builder:S,handler:async c=>s({command:`abuse-reports emails list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`]};if(c.dryRun){a({command:`cf abuse-reports emails list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/emails`,pathParams:{"report-id":String(c[`report-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.emails.list({account_id:u,report_id:c[`report-id`],...s})),{successLabel:`Loaded`})})},w={command:`emails`,describe:`Emails operations`,builder:e=>e.command(C).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`report-id`,{type:`string`,description:`Public report code.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get-submitted <report-id>`,describe:`Retrieve a report submitted by the account.`,builder:T,handler:async c=>s({command:`abuse-reports get-submitted`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf abuse-reports get-submitted`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/submitted/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}`,pathParams:{"report-id":String(c[`report-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.abuseReports.getSubmitted({account_id:l,report_id:c[`report-id`]})),{successLabel:`Loaded`})})};function D(e){return e.positional(`report-param`,{type:`string`,description:`Identifier of the abuse report`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <report-param>`,describe:`Retrieve the details of an abuse report.`,builder:D,handler:async c=>s({command:`abuse-reports get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf abuse-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${c[`report-param`]==null?`<report-param>`:encodeURIComponent(String(c[`report-param`]))}`,pathParams:{"report-param":String(c[`report-param`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.abuseReports.get({account_id:l,report_param:c[`report-param`]})),{successLabel:`Loaded`})})};function k(e){return e.option(`page`,{type:`number`,description:`Page of submitted reports to return.`}).option(`per-page`,{type:`number`,description:`Number of submitted reports per page.`}).option(`sort`,{type:`string`,description:`A property and direction to sort by (id, cdate, domain, type, status).`}).option(`id`,{type:`string`,description:`Filter by report code.`}).option(`domain`,{type:`string`,description:`Filter by reported domain. This parameter can be specified multiple times.`}).option(`created-before`,{type:`string`,description:`Return reports submitted before this time.`}).option(`created-after`,{type:`string`,description:`Return reports submitted after this time.`}).option(`status`,{type:`string`,description:`Filter by submitter-facing status. This parameter can be specified multiple times.`}).option(`type`,{type:`string`,description:`Filter by report type. This parameter can be specified multiple times.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list-submitted`,describe:`List abuse reports submitted by the account.`,builder:m(k),handler:async c=>s({command:`abuse-reports list-submitted`,classification:{safeFlags:[`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],sort:c.sort,id:c.id,domain:c.domain,created_before:c[`created-before`],created_after:c[`created-after`],status:c.status,type:c.type};if(c.dryRun){a({command:`cf abuse-reports list-submitted`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/submitted`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.listSubmitted({account_id:u,...s})),{successLabel:`Loaded`})})};function j(e){return e.option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order (id, cdate, domain, type, status)`}).option(`domain`,{type:`string`,description:`Filter by domain name related to the abuse report`}).option(`created-before`,{type:`string`,description:`Returns reports created before the specified date`}).option(`created-after`,{type:`string`,description:`Returns reports created after the specified date`}).option(`status`,{type:`string`,description:`Filter by the status of the report.`,choices:[`accepted`,`in_review`]}).option(`type`,{type:`string`,description:`Filter by the type of the report.`,choices:[`PHISH`,`GEN`,`THREAT`,`DMCA`,`EMER`,`TM`,`REG_WHO`,`NCSEI`,`NETWORK`]}).option(`mitigation-status`,{type:`string`,description:`Filter reports that have any mitigations in the given status.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list`,describe:`List the abuse reports for a given account`,builder:m(j),handler:async c=>s({command:`abuse-reports list`,classification:{safeFlags:[`status`,`type`,`mitigation-status`,`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],sort:c.sort,domain:c.domain,created_before:c[`created-before`],created_after:c[`created-after`],status:c.status,type:c.type,mitigation_status:c[`mitigation-status`]};if(c.dryRun){a({command:`cf abuse-reports list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.list({account_id:u,...s})),{successLabel:`Loaded`})})};function N(e){return e.option(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`page`,{type:`number`,description:`Where in pagination to start listing abuse reports`}).option(`per-page`,{type:`number`,description:`How many abuse reports per page to list`}).option(`sort`,{type:`string`,description:`A property to sort by, followed by the order`,choices:[`type,asc`,`type,desc`,`effective_date,asc`,`effective_date,desc`,`status,asc`,`status,desc`,`entity_type,asc`,`entity_type,desc`]}).option(`type`,{type:`string`,description:`Filter by the type of mitigation. This filter parameter can be specified multiple times to include multiple types of mitigations in the result set.`}).option(`effective-before`,{type:`string`,description:`Returns mitigations that were dispatched before the given date`}).option(`effective-after`,{type:`string`,description:`Returns mitigation that were dispatched after the given date`}).option(`status`,{type:`string`,description:`Filter by the status of the mitigation.`,choices:[`pending`,`active`,`in_review`,`cancelled`,`removed`]}).option(`entity-type`,{type:`string`,description:`Filter by the type of entity the mitigation impacts.`,choices:[`url_pattern`,`account`,`zone`,`custom_expression`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`List mitigations done to remediate the abuse report.`,builder:m(N),handler:async c=>s({command:`abuse-reports mitigations list`,classification:{safeFlags:[`sort`,`status`,`entity-type`,`dry-run`]}},c,async()=>{let s={page:c.page,per_page:c[`per-page`],sort:c.sort,type:c.type,effective_before:c[`effective-before`],effective_after:c[`effective-after`],status:c.status,entity_type:c[`entity-type`]};if(c.dryRun){a({command:`cf abuse-reports mitigations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${c[`report-id`]==null?`<report-id>`:encodeURIComponent(String(c[`report-id`]))}/mitigations`,pathParams:{"report-id":String(c[`report-id`]??``)},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.abuseReports.mitigations.list({account_id:u,report_id:c[`report-id`],...s})),{successLabel:`Loaded`})})};function F(e){return e.positional(`report-id`,{type:`string`,description:`Abuse Report ID`,demandOption:!0}).option(`appeals`,{type:`string`,description:`List of mitigations to appeal. Provide as a JSON array of objects or @path/to/file.json.`}).option(`data-city`,{type:`string`,description:`The data.city field`}).option(`data-company`,{type:`string`,description:`The data.company field`}).option(`data-counter-notice-response`,{type:`string`,description:`The data.counter_notice_response field`}).option(`data-country`,{type:`string`,description:`The data.country field`}).option(`data-email`,{type:`string`,description:`The data.email field`}).option(`data-full-name`,{type:`string`,description:`The data.full_name field`}).option(`data-jurisdiction-consent`,{type:`boolean`,description:`The data.jurisdiction_consent field`}).option(`data-perjury-attestation`,{type:`boolean`,description:`The data.perjury_attestation field`}).option(`data-phone-number`,{type:`string`,description:`The data.phone_number field`}).option(`data-signature`,{type:`string`,description:`The data.signature field`}).option(`data-state`,{type:`string`,description:`The data.state field`}).option(`data-street-address`,{type:`string`,description:`The data.street_address field`}).option(`data-urls`,{type:`string`,array:!0,description:`The data.urls field`}).option(`data-zip-code`,{type:`string`,description:`The data.zip_code field`}).option(`type`,{type:`string`,description:`The type of appeal being submitted.`,choices:[`counter_notice`,`content_removed`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Submit an appeal for a report. Provide either a list of mitigations to appeal, or an appeal type with its supporting details, but not both. When type is "counter_notice", the counter-notice details are required.`}).check(e=>{if([`data-city`,`data-company`,`data-counter-notice-response`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].some(t=>e[t]!==void 0)){let t=[`data-city`,`data-country`,`data-email`,`data-full-name`,`data-jurisdiction-consent`,`data-perjury-attestation`,`data-phone-number`,`data-signature`,`data-state`,`data-street-address`,`data-urls`,`data-zip-code`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --data-* flag is set`)}return!0})}const I={command:`review <report-id>`,describe:`Request a review for mitigations on an account. Repeating a request for a mitigation with an unresolved appeal is idempotent and returns that mitigation in the in-review state.`,builder:F,handler:async f=>s({command:`abuse-reports mitigations review`,classification:{safeFlags:[`data-jurisdiction-consent`,`data-perjury-attestation`,`type`,`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf abuse-reports mitigations review`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/abuse-reports/${f[`report-id`]==null?`<report-id>`:encodeURIComponent(String(f[`report-id`]))}/mitigations/appeal`,pathParams:{"report-id":String(f[`report-id`]??``)},bodyKind:`json`,body:f.body===void 0?u({appeals:l(f.appeals,`appeals`),data:{city:d(f[`data-city`],`data-city`,`text`),company:d(f[`data-company`],`data-company`,`text`),counter_notice_response:d(f[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:d(f[`data-country`],`data-country`,`text`),email:d(f[`data-email`],`data-email`,`text`),full_name:d(f[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:f[`data-jurisdiction-consent`],perjury_attestation:f[`data-perjury-attestation`],phone_number:d(f[`data-phone-number`],`data-phone-number`,`text`),signature:d(f[`data-signature`],`data-signature`,`text`),state:d(f[`data-state`],`data-state`,`text`),street_address:d(f[`data-street-address`],`data-street-address`,`text`),urls:f[`data-urls`],zip_code:d(f[`data-zip-code`],`data-zip-code`,`text`)},type:d(f.type,`type`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.abuseReports.mitigations.review({body:e,account_id:p,report_id:f[`report-id`]})),{successLabel:`Created`});return}let m=u({appeals:l(f.appeals,`appeals`),data:{city:d(f[`data-city`],`data-city`,`text`),company:d(f[`data-company`],`data-company`,`text`),counter_notice_response:d(f[`data-counter-notice-response`],`data-counter-notice-response`,`text`),country:d(f[`data-country`],`data-country`,`text`),email:d(f[`data-email`],`data-email`,`text`),full_name:d(f[`data-full-name`],`data-full-name`,`text`),jurisdiction_consent:f[`data-jurisdiction-consent`],perjury_attestation:f[`data-perjury-attestation`],phone_number:d(f[`data-phone-number`],`data-phone-number`,`text`),signature:d(f[`data-signature`],`data-signature`,`text`),state:d(f[`data-state`],`data-state`,`text`),street_address:d(f[`data-street-address`],`data-street-address`,`text`),urls:f[`data-urls`],zip_code:d(f[`data-zip-code`],`data-zip-code`,`text`)},type:d(f.type,`type`,`text`)});i(await o(`Creating`,async()=>s.abuseReports.mitigations.review({body:m,account_id:p,report_id:f[`report-id`]})),{successLabel:`Created`})})},L={command:`mitigations`,describe:`Mitigation actions taken in response to abuse reports`,builder:e=>e.command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`abuse-reports`,describe:`Submit and track abuse reports for phishing, malware, and other policy violations on Cloudflare-proxied sites`,builder:e=>e.command(y).command(O).command(E).command(M).command(A).command(_).command(w).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{R as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,r as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{a as f,n as p}from"./prompt-DjRTpML4.mjs";import{t as m}from"./cli-types-CrSoSMPF.mjs";function h(e){return e.option(`target-ids`,{type:`string`,array:!0,description:`List of target IDs to bulk delete`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`delete`,describe:`Removes one or more targets.`,builder:h,handler:async l=>s({command:`access targets bulk delete`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf access targets bulk delete`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch_delete`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({target_ids:l[`target-ids`]}):c(l.body)});return}let s=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.access.targets.bulk.delete({...e,account_id:d})),{successLabel:`Created`});return}if(l[`target-ids`]===void 0)throw Error(`--target-ids is required (or pass --body with this field set).`);let f=u({target_ids:l[`target-ids`]});i(await o(`Creating`,async()=>s.access.targets.bulk.delete({...f,account_id:d})),{successLabel:`Created`})})};function _(e){return e.option(`items`,{type:`string`,description:`The items field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`replace-tags`,describe:`Replaces tags for one or more existing infrastructure access targets.`,builder:_,handler:async d=>s({command:`access targets bulk replace-tags`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf access targets bulk replace-tags`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch_tags`,pathParams:{},bodyKind:`json`,body:d.body===void 0?u({items:l(d.items,`items`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.access.targets.bulk.replaceTags({...e,account_id:f})),{successLabel:`Created`});return}if(d.items===void 0)throw Error(`--items is required (or pass --body with this field set).`);let p=u({items:l(d.items,`items`)});i(await o(`Creating`,async()=>s.access.targets.bulk.replaceTags({...p,account_id:f})),{successLabel:`Created`})})};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`update`,describe:`Adds one or more targets.`,builder:y,handler:async l=>s({command:`access targets bulk update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf access targets bulk update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/batch`,pathParams:{},bodyKind:`json`,body:l.body===void 0?void 0:c(l.body)});return}let s=await r(l),u=l.local?e:await t();if(l.accountId=u,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.access.targets.bulk.update({body:e,account_id:u})),{successLabel:`Updated`});return}if(l.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},x={command:`bulk`,describe:`Operations for targets.bulk`,builder:e=>e.command(g).command(v).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`hostname`,{type:`string`,description:`A non-unique field that refers to a target. Case insensitive, maximum
|
|
3
|
+
length of 255 characters, supports the use of special characters dash
|
|
4
|
+
and period, does not support spaces, and must start and end with an
|
|
5
|
+
alphanumeric character.`}).option(`ip-ipv4-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv4-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`ip-ipv6-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv6-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be 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 C={command:`create`,describe:`Creates a new infrastructure access target in the account.`,builder:S,handler:async l=>s({command:`access targets create`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf access targets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({hostname:d(l.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:d(l[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:d(l[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.access.targets.create({...e,account_id:p})),{successLabel:`Created`});return}l.hostname===void 0&&(l.hostname=await f(`hostname`,`A non-unique field that refers to a target. Case insensitive, maximum length of 255 characters, supports the use of special characters dash and period, does not support spaces, and must start and end with an alphanumeric character.`));let m=u({hostname:d(l.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:d(l[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:d(l[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}});i(await o(`Creating`,async()=>s.access.targets.create({...m,account_id:p})),{successLabel:`Created`})})};function w(e){return e.positional(`target-id`,{type:`string`,description:`Target 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 T={command:`delete <target-id>`,describe:`Removes a single infrastructure access target by its ID.`,builder:w,handler:async c=>s({command:`access targets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf access targets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/${c[`target-id`]==null?`<target-id>`:encodeURIComponent(String(c[`target-id`]))}`,pathParams:{"target-id":String(c[`target-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await p({force:!!c.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}i(await o(`Deleting`,async()=>s.access.targets.delete({account_id:l,target_id:c[`target-id`]})),{successLabel:`Deleted`})})};function E(e){return e.positional(`target-id`,{type:`string`,description:`Target identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <target-id>`,describe:`Fetches a single infrastructure access target by its ID.`,builder:E,handler:async c=>s({command:`access targets get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf access targets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/${c[`target-id`]==null?`<target-id>`:encodeURIComponent(String(c[`target-id`]))}`,pathParams:{"target-id":String(c[`target-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.access.targets.get({account_id:l,target_id:c[`target-id`]})),{successLabel:`Loaded`})})};function O(e){return e.option(`hostname`,{type:`string`,description:`Hostname of a target`}).option(`hostname-contains`,{type:`string`,description:`Partial match to the hostname of a target`}).option(`virtual-network-id`,{type:`string`,description:`Private virtual network identifier of the target`}).option(`ip-v4`,{type:`string`,description:`IPv4 address of the target`}).option(`ip-v6`,{type:`string`,description:`IPv6 address of the target`}).option(`created-before`,{type:`string`,description:`Date and time at which the target was created before (inclusive)`}).option(`created-after`,{type:`string`,description:`Date and time at which the target was created after (inclusive)`}).option(`modified-before`,{type:`string`,description:`Date and time at which the target was modified before (inclusive)`}).option(`modified-after`,{type:`string`,description:`Date and time at which the target was modified after (inclusive)`}).option(`ips`,{type:`string`,description:"Filters for targets that have any of the following IP addresses. Specify\n`ips` multiple times in query parameter to build list of candidates."}).option(`target-ids`,{type:`string`,description:`Filters for targets that have any of the following UUIDs. Specify
|
|
7
|
+
\`target_ids\` multiple times in query parameter to build list of
|
|
8
|
+
candidates.`}).option(`ip-like`,{type:`string`,description:"Filters for targets whose IP addresses look like the specified string.\nSupports `*` as a wildcard character"}).option(`ipv4-start`,{type:`string`,description:"Defines an IPv4 filter range's starting value (inclusive). Requires\n`ipv4_end` to be specified as well."}).option(`ipv4-end`,{type:`string`,description:"Defines an IPv4 filter range's ending value (inclusive). Requires\n`ipv4_start` to be specified as well."}).option(`ipv6-start`,{type:`string`,description:"Defines an IPv6 filter range's starting value (inclusive). Requires\n`ipv6_end` to be specified as well."}).option(`ipv6-end`,{type:`string`,description:"Defines an IPv6 filter range's ending value (inclusive). Requires\n`ipv6_start` to be specified as well."}).option(`tag`,{type:`string`,description:"Filter by tag key:value pairs. Multiple `tag` params are AND'd.\nFormat: `tag=key:value` (e.g., `tag=environment:production`).\nKey and value must both be non-empty; `tag=:value` and `tag=key:` return 400."}).option(`page`,{type:`number`,description:`Current page in the response`}).option(`per-page`,{type:`number`,description:`Max amount of entries returned per page`}).option(`order`,{type:`string`,description:`The field to sort by.`,choices:[`hostname`,`created_at`]}).option(`direction`,{type:`string`,description:`The sorting direction.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Lists and sorts an account's targets. Filters are optional and are ANDed together.`,builder:m(O),handler:async c=>s({command:`access targets list`,classification:{safeFlags:[`order`,`direction`,`dry-run`]}},c,async()=>{let s={hostname:c.hostname,hostname_contains:c[`hostname-contains`],virtual_network_id:c[`virtual-network-id`],ip_v4:c[`ip-v4`],ip_v6:c[`ip-v6`],created_before:c[`created-before`],created_after:c[`created-after`],modified_before:c[`modified-before`],modified_after:c[`modified-after`],ips:c.ips,target_ids:c[`target-ids`],ip_like:c[`ip-like`],ipv4_start:c[`ipv4-start`],ipv4_end:c[`ipv4-end`],ipv6_start:c[`ipv6-start`],ipv6_end:c[`ipv6-end`],tag:c.tag,page:c.page,per_page:c[`per-page`],order:c.order,direction:c.direction};if(c.dryRun){a({command:`cf access targets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.access.targets.list({account_id:u,...s})),{successLabel:`Loaded`})})};function A(e){return e.positional(`target-id`,{type:`string`,description:`Target identifier`,demandOption:!0}).option(`hostname`,{type:`string`,description:`A non-unique field that refers to a target. Case insensitive, maximum
|
|
9
|
+
length of 255 characters, supports the use of special characters dash
|
|
10
|
+
and period, does not support spaces, and must start and end with an
|
|
11
|
+
alphanumeric character.`}).option(`ip-ipv4-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv4-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be used.`}).option(`ip-ipv6-ip-addr`,{type:`string`,description:`IP address of the target`}).option(`ip-ipv6-virtual-network-id`,{type:`string`,description:`(optional) Private virtual network identifier for the target. If omitted, the default virtual network ID will be 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 j={command:`update <target-id>`,describe:`Updates an existing infrastructure access target by its ID.`,builder:A,handler:async l=>s({command:`access targets update`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf access targets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/infrastructure/targets/${l[`target-id`]==null?`<target-id>`:encodeURIComponent(String(l[`target-id`]))}`,pathParams:{"target-id":String(l[`target-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({hostname:d(l.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:d(l[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:d(l[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}}):c(l.body)});return}let s=await r(l),p=l.local?e:await t();if(l.accountId=p,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.access.targets.update({...e,account_id:p,target_id:l[`target-id`]})),{successLabel:`Updated`});return}l.hostname===void 0&&(l.hostname=await f(`hostname`,`A non-unique field that refers to a target. Case insensitive, maximum length of 255 characters, supports the use of special characters dash and period, does not support spaces, and must start and end with an alphanumeric character.`));let m=u({hostname:d(l.hostname,`hostname`,`text`),ip:{ipv4:{ip_addr:d(l[`ip-ipv4-ip-addr`],`ip-ipv4-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv4-virtual-network-id`],`ip-ipv4-virtual-network-id`,`text`)},ipv6:{ip_addr:d(l[`ip-ipv6-ip-addr`],`ip-ipv6-ip-addr`,`text`),virtual_network_id:d(l[`ip-ipv6-virtual-network-id`],`ip-ipv6-virtual-network-id`,`text`)}}});i(await o(`Updating`,async()=>s.access.targets.update({...m,account_id:p,target_id:l[`target-id`]})),{successLabel:`Updated`})})},M={command:`targets`,describe:`Operations for targets`,builder:e=>e.command(C).command(T).command(D).command(k).command(j).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`access`,describe:`access`,builder:e=>e.command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{N as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,t as l}from"./body-parser-DIlfApuJ.mjs";import{n as u}from"./input-validation-BxchZ9jE.mjs";import{a as d}from"./prompt-DjRTpML4.mjs";function f(e){return e.option(`account-ids`,{type:`string`,array:!0,description:`Move these accounts to the destination organization.`}).option(`destination-organization-id`,{type:`string`,description:`Move accounts to this organization ID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`move`,describe:`Batch move a collection of accounts to a specific organization. ⚠️ Not implemented.`,builder:f,handler:async e=>s({command:`account batch move`,classification:{safeFlags:[`dry-run`]}},e,async()=>{if(e.dryRun){a({command:`cf account batch move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/move`,pathParams:{},bodyKind:`json`,body:e.body===void 0?l({account_ids:e[`account-ids`],destination_organization_id:u(e[`destination-organization-id`],`destination-organization-id`,`text`)}):c(e.body)});return}let t=await r(e);if(e.body){let n=c(e.body);i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`});return}if(e[`account-ids`]===void 0)throw Error(`--account-ids is required (or pass --body with this field set).`);e[`destination-organization-id`]===void 0&&(e[`destination-organization-id`]=await d(`destination-organization-id`,`Move accounts to this organization ID.`));let n=l({account_ids:e[`account-ids`],destination_organization_id:u(e[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>t.account.batch.move({...n})),{successLabel:`Created`})})},m={command:`batch`,describe:`Operations for batch`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function h(e){return e.option(`destination-organization-id`,{type:`string`,description:`The destination_organization_id field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`The destination organization ID is where the account is to be moved.`})}const g={command:`move`,describe:`Move an account within an organization hierarchy or an account outside an organization. (Currently in Public Beta - see https://developers.cloudflare.com/fundamentals/organizations/)`,builder:h,handler:async f=>s({command:`account move`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf account move`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/move`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({destination_organization_id:u(f[`destination-organization-id`],`destination-organization-id`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Creating`,async()=>s.account.move({...e,account_id:p})),{successLabel:`Created`});return}f[`destination-organization-id`]===void 0&&(f[`destination-organization-id`]=await d(`destination-organization-id`,`The destination_organization_id field`));let m=l({destination_organization_id:u(f[`destination-organization-id`],`destination-organization-id`,`text`)});i(await o(`Creating`,async()=>s.account.move({...m,account_id:p})),{successLabel:`Created`})})};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`list`,describe:`Retrieve a list of the organizations that "contain" this account or are managing it. The returned list will be in order from "root" to "leaf", where the "leaf" will be the organization that _immediately_ contains the specified account.`,builder:_,handler:async c=>s({command:`account organization list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf account organization list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/organizations`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.account.organization.list({account_id:l})),{successLabel:`Loaded`})})},y={command:`organization`,describe:`Operations for organization`,builder:e=>e.command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Retrieves the profile information for a specific Cloudflare account, including organization details, settings, and metadata. This endpoint is commonly used to verify account access and retrieve account-level configuration.`,builder:b,handler:async c=>s({command:`account profile get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf account profile get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/profile`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.account.profile.get({account_id:l})),{successLabel:`Loaded`})})};function S(e){return e.option(`business-address`,{type:`string`,description:`The business_address field`}).option(`business-email`,{type:`string`,description:`The business_email field`}).option(`business-name`,{type:`string`,description:`The business_name field`}).option(`business-phone`,{type:`string`,description:`The business_phone field`}).option(`external-metadata`,{type:`string`,description:`The external_metadata field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update`,describe:`Updates the profile information for a Cloudflare account. Allows modification of account-level settings and organizational details. Requires Account Settings Write permission.`,builder:S,handler:async f=>s({command:`account profile update`,classification:{safeFlags:[`dry-run`]}},f,async()=>{if(f.dryRun){a({command:`cf account profile update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/profile`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({business_address:u(f[`business-address`],`business-address`,`text`),business_email:u(f[`business-email`],`business-email`,`text`),business_name:u(f[`business-name`],`business-name`,`text`),business_phone:u(f[`business-phone`],`business-phone`,`text`),external_metadata:u(f[`external-metadata`],`external-metadata`,`text`)}):c(f.body)});return}let s=await r(f),p=f.local?e:await t();if(f.accountId=p,f.body){let e=c(f.body);i(await o(`Updating`,async()=>s.account.profile.update({body:e,account_id:p})),{successLabel:`Updated`});return}f[`business-address`]===void 0&&(f[`business-address`]=await d(`business-address`,`The business_address field`)),f[`business-email`]===void 0&&(f[`business-email`]=await d(`business-email`,`The business_email field`)),f[`business-name`]===void 0&&(f[`business-name`]=await d(`business-name`,`The business_name field`)),f[`business-phone`]===void 0&&(f[`business-phone`]=await d(`business-phone`,`The business_phone field`)),f[`external-metadata`]===void 0&&(f[`external-metadata`]=await d(`external-metadata`,`The external_metadata field`));let m=l({business_address:u(f[`business-address`],`business-address`,`text`),business_email:u(f[`business-email`],`business-email`,`text`),business_name:u(f[`business-name`],`business-name`,`text`),business_phone:u(f[`business-phone`],`business-phone`,`text`),external_metadata:u(f[`external-metadata`],`external-metadata`,`text`)});i(await o(`Updating`,async()=>s.account.profile.update({body:m,account_id:p})),{successLabel:`Updated`})})},w={command:`profile`,describe:`Operations for profile`,builder:e=>e.command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`account`,describe:`account`,builder:e=>e.command(g).command(m).command(y).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{a as i,r as a}from"./auth-tvDdC1J-.mjs";import{t as o}from"./output-COcSQsfn.mjs";import{t as s}from"./dry-run-DiVy1lVo.mjs";import{t as c}from"./progress-V6SZV3Ux.mjs";import{t as l}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as u,n as d,t as f}from"./body-parser-DIlfApuJ.mjs";import{n as p}from"./input-validation-BxchZ9jE.mjs";import{a as m,i as h,n as g}from"./prompt-DjRTpML4.mjs";import{t as _}from"./cli-types-CrSoSMPF.mjs";function v(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
|
|
3
|
+
verify the current resource ETag matches before applying the write. Returns
|
|
4
|
+
412 Precondition Failed if the resource has been modified since the ETag was
|
|
5
|
+
obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:`worker_version.access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.cws_deployment.cws_policy.cws_policy_set.cws_workload.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker`.split(`.`)}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).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}).option(`body`,{type:`string`,description:`Request body schema for deleting tags from account-level resources. Use /zones/{zone_id}/tags for zone-level resources.`})}const y={command:`delete`,describe:`Removes all tags from a specific account or zone-level resource.`,builder:v,handler:async _=>l({command:`account-tags delete`,classification:{safeFlags:[`resource-type`,`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},_,async()=>{let l={};if(_[`if-match`]!==void 0&&(l[`If-Match`]=String(_[`if-match`])),_.dryRun){let e=_.zone===void 0?await n():void 0,t=_.zone===void 0?`accounts`:`zones`,r=_.zone??e??`<account-id>`;s({command:`cf account-tags delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/tags`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:_.body===void 0?f({resource_id:p(_[`resource-id`],`resource-id`,`text`),resource_type:p(_[`resource-type`],`resource-type`,`text`),worker_id:p(_[`worker-id`],`worker-id`,`text`)}):d(_.body)});return}let v=await a(_),y=_.zone===void 0?`accounts`:`zones`,b=y===`zones`?await r({zone:_.zone},v,{quiet:_.quiet}):_.local?e:await t();if(y===`zones`?_.zoneId=b:_.accountId=b,!await g({force:!!_.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}if(_.body){let e=d(_.body);o(await c(`Deleting`,async()=>i(v,`DELETE`,`/${y}/${b}/tags`,{body:e,headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`});return}_[`resource-id`]===void 0&&(_[`resource-id`]=await m(`resource-id`,`Identifies the unique resource.`)),_[`resource-type`]===void 0&&(_[`resource-type`]=await h(`resource-type`,`Enum for worker_version resource type.`,`worker_version.access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.cws_deployment.cws_policy.cws_policy_set.cws_workload.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker`.split(`.`))),_[`resource-type`]===`worker_version`&&_[`worker-id`]===void 0&&(_[`worker-id`]=await m(`worker-id`,`Worker ID is required only for worker_version resources`,{question:`Enter value for --worker-id`}));let x={};_[`resource-id`]!==void 0&&u(x,[`resource_id`],p(_[`resource-id`],`resource-id`,`text`)),_[`resource-type`]!==void 0&&u(x,[`resource_type`],p(_[`resource-type`],`resource-type`,`text`)),_[`worker-id`]!==void 0&&u(x,[`worker_id`],p(_[`worker-id`],`worker-id`,`text`)),o(await c(`Deleting`,async()=>i(v,`DELETE`,`/${y}/${b}/tags`,{body:Object.keys(x).length>0?x:void 0,headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Deleted`})})};function b(e){return e.option(`resource-id`,{type:`string`,description:`The ID of the resource to retrieve tags for.`,demandOption:!0}).option(`resource-type`,{type:`string`,description:`The type of the resource.`,choices:`access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.cws_deployment.cws_policy.cws_policy_set.cws_workload.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker.worker_version`.split(`.`),demandOption:!0}).option(`worker-id`,{type:`string`,description:`Worker identifier. Required for worker_version resources.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Retrieves tags for a specific account or zone-level resource.`,builder:_(b),handler:async i=>l({command:`account-tags get`,classification:{safeFlags:[`resource-type`,`dry-run`]}},i,async()=>{let l={resource_id:i[`resource-id`],resource_type:i[`resource-type`],worker_id:i[`worker-id`]};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 account-tags get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/tags`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await a(i),d=i.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:i.zone},u,{quiet:i.quiet}):i.local?e:await t();d===`zones`?i.zoneId=f:i.accountId=f,o(await c(`Loading`,async()=>u.accountTags.get({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})})};function S(e){return e.option(`if-match`,{type:`string`,description:`ETag value for optimistic concurrency control. When provided, the server will
|
|
7
|
+
verify the current resource ETag matches before applying the write. Returns
|
|
8
|
+
412 Precondition Failed if the resource has been modified since the ETag was
|
|
9
|
+
obtained. Omit this header for unconditional writes.`}).option(`resource-id`,{type:`string`,description:`Identifies the unique resource.`}).option(`resource-type`,{type:`string`,description:`Enum for worker_version resource type.`,choices:`worker_version.access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.cws_deployment.cws_policy.cws_policy_set.cws_workload.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker`.split(`.`)}).option(`worker-id`,{type:`string`,description:`Worker ID is required only for worker_version resources`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body schema for setting tags on account-level resources.`})}const C={command:`update`,describe:`Creates or updates tags for a specific account or zone-level resource.`,builder:S,handler:async g=>l({command:`account-tags update`,classification:{safeFlags:[`resource-type`,`dry-run`]}},g,async()=>{let l={};if(g[`if-match`]!==void 0&&(l[`If-Match`]=String(g[`if-match`])),g.dryRun){let e=g.zone===void 0?await n():void 0,t=g.zone===void 0?`accounts`:`zones`,r=g.zone??e??`<account-id>`;s({command:`cf account-tags update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/tags`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:g.body===void 0?f({resource_id:p(g[`resource-id`],`resource-id`,`text`),resource_type:p(g[`resource-type`],`resource-type`,`text`),worker_id:p(g[`worker-id`],`worker-id`,`text`)}):d(g.body)});return}let _=await a(g),v=g.zone===void 0?`accounts`:`zones`,y=v===`zones`?await r({zone:g.zone},_,{quiet:g.quiet}):g.local?e:await t();if(v===`zones`?g.zoneId=y:g.accountId=y,g.body){let e=d(g.body);o(await c(`Updating`,async()=>i(_,`PUT`,`/${v}/${y}/tags`,{body:e,headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`});return}g[`resource-id`]===void 0&&(g[`resource-id`]=await m(`resource-id`,`Identifies the unique resource.`)),g[`resource-type`]===void 0&&(g[`resource-type`]=await h(`resource-type`,`Enum for worker_version resource type.`,`worker_version.access_application.access_group.account.account_ruleset.ai_gateway.alerting_policy.alerting_webhook.cloudflared_tunnel.cws_deployment.cws_policy.cws_policy_set.cws_workload.d1_database.durable_object_namespace.gateway_list.gateway_rule.image.infrastructure_target.kv_namespace.load_balancer_monitor.load_balancer_pool.pages_project.queue.r2_bucket.resource_share.stream_live_input.stream_video.vectorize_index.worker`.split(`.`))),g[`resource-type`]===`worker_version`&&g[`worker-id`]===void 0&&(g[`worker-id`]=await m(`worker-id`,`Worker ID is required only for worker_version resources`,{question:`Enter value for --worker-id`}));let b={};g[`resource-id`]!==void 0&&u(b,[`resource_id`],p(g[`resource-id`],`resource-id`,`text`)),g[`resource-type`]!==void 0&&u(b,[`resource_type`],p(g[`resource-type`],`resource-type`,`text`)),g[`worker-id`]!==void 0&&u(b,[`worker_id`],p(g[`worker-id`],`worker-id`,`text`)),o(await c(`Updating`,async()=>i(_,`PUT`,`/${v}/${y}/tags`,{body:Object.keys(b).length>0?b:void 0,headers:Object.keys(l).length>0?l:void 0})),{successLabel:`Updated`})})},w={command:`account-tags`,describe:`account-tags`,builder:e=>e.command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{a as i,r as a}from"./auth-tvDdC1J-.mjs";import{t as o}from"./output-COcSQsfn.mjs";import{t as s}from"./dry-run-DiVy1lVo.mjs";import{t as c}from"./progress-V6SZV3Ux.mjs";import{t as l}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{i as u,n as d,r as f,t as p}from"./body-parser-DIlfApuJ.mjs";import{n as m}from"./input-validation-BxchZ9jE.mjs";import{a as h,i as g,n as _}from"./prompt-DjRTpML4.mjs";import{t as v}from"./cli-types-CrSoSMPF.mjs";import{n as ee,t as te}from"./raw-fetch-BVYQR6C5.mjs";function y(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 b={command:`create`,describe:`Create a custom application for an account.`,builder:y,handler:async r=>l({command:`accounts applications create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({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?p({category_id:r[`category-id`],hostnames:r.hostnames,human_id:m(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:m(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.applications.create({...e,account_id:l})),{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 h(`human-id`,`Returns the human readable ID.`)),r.name===void 0&&(r.name=await h(`name`,`Returns the application name.`));let u=p({category_id:r[`category-id`],hostnames:r.hostnames,human_id:m(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:m(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});o(await c(`Creating`,async()=>i.accounts.applications.create({...u,account_id:l})),{successLabel:`Created`})})};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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <id>`,describe:`Delete a custom application and all of its versions. Deletion is rejected when other resources reference the application.`,builder:x,handler:async r=>l({command:`accounts applications delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({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 i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.applications.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})})};function C(e){return e.option(`filter`,{type:`string`,description:`Filter applications using key:value format. Supported filter keys:
|
|
4
|
+
- name: Filter by application name (e.g., name:HR)
|
|
5
|
+
- id: Filter by application ID (e.g., id:498)
|
|
6
|
+
- human_id: Filter by human-readable ID (e.g., human_id:HR)
|
|
7
|
+
- hostname: Filter by hostname or support domain (e.g., hostname:portal.example.com)
|
|
8
|
+
- source: Filter by application source name (e.g., source:cloudflare)
|
|
9
|
+
- ip_subnet: Filter by IP subnet using CIDR containment — returns applications where any stored subnet contains the search value (e.g., ip_subnet:10.0.1.5/32 matches apps with 10.0.0.0/16)
|
|
10
|
+
- category_id: Filter by category ID (e.g., category_id:12).
|
|
11
|
+
- category_name: Filter by category name (e.g., category_name:HR).
|
|
12
|
+
- supported: Filter by supported Cloudflare product (e.g., supported:ACCESS). Values: GATEWAY, ACCESS, CASB.
|
|
13
|
+
- review_status: Filter by the account's Gateway review status. Values: approved, unapproved, in_review, unreviewed.
|
|
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
|
+
category_id, application_type, application_confidence_score, and gen_ai_score.
|
|
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 w={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:C,handler:async r=>l({command:`accounts applications get applications`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 T(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 E={command:`id <id>`,describe:`Get application by ID.`,builder:T,handler:async r=>l({command:`accounts applications get by id`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},D={command:`by`,describe:`Operations for applications.get.by`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},O={command:`get`,describe:`Operations for applications.get`,builder:e=>e.command(w).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(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 A={command:`update <id>`,describe:`Replace the network matchers for a custom application and create a new version.`,builder:k,handler:async r=>l({command:`accounts applications update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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?p({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.applications.update({...e,account_id:l,id:r.id})),{successLabel:`Updated`});return}let u=p({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({...u,account_id:l,id:r.id})),{successLabel:`Updated`})})},j={command:`applications`,describe:`Applications operations`,builder:e=>e.command(b).command(S).command(A).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`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:M,handler:async r=>l({command:`accounts billing createSetupIntent`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`getBadDebt`,describe:`Gets bad debt information for an account, including outstanding invoices and total debt amount.`,builder:P,handler:async r=>l({command:`accounts billing getBadDebt`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`getCredits`,describe:`Gets the credit balance and eligibility for an account.`,builder:I,handler:async r=>l({command:`accounts billing getCredits`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 R(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 z={command:`getReceiptPdf <receipt-id>`,describe:`Downloads a receipt as a PDF document.`,builder:R,handler:async r=>l({command:`accounts billing getReceiptPdf`,classification:{safeFlags:[`dry-run`,`text`]}},r,async()=>{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()=>te(`/accounts/${o}/receipts/${encodeURIComponent(String(r[`receipt-id`]))}/pdf${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));ee(r.text===!0?u.toString(`utf-8`):u)})};function B(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`getUnpaidInvoices`,describe:`Gets unpaid invoice information for an account.`,builder:B,handler:async r=>l({command:`accounts billing getUnpaidInvoices`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 H(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 U={command:`list`,describe:`Gets the billing history for an account.`,builder:H,handler:async r=>l({command:`accounts billing history list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},W={command:`history`,describe:`Operations for billing.history`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(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 K={command:`payBadDebt`,describe:`Pays outstanding bad debt for an account. Discovers all debt automatically and handles invoice deduplication.`,builder:G,handler:async r=>l({command:`accounts billing payBadDebt`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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?p({payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...e,account_id:l})),{successLabel:`Created`});return}let u=p({payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.payBadDebt({...u,account_id:l})),{successLabel:`Created`})})};function q(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 J={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:q,handler:async r=>l({command:`accounts billing payInvoice`,classification:{safeFlags:[`validate-payment-method`,`dry-run`]}},r,async()=>{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?p({invoice_id:m(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...e,account_id:l})),{successLabel:`Created`});return}let u=p({invoice_id:m(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:m(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]});o(await c(`Creating`,async()=>i.accounts.billing.payInvoice({...u,account_id:l})),{successLabel:`Created`})})};function Y(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 X={command:`create`,describe:`Creates a new payment method for an account.`,builder:Y,handler:async r=>l({command:`accounts billing payment-methods create`,classification:{safeFlags:[`default`,`type`,`dry-run`]}},r,async()=>{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?p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:e,account_id:l})),{successLabel:`Created`});return}let u=p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)});o(await c(`Creating`,async()=>i.accounts.billing.paymentMethods.create({body:u,account_id:l})),{successLabel:`Created`})})};function Z(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 Q={command:`delete <payment-method-id>`,describe:`Deletes a payment method from an account.`,builder:Z,handler:async r=>l({command:`accounts billing payment-methods delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 _({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 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:`get <payment-method-id>`,describe:`Gets a specific payment method for an account.`,builder:ne,handler:async r=>l({command:`accounts billing payment-methods get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 ie(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 ae={command:`list`,describe:`Lists all payment methods for an account.`,builder:ie,handler:async r=>l({command:`accounts billing payment-methods list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 oe(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 se={command:`setDefault <payment-method-id>`,describe:`Sets a payment method as the default for an account.`,builder:oe,handler:async r=>l({command:`accounts billing payment-methods setDefault`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 ce(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 le={command:`update <payment-method-id>`,describe:`Updates a payment method for an account.`,builder:ce,handler:async r=>l({command:`accounts billing payment-methods update`,classification:{safeFlags:[`default`,`type`,`dry-run`]}},r,async()=>{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?p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.billing.paymentMethods.update({body:e,account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`});return}let u=p({address:m(r.address,`address`,`text`),address2:m(r.address2,`address2`,`text`),bank_account_type:m(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:m(r[`bank-code`],`bank-code`,`text`),bank_country:m(r[`bank-country`],`bank-country`,`text`),bank_name:m(r[`bank-name`],`bank-name`,`text`),bank_routing_number:m(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:m(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:m(r.city,`city`,`text`),country:m(r.country,`country`,`text`),default:r.default,device_data:m(r[`device-data`],`device-data`,`text`),first_name:m(r[`first-name`],`first-name`,`text`),last_name:m(r[`last-name`],`last-name`,`text`),nick_name:m(r[`nick-name`],`nick-name`,`text`),payment_account_email:m(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:m(r[`payment-email`],`payment-email`,`text`),payment_gateway:m(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:m(r[`payment-nonce`],`payment-nonce`,`text`),state:m(r.state,`state`,`text`),type:m(r.type,`type`,`text`),zipcode:m(r.zipcode,`zipcode`,`text`)});o(await c(`Updating`,async()=>i.accounts.billing.paymentMethods.update({body:u,account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`})})},ue={command:`payment-methods`,describe:`Operations for billing.payment-methods`,builder:e=>e.command(X).command(Q).command(re).command(ae).command(se).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(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 fe={command:`togglePdfInvoices`,describe:`Toggles PDF invoice generation for an account.`,builder:de,handler:async r=>l({command:`accounts billing togglePdfInvoices`,classification:{safeFlags:[`toggle`,`dry-run`]}},r,async()=>{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?p({toggle:r.toggle}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.billing.togglePdfInvoices({...e,account_id:l})),{successLabel:`Updated`});return}let u=p({toggle:r.toggle});o(await c(`Updating`,async()=>i.accounts.billing.togglePdfInvoices({...u,account_id:l})),{successLabel:`Updated`})})},pe={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(N).command(F).command(L).command(z).command(V).command(K).command(J).command(fe).command(W).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(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 he={command:`id <id>`,describe:`Get application category by ID.`,builder:me,handler:async r=>l({command:`accounts categories get by id`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},ge={command:`by`,describe:`Operations for categories.get.by`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(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 ve={command:`categories`,describe:`List application categories.`,builder:_e,handler:async r=>l({command:`accounts categories get categories`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},ye={command:`get`,describe:`Operations for categories.get`,builder:e=>e.command(ve).command(ge).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},be={command:`categories`,describe:`Categories operations`,builder:e=>e.command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function xe(e){return e.option(`idempotency-key`,{type:`string`,description:`Optional key that identifies an Account-creation request. Free Account creation can require exactly one valid key, so API clients should send a key with every Account-creation request. Reuse the same key when retrying the same request.`}).option(`name`,{type:`string`,description:`Account name`}).option(`standalone`,{type:`boolean`,description:"Set to `true` and omit `unit` to create a standalone Free Account. If provided, this field must be `true`."}).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 Se={command:`create`,describe:"Create an Account. To create the Account within an Organization, provide `unit.id` and omit `standalone`. To create a standalone Free Account, provide `standalone: true` and omit `unit`. Providing both fields is invalid. If you omit both fields, Cloudflare can determine the destination only when the User is an administrator of exactly one Organization. Cloudflare creates the Account in that Organization; otherwise, the request returns an error.",builder:xe,handler:async e=>l({command:`accounts create`,classification:{safeFlags:[`standalone`,`dry-run`]}},e,async()=>{let t={};if(e[`idempotency-key`]!==void 0&&(t[`Idempotency-Key`]=String(e[`idempotency-key`])),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?p({name:m(e.name,`name`,`text`),standalone:e.standalone,unit:{id:m(e[`unit-id`],`unit-id`,`text`)}}):d(e.body)});return}let n=await a(e);if(e.body){let r=d(e.body);o(await c(`Creating`,async()=>i(n,`POST`,`/accounts`,{body:r,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await h(`name`,`Account name`));let r={};e.name!==void 0&&u(r,[`name`],m(e.name,`name`,`text`)),e.standalone!==void 0&&u(r,[`standalone`],e.standalone),e[`unit-id`]!==void 0&&u(r,[`unit`,`id`],m(e[`unit-id`],`unit-id`,`text`)),o(await c(`Creating`,async()=>i(n,`POST`,`/accounts`,{body:Object.keys(r).length>0?r:void 0,headers:Object.keys(t).length>0?t:void 0})),{successLabel:`Created`})})};function Ce(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 we={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:Ce,handler:async r=>l({command:`accounts delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 _({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 Te(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:Te,handler:async r=>l({command:`accounts get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 De(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 Oe={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:v(De),handler:async e=>l({command:`accounts list`,classification:{safeFlags:[`direction`,`dry-run`]}},e,async()=>{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 ke(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 Ae={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:v(ke),handler:async r=>l({command:`accounts logs audit history`,classification:{safeFlags:[`direction`,`dry-run`]}},r,async()=>{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 je(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 Me={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:v(je),handler:async r=>l({command:`accounts logs audit list`,classification:{safeFlags:[`direction`,`dry-run`]}},r,async()=>{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 Ne(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pe={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:Ne,handler:async r=>l({command:`accounts logs audit product-categories`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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`})})},Fe={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(Ae).command(Me).command(Pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ie={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(Fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Le(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
|
+
Changing from 'accepted' back to 'pending' will trigger a replacement of the member resource in Terraform.
|
|
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 Re={command:`create`,describe:`Add a user to the list of members for this account.`,builder:Le,handler:async r=>l({command:`accounts members create`,classification:{safeFlags:[`status`,`dry-run`]}},r,async()=>{if(r.dryRun){s({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?p({email:m(r.email,`email`,`text`),roles:r.roles,status:m(r.status,`status`,`text`),policies:f(r.policies,`policies`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.members.create({body:e,account_id:l})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await h(`email`,`The contact email address of the user.`));let u=p({email:m(r.email,`email`,`text`),roles:r.roles,status:m(r.status,`status`,`text`),policies:f(r.policies,`policies`)});o(await c(`Creating`,async()=>i.accounts.members.create({body:u,account_id:l})),{successLabel:`Created`})})};function ze(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 Be={command:`delete <member-id>`,describe:`Remove a member from an account.`,builder:ze,handler:async r=>l({command:`accounts members delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({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 i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await _({force:!!r.force,message:`Are you sure you want to remove this user from the account?`})){process.stderr.write(`Aborted.
|
|
22
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.members.delete({account_id:l,member_id:r[`member-id`]})),{successLabel:`Deleted`})})};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})}const He={command:`get <member-id>`,describe:`Get information about a specific member of an account.`,builder:Ve,handler:async r=>l({command:`accounts members get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 Ue(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 We={command:`list`,describe:`List all members of an account.`,builder:v(Ue),handler:async r=>l({command:`accounts members list`,classification:{safeFlags:[`order`,`status`,`direction`,`dry-run`]}},r,async()=>{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 Ge(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 Ke={command:`update <member-id>`,describe:`Modify an account member.`,builder:Ge,handler:async r=>l({command:`accounts members update`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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?p({roles:f(r.roles,`roles`),policies:f(r.policies,`policies`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.members.update({body:e,account_id:l,member_id:r[`member-id`]})),{successLabel:`Updated`});return}let u=p({roles:f(r.roles,`roles`),policies:f(r.policies,`policies`)});o(await c(`Updating`,async()=>i.accounts.members.update({body:u,account_id:l,member_id:r[`member-id`]})),{successLabel:`Updated`})})},qe={command:`members`,describe:`Operations for members`,builder:e=>e.command(Re).command(Be).command(He).command(We).command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Je(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 Ye={command:`cancelDelayedDowngrade`,describe:`Cancels pending delayed downgrades for the specified subscriptions.`,builder:Je,handler:async r=>l({command:`accounts subscriptions cancelDelayedDowngrade`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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?p({subscription_ids:r[`subscription-ids`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.subscriptions.cancelDelayedDowngrade({...e,account_id:l})),{successLabel:`Created`});return}let u=p({subscription_ids:r[`subscription-ids`]});o(await c(`Creating`,async()=>i.accounts.subscriptions.cancelDelayedDowngrade({...u,account_id:l})),{successLabel:`Created`})})};function Xe(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 Ze={command:`create`,describe:`Creates an account or zone subscription.`,builder:Xe,handler:async i=>l({command:`accounts subscriptions create`,classification:{safeFlags:[`frequency`,`rate-plan-externally-managed`,`rate-plan-is-contract`,`dry-run`]}},i,async()=>{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?p({app:{install_id:m(i[`app-install-id`],`app-install-id`,`text`)},component_values:f(i[`component-values`],`component-values`),frequency:m(i.frequency,`frequency`,`text`),rate_plan:{currency:m(i[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:i[`rate-plan-externally-managed`],id:m(i[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:i[`rate-plan-is-contract`],public_name:m(i[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:m(i[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:i[`rate-plan-sets`]}}):d(i.body)});return}let l=await a(i),u=i.zone===void 0?`accounts`:`zones`,h=u===`zones`?await r({zone:i.zone},l,{quiet:i.quiet}):i.local?e:await t();if(u===`zones`?i.zoneId=h:i.accountId=h,i.body){let e=d(i.body);o(await c(`Creating`,async()=>l.accounts.subscriptions.create({body:e,account_or_zone:u,account_or_zone_id:h})),{successLabel:`Created`});return}let g=p({app:{install_id:m(i[`app-install-id`],`app-install-id`,`text`)},component_values:f(i[`component-values`],`component-values`),frequency:m(i.frequency,`frequency`,`text`),rate_plan:{currency:m(i[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:i[`rate-plan-externally-managed`],id:m(i[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:i[`rate-plan-is-contract`],public_name:m(i[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:m(i[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:i[`rate-plan-sets`]}});o(await c(`Creating`,async()=>l.accounts.subscriptions.create({body:g,account_or_zone:u,account_or_zone_id:h})),{successLabel:`Created`})})};function Qe(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 $e={command:`createCancelReason <subscription-identifier>`,describe:`Records a cancellation reason for an account subscription.`,builder:Qe,handler:async r=>l({command:`accounts subscriptions createCancelReason`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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?p({other:m(r.other,`other`,`text`),reason_code:r[`reason-code`]}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.subscriptions.createCancelReason({...e,account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`});return}let u=p({other:m(r.other,`other`,`text`),reason_code:r[`reason-code`]});o(await c(`Creating`,async()=>i.accounts.subscriptions.createCancelReason({...u,account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`})})};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}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const tt={command:`delete <subscription-identifier>`,describe:`Deletes an account's subscription.`,builder:et,handler:async r=>l({command:`accounts subscriptions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 _({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 nt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`get`,describe:`Lists all of an account or zone's subscriptions.`,builder:nt,handler:async i=>l({command:`accounts subscriptions get`,classification:{safeFlags:[`dry-run`]}},i,async()=>{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 it(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 at={command:`getByIdentifier <subscription-identifier>`,describe:`Gets an account subscription by identifier.`,builder:it,handler:async r=>l({command:`accounts subscriptions getByIdentifier`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 ot(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 st={command:`getCancelReason <subscription-identifier>`,describe:`Gets the cancellation reason for an account subscription.`,builder:ot,handler:async r=>l({command:`accounts subscriptions getCancelReason`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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 ct(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 lt={command:`update <subscription-identifier>`,describe:`Updates an account subscription.`,builder:ct,handler:async r=>l({command:`accounts subscriptions update`,classification:{safeFlags:[`frequency`,`rate-plan-externally-managed`,`rate-plan-is-contract`,`dry-run`]}},r,async()=>{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?p({app:{install_id:m(r[`app-install-id`],`app-install-id`,`text`)},component_values:f(r[`component-values`],`component-values`),frequency:m(r.frequency,`frequency`,`text`),rate_plan:{currency:m(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:m(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:m(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:m(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.subscriptions.update({body:e,account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`});return}let u=p({app:{install_id:m(r[`app-install-id`],`app-install-id`,`text`)},component_values:f(r[`component-values`],`component-values`),frequency:m(r.frequency,`frequency`,`text`),rate_plan:{currency:m(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:m(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:m(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:m(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}});o(await c(`Updating`,async()=>i.accounts.subscriptions.update({body:u,account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`})})},ut={command:`subscriptions`,describe:`View and manage plan subscriptions attached to this account`,builder:e=>e.command(Ye).command(Ze).command($e).command(tt).command(rt).command(at).command(st).command(lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function dt(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 ft={command:`create`,describe:`Create a new Account Owned API token.`,builder:dt,handler:async r=>l({command:`accounts tokens create`,classification:{safeFlags:[`dry-run`]}},r,async()=>{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?p({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:m(r[`expires-on`],`expires-on`,`text`),name:m(r.name,`name`,`text`),not_before:m(r[`not-before`],`not-before`,`text`),policies:f(r.policies,`policies`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Creating`,async()=>i.accounts.tokens.create({body:e,account_id:l})),{successLabel:`Created`});return}if(r.name===void 0&&(r.name=await h(`name`,`Token name.`)),r.policies===void 0)throw Error(`--policies is required (or pass --body with this field set).`);let u=p({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:m(r[`expires-on`],`expires-on`,`text`),name:m(r.name,`name`,`text`),not_before:m(r[`not-before`],`not-before`,`text`),policies:f(r.policies,`policies`)});o(await c(`Creating`,async()=>i.accounts.tokens.create({body:u,account_id:l})),{successLabel:`Created`})})};function pt(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 mt={command:`delete <token-id>`,describe:`Destroy an Account Owned API token.`,builder:pt,handler:async r=>l({command:`accounts tokens delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{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 _({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
24
|
+
`);return}o(await c(`Deleting`,async()=>i.accounts.tokens.delete({account_id:l,token_id:r[`token-id`]})),{successLabel:`Deleted`})})};function ht(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 gt={command:`get <token-id>`,describe:`Get information about a specific Account Owned API token.`,builder:ht,handler:async r=>l({command:`accounts tokens get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({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 i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.tokens.get({account_id:l,token_id:r[`token-id`]})),{successLabel:`Loaded`})})};function _t(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 vt={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:v(_t),handler:async r=>l({command:`accounts tokens list`,classification:{safeFlags:[`direction`,`include-expired`,`dry-run`]}},r,async()=>{let i={page:r.page,per_page:r[`per-page`],direction:r.direction,include_expired:r[`include-expired`]};if(r.dryRun){s({command:`cf accounts tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens`,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.tokens.list({account_id:u,...i})),{successLabel:`Loaded`})})};function yt(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
|
|
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 bt={command:`list`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:yt,handler:async r=>l({command:`accounts tokens permission-groups list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let i={name:r.name,scope:r.scope};if(r.dryRun){s({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: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.tokens.permissionGroups.list({account_id:u,...i})),{successLabel:`Loaded`})})},xt={command:`permission-groups`,describe:`Operations for tokens.permission-groups`,builder:e=>e.command(bt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function St(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 Ct={command:`roll <token-id>`,describe:`Roll the Account Owned API token secret.`,builder:St,handler:async r=>l({command:`accounts tokens roll`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){s({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 i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await _({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}o(await c(`Deleting`,async()=>i.accounts.tokens.roll({account_id:l,token_id:r[`token-id`]})),{successLabel:`Deleted`})})};function wt(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 Tt={command:`update <token-id>`,describe:`Update an existing token.`,builder:wt,handler:async r=>l({command:`accounts tokens update`,classification:{safeFlags:[`status`,`dry-run`]}},r,async()=>{if(r.dryRun){s({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?p({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:m(r[`expires-on`],`expires-on`,`text`),name:m(r.name,`name`,`text`),not_before:m(r[`not-before`],`not-before`,`text`),policies:f(r.policies,`policies`),status:m(r.status,`status`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.tokens.update({body:e,account_id:l,token_id:r[`token-id`]})),{successLabel:`Updated`});return}if(r.name===void 0&&(r.name=await h(`name`,`Token name.`)),r.policies===void 0)throw Error(`--policies is required (or pass --body with this field set).`);let u=p({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:m(r[`expires-on`],`expires-on`,`text`),name:m(r.name,`name`,`text`),not_before:m(r[`not-before`],`not-before`,`text`),policies:f(r.policies,`policies`),status:m(r.status,`status`,`text`)});o(await c(`Updating`,async()=>i.accounts.tokens.update({body:u,account_id:l,token_id:r[`token-id`]})),{successLabel:`Updated`})})};function Et(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`verify`,describe:`Test whether a token works.`,builder:Et,handler:async r=>l({command:`accounts tokens verify`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({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 i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.accounts.tokens.verify({account_id:l})),{successLabel:`Loaded`})})},Dt={command:`tokens`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(ft).command(mt).command(gt).command(vt).command(Ct).command(Tt).command($).command(xt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ot(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const kt={command:`list`,describe:`Returns a list of Image Resizing configurations across all zones for the account. This endpoint is useful for retrieving the transformations (image_resizing) state for all zones belonging to an account.`,builder:Ot,handler:async r=>l({command:`accounts transformations list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts transformations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/settings/transformations`,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.transformations.list({account_id:l})),{successLabel:`Loaded`})})},At={command:`transformations`,describe:`Operations for transformations`,builder:e=>e.command(kt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function jt(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 Mt={command:`update`,describe:`Update an existing account.`,builder:jt,handler:async r=>l({command:`accounts update`,classification:{safeFlags:[`settings-enforce-twofactor`,`dry-run`]}},r,async()=>{if(r.dryRun){s({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?p({id:m(r.id,`id`,`text`),name:m(r.name,`name`,`text`),settings:{abuse_contact_email:m(r[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:r[`settings-enforce-twofactor`]}}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.update({body:e,account_id:l})),{successLabel:`Updated`});return}r.id===void 0&&(r.id=await h(`id`,`Identifier`)),r.name===void 0&&(r.name=await h(`name`,`Account name`));let u=p({id:m(r.id,`id`,`text`),name:m(r.name,`name`,`text`),settings:{abuse_contact_email:m(r[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:r[`settings-enforce-twofactor`]}});o(await c(`Updating`,async()=>i.accounts.update({body:u,account_id:l})),{successLabel:`Updated`})})};function Nt(e){return e.option(`value`,{type:`string`,description:`Enables Unique Transformations billing for the account.
|
|
29
|
+
Note: once enabled, this setting cannot be set back to "off".
|
|
30
|
+
`,choices:[`on`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Pt={command:`edit`,describe:`Updates the Unique Transformations billing configuration for an account. When enabled, billing data is directed to the Transformations pipeline. Note: setting the value to "off" is not permitted once enabled.`,builder:Nt,handler:async r=>l({command:`accounts ut-billing edit`,classification:{safeFlags:[`value`,`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts ut-billing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/settings/ut-billing`,pathParams:{},bodyKind:`json`,body:r.body===void 0?p({value:m(r.value,`value`,`text`)}):d(r.body)});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,r.body){let e=d(r.body);o(await c(`Updating`,async()=>i.accounts.utBilling.edit({...e,account_id:l})),{successLabel:`Updated`});return}r.value===void 0&&(r.value=await g(`value`,`Enables Unique Transformations billing for the account. Note: once enabled, this setting cannot be set back to "off". `,[`on`]));let u=p({value:m(r.value,`value`,`text`)});o(await c(`Updating`,async()=>i.accounts.utBilling.edit({...u,account_id:l})),{successLabel:`Updated`})})};function Ft(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const It={command:`get`,describe:`Retrieves the Unique Transformations billing configuration for an account. When enabled, billing data is directed to the Transformations pipeline.`,builder:Ft,handler:async r=>l({command:`accounts ut-billing get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){s({command:`cf accounts ut-billing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/settings/ut-billing`,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.utBilling.get({account_id:l})),{successLabel:`Loaded`})})},Lt={command:`ut-billing`,describe:`Operations for ut-billing`,builder:e=>e.command(Pt).command(It).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Rt={command:`accounts`,describe:`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,builder:e=>e.command(Se).command(we).command(Ee).command(Oe).command(Mt).command(j).command(pe).command(be).command(Ie).command(qe).command(ut).command(Dt).command(At).command(Lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Rt as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{h as e}from"./oauth-DH3kMXSs.mjs";import{r as t}from"./auth-tvDdC1J-.mjs";import{t as n}from"./output-COcSQsfn.mjs";import{t as r}from"./dry-run-DiVy1lVo.mjs";import{t as i}from"./progress-V6SZV3Ux.mjs";import{t as a}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as o,t as s}from"./body-parser-DIlfApuJ.mjs";import{n as c}from"./input-validation-BxchZ9jE.mjs";import{a as l,n as u}from"./prompt-DjRTpML4.mjs";function d(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 f={command:`create`,describe:`Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`,builder:d,handler:async u=>a({command:`acm custom-trust-store create`,classification:{safeFlags:[`dry-run`]}},u,async()=>{if(u.dryRun){r({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?s({certificate:c(u.certificate,`certificate`,`text`)}):o(u.body)});return}let a=await t(u),d=await e({zone:u.zone},a,{quiet:u.quiet});if(u.zoneId=d,u.body){let e=o(u.body);n(await i(`Creating`,async()=>a.acm.customTrustStore.create({...e,zone_id:d})),{successLabel:`Created`});return}u.certificate===void 0&&(u.certificate=await l(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let f=s({certificate:c(u.certificate,`certificate`,`text`)});n(await i(`Creating`,async()=>a.acm.customTrustStore.create({...f,zone_id:d})),{successLabel:`Created`})})};function p(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 m={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:p,handler:async o=>a({command:`acm custom-trust-store delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},o,async()=>{if(o.dryRun){r({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/acm/custom_trust_store/${o[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(o[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(o[`custom-origin-trust-store-id`]??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});if(o.zoneId=s,!await u({force:!!o.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}n(await i(`Deleting`,async()=>a.acm.customTrustStore.delete({zone_id:s,custom_origin_trust_store_id:o[`custom-origin-trust-store-id`]})),{successLabel:`Deleted`})})};function h(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 g={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:h,handler:async o=>a({command:`acm custom-trust-store get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf acm custom-trust-store get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/acm/custom_trust_store/${o[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(o[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(o[`custom-origin-trust-store-id`]??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.acm.customTrustStore.get({zone_id:s,custom_origin_trust_store_id:o[`custom-origin-trust-store-id`]})),{successLabel:`Loaded`})})};function _(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 v={command:`list`,describe:`Get Custom Origin Trust Store for a Zone.`,builder:_,handler:async o=>a({command:`acm custom-trust-store list`,classification:{safeFlags:[`dry-run`]}},o,async()=>{let a={page:o.page,per_page:o[`per-page`],limit:o.limit,offset:o.offset};if(o.dryRun){r({command:`cf acm custom-trust-store list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},query:a,bodyKind:`none`});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});o.zoneId=c,n(await i(`Loading`,async()=>s.acm.customTrustStore.list({zone_id:c,...a})),{successLabel:`Loaded`})})},y={command:`custom-trust-store`,describe:`Operations for custom-trust-store`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(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 x={command:`edit`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:b,handler:async l=>a({command:`acm total-tls edit`,classification:{safeFlags:[`certificate-authority`,`enabled`,`dry-run`]}},l,async()=>{if(l.dryRun){r({command:`cf acm total-tls edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?s({certificate_authority:c(l[`certificate-authority`],`certificate-authority`,`text`),enabled:l.enabled}):o(l.body)});return}let a=await t(l),u=await e({zone:l.zone},a,{quiet:l.quiet});if(l.zoneId=u,l.body){let e=o(l.body);n(await i(`Creating`,async()=>a.acm.totalTls.edit({...e,zone_id:u})),{successLabel:`Created`});return}if(l.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=s({certificate_authority:c(l[`certificate-authority`],`certificate-authority`,`text`),enabled:l.enabled});n(await i(`Creating`,async()=>a.acm.totalTls.edit({...d,zone_id:u})),{successLabel:`Created`})})};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Get Total TLS Settings for a Zone.`,builder:S,handler:async o=>a({command:`acm total-tls get`,classification:{safeFlags:[`dry-run`]}},o,async()=>{if(o.dryRun){r({command:`cf acm total-tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`none`});return}let a=await t(o),s=await e({zone:o.zone},a,{quiet:o.quiet});o.zoneId=s,n(await i(`Loading`,async()=>a.acm.totalTls.get({zone_id:s})),{successLabel:`Loaded`})})},w={command:`total-tls`,describe:`Operations for total-tls`,builder:e=>e.command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`acm`,describe:`acm`,builder:e=>e.command(y).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
|