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/web3-y_cY91V_.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-B0ETkNcX.mjs";import{r as t}from"./auth-MQEamPN9.mjs";import{t as n}from"./output-DrpYYfnB.mjs";import{n as r,t as i}from"./progress-CsHIt3Tp.mjs";import{n as a,t as o}from"./body-parser-C-c9gfH1.mjs";import{n as s}from"./input-validation-Bav2M9F-.mjs";import{a as c,i as l,n as u}from"./prompt-DdegNPpg.mjs";function d(e){return e.option(`description`,{type:`string`,description:`Specify an optional description of the hostname.`}).option(`dnslink`,{type:`string`,description:`Specify the DNSLink value used if the target is ipfs.`}).option(`name`,{type:`string`,description:`Specify the hostname that points to the target gateway via CNAME.`}).option(`target`,{type:`string`,description:`Specify the target gateway of the hostname.`,choices:[`ethereum`,`ipfs`,`ipfs_universal_path`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const f={command:`create`,describe:`Create Web3 Hostname`,builder:d,handler:async u=>{if(u.dryRun){r({command:`cf web3 hostnames create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/web3/hostnames`,pathParams:{"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?o({description:s(u.description,`description`,`text`),dnslink:s(u.dnslink,`dnslink`,`text`),name:s(u.name,`name`,`text`),target:s(u.target,`target`,`text`)}):a(u.body)});return}let d=await t(u),f=await e({zone:u.zone},d,{quiet:u.quiet});if(u.zoneId=f,u.body){let e=a(u.body);n(await i(`Creating`,async()=>d.web3.hostnames.create({...e,zone_id:f})),{successLabel:`Created`});return}u.name===void 0&&(u.name=await c(`name`,`Specify the hostname that points to the target gateway via CNAME.`)),u.target===void 0&&(u.target=await l(`target`,`Specify the target gateway of the hostname.`,[`ethereum`,`ipfs`,`ipfs_universal_path`]));let p=o({description:s(u.description,`description`,`text`),dnslink:s(u.dnslink,`dnslink`,`text`),name:s(u.name,`name`,`text`),target:s(u.target,`target`,`text`)});n(await i(`Creating`,async()=>d.web3.hostnames.create({...p,zone_id:f})),{successLabel:`Created`})}};function p(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,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 <identifier>`,describe:`Delete Web3 Hostname`,builder:p,handler:async a=>{if(a.dryRun){r({command:`cf web3 hostnames delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/web3/hostnames/${a.identifier==null?`<identifier>`:encodeURIComponent(String(a.identifier))}`,pathParams:{identifier:String(a.identifier??``),"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.
|
|
3
|
-
`);return}n(await i(`Deleting`,async()=>o.web3.hostnames.delete({zone_id:s,identifier:a.identifier})),{successLabel:`Deleted`})}};function h(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`description`,{type:`string`,description:`Specify an optional description of the hostname.`}).option(`dnslink`,{type:`string`,description:`Specify the DNSLink value used if the target is ipfs.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const g={command:`edit <identifier>`,describe:`Edit Web3 Hostname`,builder:h,handler:async c=>{if(c.dryRun){r({command:`cf web3 hostnames edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/web3/hostnames/${c.identifier==null?`<identifier>`:encodeURIComponent(String(c.identifier))}`,pathParams:{identifier:String(c.identifier??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({description:s(c.description,`description`,`text`),dnslink:s(c.dnslink,`dnslink`,`text`)}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.web3.hostnames.edit({...e,zone_id:u,identifier:c.identifier})),{successLabel:`Updated`});return}let d=o({description:s(c.description,`description`,`text`),dnslink:s(c.dnslink,`dnslink`,`text`)});n(await i(`Updating`,async()=>l.web3.hostnames.edit({...d,zone_id:u,identifier:c.identifier})),{successLabel:`Updated`})}};function _(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const v={command:`get <identifier>`,describe:`Web3 Hostname Details`,builder:_,handler:async a=>{if(a.dryRun){r({command:`cf web3 hostnames get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/web3/hostnames/${a.identifier==null?`<identifier>`:encodeURIComponent(String(a.identifier))}`,pathParams:{identifier:String(a.identifier??``),"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.web3.hostnames.get({zone_id:s,identifier:a.identifier})),{successLabel:`Loaded`})}};function y(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`content`,{type:`string`,description:`Specify the CID or content path of content to block.`}).option(`description`,{type:`string`,description:`Specify an optional description of the content list entry.`}).option(`type`,{type:`string`,description:`Specify the type of content list entry to block.`,choices:[`cid`,`content_path`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const b={command:`create <identifier>`,describe:`Create IPFS Universal Path Gateway Content List Entry`,builder:y,handler:async u=>{if(u.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/web3/hostnames/${u.identifier==null?`<identifier>`:encodeURIComponent(String(u.identifier))}/ipfs_universal_path/content_list/entries`,pathParams:{identifier:String(u.identifier??``),"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?o({content:s(u.content,`content`,`text`),description:s(u.description,`description`,`text`),type:s(u.type,`type`,`text`)}):a(u.body)});return}let d=await t(u),f=await e({zone:u.zone},d,{quiet:u.quiet});if(u.zoneId=f,u.body){let e=a(u.body);n(await i(`Creating`,async()=>d.web3.hostnames.ipfsUniversalPaths.contentLists.entries.create({body:e,zone_id:f,identifier:u.identifier})),{successLabel:`Created`});return}u.content===void 0&&(u.content=await c(`content`,`Specify the CID or content path of content to block.`)),u.type===void 0&&(u.type=await l(`type`,`Specify the type of content list entry to block.`,[`cid`,`content_path`]));let p=o({content:s(u.content,`content`,`text`),description:s(u.description,`description`,`text`),type:s(u.type,`type`,`text`)});n(await i(`Creating`,async()=>d.web3.hostnames.ipfsUniversalPaths.contentLists.entries.create({body:p,zone_id:f,identifier:u.identifier})),{successLabel:`Created`})}};function x(e){return e.positional(`content-list-entry-identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const S={command:`delete <content-list-entry-identifier>`,describe:`Delete IPFS Universal Path Gateway Content List Entry`,builder:x,handler:async a=>{if(a.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/web3/hostnames/${a.identifier==null?`<identifier>`:encodeURIComponent(String(a.identifier))}/ipfs_universal_path/content_list/entries/${a[`content-list-entry-identifier`]==null?`<content-list-entry-identifier>`:encodeURIComponent(String(a[`content-list-entry-identifier`]))}`,pathParams:{"content-list-entry-identifier":String(a[`content-list-entry-identifier`]??``),identifier:String(a.identifier??``),"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.web3.hostnames.ipfsUniversalPaths.contentLists.entries.delete({zone_id:s,identifier:a.identifier,content_list_entry_identifier:a[`content-list-entry-identifier`]})),{successLabel:`Deleted`})}};function C(e){return e.positional(`content-list-entry-identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const w={command:`get <content-list-entry-identifier>`,describe:`IPFS Universal Path Gateway Content List Entry Details`,builder:C,handler:async a=>{if(a.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/web3/hostnames/${a.identifier==null?`<identifier>`:encodeURIComponent(String(a.identifier))}/ipfs_universal_path/content_list/entries/${a[`content-list-entry-identifier`]==null?`<content-list-entry-identifier>`:encodeURIComponent(String(a[`content-list-entry-identifier`]))}`,pathParams:{"content-list-entry-identifier":String(a[`content-list-entry-identifier`]??``),identifier:String(a.identifier??``),"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.web3.hostnames.ipfsUniversalPaths.contentLists.entries.get({zone_id:s,identifier:a.identifier,content_list_entry_identifier:a[`content-list-entry-identifier`]})),{successLabel:`Loaded`})}};function T(e){return e.option(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`List IPFS Universal Path Gateway Content List Entries`,builder:T,handler:async a=>{if(a.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/web3/hostnames/${a.identifier==null?`<identifier>`:encodeURIComponent(String(a.identifier))}/ipfs_universal_path/content_list/entries`,pathParams:{identifier:String(a.identifier??``),"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.web3.hostnames.ipfsUniversalPaths.contentLists.entries.list({zone_id:s,identifier:a.identifier})),{successLabel:`Loaded`})}};function D(e){return e.positional(`content-list-entry-identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`content`,{type:`string`,description:`Specify the CID or content path of content to block.`}).option(`description`,{type:`string`,description:`Specify an optional description of the content list entry.`}).option(`type`,{type:`string`,description:`Specify the type of content list entry to block.`,choices:[`cid`,`content_path`]}).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 <content-list-entry-identifier>`,describe:`Edit IPFS Universal Path Gateway Content List Entry`,builder:D,handler:async u=>{if(u.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists entries update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${u.zone??u.zoneId??`<zone>`}/web3/hostnames/${u.identifier==null?`<identifier>`:encodeURIComponent(String(u.identifier))}/ipfs_universal_path/content_list/entries/${u[`content-list-entry-identifier`]==null?`<content-list-entry-identifier>`:encodeURIComponent(String(u[`content-list-entry-identifier`]))}`,pathParams:{"content-list-entry-identifier":String(u[`content-list-entry-identifier`]??``),identifier:String(u.identifier??``),"zone-id":String(u.zone??u[`zone-id`]??``)},bodyKind:`json`,body:u.body===void 0?o({content:s(u.content,`content`,`text`),description:s(u.description,`description`,`text`),type:s(u.type,`type`,`text`)}):a(u.body)});return}let d=await t(u),f=await e({zone:u.zone},d,{quiet:u.quiet});if(u.zoneId=f,u.body){let e=a(u.body);n(await i(`Updating`,async()=>d.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update({body:e,zone_id:f,identifier:u.identifier,content_list_entry_identifier:u[`content-list-entry-identifier`]})),{successLabel:`Updated`});return}u.content===void 0&&(u.content=await c(`content`,`Specify the CID or content path of content to block.`)),u.type===void 0&&(u.type=await l(`type`,`Specify the type of content list entry to block.`,[`cid`,`content_path`]));let p=o({content:s(u.content,`content`,`text`),description:s(u.description,`description`,`text`),type:s(u.type,`type`,`text`)});n(await i(`Updating`,async()=>d.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update({body:p,zone_id:f,identifier:u.identifier,content_list_entry_identifier:u[`content-list-entry-identifier`]})),{successLabel:`Updated`})}},k={command:`entries`,describe:`Operations for hostnames.ipfs-universal-paths.content-lists.entries`,builder:e=>e.command(b).command(S).command(w).command(E).command(O).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const j={command:`get <identifier>`,describe:`IPFS Universal Path Gateway Content List Details`,builder:A,handler:async a=>{if(a.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/web3/hostnames/${a.identifier==null?`<identifier>`:encodeURIComponent(String(a.identifier))}/ipfs_universal_path/content_list`,pathParams:{identifier:String(a.identifier??``),"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.web3.hostnames.ipfsUniversalPaths.contentLists.get({zone_id:s,identifier:a.identifier})),{successLabel:`Loaded`})}};function M(e){return e.positional(`identifier`,{type:`string`,description:`Specify the identifier of the hostname.`,demandOption:!0}).option(`action`,{type:`string`,description:`Behavior of the content list.`,choices:[`block`]}).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 N={command:`update <identifier>`,describe:`Update IPFS Universal Path Gateway Content List`,builder:M,handler:async c=>{if(c.dryRun){r({command:`cf web3 hostnames ipfs-universal-paths content-lists update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/web3/hostnames/${c.identifier==null?`<identifier>`:encodeURIComponent(String(c.identifier))}/ipfs_universal_path/content_list`,pathParams:{identifier:String(c.identifier??``),"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({action:s(c.action,`action`,`text`)}):a(c.body)});return}let u=await t(c),d=await e({zone:c.zone},u,{quiet:c.quiet});if(c.zoneId=d,c.body){let e=a(c.body);n(await i(`Updating`,async()=>u.web3.hostnames.ipfsUniversalPaths.contentLists.update({...e,zone_id:d,identifier:c.identifier})),{successLabel:`Updated`});return}c.action===void 0&&(c.action=await l(`action`,`Behavior of the content list.`,[`block`]));let f=o({action:s(c.action,`action`,`text`)});n(await i(`Updating`,async()=>u.web3.hostnames.ipfsUniversalPaths.contentLists.update({...f,zone_id:d,identifier:c.identifier})),{successLabel:`Updated`})}},P={command:`content-lists`,describe:`Operations for hostnames.ipfs-universal-paths.content-lists`,builder:e=>e.command(j).command(N).command(k).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},F={command:`ipfs-universal-paths`,describe:`Operations for hostnames.ipfs-universal-paths`,builder:e=>e.command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List Web3 Hostnames`,builder:I,handler:async a=>{if(a.dryRun){r({command:`cf web3 hostnames list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/web3/hostnames`,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.web3.hostnames.list({zone_id:s})),{successLabel:`Loaded`})}},R={command:`hostnames`,describe:`Operations for hostnames`,builder:e=>e.command(f).command(m).command(g).command(v).command(L).command(F).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},z={command:`web3`,describe:`web3`,builder:e=>e.command(R).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{z as default};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n,h as r,m as i}from"./oauth-B0ETkNcX.mjs";import{a,r as o}from"./auth-MQEamPN9.mjs";import{t as s}from"./output-DrpYYfnB.mjs";import{n as c,t as l}from"./progress-CsHIt3Tp.mjs";import{n as u,r as d,t as f}from"./body-parser-C-c9gfH1.mjs";import{n as p,t as m}from"./input-validation-Bav2M9F-.mjs";import{a as h,i as g,n as _}from"./prompt-DdegNPpg.mjs";import{t as v}from"./cli-types-BsTty22w.mjs";import{n as ee,t as te}from"./raw-fetch-CteyTOM2.mjs";function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Fetches Worker account settings for an account.`,builder:y,handler:async r=>{if(r.dryRun){c({command:`cf workers account-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/account-settings`,pathParams:{},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();r.accountId=a,s(await l(`Loading`,async()=>i.workers.accountSettings.get({account_id:a})),{successLabel:`Loaded`})}};function x(e){return e.option(`default-usage-model`,{type:`string`,description:`The default_usage_model field`}).option(`green-compute`,{type:`boolean`,description:`The green_compute 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 S={command:`update`,describe:`Creates Worker account settings for an account.`,builder:x,handler:async r=>{if(r.dryRun){c({command:`cf workers account-settings update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/account-settings`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({default_usage_model:p(r[`default-usage-model`],`default-usage-model`,`text`),green_compute:r[`green-compute`]}):u(r.body)});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,r.body){let e=u(r.body);s(await l(`Updating`,async()=>i.workers.accountSettings.update({body:e,account_id:a})),{successLabel:`Updated`});return}let d=f({default_usage_model:p(r[`default-usage-model`],`default-usage-model`,`text`),green_compute:r[`green-compute`]});s(await l(`Updating`,async()=>i.workers.accountSettings.update({body:d,account_id:a})),{successLabel:`Updated`})}},C={command:`account-settings`,describe:`Operations for account-settings`,builder:e=>e.command(b).command(S).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function w(e){return e.option(`base64`,{type:`string`,description:"Whether the file contents are base64-encoded. Must be `true`.",choices:[`true`],demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const T={command:`create`,describe:`Upload assets ahead of creating a Worker version. To learn more about the direct uploads of assets, see https://developers.cloudflare.com/workers/static-assets/direct-upload/.`,builder:v(w),handler:async r=>{let i={base64:r.base64};if(r.dryRun){c({command:`cf workers assets upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/assets/upload`,pathParams:{},query:i,bodyKind:`octet-stream`,body:r.body});return}let u=await o(r),d=r.local?e:await t();if(r.accountId=d,r.file){let e=m(r.file),t=new FormData;t.append(`file`,new Blob([e]),r.file.split(/[\\/]/).filter(Boolean).pop()),s(await l(`Creating`,async()=>a(u,`POST`,`/accounts/${d}/workers/assets/upload`,{body:t})),{successLabel:`Created`});return}if(r.body){let e=p(r.body,`body`,`binary`),t=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();s(await l(`Creating`,async()=>a(u,`POST`,`/accounts/${d}/workers/assets/upload${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}s(await l(`Creating`,async()=>u.workers.assets.upload.create({account_id:d,...i})),{successLabel:`Created`})}},E={command:`upload`,describe:`Operations for assets.upload`,builder:e=>e.command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},D={command:`assets`,describe:`Operations for assets`,builder:e=>e.command(E).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function O(e){return e.option(`logpush`,{type:`boolean`,description:`Whether logpush is enabled for the Worker.`,default:!1}).option(`name`,{type:`string`,description:`Name of the Worker.`}).option(`observability-enabled`,{type:`boolean`,description:`Whether observability is enabled for the Worker.`,default:!1}).option(`observability-head-sampling-rate`,{type:`number`,description:`The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).`,default:1}).option(`observability-logs-destinations`,{type:`string`,array:!0,description:`A list of destinations where logs will be exported to.`}).option(`observability-logs-enabled`,{type:`boolean`,description:`Whether logs are enabled for the Worker.`,default:!1}).option(`observability-logs-head-sampling-rate`,{type:`number`,description:`The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).`,default:1}).option(`observability-logs-invocation-logs`,{type:`boolean`,description:`Whether [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) are enabled for the Worker.`,default:!0}).option(`observability-logs-persist`,{type:`boolean`,description:`Whether log persistence is enabled for the Worker.`,default:!0}).option(`observability-redact-query-string`,{type:`boolean`,description:`Whether query strings are removed from request URLs in logs and traces.`,default:!1}).option(`observability-traces-destinations`,{type:`string`,array:!0,description:`A list of destinations where traces will be exported to.`}).option(`observability-traces-enabled`,{type:`boolean`,description:`Whether traces are enabled for the Worker.`,default:!1}).option(`observability-traces-head-sampling-rate`,{type:`number`,description:`The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%).`,default:1}).option(`observability-traces-persist`,{type:`boolean`,description:`Whether trace persistence is enabled for the Worker.`,default:!0}).option(`observability-traces-propagation-policy`,{type:`string`,description:`Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. "authenticated" honors inbound trace context only when accompanied by a valid trace auth token. "accept" unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled. Returns null when the trace propagation feature is not enabled for the account.`,choices:[`authenticated`,`accept`]}).option(`subdomain-enabled`,{type:`boolean`,description:`Whether the *.workers.dev subdomain is enabled for the Worker.`,default:!1}).option(`subdomain-previews-enabled`,{type:`boolean`,description:`Whether [preview URLs](https://developers.cloudflare.com/workers/configuration/previews/) are enabled for the Worker.`}).option(`tags`,{type:`string`,array:!0,description:`Tags associated with the Worker.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Worker creation parameters.`})}const k={command:`create`,describe:`Create a new Worker.`,builder:O,handler:async r=>{if(r.dryRun){c({command:`cf workers beta workers create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({logpush:r.logpush,name:p(r.name,`name`,`text`),observability:{enabled:r[`observability-enabled`],head_sampling_rate:r[`observability-head-sampling-rate`],logs:{destinations:r[`observability-logs-destinations`],enabled:r[`observability-logs-enabled`],head_sampling_rate:r[`observability-logs-head-sampling-rate`],invocation_logs:r[`observability-logs-invocation-logs`],persist:r[`observability-logs-persist`]},redact_query_string:r[`observability-redact-query-string`],traces:{destinations:r[`observability-traces-destinations`],enabled:r[`observability-traces-enabled`],head_sampling_rate:r[`observability-traces-head-sampling-rate`],persist:r[`observability-traces-persist`],propagation_policy:p(r[`observability-traces-propagation-policy`],`observability-traces-propagation-policy`,`text`)}},subdomain:{enabled:r[`subdomain-enabled`],previews_enabled:r[`subdomain-previews-enabled`]},tags:r.tags}):u(r.body)});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,r.body){let e=u(r.body);s(await l(`Creating`,async()=>i.workers.beta.workers.create({...e,account_id:a})),{successLabel:`Created`});return}if(r.logpush===void 0)throw Error(`--logpush is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await h(`name`,`Name of the Worker.`)),r.tags===void 0)throw Error(`--tags is required (or pass --body with this field set).`);let d=f({logpush:r.logpush,name:p(r.name,`name`,`text`),observability:{enabled:r[`observability-enabled`],head_sampling_rate:r[`observability-head-sampling-rate`],logs:{destinations:r[`observability-logs-destinations`],enabled:r[`observability-logs-enabled`],head_sampling_rate:r[`observability-logs-head-sampling-rate`],invocation_logs:r[`observability-logs-invocation-logs`],persist:r[`observability-logs-persist`]},redact_query_string:r[`observability-redact-query-string`],traces:{destinations:r[`observability-traces-destinations`],enabled:r[`observability-traces-enabled`],head_sampling_rate:r[`observability-traces-head-sampling-rate`],persist:r[`observability-traces-persist`],propagation_policy:p(r[`observability-traces-propagation-policy`],`observability-traces-propagation-policy`,`text`)}},subdomain:{enabled:r[`subdomain-enabled`],previews_enabled:r[`subdomain-previews-enabled`]},tags:r.tags});s(await l(`Creating`,async()=>i.workers.beta.workers.create({...d,account_id:a})),{successLabel:`Created`})}};function A(e){return e.positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const j={command:`delete <worker-id>`,describe:`Delete a Worker and all its associated resources (versions, deployments, etc.).`,builder:A,handler:async r=>{if(r.dryRun){c({command:`cf workers beta workers delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers/${r[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(r[`worker-id`]))}`,pathParams:{"worker-id":String(r[`worker-id`]??``)},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}s(await l(`Deleting`,async()=>i.workers.beta.workers.delete({account_id:a,worker_id:r[`worker-id`]})),{successLabel:`Deleted`})}};function M(e){return e.positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`logpush`,{type:`boolean`,description:`Whether logpush is enabled for the Worker.`}).option(`name`,{type:`string`,description:`Name of the Worker.`}).option(`observability-enabled`,{type:`boolean`,description:`Whether observability is enabled for the Worker.`}).option(`observability-head-sampling-rate`,{type:`number`,description:`The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).`}).option(`observability-logs-destinations`,{type:`string`,array:!0,description:`A list of destinations where logs will be exported to.`}).option(`observability-logs-enabled`,{type:`boolean`,description:`Whether logs are enabled for the Worker.`}).option(`observability-logs-head-sampling-rate`,{type:`number`,description:`The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).`}).option(`observability-logs-invocation-logs`,{type:`boolean`,description:`Whether [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) are enabled for the Worker.`}).option(`observability-logs-persist`,{type:`boolean`,description:`Whether log persistence is enabled for the Worker.`}).option(`observability-redact-query-string`,{type:`boolean`,description:`Whether query strings are removed from request URLs in logs and traces.`}).option(`observability-traces-destinations`,{type:`string`,array:!0,description:`A list of destinations where traces will be exported to.`}).option(`observability-traces-enabled`,{type:`boolean`,description:`Whether traces are enabled for the Worker.`}).option(`observability-traces-head-sampling-rate`,{type:`number`,description:`The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%).`}).option(`observability-traces-persist`,{type:`boolean`,description:`Whether trace persistence is enabled for the Worker.`}).option(`observability-traces-propagation-policy`,{type:`string`,description:`Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. "authenticated" honors inbound trace context only when accompanied by a valid trace auth token. "accept" unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled. Returns null when the trace propagation feature is not enabled for the account.`,choices:[`authenticated`,`accept`]}).option(`subdomain-enabled`,{type:`boolean`,description:`Whether the *.workers.dev subdomain is enabled for the Worker.`}).option(`subdomain-previews-enabled`,{type:`boolean`,description:`Whether [preview URLs](https://developers.cloudflare.com/workers/configuration/previews/) are enabled for the Worker.`}).option(`tags`,{type:`string`,array:!0,description:`Tags associated with the Worker.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Worker partial update parameters.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const N={command:`edit <worker-id>`,describe:`Perform a partial update on a Worker, where omitted properties are left unchanged from their current values.`,builder:M,handler:async r=>{if(r.dryRun){c({command:`cf workers beta workers edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers/${r[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(r[`worker-id`]))}`,pathParams:{"worker-id":String(r[`worker-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({logpush:r.logpush,name:p(r.name,`name`,`text`),observability:{enabled:r[`observability-enabled`],head_sampling_rate:r[`observability-head-sampling-rate`],logs:{destinations:r[`observability-logs-destinations`],enabled:r[`observability-logs-enabled`],head_sampling_rate:r[`observability-logs-head-sampling-rate`],invocation_logs:r[`observability-logs-invocation-logs`],persist:r[`observability-logs-persist`]},redact_query_string:r[`observability-redact-query-string`],traces:{destinations:r[`observability-traces-destinations`],enabled:r[`observability-traces-enabled`],head_sampling_rate:r[`observability-traces-head-sampling-rate`],persist:r[`observability-traces-persist`],propagation_policy:p(r[`observability-traces-propagation-policy`],`observability-traces-propagation-policy`,`text`)}},subdomain:{enabled:r[`subdomain-enabled`],previews_enabled:r[`subdomain-previews-enabled`]},tags:r.tags}):u(r.body)});return}let i=await o(r),g=r.local?e:await t();if(r.accountId=g,r.file){let e=m(r.file);s(await l(`Updating`,async()=>a(i,`PATCH`,`/accounts/${g}/workers/workers/${encodeURIComponent(String(r[`worker-id`]))}`,{body:e,headers:{"Content-Type":`application/merge-patch+json`}})),{successLabel:`Updated`});return}if(r.body){let e=u(r.body);s(await l(`Updating`,async()=>a(i,`PATCH`,`/accounts/${g}/workers/workers/${encodeURIComponent(String(r[`worker-id`]))}`,{body:e})),{successLabel:`Updated`});return}if(r.logpush===void 0)throw Error(`--logpush is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await h(`name`,`Name of the Worker.`)),r.tags===void 0)throw Error(`--tags is required (or pass --body with this field set).`);let _={};r.logpush!==void 0&&d(_,[`logpush`],r.logpush),r.name!==void 0&&d(_,[`name`],p(r.name,`name`,`text`)),r[`observability-enabled`]!==void 0&&d(_,[`observability`,`enabled`],r[`observability-enabled`]),r[`observability-head-sampling-rate`]!==void 0&&d(_,[`observability`,`head_sampling_rate`],r[`observability-head-sampling-rate`]),r[`observability-logs-destinations`]!==void 0&&d(_,[`observability`,`logs`,`destinations`],r[`observability-logs-destinations`]),r[`observability-logs-enabled`]!==void 0&&d(_,[`observability`,`logs`,`enabled`],r[`observability-logs-enabled`]),r[`observability-logs-head-sampling-rate`]!==void 0&&d(_,[`observability`,`logs`,`head_sampling_rate`],r[`observability-logs-head-sampling-rate`]),r[`observability-logs-invocation-logs`]!==void 0&&d(_,[`observability`,`logs`,`invocation_logs`],r[`observability-logs-invocation-logs`]),r[`observability-logs-persist`]!==void 0&&d(_,[`observability`,`logs`,`persist`],r[`observability-logs-persist`]),r[`observability-redact-query-string`]!==void 0&&d(_,[`observability`,`redact_query_string`],r[`observability-redact-query-string`]),r[`observability-traces-destinations`]!==void 0&&d(_,[`observability`,`traces`,`destinations`],r[`observability-traces-destinations`]),r[`observability-traces-enabled`]!==void 0&&d(_,[`observability`,`traces`,`enabled`],r[`observability-traces-enabled`]),r[`observability-traces-head-sampling-rate`]!==void 0&&d(_,[`observability`,`traces`,`head_sampling_rate`],r[`observability-traces-head-sampling-rate`]),r[`observability-traces-persist`]!==void 0&&d(_,[`observability`,`traces`,`persist`],r[`observability-traces-persist`]),r[`observability-traces-propagation-policy`]!==void 0&&d(_,[`observability`,`traces`,`propagation_policy`],p(r[`observability-traces-propagation-policy`],`observability-traces-propagation-policy`,`text`)),r[`subdomain-enabled`]!==void 0&&d(_,[`subdomain`,`enabled`],r[`subdomain-enabled`]),r[`subdomain-previews-enabled`]!==void 0&&d(_,[`subdomain`,`previews_enabled`],r[`subdomain-previews-enabled`]),r.tags!==void 0&&d(_,[`tags`],r.tags),s(await l(`Updating`,async()=>a(i,`PATCH`,`/accounts/${g}/workers/workers/${encodeURIComponent(String(r[`worker-id`]))}`,{body:Object.keys(_).length>0?_:void 0})),{successLabel:`Updated`})}};function P(e){return e.positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const F={command:`get <worker-id>`,describe:`Get details about a specific Worker.`,builder:P,handler:async r=>{if(r.dryRun){c({command:`cf workers beta workers get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers/${r[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(r[`worker-id`]))}`,pathParams:{"worker-id":String(r[`worker-id`]??``)},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();r.accountId=a,s(await l(`Loading`,async()=>i.workers.beta.workers.get({account_id:a,worker_id:r[`worker-id`]})),{successLabel:`Loaded`})}};function I(e){return e.option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`order-by`,{type:`string`,description:`Property to sort results by.`,choices:[`deployed_on`,`updated_on`,`created_on`,`name`]}).option(`order`,{type:`string`,description:`Sort direction.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const L={command:`list`,describe:`List all Workers for an account.`,builder:v(I),handler:async r=>{let i={page:r.page,per_page:r[`per-page`],order_by:r[`order-by`],order:r.order};if(r.dryRun){c({command:`cf workers beta workers list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers`,pathParams:{},query:i,bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u,s(await l(`Loading`,async()=>a.workers.beta.workers.list({account_id:u,...i})),{successLabel:`Loaded`})}};function R(e){return e.positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`logpush`,{type:`boolean`,description:`Whether logpush is enabled for the Worker.`}).option(`name`,{type:`string`,description:`Name of the Worker.`}).option(`observability-enabled`,{type:`boolean`,description:`Whether observability is enabled for the Worker.`}).option(`observability-head-sampling-rate`,{type:`number`,description:`The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%).`}).option(`observability-logs-destinations`,{type:`string`,array:!0,description:`A list of destinations where logs will be exported to.`}).option(`observability-logs-enabled`,{type:`boolean`,description:`Whether logs are enabled for the Worker.`}).option(`observability-logs-head-sampling-rate`,{type:`number`,description:`The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%).`}).option(`observability-logs-invocation-logs`,{type:`boolean`,description:`Whether [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) are enabled for the Worker.`}).option(`observability-logs-persist`,{type:`boolean`,description:`Whether log persistence is enabled for the Worker.`}).option(`observability-redact-query-string`,{type:`boolean`,description:`Whether query strings are removed from request URLs in logs and traces.`}).option(`observability-traces-destinations`,{type:`string`,array:!0,description:`A list of destinations where traces will be exported to.`}).option(`observability-traces-enabled`,{type:`boolean`,description:`Whether traces are enabled for the Worker.`}).option(`observability-traces-head-sampling-rate`,{type:`number`,description:`The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%).`}).option(`observability-traces-persist`,{type:`boolean`,description:`Whether trace persistence is enabled for the Worker.`}).option(`observability-traces-propagation-policy`,{type:`string`,description:`Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. "authenticated" honors inbound trace context only when accompanied by a valid trace auth token. "accept" unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled. Returns null when the trace propagation feature is not enabled for the account.`,choices:[`authenticated`,`accept`]}).option(`subdomain-enabled`,{type:`boolean`,description:`Whether the *.workers.dev subdomain is enabled for the Worker.`}).option(`subdomain-previews-enabled`,{type:`boolean`,description:`Whether [preview URLs](https://developers.cloudflare.com/workers/configuration/previews/) are enabled for the Worker.`}).option(`tags`,{type:`string`,array:!0,description:`Tags associated with the Worker.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Worker update parameters.`})}const z={command:`update <worker-id>`,describe:`Perform a complete replacement of a Worker, where omitted properties are set to their default values. This is the exact same as the Create Worker endpoint, but operates on an existing Worker. To perform a partial update instead, use the Edit Worker endpoint.`,builder:R,handler:async r=>{if(r.dryRun){c({command:`cf workers beta workers update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers/${r[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(r[`worker-id`]))}`,pathParams:{"worker-id":String(r[`worker-id`]??``)},bodyKind:`json`,body:r.body===void 0?f({logpush:r.logpush,name:p(r.name,`name`,`text`),observability:{enabled:r[`observability-enabled`],head_sampling_rate:r[`observability-head-sampling-rate`],logs:{destinations:r[`observability-logs-destinations`],enabled:r[`observability-logs-enabled`],head_sampling_rate:r[`observability-logs-head-sampling-rate`],invocation_logs:r[`observability-logs-invocation-logs`],persist:r[`observability-logs-persist`]},redact_query_string:r[`observability-redact-query-string`],traces:{destinations:r[`observability-traces-destinations`],enabled:r[`observability-traces-enabled`],head_sampling_rate:r[`observability-traces-head-sampling-rate`],persist:r[`observability-traces-persist`],propagation_policy:p(r[`observability-traces-propagation-policy`],`observability-traces-propagation-policy`,`text`)}},subdomain:{enabled:r[`subdomain-enabled`],previews_enabled:r[`subdomain-previews-enabled`]},tags:r.tags}):u(r.body)});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,r.body){let e=u(r.body);s(await l(`Updating`,async()=>i.workers.beta.workers.update({...e,account_id:a,worker_id:r[`worker-id`]})),{successLabel:`Updated`});return}if(r.logpush===void 0)throw Error(`--logpush is required (or pass --body with this field set).`);if(r.name===void 0&&(r.name=await h(`name`,`Name of the Worker.`)),r.tags===void 0)throw Error(`--tags is required (or pass --body with this field set).`);let d=f({logpush:r.logpush,name:p(r.name,`name`,`text`),observability:{enabled:r[`observability-enabled`],head_sampling_rate:r[`observability-head-sampling-rate`],logs:{destinations:r[`observability-logs-destinations`],enabled:r[`observability-logs-enabled`],head_sampling_rate:r[`observability-logs-head-sampling-rate`],invocation_logs:r[`observability-logs-invocation-logs`],persist:r[`observability-logs-persist`]},redact_query_string:r[`observability-redact-query-string`],traces:{destinations:r[`observability-traces-destinations`],enabled:r[`observability-traces-enabled`],head_sampling_rate:r[`observability-traces-head-sampling-rate`],persist:r[`observability-traces-persist`],propagation_policy:p(r[`observability-traces-propagation-policy`],`observability-traces-propagation-policy`,`text`)}},subdomain:{enabled:r[`subdomain-enabled`],previews_enabled:r[`subdomain-previews-enabled`]},tags:r.tags});s(await l(`Updating`,async()=>i.workers.beta.workers.update({...d,account_id:a,worker_id:r[`worker-id`]})),{successLabel:`Updated`})}};function B(e){return e.positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`deploy`,{type:`boolean`,description:`If true, a deployment will be created that sends 100% of traffic to the new version.`}).option(`assets-config-html-handling`,{type:`string`,description:`Determines the redirects and rewrites of requests for HTML content.`,choices:[`auto-trailing-slash`,`force-trailing-slash`,`drop-trailing-slash`,`none`]}).option(`assets-config-not-found-handling`,{type:`string`,description:`Determines the response when a request does not match a static asset, and there is no Worker script.`,choices:[`none`,`404-page`,`single-page-application`]}).option(`assets-jwt`,{type:`string`,description:`Token provided upon successful upload of all files from a registered manifest.`}).option(`cache-options-cross-version-cache`,{type:`boolean`,description:`Whether cached responses are shared across Worker version
|
|
4
|
-
uploads. This is independent of \`enabled\`. It can stay true
|
|
5
|
-
while caching is off, so the preference survives turning
|
|
6
|
-
caching off and back on.
|
|
7
|
-
`}).option(`cache-options-enabled`,{type:`boolean`,description:`Whether caching is enabled for this Worker.`}).option(`compatibility-date`,{type:`string`,description:`Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.`}).option(`compatibility-flags`,{type:`string`,array:!0,description:"Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a `compatibility_date`."}).option(`exports-reconciliation-created`,{type:`string`,array:!0,description:`Class names for which a new namespace was provisioned.`}).option(`exports-reconciliation-deleted`,{type:`string`,array:!0,description:"Class names whose namespace was deleted by a `deleted` tombstone."}).option(`exports-reconciliation-removable-entries`,{type:`string`,array:!0,description:`Source class names whose tombstone entry is now stale and safe
|
|
8
|
-
to delete from \`exports\` (no remaining referencing scripts).
|
|
9
|
-
`}).option(`exports-reconciliation-updated`,{type:`string`,array:!0,description:`Class names whose provisioned namespace was mutated in place.`}).option(`limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`limits-subrequests`,{type:`number`,description:`Subrequest limit per request.`}).option(`main-module`,{type:`string`,description:"The name of the main module in the `modules` array (e.g. the name of the module that exports a `fetch` handler)."}).option(`migrations-new-tag`,{type:`string`,description:`Tag to set as the latest migration tag.`}).option(`migrations-old-tag`,{type:`string`,description:`Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.`}).option(`migrations-deleted-classes`,{type:`string`,array:!0,description:`A list of classes to delete Durable Object namespaces from.`}).option(`migrations-new-classes`,{type:`string`,array:!0,description:`A list of classes to create Durable Object namespaces from.`}).option(`migrations-new-sqlite-classes`,{type:`string`,array:!0,description:`A list of classes to create Durable Object namespaces with SQLite from.`}).option(`placement-mode`,{type:`string`,description:`Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).`,choices:[`smart`,`targeted`]}).option(`placement-region`,{type:`string`,description:`Cloud region for targeted placement in format 'provider:region'.`}).option(`placement-hostname`,{type:`string`,description:`HTTP hostname for targeted placement.`}).option(`placement-host`,{type:`string`,description:`TCP host and port for targeted placement.`}).option(`usage-model`,{type:`string`,description:`Usage model for the version.`,choices:[`standard`,`bundled`,`unbound`],default:`standard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Version creation parameters.`}).conflicts(`placement-mode`,[`placement-region`,`placement-hostname`,`placement-host`]).conflicts(`placement-region`,[`placement-mode`,`placement-hostname`,`placement-host`]).conflicts(`placement-hostname`,[`placement-mode`,`placement-region`,`placement-host`]).conflicts(`placement-host`,[`placement-mode`,`placement-region`,`placement-hostname`]).check(e=>{if([`cache-options-cross-version-cache`,`cache-options-enabled`].some(t=>e[t]!==void 0)){let t=[`cache-options-enabled`].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 --cache_options-* flag is set`)}return!0}).check(e=>{if([`exports-reconciliation-created`,`exports-reconciliation-deleted`,`exports-reconciliation-removable-entries`,`exports-reconciliation-updated`].some(t=>e[t]!==void 0)){let t=[`exports-reconciliation-created`,`exports-reconciliation-deleted`,`exports-reconciliation-removable-entries`,`exports-reconciliation-updated`].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 --exports_reconciliation-* flag is set`)}return!0})}const V={command:`create <worker-id>`,describe:`Create a new version.`,builder:B,handler:async r=>{let i={deploy:r.deploy};if(r.dryRun){c({command:`cf workers beta workers versions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers/${r[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(r[`worker-id`]))}/versions`,pathParams:{"worker-id":String(r[`worker-id`]??``)},query:i,bodyKind:`json`,body:r.body===void 0?f({assets:{config:{html_handling:p(r[`assets-config-html-handling`],`assets-config-html-handling`,`text`),not_found_handling:p(r[`assets-config-not-found-handling`],`assets-config-not-found-handling`,`text`)},jwt:p(r[`assets-jwt`],`assets-jwt`,`text`)},cache_options:{cross_version_cache:r[`cache-options-cross-version-cache`],enabled:r[`cache-options-enabled`]},compatibility_date:p(r[`compatibility-date`],`compatibility-date`,`text`),compatibility_flags:r[`compatibility-flags`],exports_reconciliation:{created:r[`exports-reconciliation-created`],deleted:r[`exports-reconciliation-deleted`],removable_entries:r[`exports-reconciliation-removable-entries`],updated:r[`exports-reconciliation-updated`]},limits:{cpu_ms:r[`limits-cpu-ms`],subrequests:r[`limits-subrequests`]},main_module:p(r[`main-module`],`main-module`,`text`),migrations:{new_tag:p(r[`migrations-new-tag`],`migrations-new-tag`,`text`),old_tag:p(r[`migrations-old-tag`],`migrations-old-tag`,`text`),deleted_classes:r[`migrations-deleted-classes`],new_classes:r[`migrations-new-classes`],new_sqlite_classes:r[`migrations-new-sqlite-classes`]},placement:{mode:p(r[`placement-mode`],`placement-mode`,`text`),region:p(r[`placement-region`],`placement-region`,`text`),hostname:p(r[`placement-hostname`],`placement-hostname`,`text`),host:p(r[`placement-host`],`placement-host`,`text`)},usage_model:p(r[`usage-model`],`usage-model`,`text`)}):u(r.body)});return}let a=await o(r),d=r.local?e:await t();if(r.accountId=d,r.body){let e=u(r.body);new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Creating`,async()=>a.workers.beta.workers.versions.create({body:e,account_id:d,worker_id:r[`worker-id`],...i})),{successLabel:`Created`});return}let m=f({assets:{config:{html_handling:p(r[`assets-config-html-handling`],`assets-config-html-handling`,`text`),not_found_handling:p(r[`assets-config-not-found-handling`],`assets-config-not-found-handling`,`text`)},jwt:p(r[`assets-jwt`],`assets-jwt`,`text`)},cache_options:{cross_version_cache:r[`cache-options-cross-version-cache`],enabled:r[`cache-options-enabled`]},compatibility_date:p(r[`compatibility-date`],`compatibility-date`,`text`),compatibility_flags:r[`compatibility-flags`],exports_reconciliation:{created:r[`exports-reconciliation-created`],deleted:r[`exports-reconciliation-deleted`],removable_entries:r[`exports-reconciliation-removable-entries`],updated:r[`exports-reconciliation-updated`]},limits:{cpu_ms:r[`limits-cpu-ms`],subrequests:r[`limits-subrequests`]},main_module:p(r[`main-module`],`main-module`,`text`),migrations:{new_tag:p(r[`migrations-new-tag`],`migrations-new-tag`,`text`),old_tag:p(r[`migrations-old-tag`],`migrations-old-tag`,`text`),deleted_classes:r[`migrations-deleted-classes`],new_classes:r[`migrations-new-classes`],new_sqlite_classes:r[`migrations-new-sqlite-classes`]},placement:{mode:p(r[`placement-mode`],`placement-mode`,`text`),region:p(r[`placement-region`],`placement-region`,`text`),hostname:p(r[`placement-hostname`],`placement-hostname`,`text`),host:p(r[`placement-host`],`placement-host`,`text`)},usage_model:p(r[`usage-model`],`usage-model`,`text`)});new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Creating`,async()=>a.workers.beta.workers.versions.create({body:m,account_id:d,worker_id:r[`worker-id`],...i})),{successLabel:`Created`})}};function H(e){return e.positional(`version-id`,{type:`string`,description:`Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal "latest" to operate on the most recently created version.`,demandOption:!0}).option(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const U={command:`delete <version-id>`,describe:`Delete a version.`,builder:H,handler:async r=>{if(r.dryRun){c({command:`cf workers beta workers versions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers/${r[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(r[`worker-id`]))}/versions/${r[`version-id`]==null?`<version-id>`:encodeURIComponent(String(r[`version-id`]))}`,pathParams:{"worker-id":String(r[`worker-id`]??``),"version-id":String(r[`version-id`]??``)},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
10
|
-
`);return}s(await l(`Deleting`,async()=>i.workers.beta.workers.versions.delete({account_id:a,worker_id:r[`worker-id`],version_id:r[`version-id`]})),{successLabel:`Deleted`})}};function W(e){return e.positional(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`deploy`,{type:`boolean`,description:`If true, a deployment will be created that sends 100% of traffic to the new version.`}).option(`assets-config-html-handling`,{type:`string`,description:`Determines the redirects and rewrites of requests for HTML content.`,choices:[`auto-trailing-slash`,`force-trailing-slash`,`drop-trailing-slash`,`none`]}).option(`assets-config-not-found-handling`,{type:`string`,description:`Determines the response when a request does not match a static asset, and there is no Worker script.`,choices:[`none`,`404-page`,`single-page-application`]}).option(`assets-jwt`,{type:`string`,description:`Token provided upon successful upload of all files from a registered manifest.`}).option(`cache-options-cross-version-cache`,{type:`boolean`,description:`Whether cached responses are shared across Worker version
|
|
11
|
-
uploads. This is independent of \`enabled\`. It can stay true
|
|
12
|
-
while caching is off, so the preference survives turning
|
|
13
|
-
caching off and back on.
|
|
14
|
-
`}).option(`cache-options-enabled`,{type:`boolean`,description:`Whether caching is enabled for this Worker.`}).option(`compatibility-date`,{type:`string`,description:`Date indicating targeted support in the Workers runtime. Backwards incompatible fixes to the runtime following this date will not affect this Worker.`}).option(`compatibility-flags`,{type:`string`,array:!0,description:"Flags that enable or disable certain features in the Workers runtime. Used to enable upcoming features or opt in or out of specific changes not included in a `compatibility_date`."}).option(`exports-reconciliation-created`,{type:`string`,array:!0,description:`Class names for which a new namespace was provisioned.`}).option(`exports-reconciliation-deleted`,{type:`string`,array:!0,description:"Class names whose namespace was deleted by a `deleted` tombstone."}).option(`exports-reconciliation-removable-entries`,{type:`string`,array:!0,description:`Source class names whose tombstone entry is now stale and safe
|
|
15
|
-
to delete from \`exports\` (no remaining referencing scripts).
|
|
16
|
-
`}).option(`exports-reconciliation-updated`,{type:`string`,array:!0,description:`Class names whose provisioned namespace was mutated in place.`}).option(`limits-cpu-ms`,{type:`number`,description:`CPU time limit in milliseconds.`}).option(`limits-subrequests`,{type:`number`,description:`Subrequest limit per request.`}).option(`main-module`,{type:`string`,description:"The name of the main module in the `modules` array (e.g. the name of the module that exports a `fetch` handler)."}).option(`migrations-new-tag`,{type:`string`,description:`Tag to set as the latest migration tag.`}).option(`migrations-old-tag`,{type:`string`,description:`Tag used to verify against the latest migration tag for this Worker. If they don't match, the upload is rejected.`}).option(`migrations-deleted-classes`,{type:`string`,array:!0,description:`A list of classes to delete Durable Object namespaces from.`}).option(`migrations-new-classes`,{type:`string`,array:!0,description:`A list of classes to create Durable Object namespaces from.`}).option(`migrations-new-sqlite-classes`,{type:`string`,array:!0,description:`A list of classes to create Durable Object namespaces with SQLite from.`}).option(`placement-mode`,{type:`string`,description:`Enables [Smart Placement](https://developers.cloudflare.com/workers/configuration/smart-placement).`,choices:[`smart`,`targeted`]}).option(`placement-region`,{type:`string`,description:`Cloud region for targeted placement in format 'provider:region'.`}).option(`placement-hostname`,{type:`string`,description:`HTTP hostname for targeted placement.`}).option(`placement-host`,{type:`string`,description:`TCP host and port for targeted placement.`}).option(`usage-model`,{type:`string`,description:`Usage model for the version.`,choices:[`standard`,`bundled`,`unbound`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`JSON Merge Patch to apply to the latest version. An empty object creates a new version with no changes.`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).conflicts(`placement-mode`,[`placement-region`,`placement-hostname`,`placement-host`]).conflicts(`placement-region`,[`placement-mode`,`placement-hostname`,`placement-host`]).conflicts(`placement-hostname`,[`placement-mode`,`placement-region`,`placement-host`]).conflicts(`placement-host`,[`placement-mode`,`placement-region`,`placement-hostname`]).check(e=>{if([`cache-options-cross-version-cache`,`cache-options-enabled`].some(t=>e[t]!==void 0)){let t=[`cache-options-enabled`].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 --cache_options-* flag is set`)}return!0}).check(e=>{if([`exports-reconciliation-created`,`exports-reconciliation-deleted`,`exports-reconciliation-removable-entries`,`exports-reconciliation-updated`].some(t=>e[t]!==void 0)){let t=[`exports-reconciliation-created`,`exports-reconciliation-deleted`,`exports-reconciliation-removable-entries`,`exports-reconciliation-updated`].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 --exports_reconciliation-* flag is set`)}return!0})}const G={command:`edit <worker-id>`,describe:"Only `/versions/latest` is supported. Creates a new version by applying a JSON Merge Patch (RFC 7396) to the latest version. Patching a specific version ID is not supported. Omitted fields are inherited from the latest version.",builder:W,handler:async r=>{let i={deploy:r.deploy};if(r.dryRun){c({command:`cf workers beta workers versions edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers/${r[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(r[`worker-id`]))}/versions/latest`,pathParams:{"worker-id":String(r[`worker-id`]??``)},query:i,bodyKind:`json`,body:r.body===void 0?f({assets:{config:{html_handling:p(r[`assets-config-html-handling`],`assets-config-html-handling`,`text`),not_found_handling:p(r[`assets-config-not-found-handling`],`assets-config-not-found-handling`,`text`)},jwt:p(r[`assets-jwt`],`assets-jwt`,`text`)},cache_options:{cross_version_cache:r[`cache-options-cross-version-cache`],enabled:r[`cache-options-enabled`]},compatibility_date:p(r[`compatibility-date`],`compatibility-date`,`text`),compatibility_flags:r[`compatibility-flags`],exports_reconciliation:{created:r[`exports-reconciliation-created`],deleted:r[`exports-reconciliation-deleted`],removable_entries:r[`exports-reconciliation-removable-entries`],updated:r[`exports-reconciliation-updated`]},limits:{cpu_ms:r[`limits-cpu-ms`],subrequests:r[`limits-subrequests`]},main_module:p(r[`main-module`],`main-module`,`text`),migrations:{new_tag:p(r[`migrations-new-tag`],`migrations-new-tag`,`text`),old_tag:p(r[`migrations-old-tag`],`migrations-old-tag`,`text`),deleted_classes:r[`migrations-deleted-classes`],new_classes:r[`migrations-new-classes`],new_sqlite_classes:r[`migrations-new-sqlite-classes`]},placement:{mode:p(r[`placement-mode`],`placement-mode`,`text`),region:p(r[`placement-region`],`placement-region`,`text`),hostname:p(r[`placement-hostname`],`placement-hostname`,`text`),host:p(r[`placement-host`],`placement-host`,`text`)},usage_model:p(r[`usage-model`],`usage-model`,`text`)}):u(r.body)});return}let h=await o(r),g=r.local?e:await t();if(r.accountId=g,r.file){let e=m(r.file);s(await l(`Updating`,async()=>a(h,`PATCH`,`/accounts/${g}/workers/workers/${encodeURIComponent(String(r[`worker-id`]))}/versions/latest`,{body:e,headers:{"Content-Type":`application/merge-patch+json`}})),{successLabel:`Updated`});return}if(r.body){let e=u(r.body),t=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();s(await l(`Updating`,async()=>a(h,`PATCH`,`/accounts/${g}/workers/workers/${encodeURIComponent(String(r[`worker-id`]))}/versions/latest${t?`?`+t:``}`,{body:e})),{successLabel:`Updated`});return}let _={};r[`assets-config-html-handling`]!==void 0&&d(_,[`assets`,`config`,`html_handling`],p(r[`assets-config-html-handling`],`assets-config-html-handling`,`text`)),r[`assets-config-not-found-handling`]!==void 0&&d(_,[`assets`,`config`,`not_found_handling`],p(r[`assets-config-not-found-handling`],`assets-config-not-found-handling`,`text`)),r[`assets-jwt`]!==void 0&&d(_,[`assets`,`jwt`],p(r[`assets-jwt`],`assets-jwt`,`text`)),r[`cache-options-cross-version-cache`]!==void 0&&d(_,[`cache_options`,`cross_version_cache`],r[`cache-options-cross-version-cache`]),r[`cache-options-enabled`]!==void 0&&d(_,[`cache_options`,`enabled`],r[`cache-options-enabled`]),r[`compatibility-date`]!==void 0&&d(_,[`compatibility_date`],p(r[`compatibility-date`],`compatibility-date`,`text`)),r[`compatibility-flags`]!==void 0&&d(_,[`compatibility_flags`],r[`compatibility-flags`]),r[`exports-reconciliation-created`]!==void 0&&d(_,[`exports_reconciliation`,`created`],r[`exports-reconciliation-created`]),r[`exports-reconciliation-deleted`]!==void 0&&d(_,[`exports_reconciliation`,`deleted`],r[`exports-reconciliation-deleted`]),r[`exports-reconciliation-removable-entries`]!==void 0&&d(_,[`exports_reconciliation`,`removable_entries`],r[`exports-reconciliation-removable-entries`]),r[`exports-reconciliation-updated`]!==void 0&&d(_,[`exports_reconciliation`,`updated`],r[`exports-reconciliation-updated`]),r[`limits-cpu-ms`]!==void 0&&d(_,[`limits`,`cpu_ms`],r[`limits-cpu-ms`]),r[`limits-subrequests`]!==void 0&&d(_,[`limits`,`subrequests`],r[`limits-subrequests`]),r[`main-module`]!==void 0&&d(_,[`main_module`],p(r[`main-module`],`main-module`,`text`)),r[`migrations-new-tag`]!==void 0&&d(_,[`migrations`,`new_tag`],p(r[`migrations-new-tag`],`migrations-new-tag`,`text`)),r[`migrations-old-tag`]!==void 0&&d(_,[`migrations`,`old_tag`],p(r[`migrations-old-tag`],`migrations-old-tag`,`text`)),r[`migrations-deleted-classes`]!==void 0&&d(_,[`migrations`,`deleted_classes`],r[`migrations-deleted-classes`]),r[`migrations-new-classes`]!==void 0&&d(_,[`migrations`,`new_classes`],r[`migrations-new-classes`]),r[`migrations-new-sqlite-classes`]!==void 0&&d(_,[`migrations`,`new_sqlite_classes`],r[`migrations-new-sqlite-classes`]),r[`placement-mode`]!==void 0&&d(_,[`placement`,`mode`],p(r[`placement-mode`],`placement-mode`,`text`)),r[`placement-region`]!==void 0&&d(_,[`placement`,`region`],p(r[`placement-region`],`placement-region`,`text`)),r[`placement-hostname`]!==void 0&&d(_,[`placement`,`hostname`],p(r[`placement-hostname`],`placement-hostname`,`text`)),r[`placement-host`]!==void 0&&d(_,[`placement`,`host`],p(r[`placement-host`],`placement-host`,`text`)),r[`usage-model`]!==void 0&&d(_,[`usage_model`],p(r[`usage-model`],`usage-model`,`text`));let v=new URLSearchParams(Object.entries(i).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();s(await l(`Updating`,async()=>a(h,`PATCH`,`/accounts/${g}/workers/workers/${encodeURIComponent(String(r[`worker-id`]))}/versions/latest${v?`?`+v:``}`,{body:Object.keys(_).length>0?_:void 0})),{successLabel:`Updated`})}};function K(e){return e.positional(`version-id`,{type:`string`,description:`Identifier for the version, which can be a UUID, a UUID prefix (minimum length 8), or the literal "latest" to operate on the most recently created version.`,demandOption:!0}).option(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`include`,{type:`string`,description:"Whether to include the `modules` property of the version in the response, which contains code and sourcemap content and may add several megabytes to the response size.",choices:[`modules`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const q={command:`get <version-id>`,describe:`Get details about a specific version.`,builder:v(K),handler:async r=>{let i={include:r.include};if(r.dryRun){c({command:`cf workers beta workers versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers/${r[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(r[`worker-id`]))}/versions/${r[`version-id`]==null?`<version-id>`:encodeURIComponent(String(r[`version-id`]))}`,pathParams:{"worker-id":String(r[`worker-id`]??``),"version-id":String(r[`version-id`]??``)},query:i,bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u,s(await l(`Loading`,async()=>a.workers.beta.workers.versions.get({account_id:u,worker_id:r[`worker-id`],version_id:r[`version-id`],...i})),{successLabel:`Loaded`})}};function J(e){return e.option(`worker-id`,{type:`string`,description:`Identifier for the Worker, which can be ID or name.`,demandOption:!0}).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Y={command:`list`,describe:`List all versions for a Worker.`,builder:J,handler:async r=>{let i={page:r.page,per_page:r[`per-page`]};if(r.dryRun){c({command:`cf workers beta workers versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/workers/${r[`worker-id`]==null?`<worker-id>`:encodeURIComponent(String(r[`worker-id`]))}/versions`,pathParams:{"worker-id":String(r[`worker-id`]??``)},query:i,bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u,s(await l(`Loading`,async()=>a.workers.beta.workers.versions.list({account_id:u,worker_id:r[`worker-id`],...i})),{successLabel:`Loaded`})}},X={command:`versions`,describe:`Operations for beta.workers.versions`,builder:e=>e.command(V).command(U).command(G).command(q).command(Y).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Z={command:`workers`,describe:`Operations for beta.workers`,builder:e=>e.command(k).command(j).command(N).command(F).command(L).command(z).command(X).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Q={command:`beta`,describe:`Operations for beta`,builder:e=>e.command(Z).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ne(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`force`,{type:`boolean`,description:`If set to true, the deployment will be created even if normally blocked by something such rolling back to an older version when a secret has changed.`}).option(`strategy`,{type:`string`,description:`The strategy field`,choices:[`percentage`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const re={command:`create`,describe:`Deployments configure how [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions) are deployed to traffic. A deployment can consist of one or two versions of a Worker.`,builder:ne,handler:async r=>{let a={force:r.force};if(r.dryRun){c({command:`cf workers deployments create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/deployments`,pathParams:{"script-name":String(r[`script-name`]??``)},query:a,bodyKind:`json`,body:r.body===void 0?f({strategy:p(r.strategy,`strategy`,`text`)}):u(r.body)});return}let d=await o(r),m=r.local?e:await t();r.accountId=m;let h=i({scriptName:r.worker});if(r.worker=h,r.body){let e=u(r.body);new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Creating`,async()=>d.workers.deployments.create({body:e,account_id:m,script_name:h,...a})),{successLabel:`Created`});return}r.strategy===void 0&&(r.strategy=await g(`strategy`,`The strategy field`,[`percentage`]));let _=f({strategy:p(r.strategy,`strategy`,`text`)});new URLSearchParams(Object.entries(a).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString(),s(await l(`Creating`,async()=>d.workers.deployments.create({body:_,account_id:m,script_name:h,...a})),{successLabel:`Created`})}};function ie(e){return e.positional(`deployment-id`,{type:`string`,description:`Deployment ID`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const ae={command:`delete <deployment-id>`,describe:`Delete a Worker Deployment. The latest deployment, which is actively serving traffic, cannot be deleted. All other deployments can be deleted.`,builder:ie,handler:async r=>{if(r.dryRun){c({command:`cf workers deployments delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}`,pathParams:{"script-name":String(r[`script-name`]??``),"deployment-id":String(r[`deployment-id`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});if(r.worker=d,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
17
|
-
`);return}s(await l(`Deleting`,async()=>a.workers.deployments.delete({account_id:u,script_name:d,deployment_id:r[`deployment-id`]})),{successLabel:`Deleted`})}};function oe(e){return e.positional(`deployment-id`,{type:`string`,description:`Deployment ID`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const se={command:`get <deployment-id>`,describe:`Get information about a Worker Deployment.`,builder:oe,handler:async r=>{if(r.dryRun){c({command:`cf workers deployments get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/deployments/${r[`deployment-id`]==null?`<deployment-id>`:encodeURIComponent(String(r[`deployment-id`]))}`,pathParams:{"script-name":String(r[`script-name`]??``),"deployment-id":String(r[`deployment-id`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.deployments.get({account_id:u,script_name:d,deployment_id:r[`deployment-id`]})),{successLabel:`Loaded`})}};function ce(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`list`,describe:`List of Worker Deployments. The first deployment in the list is the latest deployment actively serving traffic.`,builder:ce,handler:async r=>{if(r.dryRun){c({command:`cf workers deployments list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/deployments`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.deployments.list({account_id:u,script_name:d})),{successLabel:`Loaded`})}},ue={command:`deployments`,describe:`Operations for deployments`,builder:e=>e.command(re).command(ae).command(se).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(e){return e.positional(`domain-id`,{type:`string`,description:`ID of the domain.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const fe={command:`delete <domain-id>`,describe:`Detaches a domain from a Worker. Both the Worker and all of its previews are no longer routable using this domain.`,builder:de,handler:async r=>{if(r.dryRun){c({command:`cf workers domains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/domains/${r[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(r[`domain-id`]))}`,pathParams:{"domain-id":String(r[`domain-id`]??``)},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
18
|
-
`);return}s(await l(`Deleting`,async()=>i.workers.domains.delete({account_id:a,domain_id:r[`domain-id`]})),{successLabel:`Deleted`})}};function pe(e){return e.positional(`domain-id`,{type:`string`,description:`ID of the domain.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`get <domain-id>`,describe:`Gets information about a domain.`,builder:pe,handler:async r=>{if(r.dryRun){c({command:`cf workers domains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/domains/${r[`domain-id`]==null?`<domain-id>`:encodeURIComponent(String(r[`domain-id`]))}`,pathParams:{"domain-id":String(r[`domain-id`]??``)},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();r.accountId=a,s(await l(`Loading`,async()=>i.workers.domains.get({account_id:a,domain_id:r[`domain-id`]})),{successLabel:`Loaded`})}};function he(e){return e.option(`zone-id`,{type:`string`,description:`ID of the zone containing the domain hostname.`}).option(`zone-name`,{type:`string`,description:`Name of the zone containing the domain hostname.`}).option(`service`,{type:`string`,description:`Name of the Worker associated with the domain.`}).option(`hostname`,{type:`string`,description:`Hostname of the domain.`}).option(`environment`,{type:`string`,description:`Worker environment associated with the domain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`list`,describe:`Lists all domains for an account.`,builder:he,handler:async r=>{let i={zone_id:r[`zone-id`],zone_name:r[`zone-name`],service:r.service,hostname:r.hostname,environment:r.environment};if(r.dryRun){c({command:`cf workers domains list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/domains`,pathParams:{},query:i,bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u,s(await l(`Loading`,async()=>a.workers.domains.list({account_id:u,...i})),{successLabel:`Loaded`})}};function _e(e){return e.option(`hostname`,{type:`string`,description:`Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.`}).option(`service`,{type:`string`,description:`Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.`}).option(`zone-id`,{type:`string`,description:`ID of the zone containing the domain hostname.`}).option(`zone-name`,{type:`string`,description:`Name of the zone containing the domain hostname.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ve={command:`update`,describe:`Attaches a domain that routes traffic to a Worker.`,builder:_e,handler:async r=>{if(r.dryRun){c({command:`cf workers domains update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/domains`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({hostname:p(r.hostname,`hostname`,`text`),service:p(r.service,`service`,`text`),zone_id:p(r[`zone-id`],`zone-id`,`text`),zone_name:p(r[`zone-name`],`zone-name`,`text`)}):u(r.body)});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,r.body){let e=u(r.body);s(await l(`Updating`,async()=>i.workers.domains.update({...e,account_id:a})),{successLabel:`Updated`});return}r.hostname===void 0&&(r.hostname=await h(`hostname`,`Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.`)),r.service===void 0&&(r.service=await h(`service`,`Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.`)),r[`zone-id`]===void 0&&(r[`zone-id`]=await h(`zone-id`,`ID of the zone containing the domain hostname.`)),r[`zone-name`]===void 0&&(r[`zone-name`]=await h(`zone-name`,`Name of the zone containing the domain hostname.`));let d=f({hostname:p(r.hostname,`hostname`,`text`),service:p(r.service,`service`,`text`),zone_id:p(r[`zone-id`],`zone-id`,`text`),zone_name:p(r[`zone-name`],`zone-name`,`text`)});s(await l(`Updating`,async()=>i.workers.domains.update({...d,account_id:a})),{successLabel:`Updated`})}},ye={command:`domains`,describe:`Operations for domains`,builder:e=>e.command(fe).command(me).command(ge).command(ve).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function be(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xe={command:`list`,describe:`Returns a list of available placement regions organized by cloud provider. These regions can be used to configure Smart Placement for Workers.`,builder:be,handler:async r=>{if(r.dryRun){c({command:`cf workers placement regions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/placement/regions`,pathParams:{},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();r.accountId=a,s(await l(`Loading`,async()=>i.workers.placement.regions.list({account_id:a})),{successLabel:`Loaded`})}},Se={command:`regions`,describe:`Operations for placement.regions`,builder:e=>e.command(xe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ce={command:`placement`,describe:`Operations for placement`,builder:e=>e.command(Se).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function we(e){return e.option(`pattern`,{type:`string`,description:`Pattern to match incoming requests against. [Learn more](https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior).`}).option(`script`,{type:`string`,description:`Name of the script to run if the route matches.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Te={command:`create`,describe:`Creates a route that maps a URL pattern to a Worker.`,builder:we,handler:async e=>{if(e.dryRun){c({command:`cf workers routes create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/workers/routes`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({pattern:p(e.pattern,`pattern`,`text`),script:p(e.script,`script`,`text`)}):u(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=u(e.body);s(await l(`Creating`,async()=>t.workers.routes.create({body:r,zone_id:n})),{successLabel:`Created`});return}e.pattern===void 0&&(e.pattern=await h(`pattern`,`Pattern to match incoming requests against. [Learn more](https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior).`));let i=f({pattern:p(e.pattern,`pattern`,`text`),script:p(e.script,`script`,`text`)});s(await l(`Creating`,async()=>t.workers.routes.create({body:i,zone_id:n})),{successLabel:`Created`})}};function Ee(e){return e.positional(`route-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 De={command:`delete <route-id>`,describe:`Deletes a route.`,builder:Ee,handler:async e=>{if(e.dryRun){c({command:`cf workers routes delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/workers/routes/${e[`route-id`]==null?`<route-id>`:encodeURIComponent(String(e[`route-id`]))}`,pathParams:{"route-id":String(e[`route-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await _({force:!!e.force})){process.stderr.write(`Aborted.
|
|
19
|
-
`);return}s(await l(`Deleting`,async()=>t.workers.routes.delete({zone_id:n,route_id:e[`route-id`]})),{successLabel:`Deleted`})}};function Oe(e){return e.positional(`route-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ke={command:`get <route-id>`,describe:`Returns information about a route, including URL pattern and Worker.`,builder:Oe,handler:async e=>{if(e.dryRun){c({command:`cf workers routes get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/workers/routes/${e[`route-id`]==null?`<route-id>`:encodeURIComponent(String(e[`route-id`]))}`,pathParams:{"route-id":String(e[`route-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,s(await l(`Loading`,async()=>t.workers.routes.get({zone_id:n,route_id:e[`route-id`]})),{successLabel:`Loaded`})}};function Ae(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const je={command:`list`,describe:`Returns routes for a zone.`,builder:Ae,handler:async e=>{if(e.dryRun){c({command:`cf workers routes list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/workers/routes`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,s(await l(`Loading`,async()=>t.workers.routes.list({zone_id:n})),{successLabel:`Loaded`})}};function Me(e){return e.positional(`route-id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`pattern`,{type:`string`,description:`Pattern to match incoming requests against. [Learn more](https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior).`}).option(`script`,{type:`string`,description:`Name of the script to run if the route matches.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ne={command:`update <route-id>`,describe:`Updates the URL pattern or Worker associated with a route.`,builder:Me,handler:async e=>{if(e.dryRun){c({command:`cf workers routes update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/workers/routes/${e[`route-id`]==null?`<route-id>`:encodeURIComponent(String(e[`route-id`]))}`,pathParams:{"route-id":String(e[`route-id`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?f({pattern:p(e.pattern,`pattern`,`text`),script:p(e.script,`script`,`text`)}):u(e.body)});return}let t=await o(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=u(e.body);s(await l(`Updating`,async()=>t.workers.routes.update({body:r,zone_id:n,route_id:e[`route-id`]})),{successLabel:`Updated`});return}e.pattern===void 0&&(e.pattern=await h(`pattern`,`Pattern to match incoming requests against. [Learn more](https://developers.cloudflare.com/workers/configuration/routing/routes/#matching-behavior).`));let i=f({pattern:p(e.pattern,`pattern`,`text`),script:p(e.script,`script`,`text`)});s(await l(`Updating`,async()=>t.workers.routes.update({body:i,zone_id:n,route_id:e[`route-id`]})),{successLabel:`Updated`})}},Pe={command:`routes`,describe:`Operations for routes`,builder:e=>e.command(Te).command(De).command(ke).command(je).command(Ne).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Fe(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Ie={command:`create`,describe:`Start uploading a collection of assets for use in a Worker version. To learn more about the direct uploads of assets, see https://developers.cloudflare.com/workers/static-assets/direct-upload/.`,builder:Fe,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts assets upload create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/assets-upload-session`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let a=await o(r),d=r.local?e:await t();r.accountId=d;let f=i({scriptName:r.worker});if(r.worker=f,r.body){let e=u(r.body);s(await l(`Creating`,async()=>a.workers.scripts.assets.upload.create({body:e,account_id:d,script_name:f})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},Le={command:`upload`,describe:`Operations for scripts.assets.upload`,builder:e=>e.command(Ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Re={command:`assets`,describe:`Operations for scripts.assets`,builder:e=>e.command(Le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ze(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Be={command:`get`,describe:`Fetch script content only.`,builder:ze,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/content/v2`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.scripts.content.get({account_id:u,script_name:d})),{successLabel:`Loaded`})}};function Ve(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`cf-worker-body-part`,{type:`string`,description:`The multipart name of a script upload part containing script content in service worker format. Alternative to including in a metadata part.`}).option(`cf-worker-main-module-part`,{type:`string`,description:`The multipart name of a script upload part containing script content in es module format. Alternative to including in a metadata part.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.<br/>Possible Content-Type(s) are: `application/javascript+module`, `text/javascript+module`, `application/javascript`, `text/javascript`, `text/x-python`, `text/x-python-requirement`, `application/wasm`, `text/plain`, `application/octet-stream`, `application/source-map`."}).option(`metadata`,{type:`string`,description:`JSON-encoded metadata about the uploaded parts and Worker configuration.`})}const He={command:`update`,describe:`Put script content without touching config or metadata.`,builder:Ve,handler:async r=>{let u={};if(r[`cf-worker-body-part`]!==void 0&&(u[`CF-WORKER-BODY-PART`]=String(r[`cf-worker-body-part`])),r[`cf-worker-main-module-part`]!==void 0&&(u[`CF-WORKER-MAIN-MODULE-PART`]=String(r[`cf-worker-main-module-part`])),r.dryRun){c({command:`cf workers scripts content update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/content`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`multipart`,body:{body:r.body,file:r.file,files:r.files,metadata:r.metadata}});return}let d=await o(r),f=r.local?e:await t();r.accountId=f;let h=i({scriptName:r.worker});if(r.worker=h,r.file!==void 0||r.body!==void 0||r.files!==void 0||r.metadata!==void 0){let e=new FormData;if(r.file){let t=m(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.files!==void 0){let t=typeof r.files==`string`?p(r.files,`files`,`text`):r.files;e.append(`files`,typeof t==`string`?t:JSON.stringify(t))}if(r.metadata!==void 0){let t=typeof r.metadata==`string`?p(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}s(await l(`Updating`,async()=>a(d,`PUT`,`/accounts/${f}/workers/scripts/${h}/content`,{body:e,headers:Object.keys(u).length>0?u:void 0})),{successLabel:`Updated`});return}if(r.body){let e=p(r.body,`body`,`binary`);s(await l(`Updating`,async()=>a(d,`PUT`,`/accounts/${f}/workers/scripts/${h}/content`,{body:e,headers:{"Content-Type":`multipart/form-data`,...u}})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},Ue={command:`content`,describe:`Operations for scripts.content`,builder:e=>e.command(Be).command(He).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function We(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`force`,{type:`boolean`,description:`If set to true, delete will not be stopped by associated service binding, durable object, or other binding. Any of these associated bindings/durable objects will be deleted along with the script.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ge={command:`delete`,describe:`Delete your worker. This call has no response body on a successful delete.`,builder:We,handler:async r=>{let a={force:r.force};if(r.dryRun){c({command:`cf workers scripts delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}`,pathParams:{"script-name":String(r[`script-name`]??``)},query:a,bodyKind:`none`});return}let u=await o(r),d=r.local?e:await t();r.accountId=d;let f=i({scriptName:r.worker});if(r.worker=f,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
20
|
-
`);return}s(await l(`Deleting`,async()=>u.workers.scripts.delete({account_id:d,script_name:f,...a})),{successLabel:`Deleted`})}};function Ke(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`text`,{type:`boolean`,description:`Decode the response body as UTF-8 text instead of writing raw bytes`,default:!1})}const qe={command:`get`,describe:`Fetch raw script content for your worker. Note this is the original script content, not JSON encoded.`,builder:Ke,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}await o(r);let a=r.local?e:await t();r.accountId=a;let s=i({scriptName:r.worker});r.worker=s;let u=await l(`Loading`,async()=>te(`/accounts/${a}/workers/scripts/${s}`,{method:`GET`,local:r.local===!0,persistTo:r.persistTo}));ee(r.text===!0?u.toString(`utf-8`):u)}};function Je(e){return e.option(`tags`,{type:`string`,description:`Filter scripts by tags. Format: comma-separated list of tag:allowed pairs where allowed is 'yes' or 'no'.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ye={command:`list`,describe:`Fetch a list of uploaded workers.`,builder:Je,handler:async r=>{let i={tags:r.tags};if(r.dryRun){c({command:`cf workers scripts list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts`,pathParams:{},query:i,bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u,s(await l(`Loading`,async()=>a.workers.scripts.list({account_id:u,...i})),{successLabel:`Loaded`})}};function Xe(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ze={command:`get`,describe:`Fetches Cron Triggers for a Worker.`,builder:Xe,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts schedules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/schedules`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.scripts.schedules.get({account_id:u,script_name:d})),{successLabel:`Loaded`})}};function Qe(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const $e={command:`update`,describe:`Updates Cron Triggers for a Worker.`,builder:Qe,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts schedules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/schedules`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let a=await o(r),d=r.local?e:await t();r.accountId=d;let f=i({scriptName:r.worker});if(r.worker=f,r.body){let e=u(r.body);s(await l(`Updating`,async()=>a.workers.scripts.schedules.update({body:e,account_id:d,script_name:f})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},et={command:`schedules`,describe:`Operations for scripts.schedules`,builder:e=>e.command(Ze).command($e).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function tt(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`settings`,{type:`string`,description:`The settings`})}const nt={command:`edit`,describe:`Patch metadata or config, such as bindings or usage model.`,builder:tt,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts script-and-version-settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/settings`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`multipart`,body:{body:r.body,file:r.file,settings:r.settings}});return}let u=await o(r),d=r.local?e:await t();r.accountId=d;let f=i({scriptName:r.worker});if(r.worker=f,r.file!==void 0||r.body!==void 0||r.settings!==void 0){let e=new FormData;if(r.file){let t=m(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.settings!==void 0){let t=typeof r.settings==`string`?p(r.settings,`settings`,`text`):r.settings;e.append(`settings`,typeof t==`string`?t:JSON.stringify(t))}s(await l(`Updating`,async()=>a(u,`PATCH`,`/accounts/${d}/workers/scripts/${f}/settings`,{body:e})),{successLabel:`Updated`});return}if(r.body){let e=p(r.body,`body`,`binary`);s(await l(`Updating`,async()=>a(u,`PATCH`,`/accounts/${d}/workers/scripts/${f}/settings`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>u.workers.scripts.scriptAndVersionSettings.edit({account_id:d,script_name:f})),{successLabel:`Updated`})}};function rt(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const it={command:`get`,describe:`Get metadata and config, such as bindings or usage model.`,builder:rt,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts script-and-version-settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/settings`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.scripts.scriptAndVersionSettings.get({account_id:u,script_name:d})),{successLabel:`Loaded`})}},at={command:`script-and-version-settings`,describe:`Operations for scripts.script-and-version-settings`,builder:e=>e.command(nt).command(it).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ot(e){return e.option(`name`,{type:`string`,description:`Worker name to search for. Both exact and partial matches are returned.`}).option(`id`,{type:`string`,description:`Worker ID (also called tag) to search for. Only exact matches are returned.`}).option(`order-by`,{type:`string`,description:`Property to sort results by. Results are sorted in ascending order.`,choices:[`created_on`,`modified_on`,`name`]}).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const st={command:`search`,describe:`Search for Workers in an account.`,builder:v(ot),handler:async r=>{let i={name:r.name,id:r.id,order_by:r[`order-by`],page:r.page,per_page:r[`per-page`]};if(r.dryRun){c({command:`cf workers scripts search`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts-search`,pathParams:{},query:i,bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u,s(await l(`Loading`,async()=>a.workers.scripts.search({account_id:u,...i})),{successLabel:`Loaded`})}};function ct(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`logpush`,{type:`boolean`,description:`Whether Logpush is turned on for the Worker.`}).option(`observability-enabled`,{type:`boolean`,description:`Whether observability is enabled for the Worker.`}).option(`observability-head-sampling-rate`,{type:`number`,description:`The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.`}).option(`observability-logs-destinations`,{type:`string`,array:!0,description:`A list of destinations where logs will be exported to.`}).option(`observability-logs-enabled`,{type:`boolean`,description:`Whether logs are enabled for the Worker.`}).option(`observability-logs-head-sampling-rate`,{type:`number`,description:`The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.`}).option(`observability-logs-invocation-logs`,{type:`boolean`,description:`Whether [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) are enabled for the Worker.`}).option(`observability-logs-persist`,{type:`boolean`,description:`Whether log persistence is enabled for the Worker.`}).option(`observability-redact-query-string`,{type:`boolean`,description:`Whether query strings are removed from request URLs in logs and traces.`}).option(`observability-traces-destinations`,{type:`string`,array:!0,description:`A list of destinations where traces will be exported to.`}).option(`observability-traces-enabled`,{type:`boolean`,description:`Whether traces are enabled for the Worker.`}).option(`observability-traces-head-sampling-rate`,{type:`number`,description:`The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.`}).option(`observability-traces-persist`,{type:`boolean`,description:`Whether trace persistence is enabled for the Worker.`}).option(`observability-traces-propagation-policy`,{type:`string`,description:`Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. "authenticated" honors inbound trace context only when accompanied by a valid trace auth token. "accept" unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled. Returns null when the trace propagation feature is not enabled for the account.`,choices:[`authenticated`,`accept`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).check(e=>{if([`observability-enabled`,`observability-head-sampling-rate`,`observability-logs-destinations`,`observability-logs-enabled`,`observability-logs-head-sampling-rate`,`observability-logs-invocation-logs`,`observability-logs-persist`,`observability-redact-query-string`,`observability-traces-destinations`,`observability-traces-enabled`,`observability-traces-head-sampling-rate`,`observability-traces-persist`,`observability-traces-propagation-policy`].some(t=>e[t]!==void 0)){let t=[`observability-enabled`,`observability-logs-enabled`,`observability-logs-invocation-logs`].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 --observability-* flag is set`)}return!0})}const lt={command:`edit`,describe:`Patch script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). Including but not limited to Logpush and Tail Consumers.`,builder:ct,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/script-settings`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`json`,body:r.body===void 0?f({logpush:r.logpush,observability:{enabled:r[`observability-enabled`],head_sampling_rate:r[`observability-head-sampling-rate`],logs:{destinations:r[`observability-logs-destinations`],enabled:r[`observability-logs-enabled`],head_sampling_rate:r[`observability-logs-head-sampling-rate`],invocation_logs:r[`observability-logs-invocation-logs`],persist:r[`observability-logs-persist`]},redact_query_string:r[`observability-redact-query-string`],traces:{destinations:r[`observability-traces-destinations`],enabled:r[`observability-traces-enabled`],head_sampling_rate:r[`observability-traces-head-sampling-rate`],persist:r[`observability-traces-persist`],propagation_policy:p(r[`observability-traces-propagation-policy`],`observability-traces-propagation-policy`,`text`)}}}):u(r.body)});return}let a=await o(r),d=r.local?e:await t();r.accountId=d;let m=i({scriptName:r.worker});if(r.worker=m,r.body){let e=u(r.body);s(await l(`Updating`,async()=>a.workers.scripts.settings.edit({body:e,account_id:d,script_name:m})),{successLabel:`Updated`});return}let h=f({logpush:r.logpush,observability:{enabled:r[`observability-enabled`],head_sampling_rate:r[`observability-head-sampling-rate`],logs:{destinations:r[`observability-logs-destinations`],enabled:r[`observability-logs-enabled`],head_sampling_rate:r[`observability-logs-head-sampling-rate`],invocation_logs:r[`observability-logs-invocation-logs`],persist:r[`observability-logs-persist`]},redact_query_string:r[`observability-redact-query-string`],traces:{destinations:r[`observability-traces-destinations`],enabled:r[`observability-traces-enabled`],head_sampling_rate:r[`observability-traces-head-sampling-rate`],persist:r[`observability-traces-persist`],propagation_policy:p(r[`observability-traces-propagation-policy`],`observability-traces-propagation-policy`,`text`)}}});s(await l(`Updating`,async()=>a.workers.scripts.settings.edit({body:h,account_id:d,script_name:m})),{successLabel:`Updated`})}};function ut(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const dt={command:`get`,describe:`Get script-level settings when using [Worker Versions](https://developers.cloudflare.com/api/operations/worker-versions-list-versions). Includes Logpush and Tail Consumers.`,builder:ut,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/script-settings`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.scripts.settings.get({account_id:u,script_name:d})),{successLabel:`Loaded`})}},ft={command:`settings`,describe:`Operations for scripts.settings`,builder:e=>e.command(lt).command(dt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function pt(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`enabled`,{type:`boolean`,description:`Whether the Worker should be available on the workers.dev subdomain.`}).option(`previews-enabled`,{type:`boolean`,description:`Whether the Worker's Preview URLs should be available on the workers.dev subdomain.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const mt={command:`create`,describe:`Enable or disable the Worker on the workers.dev subdomain.`,builder:pt,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts subdomain create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/subdomain`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`json`,body:r.body===void 0?f({enabled:r.enabled,previews_enabled:r[`previews-enabled`]}):u(r.body)});return}let a=await o(r),d=r.local?e:await t();r.accountId=d;let p=i({scriptName:r.worker});if(r.worker=p,r.body){let e=u(r.body);s(await l(`Creating`,async()=>a.workers.scripts.subdomain.create({...e,account_id:d,script_name:p})),{successLabel:`Created`});return}if(r.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let m=f({enabled:r.enabled,previews_enabled:r[`previews-enabled`]});s(await l(`Creating`,async()=>a.workers.scripts.subdomain.create({...m,account_id:d,script_name:p})),{successLabel:`Created`})}};function ht(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).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 gt={command:`delete`,describe:`Disable all workers.dev subdomains for a Worker.`,builder:ht,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts subdomain delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/subdomain`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});if(r.worker=d,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
21
|
-
`);return}s(await l(`Deleting`,async()=>a.workers.scripts.subdomain.delete({account_id:u,script_name:d})),{successLabel:`Deleted`})}};function _t(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const vt={command:`get`,describe:`Get if the Worker is available on the workers.dev subdomain.`,builder:_t,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts subdomain get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/subdomain`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.scripts.subdomain.get({account_id:u,script_name:d})),{successLabel:`Loaded`})}},yt={command:`subdomain`,describe:`Operations for scripts.subdomain`,builder:e=>e.command(mt).command(gt).command(vt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function bt(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const xt={command:`create`,describe:`Starts a tail that receives logs and exception from a Worker.`,builder:bt,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts tail create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/tails`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Creating`,async()=>a.workers.scripts.tail.create({account_id:u,script_name:d})),{successLabel:`Created`})}};function St(e){return e.positional(`id`,{type:`string`,description:`Identifier.`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Ct={command:`delete <id>`,describe:`Deletes a tail from a Worker.`,builder:St,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts tail delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/tails/${r.id==null?`<id>`:encodeURIComponent(String(r.id))}`,pathParams:{"script-name":String(r[`script-name`]??``),id:String(r.id??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});if(r.worker=d,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
22
|
-
`);return}s(await l(`Deleting`,async()=>a.workers.scripts.tail.delete({account_id:u,script_name:d,id:r.id})),{successLabel:`Deleted`})}};function wt(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Tt={command:`get`,describe:`Get list of tails currently deployed on a Worker.`,builder:wt,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts tail get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/tails`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.scripts.tail.get({account_id:u,script_name:d})),{successLabel:`Loaded`})}},Et={command:`tail`,describe:`Operations for scripts.tail`,builder:e=>e.command(xt).command(Ct).command(Tt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Dt(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`bindings-inherit`,{type:`string`,description:'When set to "strict", the upload will fail if any `inherit` type bindings cannot be resolved against the previous version of the Worker. Without this, unresolvable inherit bindings are silently dropped.',choices:[`strict`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const Ot={command:`update`,describe:`Upload a worker module. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.`,builder:v(Dt),handler:async r=>{let u={bindings_inherit:r[`bindings-inherit`]};if(r.dryRun){c({command:`cf workers scripts update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}`,pathParams:{"script-name":String(r[`script-name`]??``)},query:u,bodyKind:`octet-stream`,body:r.body});return}let d=await o(r),f=r.local?e:await t();r.accountId=f;let h=i({scriptName:r.worker});if(r.worker=h,r.file){let e=m(r.file);s(await l(`Updating`,async()=>a(d,`PUT`,`/accounts/${f}/workers/scripts/${h}`,{body:e,headers:{"Content-Type":`application/javascript`}})),{successLabel:`Updated`});return}if(r.body){let e=p(r.body,`body`,`binary`),t=new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();s(await l(`Updating`,async()=>a(d,`PUT`,`/accounts/${f}/workers/scripts/${h}${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`application/javascript`}})),{successLabel:`Updated`});return}s(await l(`Updating`,async()=>d.workers.scripts.update({account_id:f,script_name:h,...u})),{successLabel:`Updated`})}};function kt(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const At={command:`get`,describe:`Fetches the Usage Model for a given Worker.`,builder:kt,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts usage-model get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/usage-model`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.scripts.usageModel.get({account_id:u,script_name:d})),{successLabel:`Loaded`})}};function jt(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`usage-model`,{type:`string`,description:`Usage model for the Worker invocations.`,choices:[`standard`,`bundled`,`unbound`]}).option(`user-limits-cpu-ms`,{type:`number`,description:`The amount of CPU time this Worker can use in milliseconds.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const Mt={command:`update`,describe:`Updates the Usage Model for a given Worker. Requires a Workers Paid subscription.`,builder:jt,handler:async r=>{if(r.dryRun){c({command:`cf workers scripts usage-model update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/usage-model`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`json`,body:r.body===void 0?f({usage_model:p(r[`usage-model`],`usage-model`,`text`),user_limits:{cpu_ms:r[`user-limits-cpu-ms`]}}):u(r.body)});return}let a=await o(r),d=r.local?e:await t();r.accountId=d;let m=i({scriptName:r.worker});if(r.worker=m,r.body){let e=u(r.body);s(await l(`Updating`,async()=>a.workers.scripts.usageModel.update({...e,account_id:d,script_name:m})),{successLabel:`Updated`});return}let h=f({usage_model:p(r[`usage-model`],`usage-model`,`text`),user_limits:{cpu_ms:r[`user-limits-cpu-ms`]}});s(await l(`Updating`,async()=>a.workers.scripts.usageModel.update({...h,account_id:d,script_name:m})),{successLabel:`Updated`})}},Nt={command:`usage-model`,describe:`Operations for scripts.usage-model`,builder:e=>e.command(At).command(Mt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Pt={command:`scripts`,describe:`Operations for scripts`,builder:e=>e.command(Ge).command(qe).command(Ye).command(st).command(Ot).command(Re).command(Ue).command(et).command(at).command(ft).command(yt).command(Et).command(Nt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Ft(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`JSON Merge Patch (RFC 7396) request body for bulk secret changes. `}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`})}const It={command:`bulk-edit`,describe:"Create, update, or delete multiple secrets on a script in a single operation using JSON Merge Patch (RFC 7396). Usage: - To create or update a secret, set its value to a secret object. - To delete a secret, set its value to `null`. - Secrets not included in the request are left unchanged.",builder:Ft,handler:async r=>{if(r.dryRun){c({command:`cf workers secrets bulk-edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/secrets-bulk`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`json`,body:r.body===void 0?void 0:u(r.body)});return}let d=await o(r),f=r.local?e:await t();r.accountId=f;let p=i({scriptName:r.worker});if(r.worker=p,r.file){let e=m(r.file);s(await l(`Updating`,async()=>a(d,`PATCH`,`/accounts/${f}/workers/scripts/${p}/secrets-bulk`,{body:e,headers:{"Content-Type":`application/merge-patch+json`}})),{successLabel:`Updated`});return}if(r.body){let e=u(r.body);s(await l(`Updating`,async()=>a(d,`PATCH`,`/accounts/${f}/workers/scripts/${p}/secrets-bulk`,{body:e})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function Lt(e){return e.positional(`secret-name`,{type:`string`,description:`A JavaScript variable name for the secret binding.`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`url-encoded`,{type:`boolean`,description:`Flag that indicates whether the secret name is URL encoded.`}).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 Rt={command:`delete <secret-name>`,describe:`Remove a secret from a script.`,builder:Lt,handler:async r=>{let a={url_encoded:r[`url-encoded`]};if(r.dryRun){c({command:`cf workers secrets delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/secrets/${r[`secret-name`]==null?`<secret-name>`:encodeURIComponent(String(r[`secret-name`]))}`,pathParams:{"script-name":String(r[`script-name`]??``),"secret-name":String(r[`secret-name`]??``)},query:a,bodyKind:`none`});return}let u=await o(r),d=r.local?e:await t();r.accountId=d;let f=i({scriptName:r.worker});if(r.worker=f,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
23
|
-
`);return}s(await l(`Deleting`,async()=>u.workers.secrets.delete({account_id:d,script_name:f,secret_name:r[`secret-name`],...a})),{successLabel:`Deleted`})}};function zt(e){return e.positional(`secret-name`,{type:`string`,description:`A JavaScript variable name for the secret binding.`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`url-encoded`,{type:`boolean`,description:`Flag that indicates whether the secret name is URL encoded.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Bt={command:`get <secret-name>`,describe:`Get a given secret binding (value omitted) on a script.`,builder:zt,handler:async r=>{let a={url_encoded:r[`url-encoded`]};if(r.dryRun){c({command:`cf workers secrets get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/secrets/${r[`secret-name`]==null?`<secret-name>`:encodeURIComponent(String(r[`secret-name`]))}`,pathParams:{"script-name":String(r[`script-name`]??``),"secret-name":String(r[`secret-name`]??``)},query:a,bodyKind:`none`});return}let u=await o(r),d=r.local?e:await t();r.accountId=d;let f=i({scriptName:r.worker});r.worker=f,s(await l(`Loading`,async()=>u.workers.secrets.get({account_id:d,script_name:f,secret_name:r[`secret-name`],...a})),{successLabel:`Loaded`})}};function Vt(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Ht={command:`list`,describe:`List secrets bound to a script.`,builder:Vt,handler:async r=>{if(r.dryRun){c({command:`cf workers secrets list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/secrets`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.secrets.list({account_id:u,script_name:d})),{successLabel:`Loaded`})}};function Ut(e){return e.positional(`name`,{type:`string`,description:`A JavaScript variable name for the binding.`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script, used in URLs and route configuration.`}).option(`text`,{type:`string`,description:`The secret value to use.`}).option(`type`,{type:`string`,description:`The kind of resource that the binding provides.`,choices:[`secret_text`,`secret_key`]}).option(`format`,{type:`string`,description:`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,choices:[`raw`,`pkcs8`,`spki`,`jwk`]}).option(`key-base64`,{type:`string`,description:'Base64-encoded key data. Required if `format` is "raw", "pkcs8", or "spki".'}).option(`usages`,{type:`string`,array:!0,description:`Allowed operations with the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`A secret value accessible through a binding.`}).conflicts(`text`,[`format`,`key-base64`,`usages`]).conflicts(`format`,[`text`]).implies(`format`,[`usages`]).conflicts(`key-base64`,[`text`]).conflicts(`usages`,[`text`]).implies(`usages`,[`format`])}const Wt={command:`update <name>`,describe:`Add a secret to a script.`,builder:Ut,handler:async r=>{if(r.dryRun){c({command:`cf workers secrets update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/secrets`,pathParams:{"script-name":String(r[`script-name`]??``)},bodyKind:`json`,body:r.body===void 0?f({text:p(r.text,`text`,`text`),type:p(r.type,`type`,`text`),format:p(r.format,`format`,`text`),key_base64:p(r[`key-base64`],`key-base64`,`text`),usages:r.usages,name:r.name}):u(r.body)});return}let a=await o(r),d=r.local?e:await t();r.accountId=d;let m=i({scriptName:r.worker});if(r.worker=m,r.body){let e=u(r.body);s(await l(`Updating`,async()=>a.workers.secrets.update({body:e,account_id:d,script_name:m})),{successLabel:`Updated`});return}if(r.type===void 0&&(r.type=await g(`type`,`The kind of resource that the binding provides.`,[`secret_text`,`secret_key`])),r.type===`secret_text`&&r.text===void 0&&(r.text=await h(`text`,`The secret value to use.`,{kind:`secret`,question:`Enter value for --text`})),r.type===`secret_key`&&r.format===void 0&&(r.format=await h(`format`,`Data format of the key. [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format).`,{question:`Enter value for --format`})),r.type===`secret_key`&&r.usages===void 0)throw Error(`--usages is required (or pass --body with this field set).`);let _=f({text:p(r.text,`text`,`text`),type:p(r.type,`type`,`text`),format:p(r.format,`format`,`text`),key_base64:p(r[`key-base64`],`key-base64`,`text`),usages:r.usages,name:r.name});s(await l(`Updating`,async()=>a.workers.secrets.update({body:_,account_id:d,script_name:m})),{successLabel:`Updated`})}},Gt={command:`secrets`,describe:`Operations for secrets`,builder:e=>e.command(It).command(Rt).command(Bt).command(Ht).command(Wt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Kt(e){return e.positional(`environment-name`,{type:`string`,description:`Optional environment if the Worker utilizes one.`,demandOption:!0}).option(`service-name`,{type:`string`,description:`Name of Worker to bind to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const qt={command:`get <environment-name>`,describe:`Get script content from a worker with an environment.`,builder:Kt,handler:async r=>{if(r.dryRun){c({command:`cf workers services environments content get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/services/${r[`service-name`]==null?`<service-name>`:encodeURIComponent(String(r[`service-name`]))}/environments/${r[`environment-name`]==null?`<environment-name>`:encodeURIComponent(String(r[`environment-name`]))}/content`,pathParams:{"service-name":String(r[`service-name`]??``),"environment-name":String(r[`environment-name`]??``)},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();r.accountId=a,s(await l(`Loading`,async()=>i.workers.services.environments.content.get({account_id:a,service_name:r[`service-name`],environment_name:r[`environment-name`]})),{successLabel:`Loaded`})}};function Jt(e){return e.positional(`environment-name`,{type:`string`,description:`Optional environment if the Worker utilizes one.`,demandOption:!0}).option(`service-name`,{type:`string`,description:`Name of Worker to bind to.`,demandOption:!0}).option(`cf-worker-body-part`,{type:`string`,description:`The multipart name of a script upload part containing script content in service worker format. Alternative to including in a metadata part.`}).option(`cf-worker-main-module-part`,{type:`string`,description:`The multipart name of a script upload part containing script content in es module format. Alternative to including in a metadata part.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.<br/>Possible Content-Type(s) are: `application/javascript+module`, `text/javascript+module`, `application/javascript`, `text/javascript`, `text/x-python`, `text/x-python-requirement`, `application/wasm`, `text/plain`, `application/octet-stream`, `application/source-map`."}).option(`metadata`,{type:`string`,description:`JSON-encoded metadata about the uploaded parts and Worker configuration.`})}const Yt={command:`update <environment-name>`,describe:`Put script content from a worker with an environment.`,builder:Jt,handler:async r=>{let i={};if(r[`cf-worker-body-part`]!==void 0&&(i[`CF-WORKER-BODY-PART`]=String(r[`cf-worker-body-part`])),r[`cf-worker-main-module-part`]!==void 0&&(i[`CF-WORKER-MAIN-MODULE-PART`]=String(r[`cf-worker-main-module-part`])),r.dryRun){c({command:`cf workers services environments content update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/services/${r[`service-name`]==null?`<service-name>`:encodeURIComponent(String(r[`service-name`]))}/environments/${r[`environment-name`]==null?`<environment-name>`:encodeURIComponent(String(r[`environment-name`]))}/content`,pathParams:{"service-name":String(r[`service-name`]??``),"environment-name":String(r[`environment-name`]??``)},bodyKind:`multipart`,body:{body:r.body,file:r.file,files:r.files,metadata:r.metadata}});return}let u=await o(r),d=r.local?e:await t();if(r.accountId=d,r.file!==void 0||r.body!==void 0||r.files!==void 0||r.metadata!==void 0){let e=new FormData;if(r.file){let t=m(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.files!==void 0){let t=typeof r.files==`string`?p(r.files,`files`,`text`):r.files;e.append(`files`,typeof t==`string`?t:JSON.stringify(t))}if(r.metadata!==void 0){let t=typeof r.metadata==`string`?p(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}s(await l(`Updating`,async()=>a(u,`PUT`,`/accounts/${d}/workers/services/${encodeURIComponent(String(r[`service-name`]))}/environments/${encodeURIComponent(String(r[`environment-name`]))}/content`,{body:e,headers:Object.keys(i).length>0?i:void 0})),{successLabel:`Updated`});return}if(r.body){let e=p(r.body,`body`,`binary`);s(await l(`Updating`,async()=>a(u,`PUT`,`/accounts/${d}/workers/services/${encodeURIComponent(String(r[`service-name`]))}/environments/${encodeURIComponent(String(r[`environment-name`]))}/content`,{body:e,headers:{"Content-Type":`multipart/form-data`,...i}})),{successLabel:`Updated`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},Xt={command:`content`,describe:`Operations for services.environments.content`,builder:e=>e.command(qt).command(Yt).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Zt(e){return e.positional(`environment-name`,{type:`string`,description:`Optional environment if the Worker utilizes one.`,demandOption:!0}).option(`service-name`,{type:`string`,description:`Name of Worker to bind to.`,demandOption:!0}).option(`success`,{type:`boolean`,description:`Whether the API call was successful.`}).option(`result-logpush`,{type:`boolean`,description:`Whether Logpush is turned on for the Worker.`}).option(`result-observability-enabled`,{type:`boolean`,description:`Whether observability is enabled for the Worker.`}).option(`result-observability-head-sampling-rate`,{type:`number`,description:`The sampling rate for incoming requests. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.`}).option(`result-observability-logs-destinations`,{type:`string`,array:!0,description:`A list of destinations where logs will be exported to.`}).option(`result-observability-logs-enabled`,{type:`boolean`,description:`Whether logs are enabled for the Worker.`}).option(`result-observability-logs-head-sampling-rate`,{type:`number`,description:`The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.`}).option(`result-observability-logs-invocation-logs`,{type:`boolean`,description:`Whether [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) are enabled for the Worker.`}).option(`result-observability-logs-persist`,{type:`boolean`,description:`Whether log persistence is enabled for the Worker.`}).option(`result-observability-redact-query-string`,{type:`boolean`,description:`Whether query strings are removed from request URLs in logs and traces.`}).option(`result-observability-traces-destinations`,{type:`string`,array:!0,description:`A list of destinations where traces will be exported to.`}).option(`result-observability-traces-enabled`,{type:`boolean`,description:`Whether traces are enabled for the Worker.`}).option(`result-observability-traces-head-sampling-rate`,{type:`number`,description:`The sampling rate for traces. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1.`}).option(`result-observability-traces-persist`,{type:`boolean`,description:`Whether trace persistence is enabled for the Worker.`}).option(`result-observability-traces-propagation-policy`,{type:`string`,description:`Controls how inbound trace context (traceparent/tracestate) headers on incoming requests are handled. "authenticated" honors inbound trace context only when accompanied by a valid trace auth token. "accept" unconditionally accepts inbound trace context. Requires the trace propagation feature to be enabled. Returns null when the trace propagation feature is not enabled for the account.`,choices:[`authenticated`,`accept`]}).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 Qt={command:`edit <environment-name>`,describe:`Patch script metadata, such as bindings.`,builder:Zt,handler:async r=>{if(r.dryRun){c({command:`cf workers services environments settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/services/${r[`service-name`]==null?`<service-name>`:encodeURIComponent(String(r[`service-name`]))}/environments/${r[`environment-name`]==null?`<environment-name>`:encodeURIComponent(String(r[`environment-name`]))}/settings`,pathParams:{"service-name":String(r[`service-name`]??``),"environment-name":String(r[`environment-name`]??``)},bodyKind:`json`,body:r.body===void 0?f({success:r.success,result:{logpush:r[`result-logpush`],observability:{enabled:r[`result-observability-enabled`],head_sampling_rate:r[`result-observability-head-sampling-rate`],logs:{destinations:r[`result-observability-logs-destinations`],enabled:r[`result-observability-logs-enabled`],head_sampling_rate:r[`result-observability-logs-head-sampling-rate`],invocation_logs:r[`result-observability-logs-invocation-logs`],persist:r[`result-observability-logs-persist`]},redact_query_string:r[`result-observability-redact-query-string`],traces:{destinations:r[`result-observability-traces-destinations`],enabled:r[`result-observability-traces-enabled`],head_sampling_rate:r[`result-observability-traces-head-sampling-rate`],persist:r[`result-observability-traces-persist`],propagation_policy:p(r[`result-observability-traces-propagation-policy`],`result-observability-traces-propagation-policy`,`text`)}}}}):u(r.body)});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,r.body){let e=u(r.body);s(await l(`Updating`,async()=>i.workers.services.environments.settings.edit({...e,account_id:a,service_name:r[`service-name`],environment_name:r[`environment-name`]})),{successLabel:`Updated`});return}if(r.success===void 0)throw Error(`--success is required (or pass --body with this field set).`);if(r[`result-observability-enabled`]===void 0)throw Error(`--result-observability-enabled is required (or pass --body with this field set).`);if(r[`result-observability-logs-enabled`]===void 0)throw Error(`--result-observability-logs-enabled is required (or pass --body with this field set).`);if(r[`result-observability-logs-invocation-logs`]===void 0)throw Error(`--result-observability-logs-invocation-logs is required (or pass --body with this field set).`);let d=f({success:r.success,result:{logpush:r[`result-logpush`],observability:{enabled:r[`result-observability-enabled`],head_sampling_rate:r[`result-observability-head-sampling-rate`],logs:{destinations:r[`result-observability-logs-destinations`],enabled:r[`result-observability-logs-enabled`],head_sampling_rate:r[`result-observability-logs-head-sampling-rate`],invocation_logs:r[`result-observability-logs-invocation-logs`],persist:r[`result-observability-logs-persist`]},redact_query_string:r[`result-observability-redact-query-string`],traces:{destinations:r[`result-observability-traces-destinations`],enabled:r[`result-observability-traces-enabled`],head_sampling_rate:r[`result-observability-traces-head-sampling-rate`],persist:r[`result-observability-traces-persist`],propagation_policy:p(r[`result-observability-traces-propagation-policy`],`result-observability-traces-propagation-policy`,`text`)}}}});s(await l(`Updating`,async()=>i.workers.services.environments.settings.edit({...d,account_id:a,service_name:r[`service-name`],environment_name:r[`environment-name`]})),{successLabel:`Updated`})}};function $t(e){return e.positional(`environment-name`,{type:`string`,description:`Optional environment if the Worker utilizes one.`,demandOption:!0}).option(`service-name`,{type:`string`,description:`Name of Worker to bind to.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const en={command:`get <environment-name>`,describe:`Get script settings from a worker with an environment.`,builder:$t,handler:async r=>{if(r.dryRun){c({command:`cf workers services environments settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/services/${r[`service-name`]==null?`<service-name>`:encodeURIComponent(String(r[`service-name`]))}/environments/${r[`environment-name`]==null?`<environment-name>`:encodeURIComponent(String(r[`environment-name`]))}/settings`,pathParams:{"service-name":String(r[`service-name`]??``),"environment-name":String(r[`environment-name`]??``)},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();r.accountId=a,s(await l(`Loading`,async()=>i.workers.services.environments.settings.get({account_id:a,service_name:r[`service-name`],environment_name:r[`environment-name`]})),{successLabel:`Loaded`})}},$={command:`settings`,describe:`Operations for services.environments.settings`,builder:e=>e.command(Qt).command(en).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},tn={command:`environments`,describe:`Operations for services.environments`,builder:e=>e.command(Xt).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},nn={command:`services`,describe:`Operations for services`,builder:e=>e.command(tn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function rn(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 an={command:`delete`,describe:`Deletes a Workers subdomain for an account.`,builder:rn,handler:async r=>{if(r.dryRun){c({command:`cf workers subdomains delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/subdomain`,pathParams:{},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,!await _({force:!!r.force})){process.stderr.write(`Aborted.
|
|
24
|
-
`);return}s(await l(`Deleting`,async()=>i.workers.subdomains.delete({account_id:a})),{successLabel:`Deleted`})}};function on(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const sn={command:`get`,describe:`Returns a Workers subdomain for an account.`,builder:on,handler:async r=>{if(r.dryRun){c({command:`cf workers subdomains get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/subdomain`,pathParams:{},bodyKind:`none`});return}let i=await o(r),a=r.local?e:await t();r.accountId=a,s(await l(`Loading`,async()=>i.workers.subdomains.get({account_id:a})),{successLabel:`Loaded`})}};function cn(e){return e.option(`subdomain`,{type:`string`,description:`The subdomain 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 ln={command:`update`,describe:`Creates a Workers subdomain for an account.`,builder:cn,handler:async r=>{if(r.dryRun){c({command:`cf workers subdomains update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/subdomain`,pathParams:{},bodyKind:`json`,body:r.body===void 0?f({subdomain:p(r.subdomain,`subdomain`,`text`)}):u(r.body)});return}let i=await o(r),a=r.local?e:await t();if(r.accountId=a,r.body){let e=u(r.body);s(await l(`Updating`,async()=>i.workers.subdomains.update({body:e,account_id:a})),{successLabel:`Updated`});return}r.subdomain===void 0&&(r.subdomain=await h(`subdomain`,`The subdomain field`));let d=f({subdomain:p(r.subdomain,`subdomain`,`text`)});s(await l(`Updating`,async()=>i.workers.subdomains.update({body:d,account_id:a})),{successLabel:`Updated`})}},un={command:`subdomains`,describe:`Operations for subdomains`,builder:e=>e.command(an).command(sn).command(ln).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function dn(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`bindings-inherit`,{type:`string`,description:'When set to "strict", the upload will fail if any `inherit` type bindings cannot be resolved against the previous version of the Worker. Without this, unresolvable inherit bindings are silently dropped.',choices:[`strict`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).option(`file`,{type:`string`,description:`Path to a file to upload as the request body`}).option(`files`,{type:`string`,description:"An array of modules (often JavaScript files) comprising a Worker script. At least one module must be present and referenced in the metadata as `main_module` or `body_part` by filename.<br/>Possible Content-Type(s) are: `application/javascript+module`, `text/javascript+module`, `application/javascript`, `text/javascript`, `text/x-python`, `text/x-python-requirement`, `application/wasm`, `text/plain`, `application/octet-stream`, `application/source-map`."}).option(`metadata`,{type:`string`,description:`JSON-encoded metadata about the uploaded parts and Worker configuration.`})}const fn={command:`create`,describe:`Upload a Worker Version without deploying to Cloudflare's network. You can find more about the multipart metadata on our docs: https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/.`,builder:dn,handler:async r=>{let u={bindings_inherit:r[`bindings-inherit`]};if(r.dryRun){c({command:`cf workers versions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/versions`,pathParams:{"script-name":String(r[`script-name`]??``)},query:u,bodyKind:`multipart`,body:{body:r.body,file:r.file,files:r.files,metadata:r.metadata}});return}let d=await o(r),f=r.local?e:await t();r.accountId=f;let h=i({scriptName:r.worker});if(r.worker=h,r.file!==void 0||r.body!==void 0||r.files!==void 0||r.metadata!==void 0){let e=new FormData;if(r.file){let t=m(r.file);e.append(`file`,new Blob([t]),r.file.split(/[\\/]/).filter(Boolean).pop())}else r.body!==void 0&&e.append(`file`,r.body);if(r.files!==void 0){let t=typeof r.files==`string`?p(r.files,`files`,`text`):r.files;e.append(`files`,typeof t==`string`?t:JSON.stringify(t))}if(r.metadata!==void 0){let t=typeof r.metadata==`string`?p(r.metadata,`metadata`,`text`):r.metadata;e.append(`metadata`,typeof t==`string`?t:JSON.stringify(t))}s(await l(`Creating`,async()=>a(d,`POST`,`/accounts/${f}/workers/scripts/${h}/versions`,{body:e})),{successLabel:`Created`});return}if(r.body){let e=p(r.body,`body`,`binary`),t=new URLSearchParams(Object.entries(u).filter(([,e])=>e!==void 0).map(([e,t])=>[e,String(t)])).toString();s(await l(`Creating`,async()=>a(d,`POST`,`/accounts/${f}/workers/scripts/${h}/versions${t?`?`+t:``}`,{body:e,headers:{"Content-Type":`multipart/form-data`}})),{successLabel:`Created`});return}if(r.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}};function pn(e){return e.positional(`version-id`,{type:`string`,description:`Version ID`,demandOption:!0}).option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const mn={command:`get <version-id>`,describe:`Retrieves detailed information about a specific version of a Workers script.`,builder:pn,handler:async r=>{if(r.dryRun){c({command:`cf workers versions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/versions/${r[`version-id`]==null?`<version-id>`:encodeURIComponent(String(r[`version-id`]))}`,pathParams:{"script-name":String(r[`script-name`]??``),"version-id":String(r[`version-id`]??``)},bodyKind:`none`});return}let a=await o(r),u=r.local?e:await t();r.accountId=u;let d=i({scriptName:r.worker});r.worker=d,s(await l(`Loading`,async()=>a.workers.versions.get({account_id:u,script_name:d,version_id:r[`version-id`]})),{successLabel:`Loaded`})}};function hn(e){return e.option(`worker`,{type:`string`,alias:`script-name`,description:`Name of the script.`}).option(`deployable`,{type:`boolean`,description:`Only return versions that can be used in a deployment. Ignores pagination.`}).option(`page`,{type:`number`,description:`Current page.`}).option(`per-page`,{type:`number`,description:`Items per-page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const gn={command:`list`,describe:`List of Worker Versions. The first version in the list is the latest version.`,builder:hn,handler:async r=>{let a={deployable:r.deployable,page:r.page,per_page:r[`per-page`]};if(r.dryRun){c({command:`cf workers versions list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/scripts/${r.worker??`<worker>`}/versions`,pathParams:{"script-name":String(r[`script-name`]??``)},query:a,bodyKind:`none`});return}let u=await o(r),d=r.local?e:await t();r.accountId=d;let f=i({scriptName:r.worker});r.worker=f,s(await l(`Loading`,async()=>u.workers.versions.list({account_id:d,script_name:f,...a})),{successLabel:`Loaded`})}},_n={command:`versions`,describe:`Operations for versions`,builder:e=>e.command(fn).command(mn).command(gn).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},vn={command:`workers`,describe:`workers`,builder:e=>e.command(C).command(D).command(Q).command(ue).command(ye).command(Ce).command(Pe).command(Pt).command(Gt).command(nn).command(un).command(_n).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{vn as default};
|
package/dist/zaraz-27zwjLvv.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-B0ETkNcX.mjs";import{a as t,r as n}from"./auth-MQEamPN9.mjs";import{t as r}from"./output-DrpYYfnB.mjs";import{n as i,t as a}from"./progress-CsHIt3Tp.mjs";import{n as o,t as s}from"./body-parser-C-c9gfH1.mjs";import{n as c}from"./input-validation-Bav2M9F-.mjs";import{a as l}from"./prompt-DdegNPpg.mjs";import{t as u}from"./cli-types-BsTty22w.mjs";function d(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const f={command:`get`,describe:`Gets latest Zaraz configuration for a zone. It can be preview or published configuration, whichever was the last updated. Secret variables values will not be included.`,builder:d,handler:async t=>{if(t.dryRun){i({command:`cf zaraz config get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/settings/zaraz/config`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.zaraz.config.get({zone_id:s})),{successLabel:`Loaded`})}};function p(e){return e.option(`analytics-default-purpose`,{type:`string`,description:`Consent purpose assigned to Monitoring.`}).option(`analytics-enabled`,{type:`boolean`,description:`Whether Advanced Monitoring reports are enabled.`}).option(`analytics-session-exp-time`,{type:`number`,description:`Session expiration time (seconds).`}).option(`consent-company-email`,{type:`string`,description:`The consent.companyEmail field`}).option(`consent-company-name`,{type:`string`,description:`The consent.companyName field`}).option(`consent-company-street-address`,{type:`string`,description:`The consent.companyStreetAddress field`}).option(`consent-consent-modal-intro-html`,{type:`string`,description:`The consent.consentModalIntroHTML field`}).option(`consent-cookie-name`,{type:`string`,description:`The consent.cookieName field`}).option(`consent-custom-css`,{type:`string`,description:`The consent.customCSS field`}).option(`consent-custom-intro-disclaimer-dismissed`,{type:`boolean`,description:`The consent.customIntroDisclaimerDismissed field`}).option(`consent-default-language`,{type:`string`,description:`The consent.defaultLanguage field`}).option(`consent-enabled`,{type:`boolean`,description:`The consent.enabled field`}).option(`consent-hide-modal`,{type:`boolean`,description:`The consent.hideModal field`}).option(`consent-tcf-compliant`,{type:`boolean`,description:`The consent.tcfCompliant field`}).option(`data-layer`,{type:`boolean`,description:`Data layer compatibility mode enabled.`}).option(`debug-key`,{type:`string`,description:`The key for Zaraz debug mode.`}).option(`history-change`,{type:`boolean`,description:`Single Page Application support enabled.`}).option(`settings-auto-inject-script`,{type:`boolean`,description:`Automatic injection of Zaraz scripts enabled.`}).option(`settings-context-enricher-escaped-worker-name`,{type:`string`,description:`The settings.contextEnricher.escapedWorkerName field`}).option(`settings-context-enricher-worker-tag`,{type:`string`,description:`The settings.contextEnricher.workerTag field`}).option(`settings-cookie-domain`,{type:`string`,description:`The domain Zaraz will use for writing and reading its cookies.`}).option(`settings-ecommerce`,{type:`boolean`,description:`Ecommerce API enabled.`}).option(`settings-events-api-path`,{type:`string`,description:`Custom endpoint for server-side track events.`}).option(`settings-hide-external-referer`,{type:`boolean`,description:`Hiding external referrer URL enabled.`}).option(`settings-hide-ipaddress`,{type:`boolean`,description:`Trimming IP address enabled.`}).option(`settings-hide-query-params`,{type:`boolean`,description:`Removing URL query params enabled.`}).option(`settings-hide-user-agent`,{type:`boolean`,description:`Removing sensitive data from User Agent string enabled.`}).option(`settings-init-path`,{type:`string`,description:`Custom endpoint for Zaraz init script.`}).option(`settings-inject-iframes`,{type:`boolean`,description:`Injection of Zaraz scripts into iframes enabled.`}).option(`settings-mc-root-path`,{type:`string`,description:`Custom path for Managed Components server functionalities.`}).option(`settings-script-path`,{type:`string`,description:`Custom endpoint for Zaraz main script.`}).option(`settings-track-path`,{type:`string`,description:`Custom endpoint for Zaraz tracking requests.`}).option(`zaraz-version`,{type:`number`,description:`Zaraz internal version of the config.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Zaraz configuration.`}).check(e=>{if([`consent-company-email`,`consent-company-name`,`consent-company-street-address`,`consent-consent-modal-intro-html`,`consent-cookie-name`,`consent-custom-css`,`consent-custom-intro-disclaimer-dismissed`,`consent-default-language`,`consent-enabled`,`consent-hide-modal`,`consent-tcf-compliant`].some(t=>e[t]!==void 0)){let t=[`consent-enabled`].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 --consent-* flag is set`)}return!0})}const m={command:`update`,describe:`Updates Zaraz configuration for a zone.`,builder:p,handler:async t=>{if(t.dryRun){i({command:`cf zaraz config update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/settings/zaraz/config`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?s({analytics:{defaultPurpose:c(t[`analytics-default-purpose`],`analytics-default-purpose`,`text`),enabled:t[`analytics-enabled`],sessionExpTime:t[`analytics-session-exp-time`]},consent:{companyEmail:c(t[`consent-company-email`],`consent-company-email`,`text`),companyName:c(t[`consent-company-name`],`consent-company-name`,`text`),companyStreetAddress:c(t[`consent-company-street-address`],`consent-company-street-address`,`text`),consentModalIntroHTML:c(t[`consent-consent-modal-intro-html`],`consent-consent-modal-intro-html`,`text`),cookieName:c(t[`consent-cookie-name`],`consent-cookie-name`,`text`),customCSS:c(t[`consent-custom-css`],`consent-custom-css`,`text`),customIntroDisclaimerDismissed:t[`consent-custom-intro-disclaimer-dismissed`],defaultLanguage:c(t[`consent-default-language`],`consent-default-language`,`text`),enabled:t[`consent-enabled`],hideModal:t[`consent-hide-modal`],tcfCompliant:t[`consent-tcf-compliant`]},dataLayer:t[`data-layer`],debugKey:c(t[`debug-key`],`debug-key`,`text`),historyChange:t[`history-change`],settings:{autoInjectScript:t[`settings-auto-inject-script`],contextEnricher:{escapedWorkerName:c(t[`settings-context-enricher-escaped-worker-name`],`settings-context-enricher-escaped-worker-name`,`text`),workerTag:c(t[`settings-context-enricher-worker-tag`],`settings-context-enricher-worker-tag`,`text`)},cookieDomain:c(t[`settings-cookie-domain`],`settings-cookie-domain`,`text`),ecommerce:t[`settings-ecommerce`],eventsApiPath:c(t[`settings-events-api-path`],`settings-events-api-path`,`text`),hideExternalReferer:t[`settings-hide-external-referer`],hideIPAddress:t[`settings-hide-ipaddress`],hideQueryParams:t[`settings-hide-query-params`],hideUserAgent:t[`settings-hide-user-agent`],initPath:c(t[`settings-init-path`],`settings-init-path`,`text`),injectIframes:t[`settings-inject-iframes`],mcRootPath:c(t[`settings-mc-root-path`],`settings-mc-root-path`,`text`),scriptPath:c(t[`settings-script-path`],`settings-script-path`,`text`),trackPath:c(t[`settings-track-path`],`settings-track-path`,`text`)},zarazVersion:t[`zaraz-version`]}):o(t.body)});return}let u=await n(t),d=await e({zone:t.zone},u,{quiet:t.quiet});if(t.zoneId=d,t.body){let e=o(t.body);r(await a(`Updating`,async()=>u.zaraz.config.update({...e,zone_id:d})),{successLabel:`Updated`});return}if(t[`data-layer`]===void 0)throw Error(`--data-layer is required (or pass --body with this field set).`);if(t[`debug-key`]===void 0&&(t[`debug-key`]=await l(`debug-key`,`The key for Zaraz debug mode.`)),t[`settings-auto-inject-script`]===void 0)throw Error(`--settings-auto-inject-script is required (or pass --body with this field set).`);if(t[`settings-context-enricher-escaped-worker-name`]===void 0&&(t[`settings-context-enricher-escaped-worker-name`]=await l(`settings-context-enricher-escaped-worker-name`,`The settings.contextEnricher.escapedWorkerName field`)),t[`settings-context-enricher-worker-tag`]===void 0&&(t[`settings-context-enricher-worker-tag`]=await l(`settings-context-enricher-worker-tag`,`The settings.contextEnricher.workerTag field`)),t[`zaraz-version`]===void 0)throw Error(`--zaraz-version is required (or pass --body with this field set).`);let f=s({analytics:{defaultPurpose:c(t[`analytics-default-purpose`],`analytics-default-purpose`,`text`),enabled:t[`analytics-enabled`],sessionExpTime:t[`analytics-session-exp-time`]},consent:{companyEmail:c(t[`consent-company-email`],`consent-company-email`,`text`),companyName:c(t[`consent-company-name`],`consent-company-name`,`text`),companyStreetAddress:c(t[`consent-company-street-address`],`consent-company-street-address`,`text`),consentModalIntroHTML:c(t[`consent-consent-modal-intro-html`],`consent-consent-modal-intro-html`,`text`),cookieName:c(t[`consent-cookie-name`],`consent-cookie-name`,`text`),customCSS:c(t[`consent-custom-css`],`consent-custom-css`,`text`),customIntroDisclaimerDismissed:t[`consent-custom-intro-disclaimer-dismissed`],defaultLanguage:c(t[`consent-default-language`],`consent-default-language`,`text`),enabled:t[`consent-enabled`],hideModal:t[`consent-hide-modal`],tcfCompliant:t[`consent-tcf-compliant`]},dataLayer:t[`data-layer`],debugKey:c(t[`debug-key`],`debug-key`,`text`),historyChange:t[`history-change`],settings:{autoInjectScript:t[`settings-auto-inject-script`],contextEnricher:{escapedWorkerName:c(t[`settings-context-enricher-escaped-worker-name`],`settings-context-enricher-escaped-worker-name`,`text`),workerTag:c(t[`settings-context-enricher-worker-tag`],`settings-context-enricher-worker-tag`,`text`)},cookieDomain:c(t[`settings-cookie-domain`],`settings-cookie-domain`,`text`),ecommerce:t[`settings-ecommerce`],eventsApiPath:c(t[`settings-events-api-path`],`settings-events-api-path`,`text`),hideExternalReferer:t[`settings-hide-external-referer`],hideIPAddress:t[`settings-hide-ipaddress`],hideQueryParams:t[`settings-hide-query-params`],hideUserAgent:t[`settings-hide-user-agent`],initPath:c(t[`settings-init-path`],`settings-init-path`,`text`),injectIframes:t[`settings-inject-iframes`],mcRootPath:c(t[`settings-mc-root-path`],`settings-mc-root-path`,`text`),scriptPath:c(t[`settings-script-path`],`settings-script-path`,`text`),trackPath:c(t[`settings-track-path`],`settings-track-path`,`text`)},zarazVersion:t[`zaraz-version`]});r(await a(`Updating`,async()=>u.zaraz.config.update({...f,zone_id:d})),{successLabel:`Updated`})}},h={command:`config`,describe:`Full Zaraz configuration including tools, triggers, and variables for the zone`,builder:e=>e.command(f).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const _={command:`get`,describe:`Gets default Zaraz configuration for a zone.`,builder:g,handler:async t=>{if(t.dryRun){i({command:`cf zaraz default get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/settings/zaraz/default`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.zaraz.default.get({zone_id:s})),{successLabel:`Loaded`})}},v={command:`default`,describe:`Default Zaraz configuration template used as a starting point for new zones`,builder:e=>e.command(_).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function y(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const b={command:`get`,describe:`Exports full current published Zaraz configuration for a zone, secret variables included.`,builder:y,handler:async t=>{if(t.dryRun){i({command:`cf zaraz export get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/settings/zaraz/export`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.zaraz.export.get({zone_id:s})),{successLabel:`Loaded`})}},x={command:`export`,describe:`Export the current Zaraz configuration as a portable JSON document`,builder:e=>e.command(b).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function S(e){return e.option(`ids`,{type:`string`,description:`Comma separated list of Zaraz configuration IDs.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const C={command:`get`,describe:`Gets a history of published Zaraz configurations by ID(s) for a zone.`,builder:u(S),handler:async t=>{let o={ids:t.ids};if(t.dryRun){i({command:`cf zaraz history configs get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/settings/zaraz/history/configs`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.zaraz.history.configs.get({zone_id:c,...o})),{successLabel:`Loaded`})}},w={command:`configs`,describe:`Operations for history.configs`,builder:e=>e.command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`offset`,{type:`number`,description:`Ordinal number to start listing the results with. Default value is 0.`}).option(`limit`,{type:`number`,description:`Maximum amount of results to list. Default value is 10.`}).option(`sort-field`,{type:`string`,description:`The field to sort by. Default is updated_at.`,choices:[`id`,`user_id`,`description`,`created_at`,`updated_at`]}).option(`sort-order`,{type:`string`,description:`Sorting order. Default is DESC.`,choices:[`DESC`,`ASC`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const E={command:`list`,describe:`Lists a history of published Zaraz configuration records for a zone.`,builder:u(T),handler:async t=>{let o={offset:t.offset,limit:t.limit,sortField:t[`sort-field`],sortOrder:t[`sort-order`]};if(t.dryRun){i({command:`cf zaraz history list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/settings/zaraz/history`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});t.zoneId=c,r(await a(`Loading`,async()=>s.zaraz.history.list({zone_id:c,...o})),{successLabel:`Loaded`})}};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:`ID of the Zaraz configuration to restore.`})}const O={command:`update`,describe:`Restores a historical published Zaraz configuration by ID for a zone.`,builder:D,handler:async s=>{if(s.dryRun){i({command:`cf zaraz history update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/settings/zaraz/history`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Updating`,async()=>c.zaraz.history.update({body:e,zone_id:l})),{successLabel:`Updated`});return}r(await a(`Updating`,async()=>t(c,`PUT`,`/zones/${s.zoneId}/settings/zaraz/history`)),{successLabel:`Updated`})}},k={command:`history`,describe:`Configuration version history — browse and restore previous Zaraz configurations`,builder:e=>e.command(E).command(O).command(w).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function A(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Zaraz configuration description.`})}const j={command:`create`,describe:`Publish current Zaraz preview configuration for a zone.`,builder:A,handler:async s=>{if(s.dryRun){i({command:`cf zaraz publish create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/settings/zaraz/publish`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?void 0:o(s.body)});return}let c=await n(s),l=await e({zone:s.zone},c,{quiet:s.quiet});if(s.zoneId=l,s.body){let e=o(s.body);r(await a(`Creating`,async()=>c.zaraz.publish.create({body:e,zone_id:l})),{successLabel:`Created`});return}r(await a(`Creating`,async()=>t(c,`POST`,`/zones/${s.zoneId}/settings/zaraz/publish`)),{successLabel:`Created`})}},M={command:`publish`,describe:`Publish pending Zaraz configuration changes to make them live on the zone`,builder:e=>e.command(j).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function N(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Gets Zaraz workflow for a zone.`,builder:N,handler:async t=>{if(t.dryRun){i({command:`cf zaraz workflow get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/settings/zaraz/workflow`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`none`});return}let o=await n(t),s=await e({zone:t.zone},o,{quiet:t.quiet});t.zoneId=s,r(await a(`Loading`,async()=>o.zaraz.workflow.get({zone_id:s})),{successLabel:`Loaded`})}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Zaraz workflow.`})}const I={command:`update`,describe:`Updates Zaraz workflow for a zone.`,builder:F,handler:async t=>{if(t.dryRun){i({command:`cf zaraz workflow update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${t.zone??t.zoneId??`<zone>`}/settings/zaraz/workflow`,pathParams:{"zone-id":String(t.zone??t[`zone-id`]??``)},bodyKind:`json`,body:t.body===void 0?void 0:o(t.body)});return}let s=await n(t),c=await e({zone:t.zone},s,{quiet:t.quiet});if(t.zoneId=c,t.body){let e=o(t.body);r(await a(`Updating`,async()=>s.zaraz.workflow.update({body:e,zone_id:c})),{successLabel:`Updated`});return}if(t.body===void 0)throw Error(`--body is required for this command. Pass --body '<json>' or --body @path/to/file.json.`)}},L={command:`workflow`,describe:`Workflow state for Zaraz configuration changes (draft vs. published)`,builder:e=>e.command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},R={command:`zaraz`,describe:`Server-side tag manager — load third-party tools (analytics, pixels, etc.) from Cloudflare's edge without client-side JS`,builder:e=>e.command(h).command(v).command(x).command(k).command(M).command(L).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{R as default};
|
package/dist/zone-BJix2KQ9.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-B0ETkNcX.mjs";import{r as t}from"./auth-MQEamPN9.mjs";import{t as n}from"./output-DrpYYfnB.mjs";import{n as r,t as i}from"./progress-CsHIt3Tp.mjs";function a(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const o={command:`activate`,describe:`Triggeres a new activation check for a PENDING Zone. This can be triggered every 5 min for paygo/ent customers, every hour for FREE Zones.`,builder:a,handler:async a=>{if(a.dryRun){r({command:`cf zone activate`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/activation_check`,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(`Updating`,async()=>o.zone.activate({zone_id:s})),{successLabel:`Updated`})}},s={command:`zone`,describe:`zone`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{s as default};
|
package/dist/zones-Bkj5i92c.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{h as e}from"./oauth-B0ETkNcX.mjs";import{r as t}from"./auth-MQEamPN9.mjs";import{t as n}from"./output-DrpYYfnB.mjs";import{n as r,t as i}from"./progress-CsHIt3Tp.mjs";import{n as a,t as o}from"./body-parser-C-c9gfH1.mjs";import{n as s}from"./input-validation-Bav2M9F-.mjs";import{a as c,i as l,n as u}from"./prompt-DdegNPpg.mjs";import{t as d}from"./cli-types-BsTty22w.mjs";function f(e){return e.option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).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 ee={command:`edit`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:f,handler:async c=>{if(c.dryRun){r({command:`cf zones aegis edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/settings/aegis`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({value:{enabled:c[`value-enabled`],pool_id:s(c[`value-pool-id`],`value-pool-id`,`text`)}}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Updating`,async()=>l.zones.aegis.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=o({value:{enabled:c[`value-enabled`],pool_id:s(c[`value-pool-id`],`value-pool-id`,`text`)}});n(await i(`Updating`,async()=>l.zones.aegis.edit({...d,zone_id:u})),{successLabel:`Updated`})}};function p(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const m={command:`get`,describe:`Aegis provides dedicated egress IPs (from Cloudflare to your origin) for your layer 7 WAF and CDN services. The egress IPs are reserved exclusively for your account so that you can increase your origin security by only allowing traffic from a small list of IP addresses.`,builder:p,handler:async a=>{if(a.dryRun){r({command:`cf zones aegis get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/aegis`,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.zones.aegis.get({zone_id:s})),{successLabel:`Loaded`})}},h={command:`aegis`,describe:`Operations for aegis`,builder:e=>e.command(ee).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function g(e){return e.option(`account-id`,{type:`string`,description:`Identifier`}).option(`name`,{type:`string`,description:`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial zone is
|
|
3
|
-
typically a partner-hosted zone or a CNAME setup.
|
|
4
|
-
`,choices:[`full`,`partial`,`secondary`,`internal`],default:`full`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _={command:`create`,describe:`Creates a new zone (domain) in your Cloudflare account. The zone is created in a pending state and must be activated by updating your domain's nameservers to point to Cloudflare, or by completing the verification process for partial (CNAME) setups.`,builder:g,handler:async e=>{if(e.dryRun){r({command:`cf zones create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},bodyKind:`json`,body:e.body===void 0?o({account:{id:s(e[`account-id`],`account-id`,`text`)},name:s(e.name,`name`,`text`),type:s(e.type,`type`,`text`)}):a(e.body)});return}let l=await t(e);if(e.body){let t=a(e.body);n(await i(`Creating`,async()=>l.zones.create({...t})),{successLabel:`Created`});return}e.name===void 0&&(e.name=await c(`name`,`The domain name. Per [RFC 1035](https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.4) the overall zone name can be up to 253 characters, with each segment ("label") not exceeding 63 characters.`));let u=o({account:{id:s(e[`account-id`],`account-id`,`text`)},name:s(e.name,`name`,`text`),type:s(e.type,`type`,`text`)});n(await i(`Creating`,async()=>l.zones.create({...u})),{successLabel:`Created`})}};function v(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 y={command:`delete`,describe:`Deletes an existing zone.`,builder:v,handler:async a=>{if(a.dryRun){r({command:`cf zones delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}`,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 u({force:!!a.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}n(await i(`Deleting`,async()=>o.zones.delete({zone_id:s})),{successLabel:`Deleted`})}};function b(e){return e.option(`paused`,{type:`boolean`,description:`Indicates whether the zone is only using Cloudflare DNS services. A
|
|
6
|
-
true value means the zone will not receive security or performance
|
|
7
|
-
benefits.
|
|
8
|
-
`}).option(`plan-id`,{type:`string`,description:`Identifier`}).option(`type`,{type:`string`,description:`A full zone implies that DNS is hosted with Cloudflare. A partial
|
|
9
|
-
zone is typically a partner-hosted zone or a CNAME setup. This
|
|
10
|
-
parameter is only available to Enterprise customers or if it has
|
|
11
|
-
been explicitly enabled on a zone.
|
|
12
|
-
`,choices:[`full`,`partial`,`secondary`,`internal`]}).option(`vanity-name-servers`,{type:`string`,array:!0,description:`An array of domains used for custom name servers. This is only
|
|
13
|
-
available for Business and Enterprise plans.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const x={command:`edit`,describe:`Edits a zone. Only one zone property can be changed at a time.`,builder:b,handler:async c=>{if(c.dryRun){r({command:`cf zones edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({paused:c.paused,plan:{id:s(c[`plan-id`],`plan-id`,`text`)},type:s(c.type,`type`,`text`),vanity_name_servers:c[`vanity-name-servers`]}):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.zones.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=o({paused:c.paused,plan:{id:s(c[`plan-id`],`plan-id`,`text`)},type:s(c.type,`type`,`text`),vanity_name_servers:c[`vanity-name-servers`]});n(await i(`Updating`,async()=>l.zones.edit({...d,zone_id:u})),{successLabel:`Updated`})}};function S(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`]}).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:`edit`,describe:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:S,handler:async c=>{if(c.dryRun){r({command:`cf zones fonts edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/settings/fonts`,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 u=await t(c),d=await e({zone:c.zone},u,{quiet:c.quiet});if(c.zoneId=d,c.body){let e=a(c.body);n(await i(`Updating`,async()=>u.zones.fonts.edit({...e,zone_id:d})),{successLabel:`Updated`});return}c.value===void 0&&(c.value=await l(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let f=o({value:s(c.value,`value`,`text`)});n(await i(`Updating`,async()=>u.zones.fonts.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function w(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const T={command:`get`,describe:`Enhance your website's font delivery with Cloudflare Fonts. Deliver Google Hosted fonts from your own domain, boost performance, and enhance user privacy. Refer to the Cloudflare Fonts documentation for more information.`,builder:w,handler:async a=>{if(a.dryRun){r({command:`cf zones fonts get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/fonts`,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.zones.fonts.get({zone_id:s})),{successLabel:`Loaded`})}},E={command:`fonts`,describe:`Fonts operations`,builder:e=>e.command(C).command(T).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function D(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const O={command:`get`,describe:`Retrieves detailed information about a specific zone identified by its zone ID. Returns zone configuration, status, nameservers, and associated metadata.`,builder:D,handler:async a=>{if(a.dryRun){r({command:`cf zones get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}`,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.zones.get({zone_id:s})),{successLabel:`Loaded`})}};function k(e){return e.option(`include-subdomains`,{type:`boolean`,description:`If provided, the zone hold will extend to block any subdomain of the given zone, as well
|
|
14
|
-
as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
|
|
15
|
-
'example.com' and include_subdomains=true will block 'example.com',
|
|
16
|
-
'staging.example.com', 'api.staging.example.com', etc.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const A={command:`create`,describe:`Enforce a zone hold on the zone, blocking the creation and activation of zones with this zone's hostname. Zone holds cannot be enabled on CDN-only zones.`,builder:k,handler:async a=>{let o={include_subdomains:a[`include-subdomains`]};if(a.dryRun){r({command:`cf zones holds create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/hold`,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(`Creating`,async()=>s.zones.holds.create({zone_id:c,...o})),{successLabel:`Created`})}};function j(e){return e.option(`hold-after`,{type:`string`,description:"If `hold_after` is provided, the hold will be temporarily disabled,\nthen automatically re-enabled by the system at the time specified\nin this RFC3339-formatted timestamp. Otherwise, the hold will be\ndisabled indefinitely. `hold_after` cannot be provided for CDN-only zones."}).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`,describe:"Stop enforcement of a zone hold on the zone, permanently or temporarily, allowing the creation and activation of zones with this zone's hostname. Existing zone holds can be removed from CDN-only zones when `hold_after` is not provided. Active holds are automatically disabled when a zone transitions to CDN-only mode.",builder:j,handler:async a=>{let o={hold_after:a[`hold-after`]};if(a.dryRun){r({command:`cf zones holds delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/hold`,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});if(a.zoneId=c,!await u({force:!!a.force})){process.stderr.write(`Aborted.
|
|
17
|
-
`);return}n(await i(`Deleting`,async()=>s.zones.holds.delete({zone_id:c,...o})),{successLabel:`Deleted`})}};function N(e){return e.option(`hold-after`,{type:`string`,description:"If `hold_after` is provided and future-dated, the hold will be temporarily disabled,\nthen automatically re-enabled by the system at the time specified\nin this RFC3339-formatted timestamp. A past-dated `hold_after` value will have\nno effect on an existing, enabled hold. Providing an empty string will set its value\nto the current time. Providing `null` will disable the hold indefinitely."}).option(`include-subdomains`,{type:`boolean`,description:`If \`true\`, the zone hold will extend to block any subdomain of the given zone, as well
|
|
18
|
-
as SSL4SaaS Custom Hostnames. For example, a zone hold on a zone with the hostname
|
|
19
|
-
'example.com' and include_subdomains=true will block 'example.com',
|
|
20
|
-
'staging.example.com', 'api.staging.example.com', etc.`}).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:`edit`,describe:"Update the `hold_after` and/or `include_subdomains` values on an existing zone hold. The hold is enabled if the `hold_after` date-time value is in the past. Existing zone holds can be removed from CDN-only zones by setting `hold_after` to `null`. Other zone hold updates cannot be made on CDN-only zones. Active holds are automatically disabled when a zone transitions to CDN-only mode.",builder:N,handler:async c=>{if(c.dryRun){r({command:`cf zones holds edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/hold`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({hold_after:s(c[`hold-after`],`hold-after`,`text`),include_subdomains:c[`include-subdomains`]}):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.zones.holds.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=o({hold_after:s(c[`hold-after`],`hold-after`,`text`),include_subdomains:c[`include-subdomains`]});n(await i(`Updating`,async()=>l.zones.holds.edit({...d,zone_id:u})),{successLabel:`Updated`})}};function F(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const I={command:`get`,describe:`Retrieve whether the zone is subject to a zone hold, and metadata about the hold.`,builder:F,handler:async a=>{if(a.dryRun){r({command:`cf zones holds get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/hold`,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.zones.holds.get({zone_id:s})),{successLabel:`Loaded`})}},L={command:`holds`,describe:`Operations for holds`,builder:e=>e.command(A).command(M).command(P).command(I).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function R(e){return e.option(`name`,{type:`string`,description:"A domain name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`status`,{type:`string`,description:`Specify a zone status to filter by.`,choices:[`initializing`,`pending`,`active`,`moved`]}).option(`type`,{type:`string`,description:`Zone types to filter by. Multiple types can be specified as a comma-separated list (e.g., ?type=full,partial,secondary). When this parameter is not provided, zones with type "internal" are excluded from the results.`}).option(`account-id`,{type:`string`,description:`Filter by an account ID.`}).option(`account-name`,{type:`string`,description:"An account Name. Optional filter operators can be provided to extend refine the search:\n * `equal` (default)\n * `not_equal`\n * `starts_with`\n * `ends_with`\n * `contains`\n * `starts_with_case_sensitive`\n * `ends_with_case_sensitive`\n * `contains_case_sensitive`"}).option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Number of zones per page.`}).option(`order`,{type:`string`,description:`Field to order zones by.`,choices:[`name`,`status`,`account.id`,`account.name`,`plan.id`]}).option(`direction`,{type:`string`,description:`Direction to order zones.`,choices:[`asc`,`desc`]}).option(`match`,{type:`string`,description:`Whether to match all search requirements or at least one (any).`,choices:[`any`,`all`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const z={command:`list`,describe:`Lists, searches, sorts, and filters your zones. Listing zones across more than 500 accounts is currently not allowed.`,builder:d(R),handler:async e=>{let a={name:e.name,status:e.status,type:e.type,"account.id":e[`account-id`],"account.name":e[`account-name`],page:e.page,per_page:e[`per-page`],order:e.order,direction:e.direction,match:e.match};if(e.dryRun){r({command:`cf zones list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones`,pathParams:{},query:a,bodyKind:`none`});return}let o=await t(e);n(await i(`Loading`,async()=>o.zones.list(a)),{successLabel:`Loaded`})}};function B(e){return e.option(`value`,{type:`number`,description:`Value of the Origin H2 Max Streams Setting.`}).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:`edit`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:B,handler:async s=>{if(s.dryRun){r({command:`cf zones origin-h2-max-streams edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/settings/origin_h2_max_streams`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({value:s.value}):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.zones.originH2MaxStreams.edit({...e,zone_id:l})),{successLabel:`Updated`});return}if(s.value===void 0)throw Error(`--value is required (or pass --body with this field set).`);let u=o({value:s.value});n(await i(`Updating`,async()=>c.zones.originH2MaxStreams.edit({...u,zone_id:l})),{successLabel:`Updated`})}};function H(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const U={command:`get`,describe:"Origin H2 Max Streams configures the max number of concurrent requests that Cloudflare will send within the same connection when communicating with the origin server, if the origin supports it. Note that if your origin does not support H2 multiplexing, 5xx errors may be observed, particularly 520s. Also note that the default value is `100` for all plan types except Enterprise where it is `1`. `1` means that H2 multiplexing is disabled.",builder:H,handler:async a=>{if(a.dryRun){r({command:`cf zones origin-h2-max-streams get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/origin_h2_max_streams`,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.zones.originH2MaxStreams.get({zone_id:s})),{successLabel:`Loaded`})}},W={command:`origin-h2-max-streams`,describe:`Operations for origin-h2-max-streams`,builder:e=>e.command(V).command(U).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function G(e){return e.option(`value`,{type:`string`,description:`Value of the Origin Max HTTP Version Setting.`,choices:[`2`,`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 K={command:`edit`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:G,handler:async c=>{if(c.dryRun){r({command:`cf zones origin-max-http-version edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/settings/origin_max_http_version`,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 u=await t(c),d=await e({zone:c.zone},u,{quiet:c.quiet});if(c.zoneId=d,c.body){let e=a(c.body);n(await i(`Updating`,async()=>u.zones.originMaxHttpVersion.edit({...e,zone_id:d})),{successLabel:`Updated`});return}c.value===void 0&&(c.value=await l(`value`,`Value of the Origin Max HTTP Version Setting.`,[`2`,`1`]));let f=o({value:s(c.value,`value`,`text`)});n(await i(`Updating`,async()=>u.zones.originMaxHttpVersion.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function q(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`get`,describe:`Origin Max HTTP Setting Version sets the highest HTTP version Cloudflare will attempt to use with your origin. This setting allows Cloudflare to make HTTP/2 requests to your origin. (Refer to [Enable HTTP/2 to Origin](https://developers.cloudflare.com/cache/how-to/enable-http2-to-origin/), for more information.). The default value is "2" for all plan types except Enterprise where it is "1".`,builder:q,handler:async a=>{if(a.dryRun){r({command:`cf zones origin-max-http-version get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/origin_max_http_version`,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.zones.originMaxHttpVersion.get({zone_id:s})),{successLabel:`Loaded`})}},te={command:`origin-max-http-version`,describe:`Operations for origin-max-http-version`,builder:e=>e.command(K).command(J).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function Y(e){return e.positional(`plan-identifier`,{type:`string`,description:`Identifier`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`get <plan-identifier>`,describe:`Details of the available plan that the zone can subscribe to.`,builder:Y,handler:async a=>{if(a.dryRun){r({command:`cf zones plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/available_plans/${a[`plan-identifier`]==null?`<plan-identifier>`:encodeURIComponent(String(a[`plan-identifier`]))}`,pathParams:{"plan-identifier":String(a[`plan-identifier`]??``),"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.zones.plans.get({zone_id:s,plan_identifier:a[`plan-identifier`]})),{successLabel:`Loaded`})}};function Z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Q={command:`list`,describe:`Lists available plans the zone can subscribe to.`,builder:Z,handler:async a=>{if(a.dryRun){r({command:`cf zones plans list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/available_plans`,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.zones.plans.list({zone_id:s})),{successLabel:`Loaded`})}},ne={command:`plans`,describe:`Operations for plans`,builder:e=>e.command(X).command(Q).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function re(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ie={command:`get`,describe:`Lists all rate plans the zone can subscribe to.`,builder:re,handler:async a=>{if(a.dryRun){r({command:`cf zones rate-plans get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/available_rate_plans`,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.zones.ratePlans.get({zone_id:s})),{successLabel:`Loaded`})}},ae={command:`rate-plans`,describe:`Operations for rate-plans`,builder:e=>e.command(ie).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function oe(e){return e.option(`value`,{type:`string`,description:`Value can either be On or Off.`}).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 se={command:`edit`,describe:`Toggles RUM on/off for an existing zone.`,builder:oe,handler:async c=>{if(c.dryRun){r({command:`cf zones rum edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/settings/rum`,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 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.zones.rum.edit({...e,zone_id:u})),{successLabel:`Updated`});return}let d=o({value:s(c.value,`value`,`text`)});n(await i(`Updating`,async()=>l.zones.rum.edit({...d,zone_id:u})),{successLabel:`Updated`})}};function ce(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const le={command:`get`,describe:`Retrieves RUM status for a zone.`,builder:ce,handler:async a=>{if(a.dryRun){r({command:`cf zones rum get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/rum`,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.zones.rum.get({zone_id:s})),{successLabel:`Loaded`})}},ue={command:`rum`,describe:`Rum operations`,builder:e=>e.command(se).command(le).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function de(e){return e.positional(`setting-id`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`ssl-recommender enrollment setting.`}).option(`value-enabled`,{type:`boolean`,description:`Whether the feature is enabled or not.`}).option(`value-pool-id`,{type:`string`,description:`Egress pool id which refers to a grouping of dedicated egress IPs through which Cloudflare will connect to origin.`}).option(`value-cache-by-device-type`,{type:`boolean`,description:`Indicates whether or not [cache by device type](https://developers.cloudflare.com/automatic-platform-optimization/reference/cache-device-type/) is enabled.`}).option(`value-cf`,{type:`boolean`,description:`Indicates whether or not Cloudflare proxy is enabled.`}).option(`value-hostnames`,{type:`string`,array:!0,description:`An array of hostnames where Automatic Platform Optimization for WordPress is activated.`}).option(`value-wordpress`,{type:`boolean`,description:`Indicates whether or not site is powered by WordPress.`}).option(`value-wp-plugin`,{type:`boolean`,description:`Indicates whether or not [Cloudflare for WordPress plugin](https://wordpress.org/plugins/cloudflare/) is installed.`}).option(`value-strict-transport-security-enabled`,{type:`boolean`,description:`Whether or not strict transport security is enabled.`}).option(`value-strict-transport-security-include-subdomains`,{type:`boolean`,description:`Include all subdomains for strict transport security.`}).option(`value-strict-transport-security-max-age`,{type:`number`,description:`Max age in seconds of the strict transport security.`}).option(`value-strict-transport-security-nosniff`,{type:`boolean`,description:`Whether or not to include 'X-Content-Type-Options: nosniff' header.`}).option(`value-strict-transport-security-preload`,{type:`boolean`,description:`Enable automatic preload of the HSTS configuration.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`}).conflicts(`value-pool-id`,[`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).conflicts(`value-cache-by-device-type`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cache-by-device-type`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`]).conflicts(`value-cf`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-cf`,[`value-strict-transport-security-enabled`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-hostnames`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-hostnames`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-cache-by-device-type`]).conflicts(`value-wordpress`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wordpress`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-wp-plugin`,[`value-pool-id`,`value-strict-transport-security-include-subdomains`,`value-strict-transport-security-max-age`,`value-strict-transport-security-nosniff`,`value-strict-transport-security-preload`]).implies(`value-wp-plugin`,[`value-strict-transport-security-enabled`,`value-cf`,`value-wordpress`,`value-hostnames`,`value-cache-by-device-type`]).implies(`value-strict-transport-security-enabled`,[`value-cf`,`value-wordpress`,`value-wp-plugin`,`value-hostnames`,`value-cache-by-device-type`]).conflicts(`value-strict-transport-security-include-subdomains`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-max-age`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-nosniff`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`]).conflicts(`value-strict-transport-security-preload`,[`value-pool-id`,`value-cache-by-device-type`,`value-cf`,`value-hostnames`,`value-wordpress`,`value-wp-plugin`])}const fe={command:`edit <setting-id>`,describe:`Updates a single zone setting by the identifier`,builder:de,handler:async c=>{if(c.dryRun){r({command:`cf zones settings edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/settings/${c[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(c[`setting-id`]))}`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``),"setting-id":String(c[`setting-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({enabled:c.enabled,value:{enabled:c[`value-enabled`],pool_id:s(c[`value-pool-id`],`value-pool-id`,`text`),cache_by_device_type:c[`value-cache-by-device-type`],cf:c[`value-cf`],hostnames:c[`value-hostnames`],wordpress:c[`value-wordpress`],wp_plugin:c[`value-wp-plugin`],strict_transport_security:{enabled:c[`value-strict-transport-security-enabled`],include_subdomains:c[`value-strict-transport-security-include-subdomains`],max_age:c[`value-strict-transport-security-max-age`],nosniff:c[`value-strict-transport-security-nosniff`],preload:c[`value-strict-transport-security-preload`]}}}):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.zones.settings.edit({body:e,zone_id:u,setting_id:c[`setting-id`]})),{successLabel:`Updated`});return}let d=o({enabled:c.enabled,value:{enabled:c[`value-enabled`],pool_id:s(c[`value-pool-id`],`value-pool-id`,`text`),cache_by_device_type:c[`value-cache-by-device-type`],cf:c[`value-cf`],hostnames:c[`value-hostnames`],wordpress:c[`value-wordpress`],wp_plugin:c[`value-wp-plugin`],strict_transport_security:{enabled:c[`value-strict-transport-security-enabled`],include_subdomains:c[`value-strict-transport-security-include-subdomains`],max_age:c[`value-strict-transport-security-max-age`],nosniff:c[`value-strict-transport-security-nosniff`],preload:c[`value-strict-transport-security-preload`]}}});n(await i(`Updating`,async()=>l.zones.settings.edit({body:d,zone_id:u,setting_id:c[`setting-id`]})),{successLabel:`Updated`})}};function pe(e){return e.positional(`setting-id`,{type:`string`,description:`Setting name`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`get <setting-id>`,describe:`Fetch a single zone setting by name`,builder:pe,handler:async a=>{if(a.dryRun){r({command:`cf zones settings get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/${a[`setting-id`]==null?`<setting-id>`:encodeURIComponent(String(a[`setting-id`]))}`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``),"setting-id":String(a[`setting-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.zones.settings.get({zone_id:s,setting_id:a[`setting-id`]})),{successLabel:`Loaded`})}},he={command:`settings`,describe:`Operations for settings`,builder:e=>e.command(fe).command(me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function ge(e){return e.option(`value`,{type:`string`,description:`Whether the feature is enabled or disabled.`,choices:[`on`,`off`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const _e={command:`edit`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:ge,handler:async c=>{if(c.dryRun){r({command:`cf zones speed-brain edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/settings/speed_brain`,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 u=await t(c),d=await e({zone:c.zone},u,{quiet:c.quiet});if(c.zoneId=d,c.body){let e=a(c.body);n(await i(`Updating`,async()=>u.zones.speedBrain.edit({...e,zone_id:d})),{successLabel:`Updated`});return}c.value===void 0&&(c.value=await l(`value`,`Whether the feature is enabled or disabled.`,[`on`,`off`]));let f=o({value:s(c.value,`value`,`text`)});n(await i(`Updating`,async()=>u.zones.speedBrain.edit({...f,zone_id:d})),{successLabel:`Updated`})}};function ve(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ye={command:`get`,describe:`Speed Brain lets compatible browsers speculate on content which can be prefetched or preloaded, making website navigation faster. Refer to the Cloudflare Speed Brain documentation for more information.`,builder:ve,handler:async a=>{if(a.dryRun){r({command:`cf zones speed-brain get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/settings/speed_brain`,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.zones.speedBrain.get({zone_id:s})),{successLabel:`Loaded`})}},be={command:`speed-brain`,describe:`Speed Brain operations`,builder:e=>e.command(_e).command(ye).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function $(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const xe={command:`create`,describe:`Create a zone subscription, either plan or add-ons.`,builder:$,handler:async c=>{if(c.dryRun){r({command:`cf zones subscriptions create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({app:{install_id:s(c[`app-install-id`],`app-install-id`,`text`)},frequency:s(c.frequency,`frequency`,`text`),rate_plan:{currency:s(c[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:c[`rate-plan-externally-managed`],id:s(c[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:c[`rate-plan-is-contract`],public_name:s(c[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:s(c[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:c[`rate-plan-sets`]}}):a(c.body)});return}let l=await t(c),u=await e({zone:c.zone},l,{quiet:c.quiet});if(c.zoneId=u,c.body){let e=a(c.body);n(await i(`Creating`,async()=>l.zones.subscriptions.create({body:e,zone_id:u})),{successLabel:`Created`});return}let d=o({app:{install_id:s(c[`app-install-id`],`app-install-id`,`text`)},frequency:s(c.frequency,`frequency`,`text`),rate_plan:{currency:s(c[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:c[`rate-plan-externally-managed`],id:s(c[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:c[`rate-plan-is-contract`],public_name:s(c[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:s(c[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:c[`rate-plan-sets`]}});n(await i(`Creating`,async()=>l.zones.subscriptions.create({body:d,zone_id:u})),{successLabel:`Created`})}};function Se(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 Ce={command:`delete`,describe:`Deletes a zone's subscription.`,builder:Se,handler:async a=>{if(a.dryRun){r({command:`cf zones subscriptions delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/subscription`,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 u({force:!!a.force})){process.stderr.write(`Aborted.
|
|
21
|
-
`);return}n(await i(`Deleting`,async()=>o.zones.subscriptions.delete({zone_id:s})),{successLabel:`Deleted`})}};function we(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Te={command:`get`,describe:`Lists zone subscription details.`,builder:we,handler:async a=>{if(a.dryRun){r({command:`cf zones subscriptions get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/subscription`,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.zones.subscriptions.get({zone_id:s})),{successLabel:`Loaded`})}};function Ee(e){return e.option(`app-install-id`,{type:`string`,description:`app install id.`}).option(`frequency`,{type:`string`,description:`How often the subscription is renewed automatically.`,choices:[`weekly`,`monthly`,`quarterly`,`yearly`]}).option(`rate-plan-currency`,{type:`string`,description:`The currency applied to the rate plan subscription.`}).option(`rate-plan-externally-managed`,{type:`boolean`,description:`Whether this rate plan is managed externally from Cloudflare.`}).option(`rate-plan-id`,{type:`string`,description:`The ID of the rate plan.`}).option(`rate-plan-is-contract`,{type:`boolean`,description:`Whether a rate plan is enterprise-based (or newly adopted term contract).`}).option(`rate-plan-public-name`,{type:`string`,description:`The full name of the rate plan.`}).option(`rate-plan-scope`,{type:`string`,description:`The scope that this rate plan applies to.`}).option(`rate-plan-sets`,{type:`string`,array:!0,description:`The list of sets this rate plan applies to. Returns array of strings.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const De={command:`update`,describe:`Updates zone subscriptions, either plan or add-ons.`,builder:Ee,handler:async c=>{if(c.dryRun){r({command:`cf zones subscriptions update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${c.zone??c.zoneId??`<zone>`}/subscription`,pathParams:{"zone-id":String(c.zone??c[`zone-id`]??``)},bodyKind:`json`,body:c.body===void 0?o({app:{install_id:s(c[`app-install-id`],`app-install-id`,`text`)},frequency:s(c.frequency,`frequency`,`text`),rate_plan:{currency:s(c[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:c[`rate-plan-externally-managed`],id:s(c[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:c[`rate-plan-is-contract`],public_name:s(c[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:s(c[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:c[`rate-plan-sets`]}}):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.zones.subscriptions.update({body:e,zone_id:u})),{successLabel:`Updated`});return}let d=o({app:{install_id:s(c[`app-install-id`],`app-install-id`,`text`)},frequency:s(c.frequency,`frequency`,`text`),rate_plan:{currency:s(c[`rate-plan-currency`],`rate-plan-currency`,`text`),externally_managed:c[`rate-plan-externally-managed`],id:s(c[`rate-plan-id`],`rate-plan-id`,`text`),is_contract:c[`rate-plan-is-contract`],public_name:s(c[`rate-plan-public-name`],`rate-plan-public-name`,`text`),scope:s(c[`rate-plan-scope`],`rate-plan-scope`,`text`),sets:c[`rate-plan-sets`]}});n(await i(`Updating`,async()=>l.zones.subscriptions.update({body:d,zone_id:u})),{successLabel:`Updated`})}},Oe={command:`subscriptions`,describe:`Operations for subscriptions`,builder:e=>e.command(xe).command(Ce).command(Te).command(De).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},ke={command:`zones`,describe:`Zones are domains on Cloudflare — list, create, and configure domain settings`,builder:e=>e.command(_).command(y).command(x).command(O).command(z).command(h).command(E).command(L).command(W).command(te).command(ne).command(ae).command(ue).command(he).command(be).command(Oe).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{ke as default};
|
|
File without changes
|