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
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";import{n as s,t as c}from"./body-parser-C-c9gfH1.mjs";import{n as l}from"./input-validation-Bav2M9F-.mjs";import{a as u,i as d,n as f}from"./prompt-DdegNPpg.mjs";import{t as p}from"./cli-types-BsTty22w.mjs";function m(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const h={command:`archiveFindingInstance <finding-id>`,describe:`Archive one or more finding instances.`,builder:m,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture archiveFindingInstance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/instances/archive`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({check_instances:l[`check-instances`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.archiveFindingInstance({body:e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let f=c({check_instances:l[`check-instances`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.archiveFindingInstance({body:f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function ee(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`new-severity`,{type:`number`,description:`The numeric severity value to apply to the finding.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating a finding's severity.`})}const g={command:`changeFindingSeverity <finding-id>`,describe:"Update the severity of a Finding. This will update the `severity_override` field on the Finding payload with the new severity value.",builder:ee,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture changeFindingSeverity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/tune_finding_severity`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({new_severity:l[`new-severity`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.changeFindingSeverity({...e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`new-severity`]===void 0)throw Error(`--new-severity is required (or pass --body with this field set).`);let f=c({new_severity:l[`new-severity`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.changeFindingSeverity({...f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function _(e){return e.option(`dlp-profile-id`,{type:`string`,array:!0,description:`Filter by DLP profile IDs.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view content flagged on or before this date.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view content flagged on or after this date.`}).option(`search`,{type:`string`,description:`Search term to filter content.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating content exports.`})}const v={command:`createContentExport`,describe:`Creates a CSV export for content and accepts optional filters in the payload.`,builder:_,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createContentExport`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/content/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({dlp_profile_id:u[`dlp-profile-id`],integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),vendors:u.vendors}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createContentExport({...e,account_id:f})),{successLabel:`Created`});return}let p=c({dlp_profile_id:u[`dlp-profile-id`],integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),vendors:u.vendors});i(await o(`Creating`,async()=>d.dataSecurity.posture.createContentExport({...p,account_id:f})),{successLabel:`Created`})}};function y(e){return e.option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see active items.`}).option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`severities`,{type:`string`,array:!0,description:`Filter by severity levels.`}).option(`vendors`,{type:`string`,array:!0,description:`Filter by vendor types.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for findings export jobs.`})}const b={command:`createFindingExportCSV`,describe:`Creates a CSV export for findings and accepts optional filters in the payload.`,builder:y,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createFindingExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({ignored:u.ignored,integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),severities:u.severities,vendors:u.vendors}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingExportCsv({...e,account_id:f})),{successLabel:`Created`});return}let p=c({ignored:u.ignored,integration_id:u[`integration-id`],max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`),severities:u.severities,vendors:u.vendors});i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingExportCsv({...p,account_id:f})),{successLabel:`Created`})}};function x(e){return e.positional(`storage-namespace-id`,{type:`string`,description:"A storage namespace identifier for the finding, used to scope finding instance exports. Constructed by base64-decoding the finding ID (which encodes `integration_id:finding_type_id`) and replacing the colon separator with a hyphen. For example, a finding ID that decodes to `00000000-0000-0000-0000-000000000001:00000000-0000-0000-0000-000000000002` becomes `00000000-0000-0000-0000-000000000001-00000000-0000-0000-0000-000000000002`.",demandOption:!0}).option(`archived`,{type:`boolean`,description:`Filter for archived status.`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for finding instance exports.`})}const S={command:`createFindingInstancesExportCSV <storage-namespace-id>`,describe:"Creates a CSV export for Finding instances and accepts optional filters in the payload. The `storage_namespace_id` path parameter is derived from the finding ID by base64-decoding it (which yields `integration_id:finding_type_id`) and replacing the colon with a hyphen.",builder:x,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createFindingInstancesExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${u[`storage-namespace-id`]==null?`<storage-namespace-id>`:encodeURIComponent(String(u[`storage-namespace-id`]))}/instances/export`,pathParams:{"storage-namespace-id":String(u[`storage-namespace-id`]??``)},bodyKind:`json`,body:u.body===void 0?c({archived:u.archived,max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`)}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingInstancesExportCsv({...e,account_id:f,storage_namespace_id:u[`storage-namespace-id`]})),{successLabel:`Created`});return}let p=c({archived:u.archived,max_affliction_date:l(u[`max-affliction-date`],`max-affliction-date`,`text`),min_affliction_date:l(u[`min-affliction-date`],`min-affliction-date`,`text`),search:l(u.search,`search`,`text`)});i(await o(`Creating`,async()=>d.dataSecurity.posture.createFindingInstancesExportCsv({...p,account_id:f,storage_namespace_id:u[`storage-namespace-id`]})),{successLabel:`Created`})}};function C(e){return e.option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`finding-type-id`,{type:`string`,description:`The finding type this policy is associated with. All remediation actions must match this finding type.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a new policy configuration.`})}const w={command:`createPolicy`,describe:`Creates a new policy configuration that defines automated actions to be executed when security findings are detected. A policy can include multiple remediation and/or webhook actions that will be triggered automatically.`,builder:C,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture createPolicy`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,finding_type_id:l(d[`finding-type-id`],`finding-type-id`,`text`),integration_ids:d[`integration-ids`]}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dataSecurity.posture.createPolicy({...e,account_id:p})),{successLabel:`Created`});return}if(d[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(d[`display-name`]===void 0&&(d[`display-name`]=await u(`display-name`,`Display name for the policy configuration.`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);d[`finding-type-id`]===void 0&&(d[`finding-type-id`]=await u(`finding-type-id`,`The finding type this policy is associated with. All remediation actions must match this finding type.`));let m=c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,finding_type_id:l(d[`finding-type-id`],`finding-type-id`,`text`),integration_ids:d[`integration-ids`]});i(await o(`Creating`,async()=>f.dataSecurity.posture.createPolicy({...m,account_id:p})),{successLabel:`Created`})}};function T(e){return e.option(`finding-instance-ids`,{type:`string`,array:!0,description:`UUIDs identifying Finding Instances.`}).option(`remediation-type-id`,{type:`string`,description:`A UUID identifying this Remediation Type.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating remediation jobs.`})}const E={command:`createRemediationJobs`,describe:`Create one or more remediation jobs tied to a specific Cloudflare Account.`,builder:T,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture createRemediationJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},bodyKind:`json`,body:d.body===void 0?c({finding_instance_ids:d[`finding-instance-ids`],remediation_type_id:l(d[`remediation-type-id`],`remediation-type-id`,`text`)}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Creating`,async()=>f.dataSecurity.posture.createRemediationJobs({...e,account_id:p})),{successLabel:`Created`});return}if(d[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);d[`remediation-type-id`]===void 0&&(d[`remediation-type-id`]=await u(`remediation-type-id`,`A UUID identifying this Remediation Type.`));let m=c({finding_instance_ids:d[`finding-instance-ids`],remediation_type_id:l(d[`remediation-type-id`],`remediation-type-id`,`text`)});i(await o(`Creating`,async()=>f.dataSecurity.posture.createRemediationJobs({...m,account_id:p})),{successLabel:`Created`})}};function D(e){return e.option(`integration-id`,{type:`string`,array:!0,description:`Filter by multiple integration IDs.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or before this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediation jobs updated on or after this datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`status`,{type:`string`,array:!0,description:`Filter by remediation job status.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Filter specification for remediation jobs export.`})}const O={command:`createRemediationJobsExportCSV`,describe:`Creates a CSV export for remediation jobs and accepts optional filters in the payload.`,builder:D,handler:async u=>{if(u.dryRun){a({command:`cf data-security posture createRemediationJobsExportCSV`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs/export`,pathParams:{},bodyKind:`json`,body:u.body===void 0?c({integration_id:u[`integration-id`],max_updated_at:l(u[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:l(u[`min-updated-at`],`min-updated-at`,`text`),search:l(u.search,`search`,`text`),status:u.status}):s(u.body)});return}let d=await r(u),f=u.local?e:await t();if(u.accountId=f,u.body){let e=s(u.body);i(await o(`Creating`,async()=>d.dataSecurity.posture.createRemediationJobsExportCsv({...e,account_id:f})),{successLabel:`Created`});return}let p=c({integration_id:u[`integration-id`],max_updated_at:l(u[`max-updated-at`],`max-updated-at`,`text`),min_updated_at:l(u[`min-updated-at`],`min-updated-at`,`text`),search:l(u.search,`search`,`text`),status:u.status});i(await o(`Creating`,async()=>d.dataSecurity.posture.createRemediationJobsExportCsv({...p,account_id:f})),{successLabel:`Created`})}};function k(e){return e.option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating a new webhook configuration.`})}const A={command:`createWebhook`,describe:`Creates a new webhook configuration for sending finding notifications to external endpoints.`,builder:k,handler:async f=>{if(f.dryRun){a({command:`cf data-security posture createWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...e,account_id:m})),{successLabel:`Created`});return}f[`authentication-type`]===void 0&&(f[`authentication-type`]=await d(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),f[`destination-url`]===void 0&&(f[`destination-url`]=await u(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),f.label===void 0&&(f.label=await u(`label`,`Account-specified display label for the webhook configuration.`));let h=c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)});i(await o(`Creating`,async()=>p.dataSecurity.posture.createWebhook({...h,account_id:m})),{successLabel:`Created`})}};function j(e){return e.option(`finding-instance-ids`,{type:`string`,array:!0,description:`Array of finding instance IDs to send to the webhooks.`}).option(`webhook-ids`,{type:`string`,array:!0,description:`Array of webhook IDs to trigger jobs for.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for creating up to 100 webhook jobs. The number of jobs is the product of webhook_ids and finding_instance_ids.`})}const M={command:`createWebhookJobs`,describe:`Creates webhook jobs to send a finding instance to one or more configured webhooks.`,builder:j,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture createWebhookJobs`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/jobs`,pathParams:{},bodyKind:`json`,body:l.body===void 0?c({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.createWebhookJobs({...e,account_id:d})),{successLabel:`Created`});return}if(l[`finding-instance-ids`]===void 0)throw Error(`--finding-instance-ids is required (or pass --body with this field set).`);if(l[`webhook-ids`]===void 0)throw Error(`--webhook-ids is required (or pass --body with this field set).`);let f=c({finding_instance_ids:l[`finding-instance-ids`],webhook_ids:l[`webhook-ids`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.createWebhookJobs({...f,account_id:d})),{successLabel:`Created`})}};function N(e){return e.positional(`policy-id`,{type:`string`,description:`A UUID identifying the policy.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const P={command:`deletePolicy <policy-id>`,describe:`Deletes a policy configuration.`,builder:N,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture deletePolicy`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}i(await o(`Deleting`,async()=>c.dataSecurity.posture.deletePolicy({account_id:l,policy_id:s[`policy-id`]})),{successLabel:`Deleted`})}};function F(e){return e.positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,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 I={command:`deleteWebhook <webhook-id>`,describe:`Soft deletes a webhook configuration by its unique identifier. The webhook will be marked as deleted and will no longer be available for use.`,builder:F,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture deleteWebhook`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();if(s.accountId=l,!await f({force:!!s.force})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}i(await o(`Deleting`,async()=>c.dataSecurity.posture.deleteWebhook({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Deleted`})}};function L(e){return e.positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const R={command:`evaluateExistingWebhook <webhook-id>`,describe:`Sends a test webhook event using an existing webhook configuration. This allows customers to verify their webhook endpoint is still reachable and properly configured after creating the webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`,builder:L,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture evaluateExistingWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}/evaluate`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.dataSecurity.posture.evaluateExistingWebhook({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Created`})}};function z(e){return e.option(`authentication-type`,{type:`string`,description:`Type of authentication to use for the test webhook request.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL to send the test webhook event to.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for testing a webhook configuration before creating it.`})}const B={command:`evaluateNewWebhook`,describe:`Sends a test webhook event to the specified destination URL to verify the webhook endpoint is reachable and properly configured. This allows customers to validate their webhook configuration before creating the actual webhook resource. The test payload includes: - event_type: "webhook.test" - timestamp: Current UTC timestamp - message: Test message indicating this is from Cloudflare CASB - data: Object with test: true`,builder:z,handler:async f=>{if(f.dryRun){a({command:`cf data-security posture evaluateNewWebhook`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/evaluate`,pathParams:{},bodyKind:`json`,body:f.body===void 0?c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Creating`,async()=>p.dataSecurity.posture.evaluateNewWebhook({...e,account_id:m})),{successLabel:`Created`});return}f[`authentication-type`]===void 0&&(f[`authentication-type`]=await d(`authentication-type`,`Type of authentication to use for the test webhook request.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),f[`destination-url`]===void 0&&(f[`destination-url`]=await u(`destination-url`,`Target URL to send the test webhook event to.`));let h=c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`)});i(await o(`Creating`,async()=>p.dataSecurity.posture.evaluateNewWebhook({...h,account_id:m})),{successLabel:`Created`})}};function V(e){return e.positional(`id`,{type:`string`,description:`Unique identifier for the export job`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`getExportJob <id>`,describe:`Retrieves a single export job by its unique identifier`,builder:V,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getExportJob`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/exports/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}`,pathParams:{id:String(s.id??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getExportJob({account_id:l,id:s.id})),{successLabel:`Loaded`})}};function U(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const W={command:`getFinding <finding-id>`,describe:`Gets a security Finding that has been identified as being problematic.`,builder:U,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getFinding`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}`,pathParams:{"finding-id":String(s[`finding-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getFinding({account_id:l,finding_id:s[`finding-id`]})),{successLabel:`Loaded`})}};function G(e){return e.positional(`instance-id`,{type:`string`,description:`A uuid ID identifying this Finding instance.`,demandOption:!0}).option(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const K={command:`getFindingInstance <instance-id>`,describe:`Gets a security Finding instance by id.`,builder:G,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getFindingInstance`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}/instances/${s[`instance-id`]==null?`<instance-id>`:encodeURIComponent(String(s[`instance-id`]))}`,pathParams:{"finding-id":String(s[`finding-id`]??``),"instance-id":String(s[`instance-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getFindingInstance({account_id:l,finding_id:s[`finding-id`],instance_id:s[`instance-id`]})),{successLabel:`Loaded`})}};function q(e){return e.positional(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const J={command:`getFindingType <finding-type-id>`,describe:`Retrieve a specific finding type by its unique identifier.`,builder:q,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types/${s[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(s[`finding-type-id`]))}`,pathParams:{"finding-type-id":String(s[`finding-type-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getFindingType({account_id:l,finding_type_id:s[`finding-type-id`]})),{successLabel:`Loaded`})}};function Y(e){return e.positional(`policy-id`,{type:`string`,description:`The UUID of the policy configuration to retrieve.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const X={command:`getPolicyByID <policy-id>`,describe:`Retrieves the details of a specific policy configuration, including its associated remediation and webhook actions.`,builder:Y,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getPolicyByID`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${s[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(s[`policy-id`]))}`,pathParams:{"policy-id":String(s[`policy-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getPolicyById({account_id:l,policy_id:s[`policy-id`]})),{successLabel:`Loaded`})}};function Z(e){return e.positional(`finding-type-id`,{type:`string`,description:`A UUID string identifying the finding type.`,demandOption:!0}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`cursor`,{type:`string`,description:`A cursor for pagination.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`getRemediationTypesForFindingType <finding-type-id>`,describe:"List all remediation types for a given finding type. This endpoint supports both cursor and offset pagination. Note that `cursor` and `page` are mutually exclusive.",builder:Z,handler:async s=>{let c={integration_id:s[`integration-id`],cursor:s.cursor,page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf data-security posture getRemediationTypesForFindingType`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types/${s[`finding-type-id`]==null?`<finding-type-id>`:encodeURIComponent(String(s[`finding-type-id`]))}/remediation_types`,pathParams:{"finding-type-id":String(s[`finding-type-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.getRemediationTypesForFindingType({account_id:u,finding_type_id:s[`finding-type-id`],...c})),{successLabel:`Loaded`})}};function Q(e){return e.positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`getWebhookConfigByID <webhook-id>`,describe:`Retrieves a specific webhook configuration by its unique identifier.`,builder:Q,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture getWebhookConfigByID`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${s[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(s[`webhook-id`]))}`,pathParams:{"webhook-id":String(s[`webhook-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.getWebhookConfigById({account_id:l,webhook_id:s[`webhook-id`]})),{successLabel:`Loaded`})}};function re(e){return e.option(`checks`,{type:`string`,array:!0,description:`A list of finding IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on findings.`})}const ie={command:`ignoreFinding`,describe:`Given a list of findings, mark as ignored. Does nothing if Finding is already ignored.`,builder:re,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture ignoreFinding`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/ignore`,pathParams:{},bodyKind:`json`,body:l.body===void 0?c({checks:l.checks}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.ignoreFinding({body:e,account_id:d})),{successLabel:`Created`});return}if(l.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let f=c({checks:l.checks});i(await o(`Creating`,async()=>u.dataSecurity.posture.ignoreFinding({body:f,account_id:d})),{successLabel:`Created`})}};function ae(e){return e.option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dlp-profile-id`,{type:`string`,description:`Filter by an DLP profile ID`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering content assets.`,choices:[`asset_name`,`dlp_profile_count`,`integration_name`,`latest_affliction_date`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`vendor`,{type:`string`,description:`Filter by vendor`,choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const oe={command:`listContentAssets`,describe:`List DLP content findings`,builder:p(ae),handler:async s=>{let c={direction:s.direction,dlp_profile_id:s[`dlp-profile-id`],integration_id:s[`integration-id`],max_affliction_date:s[`max-affliction-date`],min_affliction_date:s[`min-affliction-date`],order:s.order,page:s.page,per_page:s[`per-page`],search:s.search,vendor:s.vendor};if(s.dryRun){a({command:`cf data-security posture listContentAssets`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/content`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listContentAssets({account_id:u,...c})),{successLabel:`Loaded`})}};function se(e){return e.option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`status`,{type:`string`,description:`Filter on export job's status`,choices:[`Pending`,`Success`,`Failure`,`Rescheduled`,`In-Progress`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ce={command:`listExportJobs`,describe:`List all export jobs for a given requestor's organization`,builder:p(se),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],status:s.status};if(s.dryRun){a({command:`cf data-security posture listExportJobs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/exports`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listExportJobs({account_id:u,...c})),{successLabel:`Loaded`})}};function le(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`archived`,{type:`boolean`,description:`Archived`}).option(`cursor`,{type:`string`,description:"A cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`order`,{type:`string`,description:`Which field to use when ordering the Finding's instances.
|
|
5
|
-
When ordering by 'remediation.status', only the most recent non-stale remediation job is considered. Stale jobs (created before the instance's affliction_date) are treated as having no status for ordering purposes.`,choices:[`affliction_date`,`asset.name`,`remediation.status`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`remediation-statuses`,{type:`string`,description:`Filter finding instances by most recent remediation job status. Supports multiple comma-separated values.
|
|
6
|
-
Use 'none' to filter instances with no remediation jobs or instances where the most recent job is stale.
|
|
7
|
-
Note: Stale jobs (created before the instance's affliction_date) are ignored for filtering purposes, but are still included in the 'remediations' array with stale=true.`}).option(`finding-instance-ids`,{type:`string`,description:`Filter finding instances by an array of finding instance IDs. Supports multiple comma-separated values.`}).option(`asset-ids`,{type:`string`,description:`Filter finding instances by an array of asset IDs. Supports multiple comma-separated values.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ue={command:`listFindingInstances <finding-id>`,describe:`Lists all security finding instances for a given security finding.`,builder:p(le),handler:async s=>{let c={archived:s.archived,cursor:s.cursor,direction:s.direction,max_affliction_date:s[`max-affliction-date`],min_affliction_date:s[`min-affliction-date`],order:s.order,page:s.page,per_page:s[`per-page`],search:s.search,remediation_statuses:s[`remediation-statuses`],finding_instance_ids:s[`finding-instance-ids`],asset_ids:s[`asset-ids`]};if(s.dryRun){a({command:`cf data-security posture listFindingInstances`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}/instances`,pathParams:{"finding-id":String(s[`finding-id`]??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listFindingInstances({account_id:u,finding_id:s[`finding-id`],...c})),{successLabel:`Loaded`})}};function de(e){return e.option(`cursor`,{type:`string`,description:"A cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`ignored`,{type:`boolean`,description:`Filter for only the ignored findings. Set to false to only see "active" items`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`max-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or before the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`min-affliction-date`,{type:`string`,description:`Filter to view findings that occurred on or after the affliction date. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`observation`,{type:`string`,description:`Filter by observation type of the finding`,choices:[`Activity`,`Insight`,`Issue`]}).option(`order`,{type:`string`,description:`Which field to use when ordering the findings.`,choices:[`finding.name`,`instance_count`,`integration.name`,`latest_affliction_date`,`severity`]}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`product`,{type:`string`,description:`Filter by product category of the finding`,choices:[`Cloud`,`Saas`]}).option(`search`,{type:`string`,description:`A search term.`}).option(`severity`,{type:`string`,description:`Filter by severity`,choices:[`Critical`,`High`,`Medium`,`Low`]}).option(`type`,{type:`string`,description:`Filter by type of the finding`,choices:[`Content`,`Posture`]}).option(`vendor`,{type:`string`,description:`Filter by vendor`,choices:[`ANTHROPIC`,`AWS`,`BITBUCKET`,`BOX`,`CONFLUENCE`,`DROPBOX`,`GITHUB`,`GOOGLE_CLOUD_PLATFORM`,`GOOGLE_WORKSPACE`,`JIRA`,`MICROSOFT`,`MICROSOFT_INTERNAL`,`OPENAI`,`SALESFORCE`,`SERVICENOW`,`SLACK`]}).option(`finding-type-ids`,{type:`string`,description:`A comma separated list of UUIDs identifying the finding type(s).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const fe={command:`listFindings`,describe:`List all security findings that have been identified as being problematic. This will return a list of findings regardless if they have been ignored or not.`,builder:p(de),handler:async s=>{let c={cursor:s.cursor,direction:s.direction,ignored:s.ignored,integration_id:s[`integration-id`],max_affliction_date:s[`max-affliction-date`],min_affliction_date:s[`min-affliction-date`],observation:s.observation,order:s.order,page:s.page,per_page:s[`per-page`],product:s.product,search:s.search,severity:s.severity,type:s.type,vendor:s.vendor,finding_type_ids:s[`finding-type-ids`]};if(s.dryRun){a({command:`cf data-security posture listFindings`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listFindings({account_id:u,...c})),{successLabel:`Loaded`})}};function pe(e){return e.option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`vendors`,{type:`string`,description:`Filter finding types by vendor. Supports multiple comma-separated values. Each value may be either the vendor enum (GOOGLE_WORKSPACE) or the friendly name returned by the read routes (Google Workspace).`}).option(`search`,{type:`string`,description:`Filter finding types by name or ID (case-insensitive substring match).`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const me={command:`listFindingTypes`,describe:`List all available finding types with pagination support.`,builder:p(pe),handler:async s=>{let c={page:s.page,per_page:s[`per-page`],vendors:s.vendors,search:s.search};if(s.dryRun){a({command:`cf data-security posture listFindingTypes`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/finding_types`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listFindingTypes({account_id:u,...c})),{successLabel:`Loaded`})}};function he(e){return e.option(`cursor`,{type:`string`,description:"Cursor for pagination. Obtained from the `result_info.cursor` field of a previous response."}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ge={command:`listPolicies`,describe:`Returns a list of integration-scoped policy configurations for the given account. This endpoint supports cursor based pagination. By default, results are returned in sorted order based on created_at.`,builder:he,handler:async s=>{let c={cursor:s.cursor};if(s.dryRun){a({command:`cf data-security posture listPolicies`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listPolicies({account_id:u,...c})),{successLabel:`Loaded`})}};function _e(e){return e.option(`since`,{type:`string`,description:"Lower bound on the log entry timestamp. Accepts ISO 8601 / RFC3339 or epoch seconds. Defaults to 7 days before `until`. The window between `since` and `until` cannot exceed 180 days."}).option(`until`,{type:`string`,description:"Upper bound on the log entry timestamp. Accepts ISO 8601 / RFC3339 or epoch seconds. Defaults to the current time. Must be greater than or equal to `since`."}).option(`integration-id`,{type:`string`,description:`Comma-separated list of CASB integration IDs to filter by. At most 100 values, each at most 128 characters. Values outside the account's tenancy allowlist are silently ignored. When omitted, results are scoped to the full allowlist.`}).option(`policy-name`,{type:`string`,description:`Comma-separated list of policy display names to filter by. At most 100 values, each at most 255 characters.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ve={command:`listPolicyLogs`,describe:"Returns a list of policy invocation logs for the given account, sourced from ClickHouse via Ready Analytics. Each entry represents one execution of a policy against a finding instance, including the actions (remediation jobs and webhooks) it dispatched. Results are scoped to the requesting account's CASB integrations. The `integration_id` query parameter, when supplied, is intersected against the account's integration allowlist; values outside the allowlist are silently dropped. Pagination is offset-based. The response does not include a total row count; clients should treat a result with fewer than `per_page` entries as the end of the list.",builder:_e,handler:async s=>{let c={since:s.since,until:s.until,integration_id:s[`integration-id`],policy_name:s[`policy-name`],page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf data-security posture listPolicyLogs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/logs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listPolicyLogs({account_id:u,...c})),{successLabel:`Loaded`})}};function ye(e){return e.option(`cursor`,{type:`string`,description:`A cursor for pagination.`}).option(`page`,{type:`number`,description:`A page number within the paginated result set.`}).option(`per-page`,{type:`number`,description:`Number of results to return per page.`}).option(`search`,{type:`string`,description:`A search term.`}).option(`min-updated-at`,{type:`string`,description:`Filter to view remediations updated on or after the min updated datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`max-updated-at`,{type:`string`,description:`Filter to view remediations updated on or before the max updated datetime. Can be a date-time in ISO 8601 format or an epoch timestamp.`}).option(`status`,{type:`string`,description:`Filter to view remediations with the given status.`,choices:[`pending`,`processing`,`completed`,`failed`,`validating`]}).option(`triggered-by-actor`,{type:`string`,description:`Filter remediations by what kind of actor triggered them. Supports multiple comma-separated values.`}).option(`integration-id`,{type:`string`,description:`Filter by an integration ID`}).option(`order`,{type:`string`,description:`An optional param to sort the results by the given field.`,choices:[`created_at`,`affliction_date`,`integration_name`,`status`,`last_updated_at`,`asset_name`,`finding_type_name`]}).option(`direction`,{type:`string`,description:`Direction to order results.`,choices:[`asc`,`desc`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const be={command:`listRemediationJobs`,describe:"List all remediation jobs tied to a specific Cloudflare Account. Note that `cursor` and `page` are mutually exclusive.",builder:p(ye),handler:async s=>{let c={cursor:s.cursor,page:s.page,per_page:s[`per-page`],search:s.search,min_updated_at:s[`min-updated-at`],max_updated_at:s[`max-updated-at`],status:s.status,triggered_by_actor:s[`triggered-by-actor`],integration_id:s[`integration-id`],order:s.order,direction:s.direction};if(s.dryRun){a({command:`cf data-security posture listRemediationJobs`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/remediations/jobs`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.dataSecurity.posture.listRemediationJobs({account_id:u,...c})),{successLabel:`Loaded`})}};function xe(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Se={command:`listWebhooks`,describe:`Retrieves all webhook configurations for the authenticated account. Returns an array of webhook configurations that can be used to send finding notifications.`,builder:xe,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture listWebhooks`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks`,pathParams:{},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Loading`,async()=>c.dataSecurity.posture.listWebhooks({account_id:l})),{successLabel:`Loaded`})}};function Ce(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const we={command:`resetFindingSeverity <finding-id>`,describe:`If a Finding's severity has been changed, reset it back to default value. Does nothing if no override exists.`,builder:Ce,handler:async s=>{if(s.dryRun){a({command:`cf data-security posture resetFindingSeverity`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${s[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(s[`finding-id`]))}/reset_finding_severity`,pathParams:{"finding-id":String(s[`finding-id`]??``)},bodyKind:`none`});return}let c=await r(s),l=s.local?e:await t();s.accountId=l,i(await o(`Creating`,async()=>c.dataSecurity.posture.resetFindingSeverity({account_id:l,finding_id:s[`finding-id`]})),{successLabel:`Created`})}};function Te(e){return e.positional(`finding-id`,{type:`string`,description:`A base64-encoded ID identifying this Finding.`,demandOption:!0}).option(`check-instances`,{type:`string`,array:!0,description:`A list of finding instance IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on finding instances.`})}const Ee={command:`unarchiveFindingInstance <finding-id>`,describe:`Remove the archive marking from one or more finding instances.`,builder:Te,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture unarchiveFindingInstance`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/${l[`finding-id`]==null?`<finding-id>`:encodeURIComponent(String(l[`finding-id`]))}/instances/unarchive`,pathParams:{"finding-id":String(l[`finding-id`]??``)},bodyKind:`json`,body:l.body===void 0?c({check_instances:l[`check-instances`]}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.unarchiveFindingInstance({body:e,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`});return}if(l[`check-instances`]===void 0)throw Error(`--check-instances is required (or pass --body with this field set).`);let f=c({check_instances:l[`check-instances`]});i(await o(`Creating`,async()=>u.dataSecurity.posture.unarchiveFindingInstance({body:f,account_id:d,finding_id:l[`finding-id`]})),{successLabel:`Created`})}};function De(e){return e.option(`checks`,{type:`string`,array:!0,description:`A list of finding IDs to pass along.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for bulk actions on findings.`})}const $={command:`unIgnoreFinding`,describe:`Ability to un-ignore a Finding if it's previously been ignored. Does nothing if the Finding is not ignored.`,builder:De,handler:async l=>{if(l.dryRun){a({command:`cf data-security posture unIgnoreFinding`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/findings/unignore`,pathParams:{},bodyKind:`json`,body:l.body===void 0?c({checks:l.checks}):s(l.body)});return}let u=await r(l),d=l.local?e:await t();if(l.accountId=d,l.body){let e=s(l.body);i(await o(`Creating`,async()=>u.dataSecurity.posture.unIgnoreFinding({body:e,account_id:d})),{successLabel:`Created`});return}if(l.checks===void 0)throw Error(`--checks is required (or pass --body with this field set).`);let f=c({checks:l.checks});i(await o(`Creating`,async()=>u.dataSecurity.posture.unIgnoreFinding({body:f,account_id:d})),{successLabel:`Created`})}};function Oe(e){return e.positional(`policy-id`,{type:`string`,description:`Policy configuration ID`,demandOption:!0}).option(`applies-to-all-integrations`,{type:`boolean`,description:`When true, the policy applies to all integrations for the account. When false, integration_ids must be provided.`}).option(`description`,{type:`string`,description:`Optional description of what this policy does.`}).option(`display-name`,{type:`string`,description:`Display name for the policy configuration.`}).option(`enabled`,{type:`boolean`,description:`Boolean specifying if the policy is enabled or disabled.`}).option(`integration-ids`,{type:`string`,array:!0,description:`The integrations this policy applies to. Required when applies_to_all_integrations is false.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating an existing policy configuration.`})}const ke={command:`updatePolicy <policy-id>`,describe:`Updates an existing policy configuration and replaces its actions.`,builder:Oe,handler:async d=>{if(d.dryRun){a({command:`cf data-security posture updatePolicy`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/policies/${d[`policy-id`]==null?`<policy-id>`:encodeURIComponent(String(d[`policy-id`]))}`,pathParams:{"policy-id":String(d[`policy-id`]??``)},bodyKind:`json`,body:d.body===void 0?c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,integration_ids:d[`integration-ids`]}):s(d.body)});return}let f=await r(d),p=d.local?e:await t();if(d.accountId=p,d.body){let e=s(d.body);i(await o(`Updating`,async()=>f.dataSecurity.posture.updatePolicy({...e,account_id:p,policy_id:d[`policy-id`]})),{successLabel:`Updated`});return}if(d[`applies-to-all-integrations`]===void 0)throw Error(`--applies-to-all-integrations is required (or pass --body with this field set).`);if(d[`display-name`]===void 0&&(d[`display-name`]=await u(`display-name`,`Display name for the policy configuration.`)),d.enabled===void 0)throw Error(`--enabled is required (or pass --body with this field set).`);let m=c({applies_to_all_integrations:d[`applies-to-all-integrations`],description:l(d.description,`description`,`text`),display_name:l(d[`display-name`],`display-name`,`text`),enabled:d.enabled,integration_ids:d[`integration-ids`]});i(await o(`Updating`,async()=>f.dataSecurity.posture.updatePolicy({...m,account_id:p,policy_id:d[`policy-id`]})),{successLabel:`Updated`})}};function Ae(e){return e.positional(`webhook-id`,{type:`string`,description:`A UUID identifying the webhook configuration.`,demandOption:!0}).option(`authentication-type`,{type:`string`,description:`Type of authentication used for the webhook.`,choices:[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`]}).option(`destination-url`,{type:`string`,description:`Target URL for the webhook configuration. Where resulting data will be sent.`}).option(`label`,{type:`string`,description:`Account-specified display label for the webhook configuration.`}).option(`signing-secret`,{type:`string`,description:`Secret key used for HMAC signing when authentication_type is "HMAC-Signing".`}).option(`status`,{type:`string`,description:`Status of the webhook configuration.`,choices:[`enabled`,`disabled`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for updating an existing webhook configuration.`})}const je={command:`updateWebhook <webhook-id>`,describe:`Updates an existing webhook configuration with new settings.`,builder:Ae,handler:async f=>{if(f.dryRun){a({command:`cf data-security posture updateWebhook`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/data-security/posture/webhooks/${f[`webhook-id`]==null?`<webhook-id>`:encodeURIComponent(String(f[`webhook-id`]))}`,pathParams:{"webhook-id":String(f[`webhook-id`]??``)},bodyKind:`json`,body:f.body===void 0?c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`),status:l(f.status,`status`,`text`)}):s(f.body)});return}let p=await r(f),m=f.local?e:await t();if(f.accountId=m,f.body){let e=s(f.body);i(await o(`Updating`,async()=>p.dataSecurity.posture.updateWebhook({...e,account_id:m,webhook_id:f[`webhook-id`]})),{successLabel:`Updated`});return}f[`authentication-type`]===void 0&&(f[`authentication-type`]=await d(`authentication-type`,`Type of authentication used for the webhook.`,[`Basic Auth`,`None`,`Bearer Auth`,`Static Headers`,`HMAC-Signing`])),f[`destination-url`]===void 0&&(f[`destination-url`]=await u(`destination-url`,`Target URL for the webhook configuration. Where resulting data will be sent.`)),f.label===void 0&&(f.label=await u(`label`,`Account-specified display label for the webhook configuration.`)),f.status===void 0&&(f.status=await d(`status`,`Status of the webhook configuration.`,[`enabled`,`disabled`]));let h=c({authentication_type:l(f[`authentication-type`],`authentication-type`,`text`),destination_url:l(f[`destination-url`],`destination-url`,`text`),label:l(f.label,`label`,`text`),signing_secret:l(f[`signing-secret`],`signing-secret`,`text`),status:l(f.status,`status`,`text`)});i(await o(`Updating`,async()=>p.dataSecurity.posture.updateWebhook({...h,account_id:m,webhook_id:f[`webhook-id`]})),{successLabel:`Updated`})}},Me={command:`posture`,describe:`Operations for posture`,builder:e=>e.command(h).command(g).command(v).command(b).command(S).command(w).command(E).command(O).command(A).command(M).command(P).command(I).command(R).command(B).command(H).command(W).command(K).command(J).command(X).command(te).command(ne).command(ie).command(oe).command(ce).command(ue).command(me).command(fe).command(ge).command(ve).command(be).command(Se).command(we).command($).command(Ee).command(ke).command(je).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},Ne={command:`data-security`,describe:`data-security`,builder:e=>e.command(Me).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{Ne as default};
|
|
@@ -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:`get`,describe:`Retrieve the account and zone specific unique identifier used as part of the CNAME target for DCV Delegation.`,builder:a,handler:async a=>{if(a.dryRun){r({command:`cf dcv-delegation get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/dcv_delegation/uuid`,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.dcvDelegation.get({zone_id:s})),{successLabel:`Loaded`})}},s={command:`dcv-delegation`,describe:`dcv-delegation`,builder:e=>e.command(o).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{s as default};
|
package/dist/deploy-CZ7bgNDu.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{n as e,t}from"./shared-VppSAQf4.mjs";function n(t){return e(t).option(`dispatch-namespace`,{type:`string`,description:`Name of a dispatch namespace to deploy the Worker to (Workers for Platforms)`,requiresArg:!0})}const r={command:`deploy`,describe:`Deploy a worker to Cloudflare`,builder:n,handler:async e=>{await t(e,{command:`Deploy`})}};export{r as default};
|
package/dist/dev-V10MG-Bg.mjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./src-D_HETJNy.mjs";import{a as t}from"./theme-CeVf-5qG.mjs";import"./ui-DE8CNn6c.mjs";import{a as n,i as r,n as i,r as a,t as o}from"./spawn-O1RS01vr.mjs";import{t as s}from"./registry-Bck_zFkz.mjs";const c={command:`dev [implArgs..]`,describe:`Run the project's Cloudflare dev server`,builder:e=>e.positional(`implArgs`,{type:`string`,array:!0,describe:`Arguments forwarded to the dev-server implementation`}).parserConfiguration({"unknown-options-as-args":!0,"camel-case-expansion":!1}).epilogue(`cf dev starts the appropriate development server for your project. It runs your framework's dev command when available, falling back to an installed Cloudflare dev server.
|
|
3
|
-
|
|
4
|
-
Arguments after ${t.brand(`cf dev`)} are not forwarded to non-Cloudflare development servers. Run the non-Cloudflare dev command directly to pass additional arguments.`),handler:async t=>{let c=process.cwd(),l=await a(c);l&&!l.configured&&await r(l);let u=(t.implArgs??[]).map(String);throw l?.devCommand?u.length>0?Error(`Arguments cannot currently be forwarded to the detected dev command \`${l.devCommand}\`. Run that command directly with the required arguments.`):new e(await n(l.devCommand,c,{...l.env,...s()})):new e(await o(i(c),`dev`,u))}};export{c as default};
|
package/dist/dist-CgrMkXFx.mjs
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{n as e}from"./chunk-vbHwaUoU.mjs";import{a as t}from"./public-BwQqexwo-CNW_dPly.mjs";import*as n from"node:module";import{fileURLToPath as r,pathToFileURL as i}from"node:url";import{AsyncLocalStorage as a}from"node:async_hooks";var o;const s=Object.freeze({status:`aborted`});function c(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,`_zod`,{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}var l=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},u=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(o=globalThis).__zod_globalConfig??(o.__zod_globalConfig={});const d=globalThis.__zod_globalConfig;function f(e){return e&&Object.assign(d,e),d}function p(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function m(e,t){return typeof t==`bigint`?t.toString():t}function h(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function g(e){return e==null}function _(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ee(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const v=Symbol(`evaluating`);function y(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==v)return r===void 0&&(r=v,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function b(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function x(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}const re=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function S(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const ie=h(()=>{if(d.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function C(e){if(S(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(S(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function w(e){return C(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const ae=new Set([`string`,`number`,`symbol`]),oe=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function T(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function se(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const ce={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function le(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return E(e,x(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return b(this,`shape`,e),e},checks:[]}))}function ue(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return E(e,x(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return b(this,`shape`,r),r},checks:[]}))}function de(e,t){if(!C(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return E(e,x(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return b(this,`shape`,n),n}}))}function fe(e,t){if(!C(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,x(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return b(this,`shape`,n),n}}))}function pe(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return E(e,x(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return b(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function me(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return E(t,x(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return b(this,`shape`,i),i},checks:[]}))}function he(e,t,n){return E(t,x(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return b(this,`shape`,i),i}}))}function O(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ge(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function k(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function _e(e){return typeof e==`string`?e:e?.message}function A(e,t,n){let r=e.message?e.message:_e(e.inst?._zod.def?.error?.(e))??_e(t?.error?.(e))??_e(n.customError?.(e))??_e(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function ve(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function j(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}const ye=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),e.message=JSON.stringify(t,m,2),Object.defineProperty(e,`toString`,{value:()=>e.message,enumerable:!1})},be=c(`$ZodError`,ye),xe=c(`$ZodError`,ye,{Parent:Error});function Se(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ce(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}const we=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new l;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>A(e,a,f())));throw re(t,i?.callee),t}return o.value},Te=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>A(e,a,f())));throw re(t,i?.callee),t}return o.value},Ee=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new l;return a.issues.length?{success:!1,error:new(e??be)(a.issues.map(e=>A(e,i,f())))}:{success:!0,data:a.value}},De=Ee(xe),Oe=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>A(e,i,f())))}:{success:!0,data:a.value}},ke=Oe(xe),Ae=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return we(e)(t,n,i)},je=e=>(t,n,r)=>we(e)(t,n,r),Me=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Te(e)(t,n,i)},Ne=e=>async(t,n,r)=>Te(e)(t,n,r),Pe=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Ee(e)(t,n,i)},Fe=e=>(t,n,r)=>Ee(e)(t,n,r),Ie=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Oe(e)(t,n,i)},Le=e=>async(t,n,r)=>Oe(e)(t,n,r),Re=/^[cC][0-9a-z]{6,}$/,ze=/^[0-9a-z]+$/,Be=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ve=/^[0-9a-vA-V]{20}$/,He=/^[A-Za-z0-9]{27}$/,Ue=/^[a-zA-Z0-9_-]{21}$/,We=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ge=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ke=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,qe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;function Je(){return RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)}const Ye=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Xe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Ze=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Qe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$e=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,et=/^[A-Za-z0-9_-]*$/,tt=/^https?$/,nt=/^\+[1-9]\d{6,14}$/,rt=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,it=RegExp(`^${rt}$`);function at(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ot(e){return RegExp(`^${at(e)}$`)}function st(e){let t=at({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${rt}T(?:${r})$`)}const ct=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},lt=/^-?\d+$/,ut=/^-?\d+(?:\.\d+)?$/,dt=/^(?:true|false)$/i,ft=/^null$/i,pt=/^[^A-Z]*$/,mt=/^[^a-z]*$/,M=c(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ht={number:`number`,bigint:`bigint`,object:`date`},gt=c(`$ZodCheckLessThan`,(e,t)=>{M.init(e,t);let n=ht[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),_t=c(`$ZodCheckGreaterThan`,(e,t)=>{M.init(e,t);let n=ht[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vt=c(`$ZodCheckMultipleOf`,(e,t)=>{M.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):ee(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),yt=c(`$ZodCheckNumberFormat`,(e,t)=>{M.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ce[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=lt)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),bt=c(`$ZodCheckMaxLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=ve(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),xt=c(`$ZodCheckMinLength`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=ve(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),St=c(`$ZodCheckLengthEquals`,(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!g(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=ve(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ct=c(`$ZodCheckStringFormat`,(e,t)=>{var n,r;M.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),wt=c(`$ZodCheckRegex`,(e,t)=>{Ct.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Tt=c(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=pt,Ct.init(e,t)}),Et=c(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=mt,Ct.init(e,t)}),Dt=c(`$ZodCheckIncludes`,(e,t)=>{M.init(e,t);let n=T(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Ot=c(`$ZodCheckStartsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`^${T(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),kt=c(`$ZodCheckEndsWith`,(e,t)=>{M.init(e,t);let n=RegExp(`.*${T(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),At=c(`$ZodCheckOverwrite`,(e,t)=>{M.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var jt=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
3
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
4
|
-
`))}};const Mt={major:4,minor:4,patch:3},N=c(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Mt;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=O(e),i;for(let a of t){if(a._zod.def.when){if(ge(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new l;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=O(e,t))});else{if(e.issues.length===t)continue;r||=O(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(O(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new l;return o.then(e=>t(e,r,a))}return t(o,r,a)}}y(e,`~standard`,()=>({validate:t=>{try{let n=De(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ke(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Nt=c(`$ZodString`,(e,t)=>{N.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??ct(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),P=c(`$ZodStringFormat`,(e,t)=>{Ct.init(e,t),Nt.init(e,t)}),Pt=c(`$ZodGUID`,(e,t)=>{t.pattern??=Ge,P.init(e,t)}),Ft=c(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Ke(e)}else t.pattern??=Ke();P.init(e,t)}),It=c(`$ZodEmail`,(e,t)=>{t.pattern??=qe,P.init(e,t)}),Lt=c(`$ZodURL`,(e,t)=>{P.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===tt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Rt=c(`$ZodEmoji`,(e,t)=>{t.pattern??=Je(),P.init(e,t)}),zt=c(`$ZodNanoID`,(e,t)=>{t.pattern??=Ue,P.init(e,t)}),Bt=c(`$ZodCUID`,(e,t)=>{t.pattern??=Re,P.init(e,t)}),Vt=c(`$ZodCUID2`,(e,t)=>{t.pattern??=ze,P.init(e,t)}),Ht=c(`$ZodULID`,(e,t)=>{t.pattern??=Be,P.init(e,t)}),Ut=c(`$ZodXID`,(e,t)=>{t.pattern??=Ve,P.init(e,t)}),Wt=c(`$ZodKSUID`,(e,t)=>{t.pattern??=He,P.init(e,t)}),Gt=c(`$ZodISODateTime`,(e,t)=>{t.pattern??=st(t),P.init(e,t)}),Kt=c(`$ZodISODate`,(e,t)=>{t.pattern??=it,P.init(e,t)}),qt=c(`$ZodISOTime`,(e,t)=>{t.pattern??=ot(t),P.init(e,t)}),Jt=c(`$ZodISODuration`,(e,t)=>{t.pattern??=We,P.init(e,t)}),Yt=c(`$ZodIPv4`,(e,t)=>{t.pattern??=Ye,P.init(e,t),e._zod.bag.format=`ipv4`}),Xt=c(`$ZodIPv6`,(e,t)=>{t.pattern??=Xe,P.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Zt=c(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ze,P.init(e,t)}),Qt=c(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Qe,P.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function $t(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const en=c(`$ZodBase64`,(e,t)=>{t.pattern??=$e,P.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{$t(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function tn(e){if(!et.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return $t(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const nn=c(`$ZodBase64URL`,(e,t)=>{t.pattern??=et,P.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{tn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),rn=c(`$ZodE164`,(e,t)=>{t.pattern??=nt,P.init(e,t)});function an(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const on=c(`$ZodJWT`,(e,t)=>{P.init(e,t),e._zod.check=n=>{an(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),sn=c(`$ZodNumber`,(e,t)=>{N.init(e,t),e._zod.pattern=e._zod.bag.pattern??ut,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),cn=c(`$ZodNumberFormat`,(e,t)=>{yt.init(e,t),sn.init(e,t)}),ln=c(`$ZodBoolean`,(e,t)=>{N.init(e,t),e._zod.pattern=dt,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),un=c(`$ZodNull`,(e,t)=>{N.init(e,t),e._zod.pattern=ft,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),dn=c(`$ZodUnknown`,(e,t)=>{N.init(e,t),e._zod.parse=e=>e}),fn=c(`$ZodNever`,(e,t)=>{N.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function pn(e,t,n){e.issues.length&&t.issues.push(...k(n,e.issues)),t.value[n]=e.value}const mn=c(`$ZodArray`,(e,t)=>{N.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>pn(t,n,e))):pn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function hn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...k(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function gn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=se(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function _n(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>hn(e,n,i,t,u,d))):hn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const vn=c(`$ZodObject`,(e,t)=>{if(N.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,`shape`,{get:()=>{let n={...e};return Object.defineProperty(t,`shape`,{value:n}),n}})}let n=h(()=>gn(t));y(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=S,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>hn(n,t,e,s,r,i))):hn(a,t,e,s,r,i)}return i?_n(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),yn=c(`$ZodObjectJIT`,(e,t)=>{vn.init(e,t);let n=e._zod.parse,r=h(()=>gn(t)),i=e=>{let t=new jt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=te(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=te(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
5
|
-
if (${n}.issues.length) {
|
|
6
|
-
if (${o} in input) {
|
|
7
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
8
|
-
...iss,
|
|
9
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
10
|
-
})));
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (${n}.value === undefined) {
|
|
15
|
-
if (${o} in input) {
|
|
16
|
-
newResult[${o}] = undefined;
|
|
17
|
-
}
|
|
18
|
-
} else {
|
|
19
|
-
newResult[${o}] = ${n}.value;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
`):c?t.write(`
|
|
23
|
-
if (${n}.issues.length) {
|
|
24
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
25
|
-
...iss,
|
|
26
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
27
|
-
})));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (${n}.value === undefined) {
|
|
31
|
-
if (${o} in input) {
|
|
32
|
-
newResult[${o}] = undefined;
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
newResult[${o}] = ${n}.value;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
`):t.write(`
|
|
39
|
-
const ${n}_present = ${o} in input;
|
|
40
|
-
if (${n}.issues.length) {
|
|
41
|
-
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
42
|
-
...iss,
|
|
43
|
-
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
44
|
-
})));
|
|
45
|
-
}
|
|
46
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
47
|
-
payload.issues.push({
|
|
48
|
-
code: "invalid_type",
|
|
49
|
-
expected: "nonoptional",
|
|
50
|
-
input: undefined,
|
|
51
|
-
path: [${o}]
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
if (${n}_present) {
|
|
56
|
-
if (${n}.value === undefined) {
|
|
57
|
-
newResult[${o}] = undefined;
|
|
58
|
-
} else {
|
|
59
|
-
newResult[${o}] = ${n}.value;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=S,s=!d.jitless,c=s&&ie.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?_n([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function bn(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!O(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>A(e,r,f())))}),t)}const xn=c(`$ZodUnion`,(e,t)=>{N.init(e,t),y(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),y(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),y(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),y(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>_(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>bn(t,r,e,i)):bn(o,r,e,i)}}),Sn=c(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,xn.init(e,t);let n=e._zod.parse;y(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=h(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!S(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),Cn=c(`$ZodIntersection`,(e,t)=>{N.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Tn(e,t,n)):Tn(e,i,a)}});function wn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(C(e)&&C(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=wn(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=wn(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Tn(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),O(e))return e;let o=wn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const En=c(`$ZodRecord`,(e,t)=>{N.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!C(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>A(e,r,f())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...k(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...k(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ut.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>A(e,r,f())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...k(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...k(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Dn=c(`$ZodEnum`,(e,t)=>{N.init(e,t);let n=p(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>ae.has(typeof e)).map(e=>typeof e==`string`?T(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),On=c(`$ZodLiteral`,(e,t)=>{if(N.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?T(e):e?T(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),kn=c(`$ZodTransform`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new u(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new l;return n.value=i,n.fallback=!0,n}});function An(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const jn=c(`$ZodOptional`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,y(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),y(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${_(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>An(e,r)):An(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Mn=c(`$ZodExactOptional`,(e,t)=>{jn.init(e,t),y(e._zod,`values`,()=>t.innerType._zod.values),y(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Nn=c(`$ZodNullable`,(e,t)=>{N.init(e,t),y(e._zod,`optin`,()=>t.innerType._zod.optin),y(e._zod,`optout`,()=>t.innerType._zod.optout),y(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${_(e.source)}|null)$`):void 0}),y(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Pn=c(`$ZodDefault`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,y(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fn(e,t)):Fn(r,t)}});function Fn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const In=c(`$ZodPrefault`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,y(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ln=c(`$ZodNonOptional`,(e,t)=>{N.init(e,t),y(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Rn(t,e)):Rn(i,e)}});function Rn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}const zn=c(`$ZodCatch`,(e,t)=>{N.init(e,t),e._zod.optin=`optional`,y(e._zod,`optout`,()=>t.innerType._zod.optout),y(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>A(e,n,f()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>A(e,n,f()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Bn=c(`$ZodPipe`,(e,t)=>{N.init(e,t),y(e._zod,`values`,()=>t.in._zod.values),y(e._zod,`optin`,()=>t.in._zod.optin),y(e._zod,`optout`,()=>t.out._zod.optout),y(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Vn(e,t.in,n)):Vn(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Vn(e,t.out,n)):Vn(r,t.out,n)}});function Vn(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Hn=c(`$ZodReadonly`,(e,t)=>{N.init(e,t),y(e._zod,`propValues`,()=>t.innerType._zod.propValues),y(e._zod,`values`,()=>t.innerType._zod.values),y(e._zod,`optin`,()=>t.innerType?._zod?.optin),y(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Un):Un(r)}});function Un(e){return e.value=Object.freeze(e.value),e}const Wn=c(`$ZodTemplateLiteral`,(e,t)=>{N.init(e,t);let n=[];for(let e of t.parts)if(typeof e==`object`&&e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let r=+!!t.startsWith(`^`),i=t.endsWith(`$`)?t.length-1:t.length;n.push(t.slice(r,i))}else if(e===null||oe.has(typeof e))n.push(T(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join(``)}$`),e._zod.parse=(n,r)=>typeof n.value==`string`?(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:`invalid_format`,format:t.format??`template_literal`,pattern:e._zod.pattern.source}),n):(n.issues.push({input:n.value,inst:e,expected:`string`,code:`invalid_type`}),n)}),Gn=c(`$ZodLazy`,(e,t)=>{N.init(e,t),y(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),y(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),y(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),y(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),y(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Kn=c(`$ZodCustom`,(e,t)=>{M.init(e,t),N.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>qn(t,n,r,e));qn(i,n,r,e)}});function qn(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(j(e))}}var Jn,Yn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Xn(){return new Yn}(Jn=globalThis).__zod_globalRegistry??(Jn.__zod_globalRegistry=Xn());const Zn=globalThis.__zod_globalRegistry;function Qn(e,t){return new e({type:`string`,...D(t)})}function $n(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...D(t)})}function er(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...D(t)})}function tr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...D(t)})}function nr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...D(t)})}function rr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...D(t)})}function ir(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...D(t)})}function ar(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...D(t)})}function or(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...D(t)})}function sr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...D(t)})}function cr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...D(t)})}function lr(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...D(t)})}function ur(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...D(t)})}function dr(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...D(t)})}function fr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...D(t)})}function pr(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...D(t)})}function mr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...D(t)})}function hr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...D(t)})}function gr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...D(t)})}function _r(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...D(t)})}function vr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...D(t)})}function yr(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...D(t)})}function br(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...D(t)})}function xr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...D(t)})}function Sr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...D(t)})}function Cr(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...D(t)})}function wr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...D(t)})}function Tr(e,t){return new e({type:`number`,checks:[],...D(t)})}function Er(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...D(t)})}function Dr(e,t){return new e({type:`boolean`,...D(t)})}function Or(e,t){return new e({type:`null`,...D(t)})}function kr(e){return new e({type:`unknown`})}function Ar(e,t){return new e({type:`never`,...D(t)})}function jr(e,t){return new gt({check:`less_than`,...D(t),value:e,inclusive:!1})}function Mr(e,t){return new gt({check:`less_than`,...D(t),value:e,inclusive:!0})}function Nr(e,t){return new _t({check:`greater_than`,...D(t),value:e,inclusive:!1})}function Pr(e,t){return new _t({check:`greater_than`,...D(t),value:e,inclusive:!0})}function Fr(e,t){return new vt({check:`multiple_of`,...D(t),value:e})}function Ir(e,t){return new bt({check:`max_length`,...D(t),maximum:e})}function Lr(e,t){return new xt({check:`min_length`,...D(t),minimum:e})}function Rr(e,t){return new St({check:`length_equals`,...D(t),length:e})}function zr(e,t){return new wt({check:`string_format`,format:`regex`,...D(t),pattern:e})}function Br(e){return new Tt({check:`string_format`,format:`lowercase`,...D(e)})}function Vr(e){return new Et({check:`string_format`,format:`uppercase`,...D(e)})}function Hr(e,t){return new Dt({check:`string_format`,format:`includes`,...D(t),includes:e})}function Ur(e,t){return new Ot({check:`string_format`,format:`starts_with`,...D(t),prefix:e})}function Wr(e,t){return new kt({check:`string_format`,format:`ends_with`,...D(t),suffix:e})}function F(e){return new At({check:`overwrite`,tx:e})}function Gr(e){return F(t=>t.normalize(e))}function Kr(){return F(e=>e.trim())}function qr(){return F(e=>e.toLowerCase())}function Jr(){return F(e=>e.toUpperCase())}function Yr(){return F(e=>ne(e))}function Xr(e,t,n){return new e({type:`array`,element:t,...D(n)})}function Zr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...D(n)})}function Qr(e,t){let n=$r(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(j(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(j(r))}},e(t.value,t)),t);return n}function $r(e,t){let n=new M({check:`custom`,...D(t)});return n._zod.check=e,n}function ei(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Zn,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function I(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,I(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&L(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ti(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
64
|
-
|
|
65
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function ni(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:ii(t,`input`,e.processors),output:ii(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function L(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return L(r.element,n);if(r.type===`set`)return L(r.valueType,n);if(r.type===`lazy`)return L(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return L(r.innerType,n);if(r.type===`intersection`)return L(r.left,n)||L(r.right,n);if(r.type===`record`||r.type===`map`)return L(r.keyType,n)||L(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:L(r.in,n)||L(r.out,n);if(r.type===`object`){for(let e in r.shape)if(L(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(L(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(L(e,n))return!0;return!!(r.rest&&L(r.rest,n))}return!1}const ri=(e,t={})=>n=>{let r=ei({...n,processors:t});return I(e,r),ti(r,e),ni(r,e)},ii=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ei({...i??{},target:a,io:t,processors:n});return I(e,o),ti(o,e),ni(o,e)},ai={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},oi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ai[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},si=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},ci=(e,t,n,r)=>{n.type=`boolean`},li=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},ui=(e,t,n,r)=>{n.not={}},di=(e,t,n,r)=>{let i=e._zod.def,a=p(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},fi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},pi=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},mi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},hi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},gi=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=I(a.element,t,{...r,path:[...r.path,`items`]})},_i=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=I(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=I(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},vi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>I(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},yi=(e,t,n,r)=>{let i=e._zod.def,a=I(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=I(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},bi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=I(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=I(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=I(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},xi=(e,t,n,r)=>{let i=e._zod.def,a=I(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Si=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ci=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},wi=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ti=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ei=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;I(o,t,r);let s=t.seen.get(e);s.ref=o},Di=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Oi=(e,t,n,r)=>{let i=e._zod.def;I(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ki=(e,t,n,r)=>{let i=e._zod.innerType;I(i,t,r);let a=t.seen.get(e);a.ref=i},Ai=c(`ZodISODateTime`,(e,t)=>{Gt.init(e,t),V.init(e,t)});function ji(e){return xr(Ai,e)}const Mi=c(`ZodISODate`,(e,t)=>{Kt.init(e,t),V.init(e,t)});function Ni(e){return Sr(Mi,e)}const Pi=c(`ZodISOTime`,(e,t)=>{qt.init(e,t),V.init(e,t)});function Fi(e){return Cr(Pi,e)}const Ii=c(`ZodISODuration`,(e,t)=>{Jt.init(e,t),V.init(e,t)});function Li(e){return wr(Ii,e)}const R=c(`ZodError`,(e,t)=>{be.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Ce(e,t)},flatten:{value:t=>Se(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,m,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,m,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ri=we(R),zi=Te(R),Bi=Ee(R),Vi=Oe(R),Hi=Ae(R),Ui=je(R),Wi=Me(R),Gi=Ne(R),Ki=Pe(R),qi=Fe(R),Ji=Ie(R),Yi=Le(R),Xi=new WeakMap;function Zi(e,t,n){let r=Object.getPrototypeOf(e),i=Xi.get(r);if(i||(i=new Set,Xi.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const z=c(`ZodType`,(e,t)=>(N.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:ii(e,`input`),output:ii(e,`output`)}}),e.toJSONSchema=ri(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.parse=(t,n)=>Ri(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Bi(e,t,n),e.parseAsync=async(t,n)=>zi(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Vi(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Hi(e,t,n),e.decode=(t,n)=>Ui(e,t,n),e.encodeAsync=async(t,n)=>Wi(e,t,n),e.decodeAsync=async(t,n)=>Gi(e,t,n),e.safeEncode=(t,n)=>Ki(e,t,n),e.safeDecode=(t,n)=>qi(e,t,n),e.safeEncodeAsync=async(t,n)=>Ji(e,t,n),e.safeDecodeAsync=async(t,n)=>Yi(e,t,n),Zi(e,`ZodType`,{check(...e){let t=this.def;return this.clone(x(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return E(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fo(e,t))},superRefine(e,t){return this.check(po(e,t))},overwrite(e){return this.check(F(e))},optional(){return Ua(this)},exactOptional(){return Ga(this)},nullable(){return qa(this)},nullish(){return Ua(qa(this))},nonoptional(e){return $a(this,e)},array(){return G(this)},or(e){return q([this,e])},and(e){return Ia(this,e)},transform(e){return ro(this,Va(e))},default(e){return Ya(this,e)},prefault(e){return Za(this,e)},catch(e){return to(this,e)},pipe(e){return ro(this,e)},readonly(){return ao(this)},describe(e){let t=this.clone();return Zn.add(t,{description:e}),t},meta(...e){if(e.length===0)return Zn.get(this);let t=this.clone();return Zn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,`description`,{get(){return Zn.get(e)?.description},configurable:!0}),e)),Qi=c(`_ZodString`,(e,t)=>{Nt.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Zi(e,`_ZodString`,{regex(...e){return this.check(zr(...e))},includes(...e){return this.check(Hr(...e))},startsWith(...e){return this.check(Ur(...e))},endsWith(...e){return this.check(Wr(...e))},min(...e){return this.check(Lr(...e))},max(...e){return this.check(Ir(...e))},length(...e){return this.check(Rr(...e))},nonempty(...e){return this.check(Lr(1,...e))},lowercase(e){return this.check(Br(e))},uppercase(e){return this.check(Vr(e))},trim(){return this.check(Kr())},normalize(...e){return this.check(Gr(...e))},toLowerCase(){return this.check(qr())},toUpperCase(){return this.check(Jr())},slugify(){return this.check(Yr())}})}),$i=c(`ZodString`,(e,t)=>{Nt.init(e,t),Qi.init(e,t),e.email=t=>e.check($n(ea,t)),e.url=t=>e.check(ar(ra,t)),e.jwt=t=>e.check(br(va,t)),e.emoji=t=>e.check(or(ia,t)),e.guid=t=>e.check(er(ta,t)),e.uuid=t=>e.check(tr(na,t)),e.uuidv4=t=>e.check(nr(na,t)),e.uuidv6=t=>e.check(rr(na,t)),e.uuidv7=t=>e.check(ir(na,t)),e.nanoid=t=>e.check(sr(aa,t)),e.guid=t=>e.check(er(ta,t)),e.cuid=t=>e.check(cr(oa,t)),e.cuid2=t=>e.check(lr(sa,t)),e.ulid=t=>e.check(ur(ca,t)),e.base64=t=>e.check(_r(ha,t)),e.base64url=t=>e.check(vr(ga,t)),e.xid=t=>e.check(dr(la,t)),e.ksuid=t=>e.check(fr(ua,t)),e.ipv4=t=>e.check(pr(da,t)),e.ipv6=t=>e.check(mr(fa,t)),e.cidrv4=t=>e.check(hr(pa,t)),e.cidrv6=t=>e.check(gr(ma,t)),e.e164=t=>e.check(yr(_a,t)),e.datetime=t=>e.check(ji(t)),e.date=t=>e.check(Ni(t)),e.time=t=>e.check(Fi(t)),e.duration=t=>e.check(Li(t))});function B(e){return Qn($i,e)}const V=c(`ZodStringFormat`,(e,t)=>{P.init(e,t),Qi.init(e,t)}),ea=c(`ZodEmail`,(e,t)=>{It.init(e,t),V.init(e,t)}),ta=c(`ZodGUID`,(e,t)=>{Pt.init(e,t),V.init(e,t)}),na=c(`ZodUUID`,(e,t)=>{Ft.init(e,t),V.init(e,t)}),ra=c(`ZodURL`,(e,t)=>{Lt.init(e,t),V.init(e,t)}),ia=c(`ZodEmoji`,(e,t)=>{Rt.init(e,t),V.init(e,t)}),aa=c(`ZodNanoID`,(e,t)=>{zt.init(e,t),V.init(e,t)}),oa=c(`ZodCUID`,(e,t)=>{Bt.init(e,t),V.init(e,t)}),sa=c(`ZodCUID2`,(e,t)=>{Vt.init(e,t),V.init(e,t)}),ca=c(`ZodULID`,(e,t)=>{Ht.init(e,t),V.init(e,t)}),la=c(`ZodXID`,(e,t)=>{Ut.init(e,t),V.init(e,t)}),ua=c(`ZodKSUID`,(e,t)=>{Wt.init(e,t),V.init(e,t)}),da=c(`ZodIPv4`,(e,t)=>{Yt.init(e,t),V.init(e,t)}),fa=c(`ZodIPv6`,(e,t)=>{Xt.init(e,t),V.init(e,t)}),pa=c(`ZodCIDRv4`,(e,t)=>{Zt.init(e,t),V.init(e,t)}),ma=c(`ZodCIDRv6`,(e,t)=>{Qt.init(e,t),V.init(e,t)}),ha=c(`ZodBase64`,(e,t)=>{en.init(e,t),V.init(e,t)}),ga=c(`ZodBase64URL`,(e,t)=>{nn.init(e,t),V.init(e,t)}),_a=c(`ZodE164`,(e,t)=>{rn.init(e,t),V.init(e,t)}),va=c(`ZodJWT`,(e,t)=>{on.init(e,t),V.init(e,t)}),ya=c(`ZodNumber`,(e,t)=>{sn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>si(e,t,n,r),Zi(e,`ZodNumber`,{gt(e,t){return this.check(Nr(e,t))},gte(e,t){return this.check(Pr(e,t))},min(e,t){return this.check(Pr(e,t))},lt(e,t){return this.check(jr(e,t))},lte(e,t){return this.check(Mr(e,t))},max(e,t){return this.check(Mr(e,t))},int(e){return this.check(xa(e))},safe(e){return this.check(xa(e))},positive(e){return this.check(Nr(0,e))},nonnegative(e){return this.check(Pr(0,e))},negative(e){return this.check(jr(0,e))},nonpositive(e){return this.check(Mr(0,e))},multipleOf(e,t){return this.check(Fr(e,t))},step(e,t){return this.check(Fr(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function H(e){return Tr(ya,e)}const ba=c(`ZodNumberFormat`,(e,t)=>{cn.init(e,t),ya.init(e,t)});function xa(e){return Er(ba,e)}const Sa=c(`ZodBoolean`,(e,t)=>{ln.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ci(e,t,n,r)});function U(e){return Dr(Sa,e)}const Ca=c(`ZodNull`,(e,t)=>{un.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>li(e,t,n,r)});function wa(e){return Or(Ca,e)}const Ta=c(`ZodUnknown`,(e,t)=>{dn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function W(){return kr(Ta)}const Ea=c(`ZodNever`,(e,t)=>{fn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ui(e,t,n,r)});function Da(e){return Ar(Ea,e)}const Oa=c(`ZodArray`,(e,t)=>{mn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gi(e,t,n,r),e.element=t.element,Zi(e,`ZodArray`,{min(e,t){return this.check(Lr(e,t))},nonempty(e){return this.check(Lr(1,e))},max(e,t){return this.check(Ir(e,t))},length(e,t){return this.check(Rr(e,t))},unwrap(){return this.element}})});function G(e,t){return Xr(Oa,e,t)}const ka=c(`ZodObject`,(e,t)=>{yn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_i(e,t,n,r),y(e,`shape`,()=>t.shape),Zi(e,`ZodObject`,{keyof(){return Y(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:W()})},loose(){return this.clone({...this._zod.def,catchall:W()})},strict(){return this.clone({...this._zod.def,catchall:Da()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return de(this,e)},safeExtend(e){return fe(this,e)},merge(e){return pe(this,e)},pick(e){return le(this,e)},omit(e){return ue(this,e)},partial(...e){return me(Ha,this,e[0])},required(...e){return he(Qa,this,e[0])}})});function Aa(e,t){return new ka({type:`object`,shape:e??{},...D(t)})}function K(e,t){return new ka({type:`object`,shape:e,catchall:Da(),...D(t)})}function ja(e,t){return new ka({type:`object`,shape:e,catchall:W(),...D(t)})}const Ma=c(`ZodUnion`,(e,t)=>{xn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vi(e,t,n,r),e.options=t.options});function q(e,t){return new Ma({type:`union`,options:e,...D(t)})}const Na=c(`ZodDiscriminatedUnion`,(e,t)=>{Ma.init(e,t),Sn.init(e,t)});function Pa(e,t,n){return new Na({type:`union`,options:t,discriminator:e,...D(n)})}const Fa=c(`ZodIntersection`,(e,t)=>{Cn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yi(e,t,n,r)});function Ia(e,t){return new Fa({type:`intersection`,left:e,right:t})}const La=c(`ZodRecord`,(e,t)=>{En.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function J(e,t,n){return!t||!t._zod?new La({type:`record`,keyType:B(),valueType:e,...D(t)}):new La({type:`record`,keyType:e,valueType:t,...D(n)})}const Ra=c(`ZodEnum`,(e,t)=>{Dn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>di(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ra({...t,checks:[],...D(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ra({...t,checks:[],...D(r),entries:i})}});function Y(e,t){return new Ra({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...D(t)})}const za=c(`ZodLiteral`,(e,t)=>{On.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fi(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function X(e,t){return new za({type:`literal`,values:Array.isArray(e)?e:[e],...D(t)})}const Ba=c(`ZodTransform`,(e,t)=>{kn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hi(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new u(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(j(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(j(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Va(e){return new Ba({type:`transform`,transform:e})}const Ha=c(`ZodOptional`,(e,t)=>{jn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ua(e){return new Ha({type:`optional`,innerType:e})}const Wa=c(`ZodExactOptional`,(e,t)=>{Mn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ga(e){return new Wa({type:`optional`,innerType:e})}const Ka=c(`ZodNullable`,(e,t)=>{Nn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function qa(e){return new Ka({type:`nullable`,innerType:e})}const Ja=c(`ZodDefault`,(e,t)=>{Pn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ci(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Ya(e,t){return new Ja({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():w(t)}})}const Xa=c(`ZodPrefault`,(e,t)=>{In.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Za(e,t){return new Xa({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():w(t)}})}const Qa=c(`ZodNonOptional`,(e,t)=>{Ln.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Si(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $a(e,t){return new Qa({type:`nonoptional`,innerType:e,...D(t)})}const eo=c(`ZodCatch`,(e,t)=>{zn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ti(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function to(e,t){return new eo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}const no=c(`ZodPipe`,(e,t)=>{Bn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ei(e,t,n,r),e.in=t.in,e.out=t.out});function ro(e,t){return new no({type:`pipe`,in:e,out:t})}const io=c(`ZodReadonly`,(e,t)=>{Hn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Di(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ao(e){return new io({type:`readonly`,innerType:e})}const oo=c(`ZodTemplateLiteral`,(e,t)=>{Wn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pi(e,t,n,r)});function so(e,t){return new oo({type:`template_literal`,parts:e,...D(t)})}const co=c(`ZodLazy`,(e,t)=>{Gn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function lo(e){return new co({type:`lazy`,getter:e})}const uo=c(`ZodCustom`,(e,t)=>{Kn.init(e,t),z.init(e,t),e._zod.processJSONSchema=(t,n,r)=>mi(e,t,n,r)});function fo(e,t={}){return Zr(uo,e,t)}function po(e,t){return Qr(e,t)}function mo(e){let t=lo(()=>q([B(e),H(),U(),wa(),G(t),J(B(),t)]));return t}var ho=e({AnalyticsEngineDatasetBindingSchema:()=>To,AssetsSchema:()=>vo,BindingSchema:()=>Ao,BrowserBindingSchema:()=>yo,ConfigExportsSchema:()=>as,D1BindingSchema:()=>xo,DurableObjectCreatedExportSchema:()=>Lo,DurableObjectDeletedExportSchema:()=>Ro,DurableObjectExpectingTransferExportSchema:()=>Vo,DurableObjectRenamedExportSchema:()=>zo,DurableObjectTransferredExportSchema:()=>Bo,ExportSchema:()=>Uo,FlagshipBindingSchema:()=>Eo,HyperdriveBindingSchema:()=>Do,InputSettingsSchema:()=>Qo,InputWorkerSchema:()=>Zo,KVBindingSchema:()=>So,KnownBindingSchema:()=>Oo,ModuleTypeSchema:()=>os,OutputSettingsSchema:()=>$o,OutputWorkerSchema:()=>ls,QueueBindingSchema:()=>Co,R2BindingSchema:()=>wo,TailConsumerSchema:()=>qo,UnsafeBindingSchema:()=>ko,WorkerBindingSchema:()=>bo,WorkerEntrypointExportSchema:()=>Ho,convertToWranglerConfig:()=>hs,loadAndValidateConfig:()=>Is,loadConfig:()=>As,registerConfigHooks:()=>Ms,resolveExportDefinition:()=>t,validateSingletonBindings:()=>Fo}),go=Object.getOwnPropertyNames,_o=(e,t)=>function(){return t||(0,e[go(e)[0]])((t={exports:{}}).exports,t),t.exports};const Z=K({remote:U().optional()}),vo=K({htmlHandling:Y([`auto-trailing-slash`,`drop-trailing-slash`,`force-trailing-slash`,`none`]).optional(),notFoundHandling:Y([`single-page-application`,`404-page`,`none`]).optional(),runWorkerFirst:q([G(B()),U()]).optional()}),yo=K({type:X(`browser`),dev:Z.optional()}),bo=K({type:X(`worker`),worker:B(),exportName:B().optional(),props:J(B(),W()).optional(),dev:Z.optional()}),xo=K({type:X(`d1`),name:B().optional(),id:B().optional(),dev:Z.optional()}),So=K({type:X(`kv`),id:B().optional(),dev:Z.optional()}),Co=K({type:X(`queue`),name:B().optional(),deliveryDelay:H().optional(),dev:Z.optional()}),wo=K({type:X(`r2`),name:B().optional(),jurisdiction:B().optional(),dev:Z.extend({experimentalS3Credentials:Aa({accessKeyId:B(),secretAccessKey:B()}).optional()}).optional()}),To=K({type:X(`analytics-engine-dataset`),name:B().optional()}),Eo=K({type:X(`flagship`),id:B().optional(),dev:Z.optional()}),Do=K({type:X(`hyperdrive`),id:B(),dev:K({connectionString:B().optional()}).optional()}),Oo=Pa(`type`,[K({type:X(`agent-memory`),namespace:B(),dev:Z.optional()}),K({type:X(`ai`),dev:Z.optional()}),K({type:X(`ai-search`),name:B(),dev:Z.optional()}),K({type:X(`ai-search-namespace`),namespace:B(),dev:Z.optional()}),To,K({type:X(`artifacts`),namespace:B(),dev:Z.optional()}),K({type:X(`assets`)}),yo,xo,K({type:X(`dispatch-namespace`),namespace:B().optional(),outbound:K({worker:B(),parameters:G(B()).optional()}).optional(),dev:Z.optional()}),K({type:X(`durable-object`),worker:B(),exportName:B()}),Eo,Do,K({type:X(`images`),dev:Z.optional()}),K({type:X(`json`),value:mo()}),So,K({type:X(`logfwdr`),destination:B()}),K({type:X(`media`),dev:Z.optional()}),K({type:X(`mtls-certificate`),id:B(),dev:Z.optional()}),K({type:X(`pipeline`),name:B(),dev:Z.optional()}),Co,K({type:X(`rate-limit`),namespace:B(),simple:K({limit:H(),period:q([X(10),X(60)])})}),wo,K({type:X(`secret`)}),K({type:X(`secrets-store-secret`),storeId:B(),secretName:B()}),K({type:X(`send-email`),destinationAddress:B().optional(),allowedDestinationAddresses:G(B()).optional(),allowedSenderAddresses:G(B()).optional(),dev:Z.optional()}).refine(e=>e.destinationAddress===void 0||e.allowedDestinationAddresses===void 0,{message:`"send-email" bindings cannot specify both "destinationAddress" and "allowedDestinationAddresses"`}),K({type:X(`stream`),dev:Z.optional()}),K({type:X(`text`),value:B()}),K({type:X(`vectorize`),name:B(),dev:Z.optional()}),K({type:X(`version-metadata`)}),K({type:X(`vpc-service`),id:B(),dev:Z.optional()}),K({type:X(`vpc-network`),tunnelId:B().optional(),networkId:B().optional(),dev:Z.optional()}).refine(e=>e.tunnelId!==void 0!=(e.networkId!==void 0),{error:({input:e})=>{let t=e;return t.tunnelId!==void 0&&t.networkId!==void 0?`"vpc-network" bindings must specify exactly one of "tunnelId" or "networkId", not both`:`"vpc-network" bindings must specify either "tunnelId" or "networkId"`}}),K({type:X(`web-search`),dev:Z.optional()}),bo,K({type:X(`worker-loader`)})]),ko=ja({type:so([`unsafe:`,B().min(1)]),dev:K({plugin:K({package:B(),name:B()}),options:J(B(),W()).optional()}).optional()}),Ao=W().transform((e,t)=>{let n=(typeof e==`object`&&e&&`type`in e&&typeof e.type==`string`&&e.type.startsWith(`unsafe:`)?ko:Oo).safeParse(e);return n.success?n.data:(t.issues.push(...n.error.issues),s)});function jo(e){return e.type.startsWith(`unsafe:`)}const Mo=K({enabled:U(),crossVersionCache:U().optional()}),No=new Set([`ai`,`assets`,`browser`,`images`,`media`,`stream`,`version-metadata`,`web-search`]),Po=new Intl.ListFormat(`en-US`);function Fo(e,t){let n=new Set,r=new Set;for(let t of Object.values(e)){let e=t.type;No.has(e)&&(n.has(e)&&r.add(e),n.add(e))}r.size>0&&t.addIssue({code:`custom`,message:`${Po.format([...r].sort())} bindings can only be defined once`})}const Io=J(B(),Ao).superRefine(Fo).optional(),Lo=K({type:X(`durable-object`),state:X(`created`).optional(),storage:Y([`sqlite`,`legacy-kv`]),container:B().optional()}),Ro=K({type:X(`durable-object`),state:X(`deleted`)}),zo=K({type:X(`durable-object`),state:X(`renamed`),renamedTo:B()}),Bo=K({type:X(`durable-object`),state:X(`transferred`),transferredTo:B()}),Vo=K({type:X(`durable-object`),state:X(`expecting-transfer`),storage:Y([`sqlite`,`legacy-kv`]),transferFrom:B(),container:B().optional()}),Ho=K({type:X(`worker`),cache:K({enabled:U()}).optional()}),Uo=q([Lo.extend({storage:X(`sqlite`)}),Lo.omit({container:!0}).extend({storage:X(`legacy-kv`)}),Ro,zo,Bo,Vo.extend({storage:X(`sqlite`)}),Vo.omit({container:!0}).extend({storage:X(`legacy-kv`)}),Ho]),Wo=K({cpuMs:H().optional(),subrequests:H().optional()}),Go=K({enabled:U().optional(),headSamplingRate:H().optional(),redactQueryString:U().optional(),logs:K({enabled:U().optional(),headSamplingRate:H().optional(),invocationLogs:U().optional(),persist:U().optional(),destinations:G(B()).optional()}).optional(),traces:K({enabled:U().optional(),headSamplingRate:H().optional(),persist:U().optional(),destinations:G(B()).optional()}).optional()}),Ko=q([K({mode:Y([`off`,`smart`]),hint:B().optional()}),K({mode:X(`targeted`).optional(),region:B()}),K({mode:X(`targeted`).optional(),host:B()}),K({mode:X(`targeted`).optional(),hostname:B()})]),qo=K({worker:B(),streaming:U().optional()}),Jo=Pa(`type`,[K({type:X(`email`),addresses:G(B())}),K({type:X(`fetch`),pattern:B(),zone:B().optional()}),K({type:X(`queue`),name:B(),deadLetterQueue:B().optional(),maxBatchSize:H().optional(),maxBatchTimeout:H().optional(),maxConcurrency:H().nullable().optional(),maxRetries:H().optional(),retryDelay:H().optional(),visibilityTimeoutMs:H().optional()}),K({type:X(`scheduled`),schedule:B()}),K({type:X(`connect`),protocol:Y([`tcp`]),port:H(),address:B().optional()})]),Yo=K({metadata:J(B(),W()).optional(),capnp:q([K({basePath:B(),sourceSchemas:G(B()),compiledSchema:Da().optional()}),K({basePath:Da().optional(),sourceSchemas:Da().optional(),compiledSchema:B()})]).optional()}),Xo=K({type:X(`worker`),name:B(),compatibilityDate:B(),compatibilityFlags:G(B()).optional(),assets:vo.optional(),domains:G(B()).optional(),triggers:G(Jo).optional(),tailConsumers:G(qo).optional(),cache:Mo.optional(),placement:Ko.optional(),limits:Wo.optional(),logpush:U().optional(),observability:Go.optional(),workersDev:U().optional(),previewUrls:U().optional(),firstPartyWorker:U().optional(),unsafe:Yo.optional(),env:Io,exports:J(B(),Uo).optional()}),Zo=Xo.extend({entrypoint:q([B(),K({default:B()})]).transform(e=>typeof e==`string`?e:e.default).optional()}),Qo=K({type:X(`settings`),accountId:B().optional(),complianceRegion:Y([`public`,`fedramp-high`]).optional()}),$o=Qo.extend({mode:B().optional()}),es=`settings`,ts=new Set([`worker`,`settings`]);function ns(e){return`The \`${e}\` export is not a supported export type. Move constants, helper functions, and other unsupported exports to a separate module.`}const rs=J(B(),W()).check(e=>{for(let[t,n]of Object.entries(e.value)){let r=typeof n==`object`&&!!n,i=r&&`type`in n?n.type:void 0;if(typeof i!=`string`||!ts.has(i)){e.issues.push({code:`custom`,input:n,path:r?[t,`type`]:[t],message:ns(t)});continue}let a=t===es,o=i===`settings`;o&&!a?e.issues.push({code:`custom`,input:n,path:[t],message:`A \`settings\` config is only allowed on the \`${es}\` export; found one on the \`${t}\` export.`}):a&&!o&&e.issues.push({code:`custom`,input:n,path:[t],message:`The \`${es}\` export is reserved for a \`settings\` config; found a \`${i}\` config.`})}}),is=Aa({settings:Qo.optional()}).catchall(Zo),as=rs.pipe(is),os=Y([`esm`,`cjs`,`python`,`python-requirement`,`wasm`,`text`,`data`,`json`,`sourcemap`]),ss=J(B(),K({type:os})),cs=K({type:Y([`partial`,`complete`]),mainModule:B(),modules:ss}).superRefine((e,t)=>{let n=e.modules[e.mainModule];e.type===`complete`&&n===void 0&&t.addIssue({code:`custom`,path:[`modules`,e.mainModule],message:`A complete manifest must include its main module.`}),e.type===`partial`&&n!==void 0&&t.addIssue({code:`custom`,path:[`modules`,e.mainModule],message:`A partial manifest must not include its main module.`})}),ls=Xo.extend({manifest:cs.optional()});_o({"../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/dist/index.js":(e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.dedent=void 0;function t(e){var t=[...arguments].slice(1),n=Array.from(typeof e==`string`?[e]:e);n[n.length-1]=n[n.length-1].replace(/\r?\n([\t ]*)$/,``);var r=n.reduce(function(e,t){var n=t.match(/\n([\t ]+|(?!\s).)/g);return n?e.concat(n.map(function(e){return e.match(/[\t ]/g)?.length??0})):e},[]);if(r.length){var i=RegExp(`
|
|
66
|
-
[ ]{`+Math.min.apply(Math,r)+`}`,`g`);n=n.map(function(e){return e.replace(i,`
|
|
67
|
-
`)})}n[0]=n[0].replace(/^\r?\n/,``);var a=n[0];return t.forEach(function(e,t){var r=a.match(/(?:^|\n)( *)$/),i=r?r[1]:``,o=e;typeof e==`string`&&e.includes(`
|
|
68
|
-
`)&&(o=String(e).split(`
|
|
69
|
-
`).map(function(e,t){return t===0?e:``+i+e}).join(`
|
|
70
|
-
`)),a+=o+n[t+1]}),a}e.dedent=t})})();var us=Object.defineProperty,Q=(e,t)=>us(e,`name`,{value:t,configurable:!0}),ds=class extends Error{static{Q(this,`UserError`)}telemetryMessage;constructor(e,t){super(e,t),Object.setPrototypeOf(this,new.target.prototype),this.telemetryMessage=typeof t?.telemetryMessage==`string`?t.telemetryMessage:t?.telemetryMessage?e:void 0}};(class extends ds{static{Q(this,`DeprecationError`)}constructor(e,t){super(`Deprecation:
|
|
71
|
-
${e}`,t)}});var fs=class extends ds{static{Q(this,`FatalError`)}code;constructor(e,t){super(e,t),this.code=t.code}};(class extends ds{static{Q(this,`CommandLineArgsError`)}});var ps=class extends fs{static{Q(this,`JsonFriendlyFatalError`)}};(class extends Error{static{Q(this,`MissingConfigError`)}telemetryMessage;constructor(e){super(`Missing config value for ${e}`),this.telemetryMessage=`Missing config value for ${e}`}});function ms(e,t,n){return t?new ps(JSON.stringify(e),n):new fs(`${e}`,n)}Q(ms,`createFatalError`);function hs(e,t){let n={};return _s(e,n),bs(e,n),xs(e,n),Cs(e,n),Ss(e,n),ws(e,n),t!==void 0&&gs(t,n),n}function gs(e,t){e.accountId!==void 0&&(t.account_id=e.accountId),e.complianceRegion!==void 0&&(t.compliance_region=e.complianceRegion===`fedramp-high`?`fedramp_high`:`public`)}function _s(e,t){if(e.name!==void 0&&(t.name=e.name),typeof e.entrypoint==`string`&&(t.main=e.entrypoint),e.compatibilityDate!==void 0&&(t.compatibility_date=e.compatibilityDate),e.compatibilityFlags!==void 0&&(t.compatibility_flags=e.compatibilityFlags),e.workersDev!==void 0&&(t.workers_dev=e.workersDev),e.previewUrls!==void 0&&(t.preview_urls=e.previewUrls),e.logpush!==void 0&&(t.logpush=e.logpush),e.firstPartyWorker!==void 0&&(t.first_party_worker=e.firstPartyWorker),e.placement!==void 0&&(t.placement=e.placement),e.limits!==void 0){let n={};e.limits.cpuMs!==void 0&&(n.cpu_ms=e.limits.cpuMs),e.limits.subrequests!==void 0&&(n.subrequests=e.limits.subrequests),t.limits=n}if(e.observability!==void 0&&(t.observability=vs(e.observability)),e.cache!==void 0){let n={enabled:e.cache.enabled};e.cache.crossVersionCache!==void 0&&(n.cross_version_cache=e.cache.crossVersionCache),t.cache=n}e.unsafe!==void 0&&(t.unsafe=ys(e.unsafe))}function vs(e){let t={};if(e.enabled!==void 0&&(t.enabled=e.enabled),e.headSamplingRate!==void 0&&(t.head_sampling_rate=e.headSamplingRate),e.redactQueryString!==void 0&&(t.redact_query_string=e.redactQueryString),e.logs!==void 0){let n={},{logs:r}=e;r.enabled!==void 0&&(n.enabled=r.enabled),r.headSamplingRate!==void 0&&(n.head_sampling_rate=r.headSamplingRate),r.invocationLogs!==void 0&&(n.invocation_logs=r.invocationLogs),r.persist!==void 0&&(n.persist=r.persist),r.destinations!==void 0&&(n.destinations=r.destinations),t.logs=n}if(e.traces!==void 0){let n={},{traces:r}=e;r.enabled!==void 0&&(n.enabled=r.enabled),r.headSamplingRate!==void 0&&(n.head_sampling_rate=r.headSamplingRate),r.persist!==void 0&&(n.persist=r.persist),r.destinations!==void 0&&(n.destinations=r.destinations),t.traces=n}return t}function ys(e){let t={};return e.metadata!==void 0&&(t.metadata=e.metadata),e.capnp!==void 0&&(`compiledSchema`in e.capnp&&e.capnp.compiledSchema?t.capnp={compiled_schema:e.capnp.compiledSchema}:`basePath`in e.capnp&&e.capnp.basePath&&(t.capnp={base_path:e.capnp.basePath,source_schemas:e.capnp.sourceSchemas??[]})),t}function bs(e,t){let n,r=e.env??{},i=[],a=[],o=[],s=[],c=[],l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=[],_=[],ee=[],v=[],y=[],b=[],x=[],te=[],ne=[],re=[],S=[],ie=[],C=[],w=[],ae={},oe=[];for(let[e,S]of Object.entries(r)){if(jo(S)){w.push({...S,name:e,type:S.type.slice(7)});continue}switch(S.type){case`agent-memory`:m.push($({binding:e,namespace:S.namespace,remote:S.dev?.remote}));break;case`ai`:t.ai=$({binding:e,remote:S.dev?.remote});break;case`ai-search`:f.push($({binding:e,instance_name:S.name,remote:S.dev?.remote}));break;case`ai-search-namespace`:p.push($({binding:e,namespace:S.namespace,remote:S.dev?.remote}));break;case`analytics-engine-dataset`:h.push($({binding:e,dataset:S.name}));break;case`artifacts`:g.push($({binding:e,namespace:S.namespace,remote:S.dev?.remote}));break;case`assets`:n=e;break;case`browser`:t.browser=$({binding:e,remote:S.dev?.remote});break;case`d1`:a.push($({binding:e,database_id:S.id,database_name:S.name,remote:S.dev?.remote}));break;case`dispatch-namespace`:{let t={binding:e,namespace:S.namespace};S.outbound&&(t.outbound=$({service:S.outbound.worker,parameters:S.outbound.parameters})),S.dev?.remote!==void 0&&(t.remote=S.dev.remote),_.push(t);break}case`durable-object`:re.push({name:e,class_name:S.exportName,script_name:S.worker});break;case`flagship`:d.push($({binding:e,app_id:S.id,remote:S.dev?.remote}));break;case`hyperdrive`:l.push($({binding:e,id:S.id,localConnectionString:S.dev?.connectionString}));break;case`images`:t.images=$({binding:e,remote:S.dev?.remote});break;case`json`:ae[e]=S.value;break;case`kv`:i.push($({binding:e,id:S.id,remote:S.dev?.remote}));break;case`logfwdr`:C.push({name:e,destination:S.destination});break;case`media`:t.media=$({binding:e,remote:S.dev?.remote});break;case`mtls-certificate`:c.push($({binding:e,certificate_id:S.id,remote:S.dev?.remote}));break;case`pipeline`:u.push($({binding:e,stream:S.name,remote:S.dev?.remote}));break;case`queue`:ie.push($({binding:e,queue:S.name,delivery_delay:S.deliveryDelay,remote:S.dev?.remote}));break;case`rate-limit`:te.push({name:e,namespace_id:S.namespace,simple:S.simple});break;case`r2`:{let t=S.dev?.experimentalS3Credentials;o.push($({binding:e,bucket_name:S.name,jurisdiction:S.jurisdiction,remote:S.dev?.remote,local_dev:t===void 0?void 0:{experimental_s3_credentials:t}}));break}case`secret`:oe.push(e);break;case`secrets-store-secret`:ee.push({binding:e,store_id:S.storeId,secret_name:S.secretName});break;case`send-email`:v.push($({name:e,destination_address:S.destinationAddress,allowed_destination_addresses:S.allowedDestinationAddresses,allowed_sender_addresses:S.allowedSenderAddresses,remote:S.dev?.remote}));break;case`stream`:t.stream=$({binding:e,remote:S.dev?.remote});break;case`text`:ae[e]=S.value;break;case`vectorize`:s.push($({binding:e,index_name:S.name,remote:S.dev?.remote}));break;case`version-metadata`:t.version_metadata={binding:e};break;case`vpc-service`:y.push($({binding:e,service_id:S.id,remote:S.dev?.remote}));break;case`vpc-network`:S.tunnelId===void 0?S.networkId!==void 0&&b.push($({binding:e,network_id:S.networkId,remote:S.dev?.remote})):b.push($({binding:e,tunnel_id:S.tunnelId,remote:S.dev?.remote}));break;case`web-search`:t.websearch=$({binding:e,remote:S.dev?.remote});break;case`worker`:ne.push($({binding:e,service:S.worker,entrypoint:S.exportName,props:S.props,remote:S.dev?.remote}));break;case`worker-loader`:x.push({binding:e});break}}if(i.length&&(t.kv_namespaces=i),a.length&&(t.d1_databases=a),o.length&&(t.r2_buckets=o),s.length&&(t.vectorize=s),c.length&&(t.mtls_certificates=c),l.length&&(t.hyperdrive=l),u.length&&(t.pipelines=u),d.length&&(t.flagship=d),f.length&&(t.ai_search=f),p.length&&(t.ai_search_namespaces=p),m.length&&(t.agent_memory=m),h.length&&(t.analytics_engine_datasets=h),g.length&&(t.artifacts=g),_.length&&(t.dispatch_namespaces=_),ee.length&&(t.secrets_store_secrets=ee),v.length&&(t.send_email=v),y.length&&(t.vpc_services=y),b.length&&(t.vpc_networks=b),x.length&&(t.worker_loaders=x),te.length&&(t.ratelimits=te),ne.length&&(t.services=ne),re.length&&(t.durable_objects={bindings:re}),S.length&&(t.workflows=S),ie.length&&(t.queues={...t.queues??{},producers:ie}),C.length&&(t.logfwdr={bindings:C}),w.length&&(t.unsafe={...t.unsafe??{},bindings:w}),Object.keys(ae).length&&(t.vars=ae),oe.length&&(t.secrets={required:oe}),e.assets!==void 0||n!==void 0){let r={};n!==void 0&&(r.binding=n),e.assets?.htmlHandling!==void 0&&(r.html_handling=e.assets.htmlHandling),e.assets?.notFoundHandling!==void 0&&(r.not_found_handling=e.assets.notFoundHandling),e.assets?.runWorkerFirst!==void 0&&(r.run_worker_first=e.assets.runWorkerFirst),t.assets=r}}function xs(e,t){let n=e.exports;if(!n)return;let r={},i={};for(let[e,t]of Object.entries(n)){if(t.type===`worker`){r[e]=t;continue}if(t.type!==`durable-object`){i[e]=t;continue}switch(t.state){case void 0:case`created`:r[e]={type:`durable-object`,storage:t.storage,...t.storage===`sqlite`&&t.container!==void 0&&{container:t.container}};break;case`deleted`:r[e]={type:`durable-object`,state:`deleted`};break;case`renamed`:r[e]={type:`durable-object`,state:`renamed`,renamed_to:t.renamedTo};break;case`transferred`:r[e]={type:`durable-object`,state:`transferred`,transferred_to:t.transferredTo};break;case`expecting-transfer`:r[e]={type:`durable-object`,state:`expecting-transfer`,storage:t.storage,transfer_from:t.transferFrom,...t.storage===`sqlite`&&t.container!==void 0&&{container:t.container}};break}}if(Object.keys(i).length>0)throw new ds(`Unknown export types found: `+Object.entries(i).map(([e,{type:t}])=>`- ${e} : ${t}`).join(`
|
|
72
|
-
`),{telemetryMessage:`Unknown export types found`});Object.keys(r).length>0&&(t.exports=r)}function Ss(e,t){let n=e.triggers;if(!n||n.length===0)return;let r=[],i=t.routes?[...t.routes]:[],a=t.queues?.consumers?[...t.queues.consumers]:[],o=t.connect?[...t.connect]:[],s;for(let e of n)switch(e.type){case`email`:s??=[],s.push(...e.addresses);break;case`scheduled`:r.push(e.schedule);break;case`fetch`:e.zone===void 0?i.push(e.pattern):e.zone.includes(`.`)?i.push({pattern:e.pattern,zone_name:e.zone}):i.push({pattern:e.pattern,zone_id:e.zone});break;case`queue`:a.push($({queue:e.name,dead_letter_queue:e.deadLetterQueue,max_batch_size:e.maxBatchSize,max_batch_timeout:e.maxBatchTimeout,max_concurrency:e.maxConcurrency,max_retries:e.maxRetries,retry_delay:e.retryDelay,visibility_timeout_ms:e.visibilityTimeoutMs}));break;case`connect`:o.push($({protocol:e.protocol,port:e.port,address:e.address}));break}r.length&&(t.triggers={crons:r}),i.length&&(t.routes=i),a.length&&(t.queues={...t.queues??{},consumers:a}),o.length&&(t.connect=o),s!==void 0&&(t.addresses=s)}function Cs(e,t){if(!e.domains||e.domains.length===0)return;let n=t.routes?[...t.routes]:[];for(let t of e.domains)n.push({pattern:t,custom_domain:!0});t.routes=n}function ws(e,t){let n=e.tailConsumers;if(!n||n.length===0)return;let r=[],i=[];for(let e of n)e.streaming?i.push({service:e.worker}):r.push({service:e.worker});r.length&&(t.tail_consumers=r),i.length&&(t.streaming_tail_consumers=i)}function $(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}const Ts=`cf-worker:`,Es=`no-cache`,Ds=`cf-no-cache`,Os=/[/\\]node_modules[/\\]/,ks=new a;async function As(e,t){Ms();let n=i(e).href,r=new Set,a=await ks.run(r,()=>import(n,{with:{cf:Es}})),o={};for(let[e,n]of Object.entries(a))t?.include&&!t.include.includes(e)||(o[e]=n);return{exports:o,dependencies:r}}let js;function Ms(){if(js)return js;if(typeof process<`u`&&process.versions.bun)throw Error(`cloudflare.config.ts loading is not supported on Bun. Please use Node.js v22.18.0 or higher.`);let e=n.registerHooks;if(typeof e!=`function`)throw Error(`cloudflare.config.ts loading requires Node.js v22.18.0 or higher.`);let t=e({resolve(e,t,n){let i=t.importAttributes??{};if(i.type===`cf-worker`){let n=(e.startsWith(`./`)||e.startsWith(`../`))&&t.parentURL?r(new URL(e,t.parentURL)):e;return{url:`${Ts}${encodeURIComponent(n)}`,format:`module`,shortCircuit:!0}}let a=i.cf===Es,o=n(e,t);if(Os.test(o.url)||!o.url.startsWith(`file://`))return o;let s=Ns(t.parentURL);return!s&&!a?o:(ks.getStore()?.add(r(o.url)),o.url=Ps(o.url,s||crypto.randomUUID()),o)},load(e,t,n){if(e.startsWith(Ts)){let t=decodeURIComponent(e.slice(10));return{format:`module`,source:`export default ${JSON.stringify(t)};`,shortCircuit:!0}}return Fs(t),n(e,t)}});return js=()=>{t.deregister(),js=void 0},js}function Ns(e){if(e)return new URL(e).searchParams.get(Ds)??void 0}function Ps(e,t){let n=new URL(e);return n.searchParams.set(Ds,t),n.toString()}function Fs(e){if(!e.importAttributes?.cf)return;let t=Object.assign(Object.create(null),e.importAttributes);delete t.cf,e.importAttributes=t,Object.freeze(e.importAttributes)}async function Is(e,n,r){let{exports:i,dependencies:a}=await As(e,r),o={};for(let[e,r]of Object.entries(i))o[e]=await t(r,n);return{result:as.safeParse(o),dependencies:a}}export{ho as a,hs as i,$o as n,ls as r,Zo as t};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import{t as e}from"./local-D-aVNu6A.mjs";import{f as t,g as n}from"./oauth-B0ETkNcX.mjs";import{r}from"./auth-MQEamPN9.mjs";import{t as i}from"./output-DrpYYfnB.mjs";import{n as a,t as o}from"./progress-CsHIt3Tp.mjs";function s(e){return e.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 c={command:`list`,describe:`Returns the Durable Object namespaces owned by an account.`,builder:s,handler:async s=>{let c={page:s.page,per_page:s[`per-page`]};if(s.dryRun){a({command:`cf durable-objects namespaces list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/durable_objects/namespaces`,pathParams:{},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.durableObjects.namespaces.list({account_id:u,...c})),{successLabel:`Loaded`})}};function l(e){return e.option(`id`,{type:`string`,description:`ID of the namespace.`,demandOption:!0}).option(`limit`,{type:`number`,description:`The number of objects to return. The cursor attribute may be used to iterate over the next batch of objects if there are more than the limit.`}).option(`cursor`,{type:`string`,description:`Opaque token indicating the position from which to continue when requesting the next set of records. A valid value for the cursor can be obtained from the cursors object in the result_info structure.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`list`,describe:`Returns the Durable Objects in a given namespace.`,builder:l,handler:async s=>{let c={limit:s.limit,cursor:s.cursor};if(s.dryRun){a({command:`cf durable-objects namespaces objects list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/workers/durable_objects/namespaces/${s.id==null?`<id>`:encodeURIComponent(String(s.id))}/objects`,pathParams:{id:String(s.id??``)},query:c,bodyKind:`none`});return}let l=await r(s),u=s.local?e:await t();s.accountId=u,i(await o(`Loading`,async()=>l.durableObjects.namespaces.objects.list({account_id:u,id:s.id,...c})),{successLabel:`Loaded`})}},d={command:`objects`,describe:`Operations for namespaces.objects`,builder:e=>e.command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},f={command:`namespaces`,describe:`Operations for namespaces`,builder:e=>e.command(c).command(d).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},p={command:`durable-objects`,describe:`durable-objects`,builder:e=>e.command(f).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{p as default};
|
|
@@ -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";import{n as a,t as o}from"./body-parser-C-c9gfH1.mjs";function s(e){return e.option(`enabled`,{type:`boolean`,description:`Enable or disable DMARC reports for this zone`}).option(`skip-wizard`,{type:`boolean`,description:`Skip the DMARC setup wizard`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Request body for PATCH /dmarc-reports`})}const c={command:`edit`,describe:"Updates the DMARC report configuration for a zone. At least one of `enabled` or `skip_wizard` must be provided. When enabling, the handler will ensure the DMARC RUA record exists in DNS.",builder:s,handler:async s=>{if(s.dryRun){r({command:`cf email-auth dmarc-reports edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${s.zone??s.zoneId??`<zone>`}/email/auth/dmarc-reports`,pathParams:{"zone-id":String(s.zone??s[`zone-id`]??``)},bodyKind:`json`,body:s.body===void 0?o({enabled:s.enabled,skip_wizard:s[`skip-wizard`]}):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.emailAuth.dmarcReports.edit({...e,zone_id:l})),{successLabel:`Updated`});return}let u=o({enabled:s.enabled,skip_wizard:s[`skip-wizard`]});n(await i(`Updating`,async()=>c.emailAuth.dmarcReports.edit({...u,zone_id:l})),{successLabel:`Updated`})}};function l(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const u={command:`get`,describe:`Retrieves the current DMARC report configuration and status for a zone. Returns the RUA prefix, enabled status, approved sources, and DNS records.`,builder:l,handler:async a=>{if(a.dryRun){r({command:`cf email-auth dmarc-reports get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/email/auth/dmarc-reports`,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.emailAuth.dmarcReports.get({zone_id:s})),{successLabel:`Loaded`})}},d={command:`dmarc-reports`,describe:`Operations for dmarc-reports`,builder:e=>e.command(c).command(u).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function f(e){return e.option(`id`,{type:`string`,description:`DNS record ID (rec_tag) to inspect`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const p={command:`inspect`,describe:"Inspects a specific SPF TXT record and returns a parsed tree structure in the spflimit-worker format. The record ID must be provided via the `id` query parameter. Returns a recursive tree showing: - Parsed components with their qualifiers and types - Nested includes recursively resolved within components - Per-component and total lookup counts - Detailed error information with context",builder:f,handler:async a=>{let o={id:a.id};if(a.dryRun){r({command:`cf email-auth spf inspect`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${a.zone??a.zoneId??`<zone>`}/email/auth/spf/inspect`,pathParams:{"zone-id":String(a.zone??a[`zone-id`]??``)},query:o,bodyKind:`none`});return}let s=await t(a),c=await e({zone:a.zone},s,{quiet:a.quiet});a.zoneId=c,n(await i(`Loading`,async()=>s.emailAuth.spf.inspect({zone_id:c,...o})),{successLabel:`Loaded`})}},m={command:`spf`,describe:`Operations for spf`,builder:e=>e.command(p).demandCommand(1,`Please specify a subcommand`),handler:()=>{}},h={command:`email-auth`,describe:`email-auth`,builder:e=>e.command(d).command(m).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{h as default};
|
|
@@ -1,6 +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}from"./oauth-B0ETkNcX.mjs";import{r as i}from"./auth-MQEamPN9.mjs";import{t as a}from"./output-DrpYYfnB.mjs";import{n as o,t as s}from"./progress-CsHIt3Tp.mjs";import{n as c,t as l}from"./body-parser-C-c9gfH1.mjs";import{n as u}from"./input-validation-Bav2M9F-.mjs";import{a as d,i as f,n as p}from"./prompt-DdegNPpg.mjs";import{t as m}from"./cli-types-BsTty22w.mjs";function ee(e){return e.option(`email`,{type:`string`,description:`The contact email address of the user.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const h={command:`create`,describe:`Create a destination address to forward your emails to. Destination addresses need to be verified before they can be used.`,builder:ee,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({email:u(r.email,`email`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.emailRouting.addresses.create({...e,account_id:p})),{successLabel:`Created`});return}r.email===void 0&&(r.email=await d(`email`,`The contact email address of the user.`));let m=l({email:u(r.email,`email`,`text`)});a(await s(`Creating`,async()=>f.emailRouting.addresses.create({...m,account_id:p})),{successLabel:`Created`})}};function g(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address 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 _={command:`delete <destination-address-identifier>`,describe:`Deletes a specific destination address.`,builder:g,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();if(r.accountId=l,!await p({force:!!r.force})){process.stderr.write(`Aborted.
|
|
3
|
-
`);return}a(await s(`Deleting`,async()=>c.emailRouting.addresses.delete({account_id:l,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Deleted`})}};function v(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const y={command:`get <destination-address-identifier>`,describe:`Gets information for a specific destination email already created.`,builder:v,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`none`});return}let c=await i(r),l=r.local?e:await t();r.accountId=l,a(await s(`Loading`,async()=>c.emailRouting.addresses.get({account_id:l,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Loaded`})}};function b(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`direction`,{type:`string`,description:`Sorts results in an ascending or descending order.`,choices:[`asc`,`desc`]}).option(`verified`,{type:`string`,description:`Filter by verified destination addresses.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const x={command:`list`,describe:`Lists existing destination addresses.`,builder:m(b),handler:async r=>{let c={page:r.page,per_page:r[`per-page`],direction:r.direction,verified:r.verified};if(r.dryRun){o({command:`cf email-routing addresses list`,method:`GET`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses`,pathParams:{},query:c,bodyKind:`none`});return}let l=await i(r),u=r.local?e:await t();r.accountId=u,a(await s(`Loading`,async()=>l.emailRouting.addresses.list({account_id:u,...c})),{successLabel:`Loaded`})}};function S(e){return e.positional(`destination-address-identifier`,{type:`string`,description:`Destination address identifier.`,demandOption:!0}).option(`status`,{type:`string`,description:`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,choices:[`unverified`,`verified`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const C={command:`update <destination-address-identifier>`,describe:`Updates the status of a specific destination address.`,builder:S,handler:async r=>{if(r.dryRun){o({command:`cf email-routing addresses update`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/addresses/${r[`destination-address-identifier`]==null?`<destination-address-identifier>`:encodeURIComponent(String(r[`destination-address-identifier`]))}`,pathParams:{"destination-address-identifier":String(r[`destination-address-identifier`]??``)},bodyKind:`json`,body:r.body===void 0?l({status:u(r.status,`status`,`text`)}):c(r.body)});return}let d=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Updating`,async()=>d.emailRouting.addresses.update({...e,account_id:p,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Updated`});return}r.status===void 0&&(r.status=await f(`status`,`Destination address status. Non-admin callers may only set verified addresses back to unverified; setting to verified requires admin privileges.`,[`unverified`,`verified`]));let m=l({status:u(r.status,`status`,`text`)});a(await s(`Updating`,async()=>d.emailRouting.addresses.update({...m,account_id:p,destination_address_identifier:r[`destination-address-identifier`]})),{successLabel:`Updated`})}},w={command:`addresses`,describe:`Verified destination email addresses that can receive forwarded mail`,builder:e=>e.command(h).command(_).command(y).command(x).command(C).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function T(e){return e.option(`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 E={command:`disable`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:T,handler:async e=>{if(e.dryRun){o({command:`cf email-routing disable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/disable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force,message:`This operation turns off email routing for a zone.`})){process.stderr.write(`Aborted.
|
|
4
|
-
`);return}a(await s(`Deleting`,async()=>t.emailRouting.disable({zone_id:n})),{successLabel:`Deleted`})}};function D(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const O={command:`create`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:D,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.dns.create({body:r,zone_id:n})),{successLabel:`Created`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.dns.create({body:d,zone_id:n})),{successLabel:`Created`})}};function k(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const A={command:`delete`,describe:`Disable your Email Routing zone. Also removes additional MX records previously required for Email Routing to work.`,builder:k,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
|
|
5
|
-
`);return}if(e.body){let r=c(e.body);a(await s(`Deleting`,async()=>t.emailRouting.dns.delete({body:r,zone_id:n})),{successLabel:`Deleted`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Deleting`,async()=>t.emailRouting.dns.delete({body:d,zone_id:n})),{successLabel:`Deleted`})}};function j(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const M={command:`edit`,describe:`Unlock MX Records previously locked by Email Routing.`,builder:j,handler:async e=>{if(e.dryRun){o({command:`cf email-routing dns edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.dns.edit({body:r,zone_id:n})),{successLabel:`Updated`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.dns.edit({body:d,zone_id:n})),{successLabel:`Updated`})}};function N(e){return e.option(`subdomain`,{type:`string`,description:`Deprecated. When supplied, the response shape differs from the documented default and is not modeled in generated SDKs. Do not rely on this parameter.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const P={command:`get`,describe:`Show the DNS records needed to configure your Email Routing zone.`,builder:N,handler:async e=>{let t={subdomain:e.subdomain};if(e.dryRun){o({command:`cf email-routing dns get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/dns`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},query:t,bodyKind:`none`});return}let n=await i(e),c=await r({zone:e.zone},n,{quiet:e.quiet});e.zoneId=c,a(await s(`Loading`,async()=>n.emailRouting.dns.get({zone_id:c,...t})),{successLabel:`Loaded`})}},F={command:`dns`,describe:`DNS records required for email routing (MX, SPF, DKIM) — enable, lock, or disable`,builder:e=>e.command(O).command(A).command(M).command(P).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function I(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const L={command:`edit`,describe:`Update the settings for your Email Routing zone.`,builder:I,handler:async e=>{if(e.dryRun){o({command:`cf email-routing edit`,method:`PATCH`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.edit({...r,zone_id:n})),{successLabel:`Updated`});return}let u=l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});a(await s(`Updating`,async()=>t.emailRouting.edit({...u,zone_id:n})),{successLabel:`Updated`})}};function R(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const te={command:`enable`,describe:`Enable you Email Routing zone. Add and lock the necessary MX and SPF records.`,builder:R,handler:async e=>{if(e.dryRun){o({command:`cf email-routing enable`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/enable`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Creating`,async()=>t.emailRouting.enable({zone_id:n})),{successLabel:`Created`})}};function z(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const B={command:`get`,describe:`Get information about the settings for your Email Routing zone.`,builder:z,handler:async e=>{if(e.dryRun){o({command:`cf email-routing get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.get({zone_id:n})),{successLabel:`Loaded`})}};function V(e){return e.option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const H={command:`get`,describe:`Get information on the default catch-all routing rule.`,builder:V,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules catch-alls get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.rules.catchAlls.get({zone_id:n})),{successLabel:`Loaded`})}};function U(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const W={command:`update`,describe:`Enable or disable catch-all routing rule, or change action to forward to a specific destination address. Forward actions require exactly one verified destination address.`,builder:U,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules catch-alls update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/catch_all`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:u(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...r,zone_id:n})),{successLabel:`Updated`});return}let d=l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),source:u(e.source,`source`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.rules.catchAlls.update({...d,zone_id:n})),{successLabel:`Updated`})}},G={command:`catch-alls`,describe:`Operations for rules.catch-alls`,builder:e=>e.command(H).command(W).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function K(e){return e.option(`enabled`,{type:`boolean`,description:`Routing rule status.`,default:!0}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`,default:0}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`],default:`api`}).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 q={command:`create`,describe:`Rules consist of a set of criteria for matching emails (such as an email being sent to a specific custom email address) plus a set of actions to take on the email (like forwarding it to a specific destination address). Forward actions require exactly one verified destination address.`,builder:K,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules create`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.rules.create({...r,zone_id:n})),{successLabel:`Created`});return}let d=l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.rules.create({...d,zone_id:n})),{successLabel:`Created`})}};function J(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`force`,{type:`boolean`,alias:`f`,description:`Skip confirmation (useful in scripts and CI)`,default:!1})}const Y={command:`delete <rule-identifier>`,describe:`Delete a specific routing rule.`,builder:J,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules delete`,method:`DELETE`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,!await p({force:!!e.force})){process.stderr.write(`Aborted.
|
|
6
|
-
`);return}a(await s(`Deleting`,async()=>t.emailRouting.rules.delete({zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Deleted`})}};function X(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const Z={command:`get <rule-identifier>`,describe:`Get information for a specific routing rule already created.`,builder:X,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules get`,method:`GET`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`none`});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});e.zoneId=n,a(await s(`Loading`,async()=>t.emailRouting.rules.get({zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Loaded`})}};function Q(e){return e.option(`page`,{type:`number`,description:`Page number of paginated results.`}).option(`per-page`,{type:`number`,description:`Maximum number of results per page.`}).option(`enabled`,{type:`string`,description:`Filter by enabled routing rules.`,choices:[`true`,`false`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1})}const ne={command:`list-account`,describe:`Lists existing routing rules across all zones in the account or zone.`,builder:m(Q),handler:async c=>{let l={page:c.page,per_page:c[`per-page`],enabled:c.enabled};if(c.dryRun){let e=c.zone===void 0?await n():void 0,t=c.zone===void 0?`accounts`:`zones`,r=c.zone??e??`<account-id>`;o({command:`cf email-routing rules list-account`,method:`GET`,url:`https://api.cloudflare.com/client/v4/${t}/${r}/email/routing/rules`,pathParams:{"account-or-zone":String(t),"account-or-zone-id":String(r)},query:l,bodyKind:`none`});return}let u=await i(c),d=c.zone===void 0?`accounts`:`zones`,f=d===`zones`?await r({zone:c.zone},u,{quiet:c.quiet}):c.local?e:await t();d===`zones`?c.zoneId=f:c.accountId=f,a(await s(`Loading`,async()=>u.emailRouting.rules.listAccount({account_or_zone:d,account_or_zone_id:f,...l})),{successLabel:`Loaded`})}};function re(e){return e.option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ie={command:`plan`,describe:`Computes the Email Routing rule changes that would be needed to reconcile a Wrangler-managed desired ruleset. This endpoint is read-only and does not create, update, or delete rules.`,builder:re,handler:async r=>{if(r.dryRun){o({command:`cf email-routing rules plan`,method:`POST`,url:`https://api.cloudflare.com/client/v4/accounts/${await n()??`<account-id>`}/email/routing/rules/plan`,pathParams:{},bodyKind:`json`,body:r.body===void 0?l({owner_worker_tag:u(r[`owner-worker-tag`],`owner-worker-tag`,`text`)}):c(r.body)});return}let f=await i(r),p=r.local?e:await t();if(r.accountId=p,r.body){let e=c(r.body);a(await s(`Creating`,async()=>f.emailRouting.rules.plan({...e,account_id:p})),{successLabel:`Created`});return}r[`owner-worker-tag`]===void 0&&(r[`owner-worker-tag`]=await d(`owner-worker-tag`,"Public tag (script_tag) of the Worker that owns this rule. Required when `source` is `wrangler`. "));let m=l({owner_worker_tag:u(r[`owner-worker-tag`],`owner-worker-tag`,`text`)});a(await s(`Creating`,async()=>f.emailRouting.rules.plan({...m,account_id:p})),{successLabel:`Created`})}};function ae(e){return e.positional(`rule-identifier`,{type:`string`,description:`Routing rule identifier.`,demandOption:!0}).option(`enabled`,{type:`boolean`,description:`Routing rule status.`}).option(`name`,{type:`string`,description:`Routing rule name.`}).option(`owner-worker-tag`,{type:`string`,description:"Public tag (script_tag) of the Worker that owns this rule. Required when\n`source` is `wrangler`.\n"}).option(`priority`,{type:`number`,description:`Priority of the routing rule.`}).option(`source`,{type:`string`,description:"Who manages the rule. `api` covers dashboard, generic API, and Terraform;\n`wrangler` means the rule is managed by a Worker's wrangler.jsonc. Defaults\nto `api` when omitted on write.\n",choices:[`api`,`wrangler`]}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const oe={command:`update <rule-identifier>`,describe:`Update actions and matches, or enable/disable specific routing rules. Forward actions require exactly one verified destination address.`,builder:ae,handler:async e=>{if(e.dryRun){o({command:`cf email-routing rules update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/rules/${e[`rule-identifier`]==null?`<rule-identifier>`:encodeURIComponent(String(e[`rule-identifier`]))}`,pathParams:{"rule-identifier":String(e[`rule-identifier`]??``),"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.rules.update({...r,zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Updated`});return}let d=l({enabled:e.enabled,name:u(e.name,`name`,`text`),owner_worker_tag:u(e[`owner-worker-tag`],`owner-worker-tag`,`text`),priority:e.priority,source:u(e.source,`source`,`text`)});a(await s(`Updating`,async()=>t.emailRouting.rules.update({...d,zone_id:n,rule_identifier:e[`rule-identifier`]})),{successLabel:`Updated`})}},$={command:`rules`,describe:`Routing rules that match incoming email addresses and forward to destination mailboxes`,builder:e=>e.command(q).command(Y).command(Z).command(ne).command(ie).command(oe).command(G).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};function se(e){return e.option(`name`,{type:`string`,description:`Domain of your zone.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ce={command:`unlock`,describe:`Unlock MX records previously locked by Email Routing. Deprecated - use PATCH /zones/{zone_id}/email/routing/dns instead.`,builder:se,handler:async e=>{if(e.dryRun){o({command:`cf email-routing unlock`,method:`POST`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing/unlock`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({name:u(e.name,`name`,`text`)}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Creating`,async()=>t.emailRouting.unlock({body:r,zone_id:n})),{successLabel:`Created`});return}let d=l({name:u(e.name,`name`,`text`)});a(await s(`Creating`,async()=>t.emailRouting.unlock({body:d,zone_id:n})),{successLabel:`Created`})}};function le(e){return e.option(`enabled`,{type:`boolean`,description:"State of your zone Email Routing settings. No-op on this endpoint - use `POST`/`DELETE /zones/{zone_id}/email/routing/dns`."}).option(`skip-wizard`,{type:`boolean`,description:`Flag to check if the user skipped the configuration wizard.`}).option(`support-subaddress`,{type:`boolean`,description:`Whether subaddressing (plus-addressing) is honored when matching incoming mail against routing rules.`}).option(`dry-run`,{type:`boolean`,description:`Validate and show what would happen without executing`,default:!1}).option(`body`,{type:`string`,description:`Raw JSON request body (bypasses individual flags)`})}const ue={command:`update`,describe:`Update the settings for your Email Routing zone.`,builder:le,handler:async e=>{if(e.dryRun){o({command:`cf email-routing update`,method:`PUT`,url:`https://api.cloudflare.com/client/v4/zones/${e.zone??e.zoneId??`<zone>`}/email/routing`,pathParams:{"zone-id":String(e.zone??e[`zone-id`]??``)},bodyKind:`json`,body:e.body===void 0?l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]}):c(e.body)});return}let t=await i(e),n=await r({zone:e.zone},t,{quiet:e.quiet});if(e.zoneId=n,e.body){let r=c(e.body);a(await s(`Updating`,async()=>t.emailRouting.update({...r,zone_id:n})),{successLabel:`Updated`});return}let u=l({enabled:e.enabled,skip_wizard:e[`skip-wizard`],support_subaddress:e[`support-subaddress`]});a(await s(`Updating`,async()=>t.emailRouting.update({...u,zone_id:n})),{successLabel:`Updated`})}},de={command:`email-routing`,describe:`Route incoming emails to destination addresses using custom rules, catch-all handlers, and DNS configuration`,builder:e=>e.command(E).command(L).command(te).command(B).command(ce).command(ue).command(w).command(F).command($).demandCommand(1,`Please specify a subcommand`),handler:()=>{}};export{de as default};
|