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
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,r as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d}from"./input-validation-1esLElok.mjs";import{a as f,n as p}from"./prompt-CyATfGUu.mjs";import{t as m}from"./cli-types-C3nVfpSG.mjs";import{n as h,t as g}from"./raw-fetch-CNKIypJ7.mjs";function ee(e){return e.option(`category-id`,{type:`number`,description:`Returns the category ID.`}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`human-id`,{type:`string`,description:`Returns the human readable ID.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`name`,{type:`string`,description:`Returns the application name.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`create`,describe:`Create a custom application for an account.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf accounts applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({category_id:r[`category-id`],hostnames:r.hostnames,human_id:d(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:d(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):c(r.body)});return}let l=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.applications.create({...e,account_id:p})),{successLabel:`Created`});return}if(r[`category-id`]===void 0)throw Error(`--category-id is required (or pass --body with this field set).`);r[`human-id`]===void 0&&(r[`human-id`]=await f(`human-id`,`Returns the human readable ID.`)),r.name===void 0&&(r.name=await f(`name`,`Returns the application name.`));let m=u({category_id:r[`category-id`],hostnames:r.hostnames,human_id:d(r[`human-id`],`human-id`,`text`),ip_subnets:r[`ip-subnets`],name:d(r.name,`name`,`text`),port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});a(await s(`Creating`,async()=>l.accounts.applications.create({...m,account_id:p})),{successLabel:`Created`})}};function _(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const v={command:`delete <id>`,describe:`Delete a custom application and all of its versions. Deletion is rejected when other resources reference the application.`,builder:_,handler:async r=>{if(r.dryRun){o({command:`cf accounts applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>c.accounts.applications.delete({account_id:l,id:r.id})),{successLabel:`Deleted`})}};function y(e){return e.option(`filter`,{type:`string`,description:`Filter applications using key:value format. Supported filter keys:
|
|
4
|
-
- 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 b={command:`applications`,describe:"List the applications available to an account, both the applications Cloudflare curates and the custom applications the account has defined. Results are paginated. Use `filter` and `search` to narrow the list, `order_by` to sort it, and `fields` to reduce each result to only the properties you need. The authenticated principal must have access to the account identified by `account_id`.",builder:y,handler:async r=>{let c={filter:r.filter,limit:r.limit,offset:r.offset,order_by:r[`order-by`],search:r.search,fields:r.fields};if(r.dryRun){o({command:`cf accounts applications get applications`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.applications.get.applications({account_id:u,...c})),{successLabel:`Loaded`})}};function x(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`id <id>`,describe:`Get application by ID.`,builder:x,handler:async r=>{if(r.dryRun){o({command:`cf accounts applications get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.applications.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})}},C={command:`by`,describe:`Operations for applications.get.by`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`get`,describe:`Operations for applications.get`,builder:e=>e.command(b).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.positional(`id`,{type:`string`,description:`Application ID.`,demandOption:!0}).option(`hostnames`,{type:`string`,array:!0,description:`Hostnames matched by the application.`}).option(`ip-subnets`,{type:`string`,array:!0,description:`IP subnets matched by the application.`}).option(`port-protocols`,{type:`string`,array:!0,description:`Port and protocol pairs matched by the application.`}).option(`support-domains`,{type:`string`,array:!0,description:`Support domains matched by the application.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Updates the network matchers for the application. Omitted matcher lists are left unchanged; send an empty array to clear a list.`})}const E={command:`update <id>`,describe:`Replace the network matchers for a custom application and create a new version.`,builder:T,handler:async r=>{if(r.dryRun){o({command:`cf accounts applications update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/applications/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`json`,body:r.body===void 0?u({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.accounts.applications.update({...e,account_id:d,id:r.id})),{successLabel:`Updated`});return}let f=u({hostnames:r.hostnames,ip_subnets:r[`ip-subnets`],port_protocols:r[`port-protocols`],support_domains:r[`support-domains`]});a(await s(`Updating`,async()=>l.accounts.applications.update({...f,account_id:d,id:r.id})),{successLabel:`Updated`})}},D={command:`applications`,describe:`Applications operations`,builder:e=>e.command(te).command(v).command(E).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`createSetupIntent`,describe:`Creates a Stripe setup intent for adding a payment method to an account. Returns a client secret for frontend payment method collection.`,builder:O,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing createSetupIntent`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/client-secret`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.accounts.billing.createSetupIntent({account_id:l})),{successLabel:`Created`})}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`getBadDebt`,describe:`Gets bad debt information for an account, including outstanding invoices and total debt amount.`,builder:A,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing getBadDebt`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/bad-debt`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.billing.getBadDebt({account_id:l})),{successLabel:`Loaded`})}};function M(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`getCredits`,describe:`Gets the credit balance and eligibility for an account.`,builder:M,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing getCredits`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/credits`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.billing.getCredits({account_id:l})),{successLabel:`Loaded`})}};function P(e){return e.positional(`receipt-id`,{type:`string`,description:`Receipt identifier.`,demandOption:!0}).option(`doctype`,{type:`string`,description:`The document type to generate.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const F={command:`getReceiptPdf <receipt-id>`,describe:`Downloads a receipt as a PDF document.`,builder:P,handler:async r=>{let a={doctype:r.doctype};if(r.dryRun){o({command:`cf accounts billing getReceiptPdf`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/receipts/${r[`receipt-id`]==null?`<receipt-id>`:encodeURIComponent(String(r[`receipt-id`]))}/pdf`,pathParams:{"receipt-id":String(r[`receipt-id`]??``)},query:a,bodyKind:`none`});return}await i(r);let c=r.local?e:await t();r.accountId=c;let l=new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),u=await s(`Loading`,async()=>g(`/accounts/${c}/receipts/${encodeURIComponent(String(r[`receipt-id`]))}/pdf${l?`?`+l:``}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));h(r.text===!0?u.toString(`utf-8`):u)}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`getUnpaidInvoices`,describe:`Gets unpaid invoice information for an account.`,builder:I,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing getUnpaidInvoices`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/unpaid-invoice`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.billing.getUnpaidInvoices({account_id:l})),{successLabel:`Loaded`})}};function R(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`status`,{type:`string`,description:`Filter billing history by status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`Gets the billing history for an account.`,builder:R,handler:async r=>{let c={page:r.page,per_page:r[`per-page`],status:r.status};if(r.dryRun){o({command:`cf accounts billing history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/billing/history`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.billing.history.list({account_id:u,...c})),{successLabel:`Loaded`})}},B={command:`history`,describe:`Operations for billing.history`,builder:e=>e.command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const H={command:`payBadDebt`,describe:`Pays outstanding bad debt for an account. Discovers all debt automatically and handles invoice deduplication.`,builder:V,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payBadDebt`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-bad-debt`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.billing.payBadDebt({...e,account_id:f})),{successLabel:`Created`});return}let p=u({payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`)});a(await s(`Creating`,async()=>l.accounts.billing.payBadDebt({...p,account_id:f})),{successLabel:`Created`})}};function U(e){return e.option(`invoice-id`,{type:`string`,description:`The identifier of the invoice to pay.`}).option(`payment-method-id`,{type:`string`,description:`The payment method to use. If omitted, the default payment method is used.`}).option(`validate-payment-method`,{type:`boolean`,description:`Whether to validate the payment method before processing.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`payInvoice`,describe:`Pays an outstanding invoice for an account. Returns a Stripe client secret when Strong Customer Authentication (SCA) is required to complete the payment.`,builder:U,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payInvoice`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/pay-invoice`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({invoice_id:d(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.billing.payInvoice({...e,account_id:f})),{successLabel:`Created`});return}let p=u({invoice_id:d(r[`invoice-id`],`invoice-id`,`text`),payment_method_id:d(r[`payment-method-id`],`payment-method-id`,`text`),validate_payment_method:r[`validate-payment-method`]});a(await s(`Creating`,async()=>l.accounts.billing.payInvoice({...p,account_id:f})),{successLabel:`Created`})}};function G(e){return e.option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing zip code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const K={command:`create`,describe:`Creates a new payment method for an account.`,builder:G,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.billing.paymentMethods.create({body:e,account_id:f})),{successLabel:`Created`});return}let p=u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)});a(await s(`Creating`,async()=>l.accounts.billing.paymentMethods.create({body:p,account_id:f})),{successLabel:`Created`})}};function q(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const J={command:`delete <payment-method-id>`,describe:`Deletes a payment method from an account.`,builder:q,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
18
|
-
`);return}a(await s(`Deleting`,async()=>c.accounts.billing.paymentMethods.delete({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Deleted`})}};function Y(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <payment-method-id>`,describe:`Gets a specific payment method for an account.`,builder:Y,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.billing.paymentMethods.get({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Loaded`})}};function Z(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`Lists all payment methods for an account.`,builder:Z,handler:async r=>{let c={page:r.page,per_page:r[`per-page`]};if(r.dryRun){o({command:`cf accounts billing payment-methods list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.billing.paymentMethods.list({account_id:u,...c})),{successLabel:`Loaded`})}};function ne(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`setDefault <payment-method-id>`,describe:`Sets a payment method as the default for an account.`,builder:ne,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods setDefault`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}/set-as-default`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Creating`,async()=>c.accounts.billing.paymentMethods.setDefault({account_id:l,payment_method_id:r[`payment-method-id`]})),{successLabel:`Created`})}};function ie(e){return e.positional(`payment-method-id`,{type:`string`,description:`Payment method identifier.`,demandOption:!0}).option(`address`,{type:`string`,description:`Billing address line 1.`}).option(`address2`,{type:`string`,description:`Billing address line 2.`}).option(`bank-account-type`,{type:`string`,description:`Bank account type.`}).option(`bank-code`,{type:`string`,description:`Bank code.`}).option(`bank-country`,{type:`string`,description:`Bank country.`}).option(`bank-name`,{type:`string`,description:`Bank name for bank-based payment methods.`}).option(`bank-routing-number`,{type:`string`,description:`Bank routing number.`}).option(`cashapp-cash-tag`,{type:`string`,description:`Cash App cash tag.`}).option(`city`,{type:`string`,description:`Billing city.`}).option(`country`,{type:`string`,description:`Billing country.`}).option(`default`,{type:`boolean`,description:`Whether this is the default payment method.`}).option(`device-data`,{type:`string`,description:`Device data for fraud prevention.`}).option(`first-name`,{type:`string`,description:`Billing first name.`}).option(`last-name`,{type:`string`,description:`Billing last name.`}).option(`nick-name`,{type:`string`,description:`A nickname for the payment method.`}).option(`payment-account-email`,{type:`string`,description:`Email associated with the payment account.`}).option(`payment-email`,{type:`string`,description:`Payment email address.`}).option(`payment-gateway`,{type:`string`,description:`The payment gateway used.`}).option(`payment-nonce`,{type:`string`,description:`Payment nonce for tokenized payments.`}).option(`state`,{type:`string`,description:`Billing state.`}).option(`type`,{type:`string`,description:`The payment method type.`,choices:[`CREDIT_CARD`,`PAYPAL`,`CASHAPP`,`SEPA_DEBIT`,`LINK`,`ACH_DIRECT_DEBIT`]}).option(`zipcode`,{type:`string`,description:`Billing zip code.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ae={command:`update <payment-method-id>`,describe:`Updates a payment method for an account.`,builder:ie,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing payment-methods update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/payment-methods/${r[`payment-method-id`]==null?`<payment-method-id>`:encodeURIComponent(String(r[`payment-method-id`]))}`,pathParams:{"payment-method-id":String(r[`payment-method-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.accounts.billing.paymentMethods.update({body:e,account_id:f,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`});return}let p=u({address:d(r.address,`address`,`text`),address2:d(r.address2,`address2`,`text`),bank_account_type:d(r[`bank-account-type`],`bank-account-type`,`text`),bank_code:d(r[`bank-code`],`bank-code`,`text`),bank_country:d(r[`bank-country`],`bank-country`,`text`),bank_name:d(r[`bank-name`],`bank-name`,`text`),bank_routing_number:d(r[`bank-routing-number`],`bank-routing-number`,`text`),cashapp_cash_tag:d(r[`cashapp-cash-tag`],`cashapp-cash-tag`,`text`),city:d(r.city,`city`,`text`),country:d(r.country,`country`,`text`),default:r.default,device_data:d(r[`device-data`],`device-data`,`text`),first_name:d(r[`first-name`],`first-name`,`text`),last_name:d(r[`last-name`],`last-name`,`text`),nick_name:d(r[`nick-name`],`nick-name`,`text`),payment_account_email:d(r[`payment-account-email`],`payment-account-email`,`text`),payment_email:d(r[`payment-email`],`payment-email`,`text`),payment_gateway:d(r[`payment-gateway`],`payment-gateway`,`text`),payment_nonce:d(r[`payment-nonce`],`payment-nonce`,`text`),state:d(r.state,`state`,`text`),type:d(r.type,`type`,`text`),zipcode:d(r.zipcode,`zipcode`,`text`)});a(await s(`Updating`,async()=>l.accounts.billing.paymentMethods.update({body:p,account_id:f,payment_method_id:r[`payment-method-id`]})),{successLabel:`Updated`})}},oe={command:`payment-methods`,describe:`Operations for billing.payment-methods`,builder:e=>e.command(K).command(J).command(X).command(Q).command(re).command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.option(`toggle`,{type:`boolean`,description:`Whether to enable or disable PDF invoice generation.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`togglePdfInvoices`,describe:`Toggles PDF invoice generation for an account.`,builder:se,handler:async r=>{if(r.dryRun){o({command:`cf accounts billing togglePdfInvoices`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/invoices`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({toggle:r.toggle}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.accounts.billing.togglePdfInvoices({...e,account_id:d})),{successLabel:`Updated`});return}let f=u({toggle:r.toggle});a(await s(`Updating`,async()=>l.accounts.billing.togglePdfInvoices({...f,account_id:d})),{successLabel:`Updated`})}},le={command:`billing`,describe:`Operations for billing`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(H).command(W).command(ce).command(B).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ue(e){return e.positional(`id`,{type:`string`,description:`Application category ID.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`id <id>`,describe:`Get application category by ID.`,builder:ue,handler:async r=>{if(r.dryRun){o({command:`cf accounts categories get by id`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{id:String(r.id??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.categories.get.by.id({account_id:l,id:r.id})),{successLabel:`Loaded`})}},fe={command:`by`,describe:`Operations for categories.get.by`,builder:e=>e.command(de).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pe(e){return e.option(`limit`,{type:`number`,description:`Limit of number of results to return.`}).option(`offset`,{type:`number`,description:`Offset of results to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`categories`,describe:`List application categories.`,builder:pe,handler:async r=>{let c={limit:r.limit,offset:r.offset};if(r.dryRun){o({command:`cf accounts categories get categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/resource-library/categories`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.categories.get.categories({account_id:u,...c})),{successLabel:`Loaded`})}},he={command:`get`,describe:`Operations for categories.get`,builder:e=>e.command(me).command(fe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ge={command:`categories`,describe:`Categories operations`,builder:e=>e.command(he).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _e(e){return e.option(`name`,{type:`string`,description:`Account name`}).option(`unit-id`,{type:`string`,description:`Tenant unit ID`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Parameters for account creation`})}const ve={command:`create`,describe:`Create an account (only available for tenant admins at this time)`,builder:_e,handler:async e=>{if(e.dryRun){o({command:`cf accounts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},bodyKind:`json`,body:e.body===void 0?u({name:d(e.name,`name`,`text`),unit:{id:d(e[`unit-id`],`unit-id`,`text`)}}):c(e.body)});return}let t=await i(e);if(e.body){let n=c(e.body);a(await s(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await f(`name`,`Account name`));let n=u({name:d(e.name,`name`,`text`),unit:{id:d(e[`unit-id`],`unit-id`,`text`)}});a(await s(`Creating`,async()=>t.accounts.create({...n})),{successLabel:`Created`})}};function ye(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const be={command:`delete`,describe:`Delete a specific account (only available for tenant admins at this time). This is a permanent operation that will delete any zones or other resources under the account`,builder:ye,handler:async r=>{if(r.dryRun){o({command:`cf accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
19
|
-
`);return}a(await s(`Deleting`,async()=>c.accounts.delete({account_id:l})),{successLabel:`Deleted`})}};function xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`get`,describe:`Get information about a specific account that you are a member of.`,builder:xe,handler:async r=>{if(r.dryRun){o({command:`cf accounts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.get({account_id:l})),{successLabel:`Loaded`})}};function Ce(e){return e.option(`name`,{type:`string`,description:`Name of the account.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`list`,describe:`List all accounts you have ownership or verified access to.`,builder:m(Ce),handler:async e=>{let t={name:e.name,page:e.page,per_page:e[`per-page`],direction:e.direction};if(e.dryRun){o({command:`cf accounts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts`,pathParams:{},query:t,bodyKind:`none`});return}let n=await i(e);a(await s(`Loading`,async()=>n.accounts.list(t)),{successLabel:`Loaded`})}};function Te(e){return e.positional(`id`,{type:`string`,description:`The ID of the audit log to fetch resource history for.`,demandOption:!0}).option(`action-time`,{type:`string`,description:"RFC3339 timestamp of the source audit log entry's action time. Used to narrow the source-entry lookup window. Provide the `action.time` value from the audit log identified by `id`.",demandOption:!0}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`history <id>`,describe:"Returns the chronological change history for the resource identified by the given audit log entry. The endpoint first locates the source audit log entry by `id` (using `action_time` to narrow the lookup window), derives identifying filters from that entry, and then returns matching audit logs within the `since`/`before` window. The `result_info.history_status` field indicates the quality of the resource identification used: - `exact`: Resource was identified by the resource URI. - `approximate`: Resource was identified without the resource URI. - `unavailable`: The source audit log entry did not contain enough information to identify the resource; an empty result is returned.",builder:m(Te),handler:async r=>{let c={action_time:r[`action-time`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf accounts logs audit history`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}/history`,pathParams:{id:String(r.id??``)},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.logs.audit.history({account_id:u,id:r.id,...c})),{successLabel:`Loaded`})}};function De(e){return e.option(`account-name`,{type:`string`,description:`Filters by the account name.`}).option(`action-result`,{type:`string`,description:`Filters by whether the action was successful or not.`}).option(`action-type`,{type:`string`,description:`Filters by the action type.`}).option(`actor-context`,{type:`string`,description:"Filters by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email`,{type:`string`,description:`Filters by the actor's email address.`}).option(`actor-id`,{type:`string`,description:`Filters by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address`,{type:`string`,description:`The IP address where the action was initiated.`}).option(`actor-token-id`,{type:`string`,description:`Filters by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name`,{type:`string`,description:`Filters by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type`,{type:`string`,description:`Filters by the actor type.`}).option(`audit-log-id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`id`,{type:`string`,description:`Finds a specific log by its ID.`}).option(`raw-cf-ray-id`,{type:`string`,description:`Filters by the response CF Ray ID.`}).option(`raw-method`,{type:`string`,description:`The HTTP method for the API call.`}).option(`raw-status-code`,{type:`string`,description:`The response status code that was returned.`}).option(`raw-uri`,{type:`string`,description:`Filters by the request URI.`}).option(`resource-id`,{type:`string`,description:`Filters by the resource ID.`}).option(`resource-product`,{type:`string`,description:`Filters audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type`,{type:`string`,description:`Filters audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope`,{type:`string`,description:`Filters by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`product-category`,{type:`string`,description:`Filters audit logs by one or more predefined product categories. Each product category expands into a curated set of resource_product values and is unioned with any explicit resource_product filter. Matched case-insensitively; unknown product categories return 400. Repeatable. Use the audit log product categories endpoint to discover the available values.`}).option(`zone-id`,{type:`string`,description:`Filters by the zone ID.`}).option(`zone-name`,{type:`string`,description:`Filters by the zone name associated with the change.`}).option(`account-name-not`,{type:`string`,description:`Filters out audit logs by the account name.`}).option(`action-result-not`,{type:`string`,description:`Filters out audit logs by whether the action was successful or not.`}).option(`action-type-not`,{type:`string`,description:`Filters out audit logs by the action type.`}).option(`actor-context-not`,{type:`string`,description:"Filters out audit logs by the actor context.\n- `api`: The action was performed through the API. The specific credential type was not recorded.\n- `api_key`: The action was authenticated with a Cloudflare Global API Key.\n- `api_token`: The action was authenticated with an API token.\n- `dash`: The action was performed through the Cloudflare dashboard.\n- `oauth`: The action was authenticated with an OAuth token.\n- `origin_ca_key`: The action was authenticated with an Origin CA key."}).option(`actor-email-not`,{type:`string`,description:`Filters out audit logs by the actor's email address.`}).option(`actor-id-not`,{type:`string`,description:`Filters out audit logs by the actor ID. This can be either the Account ID or User ID.`}).option(`actor-ip-address-not`,{type:`string`,description:`Filters out audit logs IP address where the action was initiated.`}).option(`actor-token-id-not`,{type:`string`,description:`Filters out audit logs by the API token ID when the actor context is an api_token or oauth.`}).option(`actor-token-name-not`,{type:`string`,description:`Filters out audit logs by the API token name when the actor context is an api_token or oauth.`}).option(`actor-type-not`,{type:`string`,description:`Filters out audit logs by the actor type.`}).option(`audit-log-id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`id-not`,{type:`string`,description:`Filters out audit logs by their IDs.`}).option(`raw-cf-ray-id-not`,{type:`string`,description:`Filters out audit logs by the response CF Ray ID.`}).option(`raw-method-not`,{type:`string`,description:`Filters out audit logs by the HTTP method for the API call.`}).option(`raw-status-code-not`,{type:`string`,description:`Filters out audit logs by the response status code that was returned.`}).option(`raw-uri-not`,{type:`string`,description:`Filters out audit logs by the request URI.`}).option(`resource-id-not`,{type:`string`,description:`Filters out audit logs by the resource ID.`}).option(`resource-product-not`,{type:`string`,description:`Filters out audit logs by the Cloudflare product associated with the changed resource.`}).option(`resource-type-not`,{type:`string`,description:`Filters out audit logs based on the unique type of resource changed by the action.`}).option(`resource-scope-not`,{type:`string`,description:`Filters out audit logs by the resource scope, specifying whether the resource is associated with an user, an account, a zone, or a membership.`}).option(`zone-id-not`,{type:`string`,description:`Filters out audit logs by the zone ID.`}).option(`zone-name-not`,{type:`string`,description:`Filters out audit logs by the zone name associated with the change.`}).option(`since`,{type:`string`,description:`Limits the returned results to logs newer than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`before`,{type:`string`,description:`Limits the returned results to logs older than the specified date. This can be a date string 2019-04-30 (interpreted in UTC) or an absolute timestamp that conforms to RFC3339.`,demandOption:!0}).option(`direction`,{type:`string`,description:`Sets sorting order.`,choices:[`desc`,`asc`]}).option(`limit`,{type:`number`,description:`The number limits the objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`The cursor is an opaque token used to paginate through large sets of records. It indicates the position from which to continue when requesting the next set of records. A valid cursor value can be obtained from the cursor object in the result_info structure of a previous response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Oe={command:`list`,describe:`Gets a list of audit logs for an account.`,builder:m(De),handler:async r=>{let c={account_name:r[`account-name`],action_result:r[`action-result`],action_type:r[`action-type`],actor_context:r[`actor-context`],actor_email:r[`actor-email`],actor_id:r[`actor-id`],actor_ip_address:r[`actor-ip-address`],actor_token_id:r[`actor-token-id`],actor_token_name:r[`actor-token-name`],actor_type:r[`actor-type`],audit_log_id:r[`audit-log-id`],id:r.id,raw_cf_ray_id:r[`raw-cf-ray-id`],raw_method:r[`raw-method`],raw_status_code:r[`raw-status-code`],raw_uri:r[`raw-uri`],resource_id:r[`resource-id`],resource_product:r[`resource-product`],resource_type:r[`resource-type`],resource_scope:r[`resource-scope`],product_category:r[`product-category`],zone_id:r[`zone-id`],zone_name:r[`zone-name`],"account_name.not":r[`account-name-not`],"action_result.not":r[`action-result-not`],"action_type.not":r[`action-type-not`],"actor_context.not":r[`actor-context-not`],"actor_email.not":r[`actor-email-not`],"actor_id.not":r[`actor-id-not`],"actor_ip_address.not":r[`actor-ip-address-not`],"actor_token_id.not":r[`actor-token-id-not`],"actor_token_name.not":r[`actor-token-name-not`],"actor_type.not":r[`actor-type-not`],"audit_log_id.not":r[`audit-log-id-not`],"id.not":r[`id-not`],"raw_cf_ray_id.not":r[`raw-cf-ray-id-not`],"raw_method.not":r[`raw-method-not`],"raw_status_code.not":r[`raw-status-code-not`],"raw_uri.not":r[`raw-uri-not`],"resource_id.not":r[`resource-id-not`],"resource_product.not":r[`resource-product-not`],"resource_type.not":r[`resource-type-not`],"resource_scope.not":r[`resource-scope-not`],"zone_id.not":r[`zone-id-not`],"zone_name.not":r[`zone-name-not`],since:r.since,before:r.before,direction:r.direction,limit:r.limit,cursor:r.cursor};if(r.dryRun){o({command:`cf accounts logs audit list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.logs.audit.list({account_id:u,...c})),{successLabel:`Loaded`})}};function ke(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ae={command:`product-categories`,describe:`Lists the available audit log product categories and the resource products each one expands to. Use these values with the product_category filter on the account audit logs endpoint.`,builder:ke,handler:async r=>{if(r.dryRun){o({command:`cf accounts logs audit product-categories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/logs/audit/product_categories`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.logs.audit.productCategories({account_id:l})),{successLabel:`Loaded`})}},je={command:`audit`,describe:`Operations for logs.audit`,builder:e=>e.command(Ee).command(Oe).command(Ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Me={command:`logs`,describe:`Operations for logs`,builder:e=>e.command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ne(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`roles`,{type:`string`,array:!0,description:`Array of roles associated with this member.`}).option(`status`,{type:`string`,description:`Status of the member invitation. If not provided during creation, defaults to 'pending'.
|
|
20
|
-
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 Pe={command:`create`,describe:`Add a user to the list of members for this account.`,builder:Ne,handler:async r=>{if(r.dryRun){o({command:`cf accounts members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({email:d(r.email,`email`,`text`),roles:r.roles,status:d(r.status,`status`,`text`),policies:l(r.policies,`policies`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.accounts.members.create({body:e,account_id:m})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await f(`email`,`The contact email address of the user.`));let h=u({email:d(r.email,`email`,`text`),roles:r.roles,status:d(r.status,`status`,`text`),policies:l(r.policies,`policies`)});a(await s(`Creating`,async()=>p.accounts.members.create({body:h,account_id:m})),{successLabel:`Created`})}};function Fe(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ie={command:`delete <member-id>`,describe:`Remove a member from an account.`,builder:Fe,handler:async r=>{if(r.dryRun){o({command:`cf accounts members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure you want to remove this user from the account?`})){process.stderr.write(`Aborted.
|
|
22
|
-
`);return}a(await s(`Deleting`,async()=>c.accounts.members.delete({account_id:l,member_id:r[`member-id`]})),{successLabel:`Deleted`})}};function Le(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Re={command:`get <member-id>`,describe:`Get information about a specific member of an account.`,builder:Le,handler:async r=>{if(r.dryRun){o({command:`cf accounts members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.members.get({account_id:l,member_id:r[`member-id`]})),{successLabel:`Loaded`})}};function ze(e){return e.option(`order`,{type:`string`,description:`Field to order results by.`,choices:[`user.first_name`,`user.last_name`,`user.email`,`status`]}).option(`status`,{type:`string`,description:`A member's status in the account.`,choices:[`accepted`,`pending`,`rejected`]}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`list`,describe:`List all members of an account.`,builder:m(ze),handler:async r=>{let c={order:r.order,status:r.status,page:r.page,per_page:r[`per-page`],direction:r.direction};if(r.dryRun){o({command:`cf accounts members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.members.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Ve(e){return e.positional(`member-id`,{type:`string`,description:`Membership identifier tag.`,demandOption:!0}).option(`roles`,{type:`string`,description:`Roles assigned to this member. Provide as a JSON array of objects or @path/to/file.json.`}).option(`policies`,{type:`string`,description:`Array of policies associated with this member. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`roles`,[`policies`]).conflicts(`policies`,[`roles`])}const He={command:`update <member-id>`,describe:`Modify an account member.`,builder:Ve,handler:async r=>{if(r.dryRun){o({command:`cf accounts members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/members/${r[`member-id`]==null?`<member-id>`:encodeURIComponent(String(r[`member-id`]))}`,pathParams:{"member-id":String(r[`member-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({roles:l(r.roles,`roles`),policies:l(r.policies,`policies`)}):c(r.body)});return}let d=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.accounts.members.update({body:e,account_id:f,member_id:r[`member-id`]})),{successLabel:`Updated`});return}let p=u({roles:l(r.roles,`roles`),policies:l(r.policies,`policies`)});a(await s(`Updating`,async()=>d.accounts.members.update({body:p,account_id:f,member_id:r[`member-id`]})),{successLabel:`Updated`})}},Ue={command:`members`,describe:`Operations for members`,builder:e=>e.command(Pe).command(Ie).command(Re).command(Be).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function We(e){return e.option(`subscription-ids`,{type:`string`,array:!0,description:`List of subscription identifiers to cancel downgrades for.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ge={command:`cancelDelayedDowngrade`,describe:`Cancels pending delayed downgrades for the specified subscriptions.`,builder:We,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions cancelDelayedDowngrade`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/cancel-downgrade`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({subscription_ids:r[`subscription-ids`]}):c(r.body)});return}let l=await i(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.subscriptions.cancelDelayedDowngrade({...e,account_id:d})),{successLabel:`Created`});return}let f=u({subscription_ids:r[`subscription-ids`]});a(await s(`Creating`,async()=>l.accounts.subscriptions.cancelDelayedDowngrade({...f,account_id:d})),{successLabel:`Created`})}};function Ke(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`component-values`,{type:`string`,description:`Configurable component values for the subscription. Provide as a JSON array of objects or @path/to/file.json.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const qe={command:`create`,describe:`Creates an account or zone subscription.`,builder:Ke,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf accounts subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/subscriptions`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?u({app:{install_id:d(f[`app-install-id`],`app-install-id`,`text`)},component_values:l(f[`component-values`],`component-values`),frequency:d(f.frequency,`frequency`,`text`),rate_plan:{currency:d(f[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:f[`rate-plan-externally-managed`],id:d(f[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:f[`rate-plan-is-contract`],public_name:d(f[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(f[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:f[`rate-plan-sets`]}}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.accounts.subscriptions.create({body:e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}let g=u({app:{install_id:d(f[`app-install-id`],`app-install-id`,`text`)},component_values:l(f[`component-values`],`component-values`),frequency:d(f.frequency,`frequency`,`text`),rate_plan:{currency:d(f[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:f[`rate-plan-externally-managed`],id:d(f[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:f[`rate-plan-is-contract`],public_name:d(f[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(f[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:f[`rate-plan-sets`]}});a(await s(`Creating`,async()=>p.accounts.subscriptions.create({body:g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function Je(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`other`,{type:`string`,description:`Additional cancellation details.`}).option(`reason-code`,{type:`string`,array:!0,description:`The cancellation reason codes.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ye={command:`createCancelReason <subscription-identifier>`,describe:`Records a cancellation reason for an account subscription.`,builder:Je,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions createCancelReason`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}/cancel-reason`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({other:d(r.other,`other`,`text`),reason_code:r[`reason-code`]}):c(r.body)});return}let l=await i(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=c(r.body);a(await s(`Creating`,async()=>l.accounts.subscriptions.createCancelReason({...e,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`});return}let p=u({other:d(r.other,`other`,`text`),reason_code:r[`reason-code`]});a(await s(`Creating`,async()=>l.accounts.subscriptions.createCancelReason({...p,account_id:f,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Created`})}};function Xe(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ze={command:`delete <subscription-identifier>`,describe:`Deletes an account's subscription.`,builder:Xe,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
23
|
-
`);return}a(await s(`Deleting`,async()=>c.accounts.subscriptions.delete({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Deleted`})}};function Qe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $e={command:`get`,describe:`Lists all of an account or zone's subscriptions.`,builder:Qe,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf accounts subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/subscriptions`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.accounts.subscriptions.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}};function et(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tt={command:`getByIdentifier <subscription-identifier>`,describe:`Gets an account subscription by identifier.`,builder:et,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions getByIdentifier`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.subscriptions.getByIdentifier({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Loaded`})}};function nt(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const rt={command:`getCancelReason <subscription-identifier>`,describe:`Gets the cancellation reason for an account subscription.`,builder:nt,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions getCancelReason`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}/cancel-reason`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.subscriptions.getCancelReason({account_id:l,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Loaded`})}};function it(e){return e.positional(`subscription-identifier`,{type:`string`,description:`Subscription identifier tag.`,demandOption:!0}).option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`component-values`,{type:`string`,description:`Configurable component values for the subscription. Provide as a JSON array of objects or @path/to/file.json.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const at={command:`update <subscription-identifier>`,describe:`Updates an account subscription.`,builder:it,handler:async r=>{if(r.dryRun){o({command:`cf accounts subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/subscriptions/${r[`subscription-identifier`]==null?`<subscription-identifier>`:encodeURIComponent(String(r[`subscription-identifier`]))}`,pathParams:{"subscription-identifier":String(r[`subscription-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?u({app:{install_id:d(r[`app-install-id`],`app-install-id`,`text`)},component_values:l(r[`component-values`],`component-values`),frequency:d(r.frequency,`frequency`,`text`),rate_plan:{currency:d(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:d(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:d(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>f.accounts.subscriptions.update({body:e,account_id:p,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`});return}let m=u({app:{install_id:d(r[`app-install-id`],`app-install-id`,`text`)},component_values:l(r[`component-values`],`component-values`),frequency:d(r.frequency,`frequency`,`text`),rate_plan:{currency:d(r[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:r[`rate-plan-externally-managed`],id:d(r[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:r[`rate-plan-is-contract`],public_name:d(r[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:d(r[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:r[`rate-plan-sets`]}});a(await s(`Updating`,async()=>f.accounts.subscriptions.update({body:m,account_id:p,subscription_identifier:r[`subscription-identifier`]})),{successLabel:`Updated`})}},ot={command:`subscriptions`,describe:`View and manage plan subscriptions attached to this account`,builder:e=>e.command(Ge).command(qe).command(Ye).command(Ze).command($e).command(tt).command(rt).command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function st(e){return e.option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).option(`policies`,{type:`string`,description:`List of access policies assigned to the token. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ct={command:`create`,describe:`Create a new Account Owned API token.`,builder:st,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),policies:l(r.policies,`policies`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Creating`,async()=>p.accounts.tokens.create({body:e,account_id:m})),{successLabel:`Created`});return}if(r.name===void 0&&(r.name=await f(`name`,`Token name.`)),r.policies===void 0)throw Error(`--policies is required (or pass --body with this field set).`);let h=u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),policies:l(r.policies,`policies`)});a(await s(`Creating`,async()=>p.accounts.tokens.create({body:h,account_id:m})),{successLabel:`Created`})}};function lt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ut={command:`delete <token-id>`,describe:`Destroy an Account Owned API token.`,builder:lt,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
24
|
-
`);return}a(await s(`Deleting`,async()=>c.accounts.tokens.delete({account_id:l,token_id:r[`token-id`]})),{successLabel:`Deleted`})}};function dt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ft={command:`get <token-id>`,describe:`Get information about a specific Account Owned API token.`,builder:dt,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.tokens.get({account_id:l,token_id:r[`token-id`]})),{successLabel:`Loaded`})}};function $(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`include-expired`,{type:`boolean`,description:`When true, includes recently-expired tokens in the response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pt={command:`list`,describe:`List all Account Owned API tokens created for this account. Results include active, disabled, and recently-expired tokens when include_expired is set to true.`,builder:m($),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],direction:r.direction,include_expired:r[`include-expired`]};if(r.dryRun){o({command:`cf accounts tokens list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.tokens.list({account_id:u,...c})),{successLabel:`Loaded`})}};function mt(e){return e.option(`name`,{type:`string`,description:`Filter by the name of the permission group.
|
|
25
|
-
The value must be URL-encoded.`}).option(`scope`,{type:`string`,description:`Filter by the scope of the permission group.
|
|
26
|
-
The value must be URL-encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ht={command:`list`,describe:`Find all available permission groups for Account Owned API Tokens`,builder:mt,handler:async r=>{let c={name:r.name,scope:r.scope};if(r.dryRun){o({command:`cf accounts tokens permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/permission_groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.accounts.tokens.permissionGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}},gt={command:`permission-groups`,describe:`Operations for tokens.permission-groups`,builder:e=>e.command(ht).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _t(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const vt={command:`roll <token-id>`,describe:`Roll the Account Owned API token secret.`,builder:_t,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens roll`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}/value`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force,message:`Rolling this token will invalidate the current secret and generate a new one. Any integrations using the current secret will stop working.`})){process.stderr.write(`Aborted.
|
|
27
|
-
`);return}a(await s(`Deleting`,async()=>c.accounts.tokens.roll({account_id:l,token_id:r[`token-id`]})),{successLabel:`Deleted`})}};function yt(e){return e.positional(`token-id`,{type:`string`,description:`Token identifier tag.`,demandOption:!0}).option(`condition-request-ip-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`condition-request-ip-not-in`,{type:`string`,array:!0,description:`List of IPv4/IPv6 CIDR addresses.`}).option(`expires-on`,{type:`string`,description:`The expiration time on or after which the JWT MUST NOT be accepted for processing.`}).option(`name`,{type:`string`,description:`Token name.`}).option(`not-before`,{type:`string`,description:`The time before which the token MUST NOT be accepted for processing.`}).option(`policies`,{type:`string`,description:`List of access policies assigned to the token. Provide as a JSON array of objects or @path/to/file.json.`}).option(`status`,{type:`string`,description:`Status of the token.`,choices:[`active`,`disabled`,`expired`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const bt={command:`update <token-id>`,describe:`Update an existing token.`,builder:yt,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/${r[`token-id`]==null?`<token-id>`:encodeURIComponent(String(r[`token-id`]))}`,pathParams:{"token-id":String(r[`token-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),policies:l(r.policies,`policies`),status:d(r.status,`status`,`text`)}):c(r.body)});return}let p=await i(r),m=r.local?e:await t();if(r.accountId=m,r.body){let e=c(r.body);a(await s(`Updating`,async()=>p.accounts.tokens.update({body:e,account_id:m,token_id:r[`token-id`]})),{successLabel:`Updated`});return}if(r.name===void 0&&(r.name=await f(`name`,`Token name.`)),r.policies===void 0)throw Error(`--policies is required (or pass --body with this field set).`);let h=u({condition:{request_ip:{in:r[`condition-request-ip-in`],not_in:r[`condition-request-ip-not-in`]}},expires_on:d(r[`expires-on`],`expires-on`,`text`),name:d(r.name,`name`,`text`),not_before:d(r[`not-before`],`not-before`,`text`),policies:l(r.policies,`policies`),status:d(r.status,`status`,`text`)});a(await s(`Updating`,async()=>p.accounts.tokens.update({body:h,account_id:m,token_id:r[`token-id`]})),{successLabel:`Updated`})}};function xt(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const St={command:`verify`,describe:`Test whether a token works.`,builder:xt,handler:async r=>{if(r.dryRun){o({command:`cf accounts tokens verify`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tokens/verify`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.accounts.tokens.verify({account_id:l})),{successLabel:`Loaded`})}},Ct={command:`tokens`,describe:`Create and manage scoped API tokens for programmatic access to the Cloudflare API`,builder:e=>e.command(ct).command(ut).command(ft).command(pt).command(vt).command(bt).command(St).command(gt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function wt(e){return e.option(`id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`Account name`}).option(`settings-abuse-contact-email`,{type:`string`,description:`Sets an abuse contact email to notify for abuse reports.`}).option(`settings-enforce-twofactor`,{type:`boolean`,description:`Indicates whether membership in this account requires that
|
|
28
|
-
Two-Factor Authentication is enabled`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Tt={command:`update`,describe:`Update an existing account.`,builder:wt,handler:async r=>{if(r.dryRun){o({command:`cf accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({id:d(r.id,`id`,`text`),name:d(r.name,`name`,`text`),settings:{abuse_contact_email:d(r[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:r[`settings-enforce-twofactor`]}}):c(r.body)});return}let l=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>l.accounts.update({body:e,account_id:p})),{successLabel:`Updated`});return}r.id===void 0&&(r.id=await f(`id`,`Identifier`)),r.name===void 0&&(r.name=await f(`name`,`Account name`));let m=u({id:d(r.id,`id`,`text`),name:d(r.name,`name`,`text`),settings:{abuse_contact_email:d(r[`settings-abuse-contact-email`],`settings-abuse-contact-email`,`text`),enforce_twofactor:r[`settings-enforce-twofactor`]}});a(await s(`Updating`,async()=>l.accounts.update({body:m,account_id:p})),{successLabel:`Updated`})}},Et={command:`accounts`,describe:`Account settings, members, roles, subscriptions, and API tokens for your Cloudflare account`,builder:e=>e.command(ve).command(be).command(Se).command(we).command(Tt).command(D).command(le).command(ge).command(Me).command(Ue).command(ot).command(Ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Et as default};
|
package/dist/acm-CVvCTaNk.mjs
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-DAa7SwkM.mjs";import{r as t}from"./auth-DY_Y2bXC.mjs";import{t as n}from"./output-BqDR9h74.mjs";import{t as r}from"./dry-run-ILZRVpnp.mjs";import{t as i}from"./progress-jYW64HY7.mjs";import{n as a,t as o}from"./body-parser-BGVbwPeM.mjs";import{n as s}from"./input-validation-1esLElok.mjs";import{a as c,n as l}from"./prompt-CyATfGUu.mjs";function u(e){return e.option(`certificate`,{type:`string`,description:`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const d={command:`create`,describe:`Upload a root CA certificate to the Custom Origin Trust Store for a Zone. Only root CA certificates are accepted.`,builder:u,handler:async l=>{if(l.dryRun){r({command:`cf acm custom-trust-store create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({certificate:s(l.certificate,`certificate`,`text`)}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.acm.customTrustStore.create({...e,zone_id:d})),{successLabel:`Created`});return}l.certificate===void 0&&(l.certificate=await c(`certificate`,`The root CA certificate in PEM format. Only root CA certificates are accepted; intermediate and leaf certificates are not supported.`));let f=o({certificate:s(l.certificate,`certificate`,`text`)});n(await i(`Creating`,async()=>u.acm.customTrustStore.create({...f,zone_id:d})),{successLabel:`Created`})}};function f(e){return e.positional(`custom-origin-trust-store-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <custom-origin-trust-store-id>`,describe:`Removes a root CA certificate from the custom origin trust store. Origins using certificates signed by this CA will no longer be trusted.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf acm custom-trust-store delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/custom_trust_store/${a[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(a[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(a[`custom-origin-trust-store-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}n(await i(`Deleting`,async()=>o.acm.customTrustStore.delete({zone_id:s,custom_origin_trust_store_id:a[`custom-origin-trust-store-id`]})),{successLabel:`Deleted`})}};function m(e){return e.positional(`custom-origin-trust-store-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <custom-origin-trust-store-id>`,describe:`Retrieves details about a specific root CA certificate in the custom origin trust store, including expiration and subject information.`,builder:m,handler:async a=>{if(a.dryRun){r({command:`cf acm custom-trust-store get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/custom_trust_store/${a[`custom-origin-trust-store-id`]==null?`<custom-origin-trust-store-id>`:encodeURIComponent(String(a[`custom-origin-trust-store-id`]))}`,pathParams:{"custom-origin-trust-store-id":String(a[`custom-origin-trust-store-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.acm.customTrustStore.get({zone_id:s,custom_origin_trust_store_id:a[`custom-origin-trust-store-id`]})),{successLabel:`Loaded`})}};function g(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of records per page.`}).option(`limit`,{type:`number`,description:`Limit to the number of records returned.`}).option(`offset`,{type:`number`,description:`Offset the results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`list`,describe:`Get Custom Origin Trust Store for a Zone.`,builder:g,handler:async a=>{let o={page:a.page,per_page:a[`per-page`],limit:a.limit,offset:a.offset};if(a.dryRun){r({command:`cf acm custom-trust-store list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/custom_trust_store`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.acm.customTrustStore.list({zone_id:c,...o})),{successLabel:`Loaded`})}},v={command:`custom-trust-store`,describe:`Operations for custom-trust-store`,builder:e=>e.command(d).command(p).command(h).command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`certificate-authority`,{type:`string`,description:`The Certificate Authority that Total TLS certificates will be issued through.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`enabled`,{type:`boolean`,description:`If enabled, Total TLS will order a hostname specific TLS certificate for any proxied A, AAAA, or CNAME record in your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`edit`,describe:`Set Total TLS Settings or disable the feature for a Zone.`,builder:y,handler:async c=>{if(c.dryRun){r({command:`cf acm total-tls edit`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({certificate_authority:s(c[`certificate-authority`],`certificate-authority`,`text`),enabled:c.enabled}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.acm.totalTls.edit({...e,zone_id:u})),{successLabel:`Created`});return}if(c.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let d=o({certificate_authority:s(c[`certificate-authority`],`certificate-authority`,`text`),enabled:c.enabled});n(await i(`Creating`,async()=>l.acm.totalTls.edit({...d,zone_id:u})),{successLabel:`Created`})}};function x(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`get`,describe:`Get Total TLS Settings for a Zone.`,builder:x,handler:async a=>{if(a.dryRun){r({command:`cf acm total-tls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/acm/total_tls`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.acm.totalTls.get({zone_id:s})),{successLabel:`Loaded`})}},C={command:`total-tls`,describe:`Operations for total-tls`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},w={command:`acm`,describe:`acm`,builder:e=>e.command(v).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{a as i,r as a}from"./auth-DY_Y2bXC.mjs";import{t as o}from"./output-BqDR9h74.mjs";import{t as s}from"./dry-run-ILZRVpnp.mjs";import{t as c}from"./progress-jYW64HY7.mjs";import{n as l,r as u,t as d}from"./body-parser-BGVbwPeM.mjs";import{n as f,t as p}from"./input-validation-1esLElok.mjs";import{a as m,n as h}from"./prompt-CyATfGUu.mjs";import{n as ee,t as te}from"./raw-fetch-CNKIypJ7.mjs";function g(e){return e.positional(`account-id-2`,{type:`string`,description:`Identifier of a Cloudflare account.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 _={command:`delete <account-id-2>`,describe:`Remove an account as a member of a particular address map.`,builder:g,handler:async r=>{if(r.dryRun){s({command:`cf addressing address-maps accounts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/accounts/${r[`account-id-2`]==null?`<account-id-2>`:encodeURIComponent(String(r[`account-id-2`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``),"account-id-2":String(r[`account-id-2`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}o(await c(`Deleting`,async()=>i.addressing.addressMaps.accounts.delete({account_id:l,address_map_id:r[`address-map-id`],account_id_2:r[`account-id-2`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`account-id-2`,{type:`string`,description:`Identifier of a Cloudflare account.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`update <account-id-2>`,describe:`Add an account as a member of a particular address map.`,builder:v,handler:async r=>{if(r.dryRun){s({command:`cf addressing address-maps accounts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/accounts/${r[`account-id-2`]==null?`<account-id-2>`:encodeURIComponent(String(r[`account-id-2`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``),"account-id-2":String(r[`account-id-2`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.addressing.addressMaps.accounts.update({account_id:l,address_map_id:r[`address-map-id`],account_id_2:r[`account-id-2`]})),{successLabel:`Updated`})}},b={command:`accounts`,describe:`Operations for address-maps.accounts`,builder:e=>e.command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function x(e){return e.option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map is enabled.`,default:!1}).option(`ips`,{type:`string`,array:!0,description:`The ips field`}).option(`memberships`,{type:`string`,description:`Zones and Accounts which will be assigned IPs on this Address Map. A zone membership will take priority over an account membership. 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 S={command:`create`,describe:`Create a new address map under the account.`,builder:x,handler:async r=>{if(r.dryRun){s({command:`cf addressing address-maps create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({description:f(r.description,`description`,`text`),enabled:r.enabled,ips:r.ips,memberships:u(r.memberships,`memberships`)}):l(r.body)});return}let i=await a(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.addressing.addressMaps.create({...e,account_id:p})),{successLabel:`Created`});return}let m=d({description:f(r.description,`description`,`text`),enabled:r.enabled,ips:r.ips,memberships:u(r.memberships,`memberships`)});o(await c(`Creating`,async()=>i.addressing.addressMaps.create({...m,account_id:p})),{successLabel:`Created`})}};function C(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 w={command:`delete <address-map-id>`,describe:`Delete a particular address map owned by the account. An Address Map must be disabled before it can be deleted.`,builder:C,handler:async r=>{if(r.dryRun){s({command:`cf addressing address-maps delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}o(await c(`Deleting`,async()=>i.addressing.addressMaps.delete({account_id:l,address_map_id:r[`address-map-id`]})),{successLabel:`Deleted`})}};function T(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`default-sni`,{type:`string`,description:`If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map. If Cloudflare receives a TLS handshake from a client without an SNI, it will respond with the default SNI on those IPs. The default SNI can be any valid zone or subdomain owned by the account.`}).option(`description`,{type:`string`,description:`An optional description field which may be used to describe the types of IPs or zones on the map.`}).option(`enabled`,{type:`boolean`,description:`Whether the Address Map is enabled or not. Cloudflare's DNS will not respond with IP addresses on an Address Map until the map 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 E={command:`edit <address-map-id>`,describe:`Modify properties of an address map owned by the account.`,builder:T,handler:async r=>{if(r.dryRun){s({command:`cf addressing address-maps edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({default_sni:f(r[`default-sni`],`default-sni`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.addressing.addressMaps.edit({...e,account_id:u,address_map_id:r[`address-map-id`]})),{successLabel:`Updated`});return}let p=d({default_sni:f(r[`default-sni`],`default-sni`,`text`),description:f(r.description,`description`,`text`),enabled:r.enabled});o(await c(`Updating`,async()=>i.addressing.addressMaps.edit({...p,account_id:u,address_map_id:r[`address-map-id`]})),{successLabel:`Updated`})}};function D(e){return e.positional(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get <address-map-id>`,describe:`Show a particular address map owned by the account.`,builder:D,handler:async r=>{if(r.dryRun){s({command:`cf addressing address-maps get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}`,pathParams:{"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.addressMaps.get({account_id:l,address_map_id:r[`address-map-id`]})),{successLabel:`Loaded`})}};function k(e){return e.positional(`ip-address`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,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 A={command:`delete <ip-address>`,describe:`Remove an IP from a particular address map.`,builder:k,handler:async r=>{if(r.dryRun){s({command:`cf addressing address-maps ips delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/ips/${r[`ip-address`]==null?`<ip-address>`:encodeURIComponent(String(r[`ip-address`]))}`,pathParams:{"ip-address":String(r[`ip-address`]??``),"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}o(await c(`Deleting`,async()=>i.addressing.addressMaps.ips.delete({account_id:l,address_map_id:r[`address-map-id`],ip_address:r[`ip-address`]})),{successLabel:`Deleted`})}};function j(e){return e.positional(`ip-address`,{type:`string`,description:`An IPv4 or IPv6 address.`,demandOption:!0}).option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`update <ip-address>`,describe:`Add an IP from a prefix owned by the account to a particular address map.`,builder:j,handler:async r=>{if(r.dryRun){s({command:`cf addressing address-maps ips update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${r[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(r[`address-map-id`]))}/ips/${r[`ip-address`]==null?`<ip-address>`:encodeURIComponent(String(r[`ip-address`]))}`,pathParams:{"ip-address":String(r[`ip-address`]??``),"address-map-id":String(r[`address-map-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.addressing.addressMaps.ips.update({account_id:l,address_map_id:r[`address-map-id`],ip_address:r[`ip-address`]})),{successLabel:`Updated`})}},N={command:`ips`,describe:`Operations for address-maps.ips`,builder:e=>e.command(A).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list`,describe:`List all address maps owned by the account.`,builder:P,handler:async r=>{if(r.dryRun){s({command:`cf addressing address-maps list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.addressMaps.list({account_id:l})),{successLabel:`Loaded`})}};function I(e){return e.option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const L={command:`delete`,describe:`Remove a zone as a member of a particular address map.`,builder:I,handler:async i=>{if(i.dryRun){s({command:`cf addressing address-maps zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${i[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(i[`address-map-id`]))}/zones/${i.zone??i.zoneId??`<zone>`}`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``),"address-map-id":String(i[`address-map-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.local?e:await t();i.accountId=u;let d=await r({zone:i.zone},l,{quiet:i.quiet});if(i.zoneId=d,!await h({force:!!i.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}o(await c(`Deleting`,async()=>l.addressing.addressMaps.zones.delete({account_id:u,address_map_id:i[`address-map-id`],zone_id:d})),{successLabel:`Deleted`})}};function R(e){return e.option(`address-map-id`,{type:`string`,description:`Identifier of an Address Map.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`update`,describe:`Add a zone as a member of a particular address map.`,builder:R,handler:async i=>{if(i.dryRun){s({command:`cf addressing address-maps zones update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/address_maps/${i[`address-map-id`]==null?`<address-map-id>`:encodeURIComponent(String(i[`address-map-id`]))}/zones/${i.zone??i.zoneId??`<zone>`}`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``),"address-map-id":String(i[`address-map-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.local?e:await t();i.accountId=u;let d=await r({zone:i.zone},l,{quiet:i.quiet});i.zoneId=d,o(await c(`Updating`,async()=>l.addressing.addressMaps.zones.update({account_id:u,address_map_id:i[`address-map-id`],zone_id:d})),{successLabel:`Updated`})}},B={command:`zones`,describe:`Operations for address-maps.zones`,builder:e=>e.command(L).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},V={command:`address-maps`,describe:`Operations for address-maps`,builder:e=>e.command(S).command(w).command(E).command(O).command(F).command(b).command(N).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`List all leases owned by the account.`,builder:H,handler:async r=>{if(r.dryRun){s({command:`cf addressing leases list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/leases`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.leases.list({account_id:l})),{successLabel:`Loaded`})}},W={command:`leases`,describe:`Operations for leases`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`loa-document`,{type:`string`,description:`LOA document to upload.`})}const K={command:`create`,describe:`Submit LOA document (pdf format) under the account.`,builder:G,handler:async r=>{if(r.dryRun){s({command:`cf addressing loa-documents create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/loa_documents`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,"loa-document":r[`loa-document`]}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r[`loa-document`]!==void 0){let e=new FormData;if(r.file){let t=p(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);r[`loa-document`]!==void 0&&e.append(`loa_document`,String(f(r[`loa-document`],`loa-document`,`text`)??``)),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/addressing/loa_documents`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=f(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/addressing/loa_documents`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function q(e){return e.positional(`loa-document-id`,{type:`string`,description:`Identifier for the uploaded LOA document.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const J={command:`get <loa-document-id>`,describe:`Download specified LOA document under the account.`,builder:q,handler:async r=>{if(r.dryRun){s({command:`cf addressing loa-documents get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/loa_documents/${r[`loa-document-id`]==null?`<loa-document-id>`:encodeURIComponent(String(r[`loa-document-id`]))}/download`,pathParams:{"loa-document-id":String(r[`loa-document-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i;let o=await c(`Loading`,async()=>te(`/accounts/${i}/addressing/loa_documents/${encodeURIComponent(String(r[`loa-document-id`]))}/download`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));ee(r.text===!0?o.toString(`utf-8`):o)}},Y={command:`loa-documents`,describe:`Operations for loa-documents`,builder:e=>e.command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function X(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`advertised`,{type:`boolean`,description:"Advertisement status of the prefix. If `true`, the BGP route for the prefix is advertised to the Internet. If \n`false`, the BGP route is withdrawn.\n"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Z={command:`edit <prefix-id>`,describe:`Advertise or withdraw the BGP route for a prefix. **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for advertising and withdrawing subnets of an IP prefix.`,builder:X,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes advertisement-status edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bgp/status`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({advertised:r.advertised}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.addressing.prefixes.advertisementStatus.edit({...e,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Updated`});return}if(r.advertised===void 0)throw Error(`--advertised is required (or pass --body with this field set).`);let f=d({advertised:r.advertised});o(await c(`Updating`,async()=>i.addressing.prefixes.advertisementStatus.edit({...f,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Updated`})}};function Q(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`get <prefix-id>`,describe:`View the current advertisement state for a prefix. **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for advertising and withdrawing subnets of an IP prefix.`,builder:Q,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes advertisement-status get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bgp/status`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.prefixes.advertisementStatus.get({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Loaded`})}},re={command:`advertisement-status`,describe:`Operations for prefixes.advertisement-status`,builder:e=>e.command(Z).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ae={command:`create <prefix-id>`,describe:`Create a BGP prefix, controlling the BGP advertisement status of a specific subnet. When created, BGP prefixes are initially withdrawn, and can be advertised with the Update BGP Prefix API.`,builder:ie,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes bgp-prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bgp/prefixes`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({cidr:f(r.cidr,`cidr`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.addressing.prefixes.bgpPrefixes.create({...e,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Created`});return}r.cidr===void 0&&(r.cidr=await m(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`));let p=d({cidr:f(r.cidr,`cidr`,`text`)});o(await c(`Creating`,async()=>i.addressing.prefixes.bgpPrefixes.create({...p,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Created`})}};function oe(e){return e.positional(`bgp-prefix-id`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,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 se={command:`delete <bgp-prefix-id>`,describe:`Delete a BGP Prefix associated with the specified IP Prefix. A BGP Prefix must be withdrawn before it can be deleted.`,builder:oe,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes bgp-prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bgp/prefixes/${r[`bgp-prefix-id`]==null?`<bgp-prefix-id>`:encodeURIComponent(String(r[`bgp-prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``),"bgp-prefix-id":String(r[`bgp-prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
7
|
-
`);return}o(await c(`Deleting`,async()=>i.addressing.prefixes.bgpPrefixes.delete({account_id:l,prefix_id:r[`prefix-id`],bgp_prefix_id:r[`bgp-prefix-id`]})),{successLabel:`Deleted`})}};function ce(e){return e.positional(`bgp-prefix-id`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`asn-prepend-count`,{type:`number`,description:`Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute`}).option(`auto-advertise-withdraw`,{type:`boolean`,description:`Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no matching BGP prefix in the Magic routing table. When true, Cloudflare will automatically withdraw the BGP prefix when there are no matching BGP routes, and will resume advertising when there is at least one matching BGP route.`}).option(`on-demand-advertised`,{type:`boolean`,description:`The on_demand.advertised 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 le={command:`edit <bgp-prefix-id>`,describe:`Update the properties of a BGP Prefix, such as the on demand advertisement status (advertised or withdrawn).`,builder:ce,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes bgp-prefixes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bgp/prefixes/${r[`bgp-prefix-id`]==null?`<bgp-prefix-id>`:encodeURIComponent(String(r[`bgp-prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``),"bgp-prefix-id":String(r[`bgp-prefix-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({asn_prepend_count:r[`asn-prepend-count`],auto_advertise_withdraw:r[`auto-advertise-withdraw`],on_demand:{advertised:r[`on-demand-advertised`]}}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.addressing.prefixes.bgpPrefixes.edit({...e,account_id:u,prefix_id:r[`prefix-id`],bgp_prefix_id:r[`bgp-prefix-id`]})),{successLabel:`Updated`});return}let f=d({asn_prepend_count:r[`asn-prepend-count`],auto_advertise_withdraw:r[`auto-advertise-withdraw`],on_demand:{advertised:r[`on-demand-advertised`]}});o(await c(`Updating`,async()=>i.addressing.prefixes.bgpPrefixes.edit({...f,account_id:u,prefix_id:r[`prefix-id`],bgp_prefix_id:r[`bgp-prefix-id`]})),{successLabel:`Updated`})}};function ue(e){return e.positional(`bgp-prefix-id`,{type:`string`,description:`Identifier of BGP Prefix.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const de={command:`get <bgp-prefix-id>`,describe:`Retrieve a single BGP Prefix according to its identifier`,builder:ue,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes bgp-prefixes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bgp/prefixes/${r[`bgp-prefix-id`]==null?`<bgp-prefix-id>`:encodeURIComponent(String(r[`bgp-prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``),"bgp-prefix-id":String(r[`bgp-prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.prefixes.bgpPrefixes.get({account_id:l,prefix_id:r[`prefix-id`],bgp_prefix_id:r[`bgp-prefix-id`]})),{successLabel:`Loaded`})}};function fe(e){return e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const pe={command:`list`,describe:`List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to control which specific subnets are advertised to the Internet. It is possible to advertise subnets more specific than an IP Prefix by creating more specific BGP Prefixes.`,builder:fe,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes bgp-prefixes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bgp/prefixes`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.prefixes.bgpPrefixes.list({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Loaded`})}},me={command:`bgp-prefixes`,describe:`Operations for prefixes.bgp-prefixes`,builder:e=>e.command(ae).command(se).command(le).command(de).command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function he(e){return e.option(`asn`,{type:`number`,description:`Autonomous System Number (ASN) the prefix will be advertised under.`}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`delegate-loa-creation`,{type:`boolean`,description:`Whether Cloudflare is allowed to generate the LOA document on behalf of the prefix owner.`,default:!1}).option(`description`,{type:`string`,description:`Description of the prefix.`}).option(`loa-document-id`,{type:`string`,description:`Identifier for the uploaded LOA document.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ge={command:`create`,describe:`Add a new prefix under the account.`,builder:he,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({asn:r.asn,cidr:f(r.cidr,`cidr`,`text`),delegate_loa_creation:r[`delegate-loa-creation`],description:f(r.description,`description`,`text`),loa_document_id:f(r[`loa-document-id`],`loa-document-id`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.addressing.prefixes.create({...e,account_id:u})),{successLabel:`Created`});return}if(r.asn===void 0)throw Error(`--asn is required (or pass --body with this field set).`);r.cidr===void 0&&(r.cidr=await m(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`));let p=d({asn:r.asn,cidr:f(r.cidr,`cidr`,`text`),delegate_loa_creation:r[`delegate-loa-creation`],description:f(r.description,`description`,`text`),loa_document_id:f(r[`loa-document-id`],`loa-document-id`,`text`)});o(await c(`Creating`,async()=>i.addressing.prefixes.create({...p,account_id:u})),{successLabel:`Created`})}};function _e(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`delegated-account-id`,{type:`string`,description:`Account identifier for the account to which prefix is being delegated.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`create <prefix-id>`,describe:`Create a new account delegation for a given IP prefix.`,builder:_e,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes delegations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/delegations`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({cidr:f(r.cidr,`cidr`,`text`),delegated_account_id:f(r[`delegated-account-id`],`delegated-account-id`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.addressing.prefixes.delegations.create({...e,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Created`});return}r.cidr===void 0&&(r.cidr=await m(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`)),r[`delegated-account-id`]===void 0&&(r[`delegated-account-id`]=await m(`delegated-account-id`,`Account identifier for the account to which prefix is being delegated.`));let p=d({cidr:f(r.cidr,`cidr`,`text`),delegated_account_id:f(r[`delegated-account-id`],`delegated-account-id`,`text`)});o(await c(`Creating`,async()=>i.addressing.prefixes.delegations.create({...p,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Created`})}};function ye(e){return e.positional(`delegation-id`,{type:`string`,description:`Identifier of a Delegation.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,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 <delegation-id>`,describe:`Delete an account delegation for a given IP prefix.`,builder:ye,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes delegations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/delegations/${r[`delegation-id`]==null?`<delegation-id>`:encodeURIComponent(String(r[`delegation-id`]))}`,pathParams:{"delegation-id":String(r[`delegation-id`]??``),"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
8
|
-
`);return}o(await c(`Deleting`,async()=>i.addressing.prefixes.delegations.delete({account_id:l,prefix_id:r[`prefix-id`],delegation_id:r[`delegation-id`]})),{successLabel:`Deleted`})}};function xe(e){return e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`List all delegations for a given account IP prefix.`,builder:xe,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes delegations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/delegations`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.prefixes.delegations.list({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Loaded`})}},Ce={command:`delegations`,describe:`Operations for prefixes.delegations`,builder:e=>e.command(ve).command(be).command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function we(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,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 Te={command:`delete <prefix-id>`,describe:`Delete an unapproved prefix owned by the account.`,builder:we,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
9
|
-
`);return}o(await c(`Deleting`,async()=>i.addressing.prefixes.delete({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Deleted`})}};function Ee(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`description`,{type:`string`,description:`Description of the prefix.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const De={command:`edit <prefix-id>`,describe:`Modify the description for a prefix owned by the account.`,builder:Ee,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({description:f(r.description,`description`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.addressing.prefixes.edit({...e,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Updated`});return}r.description===void 0&&(r.description=await m(`description`,`Description of the prefix.`));let p=d({description:f(r.description,`description`,`text`)});o(await c(`Updating`,async()=>i.addressing.prefixes.edit({...p,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Updated`})}};function Oe(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get <prefix-id>`,describe:`List a particular prefix owned by the account.`,builder:Oe,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.prefixes.get({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Loaded`})}};function Ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`list`,describe:`List all prefixes owned by the account.`,builder:Ae,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.prefixes.list({account_id:l})),{successLabel:`Loaded`})}};function Me(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`cidr`,{type:`string`,description:`IP Prefix in Classless Inter-Domain Routing format.`}).option(`service-id`,{type:`string`,description:`Identifier of a Service on the Cloudflare network. Available services and their IDs may be found in the
|
|
10
|
-
**List Services** endpoint.
|
|
11
|
-
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ne={command:`create <prefix-id>`,describe:`Creates a new Service Binding, routing traffic to IPs within the given CIDR to a service running on Cloudflare's network. **NOTE:** The first Service Binding created for an IP Prefix must exactly match the IP Prefix's CIDR. Subsequent Service Bindings may be created with a more-specific CIDR. Refer to the [Service Bindings Documentation](https://developers.cloudflare.com/byoip/service-bindings/) for compatibility details.`,builder:Me,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes service-bindings create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bindings`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({cidr:f(r.cidr,`cidr`,`text`),service_id:f(r[`service-id`],`service-id`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.addressing.prefixes.serviceBindings.create({...e,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Created`});return}r.cidr===void 0&&(r.cidr=await m(`cidr`,`IP Prefix in Classless Inter-Domain Routing format.`)),r[`service-id`]===void 0&&(r[`service-id`]=await m(`service-id`,`Identifier of a Service on the Cloudflare network. Available services and their IDs may be found in the **List Services** endpoint. `));let p=d({cidr:f(r.cidr,`cidr`,`text`),service_id:f(r[`service-id`],`service-id`,`text`)});o(await c(`Creating`,async()=>i.addressing.prefixes.serviceBindings.create({...p,account_id:u,prefix_id:r[`prefix-id`]})),{successLabel:`Created`})}};function Pe(e){return e.positional(`binding-id`,{type:`string`,description:`Identifier of a Service Binding.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,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 Fe={command:`delete <binding-id>`,describe:`Delete a Service Binding`,builder:Pe,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes service-bindings delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bindings/${r[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(r[`binding-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``),"binding-id":String(r[`binding-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await h({force:!!r.force})){process.stderr.write(`Aborted.
|
|
12
|
-
`);return}o(await c(`Deleting`,async()=>i.addressing.prefixes.serviceBindings.delete({account_id:l,prefix_id:r[`prefix-id`],binding_id:r[`binding-id`]})),{successLabel:`Deleted`})}};function Ie(e){return e.positional(`binding-id`,{type:`string`,description:`Identifier of a Service Binding.`,demandOption:!0}).option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Le={command:`get <binding-id>`,describe:`Fetch a single Service Binding`,builder:Ie,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes service-bindings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bindings/${r[`binding-id`]==null?`<binding-id>`:encodeURIComponent(String(r[`binding-id`]))}`,pathParams:{"prefix-id":String(r[`prefix-id`]??``),"binding-id":String(r[`binding-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.prefixes.serviceBindings.get({account_id:l,prefix_id:r[`prefix-id`],binding_id:r[`binding-id`]})),{successLabel:`Loaded`})}};function Re(e){return e.option(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ze={command:`list`,describe:"List the Cloudflare services this prefix is currently bound to. Traffic sent to an address within an IP prefix will be routed to the Cloudflare service of the most-specific Service Binding matching the address. **Example:** binding `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other IPs in the prefix to Cloudflare Magic Transit.",builder:Re,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes service-bindings list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/bindings`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.prefixes.serviceBindings.list({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Loaded`})}},Be={command:`service-bindings`,describe:`Operations for prefixes.service-bindings`,builder:e=>e.command(Ne).command(Fe).command(Le).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ve(e){return e.positional(`prefix-id`,{type:`string`,description:`Identifier of an IP Prefix.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const He={command:`create <prefix-id>`,describe:`Triggers a new prefix validation. The checks are run asynchronously and include IRR, RPKI, and prefix ownership.`,builder:Ve,handler:async r=>{if(r.dryRun){s({command:`cf addressing prefixes validate create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/prefixes/${r[`prefix-id`]==null?`<prefix-id>`:encodeURIComponent(String(r[`prefix-id`]))}/validate`,pathParams:{"prefix-id":String(r[`prefix-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Creating`,async()=>i.addressing.prefixes.validate.create({account_id:l,prefix_id:r[`prefix-id`]})),{successLabel:`Created`})}},Ue={command:`validate`,describe:`Operations for prefixes.validate`,builder:e=>e.command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},We={command:`prefixes`,describe:`Operations for prefixes`,builder:e=>e.command(ge).command(Te).command(De).command(ke).command(je).command(re).command(me).command(Ce).command(Be).command(Ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ge(e){return e.option(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`"}).option(`region-key`,{type:`string`,description:`Identifying key for the region`}).option(`routing`,{type:`string`,description:`Configure which routing method to use for the regional hostname`,default:`dns`}).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 Ke={command:`create`,describe:`Create a new Regional Hostname entry. Cloudflare will only use data centers that are physically located within the chosen region to decrypt and service HTTPS traffic. Learn more about [Regional Services](https://developers.cloudflare.com/data-localization/regional-services/get-started/).`,builder:Ge,handler:async e=>{if(e.dryRun){s({command:`cf addressing regional_hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/addressing/regional_hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?d({hostname:f(e.hostname,`hostname`,`text`),region_key:f(e[`region-key`],`region-key`,`text`),routing:f(e.routing,`routing`,`text`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Creating`,async()=>t.addressing.regionalHostnames.create({...r,zone_id:n})),{successLabel:`Created`});return}e.hostname===void 0&&(e.hostname=await m(`hostname`,"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`")),e[`region-key`]===void 0&&(e[`region-key`]=await m(`region-key`,`Identifying key for the region`));let i=d({hostname:f(e.hostname,`hostname`,`text`),region_key:f(e[`region-key`],`region-key`,`text`),routing:f(e.routing,`routing`,`text`)});o(await c(`Creating`,async()=>t.addressing.regionalHostnames.create({...i,zone_id:n})),{successLabel:`Created`})}};function qe(e){return e.positional(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`",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 Je={command:`delete <hostname>`,describe:`Delete the region configuration for a specific Regional Hostname.`,builder:qe,handler:async e=>{if(e.dryRun){s({command:`cf addressing regional_hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/addressing/regional_hostnames/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),hostname:String(e.hostname??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await h({force:!!e.force})){process.stderr.write(`Aborted.
|
|
13
|
-
`);return}o(await c(`Deleting`,async()=>t.addressing.regionalHostnames.delete({zone_id:n,hostname:e.hostname})),{successLabel:`Deleted`})}};function $(e){return e.positional(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`",demandOption:!0}).option(`region-key`,{type:`string`,description:`Identifying key for the region`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ye={command:`edit <hostname>`,describe:`Update the configuration for a specific Regional Hostname. Only the region_key of a hostname is mutable.`,builder:$,handler:async e=>{if(e.dryRun){s({command:`cf addressing regional_hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/addressing/regional_hostnames/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),hostname:String(e.hostname??``)},bodyKind:`json`,body:e.body===void 0?d({region_key:f(e[`region-key`],`region-key`,`text`)}):l(e.body)});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=l(e.body);o(await c(`Updating`,async()=>t.addressing.regionalHostnames.edit({...r,zone_id:n,hostname:e.hostname})),{successLabel:`Updated`});return}e[`region-key`]===void 0&&(e[`region-key`]=await m(`region-key`,`Identifying key for the region`));let i=d({region_key:f(e[`region-key`],`region-key`,`text`)});o(await c(`Updating`,async()=>t.addressing.regionalHostnames.edit({...i,zone_id:n,hostname:e.hostname})),{successLabel:`Updated`})}};function Xe(e){return e.positional(`hostname`,{type:`string`,description:"DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are supported for one level, e.g `*.example.com`",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ze={command:`get <hostname>`,describe:`Fetch the configuration for a specific Regional Hostname, within a zone.`,builder:Xe,handler:async e=>{if(e.dryRun){s({command:`cf addressing regional_hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/addressing/regional_hostnames/${e.hostname==null?`<hostname>`:encodeURIComponent(String(e.hostname))}`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``),hostname:String(e.hostname??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.addressing.regionalHostnames.get({zone_id:n,hostname:e.hostname})),{successLabel:`Loaded`})}};function Qe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $e={command:`list`,describe:`List all Regional Hostnames within a zone.`,builder:Qe,handler:async e=>{if(e.dryRun){s({command:`cf addressing regional_hostnames list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/addressing/regional_hostnames`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await a(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,o(await c(`Loading`,async()=>t.addressing.regionalHostnames.list({zone_id:n})),{successLabel:`Loaded`})}};function et(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const tt={command:`list`,describe:`List all Regional Services regions available for use by this account.`,builder:et,handler:async r=>{if(r.dryRun){s({command:`cf addressing regional_hostnames regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/regional_hostnames/regions`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.regionalHostnames.regions.list({account_id:l})),{successLabel:`Loaded`})}},nt={command:`regions`,describe:`Operations for regional_hostnames.regions`,builder:e=>e.command(tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},rt={command:`regional_hostnames`,describe:`Operations for regional_hostnames`,builder:e=>e.command(Ke).command(Je).command(Ye).command(Ze).command($e).command(nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function it(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const at={command:`list`,describe:`Bring-Your-Own IP (BYOIP) prefixes onboarded to Cloudflare must be bound to a service running on the Cloudflare network to enable a Cloudflare product on the IP addresses. This endpoint can be used as a reference of available services on the Cloudflare network, and their service IDs.`,builder:it,handler:async r=>{if(r.dryRun){s({command:`cf addressing services list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/addressing/services`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.addressing.services.list({account_id:l})),{successLabel:`Loaded`})}},ot={command:`services`,describe:`Operations for services`,builder:e=>e.command(at).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},st={command:`addressing`,describe:`addressing`,builder:e=>e.command(V).command(W).command(Y).command(We).command(rt).command(ot).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{st as default};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./output-BqDR9h74.mjs";import{n as t}from"./metadata-DEqBUaSv.mjs";function n(e){return typeof e==`object`&&!!e&&`version`in e&&`products`in e&&`universal`in e&&typeof e.version==`string`&&typeof e.universal==`string`&&typeof e.products==`object`}const r={command:`agent-context [product]`,describe:`Output agent context and skill files`,builder:e=>e.positional(`product`,{describe:`Product name (e.g., d1, dns, zones)`,type:`string`}).option(`list`,{type:`boolean`,describe:`List available products`,default:!1}),handler:async r=>{let i=t(import.meta.url,`agent-context.json`,n);if(i||(console.error("Error: Could not load agent context. Run `pnpm generate` first."),process.exit(1)),r.list){e(Object.keys(i.products));return}if(r.product){let e=i.products[r.product];if(!e){let e=Object.keys(i.products).join(`, `);console.error(`Product "${r.product}" not found. Available: ${e}`),process.exit(1)}console.log(i.universal+`
|
|
3
|
-
|
|
4
|
-
`+e);return}console.log(i.universal+`
|
|
5
|
-
|
|
6
|
-
`+Object.values(i.products).join(`
|
|
7
|
-
|
|
8
|
-
`))}};export{r as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,r as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u}from"./input-validation-1esLElok.mjs";import{a as d,n as f}from"./prompt-CyATfGUu.mjs";import{t as p}from"./cli-types-C3nVfpSG.mjs";function m(e){return e.option(`name`,{type:`string`,description:`Namespace name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create-namespace`,describe:`Creates a new memory namespace owned by the account.`,builder:m,handler:async c=>{if(c.dryRun){a({command:`cf agent-memory create-namespace`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({name:u(c.name,`name`,`text`)}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.agentMemory.createNamespace({...e,account_id:p})),{successLabel:`Created`});return}c.name===void 0&&(c.name=await d(`name`,`Namespace name.`));let m=l({name:u(c.name,`name`,`text`)});i(await o(`Creating`,async()=>f.agentMemory.createNamespace({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`memory-id`,{type:`string`,description:`Memory Identifier.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`profile-name`,{type:`string`,description:`Profile name.`,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 _={command:`delete-memory <memory-id>`,describe:`Deletes a memory by ID. Removes the memory and any source messages linked to it. Returns the deleted memory.`,builder:g,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory delete-memory`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}/memories/${s[`memory-id`]==null?`<memory-id>`:encodeURIComponent(String(s[`memory-id`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``),"memory-id":String(s[`memory-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes the memory and any source messages linked to it.`})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>c.agentMemory.deleteMemory({account_id:l,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`],memory_id:s[`memory-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`namespace-name`,{type:`string`,description:`Namespace name.`,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 y={command:`delete-namespace <namespace-name>`,describe:`Deletes a namespace.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory delete-namespace`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes the namespace along with all memory profiles, memories, and sessions it contains.`})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}i(await o(`Deleting`,async()=>c.agentMemory.deleteNamespace({account_id:l,namespace_name:s[`namespace-name`]})),{successLabel:`Deleted`})}};function b(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,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 x={command:`delete-profile <profile-name>`,describe:`Marks a profile for deletion.`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory delete-profile`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes the profile along with all of its memories and messages.`})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}i(await o(`Deleting`,async()=>c.agentMemory.deleteProfile({account_id:l,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`]})),{successLabel:`Deleted`})}};function S(e){return e.positional(`session-id`,{type:`string`,description:`Session identifier.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const C={command:`delete-session <session-id>`,describe:`Marks all memories and messages in a profile that are tagged with the given session ID for deletion.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory delete-session`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}/sessions/${s[`session-id`]==null?`<session-id>`:encodeURIComponent(String(s[`session-id`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``),"session-id":String(s[`session-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`This operation deletes all memories and messages tagged with this session ID.`})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}i(await o(`Deleting`,async()=>c.agentMemory.deleteSession({account_id:l,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`],session_id:s[`session-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`memory-id`,{type:`string`,description:`Memory Identifier.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get-memory <memory-id>`,describe:`Retrieves a memory by ID.`,builder:w,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory get-memory`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}/memories/${s[`memory-id`]==null?`<memory-id>`:encodeURIComponent(String(s[`memory-id`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``),"memory-id":String(s[`memory-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.agentMemory.getMemory({account_id:l,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`],memory_id:s[`memory-id`]})),{successLabel:`Loaded`})}};function E(e){return e.positional(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get-namespace <namespace-name>`,describe:`Gets a namespace by name.`,builder:E,handler:async s=>{if(s.dryRun){a({command:`cf agent-memory get-namespace`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}`,pathParams:{"namespace-name":String(s[`namespace-name`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.agentMemory.getNamespace({account_id:l,namespace_name:s[`namespace-name`]})),{successLabel:`Loaded`})}};function O(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`messages`,{type:`string`,description:`Conversation messages to extract memories from. Provide as a JSON array of objects or @path/to/file.json.`}).option(`session-id`,{type:`string`,description:`Session identifier.`}).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:`ingest <profile-name>`,describe:`Processes a conversation and extracts structured memories from it. Agent Memory identifies facts, events, instructions, and tasks automatically.`,builder:O,handler:async d=>{if(d.dryRun){a({command:`cf agent-memory ingest`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${d[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(d[`namespace-name`]))}/profiles/${d[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(d[`profile-name`]))}/ingest`,pathParams:{"namespace-name":String(d[`namespace-name`]??``),"profile-name":String(d[`profile-name`]??``)},bodyKind:`json`,body:d.body===void 0?l({messages:c(d.messages,`messages`),sessionId:u(d[`session-id`],`session-id`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.agentMemory.ingest({...e,account_id:p,namespace_name:d[`namespace-name`],profile_name:d[`profile-name`]})),{successLabel:`Created`});return}if(d.messages===void 0)throw Error(`--messages is required (or pass --body with this field set).`);let m=l({messages:c(d.messages,`messages`),sessionId:u(d[`session-id`],`session-id`,`text`)});i(await o(`Creating`,async()=>f.agentMemory.ingest({...m,account_id:p,namespace_name:d[`namespace-name`],profile_name:d[`profile-name`]})),{successLabel:`Created`})}};function A(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`cursor`,{type:`string`,description:`Continuation cursor for paginated results.`}).option(`session-id`,{type:`string`,description:`Session identifier for filtering.`}).option(`type`,{type:`string`,description:`Memory type for filtering.`,choices:[`fact`,`event`,`instruction`,`task`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list-memories <profile-name>`,describe:`List memories stored in a profile.`,builder:p(A),handler:async s=>{let c={per_page:s[`per-page`],cursor:s.cursor,session_id:s[`session-id`],type:s.type};if(s.dryRun){a({command:`cf agent-memory list-memories`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles/${s[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(s[`profile-name`]))}/memories`,pathParams:{"namespace-name":String(s[`namespace-name`]??``),"profile-name":String(s[`profile-name`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.agentMemory.listMemories({account_id:u,namespace_name:s[`namespace-name`],profile_name:s[`profile-name`],...c})),{successLabel:`Loaded`})}};function M(e){return e.option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`order`,{type:`string`,description:`Field to order the results by.`,choices:[`id`,`name`]}).option(`direction`,{type:`string`,description:`Direction to sort the results in.`,choices:[`asc`,`desc`]}).option(`cursor`,{type:`string`,description:`Pagination cursor returned by a previous list response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list-namespaces`,describe:`Lists all namespaces for the given account. Results are paginated.`,builder:p(M),handler:async s=>{let c={per_page:s[`per-page`],order:s.order,direction:s.direction,cursor:s.cursor};if(s.dryRun){a({command:`cf agent-memory list-namespaces`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.agentMemory.listNamespaces({account_id:u,...c})),{successLabel:`Loaded`})}};function P(e){return e.positional(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Number of results per page.`}).option(`cursor`,{type:`string`,description:`Opaque continuation cursor returned by a previous list response.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`list-profiles <namespace-name>`,describe:`Lists the profiles of a namespace, ordered by name. A profile appears once it has been used.`,builder:P,handler:async s=>{let c={per_page:s[`per-page`],cursor:s.cursor};if(s.dryRun){a({command:`cf agent-memory list-profiles`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${s[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(s[`namespace-name`]))}/profiles`,pathParams:{"namespace-name":String(s[`namespace-name`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.agentMemory.listProfiles({account_id:u,namespace_name:s[`namespace-name`],...c})),{successLabel:`Loaded`})}};function I(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`query`,{type:`string`,description:`Natural-language query to match against stored memories.`}).option(`reference-date`,{type:`string`,description:`Temporal anchor for relative date references in the query.`}).option(`response-length`,{type:`string`,description:`Verbosity of the synthesized answer. Defaults to 'medium'.`,choices:[`short`,`medium`,`long`]}).option(`thinking-level`,{type:`string`,description:`Recall intensity / search depth. Defaults to 'low'.`,choices:[`low`,`medium`,`high`]}).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 L={command:`recall <profile-name>`,describe:`Retrieves memories relevant to the query and returns a synthesized answer.`,builder:I,handler:async c=>{if(c.dryRun){a({command:`cf agent-memory recall`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${c[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(c[`namespace-name`]))}/profiles/${c[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(c[`profile-name`]))}/recall`,pathParams:{"namespace-name":String(c[`namespace-name`]??``),"profile-name":String(c[`profile-name`]??``)},bodyKind:`json`,body:c.body===void 0?l({query:u(c.query,`query`,`text`),referenceDate:u(c[`reference-date`],`reference-date`,`text`),responseLength:u(c[`response-length`],`response-length`,`text`),thinkingLevel:u(c[`thinking-level`],`thinking-level`,`text`)}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.agentMemory.recall({...e,account_id:p,namespace_name:c[`namespace-name`],profile_name:c[`profile-name`]})),{successLabel:`Created`});return}c.query===void 0&&(c.query=await d(`query`,`Natural-language query to match against stored memories.`));let m=l({query:u(c.query,`query`,`text`),referenceDate:u(c[`reference-date`],`reference-date`,`text`),responseLength:u(c[`response-length`],`response-length`,`text`),thinkingLevel:u(c[`thinking-level`],`thinking-level`,`text`)});i(await o(`Creating`,async()=>f.agentMemory.recall({...m,account_id:p,namespace_name:c[`namespace-name`],profile_name:c[`profile-name`]})),{successLabel:`Created`})}};function R(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`content`,{type:`string`,description:`Raw memory content to store.`}).option(`session-id`,{type:`string`,description:`Session identifier.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const z={command:`remember <profile-name>`,describe:`Stores a single memory explicitly.`,builder:R,handler:async c=>{if(c.dryRun){a({command:`cf agent-memory remember`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${c[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(c[`namespace-name`]))}/profiles/${c[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(c[`profile-name`]))}/remember`,pathParams:{"namespace-name":String(c[`namespace-name`]??``),"profile-name":String(c[`profile-name`]??``)},bodyKind:`json`,body:c.body===void 0?l({content:u(c.content,`content`,`text`),sessionId:u(c[`session-id`],`session-id`,`text`)}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.agentMemory.remember({...e,account_id:p,namespace_name:c[`namespace-name`],profile_name:c[`profile-name`]})),{successLabel:`Created`});return}c.content===void 0&&(c.content=await d(`content`,`Raw memory content to store.`));let m=l({content:u(c.content,`content`,`text`),sessionId:u(c[`session-id`],`session-id`,`text`)});i(await o(`Creating`,async()=>f.agentMemory.remember({...m,account_id:p,namespace_name:c[`namespace-name`],profile_name:c[`profile-name`]})),{successLabel:`Created`})}};function B(e){return e.positional(`profile-name`,{type:`string`,description:`Profile name.`,demandOption:!0}).option(`namespace-name`,{type:`string`,description:`Namespace name.`,demandOption:!0}).option(`session-id`,{type:`string`,description:`Session identifier.`}).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:`summary <profile-name>`,describe:`Generates a paste-ready prompt block summarizing everything stored in a memory profile.`,builder:B,handler:async c=>{if(c.dryRun){a({command:`cf agent-memory summary`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/agent-memory/namespaces/${c[`namespace-name`]==null?`<namespace-name>`:encodeURIComponent(String(c[`namespace-name`]))}/profiles/${c[`profile-name`]==null?`<profile-name>`:encodeURIComponent(String(c[`profile-name`]))}/summary`,pathParams:{"namespace-name":String(c[`namespace-name`]??``),"profile-name":String(c[`profile-name`]??``)},bodyKind:`json`,body:c.body===void 0?l({sessionId:u(c[`session-id`],`session-id`,`text`)}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Creating`,async()=>d.agentMemory.summary({...e,account_id:f,namespace_name:c[`namespace-name`],profile_name:c[`profile-name`]})),{successLabel:`Created`});return}let p=l({sessionId:u(c[`session-id`],`session-id`,`text`)});i(await o(`Creating`,async()=>d.agentMemory.summary({...p,account_id:f,namespace_name:c[`namespace-name`],profile_name:c[`profile-name`]})),{successLabel:`Created`})}},H={command:`agent-memory`,describe:`agent-memory`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).command(T).command(D).command(k).command(j).command(N).command(F).command(L).command(z).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-DAa7SwkM.mjs";import{a as t,r as n}from"./auth-DY_Y2bXC.mjs";import{t as r}from"./output-BqDR9h74.mjs";import{t as i}from"./dry-run-ILZRVpnp.mjs";import{t as a}from"./progress-jYW64HY7.mjs";import{n as o}from"./body-parser-BGVbwPeM.mjs";function s(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of domain hostnames to fetch robots.txt for. Each domain must end with the zone name. Maximum 25 domains per request.`})}const c={command:`bulk-get`,describe:`Fetches and parses robots.txt files for multiple domains within a zone in a single request. Each domain must belong to the specified zone. Results are keyed by hostname.`,builder:s,handler:async s=>{if(s.dryRun){i({command:`cf ai-audit robots bulk-get`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/ai-audit/robots/bulk`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s);if(s.zoneId=await e({zone:s.zone},c,{quiet:s.quiet}),s.body){let e=o(s.body);if(Array.isArray(e)&&e.length>25){let n=Math.ceil(e.length/25),i=null;for(let r=0;r<e.length;r+=25){let o=e.slice(r,r+25);i=await a(`Loading: batch ${Math.floor(r/25)+1}/${n}`,async()=>t(c,`POST`,`/zones/${s.zoneId}/ai-audit/robots/bulk`,{body:o}))}r(i,{successLabel:`Loaded`});return}r(await a(`Loading`,async()=>t(c,`POST`,`/zones/${s.zoneId}/ai-audit/robots/bulk`,{body:e})),{successLabel:`Loaded`});return}if(s.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function l(e){return e.option(`subdomain`,{type:`string`,description:`Optional subdomain to fetch robots.txt for. If omitted, fetches robots.txt for the zone apex domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Fetches and parses the robots.txt file for a zone or a specific subdomain within the zone. Returns parsed user-agent rules, content signals, and sitemaps.`,builder:l,handler:async t=>{let o={subdomain:t.subdomain};if(t.dryRun){i({command:`cf ai-audit robots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/ai-audit/robots`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.aiAudit.robots.get({zone_id:c,...o})),{successLabel:`Loaded`})}},d={command:`robots`,describe:`Operations for robots`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`ai-audit`,describe:`ai-audit`,builder:e=>e.command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{f as default};
|