cf 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -5
- package/dist/_meta/agent-context.json +13 -5
- package/dist/_meta/commands.json +2393 -262
- package/dist/_meta/hand-written-commands.json +960 -0
- package/dist/_meta/schemas.json +1882 -155
- package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-D40QFl-y.mjs} +2 -2
- package/dist/{access-lhLJo1v2.mjs → access-Dl2IU1ID.mjs} +1 -1
- package/dist/account-CPbieCZ4.mjs +2 -0
- package/dist/{account-tags-B88TotoH.mjs → account-tags-skfP7H8k.mjs} +4 -4
- package/dist/{accounts-BSIAT_iP.mjs → accounts-CSgR6909.mjs} +12 -12
- package/dist/{acm-VULm1djv.mjs → acm-CVvCTaNk.mjs} +1 -1
- package/dist/{addressing-BHPBIkRY.mjs → addressing-Uq5hEDDP.mjs} +11 -11
- package/dist/{agent-context-KBy48G1b.mjs → agent-context-BvuDdaJb.mjs} +1 -1
- package/dist/agent-memory-BrHMIU0E.mjs +6 -0
- package/dist/ai-audit-BoZuL84i.mjs +2 -0
- package/dist/ai-gateway-DE50Jem1.mjs +13 -0
- package/dist/ai-search-Fx7NHCHB.mjs +7 -0
- package/dist/ai-security-DyLbY9kv.mjs +4 -0
- package/dist/ai-v2fP1r0s.mjs +5 -0
- package/dist/{alerting-Bl8OqViR.mjs → alerting-5mFZjTcD.mjs} +1 -1
- package/dist/analytics-BygTfozw.mjs +3 -0
- package/dist/analytics_engine-4L-q362P.mjs +2 -0
- package/dist/{api-security-4FVrD4n8.mjs → api-security-DjFsRYWx.mjs} +20 -20
- package/dist/argo-TzXPN7tz.mjs +2 -0
- package/dist/args-CDgWUP4J.mjs +2 -0
- package/dist/{artifacts-CVDGnr2V.mjs → artifacts-dEw2UUBV.mjs} +1 -1
- package/dist/audit-logs-CqY7zzwv.mjs +2 -0
- package/dist/auth-CPLdkOC7.mjs +5 -0
- package/dist/{auth-MQEamPN9.mjs → auth-DY_Y2bXC.mjs} +3 -3
- package/dist/billing-DHQuRT8S.mjs +3 -0
- package/dist/body-parser-BGVbwPeM.mjs +2 -0
- package/dist/bot-management-CfqG79hF.mjs +5 -0
- package/dist/botnet-feed-BOeNnDoH.mjs +3 -0
- package/dist/brand-protection-DYttrKIM.mjs +3 -0
- package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
- package/dist/browser-run-373D4e1i.mjs +4 -0
- package/dist/build-D0ir_S70.mjs +2 -0
- package/dist/{cache-VyWK1SjY.mjs → cache-DJXBmc3w.mjs} +1 -1
- package/dist/{calls-BxoRYxs4.mjs → calls-COO0Eoz1.mjs} +1 -1
- package/dist/certificate-authorities-DbHLmKbd.mjs +2 -0
- package/dist/cf-yPz_IqW6.mjs +18 -0
- package/dist/chunk-LQW53VED-9MACsvSG.mjs +119 -0
- package/dist/chunk-QBZBEHZB-yeyhVUeD.mjs +2 -0
- package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
- package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-HOmA37et.mjs} +1 -1
- package/dist/cloud-connector-C7hw1c1f.mjs +2 -0
- package/dist/cloudforce-one-DLOj76q4.mjs +36 -0
- package/dist/command-BV87D4tR.mjs +2 -0
- package/dist/{completions-BHE4pRjB.mjs → completions-BnD46cXe.mjs} +3 -3
- package/dist/config.d.mts +1451 -1366
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-DY-z_LrH.mjs +2 -0
- package/dist/connector-telemetry-events-DCXmcAc9.mjs +2 -0
- package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +2 -0
- package/dist/{connectors-BqxYMMtQ.mjs → connectors-fEOn-J_i.mjs} +1 -1
- package/dist/containers-BDBsEs7-.mjs +58 -0
- package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-Cmj9--XY.mjs} +1 -1
- package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
- package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
- package/dist/custom-certificates-C5qrlyhb.mjs +5 -0
- package/dist/custom-csrs-BgOnTbBW.mjs +3 -0
- package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
- package/dist/custom-nameservers-2ZajBkRC.mjs +3 -0
- package/dist/custom-pages-Buki_Cb8.mjs +3 -0
- package/dist/d1-n2in0cSF.mjs +20 -0
- package/dist/data-security-DzOQMkv3.mjs +7 -0
- package/dist/dcv-delegation-BTP9LCOm.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-BUSz35vq.mjs +2 -0
- package/dist/deploy-input-BvD9aRP1.mjs +2 -0
- package/dist/dev-DY_DquQx.mjs +4 -0
- package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
- package/dist/{directory-BlH6N6Qy.mjs → directory-BeiSyg8A.mjs} +1 -1
- package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
- package/dist/dist-BBx1io2f.mjs +2 -0
- package/dist/dist-Cb9TJ2VV.mjs +9 -0
- package/dist/dist-DV7LR38l.mjs +387 -0
- package/dist/dist-DvizctjW.mjs +48 -0
- package/dist/{dls-BF5iN78p.mjs → dls-BwoU29mS.mjs} +1 -1
- package/dist/{dns-CeCTNqRk.mjs → dns-DISAfuzj.mjs} +13 -13
- package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
- package/dist/dry-run-ILZRVpnp.mjs +2 -0
- package/dist/durable-objects-DhDL3San.mjs +2 -0
- package/dist/email-auth-BROqK6-C.mjs +2 -0
- package/dist/email-routing-BZXHDAOO.mjs +6 -0
- package/dist/email-security-DVumybrk.mjs +18 -0
- package/dist/email-sending-CDQ3_wyz.mjs +7 -0
- package/dist/fieldExtractors-Cy1rxHEF.mjs +3 -0
- package/dist/{firewall-CBPGJ43p.mjs → firewall-C0g5X7Zd.mjs} +9 -9
- package/dist/flagship-fFBiZUz-.mjs +4 -0
- package/dist/{fraud-BIhS8pLf.mjs → fraud-CjIETOaM.mjs} +1 -1
- package/dist/google-tag-gateway-hPa5IHUx.mjs +2 -0
- package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-CoycpTf9.mjs} +1 -1
- package/dist/{hostnames-Bx0mykMR.mjs → hostnames-x_Yezxpr.mjs} +1 -1
- package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
- package/dist/iam-Bk7K_PPO.mjs +6 -0
- package/dist/images-BAEFb9q1.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/{intel-B-9Z_sJs.mjs → intel-DDkyJVaP.mjs} +1 -1
- package/dist/interactive-CRnq-B5I.mjs +11 -0
- package/dist/{interactive-DtsCYfrK.mjs → interactive-cytQzL94.mjs} +1 -1
- package/dist/ips-DU0ti0i0.mjs +2 -0
- package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
- package/dist/keys-DqldTZqH.mjs +2 -0
- package/dist/{kv-BFDUCnft.mjs → kv-CcfCfnwq.mjs} +1 -1
- package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
- package/dist/load-balancers-Dg4pDad1.mjs +6 -0
- package/dist/{local-D-aVNu6A.mjs → local-DGiIS1uM.mjs} +1 -1
- package/dist/local-runtime--IQr44qq.mjs +2 -0
- package/dist/logexplorer-Bu2mG5rh.mjs +17 -0
- package/dist/logo-matches-CWUzxY7G.mjs +2 -0
- package/dist/logos-BTfdkDPi.mjs +3 -0
- package/dist/{logpush-BK34mMQs.mjs → logpush-BZyay3h2.mjs} +1 -1
- package/dist/{logs-CLAqX9h2.mjs → logs-BqF7jjQO.mjs} +1 -1
- package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +4 -4
- package/dist/magic-network-monitoring-D0FnkjuN.mjs +4 -0
- package/dist/magic-transit-B5skt0G7.mjs +111 -0
- package/dist/managed-transforms-B6X_crcJ.mjs +3 -0
- package/dist/matches-DeYaB4I0.mjs +2 -0
- package/dist/mcp-ChjBiMx2.mjs +4 -0
- package/dist/mesh-DRVAFLBX.mjs +4 -0
- package/dist/{moq-qmuVPAO0.mjs → moq-DE7VDEFS.mjs} +1 -1
- package/dist/mtls-certificates-Cbc3uAkN.mjs +3 -0
- package/dist/{network-D74cSy3t.mjs → network-CDPZNFbn.mjs} +1 -1
- package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
- package/dist/oauth-DAa7SwkM.mjs +14 -0
- package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
- package/dist/oauth-scopes-BE6xF4_h.mjs +2 -0
- package/dist/observability-DnyI8rPJ.mjs +4 -0
- package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +3 -3
- package/dist/{organization-NX7yCZrq.mjs → organization-yh0mSUdI.mjs} +6 -6
- package/dist/organizations-B3aU-RCG.mjs +2 -0
- package/dist/origin-ca-certificates-BaNWfVqf.mjs +3 -0
- package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +2 -0
- package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +4 -0
- package/dist/{output-DrpYYfnB.mjs → output-BqDR9h74.mjs} +1 -1
- package/dist/page-rules-CzbyXbt6.mjs +27 -0
- package/dist/pages-CX8yefTI.mjs +14 -0
- package/dist/pay-per-crawl-v4vBOMWD.mjs +4 -0
- package/dist/pipelines-BZ1KGupx.mjs +6 -0
- package/dist/precursor-D42A9ay5.mjs +4 -0
- package/dist/progress-jYW64HY7.mjs +2 -0
- package/dist/project-settings-BN7tL0c7.mjs +3 -0
- package/dist/prompt-CyATfGUu.mjs +3 -0
- package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
- package/dist/queries-xvETUjUE.mjs +3 -0
- package/dist/queues-CpqHDtxF.mjs +6 -0
- package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
- package/dist/r2-jhmLvD1z.mjs +24 -0
- package/dist/radar-C2J16wpX.mjs +2 -0
- package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
- package/dist/raw-fetch-CNKIypJ7.mjs +2 -0
- package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
- package/dist/registrar-BI5ewTAk.mjs +23 -0
- package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-al1znWMc.mjs} +4 -4
- package/dist/{registry-Bck_zFkz.mjs → registry-5-I2XLwF.mjs} +1 -1
- package/dist/reporting-CxsdHAH3.mjs +2 -0
- package/dist/request-tracers-DJJCncft.mjs +2 -0
- package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
- package/dist/resource-tagging-aTtpX5e5.mjs +2 -0
- package/dist/rules-PpsDU89Q.mjs +4 -0
- package/dist/rulesets-DP12Aqik.mjs +5 -0
- package/dist/rum-DxvpzJYc.mjs +4 -0
- package/dist/{schema-B34Q9tLF.mjs → schema-DlLbiOJj.mjs} +1 -1
- package/dist/schema-flags-CTfQVGCs.mjs +5 -0
- package/dist/schemas-BFCBlp_W.mjs +65 -0
- package/dist/{scim-CcSyfKCH.mjs → scim-DJ4AVU20.mjs} +1 -1
- package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
- package/dist/security-center-008FMs_z.mjs +2 -0
- package/dist/{security-txt-DqnFpjMI.mjs → security-txt-CqcfrhlN.mjs} +1 -1
- package/dist/{share-BuwYUzOL.mjs → share-D5fzsVAJ.mjs} +4 -4
- package/dist/{deploy-input-CrvuoDGJ.mjs → shared-DlKGNPiT.mjs} +97 -99
- package/dist/smart-shield-DpFscIk8.mjs +4 -0
- package/dist/snippets-CCKgI2ZX.mjs +4 -0
- package/dist/spawn-C3_tJ3RB.mjs +526 -0
- package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-LmdqY3ki.mjs} +1 -1
- package/dist/{speed-cw31yFva.mjs → speed-CEK36h3A.mjs} +1 -1
- package/dist/src-CEb2fgtT.mjs +108 -0
- package/dist/{ssl-CsEhRVTO.mjs → ssl-ChHUyaQm.mjs} +1 -1
- package/dist/startup-profile-Dpxg-MjV.mjs +17 -0
- package/dist/{state-Bb5Cbc_L.mjs → state-DeX23Kmg.mjs} +1 -1
- package/dist/{stream-DFOao6Gu.mjs → stream-DfUSELMX.mjs} +13 -13
- package/dist/submit-DF2G5CIz.mjs +2 -0
- package/dist/tags-nFJJHlLJ.mjs +2 -0
- package/dist/tenant-CRLw1oRU.mjs +2 -0
- package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +3 -0
- package/dist/{tools-BHfBOZOU.mjs → tools-j8UGEtP1.mjs} +1 -1
- package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CMQeBgmb.mjs} +1 -1
- package/dist/tunnels-iVA3MrdS.mjs +2 -0
- package/dist/turnstile-DQHP6-_b.mjs +23 -0
- package/dist/{ui-DE8CNn6c.mjs → ui-DJFcf61J.mjs} +1 -1
- package/dist/url-info-BVgdb_pf.mjs +2 -0
- package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
- package/dist/url-scanner-DwuDZLPk.mjs +2 -0
- package/dist/user-I_MbB_KX.mjs +12 -0
- package/dist/values-S-Q7-5o8.mjs +2 -0
- package/dist/{vectorize-CVKu7lEt.mjs → vectorize-CNZdF_0A.mjs} +1 -1
- package/dist/waiting-rooms-Bo-OSsxu.mjs +11 -0
- package/dist/{web-assets-C2s9kzWf.mjs → web-assets-tlFzKdNL.mjs} +1 -1
- package/dist/web3-CdbfoZ2x.mjs +4 -0
- package/dist/workers-DQ9Q7czn.mjs +28 -0
- package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
- package/dist/{workflows-B-kGHxFu.mjs → workflows-BhEy-crm.mjs} +1 -1
- package/dist/zaraz-DbKvA_8C.mjs +2 -0
- package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DrHCPVOc.mjs} +67 -66
- package/dist/zone-D2zrbJI2.mjs +2 -0
- package/dist/zones-DrpxQ_-A.mjs +21 -0
- package/package.json +12 -8
- package/dist/account-CYRm3yoN.mjs +0 -2
- package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
- package/dist/ai-audit-BWZGvbca.mjs +0 -2
- package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
- package/dist/ai-search-BmdskMjR.mjs +0 -7
- package/dist/ai-security-CsmfcaUx.mjs +0 -4
- package/dist/ai-viHB1tgI.mjs +0 -5
- package/dist/analytics-vOxw8Hy0.mjs +0 -3
- package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
- package/dist/argo-CQfCgazW.mjs +0 -2
- package/dist/args-DlUhyGU0.mjs +0 -2
- package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
- package/dist/auth-D0xZxAEa.mjs +0 -5
- package/dist/billing-aJgapeRm.mjs +0 -3
- package/dist/body-parser-C-c9gfH1.mjs +0 -2
- package/dist/bot-management-Y2q5d-pi.mjs +0 -5
- package/dist/botnet-feed-DANJqfmE.mjs +0 -3
- package/dist/brand-protection-CjpZWBjp.mjs +0 -3
- package/dist/browser-run-BFn9h2Tz.mjs +0 -4
- package/dist/build-DcflwvqN.mjs +0 -2
- package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
- package/dist/cf-C7DU4819.mjs +0 -18
- package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
- package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
- package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
- package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
- package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
- package/dist/containers-CKW081JA.mjs +0 -54
- package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
- package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
- package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
- package/dist/custom-pages-M7jA2Hit.mjs +0 -3
- package/dist/d1-BFvMd6-S.mjs +0 -20
- package/dist/data-security-Bji4Or_j.mjs +0 -7
- package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
- package/dist/deploy-CZ7bgNDu.mjs +0 -2
- package/dist/dev-V10MG-Bg.mjs +0 -4
- package/dist/dist-CgrMkXFx.mjs +0 -72
- package/dist/durable-objects-D8FQORrL.mjs +0 -2
- package/dist/email-auth-DJK0Eb30.mjs +0 -2
- package/dist/email-routing-NpmiKIrl.mjs +0 -6
- package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
- package/dist/email-sending-dn-353Nx.mjs +0 -7
- package/dist/fieldExtractors-ahysj57J.mjs +0 -3
- package/dist/flagship-BusjRNIb.mjs +0 -4
- package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
- package/dist/iam-Cj63Kjc6.mjs +0 -6
- package/dist/images-CBWXCDhy.mjs +0 -8
- package/dist/ips-qs9eGJnI.mjs +0 -2
- package/dist/keys-D7N0j4-x.mjs +0 -2
- package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
- package/dist/local-runtime-Dh3keC5v.mjs +0 -2
- package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
- package/dist/logo-matches-CJcthPHf.mjs +0 -2
- package/dist/logos-BS65zN8q.mjs +0 -3
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
- package/dist/magic-transit-BtsFePMx.mjs +0 -111
- package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
- package/dist/matches-InA1hwII.mjs +0 -2
- package/dist/mcp-mJ7bekNJ.mjs +0 -4
- package/dist/mesh-BK4S1Ezy.mjs +0 -4
- package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
- package/dist/oauth-B0ETkNcX.mjs +0 -15
- package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
- package/dist/observability-BWE0Gg3V.mjs +0 -4
- package/dist/organizations-DLhiRt8g.mjs +0 -2
- package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
- package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
- package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
- package/dist/page-rules-BSz1gO-_.mjs +0 -18
- package/dist/pages-DVDogxPs.mjs +0 -14
- package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
- package/dist/pipelines-BszRk4sM.mjs +0 -6
- package/dist/precursor-BPNjQr76.mjs +0 -4
- package/dist/progress-CsHIt3Tp.mjs +0 -2
- package/dist/prompt-DdegNPpg.mjs +0 -3
- package/dist/queries-JL1H1Biz.mjs +0 -3
- package/dist/queues-DpkYdRUE.mjs +0 -6
- package/dist/r2-CKozthw_.mjs +0 -24
- package/dist/radar-C-92vggG.mjs +0 -2
- package/dist/raw-fetch-CteyTOM2.mjs +0 -2
- package/dist/registrar-DKKN0M29.mjs +0 -21
- package/dist/reporting-fg_GKXe1.mjs +0 -2
- package/dist/request-tracers-CkMya96z.mjs +0 -2
- package/dist/resource-tagging-z48JGHCq.mjs +0 -2
- package/dist/rules-BTmNjDN-.mjs +0 -4
- package/dist/rulesets-CsoSM-17.mjs +0 -5
- package/dist/rum-DB4iO2q5.mjs +0 -4
- package/dist/schema-flags-iGoOriJt.mjs +0 -5
- package/dist/security-center-DFKeHq5c.mjs +0 -2
- package/dist/session-D6KHthHf.mjs +0 -2
- package/dist/shared-VppSAQf4.mjs +0 -2
- package/dist/smart-shield-D6X8L7p8.mjs +0 -4
- package/dist/snippets-DIpc9pb_.mjs +0 -4
- package/dist/spawn-O1RS01vr.mjs +0 -523
- package/dist/src-D_HETJNy.mjs +0 -108
- package/dist/submit--xTzyNPy.mjs +0 -2
- package/dist/tags-efICDkah.mjs +0 -2
- package/dist/tenant-CerHuToJ.mjs +0 -2
- package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
- package/dist/triggers-BEsiiKAf.mjs +0 -2
- package/dist/tunnels-D0J8lJoI.mjs +0 -2
- package/dist/turnstile-CFmtY5bn.mjs +0 -23
- package/dist/url-info-DBCeRWwb.mjs +0 -2
- package/dist/url-scanner-CNyvg65L.mjs +0 -2
- package/dist/user-bifVEQq5.mjs +0 -12
- package/dist/values-OxkdP1tV.mjs +0 -2
- package/dist/versions-BVL-Ludh.mjs +0 -2
- package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
- package/dist/web3-y_cY91V_.mjs +0 -4
- package/dist/workers-jDcq14GH.mjs +0 -24
- package/dist/zaraz-27zwjLvv.mjs +0 -2
- package/dist/zone-BJix2KQ9.mjs +0 -2
- package/dist/zones-Bkj5i92c.mjs +0 -21
- /package/dist/{alerts-CRmjqOZi.mjs → alerts-9PR5sQ_z.mjs} +0 -0
- /package/dist/{autorag-BD7cu5NU.mjs → autorag-Bevo1kIH.mjs} +0 -0
- /package/dist/{brands-BhALBkX2.mjs → brands-C4M04Man.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
- /package/dist/{clear-BgF8No7D.mjs → clear-DS0eRXOc.mjs} +0 -0
- /package/dist/{cli-types-BsTty22w.mjs → cli-types-C3nVfpSG.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
- /package/dist/{domain-info-C50W5GhA.mjs → domain-info-BUiaGCEq.mjs} +0 -0
- /package/dist/{health-BFNZqiAm.mjs → health-vX6Ml2Na.mjs} +0 -0
- /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-1esLElok.mjs} +0 -0
- /package/dist/{internal-BTeSewwB.mjs → internal-ROz7anul.mjs} +0 -0
- /package/dist/{live-Dkiyu30_.mjs → live-CSxvigCS.mjs} +0 -0
- /package/dist/{metadata-8AkOftcB.mjs → metadata-DEqBUaSv.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
- /package/dist/{ready-TKOkKeRg.mjs → ready-6G9zVGPJ.mjs} +0 -0
- /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
- /package/dist/{refute-BVz9nMyd.mjs → refute-DjkmLSNe.mjs} +0 -0
- /package/dist/{resolve-CeBbH6Pq.mjs → resolve-DEvdeprv.mjs} +0 -0
- /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-545qLcGs.mjs} +0 -0
- /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-DRQiVufl.mjs} +0 -0
- /package/dist/{search-DGNc37HK.mjs → search-CXbqFoqe.mjs} +0 -0
- /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-rU_nvgFA.mjs} +0 -0
- /package/dist/{submission-info-FjUolE6A.mjs → submission-info-D6PgXNQP.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
- /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-XkFyu8H5.mjs} +0 -0
- /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
- /package/dist/{verify-DS1PWAJe.mjs → verify-CM1NakP0.mjs} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";import{n as s,r as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u}from"./input-validation-1esLElok.mjs";import{a as d,n as f}from"./prompt-CyATfGUu.mjs";import{t as p}from"./cli-types-C3nVfpSG.mjs";function m(e){return e.positional(`permission-group-id`,{type:`string`,description:`Permission Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const h={command:`get <permission-group-id>`,describe:`Get information about a specific permission group in an account.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf iam permission-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/permission_groups/${s[`permission-group-id`]==null?`<permission-group-id>`:encodeURIComponent(String(s[`permission-group-id`]))}`,pathParams:{"permission-group-id":String(s[`permission-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.permissionGroups.get({account_id:l,permission_group_id:s[`permission-group-id`]})),{successLabel:`Loaded`})}};function ee(e){return e.option(`id`,{type:`string`,description:`ID of the permission group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the permission group to be fetched.`}).option(`label`,{type:`string`,description:`Label of the permission group to be fetched.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List all the permissions groups for an account.`,builder:ee,handler:async s=>{let c={id:s.id,name:s.name,label:s.label,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf iam permission-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/permission_groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.iam.permissionGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}},_={command:`permission-groups`,describe:`View the permission groups that can be assigned to API tokens and policies`,builder:e=>e.command(h).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function v(e){return e.option(`name`,{type:`string`,description:`Name of the resource group`}).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 y={command:`create`,describe:`Create a new Resource Group under the specified account.`,builder:v,handler:async c=>{if(c.dryRun){a({command:`cf iam resource-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({name:u(c.name,`name`,`text`)}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.iam.resourceGroups.create({...e,account_id:p})),{successLabel:`Created`});return}c.name===void 0&&(c.name=await d(`name`,`Name of the resource group`));let m=l({name:u(c.name,`name`,`text`)});i(await o(`Creating`,async()=>f.iam.resourceGroups.create({...m,account_id:p})),{successLabel:`Created`})}};function b(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const x={command:`delete <resource-group-id>`,describe:`Remove a resource group from an account.`,builder:b,handler:async s=>{if(s.dryRun){a({command:`cf iam resource-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${s[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(s[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(s[`resource-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}i(await o(`Deleting`,async()=>c.iam.resourceGroups.delete({account_id:l,resource_group_id:s[`resource-group-id`]})),{successLabel:`Deleted`})}};function S(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get <resource-group-id>`,describe:`Get information about a specific resource group in an account.`,builder:S,handler:async s=>{if(s.dryRun){a({command:`cf iam resource-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${s[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(s[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(s[`resource-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.resourceGroups.get({account_id:l,resource_group_id:s[`resource-group-id`]})),{successLabel:`Loaded`})}};function w(e){return e.option(`id`,{type:`string`,description:`ID of the resource group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the resource group to be fetched.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`list`,describe:`List all the resource groups for an account.`,builder:w,handler:async s=>{let c={id:s.id,name:s.name};if(s.dryRun){a({command:`cf iam resource-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.iam.resourceGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}};function E(e){return e.positional(`resource-group-id`,{type:`string`,description:`Resource Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the resource group`}).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 <resource-group-id>`,describe:`Modify an existing resource group.`,builder:E,handler:async c=>{if(c.dryRun){a({command:`cf iam resource-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/resource_groups/${c[`resource-group-id`]==null?`<resource-group-id>`:encodeURIComponent(String(c[`resource-group-id`]))}`,pathParams:{"resource-group-id":String(c[`resource-group-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({name:u(c.name,`name`,`text`)}):s(c.body)});return}let d=await r(c),f=c.local?e:await t();if(c.accountId=f,c.body){let e=s(c.body);i(await o(`Updating`,async()=>d.iam.resourceGroups.update({...e,account_id:f,resource_group_id:c[`resource-group-id`]})),{successLabel:`Updated`});return}let p=l({name:u(c.name,`name`,`text`)});i(await o(`Updating`,async()=>d.iam.resourceGroups.update({...p,account_id:f,resource_group_id:c[`resource-group-id`]})),{successLabel:`Updated`})}},O={command:`resource-groups`,describe:`Define scopes that limit which account resources a policy or token can access`,builder:e=>e.command(y).command(x).command(C).command(T).command(D).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function k(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`begin-verification <sso-connector-id>`,describe:`Validates the user has added the DNS TXT record required for validating ownership of the domain they are trying to set up a connector for.`,builder:k,handler:async s=>{if(s.dryRun){a({command:`cf iam sso begin-verification`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}/begin_verification`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.iam.sso.beginVerification({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Created`})}};function j(e){return e.option(`begin-verification`,{type:`boolean`,description:`Begin the verification process after creation`,default:!0}).option(`email-domain`,{type:`string`,description:`Email domain of the new SSO connector`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`create`,describe:`Creates a new SSO connector for logging into Cloudflare through an identity provider.`,builder:j,handler:async c=>{if(c.dryRun){a({command:`cf iam sso create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`json`,body:c.body===void 0?l({begin_verification:c[`begin-verification`],email_domain:u(c[`email-domain`],`email-domain`,`text`),use_fedramp_language:c[`use-fedramp-language`]}):s(c.body)});return}let f=await r(c),p=c.local?e:await t();if(c.accountId=p,c.body){let e=s(c.body);i(await o(`Creating`,async()=>f.iam.sso.create({...e,account_id:p})),{successLabel:`Created`});return}c[`email-domain`]===void 0&&(c[`email-domain`]=await d(`email-domain`,`Email domain of the new SSO connector`));let m=l({begin_verification:c[`begin-verification`],email_domain:u(c[`email-domain`],`email-domain`,`text`),use_fedramp_language:c[`use-fedramp-language`]});i(await o(`Creating`,async()=>f.iam.sso.create({...m,account_id:p})),{successLabel:`Created`})}};function N(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`delete <sso-connector-id>`,describe:`Deletes an SSO connector from the account.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf iam sso delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}i(await o(`Deleting`,async()=>c.iam.sso.delete({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get <sso-connector-id>`,describe:`Retrieves details for a specific SSO connector.`,builder:F,handler:async s=>{if(s.dryRun){a({command:`cf iam sso get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${s[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(s[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(s[`sso-connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.sso.get({account_id:l,sso_connector_id:s[`sso-connector-id`]})),{successLabel:`Loaded`})}};function L(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`Lists all SSO connectors configured for the account.`,builder:L,handler:async s=>{if(s.dryRun){a({command:`cf iam sso list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.sso.list({account_id:l})),{successLabel:`Loaded`})}};function z(e){return e.positional(`sso-connector-id`,{type:`string`,description:`SSO Connector identifier tag.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`SSO Connector enabled state`}).option(`use-fedramp-language`,{type:`boolean`,description:`Controls the display of FedRAMP language to the user during SSO login`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const te={command:`update <sso-connector-id>`,describe:`Updates the state or configuration of an SSO connector.`,builder:z,handler:async c=>{if(c.dryRun){a({command:`cf iam sso update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/sso_connectors/${c[`sso-connector-id`]==null?`<sso-connector-id>`:encodeURIComponent(String(c[`sso-connector-id`]))}`,pathParams:{"sso-connector-id":String(c[`sso-connector-id`]??``)},bodyKind:`json`,body:c.body===void 0?l({enabled:c.enabled,use_fedramp_language:c[`use-fedramp-language`]}):s(c.body)});return}let u=await r(c),d=c.local?e:await t();if(c.accountId=d,c.body){let e=s(c.body);i(await o(`Updating`,async()=>u.iam.sso.update({...e,account_id:d,sso_connector_id:c[`sso-connector-id`]})),{successLabel:`Updated`});return}let f=l({enabled:c.enabled,use_fedramp_language:c[`use-fedramp-language`]});i(await o(`Updating`,async()=>u.iam.sso.update({...f,account_id:d,sso_connector_id:c[`sso-connector-id`]})),{successLabel:`Updated`})}},B={command:`sso`,describe:`Configure single sign-on connectors to authenticate account members through an external identity provider`,builder:e=>e.command(A).command(M).command(P).command(I).command(R).command(te).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.option(`name`,{type:`string`,description:`Name of the User group.`}).option(`policies`,{type:`string`,description:`Policies attached to the User group. 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:`create`,describe:`Create a new user group under the specified account.`,builder:V,handler:async f=>{if(f.dryRun){a({command:`cf iam user-groups create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups`,pathParams:{},bodyKind:`json`,body:f.body===void 0?l({name:u(f.name,`name`,`text`),policies:c(f.policies,`policies`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.iam.userGroups.create({...e,account_id:m})),{successLabel:`Created`});return}f.name===void 0&&(f.name=await d(`name`,`Name of the User group.`));let h=l({name:u(f.name,`name`,`text`),policies:c(f.policies,`policies`)});i(await o(`Creating`,async()=>p.iam.userGroups.create({...h,account_id:m})),{successLabel:`Created`})}};function U(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const W={command:`delete <user-group-id>`,describe:`Remove a user group from an account.`,builder:U,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}i(await o(`Deleting`,async()=>c.iam.userGroups.delete({account_id:l,user_group_id:s[`user-group-id`]})),{successLabel:`Deleted`})}};function G(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`get <user-group-id>`,describe:`Get information about a specific user group in an account.`,builder:G,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.userGroups.get({account_id:l,user_group_id:s[`user-group-id`]})),{successLabel:`Loaded`})}};function q(e){return e.option(`id`,{type:`string`,description:`ID of the user group to be fetched.`}).option(`name`,{type:`string`,description:`Name of the user group to be fetched.`}).option(`fuzzy-name`,{type:`string`,description:`A string used for searching for user groups containing that substring.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`The sort order of returned user groups by name (ascending or descending).`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`list`,describe:`List all the user groups for an account.`,builder:p(q),handler:async s=>{let c={id:s.id,name:s.name,fuzzyName:s[`fuzzy-name`],page:s.page,per_page:s[`per-page`],direction:s.direction};if(s.dryRun){a({command:`cf iam user-groups list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.iam.userGroups.list({account_id:u,...c})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`create <user-group-id>`,describe:`Add members to a User Group.`,builder:Y,handler:async c=>{if(c.dryRun){a({command:`cf iam user-groups members create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(c[`user-group-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Creating`,async()=>l.iam.userGroups.members.create({body:e,account_id:u,user_group_id:c[`user-group-id`]})),{successLabel:`Created`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function Z(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Q={command:`delete <member-id>`,describe:`Remove a member from User Group`,builder:Z,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups members delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}/members/${s[`member-id`]==null?`<member-id>`:encodeURIComponent(String(s[`member-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``),"member-id":String(s[`member-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force,message:`Are you sure? This action cannot be undone.`})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}i(await o(`Deleting`,async()=>c.iam.userGroups.members.delete({account_id:l,user_group_id:s[`user-group-id`],member_id:s[`member-id`]})),{successLabel:`Deleted`})}};function ne(e){return e.positional(`member-id`,{type:`string`,description:`The identifier of an existing account Member.`,demandOption:!0}).option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <member-id>`,describe:`Get details of a specific member in a user group.`,builder:ne,handler:async s=>{if(s.dryRun){a({command:`cf iam user-groups members get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}/members/${s[`member-id`]==null?`<member-id>`:encodeURIComponent(String(s[`member-id`]))}`,pathParams:{"user-group-id":String(s[`user-group-id`]??``),"member-id":String(s[`member-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.iam.userGroups.members.get({account_id:l,user_group_id:s[`user-group-id`],member_id:s[`member-id`]})),{successLabel:`Loaded`})}};function ie(e){return e.option(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`fuzzy-email`,{type:`string`,description:`A string used for filtering members by partial email match.`}).option(`direction`,{type:`string`,description:`The sort order of returned user group members by email.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:`List all the members attached to a user group.`,builder:p(ie),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],fuzzyEmail:s[`fuzzy-email`],direction:s.direction};if(s.dryRun){a({command:`cf iam user-groups members list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${s[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(s[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(s[`user-group-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.iam.userGroups.members.list({account_id:u,user_group_id:s[`user-group-id`],...c})),{successLabel:`Loaded`})}};function oe(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Set/Replace members to a user group.`})}const $={command:`update <user-group-id>`,describe:`Replace the set of members attached to a User Group.`,builder:oe,handler:async c=>{if(c.dryRun){a({command:`cf iam user-groups members update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${c[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(c[`user-group-id`]))}/members`,pathParams:{"user-group-id":String(c[`user-group-id`]??``)},bodyKind:`json`,body:c.body===void 0?void 0:s(c.body)});return}let l=await r(c),u=c.local?e:await t();if(c.accountId=u,c.body){let e=s(c.body);i(await o(`Updating`,async()=>l.iam.userGroups.members.update({body:e,account_id:u,user_group_id:c[`user-group-id`]})),{successLabel:`Updated`});return}if(c.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},se={command:`members`,describe:`Operations for user-groups.members`,builder:e=>e.command(X).command(Q).command(re).command(ae).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ce(e){return e.positional(`user-group-id`,{type:`string`,description:`User Group identifier tag.`,demandOption:!0}).option(`name`,{type:`string`,description:`Name of the User group.`}).option(`policies`,{type:`string`,description:`Policies attached to the User group. 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 le={command:`update <user-group-id>`,describe:`Modify an existing user group.`,builder:ce,handler:async d=>{if(d.dryRun){a({command:`cf iam user-groups update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/iam/user_groups/${d[`user-group-id`]==null?`<user-group-id>`:encodeURIComponent(String(d[`user-group-id`]))}`,pathParams:{"user-group-id":String(d[`user-group-id`]??``)},bodyKind:`json`,body:d.body===void 0?l({name:u(d.name,`name`,`text`),policies:c(d.policies,`policies`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.iam.userGroups.update({...e,account_id:p,user_group_id:d[`user-group-id`]})),{successLabel:`Updated`});return}let m=l({name:u(d.name,`name`,`text`),policies:c(d.policies,`policies`)});i(await o(`Updating`,async()=>f.iam.userGroups.update({...m,account_id:p,user_group_id:d[`user-group-id`]})),{successLabel:`Updated`})}},ue={command:`user-groups`,describe:`Organize account members into groups for easier permission assignment`,builder:e=>e.command(H).command(W).command(K).command(J).command(le).command(se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},de={command:`iam`,describe:`Identity and access management — permission groups, resource groups, user groups, and SSO connectors`,builder:e=>e.command(_).command(O).command(B).command(ue).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{de as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{a as i,r as a}from"./auth-DY_Y2bXC.mjs";import{t as o}from"./output-BqDR9h74.mjs";import{t as s}from"./dry-run-ILZRVpnp.mjs";import{t as c}from"./progress-jYW64HY7.mjs";import{n as l,r as u,t as d}from"./body-parser-BGVbwPeM.mjs";import{n as f,t as p}from"./input-validation-1esLElok.mjs";import{a as m,i as h,n as g}from"./prompt-CyATfGUu.mjs";import{t as _}from"./cli-types-C3nVfpSG.mjs";import{n as v,t as y}from"./raw-fetch-CNKIypJ7.mjs";function ee(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const te={command:`cloudflareImagesBaseImage <image-id>`,describe:`Download an image from CF Images. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original.`,builder:ee,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesBaseImage`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}/blob`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i;let o=await c(`Loading`,async()=>y(`/accounts/${i}/images/v1/${encodeURIComponent(String(r[`image-id`]))}/blob`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));v(r.text===!0?o.toString(`utf-8`):o)}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes. Maximum: Now + 6 hours.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can be used for keeping references to another system of record, for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token to be accessed.`})}const x={command:`cloudflareImagesCreateAuthenticatedDirectUploadUrlV2`,describe:"Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the `draft: true` property is not present.",builder:b,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesCreateAuthenticatedDirectUploadUrlV2`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,creator:r.creator,expiry:r.expiry,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`]}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.creator!==void 0||r.expiry!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0){let e=new FormData;if(r.file){let t=p(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.creator!==void 0&&e.append(`creator`,String(f(r.creator,`creator`,`text`)??``)),r.expiry!==void 0&&e.append(`expiry`,String(f(r.expiry,`expiry`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(f(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?f(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=f(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v2/direct_upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.cloudflareImagesCreateAuthenticatedDirectUploadUrlV2({account_id:u})),{successLabel:`Created`})}};function S(e){return e.positional(`image-id`,{type:`string`,description:`Image unique 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 C={command:`cloudflareImagesDeleteImage <image-id>`,describe:`Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from cache.`,builder:S,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesDeleteImage`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force,message:`This operation will delete this image.`})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}o(await c(`Deleting`,async()=>i.images.cloudflareImagesDeleteImage({account_id:l,image_id:r[`image-id`]})),{successLabel:`Deleted`})}};function w(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`cloudflareImagesImageDetails <image-id>`,describe:`Fetch details for a CF Images image.`,builder:w,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesImageDetails`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.cloudflareImagesImageDetails({account_id:l,image_id:r[`image-id`]})),{successLabel:`Loaded`})}};function E(e){return e.option(`continuation-token`,{type:`string`,description:`Continuation token to fetch next page. Passed as a query param when requesting List V2 api endpoint.`}).option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const D={command:`cloudflareImagesListImagesV2`,describe:"List up to 10000 images from CF Images, with up to 1000 results per page. Use the optional parameters below to get a specific range of images. Pagination is supported via continuation_token. **Metadata Filtering (Optional):** You can optionally filter images by custom metadata fields using the `meta.<field>[<operator>]=<value>` syntax. **Supported Operators:** - `eq` / `eq:string` / `eq:number` / `eq:boolean` - Exact match - `gt` / `gt:number` - Greater than (number only) - `gte` / `gte:number` - Greater than or equal (number only) - `lt` / `lt:number` - Less than (number only) - `lte` / `lte:number` - Less than or equal (number only) - `in` / `in:string` / `in:number` - Match any value in list (pipe-separated) **Metadata Filter Constraints:** - Maximum 5 metadata filters per request - Maximum 5 levels of nesting (e.g., `meta.first.second.third.fourth.fifth`) - Maximum 10 elements for list operators (`in`) - Supports string, number, and boolean value types - Range operators (`gt`, `gte`, `lt`, `lte`) only accept numeric values **Filter Consistency:** Filters are combined with AND logic. The system does not validate whether filter combinations are logically consistent. For example, `meta.priority[eq:number]=5&meta.priority[lte:number]=3` will return zero results because no value can satisfy both conditions simultaneously. It is the caller's responsibility to ensure filter combinations make sense. **Examples:** ``` # List all images /images/v2 # Filter by metadata [eq] /images/v2?meta.status[eq:string]=active # Filter by metadata [in] /images/v2?meta.status[in]=pending|deleted|flagged # Filter by metadata [in:number] /images/v2?meta.ratings[in:number]=4|5 # Filter by metadata range [gte:number] /images/v2?meta.priority[gte:number]=1 # Filter by bounded range /images/v2?meta.priority[gte:number]=1&meta.priority[lte:number]=5 # Filter by nested metadata /images/v2?meta.region.name[eq]=eu-west # Combine metadata filters with creator /images/v2?meta.status[eq]=active&creator=user123 # Multiple metadata filters (AND logic) /images/v2?meta.status[eq]=active&meta.priority[eq:number]=5 ```",builder:_(E),handler:async r=>{let i={continuation_token:r[`continuation-token`],per_page:r[`per-page`],sort_order:r[`sort-order`],creator:r.creator};if(r.dryRun){s({command:`cf images cloudflareImagesListImagesV2`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.cloudflareImagesListImagesV2({account_id:u,...i})),{successLabel:`Loaded`})}};function O(e){return e.positional(`image-id`,{type:`string`,description:`Image unique identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`require-signed-urls`,{type:`boolean`,description:"Indicates whether the image can be accessed using only its UID. If set to `true`, a signed token needs to be generated with a signing key to view the image. Returns a new UID on a change. No change if not specified."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const k={command:`cloudflareImagesUpdateImage <image-id>`,describe:`Update a CF Images image's metadata, creator, or access control. On access control change, all copies of the image are purged from cache.`,builder:O,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesUpdateImage`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({creator:f(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.images.cloudflareImagesUpdateImage({...e,account_id:u,image_id:r[`image-id`]})),{successLabel:`Updated`});return}let p=d({creator:f(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]});o(await c(`Updating`,async()=>i.images.cloudflareImagesUpdateImage({...p,account_id:u,image_id:r[`image-id`]})),{successLabel:`Updated`})}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`An optional custom unique identifier for your image.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const j={command:`cloudflareImagesUploadAnImageViaUrl`,describe:`Upload an image to CF Images. Images up to 10 Megabytes can be uploaded using a single HTTP POST (multipart/form-data) request by sending an image file or passing a URL accessible to the API.`,builder:A,handler:async r=>{if(r.dryRun){s({command:`cf images cloudflareImagesUploadAnImageViaUrl`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,creator:r.creator,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`],url:r.url}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.creator!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0||r.url!==void 0){let e=new FormData;if(r.file){let t=p(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.creator!==void 0&&e.append(`creator`,String(f(r.creator,`creator`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(f(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?f(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),r.url!==void 0&&e.append(`url`,String(f(r.url,`url`,`text`)??``)),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v1`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=f(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/images/v1`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.cloudflareImagesUploadAnImageViaUrl({account_id:u})),{successLabel:`Created`})}};function M(e){return e.positional(`image-id`,{type:`string`,description:`Image 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 N={command:`deleteImageDelete <imageId>`,describe:`Delete an image.`,builder:M,handler:async r=>{if(r.dryRun){s({command:`cf images deleteImageDelete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}o(await c(`Deleting`,async()=>i.images.deleteImageDelete({accountId:l,imageId:r[`image-id`]})),{successLabel:`Deleted`})}};function P(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get`,describe:`Get the current transformation flows configuration for a zone.`,builder:P,handler:async i=>{if(i.dryRun){s({command:`cf images flows get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zones/${i.zone??i.zoneId??`<zone>`}/v1/images/flows`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``)},bodyKind:`none`});return}let l=await a(i),u=i.local?e:await t();i.accountId=u;let d=await r({zone:i.zone},l,{quiet:i.quiet});i.zoneId=d,o(await c(`Loading`,async()=>l.images.flows.get({accountId:u,zoneId:d})),{successLabel:`Loaded`})}};function I(e){return e.option(`etag`,{type:`string`,description:`The etag field`}).option(`flows`,{type:`string`,description:`The flows field. Provide as a JSON array of objects or @path/to/file.json.`}).option(`version`,{type:`number`,description:`The version 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 L={command:`update`,describe:`Replace the entire transformation flows configuration for a zone.`,builder:I,handler:async i=>{if(i.dryRun){s({command:`cf images flows update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/zones/${i.zone??i.zoneId??`<zone>`}/v1/images/flows`,pathParams:{"zone-id":String(i.zone??i[`zone-id`]??``)},bodyKind:`json`,body:i.body===void 0?d({etag:f(i.etag,`etag`,`text`),flows:u(i.flows,`flows`),version:i.version}):l(i.body)});return}let p=await a(i),m=i.local?e:await t();i.accountId=m;let h=await r({zone:i.zone},p,{quiet:i.quiet});if(i.zoneId=h,i.body){let e=l(i.body);o(await c(`Updating`,async()=>p.images.flows.update({...e,accountId:m,zoneId:h})),{successLabel:`Updated`});return}if(i.flows===void 0)throw Error(`--flows is required (or pass --body with this field set).`);if(i.version===void 0)throw Error(`--version is required (or pass --body with this field set).`);let g=d({etag:f(i.etag,`etag`,`text`),flows:u(i.flows,`flows`),version:i.version});o(await c(`Updating`,async()=>p.images.flows.update({...g,accountId:m,zoneId:h})),{successLabel:`Updated`})}},R={command:`flows`,describe:`Zone-level transformation flows that control how images are resized and optimized on delivery`,builder:e=>e.command(F).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function z(e){return e.option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`continuation-token`,{type:`string`,description:`Continuation token for a next page. List images V2 returns continuation_token`}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string will return images where creator field is not set`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`getAccountsAccountIdV2Images`,describe:`List images for an account.`,builder:_(z),handler:async r=>{let i={per_page:r[`per-page`],continuation_token:r[`continuation-token`],creator:r.creator,sort_order:r[`sort-order`]};if(r.dryRun){s({command:`cf images getAccountsAccountIdV2Images`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v2/images`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.getAccountsAccountIdV2Images({accountId:u,...i})),{successLabel:`Loaded`})}};function V(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`getImageGet <imageId>`,describe:`Get image metadata.`,builder:V,handler:async r=>{if(r.dryRun){s({command:`cf images getImageGet`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.getImageGet({accountId:l,imageId:r[`image-id`]})),{successLabel:`Loaded`})}};function U(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const W={command:`getImageGetBlob <imageId>`,describe:`Get image as a blob.`,builder:U,handler:async r=>{if(r.dryRun){s({command:`cf images getImageGetBlob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}/blob`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i;let o=await c(`Loading`,async()=>y(`/accounts/${i}/v1/images/${encodeURIComponent(String(r[`image-id`]))}/blob`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));v(r.text===!0?o.toString(`utf-8`):o)}};function G(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`create <signing-key-name>`,describe:`Create a new CF Images signing key with specified name. Returns all keys available.`,builder:G,handler:async r=>{if(r.dryRun){s({command:`cf images keys create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/keys/${r[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(r[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(r[`signing-key-name`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.images.keys.create({account_id:l,signing_key_name:r[`signing-key-name`]})),{successLabel:`Updated`})}};function q(e){return e.positional(`signing-key-name`,{type:`string`,description:`Signing key name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const J={command:`delete <signing-key-name>`,describe:`Delete a CF Images signing key with specified name. Returns all keys available. When the last key is removed, a new default signing key will be generated.`,builder:q,handler:async r=>{if(r.dryRun){s({command:`cf images keys delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/keys/${r[`signing-key-name`]==null?`<signing-key-name>`:encodeURIComponent(String(r[`signing-key-name`]))}`,pathParams:{"signing-key-name":String(r[`signing-key-name`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force,message:`This operation will delete this signing key. This will invalidate any URLs that are signed with this key.`})){process.stderr.write(`Aborted.
|
|
5
|
+
`);return}o(await c(`Deleting`,async()=>i.images.keys.delete({account_id:l,signing_key_name:r[`signing-key-name`]})),{successLabel:`Deleted`})}};function Y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`list`,describe:`List your CF Images signing keys.`,builder:Y,handler:async r=>{if(r.dryRun){s({command:`cf images keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/keys`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.keys.list({account_id:l})),{successLabel:`Loaded`})}},Z={command:`keys`,describe:`Manage signing keys for generating private image URLs`,builder:e=>e.command(K).command(J).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Q(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,demandOption:!0}).option(`creator`,{type:`string`,description:`Image creator`}).option(`require-signed-urls`,{type:`boolean`,description:`Required signed url`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ne={command:`patchImageEdit <imageId>`,describe:`Update an image's metadata.`,builder:Q,handler:async r=>{if(r.dryRun){s({command:`cf images patchImageEdit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({creator:f(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.images.patchImageEdit({...e,accountId:u,imageId:r[`image-id`]})),{successLabel:`Updated`});return}let p=d({creator:f(r.creator,`creator`,`text`),requireSignedURLs:r[`require-signed-urls`]});o(await c(`Updating`,async()=>i.images.patchImageEdit({...p,accountId:u,imageId:r[`image-id`]})),{successLabel:`Updated`})}};function re(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`expiry`,{type:`string`,description:`The date after which the upload will not be accepted. Minimum: Now + 2 minutes.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`})}const ie={command:`postDirectUploadLink`,describe:`Create an authenticated direct upload URL for an image.`,builder:re,handler:async r=>{if(r.dryRun){s({command:`cf images postDirectUploadLink`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v2/images/direct_upload`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,expiry:r.expiry,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`]}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.expiry!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0){let e=new FormData;if(r.file){let t=p(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.expiry!==void 0&&e.append(`expiry`,String(f(r.expiry,`expiry`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(f(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?f(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v2/images/direct_upload`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=f(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v2/images/direct_upload`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.postDirectUploadLink({accountId:u})),{successLabel:`Created`})}};function ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`creator`,{type:`string`,description:`Can set the creator field with an internal user ID.`}).option(`id`,{type:`string`,description:`Optional Image Custom ID. Up to 1024 chars. Can include any number of subpaths, and utf8 characters. Cannot start nor end with a / (forward slash). Cannot be a UUID.`}).option(`metadata`,{type:`string`,description:`User modifiable key-value store. Can use used for keeping references to another system of record for managing images.`}).option(`require-signed-urls`,{type:`boolean`,description:`Indicates whether the image requires a signature token for the access.`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const oe={command:`postImageUpload`,describe:`Upload a new image.`,builder:ae,handler:async r=>{if(r.dryRun){s({command:`cf images postImageUpload`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images`,pathParams:{},bodyKind:`multipart`,body:{body:r.body,file:r.file,creator:r.creator,id:r.id,metadata:r.metadata,"require-signed-urls":r[`require-signed-urls`],url:r.url}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.creator!==void 0||r.id!==void 0||r.metadata!==void 0||r[`require-signed-urls`]!==void 0||r.url!==void 0){let e=new FormData;if(r.file){let t=p(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.creator!==void 0&&e.append(`creator`,String(f(r.creator,`creator`,`text`)??``)),r.id!==void 0&&e.append(`id`,String(f(r.id,`id`,`text`)??``)),r.metadata!==void 0){let t=typeof r.metadata==`string`?f(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}r[`require-signed-urls`]!==void 0&&e.append(`requireSignedURLs`,String(r[`require-signed-urls`])),r.url!==void 0&&e.append(`url`,String(f(r.url,`url`,`text`)??``)),o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v1/images`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=f(r.body,`body`,`binary`);o(await c(`Creating`,async()=>i(l,`POST`,`/accounts/${u}/v1/images`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}o(await c(`Creating`,async()=>l.images.postImageUpload({accountId:u})),{successLabel:`Created`})}};function se(e){return e.option(`conflict-behaviour`,{type:`string`,description:`How to handle objects that already exist at the destination.`,choices:[`skip`,`overwrite`],default:`skip`}).option(`excluded-content-types`,{type:`string`,array:!0,description:`Content types to skip during migration.`}).option(`path-prefix`,{type:`string`,description:`Prefix to prepend to image custom IDs.`}).option(`root-directory`,{type:`string`,description:`Only import objects under this prefix in the source bucket.`}).option(`source-id`,{type:`string`,description:`The identifier of the source to migrate from.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`create`,describe:`Create a new migration from an existing source. The migration will import objects from the source bucket into Cloudflare Images.`,builder:se,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({conflictBehaviour:f(r[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:r[`excluded-content-types`],pathPrefix:f(r[`path-prefix`],`path-prefix`,`text`),rootDirectory:f(r[`root-directory`],`root-directory`,`text`),sourceId:f(r[`source-id`],`source-id`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.images.sourcingKit.migrations.create({...e,account_id:u})),{successLabel:`Created`});return}r[`source-id`]===void 0&&(r[`source-id`]=await m(`source-id`,`The identifier of the source to migrate from.`));let p=d({conflictBehaviour:f(r[`conflict-behaviour`],`conflict-behaviour`,`text`),excludedContentTypes:r[`excluded-content-types`],pathPrefix:f(r[`path-prefix`],`path-prefix`,`text`),rootDirectory:f(r[`root-directory`],`root-directory`,`text`),sourceId:f(r[`source-id`],`source-id`,`text`)});o(await c(`Creating`,async()=>i.images.sourcingKit.migrations.create({...p,account_id:u})),{successLabel:`Created`})}};function le(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource 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 ue={command:`delete <migration-id>`,describe:`Delete an existing migration. Only completed, errored, or aborted migrations can be deleted.`,builder:le,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
6
|
+
`);return}o(await c(`Deleting`,async()=>i.images.sourcingKit.migrations.delete({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Deleted`})}};function de(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`get <migration-id>`,describe:`Fetch details for a single migration.`,builder:de,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.sourcingKit.migrations.get({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Loaded`})}};function pe(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`abort <migration-id>`,describe:`Abort a running migration. Objects already imported will not be removed.`,builder:pe,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations lifecycle abort`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}/lifecycle/abort`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.images.sourcingKit.migrations.lifecycle.abort({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Updated`})}};function he(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`get <migration-id>`,describe:`Get the current progress of a migration including counts of scanned, imported, skipped, and errored objects.`,builder:he,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations lifecycle get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}/lifecycle`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.sourcingKit.migrations.lifecycle.get({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Loaded`})}};function _e(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`logs <migration-id>`,describe:`List log entries for a specific migration.`,builder:_e,handler:async r=>{let i={offset:r.offset,limit:r.limit};if(r.dryRun){s({command:`cf images sourcing-kit migrations lifecycle logs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}/logs`,pathParams:{"migration-id":String(r[`migration-id`]??``)},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.sourcingKit.migrations.lifecycle.logs({account_id:u,migration_id:r[`migration-id`],...i})),{successLabel:`Loaded`})}};function ye(e){return e.positional(`migration-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`start <migration-id>`,describe:`Start a pending migration. The migration will begin importing objects from the configured source.`,builder:ye,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit migrations lifecycle start`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations/${r[`migration-id`]==null?`<migration-id>`:encodeURIComponent(String(r[`migration-id`]))}/lifecycle/start`,pathParams:{"migration-id":String(r[`migration-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Updating`,async()=>i.images.sourcingKit.migrations.lifecycle.start({account_id:l,migration_id:r[`migration-id`]})),{successLabel:`Updated`})}},xe={command:`lifecycle`,describe:`Operations for sourcing-kit.migrations.lifecycle`,builder:e=>e.command(me).command(ge).command(ve).command(be).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Se(e){return e.option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ce={command:`list`,describe:`List all migrations for the account.`,builder:Se,handler:async r=>{let i={offset:r.offset,limit:r.limit};if(r.dryRun){s({command:`cf images sourcing-kit migrations list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/migrations`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.sourcingKit.migrations.list({account_id:u,...i})),{successLabel:`Loaded`})}},we={command:`migrations`,describe:`Operations for sourcing-kit.migrations`,builder:e=>e.command(ce).command(ue).command(fe).command(Ce).command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Te(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ee={command:`connectivity <source-id>`,describe:`Check the current connectivity status of an existing migration source.`,builder:Te,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources connectivity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/${r[`source-id`]==null?`<source-id>`:encodeURIComponent(String(r[`source-id`]))}/connectivity`,pathParams:{"source-id":String(r[`source-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.sourcingKit.sources.connectivity({account_id:l,source_id:r[`source-id`]})),{successLabel:`Loaded`})}};function De(e){return e.option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`name`,{type:`string`,description:`A human-readable name for the source.`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).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 Oe={command:`create`,describe:`Create a new migration source by providing storage credentials. The service will verify connectivity to the bucket before accepting the source.`,builder:De,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({account:f(r.account,`account`,`text`),bucket:f(r.bucket,`bucket`,`text`),name:f(r.name,`name`,`text`),vendor:f(r.vendor,`vendor`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.images.sourcingKit.sources.create({...e,account_id:u})),{successLabel:`Created`});return}r.bucket===void 0&&(r.bucket=await m(`bucket`,`The name of the storage bucket.`)),r.name===void 0&&(r.name=await m(`name`,`A human-readable name for the source.`)),r.vendor===void 0&&(r.vendor=await h(`vendor`,`The cloud storage vendor of the source bucket.`,[`s3`,`r2`]));let p=d({account:f(r.account,`account`,`text`),bucket:f(r.bucket,`bucket`,`text`),name:f(r.name,`name`,`text`),vendor:f(r.vendor,`vendor`,`text`)});o(await c(`Creating`,async()=>i.images.sourcingKit.sources.create({...p,account_id:u})),{successLabel:`Created`})}};function ke(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource 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 Ae={command:`delete <source-id>`,describe:`Delete an existing migration source. Sources with active migrations cannot be deleted.`,builder:ke,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/${r[`source-id`]==null?`<source-id>`:encodeURIComponent(String(r[`source-id`]))}`,pathParams:{"source-id":String(r[`source-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force})){process.stderr.write(`Aborted.
|
|
7
|
+
`);return}o(await c(`Deleting`,async()=>i.images.sourcingKit.sources.delete({account_id:l,source_id:r[`source-id`]})),{successLabel:`Deleted`})}};function je(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Me={command:`get <source-id>`,describe:`Fetch details for a single migration source.`,builder:je,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/${r[`source-id`]==null?`<source-id>`:encodeURIComponent(String(r[`source-id`]))}`,pathParams:{"source-id":String(r[`source-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.sourcingKit.sources.get({account_id:l,source_id:r[`source-id`]})),{successLabel:`Loaded`})}};function Ne(e){return e.option(`offset`,{type:`number`,description:`Number of items to skip before returning results.`}).option(`limit`,{type:`number`,description:`Maximum number of items to return.`}).option(`name`,{type:`string`,description:`Filter sources by name (partial match).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Pe={command:`list`,describe:`List all configured migration sources for the account.`,builder:Ne,handler:async r=>{let i={offset:r.offset,limit:r.limit,name:r.name};if(r.dryRun){s({command:`cf images sourcing-kit sources list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.sourcingKit.sources.list({account_id:u,...i})),{successLabel:`Loaded`})}};function Fe(e){return e.option(`account`,{type:`string`,description:`Account identifier for the bucket (required for R2 vendor).`}).option(`bucket`,{type:`string`,description:`The name of the storage bucket.`}).option(`region`,{type:`string`,description:`The region hint for the bucket (S3 only).`}).option(`vendor`,{type:`string`,description:`The cloud storage vendor of the source bucket.`,choices:[`s3`,`r2`]}).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 Ie={command:`pre-check`,describe:`Verify connectivity to a storage bucket before creating a source. Returns connectivity status without persisting any state.`,builder:Fe,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources pre-check`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/connectivity-precheck`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({account:f(r.account,`account`,`text`),bucket:f(r.bucket,`bucket`,`text`),region:f(r.region,`region`,`text`),vendor:f(r.vendor,`vendor`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.images.sourcingKit.sources.preCheck({...e,account_id:u})),{successLabel:`Created`});return}r.bucket===void 0&&(r.bucket=await m(`bucket`,`The name of the storage bucket.`)),r.vendor===void 0&&(r.vendor=await h(`vendor`,`The cloud storage vendor of the source bucket.`,[`s3`,`r2`]));let p=d({account:f(r.account,`account`,`text`),bucket:f(r.bucket,`bucket`,`text`),region:f(r.region,`region`,`text`),vendor:f(r.vendor,`vendor`,`text`)});o(await c(`Creating`,async()=>i.images.sourcingKit.sources.preCheck({...p,account_id:u})),{successLabel:`Created`})}};function Le(e){return e.positional(`source-id`,{type:`string`,description:`Sourcing kit resource identifier.`,demandOption:!0}).option(`name`,{type:`string`,description:`Updated name for the source.`}).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 Re={command:`update <source-id>`,describe:`Update the name of an existing migration source.`,builder:Le,handler:async r=>{if(r.dryRun){s({command:`cf images sourcing-kit sources update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v2/sourcingkit/sources/${r[`source-id`]==null?`<source-id>`:encodeURIComponent(String(r[`source-id`]))}`,pathParams:{"source-id":String(r[`source-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({name:f(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.images.sourcingKit.sources.update({...e,account_id:u,source_id:r[`source-id`]})),{successLabel:`Updated`});return}r.name===void 0&&(r.name=await m(`name`,`Updated name for the source.`));let p=d({name:f(r.name,`name`,`text`)});o(await c(`Updating`,async()=>i.images.sourcingKit.sources.update({...p,account_id:u,source_id:r[`source-id`]})),{successLabel:`Updated`})}},ze={command:`sources`,describe:`Operations for sourcing-kit.sources`,builder:e=>e.command(Ee).command(Oe).command(Ae).command(Me).command(Pe).command(Ie).command(Re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Be={command:`sourcing-kit`,describe:`Operations for sourcing-kit`,builder:e=>e.command(we).command(ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const He={command:`stats`,describe:`Fetch image statistics details for Cloudflare Images. The returned statistics detail storage usage, including the current image count vs this account's allowance.`,builder:Ve,handler:async r=>{if(r.dryRun){s({command:`cf images stats`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/stats`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.stats({account_id:l})),{successLabel:`Loaded`})}};function Ue(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of items per page.`}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string "" will return images where creator field is not set`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const We={command:`cloudflareImagesListImages`,describe:`List up to 100 images with one request. Use the optional parameters below to get a specific range of images.`,builder:Ue,handler:async r=>{let i={page:r.page,per_page:r[`per-page`],creator:r.creator};if(r.dryRun){s({command:`cf images v1 cloudflareImagesListImages`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.v1.cloudflareImagesListImages({account_id:u,...i})),{successLabel:`Loaded`})}};function Ge(e){return e.positional(`image-id`,{type:`string`,description:`Image identifier.`,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`}).option(`url`,{type:`string`,description:`A URL to fetch an image from origin. Only needed when type is uploading from a URL.`})}const Ke={command:`upload <imageId>`,describe:`Upload an image to a specific image ID.`,builder:Ge,handler:async r=>{if(r.dryRun){s({command:`cf images v1 direct-uploads upload`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images/${r[`image-id`]==null?`<image-id>`:encodeURIComponent(String(r[`image-id`]))}`,pathParams:{"image-id":String(r[`image-id`]??``)},bodyKind:`multipart`,body:{body:r.body,file:r.file,url:r.url}});return}let l=await a(r),u=r.local?e:await t();if(r.accountId=u,r.file!==void 0||r.body!==void 0||r.url!==void 0){let e=new FormData;if(r.file){let t=p(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);r.url!==void 0&&e.append(`url`,String(f(r.url,`url`,`text`)??``)),o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/v1/images/${encodeURIComponent(String(r[`image-id`]))}`,{body:e})),{successLabel:`Updated`});return}if(r.body){let e=f(r.body,`body`,`binary`);o(await c(`Updating`,async()=>i(l,`PUT`,`/accounts/${u}/v1/images/${encodeURIComponent(String(r[`image-id`]))}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}o(await c(`Updating`,async()=>l.images.v1.directUploads.upload({accountId:u,imageId:r[`image-id`]})),{successLabel:`Updated`})}},qe={command:`direct-uploads`,describe:`Operations for v1.direct-uploads`,builder:e=>e.command(Ke).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Je(e){return e.option(`per-page`,{type:`number`,description:`Number of items per page`}).option(`continuation-token`,{type:`string`,description:`Continuation token for a next page. List images V2 returns continuation_token`}).option(`creator`,{type:`string`,description:`Internal user ID set within the creator field. Setting to empty string will return images where creator field is not set`}).option(`sort-order`,{type:`string`,description:`Sorting order by upload time`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const $={command:`getImageList`,describe:`List images for an account.`,builder:_(Je),handler:async r=>{let i={per_page:r[`per-page`],continuation_token:r[`continuation-token`],creator:r.creator,sort_order:r[`sort-order`]};if(r.dryRun){s({command:`cf images v1 getImageList`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/v1/images`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.images.v1.getImageList({accountId:u,...i})),{successLabel:`Loaded`})}};function Ye(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Xe={command:`get <variant-id>`,describe:`Fetch details for a single variant with properties at the top level of the result.`,builder:Ye,handler:async r=>{if(r.dryRun){s({command:`cf images v1 variants-flat get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants/${r[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(r[`variant-id`]))}/flat`,pathParams:{"variant-id":String(r[`variant-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.v1.variantsFlat.get({account_id:l,variant_id:r[`variant-id`]})),{successLabel:`Loaded`})}},Ze={command:`variants-flat`,describe:`Operations for v1.variants-flat`,builder:e=>e.command(Xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Qe={command:`v1`,describe:`Operations for v1`,builder:e=>e.command(We).command($).command(qe).command(Ze).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $e(e){return e.option(`id`,{type:`string`,description:`The id field`}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`,default:!1}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).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 et={command:`create`,describe:`Create a CF Images variant that allows you to resize images for different use cases.`,builder:$e,handler:async r=>{if(r.dryRun){s({command:`cf images variants create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`json`,body:r.body===void 0?d({id:f(r.id,`id`,`text`),neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:f(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:f(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.images.variants.create({body:e,account_id:u})),{successLabel:`Created`});return}if(r.id===void 0&&(r.id=await m(`id`,`The id field`)),r[`options-fit`]===void 0&&(r[`options-fit`]=await h(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),r[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(r[`options-metadata`]===void 0&&(r[`options-metadata`]=await h(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),r[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let p=d({id:f(r.id,`id`,`text`),neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:f(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:f(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}});o(await c(`Creating`,async()=>i.images.variants.create({body:p,account_id:u})),{successLabel:`Created`})}};function tt(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const nt={command:`delete <variant-id>`,describe:`Delete a CF Images variant. This will purge the cache for all images associated with the variant.`,builder:tt,handler:async r=>{if(r.dryRun){s({command:`cf images variants delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants/${r[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(r[`variant-id`]))}`,pathParams:{"variant-id":String(r[`variant-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();if(r.accountId=l,!await g({force:!!r.force,message:`This operation will delete this variant.`})){process.stderr.write(`Aborted.
|
|
8
|
+
`);return}o(await c(`Deleting`,async()=>i.images.variants.delete({account_id:l,variant_id:r[`variant-id`]})),{successLabel:`Deleted`})}};function rt(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`never-require-signed-urls`,{type:`boolean`,description:`Indicates whether the variant can access an image without a signature, regardless of image access control.`}).option(`options-fit`,{type:`string`,description:`The fit property describes how the width and height dimensions should be interpreted.`,choices:[`scale-down`,`contain`,`cover`,`crop`,`pad`]}).option(`options-height`,{type:`number`,description:`Maximum height in image pixels.`}).option(`options-metadata`,{type:`string`,description:`What EXIF data should be preserved in the output image.`,choices:[`keep`,`copyright`,`none`]}).option(`options-width`,{type:`number`,description:`Maximum width in image pixels.`}).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 it={command:`edit <variant-id>`,describe:`Update a CF Images variant. This will purge the cache for all images associated with the variant.`,builder:rt,handler:async r=>{if(r.dryRun){s({command:`cf images variants edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants/${r[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(r[`variant-id`]))}`,pathParams:{"variant-id":String(r[`variant-id`]??``)},bodyKind:`json`,body:r.body===void 0?d({neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:f(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:f(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}}):l(r.body)});return}let i=await a(r),u=r.local?e:await t();if(r.accountId=u,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.images.variants.edit({...e,account_id:u,variant_id:r[`variant-id`]})),{successLabel:`Updated`});return}if(r[`options-fit`]===void 0&&(r[`options-fit`]=await h(`options-fit`,`The fit property describes how the width and height dimensions should be interpreted.`,[`scale-down`,`contain`,`cover`,`crop`,`pad`])),r[`options-height`]===void 0)throw Error(`--options-height is required (or pass --body with this field set).`);if(r[`options-metadata`]===void 0&&(r[`options-metadata`]=await h(`options-metadata`,`What EXIF data should be preserved in the output image.`,[`keep`,`copyright`,`none`])),r[`options-width`]===void 0)throw Error(`--options-width is required (or pass --body with this field set).`);let p=d({neverRequireSignedURLs:r[`never-require-signed-urls`],options:{fit:f(r[`options-fit`],`options-fit`,`text`),height:r[`options-height`],metadata:f(r[`options-metadata`],`options-metadata`,`text`),width:r[`options-width`]}});o(await c(`Updating`,async()=>i.images.variants.edit({...p,account_id:u,variant_id:r[`variant-id`]})),{successLabel:`Updated`})}};function at(e){return e.positional(`variant-id`,{type:`string`,description:`Variant ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ot={command:`get <variant-id>`,describe:`Fetch details for a CF Images variant.`,builder:at,handler:async r=>{if(r.dryRun){s({command:`cf images variants get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants/${r[`variant-id`]==null?`<variant-id>`:encodeURIComponent(String(r[`variant-id`]))}`,pathParams:{"variant-id":String(r[`variant-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.variants.get({account_id:l,variant_id:r[`variant-id`]})),{successLabel:`Loaded`})}};function st(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ct={command:`list`,describe:`List existing CF Images variants.`,builder:st,handler:async r=>{if(r.dryRun){s({command:`cf images variants list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/images/v1/variants`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.images.variants.list({account_id:l})),{successLabel:`Loaded`})}},lt={command:`variants`,describe:`Manage named resize variants for transforming images on delivery`,builder:e=>e.command(et).command(nt).command(it).command(ot).command(ct).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ut={command:`images`,describe:`Store, resize, and deliver optimized images globally — variants, signing keys, and direct uploads`,builder:e=>e.command(te).command(x).command(C).command(T).command(D).command(k).command(j).command(N).command(B).command(H).command(W).command(ne).command(ie).command(oe).command(He).command(R).command(Z).command(Be).command(Qe).command(lt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ut as default};
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,n as t,r as n,t as r}from"./src-
|
|
2
|
+
import{i as e,n as t,r as n,t as r}from"./src-CEb2fgtT.mjs";export{r as CliExit,t as buildCli,n as main,e as runMain};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r}from"./oauth-B0ETkNcX.mjs";import{a as i,r as a}from"./auth-MQEamPN9.mjs";import{t as o}from"./output-DrpYYfnB.mjs";import{n as s,t as c}from"./progress-CsHIt3Tp.mjs";import{n as l,t as u}from"./body-parser-C-c9gfH1.mjs";import{n as d,t as f}from"./input-validation-Bav2M9F-.mjs";import{a as p,n as m}from"./prompt-DdegNPpg.mjs";import{t as h}from"./cli-types-BsTty22w.mjs";import{n as ee,t as te}from"./raw-fetch-CteyTOM2.mjs";function g(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <asn>`,describe:`Gets an overview of the Autonomous System Number (ASN) and a list of subnets for it.`,builder:g,handler:async r=>{if(r.dryRun){s({command:`cf intel asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/asn/${r.asn==null?`<asn>`:encodeURIComponent(String(r.asn))}`,pathParams:{asn:String(r.asn??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.asn.get({account_id:l,asn:r.asn})),{successLabel:`Loaded`})}};function v(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <asn>`,describe:`Get ASN Subnets.`,builder:v,handler:async r=>{if(r.dryRun){s({command:`cf intel asn subnets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/asn/${r.asn==null?`<asn>`:encodeURIComponent(String(r.asn))}/subnets`,pathParams:{asn:String(r.asn??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.asn.subnets.get({account_id:l,asn:r.asn})),{successLabel:`Loaded`})}},b={command:`subnets`,describe:`Operations for asn.subnets`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},x={command:`asn`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(_).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Lists all available issue types in Security Center, describing categories of security issues.`,builder:S,handler:async r=>{if(r.dryRun){s({command:`cf intel attack-surface-report issue-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issue-types`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.attackSurfaceReport.issueTypes.get({account_id:l})),{successLabel:`Loaded`})}},w={command:`issue-types`,describe:`Operations for attack-surface-report.issue-types`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`class`,describe:`Retrieves Security Center issue counts aggregated by classification class.`,builder:h(T),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/class`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.attackSurfaceReport.issues.class({account_id:u,...i})),{successLabel:`Loaded`})}};function D(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss 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 O={command:`dismiss <issue-id>`,describe:`Deprecated endpoint for archiving Security Center insights. Use the newer archive-security-center-insight endpoint instead.`,builder:D,handler:async r=>{if(r.dryRun){s({command:`cf intel attack-surface-report issues dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/${r[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(r[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(r[`issue-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({dismiss:r.dismiss}):l(r.body)});return}let i=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.intel.attackSurfaceReport.issues.dismiss({...e,account_id:d,issue_id:r[`issue-id`]})),{successLabel:`Updated`});return}let f=u({dismiss:r.dismiss});o(await c(`Updating`,async()=>i.intel.attackSurfaceReport.issues.dismiss({...f,account_id:d,issue_id:r[`issue-id`]})),{successLabel:`Updated`})}};function k(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all Security Center issues for the account, showing active security problems requiring attention.`,builder:h(k),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf intel attack-surface-report issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.attackSurfaceReport.issues.list({account_id:u,...i})),{successLabel:`Loaded`})}};function j(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`severity`,describe:`Retrieves Security Center issue counts aggregated by severity level.`,builder:h(j),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/severity`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.attackSurfaceReport.issues.severity({account_id:u,...i})),{successLabel:`Loaded`})}};function N(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`type`,describe:`Retrieves Security Center issue counts aggregated by issue type.`,builder:h(N),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/type`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.attackSurfaceReport.issues.type({account_id:u,...i})),{successLabel:`Loaded`})}},F={command:`issues`,describe:`Operations for attack-surface-report.issues`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`attack-surface-report`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(w).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`start-end-params`,{type:`string`,description:`Start end params`}).option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`page`,{type:`number`,description:`Requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results requested.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`Gets a list of all the domains that have resolved to a specific IP address.`,builder:h(L),handler:async r=>{let i={start_end_params:r[`start-end-params`],ipv4:r.ipv4,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf intel dns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/dns`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.dns.list({account_id:u,...i})),{successLabel:`Loaded`})}},z={command:`dns`,describe:`Passive DNS data showing historical DNS resolution records for domains`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get`,describe:`Gets historical security threat and content categories currently and previously assigned to a domain.`,builder:B,handler:async r=>{let i={domain:r.domain};if(r.dryRun){s({command:`cf intel domain-history get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain-history`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.domainHistory.get({account_id:u,...i})),{successLabel:`Loaded`})}},H={command:`domain-history`,describe:`Historical domain registration and categorization changes over time`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`domain`,{type:`string`,description:"Accepts multiple values like `?domain=cloudflare.com&domain=example.com`."}).option(`include-ranking`,{type:`boolean`,description:"Whether to include domain ranking data in the response. Defaults to\n`false` — ranking lookups are expensive at bulk scale and most\ncallers do not need them. Set to `true` to opt in. This parameter\nreplaces the deprecated `skip_ranking` (see below)."}).option(`skip-ranking`,{type:`boolean`,description:"**Deprecated.** Previously controlled whether the ranking lookup\nwas skipped (defaulted to `false`, meaning ranking ran). The\nendpoint's default behavior is being flipped — ranking is now\nopt-in via `include_ranking=true` — and this parameter will be\nsilently ignored. Remove it from your callers and use\n`include_ranking` instead."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get`,describe:"Returns security details and statistics about multiple domains in a single request. **Behavior change — domain ranking is becoming opt-in.** This endpoint previously included domain ranking data in every response and accepted a `skip_ranking=true` query parameter to opt out. That parameter is being deprecated and ranking will no longer be returned by default. Callers that want ranking data must pass `include_ranking=true`. The `skip_ranking` parameter will be silently ignored once the change ships.",builder:U,handler:async r=>{let i={domain:r.domain,include_ranking:r[`include-ranking`],skip_ranking:r[`skip-ranking`]};if(r.dryRun){s({command:`cf intel domains bulks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain/bulk`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.domains.bulks.get({account_id:u,...i})),{successLabel:`Loaded`})}},G={command:`bulks`,describe:`Operations for domains.bulks`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`skip-dns`,{type:`boolean`,description:`Skip DNS resolution lookups for faster response.`}).option(`skip-ranking`,{type:`boolean`,description:"Skip the domain ranking lookup for faster responses. Defaults to\n`false` (ranking is included). Set to `true` to opt out — primarily\nused by callers like Cloudflare Radar that need to avoid a\ncircular dependency when building the domain details page.\nNote: the bulk endpoint (`/intel/domain/bulk`) uses opposite\ndefaults — see `include_ranking` there."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get`,describe:`Gets security details and statistics about a domain.`,builder:K,handler:async r=>{let i={domain:r.domain,skip_dns:r[`skip-dns`],skip_ranking:r[`skip-ranking`]};if(r.dryRun){s({command:`cf intel domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.domains.get({account_id:u,...i})),{successLabel:`Loaded`})}},J={command:`domains`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(q).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.option(`description`,{type:`string`,description:`The description of the example test`}).option(`name`,{type:`string`,description:`The name of the indicator feed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`create`,describe:`Creates a new custom threat indicator feed for sharing threat intelligence data.`,builder:Y,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.intel.indicatorFeeds.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.intel.indicatorFeeds.create({...p,account_id:f})),{successLabel:`Created`})}};function Z(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`data <feed-id>`,describe:`Retrieves the raw data entries in a custom threat indicator feed.`,builder:Z,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds data`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}/data`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i,ee((await c(`Loading`,async()=>te(`/accounts/${i}/intel/indicator-feeds/${encodeURIComponent(String(r[`feed-id`]))}/data`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}))).toString(`utf-8`))}};function ne(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <feed-id>`,describe:`Downloads the content of a custom threat indicator feed.`,builder:ne,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}/download`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.downloads.get({account_id:l,feed_id:r[`feed-id`]})),{successLabel:`Loaded`})}},ie={command:`downloads`,describe:`Operations for indicator-feeds.downloads`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get <feed-id>`,describe:`Retrieves details for a specific custom threat indicator feed.`,builder:ae,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.get({account_id:l,feed_id:r[`feed-id`]})),{successLabel:`Loaded`})}};function se(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`list`,describe:`Retrieves details for all accessible custom threat indicator feeds.`,builder:se,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.list({account_id:l})),{successLabel:`Loaded`})}};function le(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`create`,describe:`Grants access permissions for a custom threat indicator feed to other accounts.`,builder:le,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/add`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.intel.indicatorFeeds.permissions.create({body:e,account_id:f})),{successLabel:`Updated`});return}let p=u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]});o(await c(`Updating`,async()=>i.intel.indicatorFeeds.permissions.create({body:p,account_id:f})),{successLabel:`Updated`})}};function de(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`delete`,describe:`Revokes access permissions for a custom threat indicator feed.`,builder:de,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions delete`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/remove`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,!await m({force:!!r.force,message:`This operation destructively removes a permission entry.`})){process.stderr.write(`Aborted.
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{a as i,r as a}from"./auth-DY_Y2bXC.mjs";import{t as o}from"./output-BqDR9h74.mjs";import{t as s}from"./dry-run-ILZRVpnp.mjs";import{t as c}from"./progress-jYW64HY7.mjs";import{n as l,t as u}from"./body-parser-BGVbwPeM.mjs";import{n as d,t as f}from"./input-validation-1esLElok.mjs";import{a as p,n as m}from"./prompt-CyATfGUu.mjs";import{t as h}from"./cli-types-C3nVfpSG.mjs";import{n as ee,t as te}from"./raw-fetch-CNKIypJ7.mjs";function g(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <asn>`,describe:`Gets an overview of the Autonomous System Number (ASN) and a list of subnets for it.`,builder:g,handler:async r=>{if(r.dryRun){s({command:`cf intel asn get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/asn/${r.asn==null?`<asn>`:encodeURIComponent(String(r.asn))}`,pathParams:{asn:String(r.asn??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.asn.get({account_id:l,asn:r.asn})),{successLabel:`Loaded`})}};function v(e){return e.positional(`asn`,{type:`string`,description:`Asn`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <asn>`,describe:`Get ASN Subnets.`,builder:v,handler:async r=>{if(r.dryRun){s({command:`cf intel asn subnets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/asn/${r.asn==null?`<asn>`:encodeURIComponent(String(r.asn))}/subnets`,pathParams:{asn:String(r.asn??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.asn.subnets.get({account_id:l,asn:r.asn})),{successLabel:`Loaded`})}},b={command:`subnets`,describe:`Operations for asn.subnets`,builder:e=>e.command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},x={command:`asn`,describe:`ASN intelligence — ownership, geolocation, and subnet details for autonomous systems`,builder:e=>e.command(_).command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Lists all available issue types in Security Center, describing categories of security issues.`,builder:S,handler:async r=>{if(r.dryRun){s({command:`cf intel attack-surface-report issue-types get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issue-types`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.attackSurfaceReport.issueTypes.get({account_id:l})),{successLabel:`Loaded`})}},w={command:`issue-types`,describe:`Operations for attack-surface-report.issue-types`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`class`,describe:`Retrieves Security Center issue counts aggregated by classification class.`,builder:h(T),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues class`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/class`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.attackSurfaceReport.issues.class({account_id:u,...i})),{successLabel:`Loaded`})}};function D(e){return e.positional(`issue-id`,{type:`string`,description:`Issue ID`,demandOption:!0}).option(`dismiss`,{type:`boolean`,description:`The dismiss 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 O={command:`dismiss <issue-id>`,describe:`Deprecated endpoint for archiving Security Center insights. Use the newer archive-security-center-insight endpoint instead.`,builder:D,handler:async r=>{if(r.dryRun){s({command:`cf intel attack-surface-report issues dismiss`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/${r[`issue-id`]==null?`<issue-id>`:encodeURIComponent(String(r[`issue-id`]))}/dismiss`,pathParams:{"issue-id":String(r[`issue-id`]??``)},bodyKind:`json`,body:r.body===void 0?u({dismiss:r.dismiss}):l(r.body)});return}let i=await a(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.intel.attackSurfaceReport.issues.dismiss({...e,account_id:d,issue_id:r[`issue-id`]})),{successLabel:`Updated`});return}let f=u({dismiss:r.dismiss});o(await c(`Updating`,async()=>i.intel.attackSurfaceReport.issues.dismiss({...f,account_id:d,issue_id:r[`issue-id`]})),{successLabel:`Updated`})}};function k(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`page`,{type:`number`,description:`Specifies the current page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Sets the number of results per page of results.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`list`,describe:`Lists all Security Center issues for the account, showing active security problems requiring attention.`,builder:h(k),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf intel attack-surface-report issues list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.attackSurfaceReport.issues.list({account_id:u,...i})),{successLabel:`Loaded`})}};function j(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const M={command:`severity`,describe:`Retrieves Security Center issue counts aggregated by severity level.`,builder:h(j),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues severity`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/severity`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.attackSurfaceReport.issues.severity({account_id:u,...i})),{successLabel:`Loaded`})}};function N(e){return e.option(`dismissed`,{type:`boolean`,description:`Dismissed`}).option(`issue-class`,{type:`string`,description:`Issue class`}).option(`issue-type`,{type:`string`,description:`Issue type`}).option(`product`,{type:`string`,description:`Product`}).option(`severity`,{type:`string`,description:`Severity`}).option(`subject`,{type:`string`,description:`Subject`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`type`,describe:`Retrieves Security Center issue counts aggregated by issue type.`,builder:h(N),handler:async r=>{let i={dismissed:r.dismissed,issue_class:r[`issue-class`],issue_type:r[`issue-type`],product:r.product,severity:r.severity,subject:r.subject};if(r.dryRun){s({command:`cf intel attack-surface-report issues type`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/attack-surface-report/issues/type`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.attackSurfaceReport.issues.type({account_id:u,...i})),{successLabel:`Loaded`})}},F={command:`issues`,describe:`Operations for attack-surface-report.issues`,builder:e=>e.command(E).command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},I={command:`attack-surface-report`,describe:`Attack surface intelligence — exposed assets, vulnerabilities, and infrastructure mapping`,builder:e=>e.command(w).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function L(e){return e.option(`start-end-params`,{type:`string`,description:`Start end params`}).option(`ipv4`,{type:`string`,description:`Ipv4`}).option(`page`,{type:`number`,description:`Requested page within paginated list of results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results requested.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`list`,describe:`Gets a list of all the domains that have resolved to a specific IP address.`,builder:h(L),handler:async r=>{let i={start_end_params:r[`start-end-params`],ipv4:r.ipv4,page:r.page,per_page:r[`per-page`]};if(r.dryRun){s({command:`cf intel dns list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/dns`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.dns.list({account_id:u,...i})),{successLabel:`Loaded`})}},z={command:`dns`,describe:`Passive DNS data showing historical DNS resolution records for domains`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function B(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const V={command:`get`,describe:`Gets historical security threat and content categories currently and previously assigned to a domain.`,builder:B,handler:async r=>{let i={domain:r.domain};if(r.dryRun){s({command:`cf intel domain-history get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain-history`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.domainHistory.get({account_id:u,...i})),{successLabel:`Loaded`})}},H={command:`domain-history`,describe:`Historical domain registration and categorization changes over time`,builder:e=>e.command(V).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function U(e){return e.option(`domain`,{type:`string`,description:"Accepts multiple values like `?domain=cloudflare.com&domain=example.com`."}).option(`include-ranking`,{type:`boolean`,description:"Whether to include domain ranking data in the response. Defaults to\n`false` — ranking lookups are expensive at bulk scale and most\ncallers do not need them. Set to `true` to opt in. This parameter\nreplaces the deprecated `skip_ranking` (see below)."}).option(`skip-ranking`,{type:`boolean`,description:"**Deprecated.** Previously controlled whether the ranking lookup\nwas skipped (defaulted to `false`, meaning ranking ran). The\nendpoint's default behavior is being flipped — ranking is now\nopt-in via `include_ranking=true` — and this parameter will be\nsilently ignored. Remove it from your callers and use\n`include_ranking` instead."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`get`,describe:"Returns security details and statistics about multiple domains in a single request. **Behavior change — domain ranking is becoming opt-in.** This endpoint previously included domain ranking data in every response and accepted a `skip_ranking=true` query parameter to opt out. That parameter is being deprecated and ranking will no longer be returned by default. Callers that want ranking data must pass `include_ranking=true`. The `skip_ranking` parameter will be silently ignored once the change ships.",builder:U,handler:async r=>{let i={domain:r.domain,include_ranking:r[`include-ranking`],skip_ranking:r[`skip-ranking`]};if(r.dryRun){s({command:`cf intel domains bulks get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain/bulk`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.domains.bulks.get({account_id:u,...i})),{successLabel:`Loaded`})}},G={command:`bulks`,describe:`Operations for domains.bulks`,builder:e=>e.command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`domain`,{type:`string`,description:`Domain`}).option(`skip-dns`,{type:`boolean`,description:`Skip DNS resolution lookups for faster response.`}).option(`skip-ranking`,{type:`boolean`,description:"Skip the domain ranking lookup for faster responses. Defaults to\n`false` (ranking is included). Set to `true` to opt out — primarily\nused by callers like Cloudflare Radar that need to avoid a\ncircular dependency when building the domain details page.\nNote: the bulk endpoint (`/intel/domain/bulk`) uses opposite\ndefaults — see `include_ranking` there."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get`,describe:`Gets security details and statistics about a domain.`,builder:K,handler:async r=>{let i={domain:r.domain,skip_dns:r[`skip-dns`],skip_ranking:r[`skip-ranking`]};if(r.dryRun){s({command:`cf intel domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/domain`,pathParams:{},query:i,bodyKind:`none`});return}let l=await a(r),u=r.local?e:await t();r.accountId=u,o(await c(`Loading`,async()=>l.intel.domains.get({account_id:u,...i})),{successLabel:`Loaded`})}},J={command:`domains`,describe:`Domain intelligence — risk scores, categories, and associated infrastructure`,builder:e=>e.command(q).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.option(`description`,{type:`string`,description:`The description of the example test`}).option(`name`,{type:`string`,description:`The name of the indicator feed`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const X={command:`create`,describe:`Creates a new custom threat indicator feed for sharing threat intelligence data.`,builder:Y,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Creating`,async()=>i.intel.indicatorFeeds.create({...e,account_id:f})),{successLabel:`Created`});return}let p=u({description:d(r.description,`description`,`text`),name:d(r.name,`name`,`text`)});o(await c(`Creating`,async()=>i.intel.indicatorFeeds.create({...p,account_id:f})),{successLabel:`Created`})}};function Z(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`data <feed-id>`,describe:`Retrieves the raw data entries in a custom threat indicator feed.`,builder:Z,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds data`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}/data`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}await a(r);let i=r.local?e:await t();r.accountId=i,ee((await c(`Loading`,async()=>te(`/accounts/${i}/intel/indicator-feeds/${encodeURIComponent(String(r[`feed-id`]))}/data`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}))).toString(`utf-8`))}};function ne(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const re={command:`get <feed-id>`,describe:`Downloads the content of a custom threat indicator feed.`,builder:ne,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds downloads get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}/download`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.downloads.get({account_id:l,feed_id:r[`feed-id`]})),{successLabel:`Loaded`})}},ie={command:`downloads`,describe:`Operations for indicator-feeds.downloads`,builder:e=>e.command(re).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ae(e){return e.positional(`feed-id`,{type:`string`,description:`Indicator feed ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`get <feed-id>`,describe:`Retrieves details for a specific custom threat indicator feed.`,builder:ae,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/${r[`feed-id`]==null?`<feed-id>`:encodeURIComponent(String(r[`feed-id`]))}`,pathParams:{"feed-id":String(r[`feed-id`]??``)},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.get({account_id:l,feed_id:r[`feed-id`]})),{successLabel:`Loaded`})}};function se(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`list`,describe:`Retrieves details for all accessible custom threat indicator feeds.`,builder:se,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.list({account_id:l})),{successLabel:`Loaded`})}};function le(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`create`,describe:`Grants access permissions for a custom threat indicator feed to other accounts.`,builder:le,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions create`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/add`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,r.body){let e=l(r.body);o(await c(`Updating`,async()=>i.intel.indicatorFeeds.permissions.create({body:e,account_id:f})),{successLabel:`Updated`});return}let p=u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]});o(await c(`Updating`,async()=>i.intel.indicatorFeeds.permissions.create({body:p,account_id:f})),{successLabel:`Updated`})}};function de(e){return e.option(`account-tag`,{type:`string`,description:`The Cloudflare account tag of the account to change permissions on`}).option(`feed-id`,{type:`number`,description:`The ID of the feed to add/remove permissions on`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const fe={command:`delete`,describe:`Revokes access permissions for a custom threat indicator feed.`,builder:de,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions delete`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/remove`,pathParams:{},bodyKind:`json`,body:r.body===void 0?u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]}):l(r.body)});return}let i=await a(r),f=r.local?e:await t();if(r.accountId=f,!await m({force:!!r.force,message:`This operation destructively removes a permission entry.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}if(r.body){let e=l(r.body);o(await c(`Deleting`,async()=>i.intel.indicatorFeeds.permissions.delete({body:e,account_id:f})),{successLabel:`Deleted`});return}let p=u({account_tag:d(r[`account-tag`],`account-tag`,`text`),feed_id:r[`feed-id`]});o(await c(`Deleting`,async()=>i.intel.indicatorFeeds.permissions.delete({body:p,account_id:f})),{successLabel:`Deleted`})}};function pe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`list`,describe:`Lists current access permissions for custom threat indicator feeds.`,builder:pe,handler:async r=>{if(r.dryRun){s({command:`cf intel indicator-feeds permissions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/intel/indicator-feeds/permissions/view`,pathParams:{},bodyKind:`none`});return}let i=await a(r),l=r.local?e:await t();r.accountId=l,o(await c(`Loading`,async()=>i.intel.indicatorFeeds.permissions.list({account_id:l})),{successLabel:`Loaded`})}},he={command:`permissions`,describe:`Operations for indicator-feeds.permissions`,builder:e=>e.command(ue).command(fe).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.positional(`account-id-path`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`account-id`,{type:`number`,description:`The numeric account ID to create the provider for. Distinct from the
|
|
4
4
|
path \`account_id\` parameter, which carries the account identifier
|
|
5
5
|
string used for routing.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import"./chunk-vbHwaUoU.mjs";import{t as e}from"./src-CEb2fgtT.mjs";import{L as t}from"./dist-DV7LR38l.mjs";import{_ as n,f as r,g as i,h as a,i as o,m as s,n as c,o as l,p as u,s as d,u as f,v as p}from"./interactive-cytQzL94.mjs";import"node:os";import m,{exit as h}from"node:process";async function g(t,n){if(c())return n.fallbackValue??!1;let r=await d({message:t,initialValue:n.defaultValue,output:n.output});if(p(r))throw new e(130);return r}async function _(t,n={}){if(c()){if(n.fallbackValue===void 0)throw Error(n.fallbackError);return n.fallbackValue}for(;;){let i=await r({message:t,defaultValue:n.defaultValue,initialValue:n.initialValue,output:n.output});if(p(i))throw new e(130);let a=await n.validate?.(i);if(a===void 0||a===!0)return i;console.error(a===!1?`Invalid value`:a)}}async function ee(t,n){if(c()){let e=n.fallbackOption??n.defaultOption??0,t=n.choices[e]??n.choices[0];if(!t)throw Error(n.fallbackError??`select() called with no choices`);return t.value}let r=await f({message:t,options:n.choices.map(e=>({label:e.title,value:e.value,hint:e.description})),initialValue:n.choices[n.defaultOption??0]?.value,output:n.output});if(p(r))throw new e(130);return r}const{white:v,gray:y,dim:b,hidden:te,bold:x,cyanBright:ne,bgCyan:re}=t,S=t.hex(`#BD5B08`),C=t.hex(`#111`),w=t.hex(`#0E838F`),ie=C.bgHex(`#0E838F`),ae=t.hex(`#AB2526`),oe=C.bgHex(`#AB2526`),se=t.hex(`#218529`),ce=C.bgHex(`#218529`),le=t.hex(`#7F7322`),ue=C.bgHex(`#7F7322`),T=process.stdout,de=process.stderr;l();function fe(e,t=m.stderr){t.isTTY&&(e?t.write(`\x1B[?25h`):t.write(`\x1B[?25l`))}const E={diamond:`◇`,dash:`─`,radioInactive:`○`,radioActive:`●`,backActive:`◀`,backInactive:`◁`,bar:`│`,leftT:`├`,rigthT:`┤`,arrows:{left:`‹`,right:`›`},corners:{tl:`╭`,bl:`╰`,tr:`╮`,br:`╯`}},D={error:oe(` ERROR `),warning:ue(` WARNING `),info:ie(` INFO `),success:ce(` SUCCESS `),cancel:v.bgRed(` X `)},O=(e=1)=>te(` `.repeat(e)),k={none:-1,error:0,warn:1,info:2,log:3,debug:4};function A(){return`log`}const j=e=>{k[A()]>=k.log&&T.write(`${e}\n`)},M=e=>{j(e.split(`
|
|
3
|
+
`).map(e=>`${y(E.bar)}${e.length>0?` `+v(e):``}`).join(`
|
|
4
|
+
`))},N=()=>{M(``)},P=(e,{linePrefix:t=y(E.bar),firstLinePrefix:n=t,newlineBefore:r=!1,newlineAfter:i=!1,formatLine:a=e=>v(e),multiline:o=!0}={})=>{let s=(o?e.split(`
|
|
5
|
+
`):[e]).map((e,r)=>(r===0?n:t)+O()+a(e));return r&&s.unshift(t),i&&s.push(t),s.join(`
|
|
6
|
+
`)},F=(e,t=!0)=>{j(P(e,{firstLinePrefix:y(E.leftT),linePrefix:y(E.bar),newlineAfter:t}))},I=(e,t,n=!0)=>{j(`${y(E.corners.tl)} ${S(e)} ${t?b(t):``}`),n&&N()},L=(e,t)=>{j(`${y(E.corners.bl)} ${S(e)} ${t?b(t):``}\n`)},R=(e,{shape:t=E.corners.bl,multiline:n=!1}={})=>{j(P(e,{firstLinePrefix:`${y(t)} ${D.cancel}`,linePrefix:y(E.bar),newlineBefore:!0,formatLine:e=>b(e),multiline:n}))},z=(e,{shape:t=E.corners.bl,multiline:n=!1,newlineBefore:r=!0}={})=>{j(P(e,{firstLinePrefix:y(t)+O()+D.warning,linePrefix:y(E.bar),formatLine:e=>b(e),multiline:n,newlineBefore:r}))},B=(e,{shape:t=E.corners.bl,multiline:n=!1}={})=>{j(P(e,{firstLinePrefix:y(t)+O()+D.success,linePrefix:y(E.bar),newlineBefore:!0,formatLine:e=>b(e),multiline:n}))},V=e=>{let t=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)`,`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))`].join(`|`),n=RegExp(t,`g`);return e.replace(H,`$2`).replace(n,``)},H=/\u001B\]8;;(?<url>.+)\u001B\\(?<label>.+)\u001B\]8;;\u001B\\/g,pe=(e,t)=>{me(e,t),h(1)},me=(e,t,n=E.corners.bl)=>{let r=A();e&&k[r]>=k.error&&de.write(`${y(n)} ${D.error} ${b(e)}\n${t?O()+t+`
|
|
7
|
+
`:``}`)};var U=class extends Error{constructor(e,t){super(e),this.signal=t}},W=class extends n{options;cursor=0;get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}constructor(e){super(e,!1),this.options=e.options,this.cursor=this.options.findIndex(({value:t})=>t===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on(`key`,t=>{t===`r`&&e.onRefresh().then(e=>{this.options=[...e],this.cursor=0,this.changeValue();let t=this;`render`in t&&typeof t.render==`function`&&t.render()}).catch(()=>{})}),this.on(`cursor`,e=>{switch(e){case`left`:case`up`:this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case`down`:case`right`:this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}};const G=o(T),K=y(E.bar),q=y(E.corners.bl),J=y(E.leftT);function Y(e,t,n){let r=e.validate?.(n);if(r){let t=r instanceof Error?r.message:r;if(e.throwOnError)throw Error(t);pe(t)}return j(t.submit({value:n}).join(`
|
|
8
|
+
`)),n}const he=async e=>{let t={...ge(e),...e.renderers},n,r=(n,r)=>{let i=n.state;return i===`initial`&&e.initialErrorMessage&&(i=`error`,n.error=e.initialErrorMessage),t[i](n,r).join(`
|
|
9
|
+
`)};if(e.type===`select`){let a=String(e.defaultValue);if(e.acceptDefault)return Y(e,t,a);n=new i({...e,options:e.options.filter(e=>!e.hidden),initialValue:a,render(){return r(this,n)}})}else if(e.type===`confirm`){let i=!!e.defaultValue;if(e.acceptDefault)return Y(e,t,i);n=new u({...e,initialValue:i,active:e.activeText||``,inactive:e.inactiveText||``,render(){return r(this,n)}})}else if(e.type==`multiselect`){let i;if(Array.isArray(e.defaultValue)?i=e.defaultValue:e.defaultValue!==void 0&&(i=[String(e.defaultValue)]),e.acceptDefault)return Y(e,t,i);n=new a({...e,options:e.options,initialValues:i,render(){return r(this,n)}})}else if(e.type===`list`){let i=String(e.defaultValue);if(e.acceptDefault)return Y(e,t,i);n=new W({...e,onRefresh:e.onRefresh??(()=>Promise.resolve(e.options)),initialValue:i,render(){return r(this,n)}})}else{let i=e.initialValue??String(e.defaultValue??``);if(e.acceptDefault)return Y(e,t,i);n=new s({...e,initialValue:e.initialValue,defaultValue:String(e.defaultValue??``),render(){return r(this,n)}})}let o=await n.prompt();if(p(o)){if(e.throwOnError)throw new U(`Operation cancelled`);R(`Operation cancelled`),process.exit(0)}return o},X=(e,t)=>{let{question:n,label:r}=e;if(e.type!==`confirm`&&!t)return[`${J} ${n} ${b(`(skipped)`)}`,`${K}`];let i=e.type===`confirm`?`${K} ${S(t)} ${b(r)}`:`${K} ${S(r)} ${b(t)}`;return[`${J} ${n}`,i,`${K}`]},ge=e=>{switch(e.type){case`select`:return Z(e);case`confirm`:return ye(e);case`text`:return _e(e);case`multiselect`:return Z(e);case`list`:return ve(e)}},_e=e=>{let{question:t}=e,n=e.helpText??``,r=e.format??(e=>String(e)),i=e.defaultValue?.toString()??``,a=e=>{let{userInputWithCursor:a}=e;return[`${q} ${x(t)} ${b(n)}`,`${O(2)}${r(a||b(i))}`,``]};return{initial:()=>[`${q} ${x(t)} ${b(n)}`,`${O(2)}${y(r(i))}`,``],active:a,error:({value:e,error:i})=>[`${J} ${D.error} ${b(i)}`,`${K}`,`${q} ${t} ${b(n)}`,`${O(2)}${r(e)}`,``],submit:({value:t})=>X(e,r(t??``)),cancel:a}},Z=e=>{let{options:t,question:n,helpText:r}=e,i=r??``,a=e.maxItemsPerPage??32,o=({cursor:e=0,value:r})=>{let o=(t,n)=>{let{label:i,value:a}=t,o=n===e,s=Array.isArray(r)&&r.includes(a),c=s||o?w:v,l=o?c.underline(i):c(i),u=t.sublabel?c.grey(t.sublabel):``,d=c(s||o&&!Array.isArray(r)?t.activeIcon??E.radioActive:t.inactiveIcon??E.radioInactive);return`${O(2)}${d} ${l} ${u}`},s=(n,r)=>t.length<=a?!0:r<e?t.length-r<=a:e+a>r,c=t.filter(e=>!e.hidden),l=c.at(e),u=[`${q} ${x(n)} ${b(i)}`,`${e>0&&t.length>a?`${O(2)}${b(`...`)}\n`:``}${c.map(o).filter(s).join(`
|
|
10
|
+
`)}${e+a<t.length&&t.length>a?`\n${O(2)}${b(`...`)}`:``}`,``];if(l?.description){let e=new Intl.Segmenter(`en`,{granularity:`word`}),t=O(2),n=process.stdout.columns-V(t).length*2,r=V(l.description),i=[],a=0;for(let t of e.segment(r)){let e=i[a]??``;e.length+t.segment.length>n&&(a++,e=``,t.segment.match(/^\s+$/))||(i[a]=e+t.segment)}u.push(b(i.map(e=>t+e+t).join(`
|
|
11
|
+
`)),``)}return u};return{initial:o,active:o,confirm:o,error:(e,t)=>[`${J} ${D.error} ${b(e.error)}`,`${K}`,...o(e,t)],submit:({value:n})=>Array.isArray(n)?X(e,t.filter(e=>n.includes(e.value)).map(e=>e.label).join(`, `)):X(e,t.find(e=>e.value===n)?.label),cancel:o}},ve=e=>{let{question:t,helpText:n}=e,r=e.options,i=n??``,{rows:a}=T,o=({cursor:e,value:n},o)=>{o instanceof W&&(r=o.options),e??=0;let s=0,c=(e,t)=>{let{label:r,value:i}=e,a=i.toString(),o=t===s,c=Array.isArray(n)&&n.includes(a),l=c||o?w:v,u=o?l.underline(r):l(r),d=l(c||o&&!Array.isArray(n)?E.radioActive:E.radioInactive);return[`${O(2)}${d} ${u}`,...e.details.map((t,n)=>`${O(6)}${n===e.details.length-1?y(E.corners.bl):K} ${t}`)]},l=[],u={size:0,options:[]};for(let e of r){let t=e.details.length+1;if(u.size+t>a-6){l.push(u.options),u={size:t,options:[e]};continue}u.size+=t,u.options.push(e)}u.size!==0&&l.push(u.options);let d=!0,f=!1,p=[],m=0;for(let t=0;t<l.length;t++){let n=l[t];if(e>=m&&n.length+m>e){d=t===0,f=t===l.length-1,p=n,s=e-m;break}m+=n.length}return[`${q} ${x(t)} ${b(i)}`,...d?[]:[`${O(2)}${b(`...`)}`],...p.map(c).reduce((e,t)=>[...e,...t],[]),...f?[]:[`${O(2)}${b(`...`)}`]]};return{initial:o,active:o,confirm:o,error:(e,t)=>[`${J} ${D.error} ${b(e.error)}`,`${K}`,...o(e,t)],submit:({value:t})=>Array.isArray(t)?X(e,r.filter(e=>t.includes(e.value)).map(e=>e.value).join(`, `)):X(e,r.find(e=>e.value===t)?.value),cancel:o}},ye=e=>{let{activeText:t,inactiveText:n,question:r,helpText:i}=e,a=i??``,o=t||`Yes`,s=n||`No`,c=({value:e})=>{let t=e?w.underline:b,n=e?b:w.underline;return[`${q} ${x(r)} ${b(a)}`,`${O(2)}${t(o)} / ${n(s)}`]};return{initial:c,active:c,confirm:c,error:c,submit:({value:t})=>X(e,t?`yes`:`no`),cancel:c}},be={clockwise:[`┤`,`┘`,`┴`,`└`,`├`,`┌`,`┬`,`┐`],vertical:[`▁`,`▃`,`▄`,`▅`,`▆`,`▇`,`▆`,`▅`,`▄`,`▃`]},Q=[``,`.`,`..`,`...`,` ..`,` .`,``],xe=(e=be.clockwise,t=S)=>{let n=null,r,i;function a(){n&&clearTimeout(n),n=null}return{start(o,s){if(s||=``,i=o,r=i,s!==void 0&&s.length>0&&(r+=` ${b(s)}`),$()){let r=0;a(),n=setInterval(()=>{r++;let n=e[r%e.length],a=Q[r%Q.length];o&&G(`${t(n)} ${i} ${a}`)},120)}else j(`${J} ${r}`)},update(e){i=e},stop(e){$()?(G.clear(),e&&(G(`${J} ${r}\n${K} ${e}`),G.done(),N()),a()):(e!==void 0&&j(`${K} ${e}`),N())}}};function $(){try{return!!(process.stdin.isTTY&&process.stdout.isTTY)}catch{return!1}}export{se as C,g as D,le as E,_ as O,y as S,v as T,fe as _,U as a,S as b,M as c,E as d,I as f,z as g,F as h,xe as i,ee as k,j as l,B as m,$ as n,R as o,V as p,J as r,L as s,he as t,N as u,w as v,ae as w,b as x,x as y};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{i as e,r as t,t as n}from"./chunk-vbHwaUoU.mjs";import{
|
|
2
|
+
import{i as e,r as t,t as n}from"./chunk-vbHwaUoU.mjs";import{l as r,u as i}from"./project-settings-BN7tL0c7.mjs";import{L as a}from"./dist-DV7LR38l.mjs";import"node:fs";import{styleText as o}from"node:util";import"node:path";import"node:os";import s,{stdin as c,stdout as l}from"node:process";import{ReadStream as u}from"node:tty";import*as d from"node:readline";import f from"node:readline";const p=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,m=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,h=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141,g=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,_=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,v=/\t{1,1000}/y,y=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,b=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,x=/\p{M}+/gu,S={limit:1/0,ellipsis:``},ee=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?ee(i,S,n).width:0),o=n.ansiWidth??0,s=n.controlWidth??0,c=n.tabWidth??8,l=n.ambiguousWidth??1,u=n.emojiWidth??2,d=n.fullWidthWidth??2,f=n.regularWidth??1,te=n.wideWidth??2,C=0,w=0,T=e.length,E=0,D=!1,O=T,k=Math.max(0,r-a),A=0,j=0,M=0,N=0;outer:for(;;){if(j>A||w>=T&&w>C){let t=e.slice(A,j)||e.slice(C,w);E=0;for(let e of t.replaceAll(x,``)){let t=e.codePointAt(0)||0;if(N=m(t)?d:h(t)?te:l!==f&&p(t)?l:f,M+N>k&&(O=Math.min(O,Math.max(A,C)+E)),M+N>r){D=!0;break outer}E+=e.length,M+=N}A=j=0}if(w>=T)break;if(b.lastIndex=w,b.test(e)){if(E=b.lastIndex-w,N=E*f,M+N>k&&(O=Math.min(O,w+Math.floor((k-M)/f))),M+N>r){D=!0;break}M+=N,A=C,j=w,w=C=b.lastIndex;continue}if(g.lastIndex=w,g.test(e)){if(M+o>k&&(O=Math.min(O,w)),M+o>r){D=!0;break}M+=o,A=C,j=w,w=C=g.lastIndex;continue}if(_.lastIndex=w,_.test(e)){if(E=_.lastIndex-w,N=E*s,M+N>k&&(O=Math.min(O,w+Math.floor((k-M)/s))),M+N>r){D=!0;break}M+=N,A=C,j=w,w=C=_.lastIndex;continue}if(v.lastIndex=w,v.test(e)){if(E=v.lastIndex-w,N=E*c,M+N>k&&(O=Math.min(O,w+Math.floor((k-M)/c))),M+N>r){D=!0;break}M+=N,A=C,j=w,w=C=v.lastIndex;continue}if(y.lastIndex=w,y.test(e)){if(M+u>k&&(O=Math.min(O,w)),M+u>r){D=!0;break}M+=u,A=C,j=w,w=C=y.lastIndex;continue}w+=1}return{width:D?k:M,index:D?O:T,truncated:D,ellipsed:D&&r>=a}},te={limit:1/0,ellipsis:``,ellipsisWidth:0},C=(e,t={})=>ee(e,te,t).width,w=`]8;;`,T=RegExp(`(?:\\[(?<code>\\d+)m|\\${w}(?<uri>.*))`,`y`),E=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},D=e=>`[${e}m`,O=e=>`${w}${e}`,k=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:C(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=C(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===``)&&(i=!0,a=t.startsWith(w,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},A=e=>{let t=e.split(` `),n=t.length;for(;n&&!C(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},j=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=C(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=C(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),k(s,r,t),c=C(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){k(s,r,t),c=C(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){k(s,r,t),c=C(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>A(e)));let l=s.join(`
|
|
3
3
|
`),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,!u)u=t>=`\ud800`&&t<=`\udbff`;else continue;if(t===`\x1B`||t===``){T.lastIndex=e+1;let t=T.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
|
|
4
4
|
`){a&&(r+=O(``));let e=i?E(i):void 0;i&&e&&(r+=D(e))}else t===`
|
|
5
5
|
`&&(i&&E(i)&&(r+=D(i)),a&&(r+=O(a)))}return r},M=/\r?\n/;function N(e,t,n){return String(e).normalize().split(M).map(e=>j(e,t,n)).join(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{r as e}from"./auth-DY_Y2bXC.mjs";import{t}from"./output-BqDR9h74.mjs";import{t as n}from"./dry-run-ILZRVpnp.mjs";import{t as r}from"./progress-jYW64HY7.mjs";function i(e){return e.option(`networks`,{type:`string`,description:"Specified as `jdcloud` to list IPs used by JD Cloud data centers."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const a={command:`list`,describe:`Get IPs used on the Cloudflare/JD Cloud network, see https://www.cloudflare.com/ips for Cloudflare IPs or https://developers.cloudflare.com/china-network/reference/infrastructure/ for JD Cloud IPs.`,builder:i,handler:async i=>{let a={networks:i.networks};if(i.dryRun){n({command:`cf ips list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/ips`,pathParams:{},query:a,bodyKind:`none`});return}let o=await e(i);t(await r(`Loading`,async()=>o.ips.list(a)),{successLabel:`Loaded`})}},o={command:`ips`,describe:`ips`,builder:e=>e.command(a).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{o as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-
|
|
2
|
+
import{h as e}from"./oauth-DAa7SwkM.mjs";import{r as t}from"./auth-DY_Y2bXC.mjs";import{t as n}from"./output-BqDR9h74.mjs";import{t as r}from"./dry-run-ILZRVpnp.mjs";import{t as i}from"./progress-jYW64HY7.mjs";import{n as a,t as o}from"./body-parser-BGVbwPeM.mjs";import{n as s}from"./input-validation-1esLElok.mjs";import{a as c,n as l}from"./prompt-CyATfGUu.mjs";function u(e){return e.option(`bundle-method`,{type:`string`,description:`A ubiquitous bundle has the highest probability of being verified everywhere, even by clients using outdated or unusual trust stores. An optimal bundle uses the shortest chain and newest intermediates. And the force bundle verifies the chain, but does not otherwise modify it.`,choices:[`ubiquitous`,`optimal`,`force`],default:`ubiquitous`}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or SSL certificate and intermediate(s).`}).option(`host`,{type:`string`,description:`The keyless SSL name.`}).option(`name`,{type:`string`,description:`The keyless SSL name.`}).option(`port`,{type:`number`,description:`The keyless SSL port used to communicate between Cloudflare and the client's Keyless SSL server.`,default:24008}).option(`tunnel-private-ip`,{type:`string`,description:`Private IP of the Key Server Host.`}).option(`tunnel-vnet-id`,{type:`string`,description:`Cloudflare Tunnel Virtual Network ID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`tunnel-private-ip`,`tunnel-vnet-id`].some(t=>e[t]!==void 0)){let t=[`tunnel-private-ip`,`tunnel-vnet-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --tunnel-* flag is set`)}return!0})}const d={command:`create`,describe:`Creates a Keyless SSL configuration that allows SSL/TLS termination without exposing private keys to Cloudflare. Keys remain on your infrastructure.`,builder:u,handler:async l=>{if(l.dryRun){r({command:`cf keyless-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({bundle_method:s(l[`bundle-method`],`bundle-method`,`text`),certificate:s(l.certificate,`certificate`,`text`),host:s(l.host,`host`,`text`),name:s(l.name,`name`,`text`),port:l.port,tunnel:{private_ip:s(l[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(l[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):a(l.body)});return}let u=await t(l),d=await e({zone:l.zone},u,{quiet:l.quiet});if(l.zoneId=d,l.body){let e=a(l.body);n(await i(`Creating`,async()=>u.keylessCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}if(l.certificate===void 0&&(l.certificate=await c(`certificate`,`The zone's SSL certificate or SSL certificate and intermediate(s).`)),l.host===void 0&&(l.host=await c(`host`,`The keyless SSL name.`)),l.port===void 0)throw Error(`--port is required (or pass --body with this field set).`);let f=o({bundle_method:s(l[`bundle-method`],`bundle-method`,`text`),certificate:s(l.certificate,`certificate`,`text`),host:s(l.host,`host`,`text`),name:s(l.name,`name`,`text`),port:l.port,tunnel:{private_ip:s(l[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(l[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});n(await i(`Creating`,async()=>u.keylessCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function f(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const p={command:`delete <keyless-certificate-id>`,describe:`Removes a Keyless SSL configuration. SSL connections will no longer use the keyless server for cryptographic operations.`,builder:f,handler:async a=>{if(a.dryRun){r({command:`cf keyless-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates/${a[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(a[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(a[`keyless-certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>o.keylessCertificates.delete({zone_id:s,keyless_certificate_id:a[`keyless-certificate-id`]})),{successLabel:`Deleted`})}};function m(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Whether or not the Keyless SSL is on or off.`}).option(`host`,{type:`string`,description:`The keyless SSL name.`}).option(`name`,{type:`string`,description:`The keyless SSL name.`}).option(`port`,{type:`number`,description:`The keyless SSL port used to communicate between Cloudflare and the client's Keyless SSL server.`}).option(`tunnel-private-ip`,{type:`string`,description:`Private IP of the Key Server Host.`}).option(`tunnel-vnet-id`,{type:`string`,description:`Cloudflare Tunnel Virtual Network ID.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`tunnel-private-ip`,`tunnel-vnet-id`].some(t=>e[t]!==void 0)){let t=[`tunnel-private-ip`,`tunnel-vnet-id`].filter(t=>e[t]===void 0);if(t.length>0)throw Error(`${t.map(e=>`--`+e).join(`, `)} ${t.length===1?`is`:`are`} required when any --tunnel-* flag is set`)}return!0})}const h={command:`edit <keyless-certificate-id>`,describe:`This will update attributes of a Keyless SSL. Consists of one or more of the following: host,name,port.`,builder:m,handler:async c=>{if(c.dryRun){r({command:`cf keyless-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/keyless_certificates/${c[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(c[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(c[`keyless-certificate-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({enabled:c.enabled,host:s(c.host,`host`,`text`),name:s(c.name,`name`,`text`),port:c.port,tunnel:{private_ip:s(c[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(c[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.keylessCertificates.edit({...e,zone_id:u,keyless_certificate_id:c[`keyless-certificate-id`]})),{successLabel:`Updated`});return}let d=o({enabled:c.enabled,host:s(c.host,`host`,`text`),name:s(c.name,`name`,`text`),port:c.port,tunnel:{private_ip:s(c[`tunnel-private-ip`],`tunnel-private-ip`,`text`),vnet_id:s(c[`tunnel-vnet-id`],`tunnel-vnet-id`,`text`)}});n(await i(`Updating`,async()=>l.keylessCertificates.edit({...d,zone_id:u,keyless_certificate_id:c[`keyless-certificate-id`]})),{successLabel:`Updated`})}};function g(e){return e.positional(`keyless-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get <keyless-certificate-id>`,describe:`Get details for one Keyless SSL configuration.`,builder:g,handler:async a=>{if(a.dryRun){r({command:`cf keyless-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates/${a[`keyless-certificate-id`]==null?`<keyless-certificate-id>`:encodeURIComponent(String(a[`keyless-certificate-id`]))}`,pathParams:{"keyless-certificate-id":String(a[`keyless-certificate-id`]??``),"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.keylessCertificates.get({zone_id:s,keyless_certificate_id:a[`keyless-certificate-id`]})),{successLabel:`Loaded`})}};function v(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`list`,describe:`List all Keyless SSL configurations for a given zone.`,builder:v,handler:async a=>{if(a.dryRun){r({command:`cf keyless-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/keyless_certificates`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});a.zoneId=s,n(await i(`Loading`,async()=>o.keylessCertificates.list({zone_id:s})),{successLabel:`Loaded`})}},b={command:`keyless-certificates`,describe:`keyless-certificates`,builder:e=>e.command(d).command(p).command(h).command(_).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{b as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n}from"./oauth-DAa7SwkM.mjs";import{r}from"./auth-DY_Y2bXC.mjs";import{t as i}from"./output-BqDR9h74.mjs";import{t as a}from"./dry-run-ILZRVpnp.mjs";import{t as o}from"./progress-jYW64HY7.mjs";function s(e){return e.option(`cursor`,{type:`string`,description:`Cursor for pagination.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`list`,describe:`Lists all distinct tag keys used across resources in an account.`,builder:s,handler:async s=>{let c={cursor:s.cursor};if(s.dryRun){a({command:`cf keys list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/tags/keys`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.keys.list({account_id:u,...c})),{successLabel:`Loaded`})}},l={command:`keys`,describe:`keys`,builder:e=>e.command(c).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{l as default};
|