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
package/dist/config.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{
|
|
2
|
+
import{a as e,i as t,n,o as r,r as i,t as a}from"./public-BMg6-Hxh-DgIH5obr.mjs";export{a as bindings,n as defineConfig,i as defineContainer,t as defineWorker,e as exports,r as triggers};
|
|
@@ -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";import{n as s,t as c}from"./body-parser-BGVbwPeM.mjs";function l(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`reboot-purge`,{type:`boolean`,description:`Purge connector state.`}).option(`restart-purge`,{type:`boolean`,description:`Purge connector state.`}).option(`shutdown-purge`,{type:`boolean`,description:`Purge connector state.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Interrupt action for a connector.`})}const u={command:`create <connector-id>`,describe:`Creates an interrupt for a Magic WAN Connector.`,builder:l,handler:async l=>{if(l.dryRun){a({command:`cf connector-interrupts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${l[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(l[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(l[`connector-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.connectorInterrupts.create({...e,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`});return}let f=c({reboot:{purge:l[`reboot-purge`]},restart:{purge:l[`restart-purge`]},shutdown:{purge:l[`shutdown-purge`]}});i(await o(`Creating`,async()=>u.connectorInterrupts.create({...f,account_id:d,connector_id:l[`connector-id`]})),{successLabel:`Created`})}};function d(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`list`,describe:`Lists interrupts for a Magic WAN Connector.`,builder:d,handler:async s=>{if(s.dryRun){a({command:`cf connector-interrupts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/interrupts`,pathParams:{"connector-id":String(s[`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.connectorInterrupts.list({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}},p={command:`connector-interrupts`,describe:`connector-interrupts`,builder:e=>e.command(u).command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p 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.positional(`event-n`,{type:`string`,description:`Event n`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`event-t`,{type:`string`,description:`Event t`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get <event-n>`,describe:`Gets Magic WAN Connector Telemetry Event`,builder:s,handler:async s=>{if(s.dryRun){a({command:`cf connector-telemetry-events get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events/${s[`event-t`]==null?`<event-t>`:encodeURIComponent(String(s[`event-t`]))}.${s[`event-n`]==null?`<event-n>`:encodeURIComponent(String(s[`event-n`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"event-t":String(s[`event-t`]??``),"event-n":String(s[`event-n`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.connectorTelemetryEvents.get({account_id:l,connector_id:s[`connector-id`],event_t:s[`event-t`],event_n:s[`event-n`]})),{successLabel:`Loaded`})}};function l(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`k`,{type:`string`,description:`Filter by event kind`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Lists Magic WAN Connector Telemetry Events`,builder:l,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor,k:s.k};if(s.dryRun){a({command:`cf connector-telemetry-events list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/events`,pathParams:{"connector-id":String(s[`connector-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.connectorTelemetryEvents.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},d={command:`connector-telemetry-events`,describe:`connector-telemetry-events`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d 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.positional(`snapshot-t`,{type:`string`,description:`Snapshot t`,demandOption:!0}).option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const c={command:`get <snapshot-t>`,describe:`Gets Magic WAN Connector Telemetry Snapshot`,builder:s,handler:async s=>{if(s.dryRun){a({command:`cf connector-telemetry-snapshots get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots/${s[`snapshot-t`]==null?`<snapshot-t>`:encodeURIComponent(String(s[`snapshot-t`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``),"snapshot-t":String(s[`snapshot-t`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.connectorTelemetrySnapshots.get({account_id:l,connector_id:s[`connector-id`],snapshot_t:s[`snapshot-t`]})),{successLabel:`Loaded`})}};function l(e){return e.option(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`from`,{type:`number`,description:`From`,demandOption:!0}).option(`to`,{type:`number`,description:`To`,demandOption:!0}).option(`limit`,{type:`number`,description:`Limit`}).option(`cursor`,{type:`string`,description:`Cursor`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Lists Magic WAN Connector Telemetry Snapshots`,builder:l,handler:async s=>{let c={from:s.from,to:s.to,limit:s.limit,cursor:s.cursor};if(s.dryRun){a({command:`cf connector-telemetry-snapshots list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}/telemetry/snapshots`,pathParams:{"connector-id":String(s[`connector-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.connectorTelemetrySnapshots.list({account_id:u,connector_id:s[`connector-id`],...c})),{successLabel:`Loaded`})}},d={command:`connector-telemetry-snapshots`,describe:`connector-telemetry-snapshots`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-
|
|
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,t as c}from"./body-parser-BGVbwPeM.mjs";import{n as l}from"./input-validation-1esLElok.mjs";import{n as u}from"./prompt-CyATfGUu.mjs";import{t as d}from"./cli-types-C3nVfpSG.mjs";function f(e){return e.option(`device-id`,{type:`string`,description:`The device.id field`}).option(`device-provision-license`,{type:`boolean`,description:`When true, create and provision a new licence key for the connector.`}).option(`device-serial-number`,{type:`string`,description:`The device.serial_number field`}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`,default:!0}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone 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 p={command:`create`,describe:`Creates a Magic WAN Connector.`,builder:f,handler:async u=>{if(u.dryRun){a({command:`cf connectors create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.connectors.create({...e,account_id:f})),{successLabel:`Created`});return}let p=c({device:{id:l(u[`device-id`],`device-id`,`text`),provision_license:u[`device-provision-license`],serial_number:l(u[`device-serial-number`],`device-serial-number`,`text`)},activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`)});i(await o(`Creating`,async()=>d.connectors.create({...p,account_id:f})),{successLabel:`Created`})}};function m(e){return e.positional(`connector-id`,{type:`string`,description:`Connector 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 h={command:`delete <connector-id>`,describe:`Deletes a Magic WAN Connector.`,builder:m,handler:async s=>{if(s.dryRun){a({command:`cf connectors delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"connector-id":String(s[`connector-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await u({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}i(await o(`Deleting`,async()=>c.connectors.delete({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`edit <connector-id>`,describe:`Edits properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:g,handler:async u=>{if(u.dryRun){a({command:`cf connectors edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${u[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(u[`connector-id`]))}`,pathParams:{"connector-id":String(u[`connector-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.connectors.edit({...e,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`});return}let p=c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]});i(await o(`Updating`,async()=>d.connectors.edit({...p,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <connector-id>`,describe:`Gets a Magic WAN Connector.`,builder:v,handler:async s=>{if(s.dryRun){a({command:`cf connectors get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${s[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(s[`connector-id`]))}`,pathParams:{"connector-id":String(s[`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.connectors.get({account_id:l,connector_id:s[`connector-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`device-type`,{type:`string`,description:`Filter connectors by device type.`,choices:[`MANAGED`,`LICENSED`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists Magic WAN Connectors.`,builder:d(b),handler:async s=>{let c={device_type:s[`device-type`]};if(s.dryRun){a({command:`cf connectors list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors`,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.connectors.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`connector-id`,{type:`string`,description:`Connector ID`,demandOption:!0}).option(`activated`,{type:`boolean`,description:`The activated field`}).option(`interrupt-window-days-of-week`,{type:`string`,array:!0,description:`Allowed days of the week for upgrades. Default is all days.`}).option(`interrupt-window-duration-hours`,{type:`number`,description:`The interrupt_window_duration_hours field`}).option(`interrupt-window-embargo-dates`,{type:`string`,array:!0,description:`List of dates (YYYY-MM-DD) when upgrades are blocked.`}).option(`interrupt-window-hour-of-day`,{type:`number`,description:`The interrupt_window_hour_of_day field`}).option(`notes`,{type:`string`,description:`The notes field`}).option(`primary`,{type:`boolean`,description:`The primary field`}).option(`site-id`,{type:`string`,description:`The site_id field`}).option(`timezone`,{type:`string`,description:`The timezone field`}).option(`provision-license`,{type:`boolean`,description:`When true, regenerate license key for the connector.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <connector-id>`,describe:`Updates properties of a Magic WAN Connector. May be used to re-provision a license key.`,builder:S,handler:async u=>{if(u.dryRun){a({command:`cf connectors update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/magic/connectors/${u[`connector-id`]==null?`<connector-id>`:encodeURIComponent(String(u[`connector-id`]))}`,pathParams:{"connector-id":String(u[`connector-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Updating`,async()=>d.connectors.update({...e,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`});return}let p=c({activated:u.activated,interrupt_window_days_of_week:u[`interrupt-window-days-of-week`],interrupt_window_duration_hours:u[`interrupt-window-duration-hours`],interrupt_window_embargo_dates:u[`interrupt-window-embargo-dates`],interrupt_window_hour_of_day:u[`interrupt-window-hour-of-day`],notes:l(u.notes,`notes`,`text`),primary:u.primary,site_id:l(u[`site-id`],`site-id`,`text`),timezone:l(u.timezone,`timezone`,`text`),provision_license:u[`provision-license`]});i(await o(`Updating`,async()=>d.connectors.update({...p,account_id:f,connector_id:u[`connector-id`]})),{successLabel:`Updated`})}},w={command:`connectors`,describe:`connectors`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{H as e}from"./dist-DV7LR38l.mjs";import{r as t}from"./ui-DJFcf61J.mjs";import{t as n}from"./local-DGiIS1uM.mjs";import{f as r,g as i,p as a}from"./oauth-DAa7SwkM.mjs";import{i as o,r as s,s as c}from"./auth-DY_Y2bXC.mjs";import{t as l}from"./output-BqDR9h74.mjs";import{t as u}from"./dry-run-ILZRVpnp.mjs";import{t as d}from"./progress-jYW64HY7.mjs";import{n as f,r as p,t as m}from"./body-parser-BGVbwPeM.mjs";import{n as h}from"./input-validation-1esLElok.mjs";import{a as g,i as _,n as v}from"./prompt-CyATfGUu.mjs";import{t as y}from"./cli-types-C3nVfpSG.mjs";import{C as b,E as x,b as S,c as ee,d as te,g as C,h as w,o as T,p as E,u as D,v as O,w as k}from"./dist-DvizctjW.mjs";function A(e){return e.positional(`path`,{type:`string`,demandOption:!0,description:`Directory containing the Dockerfile to build`}).option(`tag`,{alias:`t`,type:`string`,demandOption:!0,description:`Name and optional tag for the built image`}).option(`push`,{alias:`p`,type:`boolean`,default:!1,description:`Push the built image to Cloudflare's managed registry`}).option(`path-to-docker`,{type:`string`,description:`Path to the Docker binary if it is not on PATH`})}const j={command:`build <path>`,describe:`Build a Container image`,builder:A,handler:async t=>{if(t.local)throw Error("--local is not supported with `cf containers build`.");let n={compliance_region:t.push?await a():`public`},i=t.push?await o():``,s=x(i);w({logger:s.logger,fetchResult:s.fetchResult,fetchPagedListResult:s.fetchPagedListResult}),t.push&&D(await r(),i,e(n)),await ee({PATH:t.path,tag:t.tag,push:t.push,pathToDocker:t[`path-to-docker`]},n)}};function M(e){return e.option(`tag`,{alias:`t`,type:`string`,demandOption:!0,description:`Tag of the local image to push`}).option(`path-to-docker`,{type:`string`,description:`Path to the Docker binary if it is not on PATH`})}const N={command:`push`,describe:`Push a local image to the Cloudflare managed registry`,builder:M,handler:async t=>{if(t.local)throw Error("--local is not supported with `cf containers push`.");let n=await o(),i=await r(),s={compliance_region:await a()},c=x(n);w({logger:c.logger,fetchResult:c.fetchResult,fetchPagedListResult:c.fetchPagedListResult}),D(i,n,e(s)),await S({TAG:t.tag,pathToDocker:t[`path-to-docker`]},i,s)}};function P(e){return e.positional(`id`,{type:`string`,demandOption:!0,description:`ID of the container instance`}).positional(`ssh-command`,{type:`string`,array:!0,description:`Command and arguments to run in the container`}).options(te).middleware(e=>{b(e)&&(e.quiet=!0)},!0).parserConfiguration({"populate--":!0,"unknown-options-as-args":!0,"parse-positional-numbers":!1})}const F={command:`ssh <id> [ssh-command..]`,describe:`SSH into a container`,builder:P,handler:async t=>{if(t.local)throw Error("--local is not supported with `cf containers ssh`.");let n=await o(),i=await r(),s={compliance_region:await a()},l=x(n);w({logger:l.logger,fetchResult:l.fetchResult}),T.HEADERS=c(),D(i,n,e(s)),await k({...t,id:t.id,command:[...t[`ssh-command`]??[],...Array.isArray(t[`--`])?t[`--`].map(String):[]]})}};function I(e){return e.option(`configuration-command`,{type:`string`,array:!0,description:`The command that runs when the container starts, passed to the entrypoint.
|
|
3
|
+
You can override this at run-time. If you override only the command,
|
|
4
|
+
it gets passed to the default entrypoint specified in the image.
|
|
5
|
+
`}).option(`configuration-entrypoint`,{type:`string`,array:!0,description:`The entry point for the container, specifying the executable to run when the container starts.
|
|
6
|
+
You can override this at run-time. If you do, the default command from the image is ignored.
|
|
7
|
+
Specify both entrypoint and command at run-time to completely replace the image defaults.
|
|
8
|
+
`}).option(`configuration-image`,{type:`string`,description:`Image url.`}).option(`configuration-instance-type`,{type:`string`,description:`The instance type configures vCPU, memory, and disk.
|
|
9
|
+
|
|
10
|
+
- "lite": 1/16 vCPU, 256 MiB memory, 2 GB disk
|
|
11
|
+
- "basic": 1/4 vCPU, 1 GiB memory, 4 GB disk
|
|
12
|
+
- "standard-1": 1/2 vCPU, 4 GiB memory, 8 GB disk
|
|
13
|
+
- "standard-2": 1 vCPU, 6 GiB memory, 12 GB disk
|
|
14
|
+
- "standard-3": 2 vCPU, 8 GiB memory, 16 GB disk
|
|
15
|
+
- "standard-4": 4 vCPU, 12 GiB memory, 20 GB disk
|
|
16
|
+
`}).option(`configuration-observability-logs-enabled`,{type:`boolean`,description:`The configuration.observability.logs.enabled field`}).option(`constraints-jurisdiction`,{type:`string`,description:`Currently supports only "eu" and "fedramp". Overlap between jurisdiction and region is allowed for ENAM, WNAM (FedRAMP) and EEUR, WEUR (EU).`}).option(`constraints-regions`,{type:`string`,array:!0,description:`The constraints.regions field`}).option(`instances`,{type:`number`,description:`The initial number of deployments to create.`}).option(`max-instances`,{type:`number`,description:`Sets the maximum number of instances that the application can run.`}).option(`name`,{type:`string`,description:`The name for this application.`}).option(`observability-logs-enabled`,{type:`boolean`,description:`The observability.logs.enabled field`}).option(`rollout-active-grace-period`,{type:`number`,description:`Grace period for active instances to stay alive before becoming eligible for shutdown signal due to a rollout, in seconds.
|
|
17
|
+
Defaults to 0.
|
|
18
|
+
`,default:0}).option(`scheduling-policy`,{type:`string`,description:`Selects a scheduler-backed application. Use \`default\` when the Containers
|
|
19
|
+
scheduler should maintain the requested number of instances and manage deployment
|
|
20
|
+
configuration, placement, scaling, versions, and rollouts.
|
|
21
|
+
`,choices:[`default`,`durable_object`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:"Create a Containers application. Set `scheduling_policy` to `default` for a scheduler-backed application with deployment configuration, instance counts, constraints, versions, and rollouts. Set it to `durable_object` for a Durable Object-managed application where each Durable Object creates and manages the lifecycle of its container instance. For `durable_object` requests, supply only `name`, `scheduling_policy`, and `durable_objects`. "}).implies(`instances`,[`max-instances`]).implies(`max-instances`,[`instances`]).check(e=>{if([`configuration-command`,`configuration-entrypoint`,`configuration-image`,`configuration-instance-type`,`configuration-observability-logs-enabled`].some(t=>e[t]!==void 0)){let t=[`configuration-image`].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 --configuration-* flag is set`)}return!0})}const L={command:`create`,describe:'Create a Containers application. Use `scheduling_policy: "default"` for a scheduler-backed application. The Containers scheduler maintains the requested instance count and manages deployment configuration, placement, scaling, versions, and rollouts. Use `scheduling_policy: "durable_object"` for a Durable Object-managed application. Each Durable Object creates and manages the lifecycle of its container instance. This request accepts only `name`, `scheduling_policy`, and `durable_objects`. Application-level configuration, scaling, constraints, versions, and rollouts do not apply.',builder:I,handler:async e=>{if(e.dryRun){u({command:`cf containers applications create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({configuration:{command:e[`configuration-command`],entrypoint:e[`configuration-entrypoint`],image:h(e[`configuration-image`],`configuration-image`,`text`),instance_type:h(e[`configuration-instance-type`],`configuration-instance-type`,`text`),observability:{logs:{enabled:e[`configuration-observability-logs-enabled`]}}},constraints:{jurisdiction:h(e[`constraints-jurisdiction`],`constraints-jurisdiction`,`text`),regions:e[`constraints-regions`]},instances:e.instances,max_instances:e[`max-instances`],name:h(e.name,`name`,`text`),observability:{logs:{enabled:e[`observability-logs-enabled`]}},rollout_active_grace_period:e[`rollout-active-grace-period`],scheduling_policy:h(e[`scheduling-policy`],`scheduling-policy`,`text`)}):f(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=f(e.body);l(await d(`Creating`,async()=>t.containers.applications.create({body:n,account_id:a})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await g(`name`,`The name for this application.`)),e[`scheduling-policy`]===void 0&&(e[`scheduling-policy`]=await _(`scheduling-policy`,"Selects a scheduler-backed application. Use `default` when the Containers scheduler should maintain the requested number of instances and manage deployment configuration, placement, scaling, versions, and rollouts. ",[`default`,`durable_object`]));let o=m({configuration:{command:e[`configuration-command`],entrypoint:e[`configuration-entrypoint`],image:h(e[`configuration-image`],`configuration-image`,`text`),instance_type:h(e[`configuration-instance-type`],`configuration-instance-type`,`text`),observability:{logs:{enabled:e[`configuration-observability-logs-enabled`]}}},constraints:{jurisdiction:h(e[`constraints-jurisdiction`],`constraints-jurisdiction`,`text`),regions:e[`constraints-regions`]},instances:e.instances,max_instances:e[`max-instances`],name:h(e.name,`name`,`text`),observability:{logs:{enabled:e[`observability-logs-enabled`]}},rollout_active_grace_period:e[`rollout-active-grace-period`],scheduling_policy:h(e[`scheduling-policy`],`scheduling-policy`,`text`)});l(await d(`Creating`,async()=>t.containers.applications.create({body:o,account_id:a})),{successLabel:`Created`})}};function R(e){return e.positional(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,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 z={command:`delete <application-id>`,describe:`Deletes a single application by id.`,builder:R,handler:async e=>{if(e.dryRun){u({command:`cf containers applications delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,!await v({force:!!e.force,message:`This operation permanently deletes the application and stops its containers.`})){process.stderr.write(`Aborted.
|
|
22
|
+
`);return}l(await d(`Deleting`,async()=>t.containers.applications.delete({account_id:a,application_id:e[`application-id`]})),{successLabel:`Deleted`})}};function B(e){return e.positional(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`constraints-jurisdiction`,{type:`string`,description:`Currently supports only "eu" and "fedramp". Overlap between jurisdiction and region is allowed for ENAM, WNAM (FedRAMP) and EEUR, WEUR (EU).`}).option(`constraints-regions`,{type:`string`,array:!0,description:`The constraints.regions field`}).option(`max-instances`,{type:`number`,description:`Maximum number of instances that an autoscaling application can run.`}).option(`observability-logs-enabled`,{type:`boolean`,description:`The observability.logs.enabled field`}).option(`rollout-active-grace-period`,{type:`number`,description:`Grace period for active instances to stay alive before becoming eligible for shutdown signal due to a rollout, in seconds.
|
|
23
|
+
Defaults to 0.
|
|
24
|
+
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for modifying a Containers application without replacing its instances. Deployment configuration changes such as image, resource allocation, command, and environment variables require an application rollout. `})}const V={command:`edit <application-id>`,describe:`Modifies a single application by id. Changes that replace instance deployment configuration, including the image, must be applied with a rollout.`,builder:B,handler:async e=>{if(e.dryRun){u({command:`cf containers applications edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({constraints:{jurisdiction:h(e[`constraints-jurisdiction`],`constraints-jurisdiction`,`text`),regions:e[`constraints-regions`]},max_instances:e[`max-instances`],observability:{logs:{enabled:e[`observability-logs-enabled`]}},rollout_active_grace_period:e[`rollout-active-grace-period`]}):f(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=f(e.body);l(await d(`Updating`,async()=>t.containers.applications.edit({...n,account_id:a,application_id:e[`application-id`]})),{successLabel:`Updated`});return}let o=m({constraints:{jurisdiction:h(e[`constraints-jurisdiction`],`constraints-jurisdiction`,`text`),regions:e[`constraints-regions`]},max_instances:e[`max-instances`],observability:{logs:{enabled:e[`observability-logs-enabled`]}},rollout_active_grace_period:e[`rollout-active-grace-period`]});l(await d(`Updating`,async()=>t.containers.applications.edit({...o,account_id:a,application_id:e[`application-id`]})),{successLabel:`Updated`})}};function H(e){return e.positional(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get <application-id>`,describe:`Returns a single application by id.`,builder:H,handler:async e=>{if(e.dryRun){u({command:`cf containers applications get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,l(await d(`Loading`,async()=>t.containers.applications.get({account_id:a,application_id:e[`application-id`]})),{successLabel:`Loaded`})}};function W(e){return e.positional(`instance-id`,{type:`string`,description:`A container instance ID (64-character hex Durable Object actor ID).`,demandOption:!0}).option(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const G={command:`get <instance-id>`,describe:`Returns a container instance belonging to an application.`,builder:W,handler:async e=>{if(e.dryRun){u({command:`cf containers applications instances get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}/instances/${e[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(e[`instance-id`]))}`,pathParams:{"application-id":String(e[`application-id`]??``),"instance-id":String(e[`instance-id`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,l(await d(`Loading`,async()=>t.containers.applications.instances.get({account_id:a,application_id:e[`application-id`],instance_id:e[`instance-id`]})),{successLabel:`Loaded`})}};function K(e){return e.option(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`per-page`,{type:`number`,description:`Maximum number of instances to return per page. Defaults to all.`}).option(`page-token`,{type:`string`,description:`Opaque token from a previous response to retrieve the next page.`}).option(`state`,{type:`string`,description:"Filters instances by lifecycle state. `active` includes provisioning, running, and stopping instances; `not-active` includes stopped and failed instances. When omitted, all instances are returned.",choices:[`active`,`not-active`]}).option(`name-prefix`,{type:`string`,description:`Filter instances by a case-sensitive name prefix. Keep the same prefix when using a page token.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list`,describe:`Lists container instances belonging to an application.`,builder:y(K),handler:async e=>{let t={per_page:e[`per-page`],page_token:e[`page-token`],state:e.state,name_prefix:e[`name-prefix`]};if(e.dryRun){u({command:`cf containers applications instances list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}/instances`,pathParams:{"application-id":String(e[`application-id`]??``)},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,l(await d(`Loading`,async()=>a.containers.applications.instances.list({account_id:o,application_id:e[`application-id`],...t})),{successLabel:`Loaded`})}},q={command:`instances`,describe:`Inspect Containers instances belonging to applications`,builder:e=>e.command(G).command(ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function J(e){return e.option(`name`,{type:`string`,description:`Filter applications by name.`}).option(`image`,{type:`string`,description:`Filter applications by image.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`Lists all the applications that are associated with your account.`,builder:J,handler:async e=>{let t={name:e.name,image:e.image};if(e.dryRun){u({command:`cf containers applications list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications`,pathParams:{},query:t,bodyKind:`none`});return}let a=await s(e),o=e.local?n:await r();e.accountId=o,l(await d(`Loading`,async()=>a.containers.applications.list({account_id:o,...t})),{successLabel:`Loaded`})}};function X(e){return e.positional(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`description`,{type:`string`,description:`Description of the rollout process.`}).option(`kind`,{type:`string`,description:`Kind of the rollout process. Defaults to "full_auto".
|
|
25
|
+
- "full_auto": For rolling rollouts, starts progressing steps upon rollout creation. For new_instances rollouts, advances percentage targets automatically after target-version health is observed.
|
|
26
|
+
- "full_manual": Requires manually progressing each step in the rollout using the UpdateRollout's action parameter.
|
|
27
|
+
`,choices:[`full_auto`,`full_manual`],default:`full_auto`}).option(`percentage`,{type:`number`,description:`Initial target version percentage (0-100). Version sync actively replaces instances to match.
|
|
28
|
+
Required when strategy is "new_instances" and kind is "full_manual". When strategy is "new_instances" and kind is "full_auto", omitted percentage starts at 10% or the smallest percentage that targets at least one instance. Unused for "rolling".
|
|
29
|
+
`}).option(`step-percentage`,{type:`number`,description:`Percentage of rollout to increase in each step when "steps" is absent. Applicable values: 5, 10, 20, 25, 50, 100.
|
|
30
|
+
These create rollouts with 20, 10, 5, 4, 2, 1 steps respectively.
|
|
31
|
+
Only valid for "rolling" strategy.
|
|
32
|
+
`}).option(`steps`,{type:`string`,description:`Steps defining the rollout process, used when "step_percentage" is absent.
|
|
33
|
+
Specify only one of "step_percentage" or "steps" when creating a rollout.
|
|
34
|
+
"steps" allow granular control over each step.
|
|
35
|
+
Only valid for "rolling" strategy.
|
|
36
|
+
. Provide as a JSON array of objects or @path/to/file.json.`}).option(`strategy`,{type:`string`,description:`Strategy used for the rollout.
|
|
37
|
+
- "rolling": Step-based rollout with health gates. Actively replaces instances to reach each step's target percentage.
|
|
38
|
+
- "new_instances": Percentage control over version distribution. Version sync actively replaces instances to match the configured percentage. The "full_auto" kind advances through fixed percentage targets after target-version health is observed.
|
|
39
|
+
`,choices:[`rolling`,`new_instances`]}).option(`target-configuration-command`,{type:`string`,array:!0,description:`The command that runs when the container starts, passed to the entrypoint.
|
|
40
|
+
You can override this at run-time. If you override only the command,
|
|
41
|
+
it gets passed to the default entrypoint specified in the image.
|
|
42
|
+
`}).option(`target-configuration-entrypoint`,{type:`string`,array:!0,description:`The entry point for the container, specifying the executable to run when the container starts.
|
|
43
|
+
You can override this at run-time. If you do, the default command from the image is ignored.
|
|
44
|
+
Specify both entrypoint and command at run-time to completely replace the image defaults.
|
|
45
|
+
`}).option(`target-configuration-image`,{type:`string`,description:`Image url.`}).option(`target-configuration-instance-type`,{type:`string`,description:`The instance type configures vCPU, memory, and disk.
|
|
46
|
+
|
|
47
|
+
- "lite": 1/16 vCPU, 256 MiB memory, 2 GB disk
|
|
48
|
+
- "basic": 1/4 vCPU, 1 GiB memory, 4 GB disk
|
|
49
|
+
- "standard-1": 1/2 vCPU, 4 GiB memory, 8 GB disk
|
|
50
|
+
- "standard-2": 1 vCPU, 6 GiB memory, 12 GB disk
|
|
51
|
+
- "standard-3": 2 vCPU, 8 GiB memory, 16 GB disk
|
|
52
|
+
- "standard-4": 4 vCPU, 12 GiB memory, 20 GB disk
|
|
53
|
+
`,default:`lite`}).option(`target-configuration-observability-logs-enabled`,{type:`boolean`,description:`The target_configuration.observability.logs.enabled field`,default:!1}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body to create a new rollout for a scheduler-backed application.`})}const Z={command:`create <application-id>`,describe:'Creates a rollout to update the application\'s configuration across instances with minimal downtime. Rollouts apply only to scheduler-backed applications with `scheduling_policy: "default"`. Versions and rollouts do not apply to applications with `scheduling_policy: "durable_object"`.',builder:X,handler:async e=>{if(e.dryRun){u({command:`cf containers applications rollouts create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}/rollouts`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`json`,body:e.body===void 0?m({description:h(e.description,`description`,`text`),kind:h(e.kind,`kind`,`text`),percentage:e.percentage,step_percentage:e[`step-percentage`],steps:p(e.steps,`steps`),strategy:h(e.strategy,`strategy`,`text`),target_configuration:{command:e[`target-configuration-command`],entrypoint:e[`target-configuration-entrypoint`],image:h(e[`target-configuration-image`],`target-configuration-image`,`text`),instance_type:h(e[`target-configuration-instance-type`],`target-configuration-instance-type`,`text`),observability:{logs:{enabled:e[`target-configuration-observability-logs-enabled`]}}}}):f(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=f(e.body);l(await d(`Creating`,async()=>t.containers.applications.rollouts.create({...n,account_id:a,application_id:e[`application-id`]})),{successLabel:`Created`});return}e.description===void 0&&(e.description=await g(`description`,`Description of the rollout process.`)),e.strategy===void 0&&(e.strategy=await _(`strategy`,`Strategy used for the rollout. - "rolling": Step-based rollout with health gates. Actively replaces instances to reach each step's target percentage. - "new_instances": Percentage control over version distribution. Version sync actively replaces instances to match the configured percentage. The "full_auto" kind advances through fixed percentage targets after target-version health is observed. `,[`rolling`,`new_instances`]));let o=m({description:h(e.description,`description`,`text`),kind:h(e.kind,`kind`,`text`),percentage:e.percentage,step_percentage:e[`step-percentage`],steps:p(e.steps,`steps`),strategy:h(e.strategy,`strategy`,`text`),target_configuration:{command:e[`target-configuration-command`],entrypoint:e[`target-configuration-entrypoint`],image:h(e[`target-configuration-image`],`target-configuration-image`,`text`),instance_type:h(e[`target-configuration-instance-type`],`target-configuration-instance-type`,`text`),observability:{logs:{enabled:e[`target-configuration-observability-logs-enabled`]}}}});l(await d(`Creating`,async()=>t.containers.applications.rollouts.create({...o,account_id:a,application_id:e[`application-id`]})),{successLabel:`Created`})}},re={command:`rollouts`,describe:`Manage rollouts for scheduler-backed applications`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ie(e){return e.option(`application-id`,{type:`string`,description:`An Application ID represents an identifier of an application.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ae={command:`list`,describe:'Returns all versions for a scheduler-backed application with `scheduling_policy: "default"`. Versions and rollouts do not apply to applications with `scheduling_policy: "durable_object"`.',builder:ie,handler:async e=>{if(e.dryRun){u({command:`cf containers applications versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/applications/${e[`application-id`]==null?`<application-id>`:encodeURIComponent(String(e[`application-id`]))}/versions`,pathParams:{"application-id":String(e[`application-id`]??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,l(await d(`Loading`,async()=>t.containers.applications.versions.list({account_id:a,application_id:e[`application-id`]})),{successLabel:`Loaded`})}},oe={command:`versions`,describe:`Inspect versions of scheduler-backed applications`,builder:e=>e.command(ae).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},se={command:`applications`,describe:`Manage Containers applications`,builder:e=>e.command(L).command(z).command(V).command(U).command(Y).command(q).command(re).command(oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};async function Q(){let t=await o(),n=await r(),i={compliance_region:await a()};return T.HEADERS=c(),D(n,t,e(i)),{accountId:n,complianceConfig:i}}function ce(e){return e.positional(`image`,{type:`string`,demandOption:!0,description:`Image and tag to delete, of the form IMAGE:TAG`}).option(`force`,{type:`boolean`,alias:`f`,default:!1,description:`Skip the deletion confirmation prompt`})}const le={command:`delete <image>`,describe:`Delete an image tag from the Cloudflare managed registry`,builder:ce,async handler(e){if(e.local)throw Error("--local is not supported with `cf containers images delete`.");if(O(e.image),!await v({force:e.force,message:`Delete ${e.image}? This action cannot be undone.`}))return;let n=await Q(),r=await d(`Deleting`,()=>E({...n,image:e.image}));l({image:e.image,...r},{quiet:e.quiet}),r.warning&&console.warn(t(r.warning))}};function ue(e){return e.option(`filter`,{type:`string`,description:`Regex to filter repository names`})}const de={command:`list`,describe:`List images in the Cloudflare managed registry`,builder:ue,async handler(e){if(e.local)throw Error("--local is not supported with `cf containers images list`.");e.filter!==void 0&&new RegExp(e.filter);let t=await Q();l(await d(`Loading`,()=>C({...t,filter:e.filter})),{quiet:e.quiet})}};function fe(e){return e.option(`image`,{type:`string`,description:`Image url.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A digest-pinned managed container image to prepare for the new runtime.`})}const pe={command:`prepare`,describe:`Idempotently starts or observes preparation of the runtime artifacts required to run one digest-pinned managed container image on Cloudflare's network. Returns 202 while durable preparation continues and 200 when the image is ready or preparation has reached a terminal error.`,builder:fe,handler:async e=>{if(e.dryRun){u({command:`cf containers images prepare`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/image-preparations`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({image:h(e.image,`image`,`text`)}):f(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=f(e.body);l(await d(`Creating`,async()=>t.containers.images.prepare({...n,account_id:a})),{successLabel:`Created`});return}e.image===void 0&&(e.image=await g(`image`,`Image url.`));let o=m({image:h(e.image,`image`,`text`)});l(await d(`Creating`,async()=>t.containers.images.prepare({...o,account_id:a})),{successLabel:`Created`})}},$={command:`images`,describe:`Operations for images`,builder:e=>e.command(le).command(de).command(pe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function me(e){return e.option(`auth-private-credential-secret-name`,{type:`string`,description:`Name of the secret within the store.`}).option(`auth-private-credential-store-id`,{type:`string`,description:`Identifier of the Secrets Store containing the secret.`}).option(`auth-public-credential`,{type:`string`,description:`The non-secret part of the registry credential: an AWS access key ID for ECR,
|
|
54
|
+
a username for Docker Hub, or a service account email for Google Artifact Registry.
|
|
55
|
+
`}).option(`domain`,{type:`string`,description:"Hostname of the private registry, without a scheme or image path. Supported\nhostnames are `docker.io`, AWS ECR hostnames, and Google Artifact Registry\n`*-docker.pkg.dev` hostnames.\n"}).option(`is-public`,{type:`boolean`,description:`Omit this field or set it to \`false\`. Public Docker Hub images do not require
|
|
56
|
+
registry configuration and cannot be added with this endpoint.
|
|
57
|
+
`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Configuration for connecting Containers to a supported private external image registry. See [Image management](https://developers.cloudflare.com/containers/platform-details/image-management/) for supported providers and credential setup instructions. `})}const he={command:`create`,describe:`Registers credentials for a supported private external image registry so Containers can pull images from it. This endpoint does not create a registry or upload an image. Public Docker Hub images and images in the Cloudflare managed registry do not require this configuration. Refer to [Image management](https://developers.cloudflare.com/containers/platform-details/image-management/) for supported registries and instructions for storing registry credentials.`,builder:me,handler:async e=>{if(e.dryRun){u({command:`cf containers registries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/registries`,pathParams:{},bodyKind:`json`,body:e.body===void 0?m({auth:{private_credential:{secret_name:h(e[`auth-private-credential-secret-name`],`auth-private-credential-secret-name`,`text`),store_id:h(e[`auth-private-credential-store-id`],`auth-private-credential-store-id`,`text`)},public_credential:h(e[`auth-public-credential`],`auth-public-credential`,`text`)},domain:h(e.domain,`domain`,`text`),is_public:e[`is-public`]}):f(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=f(e.body);l(await d(`Creating`,async()=>t.containers.registries.create({...n,account_id:a})),{successLabel:`Created`});return}e[`auth-private-credential-secret-name`]===void 0&&(e[`auth-private-credential-secret-name`]=await g(`auth-private-credential-secret-name`,`Name of the secret within the store.`)),e[`auth-private-credential-store-id`]===void 0&&(e[`auth-private-credential-store-id`]=await g(`auth-private-credential-store-id`,`Identifier of the Secrets Store containing the secret.`)),e[`auth-public-credential`]===void 0&&(e[`auth-public-credential`]=await g(`auth-public-credential`,`The non-secret part of the registry credential: an AWS access key ID for ECR, a username for Docker Hub, or a service account email for Google Artifact Registry. `)),e.domain===void 0&&(e.domain=await g(`domain`,"Hostname of the private registry, without a scheme or image path. Supported hostnames are `docker.io`, AWS ECR hostnames, and Google Artifact Registry `*-docker.pkg.dev` hostnames. "));let o=m({auth:{private_credential:{secret_name:h(e[`auth-private-credential-secret-name`],`auth-private-credential-secret-name`,`text`),store_id:h(e[`auth-private-credential-store-id`],`auth-private-credential-store-id`,`text`)},public_credential:h(e[`auth-public-credential`],`auth-public-credential`,`text`)},domain:h(e.domain,`domain`,`text`),is_public:e[`is-public`]});l(await d(`Creating`,async()=>t.containers.registries.create({...o,account_id:a})),{successLabel:`Created`})}};function ge(e){return e.positional(`domain`,{type:`string`,description:`The domain to get credentials for.`,demandOption:!0}).option(`expiration-minutes`,{type:`number`,description:`The number of minutes Cloudflare managed registry credentials stay valid. Required for managed registries and must remain positive. Cloudflare ignores this value for external registries.`}).option(`permissions`,{type:`string`,array:!0,description:`The permissions for Cloudflare managed registry credentials. Required for managed registries. Cloudflare ignores this value for external registries.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Specifies the configuration for the image registry credential to create. Cloudflare requires both fields for managed registries. For external registries, Cloudflare ignores both fields, and the registry provider determines the returned credentials' permissions and lifetime.`})}const _e={command:`generate <domain>`,describe:`Generates credentials for accessing a configured container image registry.`,builder:ge,handler:async e=>{if(e.dryRun){u({command:`cf containers registries credentials generate`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/registries/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}/credentials`,pathParams:{domain:String(e.domain??``)},bodyKind:`json`,body:e.body===void 0?m({expiration_minutes:e[`expiration-minutes`],permissions:e.permissions}):f(e.body)});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,e.body){let n=f(e.body);l(await d(`Creating`,async()=>t.containers.registries.credentials.generate({...n,account_id:a,domain:e.domain})),{successLabel:`Created`});return}let o=m({expiration_minutes:e[`expiration-minutes`],permissions:e.permissions});l(await d(`Creating`,async()=>t.containers.registries.credentials.generate({...o,account_id:a,domain:e.domain})),{successLabel:`Created`})}},ve={command:`credentials`,describe:`Generate image registry credentials`,builder:e=>e.command(_e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ye(e){return e.positional(`domain`,{type:`string`,description:`The domain to delete.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const be={command:`delete <domain>`,describe:`Delete a registry from the account, this will prevent Containers from pulling images from the registry.`,builder:ye,handler:async e=>{if(e.dryRun){u({command:`cf containers registries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/registries/${e.domain==null?`<domain>`:encodeURIComponent(String(e.domain))}`,pathParams:{domain:String(e.domain??``)},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();if(e.accountId=a,!await v({force:!!e.force,message:`This operation deletes the registry configuration. Containers will no longer be able to pull images from it.`})){process.stderr.write(`Aborted.
|
|
58
|
+
`);return}l(await d(`Deleting`,async()=>t.containers.registries.delete({account_id:a,domain:e.domain})),{successLabel:`Deleted`})}};function xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`list`,describe:`Get the list of configured registries in the account.`,builder:xe,handler:async e=>{if(e.dryRun){u({command:`cf containers registries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await i()??`<account-id>`}/containers/registries`,pathParams:{},bodyKind:`none`});return}let t=await s(e),a=e.local?n:await r();e.accountId=a,l(await d(`Loading`,async()=>t.containers.registries.list({account_id:a})),{successLabel:`Loaded`})}},Ce={command:`registries`,describe:`Manage Containers image registries`,builder:e=>e.command(he).command(be).command(Se).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},we={command:`containers`,describe:`Deploy and manage Containers applications on Cloudflare's global network`,builder:e=>e.command(j).command(N).command(F).command(se).command($).command(Ce).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{we as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
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,i as l,n as u}from"./prompt-CyATfGUu.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Array of Content Scanning custom expressions to create.`})}const f={command:`create`,describe:'Create one or more Content Scanning custom expressions, appending them to the existing list of the zone, and return the updated list. Each expression reaches content objects the scanner cannot find automatically, for example `lookup_json_string(http.request.body.raw, "file")`.',builder:d,handler:async o=>{if(o.dryRun){r({command:`cf content-scan expressions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/content-upload-scan/payloads`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?void 0:a(o.body)});return}let s=await t(o),c=await e({zone:o.zone},s,{quiet:o.quiet});if(o.zoneId=c,o.body){let e=a(o.body);n(await i(`Creating`,async()=>s.contentScan.expressions.create({body:e,zone_id:c})),{successLabel:`Created`});return}if(o.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function p(e){return e.positional(`expression-id`,{type:`string`,description:`Defines the unique ID for this Content Scanning custom expression.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const m={command:`delete <expression-id>`,describe:`Delete the Content Scanning custom expression with the given identifier and return the expressions that remain. Content objects reached only by the deleted expression are no longer scanned.`,builder:p,handler:async a=>{if(a.dryRun){r({command:`cf content-scan expressions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/payloads/${a[`expression-id`]==null?`<expression-id>`:encodeURIComponent(String(a[`expression-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"expression-id":String(a[`expression-id`]??``)},bodyKind:`none`});return}let o=await t(a),s=await e({zone:a.zone},o,{quiet:a.quiet});if(a.zoneId=s,!await u({force:!!a.force,message:`This operation deletes a Content Scanning custom expression.`})){process.stderr.write(`Aborted.
|
|
3
3
|
`);return}n(await i(`Deleting`,async()=>o.contentScan.expressions.delete({zone_id:s,expression_id:a[`expression-id`]})),{successLabel:`Deleted`})}};function h(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const g={command:`list`,describe:`List the Content Scanning custom expressions configured for the zone, each with its own identifier. A custom expression tells the scanner how to reach content objects in a request it cannot parse on its own, such as files Base64-encoded inside a JSON body.`,builder:h,handler:async a=>{if(a.dryRun){r({command:`cf content-scan expressions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/payloads`,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.contentScan.expressions.list({zone_id:s})),{successLabel:`Loaded`})}};function _(e){return e.positional(`expression-id`,{type:`string`,description:`Defines the unique ID for this Content Scanning custom expression.`,demandOption:!0}).option(`payload`,{type:`string`,description:`Defines the custom content extraction expression used to reach content objects in the request.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Content Scanning custom expression to update.`})}const v={command:`update <expression-id>`,describe:`Update the Content Scanning custom expression with the given identifier and return the updated list of expressions.`,builder:_,handler:async l=>{if(l.dryRun){r({command:`cf content-scan expressions update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/content-upload-scan/payloads/${l[`expression-id`]==null?`<expression-id>`:encodeURIComponent(String(l[`expression-id`]))}`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``),"expression-id":String(l[`expression-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({payload:s(l.payload,`payload`,`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(`Updating`,async()=>u.contentScan.expressions.update({...e,zone_id:d,expression_id:l[`expression-id`]})),{successLabel:`Updated`});return}l.payload===void 0&&(l.payload=await c(`payload`,`Defines the custom content extraction expression used to reach content objects in the request.`));let f=o({payload:s(l.payload,`payload`,`text`)});n(await i(`Updating`,async()=>u.contentScan.expressions.update({...f,zone_id:d,expression_id:l[`expression-id`]})),{successLabel:`Updated`})}},y={command:`expressions`,describe:`Custom expressions that tell the scanner how to reach content objects it cannot parse on its own`,builder:e=>e.command(f).command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`get`,describe:`Get the current Content Scanning status for the zone, together with the date the status was last modified.`,builder:b,handler:async a=>{if(a.dryRun){r({command:`cf content-scan get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/content-upload-scan/settings`,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.contentScan.get({zone_id:s})),{successLabel:`Loaded`})}};function S(e){return e.option(`value`,{type:`string`,description:`The status value for Content Scanning.`,choices:[`enabled`,`disabled`]}).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:`Content Scanning settings to update.`})}const C={command:`update`,describe:"Update the Content Scanning status by setting the status value to `enabled` or `disabled`. This is equivalent to calling the dedicated enable and disable endpoints.",builder:S,handler:async c=>{if(c.dryRun){r({command:`cf content-scan update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/content-upload-scan/settings`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({value:s(c.value,`value`,`text`)}):a(c.body)});return}let d=await t(c),f=await e({zone:c.zone},d,{quiet:c.quiet});if(c.zoneId=f,!await u({force:!!c.force,message:`This operation toggles Content Scanning for a zone.`})){process.stderr.write(`Aborted.
|
|
4
4
|
`);return}if(c.body){let e=a(c.body);n(await i(`Deleting`,async()=>d.contentScan.update({...e,zone_id:f})),{successLabel:`Deleted`});return}c.value===void 0&&(c.value=await l(`value`,`The status value for Content Scanning.`,[`enabled`,`disabled`]));let p=o({value:s(c.value,`value`,`text`)});n(await i(`Deleting`,async()=>d.contentScan.update({...p,zone_id:f})),{successLabel:`Deleted`})}},w={command:`content-scan`,describe:`Malicious uploads detection, scan uploaded content in HTTP requests for malware and malicious payloads`,builder:e=>e.command(x).command(C).command(y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{w as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
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";function c(e){return e.option(`id`,{type:`string`,description:`The feature identifier.`,choices:[`csam_scanner`]}).option(`value-email`,{type:`string`,description:`Notification email address for CSAM scan results. When changed,
|
|
3
3
|
email verification is triggered automatically.
|
|
4
4
|
`}).option(`value-enabled`,{type:`boolean`,description:`Whether CSAM scanning is enabled for this zone.`}).option(`value-resend-email`,{type:`boolean`,description:`Set to true to trigger re-sending the email verification.
|
|
5
5
|
Write-only; never appears in responses (omitted when false).
|
|
@@ -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";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:`Retrieve the Certificate Transparency alerting subscription settings for a zone. Returns whether CT monitoring is enabled and the list of email addresses that receive alerts, if any have been configured.`,builder:s,handler:async a=>{if(a.dryRun){r({command:`cf ct-alerting get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/ct/alerting`,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.ctAlerting.get({zone_id:s})),{successLabel:`Loaded`})}};function l(e){return e.option(`emails`,{type:`string`,array:!0,description:`Email addresses that receive CT alert notifications for the zone. A maximum of 100 addresses may be configured. Each address must be a valid RFC 5322 email address and must not contain a comma.
|
|
3
3
|
`}).option(`enabled`,{type:`boolean`,description:`Whether CT alerting is enabled for the zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating CT alerting subscription settings.`})}const u={command:`update`,describe:"Create or update the Certificate Transparency alerting subscription for a zone. Enables or disables email notifications when certificates are issued for the zone's domains. The `enabled` field is required on every request and controls whether the subscription is active. The `emails` field is optional and, when provided, replaces the stored recipient list for the zone. When `emails` is omitted, the stored recipient list is preserved and only the enabled state is toggled. A maximum of 100 email addresses may be configured per zone. Requests that omit `enabled` are rejected with error code 1008. Subscribe and unsubscribe notification emails are only sent for recipients whose effective subscription state changes. Idempotent requests (no state change) send no notification email.",builder:l,handler:async s=>{if(s.dryRun){r({command:`cf ct-alerting update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/ct/alerting`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({emails:s.emails,enabled:s.enabled}):a(s.body)});return}let c=await t(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=a(s.body);n(await i(`Updating`,async()=>c.ctAlerting.update({...e,zone_id:l})),{successLabel:`Updated`});return}if(s.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let u=o({emails:s.emails,enabled:s.enabled});n(await i(`Updating`,async()=>c.ctAlerting.update({...u,zone_id:l})),{successLabel:`Updated`})}},d={command:`ct-alerting`,describe:`ct-alerting`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{d as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{h as e}from"./oauth-DAa7SwkM.mjs";import{r as t}from"./auth-DY_Y2bXC.mjs";import{t as n}from"./output-BqDR9h74.mjs";import{t as r}from"./dry-run-ILZRVpnp.mjs";import{t as i}from"./progress-jYW64HY7.mjs";import{n as a,r as o,t as s}from"./body-parser-BGVbwPeM.mjs";import{n as c}from"./input-validation-1esLElok.mjs";import{a as l,n as u}from"./prompt-CyATfGUu.mjs";import{t as d}from"./cli-types-C3nVfpSG.mjs";function f(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 certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`],default:`production`}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
|
|
3
|
+
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`type`,{type:`string`,description:`The type 'legacy_custom' enables support for legacy clients which do not include SNI in the TLS handshake.`,choices:[`legacy_custom`,`sni_custom`],default:`legacy_custom`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const p={command:`create`,describe:`Upload a new SSL certificate for a zone.`,builder:f,handler:async o=>{if(o.dryRun){r({command:`cf custom-certificates create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({bundle_method:c(o[`bundle-method`],`bundle-method`,`text`),certificate:c(o.certificate,`certificate`,`text`),custom_csr_id:c(o[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(o.deploy,`deploy`,`text`),geo_restrictions:{label:c(o[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(o.policy,`policy`,`text`),private_key:c(o[`private-key`],`private-key`,`text`),type:c(o.type,`type`,`text`)}):a(o.body)});return}let u=await t(o),d=await e({zone:o.zone},u,{quiet:o.quiet});if(o.zoneId=d,o.body){let e=a(o.body);n(await i(`Creating`,async()=>u.customCertificates.create({...e,zone_id:d})),{successLabel:`Created`});return}o.certificate===void 0&&(o.certificate=await l(`certificate`,`The zone's SSL certificate or certificate and the intermediate(s).`));let f=s({bundle_method:c(o[`bundle-method`],`bundle-method`,`text`),certificate:c(o.certificate,`certificate`,`text`),custom_csr_id:c(o[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(o.deploy,`deploy`,`text`),geo_restrictions:{label:c(o[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(o.policy,`policy`,`text`),private_key:c(o[`private-key`],`private-key`,`text`),type:c(o.type,`type`,`text`)});n(await i(`Creating`,async()=>u.customCertificates.create({...f,zone_id:d})),{successLabel:`Created`})}};function m(e){return e.positional(`custom-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 h={command:`delete <custom-certificate-id>`,describe:`Remove a SSL certificate from a zone.`,builder:m,handler:async a=>{if(a.dryRun){r({command:`cf custom-certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_certificates/${a[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(a[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(a[`custom-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 u({force:!!a.force})){process.stderr.write(`Aborted.
|
|
4
|
+
`);return}n(await i(`Deleting`,async()=>o.customCertificates.delete({zone_id:s,custom_certificate_id:a[`custom-certificate-id`]})),{successLabel:`Deleted`})}};function g(e){return e.positional(`custom-certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).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`]}).option(`certificate`,{type:`string`,description:`The zone's SSL certificate or certificate and the intermediate(s).`}).option(`custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`deploy`,{type:`string`,description:`The environment to deploy the certificate to, defaults to production.`,choices:[`staging`,`production`]}).option(`geo-restrictions-label`,{type:`string`,description:`The geo_restrictions.label field`,choices:[`us`,`eu`,`highest_security`]}).option(`policy`,{type:`string`,description:`Specify the policy that determines the region where your private key will be held locally. HTTPS connections to any excluded data center will still be fully encrypted, but will incur some latency while Keyless SSL is used to complete the handshake with the nearest allowed data center. Any combination of countries, specified by their two letter country code (https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements) can be chosen, such as 'country: IN', as well as 'region: EU' which refers to the EU region. If there are too few data centers satisfying the policy, it will be rejected.
|
|
5
|
+
Note: The API accepts this field as either "policy" or "policy_restrictions" in requests. Responses return this field as "policy_restrictions".`}).option(`private-key`,{type:`string`,description:`The zone's private key. Not required if custom_csr_id is provided, in which case the private key is retrieved from the CSR record held by Cloudflare.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`edit <custom-certificate-id>`,describe:`Upload a new private key and/or PEM/CRT for the SSL certificate. Note: PATCHing a configuration for sni_custom certificates will result in a new resource id being returned, and the previous one being deleted.`,builder:g,handler:async o=>{if(o.dryRun){r({command:`cf custom-certificates edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${o.zone??o.zoneId??`<zone>`}/custom_certificates/${o[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(o[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(o[`custom-certificate-id`]??``),"zone-id":String(o.zone??o[`zone-id`]??``)},bodyKind:`json`,body:o.body===void 0?s({bundle_method:c(o[`bundle-method`],`bundle-method`,`text`),certificate:c(o.certificate,`certificate`,`text`),custom_csr_id:c(o[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(o.deploy,`deploy`,`text`),geo_restrictions:{label:c(o[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(o.policy,`policy`,`text`),private_key:c(o[`private-key`],`private-key`,`text`)}):a(o.body)});return}let l=await t(o),u=await e({zone:o.zone},l,{quiet:o.quiet});if(o.zoneId=u,o.body){let e=a(o.body);n(await i(`Updating`,async()=>l.customCertificates.edit({...e,zone_id:u,custom_certificate_id:o[`custom-certificate-id`]})),{successLabel:`Updated`});return}let d=s({bundle_method:c(o[`bundle-method`],`bundle-method`,`text`),certificate:c(o.certificate,`certificate`,`text`),custom_csr_id:c(o[`custom-csr-id`],`custom-csr-id`,`text`),deploy:c(o.deploy,`deploy`,`text`),geo_restrictions:{label:c(o[`geo-restrictions-label`],`geo-restrictions-label`,`text`)},policy:c(o.policy,`policy`,`text`),private_key:c(o[`private-key`],`private-key`,`text`)});n(await i(`Updating`,async()=>l.customCertificates.edit({...d,zone_id:u,custom_certificate_id:o[`custom-certificate-id`]})),{successLabel:`Updated`})}};function v(e){return e.positional(`custom-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 y={command:`get <custom-certificate-id>`,describe:`Retrieves details for a specific custom SSL certificate, including certificate metadata, bundle method, geographic restrictions, and associated keyless server configuration.`,builder:v,handler:async a=>{if(a.dryRun){r({command:`cf custom-certificates get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_certificates/${a[`custom-certificate-id`]==null?`<custom-certificate-id>`:encodeURIComponent(String(a[`custom-certificate-id`]))}`,pathParams:{"custom-certificate-id":String(a[`custom-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.customCertificates.get({zone_id:s,custom_certificate_id:a[`custom-certificate-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`status`,{type:`string`,description:`Status of the zone's custom SSL.`,choices:[`active`,`expired`,`deleted`,`pending`,`initializing`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List, search, and filter all of your custom SSL certificates. The higher priority will break ties across overlapping 'legacy_custom' certificates, but 'legacy_custom' certificates will always supercede 'sni_custom' certificates.`,builder:d(b),handler:async a=>{let o={page:a.page,per_page:a[`per-page`],match:a.match,status:a.status};if(a.dryRun){r({command:`cf custom-certificates list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_certificates`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.customCertificates.list({zone_id:c,...o})),{successLabel:`Loaded`})}};function S(e){return e.option(`certificates`,{type:`string`,description:`Array of ordered certificates. 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 C={command:`update`,describe:`If a zone has multiple SSL certificates, you can set the order in which they should be used during a request. The higher priority will break ties across overlapping 'legacy_custom' certificates.`,builder:S,handler:async c=>{if(c.dryRun){r({command:`cf custom-certificates prioritize update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/custom_certificates/prioritize`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?s({certificates:o(c.certificates,`certificates`)}):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.customCertificates.prioritize.update({...e,zone_id:u})),{successLabel:`Updated`});return}if(c.certificates===void 0)throw Error(`--certificates is required (or pass --body with this field set).`);let d=s({certificates:o(c.certificates,`certificates`)});n(await i(`Updating`,async()=>l.customCertificates.prioritize.update({...d,zone_id:u})),{successLabel:`Updated`})}},w={command:`prioritize`,describe:`Operations for prioritize`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},T={command:`custom-certificates`,describe:`custom-certificates`,builder:e=>e.command(p).command(h).command(_).command(y).command(x).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{T as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u}from"./input-validation-1esLElok.mjs";import{a as d,n as f}from"./prompt-CyATfGUu.mjs";import{t as p}from"./cli-types-C3nVfpSG.mjs";function m(e){return e.option(`common-name`,{type:`string`,description:`The common name (domain) for the CSR. Must be at most 64 characters.`}).option(`country`,{type:`string`,description:`Two-letter ISO 3166-1 alpha-2 country code.`}).option(`description`,{type:`string`,description:`Optional description for the CSR.`}).option(`key-type`,{type:`string`,description:`Key algorithm to use for the CSR. Defaults to rsa2048 if not specified.`,choices:[`rsa2048`,`p256v1`],default:`rsa2048`}).option(`locality`,{type:`string`,description:`City or locality name.`}).option(`name`,{type:`string`,description:`Human-readable name for the CSR.`}).option(`organization`,{type:`string`,description:`Organization name.`}).option(`organizational-unit`,{type:`string`,description:`Organizational unit name.`}).option(`sans`,{type:`string`,array:!0,description:`Subject Alternative Names for the CSR. At least one SAN is required.`}).option(`state`,{type:`string`,description:`State or province name.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a custom CSR.`})}const h={command:`create`,describe:`Generate a new custom Certificate Signing Request (CSR) for an account or zone. Cloudflare generates and securely stores the private key associated with the CSR.`,builder:m,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-csrs create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_csrs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({common_name:u(f[`common-name`],`common-name`,`text`),country:u(f.country,`country`,`text`),description:u(f.description,`description`,`text`),key_type:u(f[`key-type`],`key-type`,`text`),locality:u(f.locality,`locality`,`text`),name:u(f.name,`name`,`text`),organization:u(f.organization,`organization`,`text`),organizational_unit:u(f[`organizational-unit`],`organizational-unit`,`text`),sans:f.sans,state:u(f.state,`state`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.customCsrs.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}if(f[`common-name`]===void 0&&(f[`common-name`]=await d(`common-name`,`The common name (domain) for the CSR. Must be at most 64 characters.`)),f.country===void 0&&(f.country=await d(`country`,`Two-letter ISO 3166-1 alpha-2 country code.`)),f.locality===void 0&&(f.locality=await d(`locality`,`City or locality name.`)),f.organization===void 0&&(f.organization=await d(`organization`,`Organization name.`)),f.sans===void 0)throw Error(`--sans is required (or pass --body with this field set).`);f.state===void 0&&(f.state=await d(`state`,`State or province name.`));let g=l({common_name:u(f[`common-name`],`common-name`,`text`),country:u(f.country,`country`,`text`),description:u(f.description,`description`,`text`),key_type:u(f[`key-type`],`key-type`,`text`),locality:u(f.locality,`locality`,`text`),name:u(f.name,`name`,`text`),organization:u(f.organization,`organization`,`text`),organizational_unit:u(f[`organizational-unit`],`organizational-unit`,`text`),sans:f.sans,state:u(f.state,`state`,`text`)});a(await s(`Creating`,async()=>p.customCsrs.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function g(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR 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 _={command:`delete <custom-csr-id>`,describe:`Delete a custom Certificate Signing Request (CSR) and its associated private key.`,builder:g,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-csrs delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_csrs/${c[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(c[`custom-csr-id`]))}`,pathParams:{"account-or-zone":String(t),"custom-csr-id":String(c[`custom-csr-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();if(u===`zones`?c.zoneId=d:c.accountId=d,!await f({force:!!c.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}a(await s(`Deleting`,async()=>l.customCsrs.delete({account_or_zone:u,account_or_zone_id:d,custom_csr_id:c[`custom-csr-id`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`custom-csr-id`,{type:`string`,description:`Custom CSR identifier tag.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <custom-csr-id>`,describe:`Retrieve details for a specific custom Certificate Signing Request (CSR).`,builder:v,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-csrs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_csrs/${c[`custom-csr-id`]==null?`<custom-csr-id>`:encodeURIComponent(String(c[`custom-csr-id`]))}`,pathParams:{"account-or-zone":String(t),"custom-csr-id":String(c[`custom-csr-id`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customCsrs.get({account_or_zone:u,account_or_zone_id:d,custom_csr_id:c[`custom-csr-id`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of custom CSRs per page.`}).option(`order`,{type:`string`,description:`The field to sort the returned custom CSRs by.`,choices:[`name`,`account_tag`,`created_at`]}).option(`direction`,{type:`string`,description:`The direction to sort by.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`List all custom Certificate Signing Requests (CSRs) for an account or zone.`,builder:p(b),handler:async c=>{let l={page:c.page,per_page:c[`per-page`],order:c.order,direction:c.direction};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-csrs list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_csrs`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.customCsrs.list({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}},S={command:`custom-csrs`,describe:`custom-csrs`,builder:e=>e.command(h).command(_).command(y).command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{S as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
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";import{t as u}from"./cli-types-C3nVfpSG.mjs";function d(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-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 f={command:`delete <certificate-id>`,describe:`Delete a single custom certificate from a certificate pack that contains two bundled certificates. Deletion is subject to the following constraints. You cannot delete a certificate if it is the only remaining certificate in the pack. At least one certificate must remain in the pack.`,builder:d,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames certificate-pack certificates delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/${a[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(a[`custom-hostname-id`]))}/certificate_pack/${a[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(a[`certificate-pack-id`]))}/certificates/${a[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(a[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(a[`custom-hostname-id`]??``),"certificate-pack-id":String(a[`certificate-pack-id`]??``),"certificate-id":String(a[`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.customHostnames.certificatePack.certificates.delete({zone_id:s,custom_hostname_id:a[`custom-hostname-id`],certificate_pack_id:a[`certificate-pack-id`],certificate_id:a[`certificate-id`]})),{successLabel:`Deleted`})}};function p(e){return e.positional(`certificate-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`certificate-pack-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).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:`update <certificate-id>`,describe:`Replace a single custom certificate within a certificate pack that contains two bundled certificates. The replacement must adhere to the following constraints. You can only replace an RSA certificate with another RSA certificate or an ECDSA certificate with another ECDSA certificate.`,builder:p,handler:async l=>{if(l.dryRun){r({command:`cf custom-hostnames certificate-pack certificates update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames/${l[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(l[`custom-hostname-id`]))}/certificate_pack/${l[`certificate-pack-id`]==null?`<certificate-pack-id>`:encodeURIComponent(String(l[`certificate-pack-id`]))}/certificates/${l[`certificate-id`]==null?`<certificate-id>`:encodeURIComponent(String(l[`certificate-id`]))}`,pathParams:{"custom-hostname-id":String(l[`custom-hostname-id`]??``),"certificate-pack-id":String(l[`certificate-pack-id`]??``),"certificate-id":String(l[`certificate-id`]??``),"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({custom_certificate:s(l[`custom-certificate`],`custom-certificate`,`text`),custom_key:s(l[`custom-key`],`custom-key`,`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(`Updating`,async()=>u.customHostnames.certificatePack.certificates.update({body:e,zone_id:d,custom_hostname_id:l[`custom-hostname-id`],certificate_pack_id:l[`certificate-pack-id`],certificate_id:l[`certificate-id`]})),{successLabel:`Updated`});return}l[`custom-certificate`]===void 0&&(l[`custom-certificate`]=await c(`custom-certificate`,`If a custom uploaded certificate is used.`)),l[`custom-key`]===void 0&&(l[`custom-key`]=await c(`custom-key`,`The key for a custom uploaded certificate.`,{kind:`secret`}));let f=o({custom_certificate:s(l[`custom-certificate`],`custom-certificate`,`text`),custom_key:s(l[`custom-key`],`custom-key`,`text`)});n(await i(`Updating`,async()=>u.customHostnames.certificatePack.certificates.update({body:f,zone_id:d,custom_hostname_id:l[`custom-hostname-id`],certificate_pack_id:l[`certificate-pack-id`],certificate_id:l[`certificate-id`]})),{successLabel:`Updated`})}},h={command:`certificates`,describe:`Operations for certificate-pack.certificates`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},g={command:`certificate-pack`,describe:`Operations for certificate-pack`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`hostname`,{type:`string`,description:`The custom hostname that will point to your hostname via CNAME.`}).option(`ssl-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`]}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`create`,describe:`Add a new custom hostname and request that an SSL certificate be issued for it. One of three validation methods—http, txt, email—should be used, with 'http' recommended if the CNAME is already in place (or will be soon). Specifying 'email' will send an email to the WHOIS contacts on file for the base domain plus hostmaster, postmaster, webmaster, admin, administrator. If http is used and the domain is not already pointing to the Managed CNAME host, the PATCH method must be used once it is (to complete validation). Enable bundling of certificates using the custom_cert_bundle field. The bundling process requires the following condition One certificate in the bundle must use an RSA, and the other must use an ECDSA.`,builder:_,handler:async l=>{if(l.dryRun){r({command:`cf custom-hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({custom_origin_server:s(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(l[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:s(l.hostname,`hostname`,`text`),ssl:{bundle_method:s(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:s(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:s(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}}):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.customHostnames.create({...e,zone_id:d})),{successLabel:`Created`});return}l.hostname===void 0&&(l.hostname=await c(`hostname`,`The custom hostname that will point to your hostname via CNAME.`));let f=o({custom_origin_server:s(l[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(l[`custom-origin-sni`],`custom-origin-sni`,`text`),hostname:s(l.hostname,`hostname`,`text`),ssl:{bundle_method:s(l[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(l[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:l[`ssl-cloudflare-branding`],custom_certificate:s(l[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(l[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(l[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(l[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:l[`ssl-settings-ciphers`],early_hints:s(l[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(l[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(l[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(l[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(l[`ssl-type`],`ssl-type`,`text`),wildcard:l[`ssl-wildcard`]}});n(await i(`Creating`,async()=>u.customHostnames.create({...f,zone_id:d})),{successLabel:`Created`})}};function y(e){return e.positional(`custom-hostname-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 b={command:`delete <custom-hostname-id>`,describe:`Permanently deletes a custom hostname and revokes any SSL certificates that were issued for it. This action cannot be undone.`,builder:y,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/${a[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(a[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(a[`custom-hostname-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.
|
|
4
4
|
`);return}n(await i(`Deleting`,async()=>o.customHostnames.delete({zone_id:s,custom_hostname_id:a[`custom-hostname-id`]})),{successLabel:`Deleted`})}};function x(e){return e.positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`custom-origin-server`,{type:`string`,description:`a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME record.`}).option(`custom-origin-sni`,{type:`string`,description:`A hostname that will be sent to your custom origin server as SNI for TLS handshake. This can be a valid subdomain of the zone or custom origin server name or the string ':request_host_header:' which will cause the host header in the request to be used as SNI. Not configurable with default/fallback origin server.`}).option(`ssl-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`]}).option(`ssl-certificate-authority`,{type:`string`,description:`The Certificate Authority that will issue the certificate.`,choices:[`digicert`,`google`,`lets_encrypt`,`ssl_com`]}).option(`ssl-cloudflare-branding`,{type:`boolean`,description:`Whether or not to add Cloudflare Branding for the order. This will add a subdomain of sni.cloudflaressl.com as the Common Name if set to true.`}).option(`ssl-custom-certificate`,{type:`string`,description:`If a custom uploaded certificate is used.`}).option(`ssl-custom-csr-id`,{type:`string`,description:`The identifier for the Custom CSR that was used.`}).option(`ssl-custom-key`,{type:`string`,description:`The key for a custom uploaded certificate.`}).option(`ssl-method`,{type:`string`,description:`Domain control validation (DCV) method used for this hostname.`,choices:[`http`,`txt`,`email`]}).option(`ssl-settings-ciphers`,{type:`string`,array:!0,description:`An allowlist of ciphers for TLS termination. These ciphers must be in the BoringSSL format.`}).option(`ssl-settings-early-hints`,{type:`string`,description:`Whether or not Early Hints is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-http2`,{type:`string`,description:`Whether or not HTTP2 is enabled.`,choices:[`on`,`off`]}).option(`ssl-settings-min-tls-version`,{type:`string`,description:`The minimum TLS version supported.`,choices:[`1.0`,`1.1`,`1.2`,`1.3`]}).option(`ssl-settings-tls-1-3`,{type:`string`,description:`Whether or not TLS 1.3 is enabled.`,choices:[`on`,`off`]}).option(`ssl-type`,{type:`string`,description:`Level of validation to be used for this hostname. Domain validation (dv) must be used.`,choices:[`dv`]}).option(`ssl-wildcard`,{type:`boolean`,description:`Indicates whether the certificate covers a wildcard.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const S={command:`edit <custom-hostname-id>`,describe:`Modify SSL configuration for a custom hostname. When sent with SSL config that matches existing config, used to indicate that hostname should pass domain control validation (DCV). Can also be used to change validation type, e.g., from 'http' to 'email'. Bundle an existing certificate with another certificate by using the "custom_cert_bundle" field. The bundling process supports combining certificates as long as the following condition is met. One certificate must use the RSA algorithm, and the other must use the ECDSA algorithm.`,builder:x,handler:async c=>{if(c.dryRun){r({command:`cf custom-hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/custom_hostnames/${c[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(c[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(c[`custom-hostname-id`]??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({custom_origin_server:s(c[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(c[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:s(c[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(c[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:c[`ssl-cloudflare-branding`],custom_certificate:s(c[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(c[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(c[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(c[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:c[`ssl-settings-ciphers`],early_hints:s(c[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(c[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(c[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(c[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(c[`ssl-type`],`ssl-type`,`text`),wildcard:c[`ssl-wildcard`]}}):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.customHostnames.edit({...e,zone_id:u,custom_hostname_id:c[`custom-hostname-id`]})),{successLabel:`Updated`});return}let d=o({custom_origin_server:s(c[`custom-origin-server`],`custom-origin-server`,`text`),custom_origin_sni:s(c[`custom-origin-sni`],`custom-origin-sni`,`text`),ssl:{bundle_method:s(c[`ssl-bundle-method`],`ssl-bundle-method`,`text`),certificate_authority:s(c[`ssl-certificate-authority`],`ssl-certificate-authority`,`text`),cloudflare_branding:c[`ssl-cloudflare-branding`],custom_certificate:s(c[`ssl-custom-certificate`],`ssl-custom-certificate`,`text`),custom_csr_id:s(c[`ssl-custom-csr-id`],`ssl-custom-csr-id`,`text`),custom_key:s(c[`ssl-custom-key`],`ssl-custom-key`,`text`),method:s(c[`ssl-method`],`ssl-method`,`text`),settings:{ciphers:c[`ssl-settings-ciphers`],early_hints:s(c[`ssl-settings-early-hints`],`ssl-settings-early-hints`,`text`),http2:s(c[`ssl-settings-http2`],`ssl-settings-http2`,`text`),min_tls_version:s(c[`ssl-settings-min-tls-version`],`ssl-settings-min-tls-version`,`text`),tls_1_3:s(c[`ssl-settings-tls-1-3`],`ssl-settings-tls-1-3`,`text`)},type:s(c[`ssl-type`],`ssl-type`,`text`),wildcard:c[`ssl-wildcard`]}});n(await i(`Updating`,async()=>l.customHostnames.edit({...d,zone_id:u,custom_hostname_id:c[`custom-hostname-id`]})),{successLabel:`Updated`})}};function C(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const w={command:`delete`,describe:`Removes the fallback origin configuration for custom hostnames on a zone. Custom hostnames without specific origins will no longer have a fallback.`,builder:C,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames fallback-origin delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,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});if(a.zoneId=s,!await l({force:!!a.force})){process.stderr.write(`Aborted.
|
|
5
5
|
`);return}n(await i(`Deleting`,async()=>o.customHostnames.fallbackOrigin.delete({zone_id:s})),{successLabel:`Deleted`})}};function T(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`get`,describe:`Retrieves the current fallback origin configuration for custom hostnames on a zone. The fallback origin handles traffic when specific custom hostname origins are unavailable.`,builder:T,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames fallback-origin get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,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.customHostnames.fallbackOrigin.get({zone_id:s})),{successLabel:`Loaded`})}};function D(e){return e.option(`origin`,{type:`string`,description:`Your origin hostname that requests to your custom hostnames will be sent to.`}).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:`update`,describe:`Updates the fallback origin configuration for custom hostnames on a zone. Sets the default origin server for custom hostname traffic.`,builder:D,handler:async l=>{if(l.dryRun){r({command:`cf custom-hostnames fallback-origin update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${l.zone??l.zoneId??`<zone>`}/custom_hostnames/fallback_origin`,pathParams:{"zone-id":String(l.zone??l[`zone-id`]??``)},bodyKind:`json`,body:l.body===void 0?o({origin:s(l.origin,`origin`,`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(`Updating`,async()=>u.customHostnames.fallbackOrigin.update({...e,zone_id:d})),{successLabel:`Updated`});return}l.origin===void 0&&(l.origin=await c(`origin`,`Your origin hostname that requests to your custom hostnames will be sent to.`));let f=o({origin:s(l.origin,`origin`,`text`)});n(await i(`Updating`,async()=>u.customHostnames.fallbackOrigin.update({...f,zone_id:d})),{successLabel:`Updated`})}},k={command:`fallback-origin`,describe:`Operations for fallback-origin`,builder:e=>e.command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`custom-hostname-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get <custom-hostname-id>`,describe:`Retrieves detailed information about a specific custom hostname, including SSL certificate status, ownership verification, and origin configuration.`,builder:A,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/${a[`custom-hostname-id`]==null?`<custom-hostname-id>`:encodeURIComponent(String(a[`custom-hostname-id`]))}`,pathParams:{"custom-hostname-id":String(a[`custom-hostname-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.customHostnames.get({zone_id:s,custom_hostname_id:a[`custom-hostname-id`]})),{successLabel:`Loaded`})}};function M(e){return e.option(`hostname`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-exact`,{type:`string`,description:`Fully qualified domain name to match against. This parameter cannot be used with the 'id', 'hostname', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`hostname-starts-with`,{type:`string`,description:`Filters hostnames by a prefix match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.contain' parameters.`}).option(`hostname-contain`,{type:`string`,description:`Filters hostnames by a substring match on the hostname value. This parameter cannot be used with the 'id', 'hostname', 'hostname.exact', or 'hostname.startsWith' parameters.`}).option(`id`,{type:`string`,description:`Hostname ID to match against. This ID was generated and returned during the initial custom_hostname creation. This parameter cannot be used with the 'hostname', 'hostname.exact', 'hostname.contain', or 'hostname.startsWith' parameters.`}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of hostnames per page.`}).option(`order`,{type:`string`,description:`Field to order hostnames by.`,choices:[`ssl`,`ssl_status`]}).option(`direction`,{type:`string`,description:`Direction to order hostnames.`,choices:[`asc`,`desc`]}).option(`ssl-status`,{type:`string`,description:`Filter by SSL certificate status.`,choices:[`initializing`,`pending_validation`,`deleted`,`pending_issuance`,`pending_deployment`,`pending_deletion`,`pending_expiration`,`expired`,`active`,`initializing_timed_out`,`validation_timed_out`,`issuance_timed_out`,`deployment_timed_out`,`deletion_timed_out`,`pending_cleanup`,`staging_deployment`,`staging_active`,`deactivating`,`inactive`,`backup_issued`,`holding_deployment`]}).option(`hostname-status`,{type:`string`,description:`Filter by the hostname's activation status.`,choices:[`active`,`pending`,`active_redeploying`,`moved`,`pending_deletion`,`deleted`,`pending_blocked`,`pending_migration`,`pending_provisioned`,`test_pending`,`test_active`,`test_active_apex`,`test_blocked`,`test_failed`,`provisioned`,`blocked`]}).option(`certificate-authority`,{type:`string`,description:`Filter by the certificate authority that issued the SSL certificate.`,choices:[`google`,`lets_encrypt`,`ssl_com`]}).option(`wildcard`,{type:`boolean`,description:`Filter by whether the custom hostname is a wildcard hostname.`}).option(`custom-origin-server`,{type:`string`,description:`Filter by custom origin server name.`}).option(`ssl`,{type:`string`,description:`Whether to filter hostnames based on if they have SSL enabled.`,choices:[`0`,`1`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`list`,describe:`List, search, sort, and filter all of your custom hostnames.`,builder:u(M),handler:async a=>{let o={hostname:a.hostname,"hostname.exact":a[`hostname-exact`],"hostname.startsWith":a[`hostname-starts-with`],"hostname.contain":a[`hostname-contain`],id:a.id,page:a.page,per_page:a[`per-page`],order:a.order,direction:a.direction,ssl_status:a[`ssl-status`],hostname_status:a[`hostname-status`],certificate_authority:a[`certificate-authority`],wildcard:a.wildcard,custom_origin_server:a[`custom-origin-server`],ssl:a.ssl};if(a.dryRun){r({command:`cf custom-hostnames list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.customHostnames.list({zone_id:c,...o})),{successLabel:`Loaded`})}};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:`Returns custom hostname quota usage for a zone. The allocated quota is a soft limit; creating custom hostnames after usage exceeds this limit can still succeed until the hard cap is reached. Use the exceeded and hard_cap fields to track when usage is above the soft limit and when new custom hostname creation will be rejected.`,builder:P,handler:async a=>{if(a.dryRun){r({command:`cf custom-hostnames quota get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/custom_hostnames/quota`,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.customHostnames.quota.get({zone_id:s})),{successLabel:`Loaded`})}},I={command:`quota`,describe:`Operations for quota`,builder:e=>e.command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},L={command:`custom-hostnames`,describe:`custom-hostnames`,builder:e=>e.command(v).command(b).command(S).command(j).command(N).command(g).command(k).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{L as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,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";function p(e){return e.option(`ns-name`,{type:`string`,description:`The FQDN of the name server.`}).option(`ns-set`,{type:`number`,description:`The number of the set that this name server belongs to.`,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:`Adds a custom nameserver to the account or zone for use as a vanity nameserver on zones.`,builder:p,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-nameservers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_ns`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({ns_name:u(f[`ns-name`],`ns-name`,`text`),ns_set:f[`ns-set`]}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.customNameservers.create({body:e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f[`ns-name`]===void 0&&(f[`ns-name`]=await d(`ns-name`,`The FQDN of the name server.`));let g=l({ns_name:u(f[`ns-name`],`ns-name`,`text`),ns_set:f[`ns-set`]});a(await s(`Creating`,async()=>p.customNameservers.create({body:g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}};function h(e){return e.positional(`custom-ns-id`,{type:`string`,description:`The FQDN of the name server.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const g={command:`delete <custom-ns-id>`,describe:`Removes a custom nameserver from the account.`,builder:h,handler:async r=>{if(r.dryRun){o({command:`cf custom-nameservers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/custom_ns/${r[`custom-ns-id`]==null?`<custom-ns-id>`:encodeURIComponent(String(r[`custom-ns-id`]))}`,pathParams:{"custom-ns-id":String(r[`custom-ns-id`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await f({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}a(await s(`Deleting`,async()=>c.customNameservers.delete({account_id:l,custom_ns_id:r[`custom-ns-id`]})),{successLabel:`Deleted`})}};function _(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get`,describe:`List an account or zone's custom nameservers.`,builder:_,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-nameservers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_ns`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customNameservers.get({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}},y={command:`custom-nameservers`,describe:`custom-nameservers`,builder:e=>e.command(m).command(g).command(v).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{y as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{t as e}from"./local-DGiIS1uM.mjs";import{f as t,g as n,h as r}from"./oauth-DAa7SwkM.mjs";import{r as i}from"./auth-DY_Y2bXC.mjs";import{t as a}from"./output-BqDR9h74.mjs";import{t as o}from"./dry-run-ILZRVpnp.mjs";import{t as s}from"./progress-jYW64HY7.mjs";import{n as c,t as l}from"./body-parser-BGVbwPeM.mjs";import{n as u}from"./input-validation-1esLElok.mjs";import{a as d,i as f,n as p}from"./prompt-CyATfGUu.mjs";function m(e){return e.option(`act`,{type:`string`,description:`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`}).option(`target`,{type:`string`,description:`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`}).option(`url`,{type:`string`,description:`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`}).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:`Creates a signed JWT token used to preview custom pages before they are published.`,builder:m,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-pages account-custom-pages preview-tokens create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/preview_tokens`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({act:u(f.act,`act`,`text`),target:u(f.target,`target`,`text`),url:u(f.url,`url`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.customPages.accountCustomPages.previewTokens.create({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f.act===void 0&&(f.act=await d(`act`,`The preview action type. Required for request parsing but not used in token generation. Typically set to "preview".`)),f.target===void 0&&(f.target=await d(`target`,`The target custom page type to preview (e.g. "block:waf"). Encoded as the "endpoint" claim in the resulting JWT.`)),f.url===void 0&&(f.url=await d(`url`,`The URL of the custom page content to preview. Encoded as the "zone" claim in the resulting JWT.`));let g=l({act:u(f.act,`act`,`text`),target:u(f.target,`target`,`text`),url:u(f.url,`url`,`text`)});a(await s(`Creating`,async()=>p.customPages.accountCustomPages.previewTokens.create({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}},g={command:`preview-tokens`,describe:`Account preview tokens operations`,builder:e=>e.command(h).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function _(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`state`,{type:`string`,description:`The custom page state.`,choices:[`default`,`customized`]}).option(`url`,{type:`string`,description:`The URL associated with the custom page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const v={command:`update <identifier>`,describe:`Updates the configuration of an existing custom page.`,builder:_,handler:async p=>{if(p.dryRun){let e=p.zone===void 0?await n():void 0,t=p.zone===void 0?`accounts`:`zones`,r=p.zone??e??`<account-id>`;o({command:`cf custom-pages account-custom-pages update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/${p.identifier==null?`<identifier>`:encodeURIComponent(String(p.identifier))}`,pathParams:{"account-or-zone":String(t),identifier:String(p.identifier??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:p.body===void 0?l({state:u(p.state,`state`,`text`),url:u(p.url,`url`,`text`)}):c(p.body)});return}let m=await i(p),h=p.zone===void 0?`accounts`:`zones`,g=h===`zones`?await r({zone:p.zone},m,{quiet:p.quiet}):p.local?e:await t();if(h===`zones`?p.zoneId=g:p.accountId=g,p.body){let e=c(p.body);a(await s(`Updating`,async()=>m.customPages.accountCustomPages.update({...e,account_or_zone:h,account_or_zone_id:g,identifier:p.identifier})),{successLabel:`Updated`});return}p.state===void 0&&(p.state=await f(`state`,`The custom page state.`,[`default`,`customized`])),p.url===void 0&&(p.url=await d(`url`,`The URL associated with the custom page.`));let _=l({state:u(p.state,`state`,`text`),url:u(p.url,`url`,`text`)});a(await s(`Updating`,async()=>m.customPages.accountCustomPages.update({..._,account_or_zone:h,account_or_zone_id:g,identifier:p.identifier})),{successLabel:`Updated`})}},y={command:`account-custom-pages`,describe:`Account-scoped custom page operations`,builder:e=>e.command(v).command(g).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function b(e){return e.option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched 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 x={command:`asset`,describe:`Creates a new custom asset.`,builder:b,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-pages assets create custom asset`,method:`POST`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({description:u(f.description,`description`,`text`),name:u(f.name,`name`,`text`),url:u(f.url,`url`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Creating`,async()=>p.customPages.assets.create.custom.asset({...e,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`});return}f.description===void 0&&(f.description=await d(`description`,`A short description of the custom asset.`)),f.name===void 0&&(f.name=await d(`name`,`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`)),f.url===void 0&&(f.url=await d(`url`,`The URL where the asset content is fetched from.`));let g=l({description:u(f.description,`description`,`text`),name:u(f.name,`name`,`text`),url:u(f.url,`url`,`text`)});a(await s(`Creating`,async()=>p.customPages.assets.create.custom.asset({...g,account_or_zone:m,account_or_zone_id:h})),{successLabel:`Created`})}},S={command:`custom`,describe:`Operations for assets.create.custom`,builder:e=>e.command(x).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},C={command:`create`,describe:`Operations for assets.create`,builder:e=>e.command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const T={command:`asset <asset-name>`,describe:`Deletes an existing custom asset.`,builder:w,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages assets delete custom asset`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets/${c[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(c[`asset-name`]))}`,pathParams:{"account-or-zone":String(t),"asset-name":String(c[`asset-name`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();if(u===`zones`?c.zoneId=d:c.accountId=d,!await p({force:!!c.force})){process.stderr.write(`Aborted.
|
|
3
|
+
`);return}a(await s(`Deleting`,async()=>l.customPages.assets.delete.custom.asset({account_or_zone:u,account_or_zone_id:d,asset_name:c[`asset-name`]})),{successLabel:`Deleted`})}},E={command:`custom`,describe:`Operations for assets.delete.custom`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`delete`,describe:`Operations for assets.delete`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const k={command:`asset <asset-name>`,describe:`Fetches the details of a custom asset.`,builder:O,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages assets get custom asset`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets/${c[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(c[`asset-name`]))}`,pathParams:{"account-or-zone":String(t),"asset-name":String(c[`asset-name`]??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customPages.assets.get.custom.asset({account_or_zone:u,account_or_zone_id:d,asset_name:c[`asset-name`]})),{successLabel:`Loaded`})}},A={command:`custom`,describe:`Operations for assets.get.custom`,builder:e=>e.command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},j={command:`get`,describe:`Operations for assets.get`,builder:e=>e.command(A).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function M(e){return e.option(`page`,{type:`number`,description:`Page`}).option(`per-page`,{type:`number`,description:`Per page`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const N={command:`assets`,describe:`Fetches all the custom assets.`,builder:M,handler:async c=>{let l={page:c.page,per_page:c[`per-page`]};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages assets list custom assets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.customPages.assets.list.custom.assets({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}},P={command:`custom`,describe:`Operations for assets.list.custom`,builder:e=>e.command(N).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`list`,describe:`Operations for assets.list`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.positional(`asset-name`,{type:`string`,description:`The unique name of the custom asset. Can only contain letters (A-Z, a-z), numbers (0-9), and underscores (_).`,demandOption:!0}).option(`description`,{type:`string`,description:`A short description of the custom asset.`}).option(`url`,{type:`string`,description:`The URL where the asset content is fetched 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 L={command:`asset <asset-name>`,describe:`Updates the configuration of an existing custom asset.`,builder:I,handler:async f=>{if(f.dryRun){let e=f.zone===void 0?await n():void 0,t=f.zone===void 0?`accounts`:`zones`,r=f.zone??e??`<account-id>`;o({command:`cf custom-pages assets update custom asset`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/assets/${f[`asset-name`]==null?`<asset-name>`:encodeURIComponent(String(f[`asset-name`]))}`,pathParams:{"account-or-zone":String(t),"asset-name":String(f[`asset-name`]??``),"account-or-zone-id":String(r)},bodyKind:`json`,body:f.body===void 0?l({description:u(f.description,`description`,`text`),url:u(f.url,`url`,`text`)}):c(f.body)});return}let p=await i(f),m=f.zone===void 0?`accounts`:`zones`,h=m===`zones`?await r({zone:f.zone},p,{quiet:f.quiet}):f.local?e:await t();if(m===`zones`?f.zoneId=h:f.accountId=h,f.body){let e=c(f.body);a(await s(`Updating`,async()=>p.customPages.assets.update.custom.asset({...e,account_or_zone:m,account_or_zone_id:h,asset_name:f[`asset-name`]})),{successLabel:`Updated`});return}f.description===void 0&&(f.description=await d(`description`,`A short description of the custom asset.`)),f.url===void 0&&(f.url=await d(`url`,`The URL where the asset content is fetched from.`));let g=l({description:u(f.description,`description`,`text`),url:u(f.url,`url`,`text`)});a(await s(`Updating`,async()=>p.customPages.assets.update.custom.asset({...g,account_or_zone:m,account_or_zone_id:h,asset_name:f[`asset-name`]})),{successLabel:`Updated`})}},R={command:`custom`,describe:`Operations for assets.update.custom`,builder:e=>e.command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`update`,describe:`Operations for assets.update`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},B={command:`assets`,describe:`Assets operations`,builder:e=>e.command(C).command(D).command(j).command(F).command(z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function V(e){return e.positional(`identifier`,{type:`string`,description:`Error Page Types`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get <identifier>`,describe:`Fetches the details of a custom page.`,builder:V,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages/${c.identifier==null?`<identifier>`:encodeURIComponent(String(c.identifier))}`,pathParams:{"account-or-zone":String(t),identifier:String(c.identifier??``),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customPages.get({account_or_zone:u,account_or_zone_id:d,identifier:c.identifier})),{successLabel:`Loaded`})}};function U(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`list`,describe:`Fetches all the custom pages.`,builder:U,handler:async c=>{if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf custom-pages list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/custom_pages`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},bodyKind:`none`});return}let l=await i(c),u=c.zone===void 0?`accounts`:`zones`,d=u===`zones`?await r({zone:c.zone},l,{quiet:c.quiet}):c.local?e:await t();u===`zones`?c.zoneId=d:c.accountId=d,a(await s(`Loading`,async()=>l.customPages.list({account_or_zone:u,account_or_zone_id:d})),{successLabel:`Loaded`})}},G={command:`custom-pages`,describe:`Custom error and challenge pages (1000s, WAF blocks, captchas) for zones and accounts`,builder:e=>e.command(H).command(W).command(y).command(B).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{G as default};
|