cf 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_meta/agent-context.json +55 -55
- package/dist/_meta/commands.json +24282 -24542
- package/dist/_meta/hand-written-commands.json +53 -12
- package/dist/_meta/schemas.json +27680 -28212
- package/dist/abuse-reports-BbaHw4ST.mjs +8 -0
- package/dist/access-D6Xz892p.mjs +11 -0
- package/dist/account-DvxcqeaK.mjs +2 -0
- package/dist/account-tags-CeqfEWpz.mjs +9 -0
- package/dist/accounts-Bx-8BMH9.mjs +30 -0
- package/dist/acm--0opdSGE.mjs +3 -0
- package/dist/addressing-BS1ynzLA.mjs +13 -0
- package/dist/agent-context-BPhyrSns.mjs +8 -0
- package/dist/agent-memory-DczzpEw5.mjs +6 -0
- package/dist/ai-CDdCTcQl.mjs +5 -0
- package/dist/ai-audit-Bx9KMQYh.mjs +2 -0
- package/dist/ai-gateway-BSXJEaYS.mjs +13 -0
- package/dist/ai-search-DRQj1aMu.mjs +7 -0
- package/dist/ai-security-C_Rb0lGT.mjs +4 -0
- package/dist/alerting-BAR9eFs2.mjs +6 -0
- package/dist/analytics-BaUZwNc5.mjs +4 -0
- package/dist/analytics_engine-DkEzlhfT.mjs +2 -0
- package/dist/api-security-jA0lOk6a.mjs +50 -0
- package/dist/argo-Cz4pDagx.mjs +2 -0
- package/dist/artifacts-BcLTGfAv.mjs +5 -0
- package/dist/audit-logs-DbIv4n6u.mjs +2 -0
- package/dist/auth-rW5d3jtr.mjs +5 -0
- package/dist/auth-tvDdC1J-.mjs +8 -0
- package/dist/billing-Md87QjqW.mjs +3 -0
- package/dist/bot-management-VHMo4hpU.mjs +5 -0
- package/dist/botnet-feed-BHqfo3sa.mjs +3 -0
- package/dist/brand-protection-HUeR6Pof.mjs +3 -0
- package/dist/browser-extension-199oZg3X.mjs +3 -0
- package/dist/browser-run-DDasyux-.mjs +4 -0
- package/dist/build-0QlYUfFS.mjs +2 -0
- package/dist/builds-B-lXn6JR.mjs +9 -0
- package/dist/cache-CevKpiTM.mjs +9 -0
- package/dist/certificate-authorities-DAg-aO1B.mjs +2 -0
- package/dist/{cf-yPz_IqW6.mjs → cf-C11NGkjx.mjs} +1 -1
- package/dist/{chunk-LQW53VED-9MACsvSG.mjs → chunk-LQW53VED-CoECHA3R.mjs} +1 -1
- package/dist/{chunk-QBZBEHZB-yeyhVUeD.mjs → chunk-QBZBEHZB-BuiXJn8j.mjs} +1 -1
- package/dist/client-certificates-Bay7oPLE.mjs +3 -0
- package/dist/client-side-security-CbU9xn0k.mjs +37 -0
- package/dist/cloud-connector-AH2ClcSL.mjs +2 -0
- package/dist/cloudforce-one-DwOfS75V.mjs +32 -0
- package/dist/{command-BV87D4tR.mjs → command-CMzMsll4.mjs} +1 -1
- package/dist/{completions-BnD46cXe.mjs → completions-nPO9PdSu.mjs} +1 -1
- package/dist/config-B8lwPpVl.mjs +2 -0
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-DcLrqM2V.mjs +2 -0
- package/dist/connector-telemetry-events-PrJWgNs9.mjs +2 -0
- package/dist/connector-telemetry-snapshots-CIjJm5yu.mjs +2 -0
- package/dist/connectors-CEAy30E-.mjs +3 -0
- package/dist/containers-BsbDqbSn.mjs +58 -0
- package/dist/content-scan-BdK936iO.mjs +4 -0
- package/dist/cps-oP97-qkm.mjs +2 -0
- package/dist/csamScanner-DUNN4INg.mjs +6 -0
- package/dist/ct-alerting-dV_gsV2w.mjs +3 -0
- package/dist/custom-certificates-DYspvjo4.mjs +5 -0
- package/dist/custom-csrs-DjSWLQRu.mjs +3 -0
- package/dist/custom-hostnames-df1lH6IY.mjs +5 -0
- package/dist/custom-nameservers-CLTbN-9R.mjs +3 -0
- package/dist/custom-pages-DzKnSgL3.mjs +3 -0
- package/dist/d1-JBEqjJoj.mjs +20 -0
- package/dist/data-security-CIktWnXt.mjs +7 -0
- package/dist/dcv-delegation-_r6Vc6VL.mjs +2 -0
- package/dist/{deploy-BUSz35vq.mjs → deploy-QTGENpOM.mjs} +1 -1
- package/dist/{deploy-input-BvD9aRP1.mjs → deploy-input-C7W1Bsji.mjs} +1 -1
- package/dist/{dev-DY_DquQx.mjs → dev-CAubuxCc.mjs} +1 -1
- package/dist/diagnostics-B0DRh714.mjs +3 -0
- package/dist/{dist-DV7LR38l.mjs → dist-12KzRsBM.mjs} +36 -36
- package/dist/{dist-BBx1io2f.mjs → dist-BCVqQpg2.mjs} +1 -1
- package/dist/dist-Cp3uJN1x.mjs +48 -0
- package/dist/dist-DW5BPGFs.mjs +57 -0
- package/dist/{dist-Cb9TJ2VV.mjs → dist-S9K_8gq9.mjs} +1 -1
- package/dist/dls-CFzTHcZM.mjs +3 -0
- package/dist/dns-Dw6u-NV1.mjs +29 -0
- package/dist/dns-firewall-CIPptslp.mjs +57 -0
- package/dist/{dot-prop-6SRZBKHT-wwGHcwAa.mjs → dot-prop-6SRZBKHT-wIVDg_fl.mjs} +1 -1
- package/dist/dry-run-DiVy1lVo.mjs +2 -0
- package/dist/durable-objects-CCkeqqBq.mjs +2 -0
- package/dist/email-auth-kdxO51Oz.mjs +2 -0
- package/dist/email-routing-BLggZdQq.mjs +6 -0
- package/dist/email-security-DjADlgdM.mjs +18 -0
- package/dist/email-sending-Cz7E7GoP.mjs +7 -0
- package/dist/error-sanitization-DfLijlBJ.mjs +2 -0
- package/dist/fieldExtractors-BWaMi6lD.mjs +3 -0
- package/dist/firewall-5t6OBIOl.mjs +8 -0
- package/dist/flagship-CzG_VoNR.mjs +4 -0
- package/dist/fraud-UOg_69Ob.mjs +20 -0
- package/dist/google-tag-gateway-DirkD-Q2.mjs +2 -0
- package/dist/healthchecks-BkHZGTp1.mjs +4 -0
- package/dist/hostnames-EUYOZm21.mjs +3 -0
- package/dist/hyperdrive-ZoLJlJCL.mjs +21 -0
- package/dist/iam-BQ2xSgYN.mjs +6 -0
- package/dist/images-CkEq6ScP.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-DDWEdGyl.mjs +8 -0
- package/dist/interactive-B2E03Fs-.mjs +11 -0
- package/dist/interactive-_B-EqD0Y.mjs +23 -0
- package/dist/ips-54Qmy-Uw.mjs +2 -0
- package/dist/keyless-certificates-CXHLc3Qz.mjs +3 -0
- package/dist/keys-rvI4TC3Z.mjs +2 -0
- package/dist/kv-CAeN1zBy.mjs +5 -0
- package/dist/leaked-credential-checks-CbbwtG-p.mjs +4 -0
- package/dist/lifecycle-XswDq0ZB.mjs +2 -0
- package/dist/load-balancers-BFwdwAIU.mjs +6 -0
- package/dist/{local-DGiIS1uM.mjs → local-C6XsFD_W.mjs} +1 -1
- package/dist/{local-runtime--IQr44qq.mjs → local-runtime-BUGCbx8r.mjs} +1 -1
- package/dist/logexplorer-D8rOPB5I.mjs +17 -0
- package/dist/logo-matches-Y3PxVn7t.mjs +2 -0
- package/dist/logos-BN8SvJhS.mjs +3 -0
- package/dist/logpush-BnLA4WVm.mjs +4 -0
- package/dist/logs-CDo7Y5sA.mjs +3 -0
- package/dist/magic-cloud-networking-wPuLwu-F.mjs +5 -0
- package/dist/magic-network-monitoring-BNERUpxS.mjs +4 -0
- package/dist/magic-transit-6tvVOECW.mjs +111 -0
- package/dist/managed-defense-AYwBOYIH.mjs +2 -0
- package/dist/managed-transforms-HZZNrkC7.mjs +3 -0
- package/dist/matches-Dp91L3dL.mjs +2 -0
- package/dist/mcp-P7pcieiT.mjs +4 -0
- package/dist/mesh-DjFrk6PL.mjs +4 -0
- package/dist/mtls-certificates-DZMoef2H.mjs +3 -0
- package/dist/network-7cd1U6-I.mjs +6 -0
- package/dist/network-interconnects-CQ7cPZjK.mjs +41 -0
- package/dist/oauth-DH3kMXSs.mjs +14 -0
- package/dist/oauth-clients-P9t-eMnx.mjs +4 -0
- package/dist/oauth-scopes-C3r9Qh_y.mjs +2 -0
- package/dist/observability-M1DnLhMR.mjs +10 -0
- package/dist/{open-PBXRGS4R-DIiYQyU9.mjs → open-PBXRGS4R-DARSUDEI.mjs} +1 -1
- package/dist/organization-cUE7GDCt.mjs +45 -0
- package/dist/organizations-C-Hcpd0w.mjs +2 -0
- package/dist/origin-ca-certificates-C8cJMyQH.mjs +3 -0
- package/dist/origin-post-quantum-encryption-DjZJCk8M.mjs +2 -0
- package/dist/origin-tls-client-auth-BsjR5EAV.mjs +4 -0
- package/dist/{output-BqDR9h74.mjs → output-COcSQsfn.mjs} +1 -1
- package/dist/page-rules-B-zq1EUb.mjs +27 -0
- package/dist/pages-B6YpkPos.mjs +14 -0
- package/dist/pay-per-crawl-B4wx0lUb.mjs +4 -0
- package/dist/pipelines-BJc_RylD.mjs +6 -0
- package/dist/precursor-CLQu7suY.mjs +4 -0
- package/dist/progress-V6SZV3Ux.mjs +2 -0
- package/dist/prompt-DjRTpML4.mjs +3 -0
- package/dist/queries-DSrrket-.mjs +3 -0
- package/dist/queues-Tf7kPBpn.mjs +7 -0
- package/dist/r2-DmKNnxtC.mjs +25 -0
- package/dist/r2-data-catalog-DBxoifOq.mjs +16 -0
- package/dist/radar-Csk7Ab-b.mjs +2 -0
- package/dist/rate-limits-cdChIg_S.mjs +2 -0
- package/dist/raw-fetch-BVYQR6C5.mjs +2 -0
- package/dist/realtime-CDehZVhV.mjs +20 -0
- package/dist/registrar-sandbox-BxVdfnam.mjs +56 -0
- package/dist/registrar-vflzeNQ9.mjs +43 -0
- package/dist/{registry-5-I2XLwF.mjs → registry-CWUfXloz.mjs} +1 -1
- package/dist/reporting-BaPZ1PHN.mjs +2 -0
- package/dist/request-headers-CC4eHmI2.mjs +3 -0
- package/dist/request-tracers-C_UVBexV.mjs +2 -0
- package/dist/resource-sharing-CoB4S9j1.mjs +6 -0
- package/dist/resource-tagging-CUiUC5g4.mjs +2 -0
- package/dist/rules-4O8076_s.mjs +4 -0
- package/dist/rulesets-C84MxTYo.mjs +5 -0
- package/dist/rum-Bvwkrntx.mjs +4 -0
- package/dist/run-CRfinkSe.mjs +2 -0
- package/dist/schema-C8hU6G9R.mjs +2 -0
- package/dist/{schema-flags-CTfQVGCs.mjs → schema-flags-DC4c6dka.mjs} +1 -1
- package/dist/scim-BvxQmde6.mjs +4 -0
- package/dist/{sdk-ZctLa5jW.mjs → sdk-C12y5qCN.mjs} +2 -2
- package/dist/secrets-store-DOKWiC-j.mjs +7 -0
- package/dist/security-center-Bhy_aC-w.mjs +2 -0
- package/dist/security-txt-L7HJ9tq5.mjs +3 -0
- package/dist/{shared-DlKGNPiT.mjs → shared-YJtB5KZB.mjs} +17 -17
- package/dist/smart-shield-COMXuQ1S.mjs +4 -0
- package/dist/snippets-DffQhlKt.mjs +4 -0
- package/dist/{spawn-C3_tJ3RB.mjs → spawn-C1AISA2V.mjs} +3 -3
- package/dist/spectrum-Cmf7SqQE.mjs +63 -0
- package/dist/speed-m8cdhLFS.mjs +4 -0
- package/dist/src-C8phrg-8.mjs +109 -0
- package/dist/ssl-D4ffsdSw.mjs +15 -0
- package/dist/{startup-profile-Dpxg-MjV.mjs → startup-profile-Dx95Y5cl.mjs} +1 -1
- package/dist/state-CHif8Y5I.mjs +2 -0
- package/dist/stream-DPF5fojV.mjs +16 -0
- package/dist/submit-Br8hfP0_.mjs +2 -0
- package/dist/tags-Bnt4JuxQ.mjs +2 -0
- package/dist/telemetry-Ch1vCICm.mjs +2 -0
- package/dist/telemetry-DjGNSlkU.mjs +5 -0
- package/dist/tenant-D8u0CxoC.mjs +2 -0
- package/dist/tenant-custom-nameservers-BrWMyslZ.mjs +3 -0
- package/dist/{tools-j8UGEtP1.mjs → tools-D9RZkZRc.mjs} +1 -1
- package/dist/tunnels-BkNPpTHa.mjs +5 -0
- package/dist/turnstile-MgwRECJv.mjs +23 -0
- package/dist/ui-DQSZeaG5.mjs +5 -0
- package/dist/url-info-Ddp7MgcI.mjs +2 -0
- package/dist/url-normalization-3ptK9ntV.mjs +3 -0
- package/dist/url-scanner-Psb9ollR.mjs +2 -0
- package/dist/user-DWdshcIu.mjs +12 -0
- package/dist/values-CDKQL1z2.mjs +2 -0
- package/dist/vectorize-CTYYUyQj.mjs +4 -0
- package/dist/waiting-rooms-BUdmwXDY.mjs +11 -0
- package/dist/web-assets-CpDwDEx8.mjs +8 -0
- package/dist/web3-YsjDyAzH.mjs +4 -0
- package/dist/workers-BKKxaZcz.mjs +6 -0
- package/dist/workers-builds-BWo5vUA9.mjs +2 -0
- package/dist/workers-for-platforms-ASJsxYdM.mjs +5 -0
- package/dist/workers-vpc-RkTnRvA2.mjs +3 -0
- package/dist/workflows-KrIFI9ns.mjs +5 -0
- package/dist/zaraz-DglXbVzZ.mjs +2 -0
- package/dist/zero-trust-RilTdSjX.mjs +91 -0
- package/dist/zone-DsBtVkvT.mjs +2 -0
- package/dist/zones-BFxvWFQW.mjs +44 -0
- package/package.json +1 -1
- package/dist/abuse-reports-D40QFl-y.mjs +0 -8
- package/dist/access-Dl2IU1ID.mjs +0 -11
- package/dist/account-CPbieCZ4.mjs +0 -2
- package/dist/account-tags-skfP7H8k.mjs +0 -9
- package/dist/accounts-CSgR6909.mjs +0 -28
- package/dist/acm-CVvCTaNk.mjs +0 -3
- package/dist/addressing-Uq5hEDDP.mjs +0 -13
- package/dist/agent-context-BvuDdaJb.mjs +0 -8
- package/dist/agent-memory-BrHMIU0E.mjs +0 -6
- package/dist/ai-audit-BoZuL84i.mjs +0 -2
- package/dist/ai-gateway-DE50Jem1.mjs +0 -13
- package/dist/ai-search-Fx7NHCHB.mjs +0 -7
- package/dist/ai-security-DyLbY9kv.mjs +0 -4
- package/dist/ai-v2fP1r0s.mjs +0 -5
- package/dist/alerting-5mFZjTcD.mjs +0 -6
- package/dist/analytics-BygTfozw.mjs +0 -3
- package/dist/analytics_engine-4L-q362P.mjs +0 -2
- package/dist/api-security-DjFsRYWx.mjs +0 -50
- package/dist/argo-TzXPN7tz.mjs +0 -2
- package/dist/args-CDgWUP4J.mjs +0 -2
- package/dist/artifacts-dEw2UUBV.mjs +0 -4
- package/dist/audit-logs-CqY7zzwv.mjs +0 -2
- package/dist/auth-CPLdkOC7.mjs +0 -5
- package/dist/auth-DY_Y2bXC.mjs +0 -9
- package/dist/billing-DHQuRT8S.mjs +0 -3
- package/dist/bot-management-CfqG79hF.mjs +0 -5
- package/dist/botnet-feed-BOeNnDoH.mjs +0 -3
- package/dist/brand-protection-DYttrKIM.mjs +0 -3
- package/dist/browser-extension-CTUCdgfn.mjs +0 -3
- package/dist/browser-run-373D4e1i.mjs +0 -4
- package/dist/build-D0ir_S70.mjs +0 -2
- package/dist/cache-DJXBmc3w.mjs +0 -7
- package/dist/calls-COO0Eoz1.mjs +0 -4
- package/dist/certificate-authorities-DbHLmKbd.mjs +0 -2
- package/dist/client-certificates-RBRqYP3f.mjs +0 -3
- package/dist/client-side-security-HOmA37et.mjs +0 -37
- package/dist/cloud-connector-C7hw1c1f.mjs +0 -2
- package/dist/cloudforce-one-DLOj76q4.mjs +0 -36
- package/dist/connector-interrupts-DY-z_LrH.mjs +0 -2
- package/dist/connector-telemetry-events-DCXmcAc9.mjs +0 -2
- package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +0 -2
- package/dist/connectors-fEOn-J_i.mjs +0 -3
- package/dist/containers-BDBsEs7-.mjs +0 -58
- package/dist/content-scan-Cmj9--XY.mjs +0 -4
- package/dist/csamScanner-BRXyMCyH.mjs +0 -6
- package/dist/ct-alerting-9AvYys-f.mjs +0 -3
- package/dist/custom-certificates-C5qrlyhb.mjs +0 -5
- package/dist/custom-csrs-BgOnTbBW.mjs +0 -3
- package/dist/custom-hostnames-CbQD9aYo.mjs +0 -5
- package/dist/custom-nameservers-2ZajBkRC.mjs +0 -3
- package/dist/custom-pages-Buki_Cb8.mjs +0 -3
- package/dist/d1-n2in0cSF.mjs +0 -20
- package/dist/data-security-DzOQMkv3.mjs +0 -7
- package/dist/dcv-delegation-BTP9LCOm.mjs +0 -2
- package/dist/diagnostics-BvHV8kQb.mjs +0 -3
- package/dist/directory-BeiSyg8A.mjs +0 -3
- package/dist/dispatch-namespaces-Dp8Jjpwy.mjs +0 -7
- package/dist/dist-DvizctjW.mjs +0 -48
- package/dist/dls-BwoU29mS.mjs +0 -3
- package/dist/dns-DISAfuzj.mjs +0 -29
- package/dist/dns-firewall-wBcCx_ua.mjs +0 -57
- package/dist/dry-run-ILZRVpnp.mjs +0 -2
- package/dist/durable-objects-DhDL3San.mjs +0 -2
- package/dist/email-auth-BROqK6-C.mjs +0 -2
- package/dist/email-routing-BZXHDAOO.mjs +0 -6
- package/dist/email-security-DVumybrk.mjs +0 -18
- package/dist/email-sending-CDQ3_wyz.mjs +0 -7
- package/dist/fieldExtractors-Cy1rxHEF.mjs +0 -3
- package/dist/firewall-C0g5X7Zd.mjs +0 -11
- package/dist/flagship-fFBiZUz-.mjs +0 -4
- package/dist/fraud-CjIETOaM.mjs +0 -20
- package/dist/google-tag-gateway-hPa5IHUx.mjs +0 -2
- package/dist/healthchecks-CoycpTf9.mjs +0 -4
- package/dist/hostnames-x_Yezxpr.mjs +0 -3
- package/dist/hyperdrive-BlfrTwSq.mjs +0 -21
- package/dist/iam-Bk7K_PPO.mjs +0 -6
- package/dist/images-BAEFb9q1.mjs +0 -8
- package/dist/intel-DDkyJVaP.mjs +0 -8
- package/dist/interactive-CRnq-B5I.mjs +0 -11
- package/dist/interactive-cytQzL94.mjs +0 -78
- package/dist/ips-DU0ti0i0.mjs +0 -2
- package/dist/keyless-certificates-E1P9jBTb.mjs +0 -3
- package/dist/keys-DqldTZqH.mjs +0 -2
- package/dist/kv-CcfCfnwq.mjs +0 -5
- package/dist/leaked-credential-checks-CqmKaEbd.mjs +0 -4
- package/dist/load-balancers-Dg4pDad1.mjs +0 -6
- package/dist/logexplorer-Bu2mG5rh.mjs +0 -17
- package/dist/logo-matches-CWUzxY7G.mjs +0 -2
- package/dist/logos-BTfdkDPi.mjs +0 -3
- package/dist/logpush-BZyay3h2.mjs +0 -4
- package/dist/logs-BqF7jjQO.mjs +0 -3
- package/dist/magic-cloud-networking-Dhd8pTyM.mjs +0 -5
- package/dist/magic-network-monitoring-D0FnkjuN.mjs +0 -4
- package/dist/magic-transit-B5skt0G7.mjs +0 -111
- package/dist/managed-transforms-B6X_crcJ.mjs +0 -3
- package/dist/matches-DeYaB4I0.mjs +0 -2
- package/dist/mcp-ChjBiMx2.mjs +0 -4
- package/dist/mesh-DRVAFLBX.mjs +0 -4
- package/dist/moq-DE7VDEFS.mjs +0 -13
- package/dist/mtls-certificates-Cbc3uAkN.mjs +0 -3
- package/dist/network-CDPZNFbn.mjs +0 -6
- package/dist/network-interconnects-CMRs_chR.mjs +0 -41
- package/dist/oauth-DAa7SwkM.mjs +0 -14
- package/dist/oauth-clients-DAI_gcuL.mjs +0 -4
- package/dist/oauth-scopes-BE6xF4_h.mjs +0 -2
- package/dist/observability-DnyI8rPJ.mjs +0 -4
- package/dist/organization-yh0mSUdI.mjs +0 -41
- package/dist/organizations-B3aU-RCG.mjs +0 -2
- package/dist/origin-ca-certificates-BaNWfVqf.mjs +0 -3
- package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +0 -2
- package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +0 -4
- package/dist/page-rules-CzbyXbt6.mjs +0 -27
- package/dist/pages-CX8yefTI.mjs +0 -14
- package/dist/pay-per-crawl-v4vBOMWD.mjs +0 -4
- package/dist/pipelines-BZ1KGupx.mjs +0 -6
- package/dist/precursor-D42A9ay5.mjs +0 -4
- package/dist/progress-jYW64HY7.mjs +0 -2
- package/dist/project-settings-BN7tL0c7.mjs +0 -3
- package/dist/prompt-CyATfGUu.mjs +0 -3
- package/dist/queries-xvETUjUE.mjs +0 -3
- package/dist/queues-CpqHDtxF.mjs +0 -6
- package/dist/r2-data-catalog-DgKmlTKR.mjs +0 -16
- package/dist/r2-jhmLvD1z.mjs +0 -24
- package/dist/radar-C2J16wpX.mjs +0 -2
- package/dist/rate-limits-CoH9Xma0.mjs +0 -5
- package/dist/raw-fetch-CNKIypJ7.mjs +0 -2
- package/dist/realtimekit-CDs0Z5WW.mjs +0 -7
- package/dist/registrar-BI5ewTAk.mjs +0 -23
- package/dist/registrar-sandbox-al1znWMc.mjs +0 -61
- package/dist/reporting-CxsdHAH3.mjs +0 -2
- package/dist/request-tracers-DJJCncft.mjs +0 -2
- package/dist/resource-sharing-qQGn8AEn.mjs +0 -3
- package/dist/resource-tagging-aTtpX5e5.mjs +0 -2
- package/dist/rules-PpsDU89Q.mjs +0 -4
- package/dist/rulesets-DP12Aqik.mjs +0 -5
- package/dist/rum-DxvpzJYc.mjs +0 -4
- package/dist/schema-DlLbiOJj.mjs +0 -2
- package/dist/scim-DJ4AVU20.mjs +0 -4
- package/dist/secrets-store-D6KDNo_s.mjs +0 -7
- package/dist/security-center-008FMs_z.mjs +0 -2
- package/dist/security-txt-CqcfrhlN.mjs +0 -3
- package/dist/share-D5fzsVAJ.mjs +0 -5
- package/dist/smart-shield-DpFscIk8.mjs +0 -4
- package/dist/snippets-CCKgI2ZX.mjs +0 -4
- package/dist/spectrum-LmdqY3ki.mjs +0 -7
- package/dist/speed-CEK36h3A.mjs +0 -4
- package/dist/src-CEb2fgtT.mjs +0 -108
- package/dist/ssl-ChHUyaQm.mjs +0 -15
- package/dist/state-DeX23Kmg.mjs +0 -2
- package/dist/stream-DfUSELMX.mjs +0 -14
- package/dist/submit-DF2G5CIz.mjs +0 -2
- package/dist/tags-nFJJHlLJ.mjs +0 -2
- package/dist/tenant-CRLw1oRU.mjs +0 -2
- package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +0 -3
- package/dist/tunnel-CMQeBgmb.mjs +0 -5
- package/dist/tunnels-iVA3MrdS.mjs +0 -2
- package/dist/turnstile-DQHP6-_b.mjs +0 -23
- package/dist/ui-DJFcf61J.mjs +0 -5
- package/dist/url-info-BVgdb_pf.mjs +0 -2
- package/dist/url-normalization-BTcxLxIQ.mjs +0 -3
- package/dist/url-scanner-DwuDZLPk.mjs +0 -2
- package/dist/user-I_MbB_KX.mjs +0 -12
- package/dist/values-S-Q7-5o8.mjs +0 -2
- package/dist/vectorize-CNZdF_0A.mjs +0 -4
- package/dist/waiting-rooms-Bo-OSsxu.mjs +0 -11
- package/dist/web-assets-tlFzKdNL.mjs +0 -8
- package/dist/web3-CdbfoZ2x.mjs +0 -4
- package/dist/workers-DQ9Q7czn.mjs +0 -28
- package/dist/workers-builds-CGRhYx-x.mjs +0 -9
- package/dist/workflows-BhEy-crm.mjs +0 -5
- package/dist/zaraz-DbKvA_8C.mjs +0 -2
- package/dist/zero-trust-DrHCPVOc.mjs +0 -93
- package/dist/zone-D2zrbJI2.mjs +0 -2
- package/dist/zones-DrpxQ_-A.mjs +0 -21
- /package/dist/{Page-9ry_XAVC.mjs → Page-C-JHZnIy.mjs} +0 -0
- /package/dist/{alerts-9PR5sQ_z.mjs → alerts-B2SJO4nd.mjs} +0 -0
- /package/dist/{autorag-Bevo1kIH.mjs → autorag-iNjZXw1n.mjs} +0 -0
- /package/dist/{body-parser-BGVbwPeM.mjs → body-parser-DIlfApuJ.mjs} +0 -0
- /package/dist/{brands-C4M04Man.mjs → brands-BrVnNrT3.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-C3w62dek.mjs → chunk-6EUZQHAF-B7bSMYLe.mjs} +0 -0
- /package/dist/{chunk-Q72B4Q5Z-DVMMVVEs.mjs → chunk-Q72B4Q5Z-CPy_WJKU.mjs} +0 -0
- /package/dist/{clear-DS0eRXOc.mjs → clear-an9o3dJ3.mjs} +0 -0
- /package/dist/{cli-types-C3nVfpSG.mjs → cli-types-CrSoSMPF.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-CKKG6_pD.mjs → connector-telemetry-events-latest-BqWfopFc.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-Bv5OddJr.mjs → connector-telemetry-snapshots-latest-C1m9U1En.mjs} +0 -0
- /package/dist/{domain-info-BUiaGCEq.mjs → domain-info-B0Ykqv5l.mjs} +0 -0
- /package/dist/{health-vX6Ml2Na.mjs → health-CIUg1C5o.mjs} +0 -0
- /package/dist/{input-validation-1esLElok.mjs → input-validation-BxchZ9jE.mjs} +0 -0
- /package/dist/{internal-ROz7anul.mjs → internal-DmpATljO.mjs} +0 -0
- /package/dist/{live-CSxvigCS.mjs → live-B66u3_0g.mjs} +0 -0
- /package/dist/{metadata-DEqBUaSv.mjs → metadata-D062SVyy.mjs} +0 -0
- /package/dist/{public-BMg6-Hxh-DgIH5obr.mjs → public-BMg6-Hxh-BfUOZTDP.mjs} +0 -0
- /package/dist/{rate-limit-analytics-CgHgKjmV.mjs → rate-limit-analytics-BknoecoM.mjs} +0 -0
- /package/dist/{ready-6G9zVGPJ.mjs → ready-C-H2cwp_.mjs} +0 -0
- /package/dist/{recent-submissions-B3Smh-QM.mjs → recent-submissions-DyuH_n5u.mjs} +0 -0
- /package/dist/{refute-DjkmLSNe.mjs → refute-uSlzkQKq.mjs} +0 -0
- /package/dist/{resolve-DEvdeprv.mjs → resolve-B8CyM1mi.mjs} +0 -0
- /package/dist/{scan-logo-545qLcGs.mjs → scan-logo-DMk--WT7.mjs} +0 -0
- /package/dist/{scan-page-DRQiVufl.mjs → scan-page-DEHnAOJo.mjs} +0 -0
- /package/dist/{schemas-BFCBlp_W.mjs → schemas-O_ZNaF8R.mjs} +0 -0
- /package/dist/{search-CXbqFoqe.mjs → search-BlKeSfVD.mjs} +0 -0
- /package/dist/{signed-url-rU_nvgFA.mjs → signed-url-CiGmGkLQ.mjs} +0 -0
- /package/dist/{submission-info-D6PgXNQP.mjs → submission-info-DHlTHDrs.mjs} +0 -0
- /package/dist/{theme-CrIBazAF.mjs → theme-CeVf-5qG.mjs} +0 -0
- /package/dist/{total-queries-XkFyu8H5.mjs → total-queries-D5WvVfYi.mjs} +0 -0
- /package/dist/{tracked-domains-CmcRXHj_.mjs → tracked-domains-9deBK9bp.mjs} +0 -0
- /package/dist/{verify-CM1NakP0.mjs → verify-S-TmhUDr.mjs} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n,h as r}from"./oauth-DH3kMXSs.mjs";import{r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as l,r as u,t as d}from"./body-parser-DIlfApuJ.mjs";import{n as f}from"./input-validation-BxchZ9jE.mjs";import{a as p,i as m,n as h}from"./prompt-DjRTpML4.mjs";function g(e){return e.option(`dry-run`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`,default:``}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. 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 _={command:`create`,describe:`Creates a ruleset.`,builder:g,handler:async h=>c({command:`rulesets account-rulesets create`,classification:{safeFlags:[`dry-run`,`kind`,`phase`]}},h,async()=>{let c={dry_run:h[`dry-run`]};if(h.dryRun){let e=h.zone===void 0?await n():void 0,t=h.zone===void 0?`accounts`:`zones`,r=h.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:h.body===void 0?d({description:f(h.description,`description`,`text`),name:f(h.name,`name`,`text`),kind:f(h.kind,`kind`,`text`),phase:f(h.phase,`phase`,`text`),rules:u(h.rules,`rules`)}):l(h.body)});return}let g=await i(h),_=h.zone===void 0?`accounts`:`zones`,v=_===`zones`?await r({zone:h.zone},g,{quiet:h.quiet}):h.local?e:await t();if(_===`zones`?h.zoneId=v:h.accountId=v,h.body){let e=l(h.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>g.rulesets.accountRulesets.create({...e,account_or_zone:_,account_or_zone_id:v,...c})),{successLabel:`Created`});return}h.name===void 0&&(h.name=await p(`name`,`The human-readable name of the ruleset.`)),h.kind===void 0&&(h.kind=await m(`kind`,`The kind of the ruleset.`,[`managed`,`custom`,`root`,`zone`])),h.phase===void 0&&(h.phase=await m(`phase`,`The phase of the ruleset.`,[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]));let y=d({description:f(h.description,`description`,`text`),name:f(h.name,`name`,`text`),kind:f(h.kind,`kind`,`text`),phase:f(h.phase,`phase`,`text`),rules:u(h.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>g.rulesets.accountRulesets.create({...y,account_or_zone:_,account_or_zone_id:v,...c})),{successLabel:`Created`})})};function v(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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 <ruleset-id>`,describe:`Deletes all versions of an existing account or zone ruleset.`,builder:v,handler:async l=>c({command:`rulesets account-rulesets delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`dry-run`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await t();if(d===`zones`?l.zoneId=f:l.accountId=f,!await h({force:!!l.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],...c})),{successLabel:`Deleted`})})};function b(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get <ruleset-id>`,describe:`Fetches the latest version of an account or zone ruleset.`,builder:b,handler:async l=>c({command:`rulesets account-rulesets get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`]})),{successLabel:`Loaded`})})};function S(e){return e.option(`cursor`,{type:`string`,description:`The cursor to use for the next page.`}).option(`per-page`,{type:`number`,description:`The number of rulesets to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`list`,describe:`Fetches all rulesets.`,builder:S,handler:async l=>c({command:`rulesets account-rulesets list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{let c={cursor:l.cursor,per_page:l[`per-page`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await t();d===`zones`?l.zoneId=f:l.accountId=f,a(await s(`Loading`,async()=>u.rulesets.accountRulesets.list({account_or_zone:d,account_or_zone_id:f,...c})),{successLabel:`Loaded`})})};function w(e){return e.positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get <ruleset-phase>`,describe:`Fetches the latest version of the account or zone entry point ruleset for a given phase.`,builder:w,handler:async l=>c({command:`rulesets account-rulesets phases get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(t),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`]})),{successLabel:`Loaded`})})};function E(e){return e.positional(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. 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 D={command:`update <ruleset-phase>`,describe:`Updates an account or zone entry point ruleset, creating a new version.`,builder:E,handler:async p=>c({command:`rulesets account-rulesets phases update`,classification:{safeFlags:[`dry-run`]}},p,async()=>{let c={dry_run:p[`dry-run`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${p[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(p[`ruleset-phase`]))}/entrypoint`,pathParams:{"account-or-zone":String(t),"ruleset-phase":String(p[`ruleset-phase`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await t();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_phase:p[`ruleset-phase`],...c})),{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.phases.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_phase:p[`ruleset-phase`],...c})),{successLabel:`Updated`})})};function O(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`get <ruleset-version>`,describe:`Fetches a specific version of an account or zone entry point ruleset.`,builder:O,handler:async l=>c({command:`rulesets account-rulesets phases versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`],ruleset_version:l[`ruleset-version`]})),{successLabel:`Loaded`})})};function A(e){return e.option(`ruleset-phase`,{type:`string`,description:`The phase of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`list`,describe:`Fetches the versions of an account or zone entry point ruleset.`,builder:A,handler:async l=>c({command:`rulesets account-rulesets phases versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets phases versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/phases/${l[`ruleset-phase`]==null?`<ruleset-phase>`:encodeURIComponent(String(l[`ruleset-phase`]))}/entrypoint/versions`,pathParams:{"account-or-zone":String(t),"ruleset-phase":String(l[`ruleset-phase`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.phases.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_phase:l[`ruleset-phase`]})),{successLabel:`Loaded`})})},M={command:`versions`,describe:`Operations for account-rulesets.phases.versions`,builder:e=>e.command(k).command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},N={command:`phases`,describe:`Operations for account-rulesets.phases`,builder:e=>e.command(T).command(D).command(M).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function P(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const F={command:`create <ruleset-id>`,describe:`Adds a new rule to an account or zone ruleset. The rule will be added to the end of the existing list of rules in the ruleset by default.`,builder:P,handler:async u=>c({command:`rulesets account-rulesets rules create`,classification:{safeFlags:[`dry-run`]}},u,async()=>{let c={dry_run:u[`dry-run`]};if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await i(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await t();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c})),{successLabel:`Created`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Creating`,async()=>p.rulesets.accountRulesets.rules.create({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],...c})),{successLabel:`Created`})})};function I(e){return e.positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).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 ee={command:`delete <rule-id>`,describe:`Deletes an existing rule from an account or zone ruleset.`,builder:I,handler:async l=>c({command:`rulesets account-rulesets rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`dry-run`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rules/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(l[`rule-id`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await t();if(d===`zones`?l.zoneId=f:l.accountId=f,!await h({force:!!l.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.rules.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`],...c})),{successLabel:`Deleted`})})};function L(e){return e.positional(`rule-id`,{type:`string`,description:`The unique ID of the rule.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`position-before`,{type:`string`,description:`The ID of another rule to place the rule before. An empty value causes the rule to be placed at the top.`}).option(`position-after`,{type:`string`,description:`The ID of another rule to place the rule after. An empty value causes the rule to be placed at the bottom.`}).option(`position-index`,{type:`number`,description:`An index at which to place the rule, where index 1 is the first rule.`}).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(`position-before`,[`position-after`,`position-index`]).conflicts(`position-after`,[`position-before`,`position-index`]).conflicts(`position-index`,[`position-before`,`position-after`])}const R={command:`update <rule-id>`,describe:`Updates an existing rule in an account or zone ruleset.`,builder:L,handler:async u=>c({command:`rulesets account-rulesets rules update`,classification:{safeFlags:[`dry-run`]}},u,async()=>{let c={dry_run:u[`dry-run`]};if(u.dryRun){let e=u.zone===void 0?await n():void 0,t=u.zone===void 0?`accounts`:`zones`,r=u.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets rules update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${u[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(u[`ruleset-id`]))}/rules/${u[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(u[`rule-id`]))}`,pathParams:{"account-or-zone":String(t),"rule-id":String(u[`rule-id`]??``),"ruleset-id":String(u[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:u.body===void 0?d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}}):l(u.body)});return}let p=await i(u),m=u.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:u.zone},p,{quiet:u.quiet}):u.local?e:await t();if(m===`zones`?u.zoneId=h:u.accountId=h,u.body){let e=l(u.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...e,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c})),{successLabel:`Updated`});return}let g=d({position:{before:f(u[`position-before`],`position-before`,`text`),after:f(u[`position-after`],`position-after`,`text`),index:u[`position-index`]}});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>p.rulesets.accountRulesets.rules.update({...g,account_or_zone:m,account_or_zone_id:h,ruleset_id:u[`ruleset-id`],rule_id:u[`rule-id`],...c})),{successLabel:`Updated`})})},z={command:`rules`,describe:`Operations for account-rulesets.rules`,builder:e=>e.command(F).command(ee).command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.positional(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`description`,{type:`string`,description:`An informative description of the ruleset.`}).option(`name`,{type:`string`,description:`The human-readable name of the ruleset.`}).option(`kind`,{type:`string`,description:`The kind of the ruleset.`,choices:[`managed`,`custom`,`root`,`zone`]}).option(`phase`,{type:`string`,description:`The phase of the ruleset.`,choices:[`ddos_l4`,`ddos_l7`,`http_config_settings`,`http_custom_errors`,`http_log_custom_fields`,`http_ratelimit`,`http_request_cache_settings`,`http_request_dynamic_redirect`,`http_request_firewall_custom`,`http_request_firewall_managed`,`http_request_late_transform`,`http_request_origin`,`http_request_redirect`,`http_request_sanitize`,`http_request_sbfm`,`http_request_transform`,`http_response_cache_settings`,`http_response_compression`,`http_response_firewall_managed`,`http_response_headers_transform`,`magic_transit`,`magic_transit_ids_managed`,`magic_transit_managed`,`magic_transit_ratelimit`]}).option(`rules`,{type:`string`,description:`The list of rules in the ruleset. Provide as a JSON array of objects or @path/to/file.json.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const V={command:`update <ruleset-id>`,describe:`Updates an account or zone ruleset, creating a new version.`,builder:B,handler:async p=>c({command:`rulesets account-rulesets update`,classification:{safeFlags:[`dry-run`,`kind`,`phase`]}},p,async()=>{let c={dry_run:p[`dry-run`]};if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${p[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(p[`ruleset-id`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(p[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`json`,body:p.body===void 0?d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)}):l(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await t();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=l(p.body);new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({...e,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c})),{successLabel:`Updated`});return}let _=d({description:f(p.description,`description`,`text`),name:f(p.name,`name`,`text`),kind:f(p.kind,`kind`,`text`),phase:f(p.phase,`phase`,`text`),rules:u(p.rules,`rules`)});new URLSearchParams(Object.entries(c).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),a(await s(`Updating`,async()=>m.rulesets.accountRulesets.update({..._,account_or_zone:h,account_or_zone_id:g,ruleset_id:p[`ruleset-id`],...c})),{successLabel:`Updated`})})};function H(e){return e.option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`rule-tag`,{type:`string`,description:`The category of a rule.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`list`,describe:`Fetches the rules of a managed account or zone ruleset version for a given tag.`,builder:H,handler:async l=>c({command:`rulesets account-rulesets versions by-tag list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions by-tag list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}/by_tag/${l[`rule-tag`]==null?`<rule-tag>`:encodeURIComponent(String(l[`rule-tag`]))}`,pathParams:{"account-or-zone":String(t),"rule-tag":String(l[`rule-tag`]??``),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.byTag.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`],rule_tag:l[`rule-tag`]})),{successLabel:`Loaded`})})},W={command:`by-tag`,describe:`Operations for account-rulesets.versions.by-tag`,builder:e=>e.command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:"Validates the request without persisting changes when set to `true`. Responses that normally return 200 return `result: null`; endpoints that normally return 204 continue to return 204."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const K={command:`delete <ruleset-version>`,describe:`Deletes an existing version of an account or zone ruleset.`,builder:G,handler:async l=>c({command:`rulesets account-rulesets versions delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},l,async()=>{let c={dry_run:l[`dry-run`]};if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},query:c,bodyKind:`none`});return}let u=await i(l),d=l.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:l.zone},u,{quiet:l.quiet}):l.local?e:await t();if(d===`zones`?l.zoneId=f:l.accountId=f,!await h({force:!!l.force})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}a(await s(`Deleting`,async()=>u.rulesets.accountRulesets.versions.delete({account_or_zone:d,account_or_zone_id:f,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`],...c})),{successLabel:`Deleted`})})};function q(e){return e.positional(`ruleset-version`,{type:`string`,description:`The version of the ruleset.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get <ruleset-version>`,describe:`Fetches a specific version of an account or zone ruleset.`,builder:q,handler:async l=>c({command:`rulesets account-rulesets versions get`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions/${l[`ruleset-version`]==null?`<ruleset-version>`:encodeURIComponent(String(l[`ruleset-version`]))}`,pathParams:{"account-or-zone":String(t),"ruleset-version":String(l[`ruleset-version`]??``),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.get({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`],ruleset_version:l[`ruleset-version`]})),{successLabel:`Loaded`})})};function Y(e){return e.option(`ruleset-id`,{type:`string`,description:`The unique ID of the ruleset.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`list`,describe:`Fetches the versions of an account or zone ruleset.`,builder:Y,handler:async l=>c({command:`rulesets account-rulesets versions list`,classification:{safeFlags:[`dry-run`]}},l,async()=>{if(l.dryRun){let e=l.zone===void 0?await n():void 0,t=l.zone===void 0?`accounts`:`zones`,r=l.zone??e??`<account-id>`;o({command:`cf rulesets account-rulesets versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/rulesets/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/versions`,pathParams:{"account-or-zone":String(t),"ruleset-id":String(l[`ruleset-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let c=await i(l),u=l.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:l.zone},c,{quiet:l.quiet}):l.local?e:await t();u===`zones`?l.zoneId=d:l.accountId=d,a(await s(`Loading`,async()=>c.rulesets.accountRulesets.versions.list({account_or_zone:u,account_or_zone_id:d,ruleset_id:l[`ruleset-id`]})),{successLabel:`Loaded`})})},Z={command:`versions`,describe:`Operations for account-rulesets.versions`,builder:e=>e.command(K).command(J).command(X).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`account-rulesets`,describe:`Operations for account-rulesets`,builder:e=>e.command(_).command(y).command(x).command(C).command(V).command(N).command(z).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},$={command:`rulesets`,describe:`rulesets`,builder:e=>e.command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{$ as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{r}from"./auth-tvDdC1J-.mjs";import{t as i}from"./output-COcSQsfn.mjs";import{t as a}from"./dry-run-DiVy1lVo.mjs";import{t as o}from"./progress-V6SZV3Ux.mjs";import{t as s}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as c,r as l,t as u}from"./body-parser-DIlfApuJ.mjs";import{n as d}from"./input-validation-BxchZ9jE.mjs";import{n as f}from"./prompt-DjRTpML4.mjs";import{t as p}from"./cli-types-CrSoSMPF.mjs";function m(e){return e.option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`delete-rules`,{type:`string`,array:!0,description:`A list of rule identifiers to delete.`}).option(`rules`,{type:`string`,description:`A list of rules to create or update. 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 h={command:`bulk-create`,describe:`Modifies one or more rules in a Web Analytics ruleset with a single request.`,builder:m,handler:async d=>s({command:`rum rules bulk-create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){a({command:`cf rum rules bulk-create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${d[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(d[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(d[`ruleset-id`]??``)},bodyKind:`json`,body:d.body===void 0?u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)}):c(d.body)});return}let s=await r(d),f=d.local?e:await t();if(d.accountId=f,d.body){let e=c(d.body);i(await o(`Creating`,async()=>s.rum.rules.bulkCreate({...e,account_id:f,ruleset_id:d[`ruleset-id`]})),{successLabel:`Created`});return}let p=u({delete_rules:d[`delete-rules`],rules:l(d.rules,`rules`)});i(await o(`Creating`,async()=>s.rum.rules.bulkCreate({...p,account_id:f,ruleset_id:d[`ruleset-id`]})),{successLabel:`Created`})})};function g(e){return e.positional(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths 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 _={command:`create <ruleset-id>`,describe:`Creates a new rule in a Web Analytics ruleset.`,builder:g,handler:async l=>s({command:`rum rules create`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rule`,pathParams:{"ruleset-id":String(l[`ruleset-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}):c(l.body)});return}let s=await r(l),f=l.local?e:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.rum.rules.create({body:e,account_id:f,ruleset_id:l[`ruleset-id`]})),{successLabel:`Created`});return}let p=u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths});i(await o(`Creating`,async()=>s.rum.rules.create({body:p,account_id:f,ruleset_id:l[`ruleset-id`]})),{successLabel:`Created`})})};function v(e){return e.positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset 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 y={command:`delete <rule-id>`,describe:`Deletes an existing rule from a Web Analytics ruleset.`,builder:v,handler:async c=>s({command:`rum rules delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf rum rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rule/${c[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(c[`rule-id`]))}`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``),"rule-id":String(c[`rule-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}i(await o(`Deleting`,async()=>s.rum.rules.delete({account_id:l,ruleset_id:c[`ruleset-id`],rule_id:c[`rule-id`]})),{successLabel:`Deleted`})})};function b(e){return e.option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists all the rules in a Web Analytics ruleset.`,builder:b,handler:async c=>s({command:`rum rules list`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum rules list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${c[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(c[`ruleset-id`]))}/rules`,pathParams:{"ruleset-id":String(c[`ruleset-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.rum.rules.list({account_id:l,ruleset_id:c[`ruleset-id`]})),{successLabel:`Loaded`})})};function S(e){return e.positional(`rule-id`,{type:`string`,description:`The Web Analytics rule identifier.`,demandOption:!0}).option(`ruleset-id`,{type:`string`,description:`The Web Analytics ruleset identifier.`,demandOption:!0}).option(`host`,{type:`string`,description:`The host field`}).option(`inclusive`,{type:`boolean`,description:`Whether the rule includes or excludes traffic from being measured.`}).option(`is-paused`,{type:`boolean`,description:`Whether the rule is paused or not.`}).option(`paths`,{type:`string`,array:!0,description:`The paths field`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <rule-id>`,describe:`Updates a rule in a Web Analytics ruleset.`,builder:S,handler:async l=>s({command:`rum rules update`,classification:{safeFlags:[`inclusive`,`is-paused`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/v2/${l[`ruleset-id`]==null?`<ruleset-id>`:encodeURIComponent(String(l[`ruleset-id`]))}/rule/${l[`rule-id`]==null?`<rule-id>`:encodeURIComponent(String(l[`rule-id`]))}`,pathParams:{"ruleset-id":String(l[`ruleset-id`]??``),"rule-id":String(l[`rule-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths}):c(l.body)});return}let s=await r(l),f=l.local?e:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rum.rules.update({body:e,account_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`]})),{successLabel:`Updated`});return}let p=u({host:d(l.host,`host`,`text`),inclusive:l.inclusive,is_paused:l[`is-paused`],paths:l.paths});i(await o(`Updating`,async()=>s.rum.rules.update({body:p,account_id:f,ruleset_id:l[`ruleset-id`],rule_id:l[`rule-id`]})),{successLabel:`Updated`})})},w={command:`rules`,describe:`Rules that control which pages and paths are tracked by Web Analytics`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`zone-tag`,{type:`string`,description:`The zone 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 E={command:`create`,describe:`Creates a new Web Analytics site.`,builder:T,handler:async l=>s({command:`rum site-info create`,classification:{safeFlags:[`auto-install`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum site-info create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info`,pathParams:{},bodyKind:`json`,body:l.body===void 0?u({auto_install:l[`auto-install`],host:d(l.host,`host`,`text`),zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}):c(l.body)});return}let s=await r(l),f=l.local?e:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Creating`,async()=>s.rum.siteInfo.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({auto_install:l[`auto-install`],host:d(l.host,`host`,`text`),zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)});i(await o(`Creating`,async()=>s.rum.siteInfo.create({...p,account_id:f})),{successLabel:`Created`})})};function D(e){return e.positional(`site-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 O={command:`delete <site-id>`,describe:`Deletes an existing Web Analytics site.`,builder:D,handler:async c=>s({command:`rum site-info delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${c[`site-id`]==null?`<site-id>`:encodeURIComponent(String(c[`site-id`]))}`,pathParams:{"site-id":String(c[`site-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();if(c.accountId=l,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}i(await o(`Deleting`,async()=>s.rum.siteInfo.delete({account_id:l,site_id:c[`site-id`]})),{successLabel:`Deleted`})})};function k(e){return e.positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`get <site-id>`,describe:`Retrieves a Web Analytics site.`,builder:k,handler:async c=>s({command:`rum site-info get`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${c[`site-id`]==null?`<site-id>`:encodeURIComponent(String(c[`site-id`]))}`,pathParams:{"site-id":String(c[`site-id`]??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.rum.siteInfo.get({account_id:l,site_id:c[`site-id`]})),{successLabel:`Loaded`})})};function j(e){return e.option(`all`,{type:`boolean`,description:`When true, includes sites that are disabled or paused.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`list-site-tags`,describe:`Returns all site tags for an account as an array of site tag strings. This endpoint returns all results without pagination.`,builder:j,handler:async c=>s({command:`rum site-info list-site-tags`,classification:{safeFlags:[`all`,`dry-run`]}},c,async()=>{let s={all:c.all};if(c.dryRun){a({command:`cf rum site-info list-site-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/site_tag/list`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.rum.siteInfo.listSiteTags({account_id:u,...s})),{successLabel:`Loaded`})})};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list-zone-tags`,describe:`Returns all zone tags associated with Web Analytics sites for an account. These can be used to filter or exclude zones in the zone selection input. This endpoint returns all results without pagination.`,builder:N,handler:async c=>s({command:`rum site-info list-zone-tags`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info list-zone-tags`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/zone_tag/list`,pathParams:{},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.rum.siteInfo.listZoneTags({account_id:l})),{successLabel:`Loaded`})})};function F(e){return e.option(`per-page`,{type:`number`,description:`Number of items to return per page of results.`}).option(`page`,{type:`number`,description:`Current page within the paginated list of results.`}).option(`order-by`,{type:`string`,description:`The property used to sort the list of results.`,choices:[`host`,`created`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`list`,describe:`Lists all Web Analytics sites of an account.`,builder:p(F),handler:async c=>s({command:`rum site-info list`,classification:{safeFlags:[`order-by`,`dry-run`]}},c,async()=>{let s={per_page:c[`per-page`],page:c.page,order_by:c[`order-by`]};if(c.dryRun){a({command:`cf rum site-info list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/list`,pathParams:{},query:s,bodyKind:`none`});return}let l=await r(c),u=c.local?e:await t();c.accountId=u,i(await o(`Loading`,async()=>l.rum.siteInfo.list({account_id:u,...s})),{successLabel:`Loaded`})})};function L(e){return e.positional(`site-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`auto-install`,{type:`boolean`,description:`If enabled, the JavaScript snippet is automatically injected for orange-clouded sites.`}).option(`enabled`,{type:`boolean`,description:`Enables or disables RUM. This option can be used only when auto_install is set to true.`}).option(`host`,{type:`string`,description:`The hostname to use for gray-clouded sites.`}).option(`lite`,{type:`boolean`,description:`If enabled, the JavaScript snippet will not be injected for visitors from the EU.`}).option(`zone-tag`,{type:`string`,description:`The zone 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 R={command:`update <site-id>`,describe:`Updates an existing Web Analytics site.`,builder:L,handler:async l=>s({command:`rum site-info update`,classification:{safeFlags:[`auto-install`,`enabled`,`lite`,`dry-run`]}},l,async()=>{if(l.dryRun){a({command:`cf rum site-info update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/${l[`site-id`]==null?`<site-id>`:encodeURIComponent(String(l[`site-id`]))}`,pathParams:{"site-id":String(l[`site-id`]??``)},bodyKind:`json`,body:l.body===void 0?u({auto_install:l[`auto-install`],enabled:l.enabled,host:d(l.host,`host`,`text`),lite:l.lite,zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)}):c(l.body)});return}let s=await r(l),f=l.local?e:await t();if(l.accountId=f,l.body){let e=c(l.body);i(await o(`Updating`,async()=>s.rum.siteInfo.update({...e,account_id:f,site_id:l[`site-id`]})),{successLabel:`Updated`});return}let p=u({auto_install:l[`auto-install`],enabled:l.enabled,host:d(l.host,`host`,`text`),lite:l.lite,zone_tag:d(l[`zone-tag`],`zone-tag`,`text`)});i(await o(`Updating`,async()=>s.rum.siteInfo.update({...p,account_id:f,site_id:l[`site-id`]})),{successLabel:`Updated`})})};function z(e){return e.positional(`hostname`,{type:`string`,description:"The hostname to validate (e.g. example.com). The `pattern` below validates the hostname's structure (label syntax) only. In addition, the hostname must end in a valid public suffix (TLD). For the list of valid suffixes and how it is used, see the Public Suffix List: https://wiki.mozilla.org/Public_Suffix_List/Use_Cases",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`validate-hostname <hostname>`,describe:`Validates that the provided hostname is well-formed, does not contain wildcards, and has a valid TLD. Returns an empty result on success.`,builder:z,handler:async c=>s({command:`rum site-info validate-hostname`,classification:{safeFlags:[`dry-run`]}},c,async()=>{if(c.dryRun){a({command:`cf rum site-info validate-hostname`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/rum/site_info/validate/${c.hostname==null?`<hostname>`:encodeURIComponent(String(c.hostname))}`,pathParams:{hostname:String(c.hostname??``)},bodyKind:`none`});return}let s=await r(c),l=c.local?e:await t();c.accountId=l,i(await o(`Loading`,async()=>s.rum.siteInfo.validateHostname({account_id:l,hostname:c.hostname})),{successLabel:`Loaded`})})},V={command:`site-info`,describe:`Web Analytics sites — register domains and get the JavaScript beacon snippet`,builder:e=>e.command(E).command(O).command(A).command(I).command(M).command(P).command(R).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},H={command:`rum`,describe:`Real User Measurement (Web Analytics) — track page loads, Core Web Vitals, and visitor metrics`,builder:e=>e.command(w).command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{H as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{n as e}from"./chunk-vbHwaUoU.mjs";import{i as t,r as n,s as r}from"./lifecycle-XswDq0ZB.mjs";import{DELEGATION_SENTINEL as i}from"./delegate.mjs";import{r as a,t as o}from"./interactive-_B-EqD0Y.mjs";import{r as s,t as c}from"./request-headers-CC4eHmI2.mjs";import{i as l,o as u,s as d}from"./config-B8lwPpVl.mjs";import{n as f}from"./error-sanitization-DfLijlBJ.mjs";import p from"node:os";function m(){switch(process.platform){case`win32`:return`Windows`;case`darwin`:return`Mac OS`;case`linux`:return`Linux`;default:return`Others: ${process.platform}`}}function h(){return p.version()}function g(){return process.arch}function _(){return Number.parseInt(process.versions.node.split(`.`)[0]??`0`,10)}function v(){let e=process.env.npm_config_user_agent??``;return e.startsWith(`pnpm`)?`pnpm`:e.startsWith(`yarn`)?`yarn`:e.startsWith(`bun`)?`bun`:e.startsWith(`npm`)?`npm`:`unknown`}function y(){try{let e=s(process.env,[]);return e.isAgentic?e.id:null}catch{return null}}function b(){return typeof PACKAGE_PRERELEASE_LABEL==`string`?PACKAGE_PRERELEASE_LABEL:void 0}let x;function S(){if(x)return x;let[e,n,s]=r.split(`.`).map(e=>{let t=Number.parseInt(e,10);return Number.isNaN(t)?0:t}),f=Date.now(),p=0,S=u(),{enabled:C}=d(),w=y();function T(){let t=b();return{product:`cf`,cliVersion:r,cliMajor:e??0,cliMinor:n??0,cliPatch:s??0,...t?{prereleaseLabel:t}:{},osPlatform:m(),osVersion:h(),arch:g(),nodeVersion:_(),packageManager:v(),deviceId:l(),amplitude_session_id:f,amplitude_event_id:p++,isFirstUsage:S,isCI:o,isInteractive:a(),cliMode:c(),agent:w,delegated:!!process.env[i]}}function E(e,t){let n={deviceId:t.deviceId,event:e,timestamp:Date.now(),properties:t};process.env.DEBUG&&console.error(`Telemetry would send: ${JSON.stringify(n)}`)}return x={enabled:C,sendCommandEvent(e,n){if(C)try{t(E(e,{...T(),...n}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}},sendAdhocEvent(e,n={}){if(C)try{t(E(e,{...T(),...n}))}catch(e){process.env.DEBUG&&console.error(`Telemetry failed to prepare:`,e)}}},x}const C={q:{canonical:`quiet`,type:`boolean`},z:{canonical:`zone`,type:`value`},m:{canonical:`mode`,type:`value`},h:{canonical:`help`,type:`boolean`},v:{canonical:`version`,type:`boolean`}};function w(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function T(e,t){let n=[];for(let r of e){if(r===`--`)break;if(r.startsWith(`--`)){let e=r.slice(2).split(`=`)[0]??``,t=e.startsWith(`no-`)?e.slice(3):e;t&&n.push(t);continue}if(!r.startsWith(`-`)||r===`-`)continue;let e=r.slice(1);for(let r of e){let e=t[r];if(!e||(n.push(e.canonical),e.type===`value`))break}}return n}function E(e,t,n){let r=new Set([...n.safeFlags,`quiet`,`local`]),i={...C,...n.shortFlagAliases},a=new Set,o={};for(let n of T(t,i)){a.add(n);let t=e[n]??e[w(n)];o[n]=r.has(n)?t:`<REDACTED>`}let s=[...a].sort();return{sanitizedArgs:o,argsUsed:s,argsCombination:s.join(`, `)}}var D=e({runWithTelemetry:()=>O,withTelemetry:()=>k});async function O(e,t,r){let i;try{i=S()}catch{return r()}if(n(),e.sendMetrics===!1||!i.enabled)return r();let a=e.recordArgs===!1?{sanitizedArgs:{},argsUsed:[],argsCombination:``}:E(t,process.argv.slice(2),e.classification);i.sendCommandEvent(e.command,{...a,status:`started`});let o=Date.now();try{let t=await r();return i.sendCommandEvent(e.command,{...a,status:`completed`,durationMs:Date.now()-o}),t}catch(t){let{CliExit:n}=await import(`./index.mjs`);throw t instanceof n&&t.code===0?i.sendCommandEvent(e.command,{...a,status:`completed`,durationMs:Date.now()-o}):i.sendCommandEvent(e.command,{...a,status:`errored`,durationMs:Date.now()-o,...f(t)}),t}}function k(e,t){return{...e,handler:n=>O(t,n,()=>e.handler(n))}}export{S as a,E as i,D as n,k as r,O as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./src-C8phrg-8.mjs";import{t}from"./output-COcSQsfn.mjs";import{n}from"./metadata-D062SVyy.mjs";function r(e){return typeof e==`object`&&!!e&&`version`in e&&`schemas`in e&&typeof e.version==`string`&&typeof e.schemas==`object`}const i={command:`schema [command..]`,describe:`Show API schema details for a command`,builder:e=>e.positional(`command`,{describe:`Command path segments (e.g., dns records create)`,type:`string`,array:!0,default:[]}).option(`list`,{type:`boolean`,describe:`List all available schemas`,default:!1}),handler:async i=>{let a=n(import.meta.url,`schemas.json`,r);if(!a)throw console.error("Error: Could not load schemas.json. Run `pnpm generate` first."),new e(1);if(i.list){t(Object.entries(a.schemas).map(([e,t])=>({command:`cf ${e}`,httpMethod:t.httpMethod,apiPath:t.path,operationId:t.operationId})));return}if(i.command.length===0)throw console.error(`Usage: cf schema <command...> or cf schema --list`),console.error(`Example: cf schema dns records create`),new e(1);let o=i.command.join(` `),s=a.schemas[o];if(!s){let t=Object.keys(a.schemas).filter(e=>e.includes(o)||o.includes(e));if(t.length>0){console.error(`Schema not found for "${o}". Did you mean:`);for(let e of t)console.error(` cf schema ${e}`)}else console.error(`Schema not found for "${o}". Use --list to see available schemas.`);throw new e(1)}t(s)}};export{i as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{s as e}from"./lifecycle-XswDq0ZB.mjs";import{a as t}from"./theme-CeVf-5qG.mjs";import{i as n}from"./cf-C11NGkjx.mjs";import{i as r}from"./body-parser-DIlfApuJ.mjs";import{n as i}from"./input-validation-BxchZ9jE.mjs";import{o as a}from"./prompt-DjRTpML4.mjs";import{mkdirSync as o,readFileSync as s,writeFileSync as c}from"node:fs";import{isDeepStrictEqual as l}from"node:util";import{dirname as u,join as d}from"node:path";import{createHash as f}from"node:crypto";const p=5e3;function m(e,t=new WeakSet){if(typeof e!=`object`||!e||Array.isArray(e)||t.has(e))return!1;t.add(e);let n=e,r=new Set([`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]),i=Array.isArray(n.type)?n.type:[n.type];if(n.type!==void 0&&(i.length===0||!i.every(e=>typeof e==`string`&&r.has(e)))||n.description!==void 0&&typeof n.description!=`string`||n.title!==void 0&&typeof n.title!=`string`||n.required!==void 0&&(!Array.isArray(n.required)||!n.required.every(e=>typeof e==`string`))||n.enum!==void 0&&!Array.isArray(n.enum)||n.oneOf!==void 0&&(!Array.isArray(n.oneOf)||n.oneOf.length===0||!n.oneOf.every(e=>m(e,t)))||n.anyOf!==void 0&&(!Array.isArray(n.anyOf)||n.anyOf.length===0||!n.anyOf.every(e=>m(e,t)))||n.allOf!==void 0&&(!Array.isArray(n.allOf)||n.allOf.length===0||!n.allOf.every(e=>m(e,t)))||n.if!==void 0&&!m(n.if,t)||n.then!==void 0&&!m(n.then,t)||n.additionalProperties!==void 0&&typeof n.additionalProperties!=`boolean`&&!m(n.additionalProperties,t)||n.uniqueItems!==void 0&&typeof n.uniqueItems!=`boolean`||[`minLength`,`maxLength`,`minimum`,`maximum`,`multipleOf`,`minItems`,`maxItems`,`minProperties`,`maxProperties`].some(e=>n[e]!==void 0&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||[`exclusiveMinimum`,`exclusiveMaximum`].some(e=>n[e]!==void 0&&typeof n[e]!=`boolean`&&(typeof n[e]!=`number`||!Number.isFinite(n[e])))||n.items!==void 0&&!(Array.isArray(n.items)?n.items:[n.items]).every(e=>m(e,t))||n.properties!==void 0&&(n.properties===null||typeof n.properties!=`object`||Array.isArray(n.properties)||!Object.values(n.properties).every(e=>m(e,t))))return!1;if(n.pattern!==void 0){if(typeof n.pattern!=`string`)return!1;try{new RegExp(n.pattern)}catch{return!1}}return!0}function h(e,t){if(typeof e!=`object`||!e)return;let n=e[t]??e;if(typeof n!=`object`||!n||!m(n))return;let r=n;return r.properties??r.oneOf??r.anyOf??r.allOf?r:void 0}function g(t,r){let i=f(`sha256`).update([e,...r].join(` `)).digest(`hex`).slice(0,32);return d(n(),`cache`,t,`${i}.json`)}function _(e,t){try{let n=JSON.parse(s(g(e,t),`utf-8`));return typeof n?.fetchedAt==`number`&&Date.now()-n.fetchedAt<=36e5&&m(n.schema)?n.schema:void 0}catch{return}}function v(e,t,n){try{let r=g(e,t);o(u(r),{recursive:!0}),c(r,JSON.stringify({fetchedAt:Date.now(),schema:n}),`utf-8`)}catch{}}function ee(e){if(typeof e!=`object`||!e)return`the request failed`;let t=e.statusCode;if(t===404)return`not found, or this account can't access it`;if(t===401)return"credentials were rejected; update `CLOUDFLARE_API_TOKEN` or run `cf auth login`";if(t===403)return`these credentials can't read it — check your API token permissions`;let n=e.message;if(!n)return`the request failed`;let r=(n.split(`
|
|
3
3
|
`)[0]??``).replace(/\.$/,``);return/^"?timeout"?$/i.test(r)?`the request timed out`:r}const y=new Set(`$comment.$defs.$id.$schema.additionalProperties.allOf.anyOf.const.default.definitions.deprecated.description.discriminator.enum.example.examples.exclusiveMaximum.exclusiveMinimum.externalDocs.if.items.maxItems.maxLength.maxProperties.maximum.minItems.minLength.minProperties.minimum.multipleOf.oneOf.pattern.properties.readOnly.required.then.title.type.uniqueItems.writeOnly.xml`.split(`.`));function te(e){let t=e.additionalProperties!==void 0&&typeof e.additionalProperties==`object`?[e.additionalProperties]:[],n=e.items===void 0?[]:Array.isArray(e.items)?e.items:[e.items];return[...Object.values(e.properties??{}),...t,...n,...e.oneOf??[],...e.anyOf??[],...e.allOf??[],...e.if?[e.if]:[],...e.then?[e.then]:[]]}function b(e,t){if(t.has(e))return!1;t.add(e);let n=e;return n.nullable===!0||n[`x-nullable`]===!0?!1:Object.keys(n).every(e=>y.has(e)||e.startsWith(`x-`))&&te(e).every(e=>b(e,t))}function ne(e){return b(e,new WeakSet)}function re(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1 $2`).split(/[-_\s]+/).filter(Boolean).map(e=>`${e[0]?.toUpperCase()??``}${e.slice(1)}`).join(` `)}function ie(e){let t=e.path.at(-1)??e.name,n=a(e.schema.title?.trim()||re(t)),r=e.description?a(e.description.trim()):void 0;return!r||r.toLocaleLowerCase()===n.toLocaleLowerCase()?n:`${n} — ${r}`}function x(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).replace(/_/g,`-`).toLowerCase()}const ae=new Set([`__proto__`,`constructor`,`prototype`]);function S(e){return e.every(e=>!ae.has(e))}function C(e,t){return e!==void 0&&Object.hasOwn(e,t)?e[t]:void 0}function w(e){return e.replace(/-([a-z0-9])/g,(e,t)=>t.toUpperCase())}function oe(e){return e.type===void 0&&e.properties===void 0&&e.enum===void 0&&e.const===void 0&&e.oneOf===void 0&&e.anyOf===void 0}function se(e){if(e===null)return`json`;if(Array.isArray(e))return`array`;switch(typeof e){case`boolean`:return`boolean`;case`number`:return`number`;case`object`:return`object`;default:return`string`}}function T(e){let t=ce(e);if(t.length>1){let e=new Set(t.map(T));return e.size===2&&e.has(`string`)&&e.has(`array`)?`string-or-array`:e.has(void 0)?void 0:e.size===1?[...e][0]??`json`:`json`}if(t[0]!==e)return T(t[0]??{});if(Array.isArray(e.type)&&e.type.includes(`object`)&&e.type.some(e=>e!==`object`))return`json`;let n=Array.isArray(e.type)?e.type.find(e=>e!==`null`):e.type;if(n===`null`||Array.isArray(e.type)&&e.type.length===1&&e.type[0]===`null`)return`json`;if(n===void 0){let t=e.const===void 0?e.enum:[e.const];if(t?.length){let e=new Set(t.map(se));return e.size===1?[...e][0]??`json`:`json`}}if(n===void 0&&e.properties)return`object`;if(n===void 0&&oe(e))return`json`;switch(n){case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`array`;case`object`:return`object`;default:return`string`}}function ce(e){let t=e.oneOf??e.anyOf;return t?.length?t:[e]}function E(e,t){if(e===void 0)return t;if(t===void 0)return e;let n=new Set(Array.isArray(e)?e:[e]),r=new Set(Array.isArray(t)?t:[t]),i=(e,t)=>e.has(t)||t===`integer`&&e.has(`number`),a=[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`].filter(e=>i(n,e)&&i(r,e));return a.includes(`number`)&&a.splice(a.indexOf(`integer`),1),a.length===1?a[0]:a.length>1?a:void 0}function le(e,t){return e===void 0?t:t===void 0?e:e.filter(e=>t.some(t=>l(e,t)))}function D(e,t){let n=t.flatMap(t=>[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]),r=n[0];return n.length>0&&n.every(e=>l(e,r))?r:void 0}function ue(e,t){return[...t[e]===void 0?[]:[t[e]],...(t.allOf??[]).flatMap(t=>ue(e,t))]}function de(e,t){return{type:E(e.type,t.type),title:e.title??t.title,description:e.description??t.description,enum:le(e.enum,t.enum),const:D(`const`,[e,t]),default:D(`default`,[e,t]),oneOf:e.oneOf===void 0?t.oneOf:t.oneOf===void 0?e.oneOf:void 0,anyOf:e.anyOf===void 0?t.anyOf:t.anyOf===void 0?e.anyOf:void 0,allOf:[e,t]}}function O(e){if(!e.allOf?.length)return e;let t=new Map(Object.entries(e.properties??{})),n=new Set(e.required??[]),r=e.type,i=e.title,a=e.description,o=e.enum;for(let s of e.allOf){let e=O(s);r=E(r,e.type),i??=e.title,a??=e.description,o=le(o,e.enum);for(let t of e.required??[])n.add(t);for(let[n,r]of Object.entries(e.properties??{})){let e=t.get(n);t.set(n,e===void 0?r:de(e,r))}}return{...e,type:r,title:i,description:a,enum:o,const:D(`const`,[e]),default:D(`default`,[e]),properties:t.size>0?Object.fromEntries(t):e.properties,required:n.size>0?[...n]:e.required}}function fe(e){return{...e,oneOf:void 0,anyOf:void 0}}function k(e){return(e.allOf??[]).flatMap(e=>[e,...k(e)])}function A(e){return[e,...k(e)].flatMap(e=>[...e.oneOf?.length?[e.oneOf]:[],...e.anyOf?.length?[e.anyOf]:[]])}function j(e){return Object.keys(O(fe(e)).properties??{}).length>0?!0:A(e).some(e=>e.some(j))}function M(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function N(e){let t=O(e),n=t.type===void 0?void 0:Array.isArray(t.type)?t.type:[t.type];return n?.length&&n.every(e=>e===`object`)?!0:n!==void 0&&!n.includes(`object`)?!1:t.const===void 0?t.enum?.length&&t.enum.every(e=>M(e))||A(e).some(e=>e.every(N))?!0:e.allOf?.some(N)??!1:M(t.const)}function P(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(!t?.length||!t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`))return;for(let r of t)n.push({value:r,label:t.length===1&&e.title?a(e.title):void 0})}return n}function pe(e){let t=e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0;return t?.length?t.map(e=>({value:e})):P(e)}function F(e){let t=e.oneOf??e.anyOf;if(!t?.length)return;let n=[];for(let e of t){let t=e.const===void 0?e.enum?.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)?e.enum:void 0:[e.const];if(t?.length&&t.every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)){for(let r of t){let t=K(r),i=e.title?a(e.title):void 0;n.push(i?`${t} (${i})`:t)}continue}if(e.pattern&&T(e)===`string`){let t=a(e.pattern),r=e.title?a(e.title):void 0;n.push(r?`${t} (${r})`:t);continue}return}return n.length>0?n:void 0}function I(e,t,n,r,i){if(!S(e))return;let a=i??T(t);if(a===void 0)return;let o=a===`json`?void 0:pe(t),s=o?.map(({value:e})=>String(e)),c=Object.fromEntries((o??[]).filter(({value:e,label:t})=>t&&t!==String(e)).map(({value:e,label:t})=>[String(e),t])),l=e.map(x).join(`-`);if(l!==`mode`)return{name:l,path:e,type:a,required:n,requiredWhen:r,description:t.description?.split(`
|
|
4
4
|
`)[0]??t.title,choices:s?.length?s:void 0,choiceLabels:Object.keys(c).length>0?c:void 0,schema:t}}function me(e,t){return e===t?e:[...new Set([e,t])].every(e=>e===`string`||e===`array`||e===`string-or-array`)?`string-or-array`:`json`}function he(e,t){let n=me(e.type,t.type),r=e.schema.description??t.schema.description,i=n===`json`||n===`string-or-array`?{description:r}:{type:n===`number`?`number`:n,description:r};return{...e,type:n,required:e.required&&t.required,requiredWhen:L(e.requiredWhen,t.requiredWhen)?e.requiredWhen:void 0,choices:void 0,choiceLabels:void 0,schema:i,requiredIf:l(e.requiredIf,t.requiredIf)?e.requiredIf:void 0,requiredContainer:e.requiredContainer&&t.requiredContainer?!0:void 0}}function ge(e,t={}){let n=new Set((t.exclude??[]).map(e=>e.join(`.`))),r=new Map,i=new Set,a=(e,t,n)=>{let a=r.get(e);if(!n){i.add(e),r.set(e,t);return}i.has(e)||r.set(e,a===void 0?t:he(a,t))},o=(e,t,o)=>{for(let s of[e,...k(e)]){let c=s.if,u=s.then?O(s.then):void 0,d=u?.required;if(!c||!d?.length)continue;let f=Object.keys(c),p=c.type===void 0?void 0:Array.isArray(c.type)?c.type:[c.type];if(f.some(e=>![`$comment`,`description`,`properties`,`required`,`title`,`type`].includes(e))||p!==void 0&&!p.includes(`object`))continue;let m=new Set(c.required??[]),h=c.properties??{};if(Object.keys(h).some(e=>!m.has(e)))continue;let g=[],_=!0;for(let e of m){if(!S([...t,e])){_=!1;break}let n=C(h,e),r;if(n){if(Object.keys(n).some(e=>![`$comment`,`const`,`default`,`description`,`enum`,`examples`,`title`,`type`].includes(e))){_=!1;break}if(r=n.enum,n.const!==void 0&&(r=(r??[n.const]).filter(e=>l(e,n.const))),n.type!==void 0){if(r===void 0){_=!1;break}let e=Array.isArray(n.type)?n.type:[n.type];r=r.filter(t=>e.some(e=>we(e,t)))}}g.push({path:[...t,e],values:r})}if(!(!_||g.length===0))for(let s of d){let c=[...t,s].join(`.`);if(n.has(c))continue;let d={predicates:g},f=r.get(c),p=o&&C(e.properties,s)===void 0&&!i.has(c);if(!f||p){let e=C(u?.properties,s),n=e===void 0?void 0:I([...t,s],O(e),!1);n&&(a(c,n,o),f=r.get(c))}!o&&f&&!f.requiredIf?.some(e=>l(e,d))&&(f.requiredIf=[...f.requiredIf??[],d])}}},s=(e,t,i,c=!1)=>{let l=O(fe(e));if(l.properties){let e=new Set(l.required??[]);for(let[o,u]of Object.entries(l.properties)){let l=[...t,o],d=l.join(`.`);if(!S(l)||n.has(d))continue;let f=O(u),p=j(u),m=p&&N(u),h=!c&&e.has(o),g=h&&i===void 0,_=h&&i!==void 0?i:void 0;if(m){s(u,l,h?i:l,c);let e=[...r.values()].some(e=>e.required===g&&L(e.requiredWhen,_)&&e.path.length>l.length&&l.every((t,n)=>e.path[n]===t));if(h&&!e){let e=I(l,u,g,_);e&&a(d,{...e,requiredContainer:!0},c)}continue}let v=I(l,f,g,_,p?`json`:void 0);v&&a(d,v,c)}}for(let n of A(e))for(let e of n)s(e,t,i,!0);for(let n of[e,...k(e)])n.if&&n.then&&s(n.then,t,i,!0);o(l,t,c)};return s(e,[]),[...r.values()].sort((e,t)=>e.required===t.required?e.name.localeCompare(t.name):e.required?-1:1)}function L(e,t){return e===t||e!==void 0&&t!==void 0&&e.length===t.length&&e.every((e,n)=>e===t[n])}function _e(e,n){if(e.length===0)return`${t.brand(a(n))}\n (no input fields)`;let r=process.stdout.columns??80,i=e.map(e=>`--${a(e.name)}`),o=Math.min(Math.max(...i.map(e=>e.length))+2,42),s=e.map((e,t)=>{let n=[`[${e.type}]`];e.required?n.push(`[required]`):e.requiredWhen&&n.push(`[required with --${a(e.requiredWhen.map(x).join(`-`))}-*]`),e.requiredIf&&n.push(`[conditionally required]`),e.choices&&n.push(`[choices: ${e.choices.map(t=>{let n=a(t),r=e.choiceLabels&&Object.hasOwn(e.choiceLabels,t)?e.choiceLabels[t]:void 0;return r?`${a(r)} (${n})`:n}).join(`, `)}]`),e.schema.const!==void 0&&n.push(`[must be: ${a(JSON.stringify(e.schema.const)??`undefined`)}]`),e.schema.default!==void 0&&n.push(`[default: ${a(JSON.stringify(e.schema.default)??`undefined`)}]`);let s=n.join(` `),c=Math.max(r-o-4,20)-s.length-1,l=e.description===void 0?void 0:a(e.description),u=l===void 0||c<12?``:l.length>c?`${l.slice(0,c-1)}…`:l,d=i[t]??``;return` ${d.length<o?d.padEnd(o):`${d} `}${[u,s].filter(Boolean).join(` `)}`});return[t.brand(a(n)),...s].join(`
|
|
5
5
|
`)}const ve=`_ $0 -- body dry-run dryRun help h local m mode persist-to persistTo profile quiet q version v zone z`.split(` `);function R(e,t){let n=Object.hasOwn(t,e.name)?t[e.name]:void 0,r=w(e.name);return n===void 0&&Object.hasOwn(t,r)?t[r]:n}function ye(e,t,n){return e.filter(r=>{let i=n!==void 0&&B(n,r.path).found;return V(r,e,t,n)&&R(r,t)===void 0&&!i&&!H(r.path,e,t)&&!(r.requiredContainer&&U(r,e,t))})}function z(e,t){let n=e=>B(t,e);return e.filter(e=>be(e,n)&&!n(e.path).found)}function B(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n||Array.isArray(n)||!Object.hasOwn(n,e))return{found:!1};n=n[e]}return{found:!0,value:n}}function be(e,t){return e.required||e.requiredWhen!==void 0&&t(e.requiredWhen).found||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:n})=>{let r=t(e);return r.found&&(n===void 0||n.some(e=>l(r.value,e)))}))??!1)}function V(e,t,n,r){return e.required||e.requiredWhen!==void 0&&(H(e.requiredWhen,t,n)||r!==void 0&&B(r,e.requiredWhen).found)||(e.requiredIf?.some(({predicates:e})=>e.every(({path:e,values:i})=>{let a=xe(e,t,n),o=a.found||r===void 0?a:B(r,e),s=!a.found||a.descriptor===void 0||!L(a.descriptor.path,e)?o.value:q(a.descriptor,o.value,[]);return o.found&&(i===void 0||i.some(e=>l(s,e)))}))??!1)}function xe(e,t,n){for(let r of t){let t=R(r,n);if(t===void 0||r.path.length>e.length||!r.path.every((t,n)=>e[n]===t))continue;let i=t;if(typeof i==`string`&&r.path.length<e.length)try{i=JSON.parse(i)}catch{continue}for(let t of e.slice(r.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,t)){i=void 0;break}i=i[t]}if(i!==void 0)return{found:!0,value:i,descriptor:r}}return{found:!1}}function H(e,t,n){return t.some(t=>{let r=R(t,n);if(r===void 0)return!1;if(t.path.length>=e.length)return e.every((e,n)=>t.path[n]===e);if(!t.path.every((t,n)=>e[n]===t))return!1;let i=r;if(typeof i==`string`)try{i=JSON.parse(i)}catch{return!1}for(let n of e.slice(t.path.length)){if(typeof i!=`object`||!i||Array.isArray(i)||!Object.hasOwn(i,n))return!1;i=i[n]}return!0})}function U(e,t,n){return t.some(t=>t!==e&&t.path.length>e.path.length&&e.path.every((e,n)=>t.path[n]===e)&&R(t,n)!==void 0)}function W(e){return e.flatMap(e=>[e.name,w(e.name)])}function G(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)??`undefined`}catch{return`unprintable value`}}function K(e){return a(G(e))}function q(e,t,n){let r=r=>{n.push(`--${a(e.name)} expects ${r} (got '${K(t)}')`)};switch(e.type){case`number`:{let n=typeof t==`number`?t:Number(G(t)),i=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];return Number.isFinite(n)?i.includes(`integer`)&&!i.includes(`number`)&&!Number.isInteger(n)?r(`an integer`):n:r(`a finite number`)}case`boolean`:return typeof t==`boolean`?t:t===`true`?!0:t===`false`?!1:r(`a boolean`);case`array`:case`object`:{let n=t;if(typeof t==`string`)try{n=JSON.parse(t)}catch{return r(`a JSON ${e.type}`)}return(e.type===`array`?Array.isArray(n):typeof n==`object`&&n&&!Array.isArray(n))?n:r(`a JSON ${e.type}`)}case`json`:{let n=Array.isArray(e.schema.type)?e.schema.type:[e.schema.type];if(n.length===1&&n[0]===`null`)return t===null||t===`null`?null:r(`null`);if(typeof t!=`string`)return t;try{return JSON.parse(t)}catch{return i(t,e.name,`json`)}}case`string-or-array`:if(typeof t!=`string`)return Array.isArray(t)?t:r(`a string or JSON array`);try{let e=JSON.parse(t);if(Array.isArray(e))return e}catch{}return i(t,e.name,`text`);default:{let n=Array.isArray(t)?t[t.length-1]:t;return typeof n==`boolean`?r(`a string`):typeof n==`string`?i(n,e.name,`text`):G(n)}}}function J(e){return Array.from(e).length}function Se(e,t,n){let r=a(e.name),{const:i,pattern:o,minLength:s,maxLength:c,minimum:u,maximum:d,exclusiveMinimum:f,exclusiveMaximum:p}=e.schema;if(i!==void 0&&!l(t,i)){n.push(`--${r} must be ${a(JSON.stringify(i)??`undefined`)}`);return}let m=e.schema.enum??P(e.schema)?.map(e=>e.value);if(m!==void 0&&!m.some(e=>l(t,e))){n.push(`--${r} must be one of: ${m.map(K).join(`, `)}`);return}if(typeof t==`string`){let e=J(t);o!==void 0&&!new RegExp(o).test(t)&&n.push(`--${r} does not match the required format (${a(o)})`),s!==void 0&&e<s&&n.push(`--${r} must be at least ${s} characters`),c!==void 0&&e>c&&n.push(`--${r} must be at most ${c} characters`)}typeof t==`number`&&(u!==void 0&&(f===!0?t<=u:t<u)&&n.push(f===!0?`--${r} must be greater than ${u}`:`--${r} must be at least ${u}`),d!==void 0&&(p===!0?t>=d:t>d)&&n.push(p===!0?`--${r} must be less than ${d}`:`--${r} must be at most ${d}`),typeof f==`number`&&t<=f&&n.push(`--${r} must be greater than ${f}`),typeof p==`number`&&t>=p&&n.push(`--${r} must be less than ${p}`))}function Ce(e,t){let n=[],r=q(e,t,n);if(r===void 0||(Se(e,r,n),n.length>0))return n[0];let i=Z(e.schema,r);return i.length>0?`--${a(e.name)} ${i[0]?.replace(/^the request body /,``)}`:void 0}function we(e,t){switch(e){case`null`:return t===null;case`array`:return Array.isArray(t);case`object`:return typeof t==`object`&&!!t&&!Array.isArray(t);case`integer`:return typeof t==`number`&&Number.isInteger(t);default:return typeof t===e}}function Te(e){return e.map(e=>e===`integer`?`an integer`:`a${/^[aeiou]/.test(e)?`n`:``} ${e}`).join(` or `)}function Y(e){return e.length===0?`the request body`:`\`/${e.map(e=>a(e).replace(/~/g,`~0`).replace(/\//g,`~1`)).join(`/`)}\``}function X(e,t,n){let r=[],i=Y(n),o=e.type===void 0?[]:Array.isArray(e.type)?e.type:[e.type];if(o.length>0&&!o.some(e=>we(e,t)))return[`${i} must be ${Te(o)}`];if(e.const!==void 0&&!l(t,e.const))return[`${i} must be ${a(JSON.stringify(e.const)??`undefined`)}`];if(e.enum&&!e.enum.some(e=>l(t,e)))return[`${i} must be one of: ${e.enum.map(K).join(`, `)}`];if(e.oneOf?.length&&e.oneOf.filter(e=>X(e,t,n).length===0).length!==1){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match exactly one allowed shape`]}if(e.anyOf?.length&&!e.anyOf.some(e=>X(e,t,n).length===0)){let t=F(e);return[t?`${i} must be one of: ${t.join(`, `)}`:`${i} must match an allowed shape`]}for(let i of e.allOf??[])r.push(...X(i,t,n));if(e.if&&X(e.if,t,n).length===0&&e.then&&r.push(...X(e.then,t,n)),typeof t==`string`){let n=J(t);e.pattern!==void 0&&!new RegExp(e.pattern).test(t)&&r.push(`${i} does not match the required format (${a(e.pattern)})`),e.minLength!==void 0&&n<e.minLength&&r.push(`${i} must be at least ${e.minLength} characters`),e.maxLength!==void 0&&n>e.maxLength&&r.push(`${i} must be at most ${e.maxLength} characters`)}if(typeof t==`number`&&(e.minimum!==void 0&&(e.exclusiveMinimum===!0?t<=e.minimum:t<e.minimum)&&r.push(e.exclusiveMinimum===!0?`${i} must be greater than ${e.minimum}`:`${i} must be at least ${e.minimum}`),e.maximum!==void 0&&(e.exclusiveMaximum===!0?t>=e.maximum:t>e.maximum)&&r.push(e.exclusiveMaximum===!0?`${i} must be less than ${e.maximum}`:`${i} must be at most ${e.maximum}`),typeof e.exclusiveMinimum==`number`&&t<=e.exclusiveMinimum&&r.push(`${i} must be greater than ${e.exclusiveMinimum}`),typeof e.exclusiveMaximum==`number`&&t>=e.exclusiveMaximum&&r.push(`${i} must be less than ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&Math.abs(t/e.multipleOf-Math.round(t/e.multipleOf))>2**-52*10&&r.push(`${i} must be a multiple of ${e.multipleOf}`)),Array.isArray(t)){if(e.minItems!==void 0&&t.length<e.minItems&&r.push(`${i} must contain at least ${e.minItems} items`),e.maxItems!==void 0&&t.length>e.maxItems&&r.push(`${i} must contain at most ${e.maxItems} items`),e.uniqueItems&&t.some((e,n)=>t.slice(0,n).some(t=>l(e,t)))&&r.push(`${i} must contain unique items`),e.items&&!Array.isArray(e.items))for(let[i,a]of t.entries())r.push(...X(e.items,a,[...n,String(i)]));else if(Array.isArray(e.items))for(let[i,a]of e.items.entries())i<t.length&&r.push(...X(a,t[i],[...n,String(i)]))}if(typeof t==`object`&&t&&!Array.isArray(t)){let a=t,o=e.properties??{};for(let t of e.required??[])Object.hasOwn(a,t)||r.push(`${Y([...n,t])} is required`);for(let[t,i]of Object.entries(a)){let a=Object.hasOwn(o,t)?o[t]:void 0;a?r.push(...X(a,i,[...n,t])):e.additionalProperties===!1?r.push(`${Y([...n,t])} is not allowed`):e.additionalProperties&&typeof e.additionalProperties==`object`&&r.push(...X(e.additionalProperties,i,[...n,t]))}let s=Object.keys(a).length;e.minProperties!==void 0&&s<e.minProperties&&r.push(`${i} must contain at least ${e.minProperties} properties`),e.maxProperties!==void 0&&s>e.maxProperties&&r.push(`${i} must contain at most ${e.maxProperties} properties`)}return r}function Z(e,t){return[...new Set(X(e,t,[]))]}const Ee=[`const`,`enum`,`exclusiveMaximum`,`exclusiveMinimum`,`maxItems`,`maxLength`,`maxProperties`,`maximum`,`minItems`,`minLength`,`minProperties`,`minimum`,`multipleOf`,`pattern`,`required`,`title`,`type`,`uniqueItems`];function Q(e){let t=e,n=Object.keys(t);if(t.nullable===!0||t[`x-nullable`]===!0||n.some(e=>[`$dynamicRef`,`$recursiveRef`,`$ref`].includes(e)))return{schema:{},exact:!1};let r={},i=n.every(e=>y.has(e)||e.startsWith(`x-`));for(let t of Ee){let n=e[t];n!==void 0&&Object.assign(r,{[t]:n})}if(e.properties!==void 0){let t=Object.entries(e.properties).map(([e,t])=>{let n=Q(t);return i&&=n.exact,[e,n.schema]});r.properties=Object.fromEntries(t)}if(e.additionalProperties!==void 0&&!Object.hasOwn(t,`patternProperties`))if(typeof e.additionalProperties==`boolean`)r.additionalProperties=e.additionalProperties;else{let t=Q(e.additionalProperties);r.additionalProperties=t.schema,i&&=t.exact}if(e.items!==void 0&&!Object.hasOwn(t,`prefixItems`))if(Array.isArray(e.items))r.items=e.items.map(e=>{let t=Q(e);return i&&=t.exact,t.schema});else{let t=Q(e.items);r.items=t.schema,i&&=t.exact}let a=(e.allOf??[]).map(e=>{let t=Q(e);return i&&=t.exact,t.schema});if(e.anyOf?.length&&(r.anyOf=e.anyOf.map(e=>{let t=Q(e);return i&&=t.exact,t.schema})),e.oneOf?.length){let t=e.oneOf.map(Q),n=t.every(e=>e.exact);i&&=n,n?r.oneOf=t.map(e=>e.schema):a.push({anyOf:t.map(e=>e.schema)})}if(e.if&&e.then){let t=Q(e.if),n=Q(e.then);i&&=t.exact&&n.exact,t.exact&&a.push({if:t.schema,then:n.schema})}return a.length>0&&(r.allOf=a),{schema:r,exact:i}}function De(e,t){return Z(Q(e).schema,t)}function Oe(e,t,n){let r=e;for(let e of t.slice(0,-1)){let t=r[e];(typeof t!=`object`||!t||Array.isArray(t))&&(r[e]={}),r=r[e]}let i=t.at(-1);i!==void 0&&(r[i]=n)}function $(e,t=[]){let n=new Set([...ve,...t]),r=new Map;for(let t of Object.keys(e))!n.has(t)&&!r.has(x(t))&&r.set(x(t),t);return[...r.values()].sort()}function ke(e,t,n={}){let i=[],o=n.baseBody!==void 0,s=n.baseBody===void 0?{}:structuredClone(n.baseBody),c=e.filter(({path:e})=>S(e)),l=[...n.reserved??[],...W(c)];for(let e of c){let n=R(e,t);if(n===void 0){!o&&V(e,c,t)&&!H(e.path,c,t)&&!(e.requiredContainer&&U(e,c,t))&&i.push(`--${a(e.name)} is required`);continue}let l=q(e,n,i);l!==void 0&&(Se(e,l,i),o?Oe(s,e.path,l):r(s,e.path,l))}if(o)for(let e of z(c,s))R(e,t)===void 0&&i.push(`--${a(e.name)} is required`);for(let e of $(t,l))i.push(`Unknown flag --${a(e)}`);return{body:s,errors:i}}export{v as _,z as a,ge as c,Z as d,De as f,_ as g,h,ye as i,$ as l,ee as m,W as n,_e as o,p,ne as r,ie as s,ke as t,Ce as u};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-C6XsFD_W.mjs";import{f as t,g as n}from"./oauth-DH3kMXSs.mjs";import{a as r,r as i}from"./auth-tvDdC1J-.mjs";import{t as a}from"./output-COcSQsfn.mjs";import{t as o}from"./dry-run-DiVy1lVo.mjs";import{t as s}from"./progress-V6SZV3Ux.mjs";import{t as c}from"./run-CRfinkSe.mjs";import"./telemetry-Ch1vCICm.mjs";import{n as l,t as u}from"./input-validation-BxchZ9jE.mjs";import{n as d}from"./prompt-DjRTpML4.mjs";import{t as f}from"./cli-types-CrSoSMPF.mjs";function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const m={command:`create`,describe:"Creates a new SCIM Group (user group) for the account. The `displayName` must not be empty and must not begin with `CF` (reserved for system groups).",builder:p,handler:async d=>c({command:`scim groups create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){o({command:`cf scim groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Groups`,pathParams:{},bodyKind:`octet-stream`,body:d.body});return}let c=await i(d),f=d.local?e:await t();if(d.accountId=f,d.file){let e=u(d.file);a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(d.body){let e=l(d.body,`body`,`binary`);a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${f}/scim/v2/Groups`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function h(e){return e.positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style 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 g={command:`delete <group-id>`,describe:`Deletes a SCIM Group (custom user groups only). System groups backed by Cloudflare permission groups cannot be deleted via SCIM. Returns 204 No Content on success.`,builder:h,handler:async r=>c({command:`scim groups delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf scim groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await d({force:!!r.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}a(await s(`Deleting`,async()=>c.scim.groups.delete({account_id:l,group_id:r[`group-id`]})),{successLabel:`Deleted`})})};function _(e){return e.positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const v={command:`edit <group-id>`,describe:"Partially updates a SCIM Group via PATCH operations (RFC 7644 Section 3.5.2). Supports add, remove, and replace operations on `members`, `displayName`, and `externalId`. For system groups (prefixed `cloudflare-v1-`), only member management operations are supported.",builder:_,handler:async d=>c({command:`scim groups edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){o({command:`cf scim groups edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Groups/${d[`group-id`]==null?`<group-id>`:encodeURIComponent(String(d[`group-id`]))}`,pathParams:{"group-id":String(d[`group-id`]??``)},bodyKind:`octet-stream`,body:d.body});return}let c=await i(d),f=d.local?e:await t();if(d.accountId=f,d.file){let e=u(d.file);a(await s(`Updating`,async()=>r(c,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(d[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(d.body){let e=l(d.body,`body`,`binary`);a(await s(`Updating`,async()=>r(c,`PATCH`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(d[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function y(e){return e.positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get <group-id>`,describe:`Retrieves a single SCIM Group resource by group ID.`,builder:y,handler:async r=>c({command:`scim groups get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf scim groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Groups/${r[`group-id`]==null?`<group-id>`:encodeURIComponent(String(r[`group-id`]))}`,pathParams:{"group-id":String(r[`group-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.scim.groups.get({account_id:l,group_id:r[`group-id`]})),{successLabel:`Loaded`})})};function x(e){return e.option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `displayName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const S={command:`list`,describe:"Lists SCIM Group resources for the account. Returns both system groups (backed by Cloudflare permission groups, prefixed `cloudflare-v1-`) and custom user groups. Supports filtering by `displayName` using SCIM filter syntax.",builder:x,handler:async r=>c({command:`scim groups list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={startIndex:r[`start-index`],count:r.count,filter:r.filter};if(r.dryRun){o({command:`cf scim groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/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.scim.groups.list({account_id:u,...c})),{successLabel:`Loaded`})})};function C(e){return e.positional(`group-id`,{type:`string`,description:"The group identifier for a SCIM Group resource. For system groups this is prefixed `cloudflare-v1-<permissionGroupTag>`; for custom user groups this is a UUID-style tag.",demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const w={command:`update <group-id>`,describe:"Replaces the mutable attributes of a SCIM Group (RFC 7644 Section 3.5.1), including its complete member set. Omitting `externalId` clears it, and omitting `members` replaces the member set with an empty list. For system groups (prefixed `cloudflare-v1-`), only the member set is replaced.",builder:C,handler:async d=>c({command:`scim groups update`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){o({command:`cf scim groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Groups/${d[`group-id`]==null?`<group-id>`:encodeURIComponent(String(d[`group-id`]))}`,pathParams:{"group-id":String(d[`group-id`]??``)},bodyKind:`octet-stream`,body:d.body});return}let c=await i(d),f=d.local?e:await t();if(d.accountId=f,d.file){let e=u(d.file);a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(d[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(d.body){let e=l(d.body,`body`,`binary`);a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${f}/scim/v2/Groups/${encodeURIComponent(String(d[`group-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},T={command:`groups`,describe:`Groups operations`,builder:e=>e.command(m).command(g).command(v).command(b).command(S).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function E(e){return e.positional(`resource-type-id`,{type:`string`,description:`The resource type identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`get <resource-type-id>`,describe:"Returns a single SCIM resource type by ID (RFC 7643 Section 6). Valid IDs are `User` and `Group`.",builder:f(E),handler:async r=>c({command:`scim resource-types get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf scim resource-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/ResourceTypes/${r[`resource-type-id`]==null?`<resource-type-id>`:encodeURIComponent(String(r[`resource-type-id`]))}`,pathParams:{"resource-type-id":String(r[`resource-type-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.scim.resourceTypes.get({account_id:l,resource_type_id:r[`resource-type-id`]})),{successLabel:`Loaded`})})};function O(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`list`,describe:`Returns the list of SCIM resource types supported by the Cloudflare SCIM service (RFC 7643 Section 6, RFC 7644 Section 4). Clients use this to discover available resource categories (e.g. Users, Groups) and their associated schemas. Query parameters are not supported on this endpoint.`,builder:O,handler:async r=>c({command:`scim resource-types list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf scim resource-types list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/ResourceTypes`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.scim.resourceTypes.list({account_id:l})),{successLabel:`Loaded`})})},A={command:`resource-types`,describe:`Resource Types operations`,builder:e=>e.command(D).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function j(e){return e.positional(`schema-id`,{type:`string`,description:`The schema URI identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`get <schema-id>`,describe:"Returns a single SCIM schema definition by schema URI ID (RFC 7643 Section 7). Valid IDs are `urn:ietf:params:scim:schemas:core:2.0:User` and `urn:ietf:params:scim:schemas:core:2.0:Group`.",builder:j,handler:async r=>c({command:`scim schemas get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf scim schemas get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Schemas/${r[`schema-id`]==null?`<schema-id>`:encodeURIComponent(String(r[`schema-id`]))}`,pathParams:{"schema-id":String(r[`schema-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.scim.schemas.get({account_id:l,schema_id:r[`schema-id`]})),{successLabel:`Loaded`})})};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`list`,describe:`Returns the list of SCIM schemas supported by the Cloudflare SCIM service (RFC 7643 Section 7, RFC 7644 Section 4). Clients use this to introspect the attributes of each resource type. Query parameters are not supported on this endpoint.`,builder:N,handler:async r=>c({command:`scim schemas list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf scim schemas list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Schemas`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.scim.schemas.list({account_id:l})),{successLabel:`Loaded`})})},F={command:`schemas`,describe:`Schemas operations`,builder:e=>e.command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`get`,describe:`Returns the SCIM 2.0 Service Provider configuration (RFC 7643 Section 5). IdPs use this endpoint to auto-configure their SCIM integration with Cloudflare, discovering which optional features (patch, bulk, filter, etc.) are supported.`,builder:I,handler:async r=>c({command:`scim service-provider-config get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf scim service-provider-config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/ServiceProviderConfig`,pathParams:{},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.scim.serviceProviderConfig.get({account_id:l})),{successLabel:`Loaded`})})},R={command:`service-provider-config`,describe:`Service Provider Config operations`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const B={command:`create`,describe:"Provisions a new account member via SCIM. The `userName` field must be a valid email address and must match the primary email in `emails`. The account must be an Enterprise account with SCIM entitlements enabled.",builder:z,handler:async d=>c({command:`scim users create`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){o({command:`cf scim users create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Users`,pathParams:{},bodyKind:`octet-stream`,body:d.body});return}let c=await i(d),f=d.local?e:await t();if(d.accountId=f,d.file){let e=u(d.file);a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${f}/scim/v2/Users`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(d.body){let e=l(d.body,`body`,`binary`);a(await s(`Creating`,async()=>r(c,`POST`,`/accounts/${f}/scim/v2/Users`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Created`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function V(e){return e.positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,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 H={command:`delete <user-id>`,describe:`Deprovisions a SCIM User by removing their membership from this account (RFC 7644 Section 3.6). This does not delete the global Cloudflare user.`,builder:V,handler:async r=>c({command:`scim users delete`,classification:{safeFlags:[`dry-run`,`force`],shortFlagAliases:{f:{canonical:`force`,type:`boolean`}}}},r,async()=>{if(r.dryRun){o({command:`cf scim users delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await d({force:!!r.force,message:`Are you sure you want to remove this user from the account?`})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}a(await s(`Deleting`,async()=>c.scim.users.delete({account_id:l,user_id:r[`user-id`]})),{successLabel:`Deleted`})})};function U(e){return e.positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const W={command:`edit <user-id>`,describe:'Partially updates a SCIM User via PATCH operations (RFC 7644 Section 3.5.2). Supports updating `userName`, `name.givenName`, `name.familyName`, and `active`. Setting `active: false` deprovisions the user (removes them from the account). For IdP compatibility, `emails[type eq "work"].value` is also accepted as an alias for `userName`.',builder:U,handler:async d=>c({command:`scim users edit`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){o({command:`cf scim users edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Users/${d[`user-id`]==null?`<user-id>`:encodeURIComponent(String(d[`user-id`]))}`,pathParams:{"user-id":String(d[`user-id`]??``)},bodyKind:`octet-stream`,body:d.body});return}let c=await i(d),f=d.local?e:await t();if(d.accountId=f,d.file){let e=u(d.file);a(await s(`Updating`,async()=>r(c,`PATCH`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(d[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(d.body){let e=l(d.body,`body`,`binary`);a(await s(`Updating`,async()=>r(c,`PATCH`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(d[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})};function G(e){return e.positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <user-id>`,describe:`Retrieves a single account member as a SCIM User resource by user tag.`,builder:G,handler:async r=>c({command:`scim users get`,classification:{safeFlags:[`dry-run`]}},r,async()=>{if(r.dryRun){o({command:`cf scim users get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Users/${r[`user-id`]==null?`<user-id>`:encodeURIComponent(String(r[`user-id`]))}`,pathParams:{"user-id":String(r[`user-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.scim.users.get({account_id:l,user_id:r[`user-id`]})),{successLabel:`Loaded`})})};function q(e){return e.option(`start-index`,{type:`number`,description:`The 1-based index of the first result in the current set of list results. Values less than 1 are treated as 1.`}).option(`count`,{type:`number`,description:`Specifies the desired maximum number of query results per page.`}).option(`filter`,{type:`string`,description:'SCIM filter expression (RFC 7644 Section 3.4.2.2). Only `userName eq "value"` is supported.'}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:'Lists account members as SCIM User resources. Supports optional filtering by `userName` (email) using the SCIM filter syntax (e.g. `userName eq "user@example.com"`). Pagination is controlled via `startIndex` and `count` query parameters per RFC 7644 Section 3.4.2.4.',builder:q,handler:async r=>c({command:`scim users list`,classification:{safeFlags:[`dry-run`]}},r,async()=>{let c={startIndex:r[`start-index`],count:r.count,filter:r.filter};if(r.dryRun){o({command:`cf scim users list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Users`,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.scim.users.list({account_id:u,...c})),{successLabel:`Loaded`})})};function Y(e){return e.positional(`user-id`,{type:`string`,description:`The user tag identifying a SCIM User resource (account member).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const X={command:`update <user-id>`,describe:"Replaces a SCIM User resource (RFC 7644 Section 3.5.1). Fully replaces the mutable attributes of the user. Supports updating `userName`, `name`, `emails`, and `active`.",builder:Y,handler:async d=>c({command:`scim users update`,classification:{safeFlags:[`dry-run`]}},d,async()=>{if(d.dryRun){o({command:`cf scim users update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/scim/v2/Users/${d[`user-id`]==null?`<user-id>`:encodeURIComponent(String(d[`user-id`]))}`,pathParams:{"user-id":String(d[`user-id`]??``)},bodyKind:`octet-stream`,body:d.body});return}let c=await i(d),f=d.local?e:await t();if(d.accountId=f,d.file){let e=u(d.file);a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(d[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(d.body){let e=l(d.body,`body`,`binary`);a(await s(`Updating`,async()=>r(c,`PUT`,`/accounts/${f}/scim/v2/Users/${encodeURIComponent(String(d[`user-id`]))}`,{body:e,headers:{"Content-Type":`application/scim+json`}})),{successLabel:`Updated`});return}if(d.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)})},Z={command:`users`,describe:`Users operations`,builder:e=>e.command(B).command(H).command(W).command(K).command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`scim`,describe:`SCIM 2.0 provisioning — manage users, groups, and identity provider sync for your account`,builder:e=>e.command(T).command(A).command(F).command(R).command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Q as default};
|