cf 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -5
- package/dist/_meta/agent-context.json +13 -5
- package/dist/_meta/commands.json +2393 -262
- package/dist/_meta/hand-written-commands.json +960 -0
- package/dist/_meta/schemas.json +1882 -155
- package/dist/{abuse-reports-CGF4zcKf.mjs → abuse-reports-D40QFl-y.mjs} +2 -2
- package/dist/{access-lhLJo1v2.mjs → access-Dl2IU1ID.mjs} +1 -1
- package/dist/account-CPbieCZ4.mjs +2 -0
- package/dist/{account-tags-B88TotoH.mjs → account-tags-skfP7H8k.mjs} +4 -4
- package/dist/{accounts-BSIAT_iP.mjs → accounts-CSgR6909.mjs} +12 -12
- package/dist/{acm-VULm1djv.mjs → acm-CVvCTaNk.mjs} +1 -1
- package/dist/{addressing-BHPBIkRY.mjs → addressing-Uq5hEDDP.mjs} +11 -11
- package/dist/{agent-context-KBy48G1b.mjs → agent-context-BvuDdaJb.mjs} +1 -1
- package/dist/agent-memory-BrHMIU0E.mjs +6 -0
- package/dist/ai-audit-BoZuL84i.mjs +2 -0
- package/dist/ai-gateway-DE50Jem1.mjs +13 -0
- package/dist/ai-search-Fx7NHCHB.mjs +7 -0
- package/dist/ai-security-DyLbY9kv.mjs +4 -0
- package/dist/ai-v2fP1r0s.mjs +5 -0
- package/dist/{alerting-Bl8OqViR.mjs → alerting-5mFZjTcD.mjs} +1 -1
- package/dist/analytics-BygTfozw.mjs +3 -0
- package/dist/analytics_engine-4L-q362P.mjs +2 -0
- package/dist/{api-security-4FVrD4n8.mjs → api-security-DjFsRYWx.mjs} +20 -20
- package/dist/argo-TzXPN7tz.mjs +2 -0
- package/dist/args-CDgWUP4J.mjs +2 -0
- package/dist/{artifacts-CVDGnr2V.mjs → artifacts-dEw2UUBV.mjs} +1 -1
- package/dist/audit-logs-CqY7zzwv.mjs +2 -0
- package/dist/auth-CPLdkOC7.mjs +5 -0
- package/dist/{auth-MQEamPN9.mjs → auth-DY_Y2bXC.mjs} +3 -3
- package/dist/billing-DHQuRT8S.mjs +3 -0
- package/dist/body-parser-BGVbwPeM.mjs +2 -0
- package/dist/bot-management-CfqG79hF.mjs +5 -0
- package/dist/botnet-feed-BOeNnDoH.mjs +3 -0
- package/dist/brand-protection-DYttrKIM.mjs +3 -0
- package/dist/{browser-extension-BtpCbh-2.mjs → browser-extension-CTUCdgfn.mjs} +1 -1
- package/dist/browser-run-373D4e1i.mjs +4 -0
- package/dist/build-D0ir_S70.mjs +2 -0
- package/dist/{cache-VyWK1SjY.mjs → cache-DJXBmc3w.mjs} +1 -1
- package/dist/{calls-BxoRYxs4.mjs → calls-COO0Eoz1.mjs} +1 -1
- package/dist/certificate-authorities-DbHLmKbd.mjs +2 -0
- package/dist/cf-yPz_IqW6.mjs +18 -0
- package/dist/chunk-LQW53VED-9MACsvSG.mjs +119 -0
- package/dist/chunk-QBZBEHZB-yeyhVUeD.mjs +2 -0
- package/dist/{client-certificates-DDUv8K0a.mjs → client-certificates-RBRqYP3f.mjs} +1 -1
- package/dist/{client-side-security-D4ysjwWT.mjs → client-side-security-HOmA37et.mjs} +1 -1
- package/dist/cloud-connector-C7hw1c1f.mjs +2 -0
- package/dist/cloudforce-one-DLOj76q4.mjs +36 -0
- package/dist/command-BV87D4tR.mjs +2 -0
- package/dist/{completions-BHE4pRjB.mjs → completions-BnD46cXe.mjs} +3 -3
- package/dist/config.d.mts +1451 -1366
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-DY-z_LrH.mjs +2 -0
- package/dist/connector-telemetry-events-DCXmcAc9.mjs +2 -0
- package/dist/connector-telemetry-snapshots-D8GNuzx3.mjs +2 -0
- package/dist/{connectors-BqxYMMtQ.mjs → connectors-fEOn-J_i.mjs} +1 -1
- package/dist/containers-BDBsEs7-.mjs +58 -0
- package/dist/{content-scan-Dgd7A8KF.mjs → content-scan-Cmj9--XY.mjs} +1 -1
- package/dist/{csamScanner-DYL37wLc.mjs → csamScanner-BRXyMCyH.mjs} +1 -1
- package/dist/{ct-alerting-CkhSbfAs.mjs → ct-alerting-9AvYys-f.mjs} +1 -1
- package/dist/custom-certificates-C5qrlyhb.mjs +5 -0
- package/dist/custom-csrs-BgOnTbBW.mjs +3 -0
- package/dist/{custom-hostnames-q_nsnlye.mjs → custom-hostnames-CbQD9aYo.mjs} +1 -1
- package/dist/custom-nameservers-2ZajBkRC.mjs +3 -0
- package/dist/custom-pages-Buki_Cb8.mjs +3 -0
- package/dist/d1-n2in0cSF.mjs +20 -0
- package/dist/data-security-DzOQMkv3.mjs +7 -0
- package/dist/dcv-delegation-BTP9LCOm.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/deploy-BUSz35vq.mjs +2 -0
- package/dist/deploy-input-BvD9aRP1.mjs +2 -0
- package/dist/dev-DY_DquQx.mjs +4 -0
- package/dist/{diagnostics-BTH-8nJH.mjs → diagnostics-BvHV8kQb.mjs} +1 -1
- package/dist/{directory-BlH6N6Qy.mjs → directory-BeiSyg8A.mjs} +1 -1
- package/dist/{dispatch-namespaces-BCjH1JzB.mjs → dispatch-namespaces-Dp8Jjpwy.mjs} +1 -1
- package/dist/dist-BBx1io2f.mjs +2 -0
- package/dist/dist-Cb9TJ2VV.mjs +9 -0
- package/dist/dist-DV7LR38l.mjs +387 -0
- package/dist/dist-DvizctjW.mjs +48 -0
- package/dist/{dls-BF5iN78p.mjs → dls-BwoU29mS.mjs} +1 -1
- package/dist/{dns-CeCTNqRk.mjs → dns-DISAfuzj.mjs} +13 -13
- package/dist/{dns-firewall-B54MaLGm.mjs → dns-firewall-wBcCx_ua.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-wIVDg_fl.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
- package/dist/dry-run-ILZRVpnp.mjs +2 -0
- package/dist/durable-objects-DhDL3San.mjs +2 -0
- package/dist/email-auth-BROqK6-C.mjs +2 -0
- package/dist/email-routing-BZXHDAOO.mjs +6 -0
- package/dist/email-security-DVumybrk.mjs +18 -0
- package/dist/email-sending-CDQ3_wyz.mjs +7 -0
- package/dist/fieldExtractors-Cy1rxHEF.mjs +3 -0
- package/dist/{firewall-CBPGJ43p.mjs → firewall-C0g5X7Zd.mjs} +9 -9
- package/dist/flagship-fFBiZUz-.mjs +4 -0
- package/dist/{fraud-BIhS8pLf.mjs → fraud-CjIETOaM.mjs} +1 -1
- package/dist/google-tag-gateway-hPa5IHUx.mjs +2 -0
- package/dist/{healthchecks-FiXIk-KP.mjs → healthchecks-CoycpTf9.mjs} +1 -1
- package/dist/{hostnames-Bx0mykMR.mjs → hostnames-x_Yezxpr.mjs} +1 -1
- package/dist/{hyperdrive-C8qCabBF.mjs → hyperdrive-BlfrTwSq.mjs} +1 -1
- package/dist/iam-Bk7K_PPO.mjs +6 -0
- package/dist/images-BAEFb9q1.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/{intel-B-9Z_sJs.mjs → intel-DDkyJVaP.mjs} +1 -1
- package/dist/interactive-CRnq-B5I.mjs +11 -0
- package/dist/{interactive-DtsCYfrK.mjs → interactive-cytQzL94.mjs} +1 -1
- package/dist/ips-DU0ti0i0.mjs +2 -0
- package/dist/{keyless-certificates-THHvoXX3.mjs → keyless-certificates-E1P9jBTb.mjs} +1 -1
- package/dist/keys-DqldTZqH.mjs +2 -0
- package/dist/{kv-BFDUCnft.mjs → kv-CcfCfnwq.mjs} +1 -1
- package/dist/{leaked-credential-checks-DUlUCOoJ.mjs → leaked-credential-checks-CqmKaEbd.mjs} +1 -1
- package/dist/load-balancers-Dg4pDad1.mjs +6 -0
- package/dist/{local-D-aVNu6A.mjs → local-DGiIS1uM.mjs} +1 -1
- package/dist/local-runtime--IQr44qq.mjs +2 -0
- package/dist/logexplorer-Bu2mG5rh.mjs +17 -0
- package/dist/logo-matches-CWUzxY7G.mjs +2 -0
- package/dist/logos-BTfdkDPi.mjs +3 -0
- package/dist/{logpush-BK34mMQs.mjs → logpush-BZyay3h2.mjs} +1 -1
- package/dist/{logs-CLAqX9h2.mjs → logs-BqF7jjQO.mjs} +1 -1
- package/dist/{magic-cloud-networking-h_ozrC5S.mjs → magic-cloud-networking-Dhd8pTyM.mjs} +4 -4
- package/dist/magic-network-monitoring-D0FnkjuN.mjs +4 -0
- package/dist/magic-transit-B5skt0G7.mjs +111 -0
- package/dist/managed-transforms-B6X_crcJ.mjs +3 -0
- package/dist/matches-DeYaB4I0.mjs +2 -0
- package/dist/mcp-ChjBiMx2.mjs +4 -0
- package/dist/mesh-DRVAFLBX.mjs +4 -0
- package/dist/{moq-qmuVPAO0.mjs → moq-DE7VDEFS.mjs} +1 -1
- package/dist/mtls-certificates-Cbc3uAkN.mjs +3 -0
- package/dist/{network-D74cSy3t.mjs → network-CDPZNFbn.mjs} +1 -1
- package/dist/{network-interconnects-BJ0Nc48J.mjs → network-interconnects-CMRs_chR.mjs} +1 -1
- package/dist/oauth-DAa7SwkM.mjs +14 -0
- package/dist/{oauth-clients-Br-smLxQ.mjs → oauth-clients-DAI_gcuL.mjs} +1 -1
- package/dist/oauth-scopes-BE6xF4_h.mjs +2 -0
- package/dist/observability-DnyI8rPJ.mjs +4 -0
- package/dist/{open-PBXRGS4R-R-qesf18.mjs → open-PBXRGS4R-DIiYQyU9.mjs} +3 -3
- package/dist/{organization-NX7yCZrq.mjs → organization-yh0mSUdI.mjs} +6 -6
- package/dist/organizations-B3aU-RCG.mjs +2 -0
- package/dist/origin-ca-certificates-BaNWfVqf.mjs +3 -0
- package/dist/origin-post-quantum-encryption-CIUtQgyv.mjs +2 -0
- package/dist/origin-tls-client-auth-CvEpbX2Q.mjs +4 -0
- package/dist/{output-DrpYYfnB.mjs → output-BqDR9h74.mjs} +1 -1
- package/dist/page-rules-CzbyXbt6.mjs +27 -0
- package/dist/pages-CX8yefTI.mjs +14 -0
- package/dist/pay-per-crawl-v4vBOMWD.mjs +4 -0
- package/dist/pipelines-BZ1KGupx.mjs +6 -0
- package/dist/precursor-D42A9ay5.mjs +4 -0
- package/dist/progress-jYW64HY7.mjs +2 -0
- package/dist/project-settings-BN7tL0c7.mjs +3 -0
- package/dist/prompt-CyATfGUu.mjs +3 -0
- package/dist/{public-BwQqexwo-CNW_dPly.mjs → public-BMg6-Hxh-DgIH5obr.mjs} +1 -1
- package/dist/queries-xvETUjUE.mjs +3 -0
- package/dist/queues-CpqHDtxF.mjs +6 -0
- package/dist/{r2-data-catalog-Du7hN9jA.mjs → r2-data-catalog-DgKmlTKR.mjs} +1 -1
- package/dist/r2-jhmLvD1z.mjs +24 -0
- package/dist/radar-C2J16wpX.mjs +2 -0
- package/dist/{rate-limits-yBF3qoYD.mjs → rate-limits-CoH9Xma0.mjs} +1 -1
- package/dist/raw-fetch-CNKIypJ7.mjs +2 -0
- package/dist/{realtimekit-CIP7lP-a.mjs → realtimekit-CDs0Z5WW.mjs} +1 -1
- package/dist/registrar-BI5ewTAk.mjs +23 -0
- package/dist/{registrar-sandbox-DiXg8p_1.mjs → registrar-sandbox-al1znWMc.mjs} +4 -4
- package/dist/{registry-Bck_zFkz.mjs → registry-5-I2XLwF.mjs} +1 -1
- package/dist/reporting-CxsdHAH3.mjs +2 -0
- package/dist/request-tracers-DJJCncft.mjs +2 -0
- package/dist/{resource-sharing-D1pSDvtf.mjs → resource-sharing-qQGn8AEn.mjs} +1 -1
- package/dist/resource-tagging-aTtpX5e5.mjs +2 -0
- package/dist/rules-PpsDU89Q.mjs +4 -0
- package/dist/rulesets-DP12Aqik.mjs +5 -0
- package/dist/rum-DxvpzJYc.mjs +4 -0
- package/dist/{schema-B34Q9tLF.mjs → schema-DlLbiOJj.mjs} +1 -1
- package/dist/schema-flags-CTfQVGCs.mjs +5 -0
- package/dist/schemas-BFCBlp_W.mjs +65 -0
- package/dist/{scim-CcSyfKCH.mjs → scim-DJ4AVU20.mjs} +1 -1
- package/dist/{secrets-store-DFmvtphu.mjs → secrets-store-D6KDNo_s.mjs} +1 -1
- package/dist/security-center-008FMs_z.mjs +2 -0
- package/dist/{security-txt-DqnFpjMI.mjs → security-txt-CqcfrhlN.mjs} +1 -1
- package/dist/{share-BuwYUzOL.mjs → share-D5fzsVAJ.mjs} +4 -4
- package/dist/{deploy-input-CrvuoDGJ.mjs → shared-DlKGNPiT.mjs} +97 -99
- package/dist/smart-shield-DpFscIk8.mjs +4 -0
- package/dist/snippets-CCKgI2ZX.mjs +4 -0
- package/dist/spawn-C3_tJ3RB.mjs +526 -0
- package/dist/{spectrum-b7N1ZRAm.mjs → spectrum-LmdqY3ki.mjs} +1 -1
- package/dist/{speed-cw31yFva.mjs → speed-CEK36h3A.mjs} +1 -1
- package/dist/src-CEb2fgtT.mjs +108 -0
- package/dist/{ssl-CsEhRVTO.mjs → ssl-ChHUyaQm.mjs} +1 -1
- package/dist/startup-profile-Dpxg-MjV.mjs +17 -0
- package/dist/{state-Bb5Cbc_L.mjs → state-DeX23Kmg.mjs} +1 -1
- package/dist/{stream-DFOao6Gu.mjs → stream-DfUSELMX.mjs} +13 -13
- package/dist/submit-DF2G5CIz.mjs +2 -0
- package/dist/tags-nFJJHlLJ.mjs +2 -0
- package/dist/tenant-CRLw1oRU.mjs +2 -0
- package/dist/tenant-custom-nameservers-BvBQRDcs.mjs +3 -0
- package/dist/{tools-BHfBOZOU.mjs → tools-j8UGEtP1.mjs} +1 -1
- package/dist/{tunnel-DkMiNtVY.mjs → tunnel-CMQeBgmb.mjs} +1 -1
- package/dist/tunnels-iVA3MrdS.mjs +2 -0
- package/dist/turnstile-DQHP6-_b.mjs +23 -0
- package/dist/{ui-DE8CNn6c.mjs → ui-DJFcf61J.mjs} +1 -1
- package/dist/url-info-BVgdb_pf.mjs +2 -0
- package/dist/{url-normalization-ClfFiruK.mjs → url-normalization-BTcxLxIQ.mjs} +1 -1
- package/dist/url-scanner-DwuDZLPk.mjs +2 -0
- package/dist/user-I_MbB_KX.mjs +12 -0
- package/dist/values-S-Q7-5o8.mjs +2 -0
- package/dist/{vectorize-CVKu7lEt.mjs → vectorize-CNZdF_0A.mjs} +1 -1
- package/dist/waiting-rooms-Bo-OSsxu.mjs +11 -0
- package/dist/{web-assets-C2s9kzWf.mjs → web-assets-tlFzKdNL.mjs} +1 -1
- package/dist/web3-CdbfoZ2x.mjs +4 -0
- package/dist/workers-DQ9Q7czn.mjs +28 -0
- package/dist/{workers-builds-B55-oXOa.mjs → workers-builds-CGRhYx-x.mjs} +1 -1
- package/dist/{workflows-B-kGHxFu.mjs → workflows-BhEy-crm.mjs} +1 -1
- package/dist/zaraz-DbKvA_8C.mjs +2 -0
- package/dist/{zero-trust-DV3sIOvu.mjs → zero-trust-DrHCPVOc.mjs} +67 -66
- package/dist/zone-D2zrbJI2.mjs +2 -0
- package/dist/zones-DrpxQ_-A.mjs +21 -0
- package/package.json +12 -8
- package/dist/account-CYRm3yoN.mjs +0 -2
- package/dist/agent-memory-DDv_Gxr7.mjs +0 -6
- package/dist/ai-audit-BWZGvbca.mjs +0 -2
- package/dist/ai-gateway-jeB-sAgP.mjs +0 -13
- package/dist/ai-search-BmdskMjR.mjs +0 -7
- package/dist/ai-security-CsmfcaUx.mjs +0 -4
- package/dist/ai-viHB1tgI.mjs +0 -5
- package/dist/analytics-vOxw8Hy0.mjs +0 -3
- package/dist/analytics_engine-DO4-C0wD.mjs +0 -2
- package/dist/argo-CQfCgazW.mjs +0 -2
- package/dist/args-DlUhyGU0.mjs +0 -2
- package/dist/audit-logs-CzpwvQ6A.mjs +0 -2
- package/dist/auth-D0xZxAEa.mjs +0 -5
- package/dist/billing-aJgapeRm.mjs +0 -3
- package/dist/body-parser-C-c9gfH1.mjs +0 -2
- package/dist/bot-management-Y2q5d-pi.mjs +0 -5
- package/dist/botnet-feed-DANJqfmE.mjs +0 -3
- package/dist/brand-protection-CjpZWBjp.mjs +0 -3
- package/dist/browser-run-BFn9h2Tz.mjs +0 -4
- package/dist/build-DcflwvqN.mjs +0 -2
- package/dist/certificate-authorities-D7OAFxF_.mjs +0 -2
- package/dist/cf-C7DU4819.mjs +0 -18
- package/dist/chunk-LQW53VED-DLrXV-hE.mjs +0 -499
- package/dist/cloud-connector-Bhec6z2P.mjs +0 -2
- package/dist/cloudforce-one-J_hn9ss9.mjs +0 -36
- package/dist/connector-interrupts-Dycx8zFx.mjs +0 -2
- package/dist/connector-telemetry-events-BmxOSNtN.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CdcqfKnH.mjs +0 -2
- package/dist/containers-CKW081JA.mjs +0 -54
- package/dist/custom-certificates-BzAOnEoT.mjs +0 -5
- package/dist/custom-csrs-CgzG3pd3.mjs +0 -3
- package/dist/custom-nameservers-BUBmfhUe.mjs +0 -3
- package/dist/custom-pages-M7jA2Hit.mjs +0 -3
- package/dist/d1-BFvMd6-S.mjs +0 -20
- package/dist/data-security-Bji4Or_j.mjs +0 -7
- package/dist/dcv-delegation-BuoRQ1Yh.mjs +0 -2
- package/dist/deploy-CZ7bgNDu.mjs +0 -2
- package/dist/dev-V10MG-Bg.mjs +0 -4
- package/dist/dist-CgrMkXFx.mjs +0 -72
- package/dist/durable-objects-D8FQORrL.mjs +0 -2
- package/dist/email-auth-DJK0Eb30.mjs +0 -2
- package/dist/email-routing-NpmiKIrl.mjs +0 -6
- package/dist/email-security-BLZ7WZ9Z.mjs +0 -18
- package/dist/email-sending-dn-353Nx.mjs +0 -7
- package/dist/fieldExtractors-ahysj57J.mjs +0 -3
- package/dist/flagship-BusjRNIb.mjs +0 -4
- package/dist/google-tag-gateway-TZZ3F1tV.mjs +0 -2
- package/dist/iam-Cj63Kjc6.mjs +0 -6
- package/dist/images-CBWXCDhy.mjs +0 -8
- package/dist/ips-qs9eGJnI.mjs +0 -2
- package/dist/keys-D7N0j4-x.mjs +0 -2
- package/dist/load-balancers-D2zbQ8fT.mjs +0 -6
- package/dist/local-runtime-Dh3keC5v.mjs +0 -2
- package/dist/logexplorer-CUsfZ_bS.mjs +0 -13
- package/dist/logo-matches-CJcthPHf.mjs +0 -2
- package/dist/logos-BS65zN8q.mjs +0 -3
- package/dist/magic-network-monitoring-C7tAPNKP.mjs +0 -4
- package/dist/magic-transit-BtsFePMx.mjs +0 -111
- package/dist/managed-transforms-Cm_KVCMB.mjs +0 -3
- package/dist/matches-InA1hwII.mjs +0 -2
- package/dist/mcp-mJ7bekNJ.mjs +0 -4
- package/dist/mesh-BK4S1Ezy.mjs +0 -4
- package/dist/mtls-certificates-CU4OAAXY.mjs +0 -3
- package/dist/oauth-B0ETkNcX.mjs +0 -15
- package/dist/oauth-scopes-D5bF11ju.mjs +0 -2
- package/dist/observability-BWE0Gg3V.mjs +0 -4
- package/dist/organizations-DLhiRt8g.mjs +0 -2
- package/dist/origin-ca-certificates-Ff4McZRQ.mjs +0 -3
- package/dist/origin-post-quantum-encryption-UuTr4_SW.mjs +0 -2
- package/dist/origin-tls-client-auth-DOJ1zlH3.mjs +0 -4
- package/dist/page-rules-BSz1gO-_.mjs +0 -18
- package/dist/pages-DVDogxPs.mjs +0 -14
- package/dist/pay-per-crawl-BrLXK7gT.mjs +0 -4
- package/dist/pipelines-BszRk4sM.mjs +0 -6
- package/dist/precursor-BPNjQr76.mjs +0 -4
- package/dist/progress-CsHIt3Tp.mjs +0 -2
- package/dist/prompt-DdegNPpg.mjs +0 -3
- package/dist/queries-JL1H1Biz.mjs +0 -3
- package/dist/queues-DpkYdRUE.mjs +0 -6
- package/dist/r2-CKozthw_.mjs +0 -24
- package/dist/radar-C-92vggG.mjs +0 -2
- package/dist/raw-fetch-CteyTOM2.mjs +0 -2
- package/dist/registrar-DKKN0M29.mjs +0 -21
- package/dist/reporting-fg_GKXe1.mjs +0 -2
- package/dist/request-tracers-CkMya96z.mjs +0 -2
- package/dist/resource-tagging-z48JGHCq.mjs +0 -2
- package/dist/rules-BTmNjDN-.mjs +0 -4
- package/dist/rulesets-CsoSM-17.mjs +0 -5
- package/dist/rum-DB4iO2q5.mjs +0 -4
- package/dist/schema-flags-iGoOriJt.mjs +0 -5
- package/dist/security-center-DFKeHq5c.mjs +0 -2
- package/dist/session-D6KHthHf.mjs +0 -2
- package/dist/shared-VppSAQf4.mjs +0 -2
- package/dist/smart-shield-D6X8L7p8.mjs +0 -4
- package/dist/snippets-DIpc9pb_.mjs +0 -4
- package/dist/spawn-O1RS01vr.mjs +0 -523
- package/dist/src-D_HETJNy.mjs +0 -108
- package/dist/submit--xTzyNPy.mjs +0 -2
- package/dist/tags-efICDkah.mjs +0 -2
- package/dist/tenant-CerHuToJ.mjs +0 -2
- package/dist/tenant-custom-nameservers-C4otMBm2.mjs +0 -3
- package/dist/triggers-BEsiiKAf.mjs +0 -2
- package/dist/tunnels-D0J8lJoI.mjs +0 -2
- package/dist/turnstile-CFmtY5bn.mjs +0 -23
- package/dist/url-info-DBCeRWwb.mjs +0 -2
- package/dist/url-scanner-CNyvg65L.mjs +0 -2
- package/dist/user-bifVEQq5.mjs +0 -12
- package/dist/values-OxkdP1tV.mjs +0 -2
- package/dist/versions-BVL-Ludh.mjs +0 -2
- package/dist/waiting-rooms-CmRAl51T.mjs +0 -11
- package/dist/web3-y_cY91V_.mjs +0 -4
- package/dist/workers-jDcq14GH.mjs +0 -24
- package/dist/zaraz-27zwjLvv.mjs +0 -2
- package/dist/zone-BJix2KQ9.mjs +0 -2
- package/dist/zones-Bkj5i92c.mjs +0 -21
- /package/dist/{alerts-CRmjqOZi.mjs → alerts-9PR5sQ_z.mjs} +0 -0
- /package/dist/{autorag-BD7cu5NU.mjs → autorag-Bevo1kIH.mjs} +0 -0
- /package/dist/{brands-BhALBkX2.mjs → brands-C4M04Man.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-B7bSMYLe.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
- /package/dist/{clear-BgF8No7D.mjs → clear-DS0eRXOc.mjs} +0 -0
- /package/dist/{cli-types-BsTty22w.mjs → cli-types-C3nVfpSG.mjs} +0 -0
- /package/dist/{connector-telemetry-events-latest-BY2556uL.mjs → connector-telemetry-events-latest-CKKG6_pD.mjs} +0 -0
- /package/dist/{connector-telemetry-snapshots-latest-BHYdxUEF.mjs → connector-telemetry-snapshots-latest-Bv5OddJr.mjs} +0 -0
- /package/dist/{domain-info-C50W5GhA.mjs → domain-info-BUiaGCEq.mjs} +0 -0
- /package/dist/{health-BFNZqiAm.mjs → health-vX6Ml2Na.mjs} +0 -0
- /package/dist/{input-validation-Bav2M9F-.mjs → input-validation-1esLElok.mjs} +0 -0
- /package/dist/{internal-BTeSewwB.mjs → internal-ROz7anul.mjs} +0 -0
- /package/dist/{live-Dkiyu30_.mjs → live-CSxvigCS.mjs} +0 -0
- /package/dist/{metadata-8AkOftcB.mjs → metadata-DEqBUaSv.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Dz-Wv1T0.mjs → rate-limit-analytics-CgHgKjmV.mjs} +0 -0
- /package/dist/{ready-TKOkKeRg.mjs → ready-6G9zVGPJ.mjs} +0 -0
- /package/dist/{recent-submissions-3Asm6eIi.mjs → recent-submissions-B3Smh-QM.mjs} +0 -0
- /package/dist/{refute-BVz9nMyd.mjs → refute-DjkmLSNe.mjs} +0 -0
- /package/dist/{resolve-CeBbH6Pq.mjs → resolve-DEvdeprv.mjs} +0 -0
- /package/dist/{scan-logo-ZteA-PUV.mjs → scan-logo-545qLcGs.mjs} +0 -0
- /package/dist/{scan-page-DWDSyzQ7.mjs → scan-page-DRQiVufl.mjs} +0 -0
- /package/dist/{search-DGNc37HK.mjs → search-CXbqFoqe.mjs} +0 -0
- /package/dist/{signed-url-B5Qpn2mn.mjs → signed-url-rU_nvgFA.mjs} +0 -0
- /package/dist/{submission-info-FjUolE6A.mjs → submission-info-D6PgXNQP.mjs} +0 -0
- /package/dist/{theme-CeVf-5qG.mjs → theme-CrIBazAF.mjs} +0 -0
- /package/dist/{total-queries-NHJj1HGq.mjs → total-queries-XkFyu8H5.mjs} +0 -0
- /package/dist/{tracked-domains-CniKVHIp.mjs → tracked-domains-CmcRXHj_.mjs} +0 -0
- /package/dist/{verify-DS1PWAJe.mjs → verify-CM1NakP0.mjs} +0 -0
package/dist/config.d.mts
CHANGED
|
@@ -1,1645 +1,1730 @@
|
|
|
1
1
|
|
|
2
2
|
import { Pipeline, PipelineRecord } from "cloudflare:pipelines";
|
|
3
3
|
|
|
4
|
-
//#region ../../node_modules/.pnpm/@cloudflare+config@0.
|
|
5
|
-
//#region src/
|
|
4
|
+
//#region ../../node_modules/.pnpm/@cloudflare+config@0.17.0/node_modules/@cloudflare/config/dist/public-fVh2BrM5.d.mts
|
|
5
|
+
//#region src/exports.d.ts
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* Storage backend for the Durable Object.
|
|
8
|
+
*
|
|
9
|
+
* Containers are only supported on the SQLite storage engine, so `container` is
|
|
10
|
+
* only offered alongside `storage: "sqlite"`.
|
|
8
11
|
*/
|
|
9
|
-
type
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
dev?: BindingDevOptions;
|
|
23
|
-
}
|
|
12
|
+
type DurableObjectStorageOptions<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = {
|
|
13
|
+
/**
|
|
14
|
+
* Selects the SQLite-backed storage engine (recommended for new
|
|
15
|
+
* classes).
|
|
16
|
+
*/
|
|
17
|
+
storage: "sqlite";
|
|
18
|
+
/**
|
|
19
|
+
* Attach a Container application to this Durable Object by config reference.
|
|
20
|
+
*/
|
|
21
|
+
container?: TContainer;
|
|
22
|
+
} | {
|
|
23
|
+
/** Selects the legacy key-value storage engine. */storage: "legacy-kv";
|
|
24
|
+
};
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
26
|
+
* Declares a provisioned Durable Object class exported from this Worker.
|
|
27
|
+
*
|
|
28
|
+
* For more information about Durable Objects, see the documentation at
|
|
29
|
+
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
30
|
+
*
|
|
31
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
27
32
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
interface AiBindingOptions {
|
|
32
|
-
/** Options that only apply during local development. */
|
|
33
|
-
dev?: BindingDevOptions;
|
|
34
|
-
}
|
|
33
|
+
type DurableObjectCreatedExportOptions<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = {
|
|
34
|
+
state?: "created";
|
|
35
|
+
} & DurableObjectStorageOptions<TContainer>;
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
+
* Retire a provisioned Durable Object namespace whose class has
|
|
38
|
+
* been removed from code.
|
|
37
39
|
*
|
|
38
|
-
*
|
|
40
|
+
* During deploy, the class must not be exported in the uploaded code, and no
|
|
41
|
+
* other Worker may hold a `durableObject` binding to the namespace.
|
|
39
42
|
*/
|
|
40
|
-
interface
|
|
41
|
-
|
|
43
|
+
interface DurableObjectDeletedExportOptions {
|
|
44
|
+
state: "deleted";
|
|
42
45
|
}
|
|
43
46
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
+
* Rename a provisioned Durable Object namespace's class. The
|
|
48
|
+
* `renamedTo` value must also appear as a live (`state: "created"`)
|
|
49
|
+
* `durableObject` entry in the same `exports` map.
|
|
47
50
|
*/
|
|
48
|
-
interface
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
dev?: BindingDevOptions;
|
|
51
|
+
interface DurableObjectRenamedExportOptions {
|
|
52
|
+
state: "renamed";
|
|
53
|
+
/**
|
|
54
|
+
* The destination class name. Must be a valid JavaScript identifier and
|
|
55
|
+
* must appear as a live (`state: "created"`) `durableObject` entry in the
|
|
56
|
+
* same `exports` map.
|
|
57
|
+
*/
|
|
58
|
+
renamedTo: string;
|
|
57
59
|
}
|
|
58
60
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
+
* Transfer ownership of a Durable Object namespace to another Worker in the same account.
|
|
62
|
+
* The target Worker must first deploy an `expectingTransfer` entry naming this Worker via `transferFrom`.
|
|
61
63
|
*/
|
|
62
|
-
interface
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
/** Options that only apply during local development. */
|
|
69
|
-
dev?: BindingDevOptions;
|
|
64
|
+
interface DurableObjectTransferredExportOptions {
|
|
65
|
+
state: "transferred";
|
|
66
|
+
/**
|
|
67
|
+
* The destination Worker. Must reference a Worker in the same account.
|
|
68
|
+
*/
|
|
69
|
+
transferredTo: string;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
72
|
+
* Prepare to receive cross-Worker Durable Object transfer.
|
|
73
|
+
* Once the source Worker's `transferred` export is deployed, this entry becomes a normal live `durable-object` export.
|
|
74
74
|
*/
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
type DurableObjectExpectingTransferExportOptions<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = {
|
|
76
|
+
state: "expecting-transfer";
|
|
77
|
+
/**
|
|
78
|
+
* The source Worker for the two-phase cross-Worker transfer.
|
|
79
|
+
*/
|
|
80
|
+
transferFrom: string;
|
|
81
|
+
} & DurableObjectStorageOptions<TContainer>;
|
|
82
|
+
type DurableObjectCreatedExport<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = DurableObjectCreatedExportOptions<TContainer> & {
|
|
83
|
+
type: "durable-object";
|
|
84
|
+
};
|
|
85
|
+
interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
|
|
86
|
+
type: "durable-object";
|
|
77
87
|
}
|
|
78
|
-
interface
|
|
79
|
-
|
|
80
|
-
name?: string;
|
|
88
|
+
interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
|
|
89
|
+
type: "durable-object";
|
|
81
90
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
*
|
|
85
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
86
|
-
*/
|
|
87
|
-
interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOptions {
|
|
88
|
-
type: "analytics-engine-dataset";
|
|
91
|
+
interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
|
|
92
|
+
type: "durable-object";
|
|
89
93
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
type DurableObjectExpectingTransferExport<TContainer extends ContainerDefinition | undefined = ContainerDefinition | undefined> = DurableObjectExpectingTransferExportOptions<TContainer> & {
|
|
95
|
+
type: "durable-object";
|
|
96
|
+
};
|
|
97
|
+
type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
|
|
98
|
+
type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
|
|
99
|
+
interface WorkerEntrypointExportOptions {
|
|
100
|
+
cache?: {
|
|
101
|
+
/** Whether cache is enabled for this entrypoint. */enabled: boolean;
|
|
102
|
+
};
|
|
95
103
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
* storage on Cloudflare Workers.
|
|
99
|
-
*/
|
|
100
|
-
interface ArtifactsBinding extends ArtifactsBindingOptions {
|
|
101
|
-
type: "artifacts";
|
|
104
|
+
interface WorkerEntrypointExport extends WorkerEntrypointExportOptions {
|
|
105
|
+
type: "worker";
|
|
102
106
|
}
|
|
103
107
|
/**
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
108
|
+
* Configuration for named exports declared by the Worker. Each entry's
|
|
109
|
+
* key is the exported class name; the value configures the export.
|
|
107
110
|
*/
|
|
108
|
-
interface
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
interface Exports {
|
|
112
|
+
/**
|
|
113
|
+
* Declares a Durable Object class defined by this Worker.
|
|
114
|
+
*
|
|
115
|
+
* For more information about Durable Objects, see the documentation at
|
|
116
|
+
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
117
|
+
*
|
|
118
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
119
|
+
*/
|
|
120
|
+
durableObject<TContainer extends ContainerDefinition | undefined = undefined>(options: DurableObjectCreatedExportOptions<TContainer>): DurableObjectCreatedExport<TContainer>;
|
|
121
|
+
/**
|
|
122
|
+
* Retire a provisioned Durable Object namespace whose class has been removed from code.
|
|
123
|
+
*/
|
|
124
|
+
durableObject(options: DurableObjectDeletedExportOptions): DurableObjectDeletedExport;
|
|
125
|
+
/**
|
|
126
|
+
* Rename a provisioned Durable Object namespace's class.
|
|
127
|
+
*/
|
|
128
|
+
durableObject(options: DurableObjectRenamedExportOptions): DurableObjectRenamedExport;
|
|
129
|
+
/**
|
|
130
|
+
* Transfer ownership of a Durable Object namespace to another Worker in the same account.
|
|
131
|
+
*/
|
|
132
|
+
durableObject(options: DurableObjectTransferredExportOptions): DurableObjectTransferredExport;
|
|
133
|
+
/**
|
|
134
|
+
* Prepare to receive cross-Worker Durable Object transfer.
|
|
135
|
+
* The source Worker must follow up with a deployment containing a `transferred` export to commit the transfer.
|
|
136
|
+
*/
|
|
137
|
+
durableObject<TContainer extends ContainerDefinition | undefined = undefined>(options: DurableObjectExpectingTransferExportOptions<TContainer>): DurableObjectExpectingTransferExport<TContainer>;
|
|
138
|
+
durableObject(options: DurableObjectExportOptions): DurableObjectExports;
|
|
139
|
+
/** Declares a WorkerEntrypoint export defined by this Worker. */
|
|
140
|
+
worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;
|
|
114
141
|
}
|
|
115
142
|
/**
|
|
116
|
-
*
|
|
143
|
+
* Exports builder for configuring Worker exports.
|
|
117
144
|
*
|
|
118
|
-
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* import { defineConfig, defineContainer, defineWorker, exports } from "@cloudflare/config";
|
|
148
|
+
*
|
|
149
|
+
* const myContainer = defineContainer({
|
|
150
|
+
* name: "my-container",
|
|
151
|
+
* image: { dockerfile: "./Dockerfile" },
|
|
152
|
+
* });
|
|
153
|
+
*
|
|
154
|
+
* const worker = defineWorker({
|
|
155
|
+
* exports: {
|
|
156
|
+
* MyDurableObject: exports.durableObject({ storage: "sqlite" }),
|
|
157
|
+
* MyContainerDO: exports.durableObject({ storage: "sqlite", container: myContainer }),
|
|
158
|
+
* OldClass: exports.durableObject({ state: "deleted" }),
|
|
159
|
+
* OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
|
|
160
|
+
* Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
|
|
161
|
+
* Incoming: exports.durableObject({ state: "expecting-transfer", storage: "sqlite", transferFrom: "source-worker" }),
|
|
162
|
+
* },
|
|
163
|
+
* });
|
|
164
|
+
*
|
|
165
|
+
* export default defineConfig({ worker, containers: [myContainer] });
|
|
166
|
+
* ```
|
|
119
167
|
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
interface D1BindingOptions {
|
|
124
|
-
/** The UUID of this D1 database (not required). */
|
|
125
|
-
id?: string;
|
|
126
|
-
/** The name of this D1 database. */
|
|
127
|
-
name?: string;
|
|
128
|
-
/** Options that only apply during local development. */
|
|
129
|
-
dev?: BindingDevOptions;
|
|
130
|
-
}
|
|
168
|
+
declare const exports: Exports; //#endregion
|
|
169
|
+
//#region src/inference.d.ts
|
|
131
170
|
/**
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
171
|
+
* The Worker's entry module, imported with the `{ type: "cf-worker" }` import attribute
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* import * as entrypoint from "./src" with { type: "cf-worker" };
|
|
175
|
+
* ```
|
|
135
176
|
*/
|
|
136
|
-
|
|
137
|
-
type: "d1";
|
|
138
|
-
}
|
|
139
|
-
interface DispatchNamespaceBindingOptions {
|
|
140
|
-
/** The namespace to bind to. */
|
|
141
|
-
namespace?: string;
|
|
142
|
-
/** Details about the outbound Worker which will handle outbound requests from your namespace. */
|
|
143
|
-
outbound?: {
|
|
144
|
-
/** Name of the Worker handling the outbound requests. */worker: string; /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler. */
|
|
145
|
-
parameters?: string[];
|
|
146
|
-
};
|
|
147
|
-
/** Options that only apply during local development. */
|
|
148
|
-
dev?: BindingDevOptions;
|
|
149
|
-
}
|
|
177
|
+
type WorkerModule = Record<string, any>;
|
|
150
178
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
179
|
+
* Default module type representing an unknown Worker's exports.
|
|
180
|
+
* - default export can be `ExportedHandler` or a `WorkerEntrypoint` class constructor
|
|
181
|
+
* - named exports can be `WorkerEntrypoint`, `DurableObject`, or `WorkflowEntrypoint` class constructors
|
|
154
182
|
*/
|
|
155
|
-
interface
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
interface DurableObjectBindingOptions {
|
|
159
|
-
/** The name of the Worker that defines the Durable Object class. */
|
|
160
|
-
worker: string;
|
|
161
|
-
/** The exported class name of the Durable Object. */
|
|
162
|
-
exportName: string;
|
|
183
|
+
interface DefaultModule {
|
|
184
|
+
default?: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded>;
|
|
185
|
+
[key: string]: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded> | Constructor<Rpc.DurableObjectBranded> | Constructor<Rpc.WorkflowEntrypointBranded> | undefined;
|
|
163
186
|
}
|
|
164
187
|
/**
|
|
165
|
-
*
|
|
166
|
-
* that defines the class; `exportName` is the exported class name.
|
|
167
|
-
*
|
|
168
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
188
|
+
* Represents a class constructor that creates instances of TInstance.
|
|
169
189
|
*/
|
|
170
|
-
|
|
171
|
-
type: "durable-object";
|
|
172
|
-
}
|
|
190
|
+
type Constructor<TInstance> = new (...args: any[]) => TInstance;
|
|
173
191
|
/**
|
|
174
|
-
*
|
|
175
|
-
* that defines the class; `exportName` is the exported class name.
|
|
176
|
-
*
|
|
177
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
192
|
+
* Extracts the instance type from a class constructor if it extends `TInstance`.
|
|
178
193
|
*/
|
|
179
|
-
|
|
180
|
-
worker: string;
|
|
181
|
-
exportName: TExportName$1;
|
|
182
|
-
/** @internal Carries the config type for inference */
|
|
183
|
-
__config: TConfig$1;
|
|
184
|
-
}
|
|
185
|
-
interface FlagshipBindingOptions {
|
|
186
|
-
/** The Flagship app ID to bind to. */
|
|
187
|
-
id?: string;
|
|
188
|
-
/** Options that only apply during local development. */
|
|
189
|
-
dev?: BindingDevOptions;
|
|
190
|
-
}
|
|
191
|
-
/** Binding to a Flagship feature-flag service. */
|
|
192
|
-
interface FlagshipBinding extends FlagshipBindingOptions {
|
|
193
|
-
type: "flagship";
|
|
194
|
-
}
|
|
195
|
-
interface HyperdriveBindingOptions {
|
|
196
|
-
/** The ID of the Hyperdrive configuration. */
|
|
197
|
-
id: string;
|
|
198
|
-
/** Options that only apply during local development. */
|
|
199
|
-
dev?: {
|
|
200
|
-
/** The database connection string used during local development. */connectionString?: string;
|
|
201
|
-
};
|
|
202
|
-
}
|
|
194
|
+
type ExtractInstance<T$1, TInstance> = T$1 extends Constructor<TInstance> ? InstanceType<T$1> : never;
|
|
203
195
|
/**
|
|
204
|
-
*
|
|
196
|
+
* Mapping from binding type literals to Cloudflare runtime types.
|
|
205
197
|
*
|
|
206
|
-
*
|
|
198
|
+
* Entries fall into two groups:
|
|
199
|
+
* - Parameterized bindings (ai, json, kv, pipeline, queue, text) refine their
|
|
200
|
+
* runtime type from the binding instance via nominal matches against the
|
|
201
|
+
* `Typed*Binding` / `JsonBinding` / `TextBinding` interfaces from
|
|
202
|
+
* `./bindings`. When `TBinding` does not match, the entry falls back to the
|
|
203
|
+
* unparameterized runtime type.
|
|
204
|
+
* - Non-parameterized bindings map their type literal directly to a runtime
|
|
205
|
+
* type and ignore `TBinding`.
|
|
206
|
+
*
|
|
207
|
+
* IMPORTANT: The right-hand-side identifiers in this map (e.g. `KVNamespace`,
|
|
208
|
+
* `ImagesBinding`, `Fetcher`) must resolve to the ambient runtime types from
|
|
209
|
+
* `@cloudflare/workers-types`, not to local config interfaces. Several local
|
|
210
|
+
* binding interfaces in `./bindings.ts` (`ImagesBinding`, `MediaBinding`,
|
|
211
|
+
* `StreamBinding`) share names with ambient globals — importing those local
|
|
212
|
+
* types into this file silently shadows the globals and breaks `InferEnv`.
|
|
213
|
+
* Only import the `Typed*Binding`, `JsonBinding`, and `TextBinding` interfaces
|
|
214
|
+
* from `./bindings` (their names do not collide with ambient globals); never
|
|
215
|
+
* widen the import to a wildcard or to the plain `*Binding` interfaces.
|
|
207
216
|
*/
|
|
208
|
-
interface
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
217
|
+
interface BindingTypeMap<TBinding> {
|
|
218
|
+
ai: TBinding extends TypedAiBinding<infer T> ? Ai<T> : Ai;
|
|
219
|
+
json: TBinding extends JsonBinding<infer T> ? T : never;
|
|
220
|
+
kv: TBinding extends TypedKvBinding<infer T> ? KVNamespace<T> : KVNamespace;
|
|
221
|
+
pipeline: TBinding extends TypedPipelineBinding<infer T> ? Pipeline<T> : Pipeline;
|
|
222
|
+
queue: TBinding extends TypedQueueBinding<infer T> ? Queue<T> : Queue;
|
|
223
|
+
text: TBinding extends TextBinding<infer T> ? T : never;
|
|
224
|
+
"agent-memory": AgentMemoryNamespace;
|
|
225
|
+
"ai-search": AiSearchInstance;
|
|
226
|
+
"ai-search-namespace": AiSearchNamespace;
|
|
227
|
+
"analytics-engine-dataset": AnalyticsEngineDataset;
|
|
228
|
+
artifacts: Artifacts;
|
|
229
|
+
assets: Fetcher;
|
|
230
|
+
browser: BrowserRun;
|
|
231
|
+
d1: D1Database;
|
|
232
|
+
"dispatch-namespace": DispatchNamespace;
|
|
233
|
+
"durable-object": DurableObjectNamespace;
|
|
234
|
+
flagship: Flagship;
|
|
235
|
+
hyperdrive: Hyperdrive;
|
|
236
|
+
images: ImagesBinding;
|
|
237
|
+
logfwdr: any;
|
|
238
|
+
media: MediaBinding;
|
|
239
|
+
"mtls-certificate": Fetcher;
|
|
240
|
+
"rate-limit": RateLimit;
|
|
241
|
+
r2: R2Bucket;
|
|
242
|
+
secret: string;
|
|
243
|
+
"secrets-store-secret": SecretsStoreSecret;
|
|
244
|
+
"send-email": SendEmail;
|
|
245
|
+
stream: StreamBinding;
|
|
246
|
+
vectorize: VectorizeIndex;
|
|
247
|
+
"version-metadata": WorkerVersionMetadata;
|
|
248
|
+
"vpc-service": Fetcher;
|
|
249
|
+
"vpc-network": Fetcher;
|
|
250
|
+
worker: Fetcher;
|
|
251
|
+
"worker-loader": WorkerLoader;
|
|
252
|
+
workflow: Workflow;
|
|
214
253
|
}
|
|
254
|
+
type SelectedWorkerExportName<TBinding> = TBinding extends {
|
|
255
|
+
exportName?: infer TExportName;
|
|
256
|
+
} ? TExportName extends string ? TExportName : "default" : "default";
|
|
257
|
+
type InferBindingType<TBinding> = TBinding extends {
|
|
258
|
+
type: "worker";
|
|
259
|
+
worker: infer TWorker extends WorkerReference;
|
|
260
|
+
} ? TWorker extends string ? Fetcher : InferMainModule<UnwrapConfig<TWorker>> extends infer TModule extends WorkerModule ? SelectedWorkerExportName<TBinding> extends infer TExportName ? TExportName extends keyof TModule ? TModule[TExportName] extends Constructor<any> ? Fetcher<ExtractInstance<TModule[TExportName], Rpc.WorkerEntrypointBranded>> : Fetcher : never : never : never : TBinding extends {
|
|
261
|
+
type: "durable-object";
|
|
262
|
+
worker: infer TWorker extends WorkerReference;
|
|
263
|
+
exportName: infer TExportName extends string;
|
|
264
|
+
} ? TWorker extends string ? DurableObjectNamespace : InferMainModule<UnwrapConfig<TWorker>> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? DurableObjectNamespace<ExtractInstance<TModule[TExportName], Rpc.DurableObjectBranded>> : never : never : TBinding extends {
|
|
265
|
+
type: "workflow";
|
|
266
|
+
worker: infer TWorker extends WorkerReference;
|
|
267
|
+
exportName: infer TExportName extends string;
|
|
268
|
+
} ? TWorker extends string ? Workflow : InferMainModule<UnwrapConfig<TWorker>> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? ExtractInstance<TModule[TExportName], Rpc.WorkflowEntrypointBranded> extends infer TWorkflow ? TWorkflow extends {
|
|
269
|
+
run(event: {
|
|
270
|
+
payload: infer P;
|
|
271
|
+
}, step: any): any;
|
|
272
|
+
} ? Workflow<P> : Workflow : Workflow : never : never : TBinding extends {
|
|
273
|
+
type: `unsafe:${string}`;
|
|
274
|
+
} ? any : TBinding extends {
|
|
275
|
+
type: infer K extends keyof BindingTypeMap<TBinding>;
|
|
276
|
+
} ? BindingTypeMap<TBinding>[K] : never;
|
|
215
277
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
278
|
+
* Infer export names from a config's exports, optionally filtered by type.
|
|
279
|
+
* When TExportType is `string` (default), returns all export names.
|
|
280
|
+
* When TExportType is a specific literal like `"durable-object"` or `"workflow"`,
|
|
281
|
+
* returns only exports of that type.
|
|
219
282
|
*/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
283
|
+
type InferExportsByType<TUnwrappedConfig, TExportType extends string = string> = TUnwrappedConfig extends {
|
|
284
|
+
exports: infer TExports extends Record<string, {
|
|
285
|
+
type: string;
|
|
286
|
+
}>;
|
|
287
|
+
} ? { [K in keyof TExports]: TExports[K] extends {
|
|
288
|
+
type: TExportType;
|
|
289
|
+
} ? K & string : never }[keyof TExports] : never;
|
|
223
290
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
291
|
+
* Infer `WorkerEntrypoint` export names from a config.
|
|
292
|
+
* Returns named module exports that are not declared as type `"durable-object"` or `"workflow"` in `exports`.
|
|
293
|
+
* Excludes `"default"` since `exportName` should only be provided for named exports.
|
|
226
294
|
*/
|
|
227
|
-
|
|
228
|
-
type: "json";
|
|
229
|
-
/** The JSON value made available to the Worker. */
|
|
230
|
-
value: T$1;
|
|
231
|
-
}
|
|
232
|
-
interface KvBindingOptions {
|
|
233
|
-
/** The ID of the KV namespace. */
|
|
234
|
-
id?: string;
|
|
235
|
-
/** Options that only apply during local development. */
|
|
236
|
-
dev?: BindingDevOptions;
|
|
237
|
-
}
|
|
295
|
+
type InferWorkerEntrypointExports<TUnwrappedConfig> = Exclude<keyof InferMainModule<TUnwrappedConfig> & string, "default" | InferExportsByType<TUnwrappedConfig, "durable-object" | "workflow">>;
|
|
238
296
|
/**
|
|
239
|
-
*
|
|
297
|
+
* Unwrap function and promise types to get the underlying config.
|
|
298
|
+
* Use this to normalize a config before passing it to other inference utilities.
|
|
299
|
+
*/
|
|
300
|
+
type UnwrapConfig<TConfig> = TConfig extends ((...args: any[]) => infer TReturn) ? UnwrapConfig<TReturn> : TConfig extends Promise<infer TCompletion> ? UnwrapConfig<TCompletion> : TConfig;
|
|
301
|
+
/**
|
|
302
|
+
* Infer the `Env` interface type from a Worker config.
|
|
240
303
|
*
|
|
241
|
-
*
|
|
304
|
+
* Transforms a config object's `env` bindings into their
|
|
305
|
+
* corresponding Cloudflare runtime types.
|
|
306
|
+
*
|
|
307
|
+
* @example
|
|
308
|
+
* ```typescript
|
|
309
|
+
* import { defineWorker, bindings } from "@cloudflare/config";
|
|
310
|
+
* import type { InferEnv, UnwrapConfig } from "@cloudflare/config";
|
|
311
|
+
*
|
|
312
|
+
* const config = defineWorker({
|
|
313
|
+
* env: {
|
|
314
|
+
* MY_JSON: bindings.json({ id: string }),
|
|
315
|
+
* MY_KV: bindings.kv(),
|
|
316
|
+
* },
|
|
317
|
+
* });
|
|
318
|
+
*
|
|
319
|
+
* type WorkerConfig = UnwrapConfig<typeof config>;
|
|
320
|
+
* // Inferred as: { MY_JSON: { id: string }; MY_KV: KVNamespace }
|
|
321
|
+
* export type Env = InferEnv<WorkerConfig>;
|
|
322
|
+
* ```
|
|
242
323
|
*/
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
324
|
+
type InferEnv<TUnwrappedConfig> = TUnwrappedConfig extends {
|
|
325
|
+
env: infer TEnv extends Record<string, any>;
|
|
326
|
+
} ? { [K in keyof TEnv]: InferBindingType<TEnv[K]> } : never;
|
|
246
327
|
/**
|
|
247
|
-
*
|
|
328
|
+
* Infer the Durable Object namespace names from a Worker config's exports.
|
|
329
|
+
* Returns a union of export names that declare a *live* Durable Object —
|
|
330
|
+
* `type: "durable-object"` with `state` either omitted, `"created"`, or
|
|
331
|
+
* `"expecting-transfer"`. Tombstone entries (`deleted`, `renamed`,
|
|
332
|
+
* `transferred`) are excluded because they retire the namespace and a
|
|
333
|
+
* binding to a tombstoned class would fail at deploy time.
|
|
248
334
|
*
|
|
249
|
-
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```typescript
|
|
337
|
+
* import { defineWorker } from "@cloudflare/config";
|
|
338
|
+
* import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
|
|
339
|
+
*
|
|
340
|
+
* const config = defineWorker({
|
|
341
|
+
* exports: {
|
|
342
|
+
* MyDurableObject: { type: "durable-object", storage: "sqlite" },
|
|
343
|
+
* OldGone: { type: "durable-object", state: "deleted" },
|
|
344
|
+
* },
|
|
345
|
+
* });
|
|
346
|
+
*
|
|
347
|
+
* type WorkerConfig = UnwrapConfig<typeof config>;
|
|
348
|
+
* // Inferred as: "MyDurableObject" (the deleted tombstone is excluded)
|
|
349
|
+
* type DurableNamespaces = InferDurableNamespaces<WorkerConfig>;
|
|
350
|
+
* ```
|
|
250
351
|
*/
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
352
|
+
type InferDurableNamespaces<TUnwrappedConfig> = TUnwrappedConfig extends {
|
|
353
|
+
exports: infer TExports extends Record<string, {
|
|
354
|
+
type: string;
|
|
355
|
+
}>;
|
|
356
|
+
} ? { [K in keyof TExports]: TExports[K] extends {
|
|
357
|
+
type: "durable-object";
|
|
358
|
+
} ? TExports[K] extends {
|
|
359
|
+
state: "deleted" | "renamed" | "transferred";
|
|
360
|
+
} ? never : K & string : never }[keyof TExports] : never;
|
|
361
|
+
/**
|
|
362
|
+
* Infer the main module type from a Worker config's entrypoint.
|
|
363
|
+
* If entrypoint is a module namespace object, returns that type.
|
|
364
|
+
* If entrypoint is a `string` or not present, returns `DefaultModule` as a fallback.
|
|
365
|
+
*/
|
|
366
|
+
type InferMainModule<TUnwrappedConfig> = TUnwrappedConfig extends {
|
|
367
|
+
entrypoint: infer TModule extends WorkerModule;
|
|
368
|
+
} ? TModule : DefaultModule; //#endregion
|
|
369
|
+
//#region src/triggers.d.ts
|
|
370
|
+
interface FetchTriggerOptions {
|
|
371
|
+
/**
|
|
372
|
+
* A route that your Worker should be published to.
|
|
373
|
+
*
|
|
374
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
375
|
+
*/
|
|
376
|
+
pattern: string;
|
|
377
|
+
/**
|
|
378
|
+
* The DNS zone the pattern is attached to. Required when the
|
|
379
|
+
* pattern is ambiguous.
|
|
380
|
+
*/
|
|
381
|
+
zone?: string;
|
|
276
382
|
}
|
|
277
383
|
/**
|
|
278
|
-
*
|
|
384
|
+
* Fetch trigger — a route that your Worker should be published to.
|
|
279
385
|
*
|
|
280
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
386
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
281
387
|
*/
|
|
282
|
-
interface
|
|
283
|
-
type: "
|
|
388
|
+
interface FetchTrigger extends FetchTriggerOptions {
|
|
389
|
+
type: "fetch";
|
|
284
390
|
}
|
|
285
|
-
interface
|
|
286
|
-
/**
|
|
391
|
+
interface QueueConsumerTriggerOptions {
|
|
392
|
+
/** The name of the queue from which this consumer should consume. */
|
|
287
393
|
name: string;
|
|
288
|
-
/**
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
dev?: BindingDevOptions;
|
|
394
|
+
/** The queue to send messages that failed to be consumed. */
|
|
395
|
+
deadLetterQueue?: string;
|
|
396
|
+
/** The maximum number of messages per batch. */
|
|
397
|
+
maxBatchSize?: number;
|
|
398
|
+
/** The maximum number of seconds to wait to fill a batch with messages. */
|
|
399
|
+
maxBatchTimeout?: number;
|
|
400
|
+
/**
|
|
401
|
+
* The maximum number of concurrent consumer Worker invocations.
|
|
402
|
+
* Leaving this unset will allow your consumer to scale to the
|
|
403
|
+
* maximum concurrency needed to keep up with the message backlog.
|
|
404
|
+
*/
|
|
405
|
+
maxConcurrency?: number | null;
|
|
406
|
+
/** The maximum number of retries for each message. */
|
|
407
|
+
maxRetries?: number;
|
|
408
|
+
/** The number of seconds to wait before retrying a message. */
|
|
409
|
+
retryDelay?: number;
|
|
410
|
+
/** The number of milliseconds to wait for pulled messages to become visible again. */
|
|
411
|
+
visibilityTimeoutMs?: number;
|
|
307
412
|
}
|
|
308
413
|
/**
|
|
309
|
-
*
|
|
414
|
+
* Queue consumer trigger — invokes this Worker when messages arrive on the
|
|
415
|
+
* named queue.
|
|
310
416
|
*
|
|
311
417
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
312
418
|
*/
|
|
313
|
-
interface
|
|
419
|
+
interface QueueConsumerTrigger extends QueueConsumerTriggerOptions {
|
|
314
420
|
type: "queue";
|
|
315
421
|
}
|
|
422
|
+
interface ScheduledTriggerOptions {
|
|
423
|
+
/**
|
|
424
|
+
* A "cron" definition to trigger a Worker's "scheduled" function.
|
|
425
|
+
*
|
|
426
|
+
* Lets you call Workers periodically, much like a cron job.
|
|
427
|
+
*
|
|
428
|
+
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
429
|
+
*/
|
|
430
|
+
schedule: string;
|
|
431
|
+
}
|
|
316
432
|
/**
|
|
317
|
-
*
|
|
433
|
+
* Scheduled (cron) trigger — invokes this Worker on the given schedules.
|
|
318
434
|
*
|
|
319
|
-
*
|
|
435
|
+
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
320
436
|
*/
|
|
321
|
-
interface
|
|
322
|
-
|
|
323
|
-
__typeParams: [TBody];
|
|
437
|
+
interface ScheduledTrigger extends ScheduledTriggerOptions {
|
|
438
|
+
type: "scheduled";
|
|
324
439
|
}
|
|
325
|
-
interface
|
|
326
|
-
/**
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
accessKeyId: string;
|
|
334
|
-
secretAccessKey: string;
|
|
335
|
-
};
|
|
336
|
-
};
|
|
440
|
+
interface EmailTriggerOptions {
|
|
441
|
+
/**
|
|
442
|
+
* Inbound Email Routing addresses handled by this Worker.
|
|
443
|
+
*
|
|
444
|
+
* Each entry is a literal recipient address (e.g. `"support@example.com"`)
|
|
445
|
+
* or a `*@domain` catch-all (e.g. `"*@example.com"`).
|
|
446
|
+
*/
|
|
447
|
+
addresses: string[];
|
|
337
448
|
}
|
|
338
449
|
/**
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
450
|
+
* Email trigger — invokes this Worker for the configured Email Routing
|
|
451
|
+
* addresses.
|
|
342
452
|
*/
|
|
343
|
-
interface
|
|
344
|
-
type: "
|
|
345
|
-
}
|
|
346
|
-
interface RateLimitBindingOptions {
|
|
347
|
-
/** The namespace ID for this rate limiter. */
|
|
348
|
-
namespace: string;
|
|
349
|
-
/** Simple rate limiting configuration. */
|
|
350
|
-
simple: {
|
|
351
|
-
/** The maximum number of requests allowed in the time period. */limit: number; /** The time period in seconds (10 for ten seconds, 60 for one minute). */
|
|
352
|
-
period: 10 | 60;
|
|
353
|
-
};
|
|
453
|
+
interface EmailTrigger extends EmailTriggerOptions {
|
|
454
|
+
type: "email";
|
|
354
455
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
456
|
+
interface ConnectTriggerOptions {
|
|
457
|
+
/** The transport protocol to listen for. */
|
|
458
|
+
protocol: "tcp";
|
|
459
|
+
/** The port to listen on. */
|
|
460
|
+
port: number;
|
|
461
|
+
/** The address to bind to. Defaults to `127.0.0.1`. */
|
|
462
|
+
address?: string;
|
|
358
463
|
}
|
|
359
464
|
/**
|
|
360
|
-
*
|
|
361
|
-
* the
|
|
362
|
-
*
|
|
363
|
-
* When defined, this binding:
|
|
364
|
-
* - Replaces .dev.vars/.env/process.env inference for type generation
|
|
365
|
-
* - Enables local dev validation with warnings for missing secrets
|
|
366
|
-
*
|
|
367
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
|
|
465
|
+
* Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
|
|
466
|
+
* handler for raw socket connections received on the configured
|
|
467
|
+
* protocol/port.
|
|
368
468
|
*/
|
|
369
|
-
interface
|
|
370
|
-
type: "
|
|
371
|
-
}
|
|
372
|
-
interface SecretsStoreSecretBindingOptions {
|
|
373
|
-
/** ID of the secret store. */
|
|
374
|
-
storeId: string;
|
|
375
|
-
/** Name of the secret. */
|
|
376
|
-
secretName: string;
|
|
377
|
-
}
|
|
378
|
-
/** Binding to a Secrets Store secret. */
|
|
379
|
-
interface SecretsStoreSecretBinding extends SecretsStoreSecretBindingOptions {
|
|
380
|
-
type: "secrets-store-secret";
|
|
469
|
+
interface ConnectTrigger extends ConnectTriggerOptions {
|
|
470
|
+
type: "connect";
|
|
381
471
|
}
|
|
382
|
-
type SendEmailDestinationOptions = {
|
|
383
|
-
/** If this binding should be restricted to a specific verified address. */destinationAddress: string;
|
|
384
|
-
allowedDestinationAddresses?: never;
|
|
385
|
-
} | {
|
|
386
|
-
destinationAddress?: never; /** If this binding should be restricted to a set of verified addresses. */
|
|
387
|
-
allowedDestinationAddresses: string[];
|
|
388
|
-
} | {
|
|
389
|
-
destinationAddress?: never;
|
|
390
|
-
allowedDestinationAddresses?: never;
|
|
391
|
-
};
|
|
392
|
-
type SendEmailBindingOptions = SendEmailDestinationOptions & {
|
|
393
|
-
/** If this binding should be restricted to a set of sender addresses. */allowedSenderAddresses?: string[]; /** Options that only apply during local development. */
|
|
394
|
-
dev?: BindingDevOptions;
|
|
395
|
-
};
|
|
396
472
|
/**
|
|
397
|
-
*
|
|
473
|
+
* Event triggers — fetch routes, queue consumers, cron schedules, Email
|
|
474
|
+
* Routing addresses, and raw sockets — that invoke this Worker.
|
|
475
|
+
* Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
476
|
+
* `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
|
|
398
477
|
*
|
|
399
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
478
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
400
479
|
*/
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
|
|
410
|
-
|
|
480
|
+
interface Triggers {
|
|
481
|
+
/**
|
|
482
|
+
* Fetch trigger — a route that your Worker should be published to.
|
|
483
|
+
*
|
|
484
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
485
|
+
*/
|
|
486
|
+
fetch(options: FetchTriggerOptions): FetchTrigger;
|
|
487
|
+
/**
|
|
488
|
+
* Queue consumer trigger — invokes this Worker when messages arrive on the
|
|
489
|
+
* named queue.
|
|
490
|
+
*
|
|
491
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
492
|
+
*/
|
|
493
|
+
queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;
|
|
494
|
+
/**
|
|
495
|
+
* Scheduled (cron) trigger — invokes this Worker on the given schedules.
|
|
496
|
+
*
|
|
497
|
+
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
498
|
+
*/
|
|
499
|
+
scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;
|
|
500
|
+
/**
|
|
501
|
+
* Email trigger — invokes this Worker for the configured Email Routing
|
|
502
|
+
* addresses.
|
|
503
|
+
*/
|
|
504
|
+
email(options: EmailTriggerOptions): EmailTrigger;
|
|
505
|
+
/**
|
|
506
|
+
* Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
|
|
507
|
+
* handler for raw socket connections received on the configured
|
|
508
|
+
* protocol/port.
|
|
509
|
+
*/
|
|
510
|
+
connect(options: ConnectTriggerOptions): ConnectTrigger;
|
|
411
511
|
}
|
|
412
512
|
/**
|
|
413
|
-
*
|
|
414
|
-
* binding name.
|
|
513
|
+
* Triggers builder for configuring event triggers.
|
|
415
514
|
*
|
|
416
|
-
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```typescript
|
|
517
|
+
* import { defineConfig, triggers } from "@cloudflare/config";
|
|
518
|
+
*
|
|
519
|
+
* export default defineConfig({
|
|
520
|
+
* worker: {
|
|
521
|
+
* name: "my-worker",
|
|
522
|
+
* compatibilityDate: "2026-09-17",
|
|
523
|
+
* triggers: [
|
|
524
|
+
* triggers.fetch({ pattern: "example.com/*", zone: "example.com" }),
|
|
525
|
+
* triggers.queue({ name: "my-queue" }),
|
|
526
|
+
* triggers.scheduled({ schedule: "0 * * * *" }),
|
|
527
|
+
* triggers.scheduled({ schedule: "30 0 * * *" }),
|
|
528
|
+
* triggers.email({ addresses: ["support@example.com"] }),
|
|
529
|
+
* triggers.connect({ protocol: "tcp", port: 5432 }),
|
|
530
|
+
* ],
|
|
531
|
+
* },
|
|
532
|
+
* });
|
|
533
|
+
* ```
|
|
417
534
|
*/
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
535
|
+
declare const triggers: Triggers; //#endregion
|
|
536
|
+
//#region src/types.d.ts
|
|
537
|
+
/** Account-level values shared by the resources in a configuration. */
|
|
538
|
+
interface Settings {
|
|
539
|
+
/**
|
|
540
|
+
* This is the ID of the account associated with your zone. It can also be
|
|
541
|
+
* specified through the `CLOUDFLARE_ACCOUNT_ID` environment variable.
|
|
542
|
+
*/
|
|
543
|
+
accountId?: string;
|
|
544
|
+
/**
|
|
545
|
+
* The compliance boundary in which commands should operate. When omitted,
|
|
546
|
+
* this can be supplied through `CLOUDFLARE_COMPLIANCE_REGION`.
|
|
547
|
+
*/
|
|
548
|
+
complianceRegion?: "public" | "fedramp-high";
|
|
422
549
|
}
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}; /** Plugin-specific options. */
|
|
430
|
-
options?: Record<string, unknown>;
|
|
431
|
-
};
|
|
432
|
-
[key: string]: unknown;
|
|
550
|
+
/** The authored shape of `cloudflare.config.ts`'s default export. */
|
|
551
|
+
interface CloudflareConfig extends Settings {
|
|
552
|
+
/** The Worker defined by this configuration. */
|
|
553
|
+
worker?: ConfigInput<WorkerConfig>;
|
|
554
|
+
/** Container applications defined by this configuration. */
|
|
555
|
+
containers?: ConfigInput<ContainerConfig>[];
|
|
433
556
|
}
|
|
434
557
|
/**
|
|
435
|
-
*
|
|
436
|
-
* by this configuration. Included in the Worker's upload metadata without
|
|
437
|
-
* changes.
|
|
558
|
+
* Union of all binding definitions accepted in `env`.
|
|
438
559
|
*/
|
|
439
|
-
|
|
440
|
-
type: `unsafe:${string}`;
|
|
441
|
-
}
|
|
442
|
-
interface VectorizeBindingOptions {
|
|
443
|
-
/** The name of the Vectorize index. */
|
|
444
|
-
name: string;
|
|
445
|
-
/** Options that only apply during local development. */
|
|
446
|
-
dev?: BindingDevOptions;
|
|
447
|
-
}
|
|
560
|
+
type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WorkerBinding | WorkerLoaderBinding;
|
|
448
561
|
/**
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
562
|
+
* Union of all trigger definitions accepted in `triggers`.
|
|
452
563
|
*/
|
|
453
|
-
|
|
454
|
-
type: "vectorize";
|
|
455
|
-
}
|
|
456
|
-
/** Binding to the Worker version's metadata. */
|
|
457
|
-
interface VersionMetadataBinding {
|
|
458
|
-
type: "version-metadata";
|
|
459
|
-
}
|
|
460
|
-
type VpcNetworkBindingOptions = {
|
|
461
|
-
/** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with `networkId`. */tunnelId: string;
|
|
462
|
-
networkId?: never; /** Options that only apply during local development. */
|
|
463
|
-
dev?: BindingDevOptions;
|
|
464
|
-
} | {
|
|
465
|
-
tunnelId?: never; /** The network ID to route traffic through. Mutually exclusive with `tunnelId`. */
|
|
466
|
-
networkId: string; /** Options that only apply during local development. */
|
|
467
|
-
dev?: BindingDevOptions;
|
|
468
|
-
};
|
|
469
|
-
/** Binding to a VPC network. */
|
|
470
|
-
type VpcNetworkBinding = VpcNetworkBindingOptions & {
|
|
471
|
-
type: "vpc-network";
|
|
472
|
-
};
|
|
473
|
-
interface VpcServiceBindingOptions {
|
|
474
|
-
/** The service ID of the VPC connectivity service. */
|
|
475
|
-
id: string;
|
|
476
|
-
/** Options that only apply during local development. */
|
|
477
|
-
dev?: BindingDevOptions;
|
|
478
|
-
}
|
|
479
|
-
/** Binding to a VPC service. */
|
|
480
|
-
interface VpcServiceBinding extends VpcServiceBindingOptions {
|
|
481
|
-
type: "vpc-service";
|
|
482
|
-
}
|
|
483
|
-
interface WebSearchBindingOptions {
|
|
484
|
-
/** Options that only apply during local development. */
|
|
485
|
-
dev?: BindingDevOptions;
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Cloudflare Web Search binding. There is exactly one shared web corpus, so
|
|
489
|
-
* the binding is zero-config — only the variable name is required.
|
|
490
|
-
*/
|
|
491
|
-
interface WebSearchBinding extends WebSearchBindingOptions {
|
|
492
|
-
type: "web-search";
|
|
493
|
-
}
|
|
494
|
-
interface WorkerBindingOptions {
|
|
495
|
-
/** The name of the bound Worker. */
|
|
496
|
-
worker: string;
|
|
497
|
-
/** The named export to bind to (defaults to the default export). */
|
|
498
|
-
exportName?: string;
|
|
499
|
-
/** Optional properties that will be made available to the service via `ctx.props`. */
|
|
500
|
-
props?: Record<string, unknown>;
|
|
501
|
-
/** Options that only apply during local development. */
|
|
502
|
-
dev?: BindingDevOptions;
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* Service binding (Worker-to-Worker). `worker` is the name of the bound
|
|
506
|
-
* Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
|
|
507
|
-
* the default export).
|
|
508
|
-
*
|
|
509
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
510
|
-
*/
|
|
511
|
-
interface WorkerBinding extends WorkerBindingOptions {
|
|
512
|
-
type: "worker";
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* Service binding (Worker-to-Worker). `worker` is the name of the bound
|
|
516
|
-
* Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
|
|
517
|
-
* the default export).
|
|
518
|
-
*
|
|
519
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
520
|
-
*/
|
|
521
|
-
interface TypedWorkerBinding<TConfig$1, TExportName$1 extends string> extends WorkerBinding {
|
|
522
|
-
worker: string;
|
|
523
|
-
exportName: TExportName$1;
|
|
524
|
-
/** @internal Carries the config type for inference */
|
|
525
|
-
__config: TConfig$1;
|
|
526
|
-
}
|
|
527
|
-
/** Binding to a Worker Loader. */
|
|
528
|
-
interface WorkerLoaderBinding {
|
|
529
|
-
type: "worker-loader";
|
|
530
|
-
}
|
|
531
|
-
interface WorkflowBindingOptions {
|
|
532
|
-
/** The name of the Worker that defines the Workflow. */
|
|
533
|
-
worker: string;
|
|
534
|
-
/** The exported class name of the Workflow. */
|
|
535
|
-
exportName: string;
|
|
536
|
-
}
|
|
537
|
-
/**
|
|
538
|
-
* Binding to a Workflow. `worker` is the name of the Worker that defines
|
|
539
|
-
* the Workflow; `exportName` is the exported `WorkflowEntrypoint` class name.
|
|
540
|
-
*/
|
|
541
|
-
interface WorkflowBinding extends WorkflowBindingOptions {
|
|
542
|
-
type: "workflow";
|
|
543
|
-
}
|
|
564
|
+
type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
|
|
544
565
|
/**
|
|
545
|
-
*
|
|
546
|
-
*
|
|
566
|
+
* Union of all export definitions accepted in `exports`. Worker entries
|
|
567
|
+
* configure WorkerEntrypoint exports. Durable Object entries configure live
|
|
568
|
+
* classes and tombstone lifecycle operations.
|
|
547
569
|
*/
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
/**
|
|
552
|
-
__config: TConfig$1;
|
|
553
|
-
}
|
|
554
|
-
interface Bindings {
|
|
555
|
-
/**
|
|
556
|
-
* Agent Memory namespace binding. Each binding is scoped to a namespace and
|
|
557
|
-
* allows agents to persist and recall memory.
|
|
558
|
-
*/
|
|
559
|
-
agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;
|
|
570
|
+
type Export = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport | WorkerEntrypointExport;
|
|
571
|
+
/** An image source accepted in an authored Container configuration. */
|
|
572
|
+
type ContainerImage = {
|
|
573
|
+
/** The path to a Dockerfile. */dockerfile: string;
|
|
560
574
|
/**
|
|
561
|
-
*
|
|
575
|
+
* Build context of the application.
|
|
562
576
|
*
|
|
563
|
-
*
|
|
564
|
-
*/
|
|
565
|
-
ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;
|
|
566
|
-
/**
|
|
567
|
-
* AI Search instance binding. Each binding is bound directly to a single
|
|
568
|
-
* pre-existing instance within the "default" namespace.
|
|
577
|
+
* @default The directory containing `dockerfile`.
|
|
569
578
|
*/
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
* allows dynamic instance CRUD within it.
|
|
574
|
-
*/
|
|
575
|
-
aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;
|
|
579
|
+
buildContext?: string; /** Image variables available to the image at build time only. */
|
|
580
|
+
buildVars?: Record<string, string>;
|
|
581
|
+
} | {
|
|
576
582
|
/**
|
|
577
|
-
*
|
|
583
|
+
* Reference to an existing image.
|
|
578
584
|
*
|
|
579
|
-
* For
|
|
585
|
+
* For supported registries, refer to
|
|
586
|
+
* https://developers.cloudflare.com/containers/guides/image-management/#use-pre-built-container-images
|
|
580
587
|
*/
|
|
581
|
-
|
|
588
|
+
reference: string;
|
|
589
|
+
};
|
|
590
|
+
/** Application-wide observability settings shared by all Containers. */
|
|
591
|
+
interface ContainerObservabilityConfig {
|
|
592
|
+
/** Whether observability is enabled. */
|
|
593
|
+
enabled?: boolean;
|
|
594
|
+
logs?: {
|
|
595
|
+
/** Whether log collection is enabled. */enabled?: boolean;
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
/** Observability settings for a standard Container application. */
|
|
599
|
+
type StandardContainerObservabilityConfig = ContainerObservabilityConfig & ({
|
|
600
|
+
/** Percentage of Container instances targeted for observability. */targetInstancePercentage?: number;
|
|
601
|
+
targetInstanceCount?: never;
|
|
602
|
+
} | {
|
|
603
|
+
targetInstancePercentage?: never; /** Number of Container instances targeted for observability. */
|
|
604
|
+
targetInstanceCount?: number;
|
|
605
|
+
});
|
|
606
|
+
/** Fields shared by all Container application configurations. */
|
|
607
|
+
interface BaseContainerConfig {
|
|
582
608
|
/**
|
|
583
|
-
*
|
|
584
|
-
*
|
|
609
|
+
* Name of the application.
|
|
610
|
+
*
|
|
611
|
+
* This is also the identifier used to reference the Container from a Durable
|
|
612
|
+
* Object's `exports` entry via its `container` field.
|
|
585
613
|
*/
|
|
586
|
-
|
|
614
|
+
name: string;
|
|
587
615
|
/**
|
|
588
|
-
*
|
|
616
|
+
* Passed through without client-side validation or transformation.
|
|
589
617
|
*
|
|
590
|
-
*
|
|
618
|
+
* @hidden
|
|
591
619
|
*/
|
|
592
|
-
|
|
620
|
+
unsafe?: Record<string, unknown>;
|
|
621
|
+
}
|
|
622
|
+
/** A Container application managed with a standard scheduling policy. */
|
|
623
|
+
interface StandardContainerConfig extends BaseContainerConfig {
|
|
624
|
+
/** Configures observability and optional targeting for Container instances. */
|
|
625
|
+
observability?: StandardContainerObservabilityConfig;
|
|
626
|
+
/** The image to build or deploy. */
|
|
627
|
+
image: ContainerImage;
|
|
593
628
|
/**
|
|
594
|
-
*
|
|
629
|
+
* Maximum number of application instances.
|
|
595
630
|
*
|
|
596
|
-
*
|
|
631
|
+
* @default 20
|
|
597
632
|
*/
|
|
598
|
-
|
|
633
|
+
maxInstances?: number;
|
|
599
634
|
/**
|
|
600
|
-
*
|
|
635
|
+
* The instance type to be used for the Container.
|
|
636
|
+
* Select from one of the following named instance types:
|
|
601
637
|
*
|
|
602
|
-
*
|
|
638
|
+
* - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk
|
|
639
|
+
* - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk
|
|
640
|
+
* - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk
|
|
641
|
+
* - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk
|
|
642
|
+
* - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk
|
|
643
|
+
* - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk
|
|
644
|
+
*
|
|
645
|
+
* Customers on an enterprise plan have the additional option to set custom
|
|
646
|
+
* limits.
|
|
647
|
+
*
|
|
648
|
+
* @default "lite"
|
|
603
649
|
*/
|
|
604
|
-
|
|
650
|
+
instanceType?: "basic" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | {
|
|
651
|
+
/** @default 0.0625 (1/16 vCPU) */vcpu?: number; /** @default 256 MiB */
|
|
652
|
+
memoryMib?: number; /** @default 2 GB */
|
|
653
|
+
diskMb?: number;
|
|
654
|
+
};
|
|
605
655
|
/**
|
|
606
|
-
*
|
|
656
|
+
* The scheduling policy of the application.
|
|
607
657
|
*
|
|
608
|
-
*
|
|
658
|
+
* @default "default"
|
|
609
659
|
*/
|
|
610
|
-
|
|
660
|
+
schedulingPolicy?: "default" | "regional";
|
|
661
|
+
ssh?: {
|
|
662
|
+
/**
|
|
663
|
+
* If enabled, users with write access to the Container application can
|
|
664
|
+
* connect to it over SSH.
|
|
665
|
+
*
|
|
666
|
+
* @default false
|
|
667
|
+
*/
|
|
668
|
+
enabled: boolean;
|
|
669
|
+
/**
|
|
670
|
+
* Port that the SSH service is running on.
|
|
671
|
+
*
|
|
672
|
+
* @default 22
|
|
673
|
+
*/
|
|
674
|
+
port?: number;
|
|
675
|
+
};
|
|
676
|
+
/** SSH public keys to put in the Container's authorized_keys file. */
|
|
677
|
+
authorizedKeys?: Array<{
|
|
678
|
+
name: string;
|
|
679
|
+
publicKey: string;
|
|
680
|
+
}>;
|
|
681
|
+
/** Scheduling constraints for Container placement. */
|
|
682
|
+
constraints?: {
|
|
683
|
+
/** Limit Container placement to specific geographic regions. */regions?: Array<"ENAM" | "WNAM" | "EEUR" | "WEUR" | "APAC" | "SAM" | "ME" | "OC" | "AFR">; /** Restrict Containers to compliance boundaries. */
|
|
684
|
+
jurisdiction?: "eu" | "fedramp";
|
|
685
|
+
};
|
|
686
|
+
rollout?: {
|
|
687
|
+
/**
|
|
688
|
+
* How a rollout should be created. It supports the following modes:
|
|
689
|
+
*
|
|
690
|
+
* - full-auto: The Container application will be rolled out fully
|
|
691
|
+
* automatically.
|
|
692
|
+
* - none: The Container application will not have a rollout or update.
|
|
693
|
+
* - full-manual: The Container application will be rolled out by manually
|
|
694
|
+
* progressing through the rollout steps.
|
|
695
|
+
*
|
|
696
|
+
* @default "full-auto"
|
|
697
|
+
* @hidden
|
|
698
|
+
*/
|
|
699
|
+
kind?: "full-auto" | "none" | "full-manual";
|
|
700
|
+
/**
|
|
701
|
+
* Configures what percentage of instances should be updated at each step of
|
|
702
|
+
* a rollout. You can specify this as a single number or an array of numbers.
|
|
703
|
+
*
|
|
704
|
+
* If this is a single number, each step will progress by that percentage.
|
|
705
|
+
* The options are 5, 10, 20, 25, 50, or 100.
|
|
706
|
+
*
|
|
707
|
+
* If this is an array, each step specifies the cumulative rollout progress.
|
|
708
|
+
* The final step must be 100.
|
|
709
|
+
*
|
|
710
|
+
* @default [10, 100]
|
|
711
|
+
*/
|
|
712
|
+
stepPercentage?: number | number[];
|
|
713
|
+
/**
|
|
714
|
+
* Configures the grace period, in seconds, for active instances before they
|
|
715
|
+
* are shut down during a rollout.
|
|
716
|
+
*
|
|
717
|
+
* @default 0
|
|
718
|
+
*/
|
|
719
|
+
activeGracePeriod?: number;
|
|
720
|
+
};
|
|
721
|
+
}
|
|
722
|
+
/** A Container application managed by a Durable Object. */
|
|
723
|
+
interface DurableObjectContainerConfig extends BaseContainerConfig {
|
|
724
|
+
schedulingPolicy: "durable-object";
|
|
611
725
|
/**
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
*
|
|
615
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
726
|
+
* Configures application-wide observability. Instance targeting is not
|
|
727
|
+
* supported for Durable Object-managed Containers.
|
|
616
728
|
*/
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
|
|
729
|
+
observability?: ContainerObservabilityConfig;
|
|
730
|
+
/** Named images that the Durable Object can start. */
|
|
731
|
+
images?: Record<string, ContainerImage>;
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* Container application configuration. This is the input shape passed to
|
|
735
|
+
* `defineContainer` and parsed at runtime by `InputContainerSchema`.
|
|
736
|
+
*/
|
|
737
|
+
type ContainerConfig = DurableObjectContainerConfig | StandardContainerConfig;
|
|
738
|
+
/**
|
|
739
|
+
* Worker configuration. This is the input shape passed to
|
|
740
|
+
* [`defineWorker`](https://developers.cloudflare.com/workers/wrangler/configuration/).
|
|
741
|
+
*
|
|
742
|
+
* Fields are parsed and normalised at runtime by `InputWorkerSchema` before
|
|
743
|
+
* being passed to downstream tooling.
|
|
744
|
+
*/
|
|
745
|
+
interface WorkerConfig {
|
|
620
746
|
/**
|
|
621
|
-
*
|
|
622
|
-
*
|
|
623
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
747
|
+
* The name of your Worker.
|
|
624
748
|
*/
|
|
625
|
-
|
|
749
|
+
name: string;
|
|
626
750
|
/**
|
|
627
|
-
*
|
|
751
|
+
* A date in the form yyyy-mm-dd, which will be used to determine
|
|
752
|
+
* which version of the Workers runtime is used.
|
|
628
753
|
*
|
|
629
|
-
*
|
|
754
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
|
|
630
755
|
*/
|
|
631
|
-
|
|
756
|
+
compatibilityDate: string;
|
|
632
757
|
/**
|
|
633
|
-
*
|
|
634
|
-
*
|
|
758
|
+
* A list of flags that enable features from upcoming features of
|
|
759
|
+
* the Workers runtime, usually used together with `compatibilityDate`.
|
|
760
|
+
*
|
|
761
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
|
|
762
|
+
*
|
|
763
|
+
* @default []
|
|
635
764
|
*/
|
|
636
|
-
|
|
765
|
+
compatibilityFlags?: string[];
|
|
637
766
|
/**
|
|
638
|
-
*
|
|
767
|
+
* The entrypoint module that will be executed.
|
|
639
768
|
*
|
|
640
|
-
*
|
|
769
|
+
* May be either a path string (e.g. `"./src/index.ts"`) or a module
|
|
770
|
+
* namespace imported with the `cf-worker` import attribute.
|
|
771
|
+
*
|
|
772
|
+
* @example
|
|
773
|
+
* ```ts
|
|
774
|
+
* import { defineConfig, defineWorker } from "@cloudflare/config";
|
|
775
|
+
* import * as entrypoint from "./src" with { type: "cf-worker" };
|
|
776
|
+
* const worker = defineWorker({ entrypoint });
|
|
777
|
+
* export default defineConfig({ worker });
|
|
778
|
+
* ```
|
|
641
779
|
*/
|
|
642
|
-
|
|
643
|
-
/** Binding for forwarding logs to logfwdr. */
|
|
644
|
-
logfwdr(options: LogfwdrBindingOptions): LogfwdrBinding;
|
|
645
|
-
/** Binding to Cloudflare Media Transformations. */
|
|
646
|
-
media(options?: MediaBindingOptions): MediaBinding$1;
|
|
780
|
+
entrypoint?: string | WorkerModule;
|
|
647
781
|
/**
|
|
648
|
-
*
|
|
782
|
+
* Specify the directory of static assets to deploy/serve.
|
|
649
783
|
*
|
|
650
|
-
*
|
|
784
|
+
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
785
|
+
*
|
|
786
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
651
787
|
*/
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
788
|
+
assets?: {
|
|
789
|
+
/** How to handle HTML requests. */htmlHandling?: "auto-trailing-slash" | "drop-trailing-slash" | "force-trailing-slash" | "none"; /** How to handle requests that do not match an asset. */
|
|
790
|
+
notFoundHandling?: "single-page-application" | "404-page" | "none";
|
|
791
|
+
/**
|
|
792
|
+
* Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
|
|
793
|
+
*
|
|
794
|
+
* Can also be `true`, indicating that every request should be routed to the User Worker.
|
|
795
|
+
*/
|
|
796
|
+
runWorkerFirst?: string[] | boolean;
|
|
797
|
+
};
|
|
655
798
|
/**
|
|
656
|
-
*
|
|
799
|
+
* Custom domains that your Worker should be published to.
|
|
657
800
|
*
|
|
658
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
801
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
659
802
|
*/
|
|
660
|
-
|
|
803
|
+
domains?: string[];
|
|
661
804
|
/**
|
|
662
|
-
*
|
|
805
|
+
* Event triggers — fetch routes, queue consumers, cron schedules, Email
|
|
806
|
+
* Routing addresses, and raw sockets — that invoke this Worker.
|
|
807
|
+
* Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
808
|
+
* `triggers.scheduled(...)`, `triggers.email(...)`, or
|
|
809
|
+
* `triggers.connect(...)`.
|
|
663
810
|
*
|
|
664
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
811
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
665
812
|
*/
|
|
666
|
-
|
|
667
|
-
/** Binding to a rate limiter. */
|
|
668
|
-
rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
|
|
813
|
+
triggers?: Trigger[];
|
|
669
814
|
/**
|
|
670
|
-
*
|
|
671
|
-
* the binding name.
|
|
815
|
+
* A list of Tail Workers that are bound to this Worker.
|
|
672
816
|
*
|
|
673
|
-
*
|
|
674
|
-
*
|
|
675
|
-
* - Enables local dev validation with warnings for missing secrets
|
|
817
|
+
* `@cloudflare/config` unifies regular and streaming tail consumers under
|
|
818
|
+
* a single field; pass `streaming: true` to forward streaming tail events.
|
|
676
819
|
*
|
|
677
|
-
*
|
|
820
|
+
* @default []
|
|
678
821
|
*/
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
822
|
+
tailConsumers?: Array<{
|
|
823
|
+
/** The name of the service tail events will be forwarded to. */worker: string; /** Whether to stream tail events in real time. */
|
|
824
|
+
streaming?: boolean;
|
|
825
|
+
}>;
|
|
682
826
|
/**
|
|
683
|
-
*
|
|
684
|
-
*
|
|
685
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
827
|
+
* Specify the cache behavior of the Worker.
|
|
686
828
|
*/
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
829
|
+
cache?: {
|
|
830
|
+
/** If cache is enabled for this Worker. */enabled: boolean; /** Whether cached assets may be reused across Worker versions. */
|
|
831
|
+
crossVersionCache?: boolean;
|
|
832
|
+
};
|
|
690
833
|
/**
|
|
691
|
-
*
|
|
692
|
-
* binding name.
|
|
834
|
+
* Specify how the Worker should be located to minimize round-trip time.
|
|
693
835
|
*
|
|
694
|
-
*
|
|
836
|
+
* More details: https://developers.cloudflare.com/workers/platform/smart-placement/
|
|
695
837
|
*/
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
838
|
+
placement?: {
|
|
839
|
+
mode: "off" | "smart";
|
|
840
|
+
hint?: string;
|
|
841
|
+
} | {
|
|
842
|
+
mode?: "targeted";
|
|
843
|
+
region: string;
|
|
844
|
+
} | {
|
|
845
|
+
mode?: "targeted";
|
|
846
|
+
host: string;
|
|
847
|
+
} | {
|
|
848
|
+
mode?: "targeted";
|
|
849
|
+
hostname: string;
|
|
850
|
+
};
|
|
851
|
+
/**
|
|
852
|
+
* Specify limits for runtime behavior.
|
|
853
|
+
* Only supported for the "standard" Usage Model.
|
|
699
854
|
*
|
|
700
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
855
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
|
|
701
856
|
*/
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;
|
|
707
|
-
/** Binding to a VPC service. */
|
|
708
|
-
vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;
|
|
857
|
+
limits?: {
|
|
858
|
+
/** Maximum allowed CPU time for a Worker's invocation in milliseconds. */cpuMs?: number; /** Maximum allowed number of fetch requests that a Worker's invocation can execute. */
|
|
859
|
+
subrequests?: number;
|
|
860
|
+
};
|
|
709
861
|
/**
|
|
710
|
-
*
|
|
711
|
-
*
|
|
862
|
+
* Send Trace Events from this Worker to Workers Logpush.
|
|
863
|
+
*
|
|
864
|
+
* This will not configure a corresponding Logpush job automatically.
|
|
865
|
+
*
|
|
866
|
+
* For more information about Workers Logpush, see:
|
|
867
|
+
* https://blog.cloudflare.com/logpush-for-workers/
|
|
712
868
|
*/
|
|
713
|
-
|
|
869
|
+
logpush?: boolean;
|
|
714
870
|
/**
|
|
715
|
-
*
|
|
716
|
-
* Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
|
|
717
|
-
* the default export).
|
|
871
|
+
* Specify the observability behavior of the Worker.
|
|
718
872
|
*
|
|
719
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
873
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
|
|
720
874
|
*/
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
875
|
+
observability?: {
|
|
876
|
+
/** If observability is enabled for this Worker. */enabled?: boolean; /** The sampling rate. */
|
|
877
|
+
headSamplingRate?: number;
|
|
878
|
+
/**
|
|
879
|
+
* Whether query strings are removed from request URLs in logs and traces.
|
|
880
|
+
*
|
|
881
|
+
* @default false
|
|
882
|
+
*/
|
|
883
|
+
redactQueryString?: boolean; /** Real-time Issues settings for this Worker. */
|
|
884
|
+
issues?: {
|
|
885
|
+
/** Whether real-time Issues are enabled. */enabled?: boolean;
|
|
886
|
+
};
|
|
887
|
+
logs?: {
|
|
888
|
+
enabled?: boolean; /** The sampling rate. */
|
|
889
|
+
headSamplingRate?: number; /** Set to false to disable invocation logs. */
|
|
890
|
+
invocationLogs?: boolean;
|
|
891
|
+
/**
|
|
892
|
+
* If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
893
|
+
*
|
|
894
|
+
* @default true
|
|
895
|
+
*/
|
|
896
|
+
persist?: boolean;
|
|
897
|
+
/**
|
|
898
|
+
* What destinations logs emitted from the Worker should be sent to.
|
|
899
|
+
*
|
|
900
|
+
* @default []
|
|
901
|
+
*/
|
|
902
|
+
destinations?: string[];
|
|
903
|
+
};
|
|
904
|
+
traces?: {
|
|
905
|
+
enabled?: boolean; /** The sampling rate. */
|
|
906
|
+
headSamplingRate?: number;
|
|
907
|
+
/**
|
|
908
|
+
* If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
909
|
+
*
|
|
910
|
+
* @default true
|
|
911
|
+
*/
|
|
912
|
+
persist?: boolean;
|
|
913
|
+
/**
|
|
914
|
+
* What destinations traces emitted from the Worker should be sent to.
|
|
915
|
+
*
|
|
916
|
+
* @default []
|
|
917
|
+
*/
|
|
918
|
+
destinations?: string[];
|
|
919
|
+
};
|
|
920
|
+
};
|
|
728
921
|
/**
|
|
729
|
-
*
|
|
922
|
+
* Whether we use `<name>.<subdomain>.workers.dev` to
|
|
923
|
+
* test and deploy your Worker.
|
|
730
924
|
*
|
|
731
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
925
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
|
|
926
|
+
*
|
|
927
|
+
* @default true
|
|
732
928
|
*/
|
|
733
|
-
|
|
929
|
+
workersDev?: boolean;
|
|
734
930
|
/**
|
|
735
|
-
*
|
|
736
|
-
*
|
|
931
|
+
* Whether we use `<version>-<name>.<subdomain>.workers.dev` to
|
|
932
|
+
* serve Preview URLs for your Worker.
|
|
933
|
+
*
|
|
934
|
+
* @default false
|
|
737
935
|
*/
|
|
738
|
-
|
|
739
|
-
}
|
|
740
|
-
/**
|
|
741
|
-
* Fetch trigger — a route that your Worker should be published to.
|
|
742
|
-
*
|
|
743
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
744
|
-
*/
|
|
745
|
-
interface FetchTrigger extends FetchTriggerOptions {
|
|
746
|
-
type: "fetch";
|
|
747
|
-
}
|
|
748
|
-
interface QueueConsumerTriggerOptions {
|
|
749
|
-
/** The name of the queue from which this consumer should consume. */
|
|
750
|
-
name: string;
|
|
751
|
-
/** The queue to send messages that failed to be consumed. */
|
|
752
|
-
deadLetterQueue?: string;
|
|
753
|
-
/** The maximum number of messages per batch. */
|
|
754
|
-
maxBatchSize?: number;
|
|
755
|
-
/** The maximum number of seconds to wait to fill a batch with messages. */
|
|
756
|
-
maxBatchTimeout?: number;
|
|
936
|
+
previewUrls?: boolean;
|
|
757
937
|
/**
|
|
758
|
-
*
|
|
759
|
-
*
|
|
760
|
-
*
|
|
938
|
+
* Designates this Worker as an internal-only "first-party" Worker.
|
|
939
|
+
*
|
|
940
|
+
* @internal
|
|
761
941
|
*/
|
|
762
|
-
|
|
763
|
-
/** The maximum number of retries for each message. */
|
|
764
|
-
maxRetries?: number;
|
|
765
|
-
/** The number of seconds to wait before retrying a message. */
|
|
766
|
-
retryDelay?: number;
|
|
767
|
-
/** The number of milliseconds to wait for pulled messages to become visible again. */
|
|
768
|
-
visibilityTimeoutMs?: number;
|
|
769
|
-
}
|
|
770
|
-
/**
|
|
771
|
-
* Queue consumer trigger — invokes this Worker when messages arrive on the
|
|
772
|
-
* named queue.
|
|
773
|
-
*
|
|
774
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
775
|
-
*/
|
|
776
|
-
interface QueueConsumerTrigger extends QueueConsumerTriggerOptions {
|
|
777
|
-
type: "queue";
|
|
778
|
-
}
|
|
779
|
-
interface ScheduledTriggerOptions {
|
|
942
|
+
firstPartyWorker?: boolean;
|
|
780
943
|
/**
|
|
781
|
-
*
|
|
782
|
-
*
|
|
783
|
-
*
|
|
944
|
+
* "Unsafe" tables for runtime features that aren't directly supported by
|
|
945
|
+
* this configuration. Values are forwarded verbatim in the Worker's
|
|
946
|
+
* upload metadata.
|
|
784
947
|
*
|
|
785
|
-
*
|
|
948
|
+
* @default {}
|
|
786
949
|
*/
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
950
|
+
unsafe?: {
|
|
951
|
+
/**
|
|
952
|
+
* Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
|
|
953
|
+
* here will always be applied to metadata last, so can add new or override existing fields.
|
|
954
|
+
*/
|
|
955
|
+
metadata?: Record<string, unknown>;
|
|
956
|
+
/**
|
|
957
|
+
* Used for internal capnp uploads for the Workers runtime.
|
|
958
|
+
*/
|
|
959
|
+
capnp?: {
|
|
960
|
+
basePath: string;
|
|
961
|
+
sourceSchemas: string[];
|
|
962
|
+
compiledSchema?: never;
|
|
963
|
+
} | {
|
|
964
|
+
basePath?: never;
|
|
965
|
+
sourceSchemas?: never;
|
|
966
|
+
compiledSchema: string;
|
|
967
|
+
};
|
|
968
|
+
};
|
|
798
969
|
/**
|
|
799
|
-
*
|
|
970
|
+
* Bindings exposed on the Worker's `env` object. Construct entries with
|
|
971
|
+
* `bindings.kv(...)`, `bindings.r2(...)`, etc.
|
|
972
|
+
*/
|
|
973
|
+
env?: Record<string, Binding>;
|
|
974
|
+
/**
|
|
975
|
+
* Configuration for named exports declared by the Worker. Each entry's
|
|
976
|
+
* key is the exported class name; the value configures the export.
|
|
800
977
|
*
|
|
801
|
-
*
|
|
802
|
-
*
|
|
978
|
+
* Only one export kind is currently supported:
|
|
979
|
+
*
|
|
980
|
+
* - Construct entries with `exports.durableObject(...)`.
|
|
981
|
+
* - Declares Durable Object classes exported from this Worker.
|
|
982
|
+
* For more information about Durable Objects, see the documentation at
|
|
983
|
+
* https://developers.cloudflare.com/workers/learning/using-durable-objects.
|
|
984
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects.
|
|
803
985
|
*/
|
|
804
|
-
|
|
986
|
+
exports?: Record<string, Export>;
|
|
987
|
+
} //#endregion
|
|
988
|
+
//#region src/definition.d.ts
|
|
989
|
+
interface ConfigContext {
|
|
990
|
+
/** Whether the config is being evaluated for a Preview build. */
|
|
991
|
+
isPreview: boolean;
|
|
992
|
+
/**
|
|
993
|
+
* The mode the config is being evaluated in.
|
|
994
|
+
* Set via the `--mode` CLI flag.
|
|
995
|
+
* In Vite the mode defaults to `development` in `vite dev` and `production` in `vite build` ([more info](https://vite.dev/guide/env-and-mode.html#modes)).
|
|
996
|
+
* In Wrangler the mode defaults to `undefined`.
|
|
997
|
+
*/
|
|
998
|
+
mode: string | undefined;
|
|
805
999
|
}
|
|
806
1000
|
/**
|
|
807
|
-
*
|
|
808
|
-
*
|
|
1001
|
+
* A configuration value, promise, or factory. Factories can be passed directly
|
|
1002
|
+
* for automatic resolution with the current context or called explicitly with
|
|
1003
|
+
* another context before they are used.
|
|
809
1004
|
*/
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
protocol: "tcp";
|
|
816
|
-
/** The port to listen on. */
|
|
817
|
-
port: number;
|
|
818
|
-
/** The address to bind to. Defaults to `127.0.0.1`. */
|
|
819
|
-
address?: string;
|
|
820
|
-
}
|
|
1005
|
+
type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
|
|
1006
|
+
type ContainerDefinition<T$1 extends ContainerConfig = ContainerConfig> = ConfigInput<T$1>;
|
|
1007
|
+
type WorkerDefinition<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
|
|
1008
|
+
/** A Worker name, value, promise, or context-aware factory. */
|
|
1009
|
+
type WorkerReference = string | WorkerDefinition;
|
|
821
1010
|
/**
|
|
822
|
-
*
|
|
823
|
-
*
|
|
824
|
-
*
|
|
1011
|
+
* Used to define the default export in `cloudflare.config.ts`.
|
|
1012
|
+
*
|
|
1013
|
+
* @example
|
|
1014
|
+
* ```typescript
|
|
1015
|
+
* import { defineConfig } from "@cloudflare/config";
|
|
1016
|
+
*
|
|
1017
|
+
* export default defineConfig({
|
|
1018
|
+
* worker: {
|
|
1019
|
+
* name: "my-worker",
|
|
1020
|
+
* compatibilityDate: "2026-09-17",
|
|
1021
|
+
* },
|
|
1022
|
+
* });
|
|
1023
|
+
* ```
|
|
825
1024
|
*/
|
|
826
|
-
|
|
827
|
-
type: "connect";
|
|
828
|
-
}
|
|
1025
|
+
declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>(config: TInput) => TInput;
|
|
829
1026
|
/**
|
|
830
|
-
*
|
|
831
|
-
* Routing addresses, and raw sockets — that invoke this Worker.
|
|
832
|
-
* Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
833
|
-
* `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
|
|
1027
|
+
* Define a Container.
|
|
834
1028
|
*
|
|
835
|
-
*
|
|
1029
|
+
* @example
|
|
1030
|
+
* ```typescript
|
|
1031
|
+
* import { defineContainer } from "@cloudflare/config";
|
|
1032
|
+
*
|
|
1033
|
+
* const container = defineContainer({
|
|
1034
|
+
* name: "my-container",
|
|
1035
|
+
* image: { dockerfile: "./Dockerfile" },
|
|
1036
|
+
* });
|
|
1037
|
+
* ```
|
|
836
1038
|
*/
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* Fetch trigger — a route that your Worker should be published to.
|
|
840
|
-
*
|
|
841
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
842
|
-
*/
|
|
843
|
-
fetch(options: FetchTriggerOptions): FetchTrigger;
|
|
844
|
-
/**
|
|
845
|
-
* Queue consumer trigger — invokes this Worker when messages arrive on the
|
|
846
|
-
* named queue.
|
|
847
|
-
*
|
|
848
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
849
|
-
*/
|
|
850
|
-
queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;
|
|
851
|
-
/**
|
|
852
|
-
* Scheduled (cron) trigger — invokes this Worker on the given schedules.
|
|
853
|
-
*
|
|
854
|
-
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
855
|
-
*/
|
|
856
|
-
scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;
|
|
857
|
-
/**
|
|
858
|
-
* Email trigger — invokes this Worker for the configured Email Routing
|
|
859
|
-
* addresses.
|
|
860
|
-
*/
|
|
861
|
-
email(options: EmailTriggerOptions): EmailTrigger;
|
|
862
|
-
/**
|
|
863
|
-
* Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
|
|
864
|
-
* handler for raw socket connections received on the configured
|
|
865
|
-
* protocol/port.
|
|
866
|
-
*/
|
|
867
|
-
connect(options: ConnectTriggerOptions): ConnectTrigger;
|
|
868
|
-
}
|
|
1039
|
+
declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig>>(config: TInput) => TInput;
|
|
869
1040
|
/**
|
|
870
|
-
*
|
|
1041
|
+
* Define a Worker.
|
|
871
1042
|
*
|
|
872
1043
|
* @example
|
|
873
1044
|
* ```typescript
|
|
874
|
-
* import { defineWorker
|
|
1045
|
+
* import { defineWorker } from "@cloudflare/config";
|
|
875
1046
|
*
|
|
876
|
-
*
|
|
877
|
-
*
|
|
878
|
-
*
|
|
879
|
-
* triggers.queue({ name: "my-queue" }),
|
|
880
|
-
* triggers.scheduled({ schedule: "0 * * * *" }),
|
|
881
|
-
* triggers.scheduled({ schedule: "30 0 * * *" }),
|
|
882
|
-
* triggers.email({ addresses: ["support@example.com"] }),
|
|
883
|
-
* triggers.connect({ protocol: "tcp", port: 5432 }),
|
|
884
|
-
* ],
|
|
1047
|
+
* const worker = defineWorker({
|
|
1048
|
+
* name: "my-worker",
|
|
1049
|
+
* compatibilityDate: "2026-09-17",
|
|
885
1050
|
* });
|
|
886
1051
|
* ```
|
|
887
1052
|
*/
|
|
888
|
-
declare const
|
|
889
|
-
//#region src/
|
|
1053
|
+
declare const defineWorker: <const TInput extends ConfigInput<WorkerConfig>>(config: TInput) => TInput; //#endregion
|
|
1054
|
+
//#region src/utils.d.ts
|
|
890
1055
|
/**
|
|
891
|
-
*
|
|
892
|
-
*
|
|
893
|
-
* Containers are only supported on the SQLite storage engine, so `container` is
|
|
894
|
-
* only offered alongside `storage: "sqlite"`.
|
|
1056
|
+
* Represents any valid JSON value.
|
|
895
1057
|
*/
|
|
896
|
-
type
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
/**
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
/**
|
|
909
|
-
|
|
1058
|
+
type Json = string | number | boolean | null | Json[] | {
|
|
1059
|
+
[key: string]: Json;
|
|
1060
|
+
}; //#endregion
|
|
1061
|
+
//#region src/bindings.d.ts
|
|
1062
|
+
/** Options that control a binding during local development. */
|
|
1063
|
+
interface BindingDevOptions {
|
|
1064
|
+
/** Whether the binding should connect to the remote resource. */
|
|
1065
|
+
remote?: boolean;
|
|
1066
|
+
}
|
|
1067
|
+
interface AgentMemoryBindingOptions {
|
|
1068
|
+
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
1069
|
+
namespace: string;
|
|
1070
|
+
/** Options that only apply during local development. */
|
|
1071
|
+
dev?: BindingDevOptions;
|
|
1072
|
+
}
|
|
910
1073
|
/**
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
* For more information about Durable Objects, see the documentation at
|
|
914
|
-
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
915
|
-
*
|
|
916
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
1074
|
+
* Agent Memory namespace binding. Each binding is scoped to a namespace and
|
|
1075
|
+
* allows agents to persist and recall memory.
|
|
917
1076
|
*/
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
}
|
|
1077
|
+
interface AgentMemoryBinding extends AgentMemoryBindingOptions {
|
|
1078
|
+
type: "agent-memory";
|
|
1079
|
+
}
|
|
1080
|
+
interface AiBindingOptions {
|
|
1081
|
+
/** Options that only apply during local development. */
|
|
1082
|
+
dev?: BindingDevOptions;
|
|
1083
|
+
}
|
|
921
1084
|
/**
|
|
922
|
-
*
|
|
923
|
-
* been removed from code.
|
|
1085
|
+
* Binding to the Workers AI project.
|
|
924
1086
|
*
|
|
925
|
-
*
|
|
926
|
-
* other Worker may hold a `durableObject` binding to the namespace.
|
|
1087
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
927
1088
|
*/
|
|
928
|
-
interface
|
|
929
|
-
|
|
1089
|
+
interface AiBinding extends AiBindingOptions {
|
|
1090
|
+
type: "ai";
|
|
930
1091
|
}
|
|
931
1092
|
/**
|
|
932
|
-
*
|
|
933
|
-
*
|
|
934
|
-
*
|
|
1093
|
+
* Binding to the Workers AI project.
|
|
1094
|
+
*
|
|
1095
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
935
1096
|
*/
|
|
936
|
-
interface
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
* The destination class name. Must be a valid JavaScript identifier and
|
|
940
|
-
* must appear as a live (`state: "created"`) `durableObject` entry in the
|
|
941
|
-
* same `exports` map.
|
|
942
|
-
*/
|
|
943
|
-
renamedTo: string;
|
|
1097
|
+
interface TypedAiBinding<TAiModelList extends AiModelListType = AiModels> extends AiBinding {
|
|
1098
|
+
/** @internal Carries type parameters for inference */
|
|
1099
|
+
__typeParams: [TAiModelList];
|
|
944
1100
|
}
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
*/
|
|
949
|
-
|
|
950
|
-
state: "transferred";
|
|
951
|
-
/**
|
|
952
|
-
* The destination Worker. Must reference a Worker in the same account.
|
|
953
|
-
*/
|
|
954
|
-
transferredTo: string;
|
|
1101
|
+
interface AiSearchBindingOptions {
|
|
1102
|
+
/** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
|
|
1103
|
+
name: string;
|
|
1104
|
+
/** Options that only apply during local development. */
|
|
1105
|
+
dev?: BindingDevOptions;
|
|
955
1106
|
}
|
|
956
1107
|
/**
|
|
957
|
-
*
|
|
958
|
-
*
|
|
1108
|
+
* AI Search instance binding. Each binding is bound directly to a single
|
|
1109
|
+
* pre-existing instance within the "default" namespace.
|
|
959
1110
|
*/
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
/**
|
|
963
|
-
* The source Worker for the two-phase cross-Worker transfer.
|
|
964
|
-
*/
|
|
965
|
-
transferFrom: string;
|
|
966
|
-
} & DurableObjectStorageOptions;
|
|
967
|
-
type DurableObjectCreatedExport = DurableObjectCreatedExportOptions & {
|
|
968
|
-
type: "durable-object";
|
|
969
|
-
};
|
|
970
|
-
interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
|
|
971
|
-
type: "durable-object";
|
|
972
|
-
}
|
|
973
|
-
interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
|
|
974
|
-
type: "durable-object";
|
|
975
|
-
}
|
|
976
|
-
interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
|
|
977
|
-
type: "durable-object";
|
|
978
|
-
}
|
|
979
|
-
type DurableObjectExpectingTransferExport = DurableObjectExpectingTransferExportOptions & {
|
|
980
|
-
type: "durable-object";
|
|
981
|
-
};
|
|
982
|
-
type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
|
|
983
|
-
type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
|
|
984
|
-
interface WorkerEntrypointExportOptions {
|
|
985
|
-
cache?: {
|
|
986
|
-
/** Whether cache is enabled for this entrypoint. */enabled: boolean;
|
|
987
|
-
};
|
|
1111
|
+
interface AiSearchBinding extends AiSearchBindingOptions {
|
|
1112
|
+
type: "ai-search";
|
|
988
1113
|
}
|
|
989
|
-
interface
|
|
990
|
-
|
|
1114
|
+
interface AiSearchNamespaceBindingOptions {
|
|
1115
|
+
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
1116
|
+
namespace: string;
|
|
1117
|
+
/** Options that only apply during local development. */
|
|
1118
|
+
dev?: BindingDevOptions;
|
|
991
1119
|
}
|
|
992
1120
|
/**
|
|
993
|
-
*
|
|
994
|
-
*
|
|
1121
|
+
* AI Search namespace binding. Each binding is scoped to a namespace and
|
|
1122
|
+
* allows dynamic instance CRUD within it.
|
|
995
1123
|
*/
|
|
996
|
-
interface
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
*
|
|
1003
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
1004
|
-
*/
|
|
1005
|
-
durableObject(options: DurableObjectCreatedExportOptions): DurableObjectCreatedExport;
|
|
1006
|
-
/**
|
|
1007
|
-
* Retire a provisioned Durable Object namespace whose class has been removed from code.
|
|
1008
|
-
*/
|
|
1009
|
-
durableObject(options: DurableObjectDeletedExportOptions): DurableObjectDeletedExport;
|
|
1010
|
-
/**
|
|
1011
|
-
* Rename a provisioned Durable Object namespace's class.
|
|
1012
|
-
*/
|
|
1013
|
-
durableObject(options: DurableObjectRenamedExportOptions): DurableObjectRenamedExport;
|
|
1014
|
-
/**
|
|
1015
|
-
* Transfer ownership of a Durable Object namespace to another Worker in the same account.
|
|
1016
|
-
*/
|
|
1017
|
-
durableObject(options: DurableObjectTransferredExportOptions): DurableObjectTransferredExport;
|
|
1018
|
-
/**
|
|
1019
|
-
* Prepare to receive cross-Worker Durable Object transfer.
|
|
1020
|
-
* The source Worker must follow up with a deployment containing a `transferred` export to commit the transfer.
|
|
1021
|
-
*/
|
|
1022
|
-
durableObject(options: DurableObjectExpectingTransferExportOptions): DurableObjectExpectingTransferExport;
|
|
1023
|
-
durableObject(options: DurableObjectExportOptions): DurableObjectExports;
|
|
1024
|
-
/** Declares a WorkerEntrypoint export defined by this Worker. */
|
|
1025
|
-
worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;
|
|
1124
|
+
interface AiSearchNamespaceBinding extends AiSearchNamespaceBindingOptions {
|
|
1125
|
+
type: "ai-search-namespace";
|
|
1126
|
+
}
|
|
1127
|
+
interface AnalyticsEngineDatasetBindingOptions {
|
|
1128
|
+
/** The name of this dataset to write to. */
|
|
1129
|
+
name?: string;
|
|
1026
1130
|
}
|
|
1027
1131
|
/**
|
|
1028
|
-
*
|
|
1029
|
-
*
|
|
1030
|
-
* @example
|
|
1031
|
-
* ```typescript
|
|
1032
|
-
* import { defineWorker, exports } from "@cloudflare/config";
|
|
1132
|
+
* Binding to an Analytics Engine dataset.
|
|
1033
1133
|
*
|
|
1034
|
-
*
|
|
1035
|
-
* exports: {
|
|
1036
|
-
* MyDurableObject: exports.durableObject({ storage: "sqlite" }),
|
|
1037
|
-
* MyContainerDO: exports.durableObject({ storage: "sqlite", container: "my-container" }),
|
|
1038
|
-
* OldClass: exports.durableObject({ state: "deleted" }),
|
|
1039
|
-
* OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
|
|
1040
|
-
* Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
|
|
1041
|
-
* Incoming: exports.durableObject({ state: "expecting-transfer", storage: "sqlite", transferFrom: "source-worker" }),
|
|
1042
|
-
* },
|
|
1043
|
-
* });
|
|
1044
|
-
* ```
|
|
1134
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
1045
1135
|
*/
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
*/
|
|
1055
|
-
mode: string | undefined;
|
|
1136
|
+
interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOptions {
|
|
1137
|
+
type: "analytics-engine-dataset";
|
|
1138
|
+
}
|
|
1139
|
+
interface ArtifactsBindingOptions {
|
|
1140
|
+
/** The namespace to use. */
|
|
1141
|
+
namespace: string;
|
|
1142
|
+
/** Options that only apply during local development. */
|
|
1143
|
+
dev?: BindingDevOptions;
|
|
1056
1144
|
}
|
|
1057
|
-
declare const DEFINITION: unique symbol;
|
|
1058
1145
|
/**
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1146
|
+
* Binding to an Artifacts instance. Artifacts provides git-compatible file
|
|
1147
|
+
* storage on Cloudflare Workers.
|
|
1061
1148
|
*/
|
|
1062
|
-
|
|
1149
|
+
interface ArtifactsBinding extends ArtifactsBindingOptions {
|
|
1150
|
+
type: "artifacts";
|
|
1151
|
+
}
|
|
1063
1152
|
/**
|
|
1064
|
-
*
|
|
1153
|
+
* Binding to the Worker's static assets.
|
|
1065
1154
|
*
|
|
1066
|
-
*
|
|
1067
|
-
* {@link DEFINITION} symbol; here we unwrap the config and stamp `type` back on.
|
|
1068
|
-
* Every other export — a raw object/promise/function — is unwrapped as-is and
|
|
1069
|
-
* already carries its own `type`. Discrimination happens afterwards via `type`.
|
|
1070
|
-
*/
|
|
1071
|
-
//#endregion
|
|
1072
|
-
//#region src/types.d.ts
|
|
1073
|
-
/**
|
|
1074
|
-
* Union of all binding definitions accepted in `env`.
|
|
1155
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
1075
1156
|
*/
|
|
1076
|
-
|
|
1157
|
+
interface AssetsBinding {
|
|
1158
|
+
type: "assets";
|
|
1159
|
+
}
|
|
1160
|
+
interface BrowserBindingOptions {
|
|
1161
|
+
/** Options that only apply during local development. */
|
|
1162
|
+
dev?: BindingDevOptions;
|
|
1163
|
+
}
|
|
1077
1164
|
/**
|
|
1078
|
-
*
|
|
1165
|
+
* Binding to a headless browser usable from the Worker.
|
|
1166
|
+
*
|
|
1167
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
1079
1168
|
*/
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1169
|
+
interface BrowserBinding extends BrowserBindingOptions {
|
|
1170
|
+
type: "browser";
|
|
1171
|
+
}
|
|
1172
|
+
interface D1BindingOptions {
|
|
1173
|
+
/** The UUID of this D1 database (not required). */
|
|
1174
|
+
id?: string;
|
|
1175
|
+
/** The name of this D1 database. */
|
|
1176
|
+
name?: string;
|
|
1177
|
+
/** Options that only apply during local development. */
|
|
1178
|
+
dev?: BindingDevOptions;
|
|
1179
|
+
}
|
|
1180
|
+
/**
|
|
1181
|
+
* Binding to a D1 database.
|
|
1182
|
+
*
|
|
1183
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
|
1085
1184
|
*/
|
|
1086
|
-
|
|
1185
|
+
interface D1Binding extends D1BindingOptions {
|
|
1186
|
+
type: "d1";
|
|
1187
|
+
}
|
|
1188
|
+
interface DispatchNamespaceBindingOptions {
|
|
1189
|
+
/** The namespace to bind to. */
|
|
1190
|
+
namespace?: string;
|
|
1191
|
+
/** Details about the outbound Worker which will handle outbound requests from your namespace. */
|
|
1192
|
+
outbound?: {
|
|
1193
|
+
/** Name of the Worker handling the outbound requests. */worker: string; /** (Optional) List of parameter names, for sending context from your dispatch Worker to the outbound handler. */
|
|
1194
|
+
parameters?: string[];
|
|
1195
|
+
};
|
|
1196
|
+
/** Options that only apply during local development. */
|
|
1197
|
+
dev?: BindingDevOptions;
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* Binding to a Workers for Platforms dispatch namespace.
|
|
1201
|
+
*
|
|
1202
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
1203
|
+
*/
|
|
1204
|
+
interface DispatchNamespaceBinding extends DispatchNamespaceBindingOptions {
|
|
1205
|
+
type: "dispatch-namespace";
|
|
1206
|
+
}
|
|
1207
|
+
type ReferencedWorkerConfig<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? never : UnwrapConfig<TWorker$1>;
|
|
1208
|
+
type DurableObjectExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferDurableNamespaces<ReferencedWorkerConfig<TWorker$1>>;
|
|
1209
|
+
type WorkerEntrypointExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferWorkerEntrypointExports<ReferencedWorkerConfig<TWorker$1>>;
|
|
1210
|
+
type WorkflowExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferExportsByType<ReferencedWorkerConfig<TWorker$1>, "workflow">;
|
|
1211
|
+
interface DurableObjectBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> {
|
|
1212
|
+
/** The name or config of the Worker that defines the Durable Object class. */
|
|
1213
|
+
worker: TWorker$1;
|
|
1214
|
+
/** The exported class name of the Durable Object. */
|
|
1215
|
+
exportName: TExportName$1;
|
|
1216
|
+
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Binding to a Durable Object class. `worker` is the name or config of the
|
|
1219
|
+
* Worker that defines the class; `exportName` is the exported class name.
|
|
1220
|
+
*
|
|
1221
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
1222
|
+
*/
|
|
1223
|
+
interface DurableObjectBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> extends DurableObjectBindingOptions<TWorker$1, TExportName$1> {
|
|
1224
|
+
type: "durable-object";
|
|
1225
|
+
}
|
|
1226
|
+
interface FlagshipBindingOptions {
|
|
1227
|
+
/** The Flagship app ID to bind to. */
|
|
1228
|
+
id?: string;
|
|
1229
|
+
/** Options that only apply during local development. */
|
|
1230
|
+
dev?: BindingDevOptions;
|
|
1231
|
+
}
|
|
1232
|
+
/** Binding to a Flagship feature-flag service. */
|
|
1233
|
+
interface FlagshipBinding extends FlagshipBindingOptions {
|
|
1234
|
+
type: "flagship";
|
|
1235
|
+
}
|
|
1236
|
+
interface HyperdriveBindingOptions {
|
|
1237
|
+
/** The ID of the Hyperdrive configuration. */
|
|
1238
|
+
id: string;
|
|
1239
|
+
/** Options that only apply during local development. */
|
|
1240
|
+
dev?: {
|
|
1241
|
+
/** The database connection string used during local development. */connectionString?: string;
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Binding to a Hyperdrive configuration.
|
|
1246
|
+
*
|
|
1247
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
1248
|
+
*/
|
|
1249
|
+
interface HyperdriveBinding extends HyperdriveBindingOptions {
|
|
1250
|
+
type: "hyperdrive";
|
|
1251
|
+
}
|
|
1252
|
+
interface ImagesBindingOptions {
|
|
1253
|
+
/** Options that only apply during local development. */
|
|
1254
|
+
dev?: BindingDevOptions;
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Binding to Cloudflare Images.
|
|
1258
|
+
*
|
|
1259
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
|
|
1260
|
+
*/
|
|
1261
|
+
interface ImagesBinding$1 extends ImagesBindingOptions {
|
|
1262
|
+
type: "images";
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Inline JSON value made available to the Worker on `env` under the
|
|
1266
|
+
* binding name.
|
|
1267
|
+
*/
|
|
1268
|
+
interface JsonBinding<T$1 extends Json = Json> {
|
|
1269
|
+
type: "json";
|
|
1270
|
+
/** The JSON value made available to the Worker. */
|
|
1271
|
+
value: T$1;
|
|
1272
|
+
}
|
|
1273
|
+
interface KvBindingOptions {
|
|
1274
|
+
/** The ID of the KV namespace. */
|
|
1275
|
+
id?: string;
|
|
1276
|
+
/** Options that only apply during local development. */
|
|
1277
|
+
dev?: BindingDevOptions;
|
|
1278
|
+
}
|
|
1279
|
+
/**
|
|
1280
|
+
* Binding to a Workers KV namespace.
|
|
1281
|
+
*
|
|
1282
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
1283
|
+
*/
|
|
1284
|
+
interface KvBinding extends KvBindingOptions {
|
|
1285
|
+
type: "kv";
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* Binding to a Workers KV namespace.
|
|
1289
|
+
*
|
|
1290
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
1291
|
+
*/
|
|
1292
|
+
interface TypedKvBinding<TKey extends string = string> extends KvBinding {
|
|
1293
|
+
/** @internal Carries type parameters for inference */
|
|
1294
|
+
__typeParams: [TKey];
|
|
1295
|
+
}
|
|
1296
|
+
interface LogfwdrBindingOptions {
|
|
1297
|
+
/** The destination for this logged message. */
|
|
1298
|
+
destination: string;
|
|
1299
|
+
}
|
|
1300
|
+
/** Binding for forwarding logs to logfwdr. */
|
|
1301
|
+
interface LogfwdrBinding extends LogfwdrBindingOptions {
|
|
1302
|
+
type: "logfwdr";
|
|
1303
|
+
}
|
|
1304
|
+
interface MediaBindingOptions {
|
|
1305
|
+
/** Options that only apply during local development. */
|
|
1306
|
+
dev?: BindingDevOptions;
|
|
1307
|
+
}
|
|
1308
|
+
/** Binding to Cloudflare Media Transformations. */
|
|
1309
|
+
interface MediaBinding$1 extends MediaBindingOptions {
|
|
1310
|
+
type: "media";
|
|
1311
|
+
}
|
|
1312
|
+
interface MtlsCertificateBindingOptions {
|
|
1313
|
+
/** The UUID of the uploaded mTLS certificate. */
|
|
1314
|
+
id: string;
|
|
1315
|
+
/** Options that only apply during local development. */
|
|
1316
|
+
dev?: BindingDevOptions;
|
|
1317
|
+
}
|
|
1318
|
+
/**
|
|
1319
|
+
* Binding to an uploaded mTLS certificate.
|
|
1320
|
+
*
|
|
1321
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
|
1322
|
+
*/
|
|
1323
|
+
interface MtlsCertificateBinding extends MtlsCertificateBindingOptions {
|
|
1324
|
+
type: "mtls-certificate";
|
|
1325
|
+
}
|
|
1326
|
+
interface PipelineBindingOptions {
|
|
1327
|
+
/** Name of the Pipeline to bind. */
|
|
1328
|
+
name: string;
|
|
1329
|
+
/** Options that only apply during local development. */
|
|
1330
|
+
dev?: BindingDevOptions;
|
|
1331
|
+
}
|
|
1332
|
+
/** Binding to a Cloudflare Pipeline. */
|
|
1333
|
+
interface PipelineBinding extends PipelineBindingOptions {
|
|
1334
|
+
type: "pipeline";
|
|
1335
|
+
}
|
|
1336
|
+
/** Binding to a Cloudflare Pipeline. */
|
|
1337
|
+
interface TypedPipelineBinding<TRecord extends PipelineRecord = PipelineRecord> extends PipelineBinding {
|
|
1338
|
+
/** @internal Carries type parameters for inference */
|
|
1339
|
+
__typeParams: [TRecord];
|
|
1340
|
+
}
|
|
1341
|
+
interface QueueBindingOptions {
|
|
1342
|
+
/** The name of this Queue. */
|
|
1343
|
+
name?: string;
|
|
1344
|
+
/** The number of seconds to wait before delivering a message. */
|
|
1345
|
+
deliveryDelay?: number;
|
|
1346
|
+
/** Options that only apply during local development. */
|
|
1347
|
+
dev?: BindingDevOptions;
|
|
1348
|
+
}
|
|
1349
|
+
/**
|
|
1350
|
+
* Producer binding to a Cloudflare Queue.
|
|
1351
|
+
*
|
|
1352
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
1353
|
+
*/
|
|
1354
|
+
interface QueueBinding extends QueueBindingOptions {
|
|
1355
|
+
type: "queue";
|
|
1356
|
+
}
|
|
1357
|
+
/**
|
|
1358
|
+
* Producer binding to a Cloudflare Queue.
|
|
1359
|
+
*
|
|
1360
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
1361
|
+
*/
|
|
1362
|
+
interface TypedQueueBinding<TBody = unknown> extends QueueBinding {
|
|
1363
|
+
/** @internal Carries type parameters for inference */
|
|
1364
|
+
__typeParams: [TBody];
|
|
1365
|
+
}
|
|
1366
|
+
interface R2BindingOptions {
|
|
1367
|
+
/** The name of this R2 bucket at the edge. */
|
|
1368
|
+
name?: string;
|
|
1369
|
+
/** The jurisdiction that the bucket exists in. Default if not present. */
|
|
1370
|
+
jurisdiction?: string;
|
|
1371
|
+
/** Settings that only apply to local development. */
|
|
1372
|
+
dev?: BindingDevOptions & {
|
|
1373
|
+
/** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */experimentalS3Credentials?: {
|
|
1374
|
+
accessKeyId: string;
|
|
1375
|
+
secretAccessKey: string;
|
|
1376
|
+
};
|
|
1377
|
+
};
|
|
1378
|
+
}
|
|
1379
|
+
/**
|
|
1380
|
+
* Binding to an R2 bucket.
|
|
1381
|
+
*
|
|
1382
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
1383
|
+
*/
|
|
1384
|
+
interface R2Binding extends R2BindingOptions {
|
|
1385
|
+
type: "r2";
|
|
1386
|
+
}
|
|
1387
|
+
interface RateLimitBindingOptions {
|
|
1388
|
+
/** The namespace ID for this rate limiter. */
|
|
1389
|
+
namespace: string;
|
|
1390
|
+
/** Simple rate limiting configuration. */
|
|
1391
|
+
simple: {
|
|
1392
|
+
/** The maximum number of requests allowed in the time period. */limit: number; /** The time period in seconds (10 for ten seconds, 60 for one minute). */
|
|
1393
|
+
period: 10 | 60;
|
|
1394
|
+
};
|
|
1395
|
+
}
|
|
1396
|
+
/** Binding to a rate limiter. */
|
|
1397
|
+
interface RateLimitBinding extends RateLimitBindingOptions {
|
|
1398
|
+
type: "rate-limit";
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
* Declares a secret that is required by your Worker, exposed on `env` under
|
|
1402
|
+
* the binding name.
|
|
1403
|
+
*
|
|
1404
|
+
* When defined, this binding:
|
|
1405
|
+
* - Replaces .dev.vars/.env/process.env inference for type generation
|
|
1406
|
+
* - Enables local dev validation with warnings for missing secrets
|
|
1407
|
+
*
|
|
1408
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
|
|
1409
|
+
*/
|
|
1410
|
+
interface SecretBinding {
|
|
1411
|
+
type: "secret";
|
|
1412
|
+
}
|
|
1413
|
+
interface SecretsStoreSecretBindingOptions {
|
|
1414
|
+
/** ID of the secret store. */
|
|
1415
|
+
storeId: string;
|
|
1416
|
+
/** Name of the secret. */
|
|
1417
|
+
secretName: string;
|
|
1418
|
+
}
|
|
1419
|
+
/** Binding to a Secrets Store secret. */
|
|
1420
|
+
interface SecretsStoreSecretBinding extends SecretsStoreSecretBindingOptions {
|
|
1421
|
+
type: "secrets-store-secret";
|
|
1422
|
+
}
|
|
1423
|
+
type SendEmailDestinationOptions = {
|
|
1424
|
+
/** If this binding should be restricted to a specific verified address. */destinationAddress: string;
|
|
1425
|
+
allowedDestinationAddresses?: never;
|
|
1426
|
+
} | {
|
|
1427
|
+
destinationAddress?: never; /** If this binding should be restricted to a set of verified addresses. */
|
|
1428
|
+
allowedDestinationAddresses: string[];
|
|
1429
|
+
} | {
|
|
1430
|
+
destinationAddress?: never;
|
|
1431
|
+
allowedDestinationAddresses?: never;
|
|
1432
|
+
};
|
|
1433
|
+
type SendEmailBindingOptions = SendEmailDestinationOptions & {
|
|
1434
|
+
/** If this binding should be restricted to a set of sender addresses. */allowedSenderAddresses?: string[]; /** Options that only apply during local development. */
|
|
1435
|
+
dev?: BindingDevOptions;
|
|
1436
|
+
};
|
|
1437
|
+
/**
|
|
1438
|
+
* Binding for sending email from inside the Worker.
|
|
1439
|
+
*
|
|
1440
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
1441
|
+
*/
|
|
1442
|
+
type SendEmailBinding = SendEmailBindingOptions & {
|
|
1443
|
+
type: "send-email";
|
|
1444
|
+
};
|
|
1445
|
+
interface StreamBindingOptions {
|
|
1446
|
+
/** Options that only apply during local development. */
|
|
1447
|
+
dev?: BindingDevOptions;
|
|
1448
|
+
}
|
|
1449
|
+
/** Binding to Cloudflare Stream. */
|
|
1450
|
+
interface StreamBinding$1 extends StreamBindingOptions {
|
|
1451
|
+
type: "stream";
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* Inline string value made available to the Worker on `env` under the
|
|
1455
|
+
* binding name.
|
|
1456
|
+
*
|
|
1457
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
1458
|
+
*/
|
|
1459
|
+
interface TextBinding<T$1 extends string = string> {
|
|
1460
|
+
type: "text";
|
|
1461
|
+
/** The string value made available to the Worker. */
|
|
1462
|
+
value: T$1;
|
|
1463
|
+
}
|
|
1464
|
+
interface UnsafeBindingOptions {
|
|
1465
|
+
/** Local-dev plugin configuration for this unsafe binding. */
|
|
1466
|
+
dev?: {
|
|
1467
|
+
/** The plugin package that provides the binding's local-dev implementation. */plugin: {
|
|
1468
|
+
package: string;
|
|
1469
|
+
name: string;
|
|
1470
|
+
}; /** Plugin-specific options. */
|
|
1471
|
+
options?: Record<string, unknown>;
|
|
1472
|
+
};
|
|
1473
|
+
[key: string]: unknown;
|
|
1474
|
+
}
|
|
1475
|
+
/**
|
|
1476
|
+
* Escape-hatch binding for runtime features that aren't directly supported
|
|
1477
|
+
* by this configuration. Included in the Worker's upload metadata without
|
|
1478
|
+
* changes.
|
|
1479
|
+
*/
|
|
1480
|
+
interface UnsafeBinding extends UnsafeBindingOptions {
|
|
1481
|
+
type: `unsafe:${string}`;
|
|
1482
|
+
}
|
|
1483
|
+
interface VectorizeBindingOptions {
|
|
1484
|
+
/** The name of the Vectorize index. */
|
|
1485
|
+
name: string;
|
|
1486
|
+
/** Options that only apply during local development. */
|
|
1487
|
+
dev?: BindingDevOptions;
|
|
1488
|
+
}
|
|
1489
|
+
/**
|
|
1490
|
+
* Binding to a Vectorize index.
|
|
1491
|
+
*
|
|
1492
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
1493
|
+
*/
|
|
1494
|
+
interface VectorizeBinding extends VectorizeBindingOptions {
|
|
1495
|
+
type: "vectorize";
|
|
1496
|
+
}
|
|
1497
|
+
/** Binding to the Worker version's metadata. */
|
|
1498
|
+
interface VersionMetadataBinding {
|
|
1499
|
+
type: "version-metadata";
|
|
1500
|
+
}
|
|
1501
|
+
type VpcNetworkBindingOptions = {
|
|
1502
|
+
/** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with `networkId`. */tunnelId: string;
|
|
1503
|
+
networkId?: never; /** Options that only apply during local development. */
|
|
1504
|
+
dev?: BindingDevOptions;
|
|
1505
|
+
} | {
|
|
1506
|
+
tunnelId?: never; /** The network ID to route traffic through. Mutually exclusive with `tunnelId`. */
|
|
1507
|
+
networkId: string; /** Options that only apply during local development. */
|
|
1508
|
+
dev?: BindingDevOptions;
|
|
1509
|
+
};
|
|
1510
|
+
/** Binding to a VPC network. */
|
|
1511
|
+
type VpcNetworkBinding = VpcNetworkBindingOptions & {
|
|
1512
|
+
type: "vpc-network";
|
|
1513
|
+
};
|
|
1514
|
+
interface VpcServiceBindingOptions {
|
|
1515
|
+
/** The service ID of the VPC connectivity service. */
|
|
1516
|
+
id: string;
|
|
1517
|
+
/** Options that only apply during local development. */
|
|
1518
|
+
dev?: BindingDevOptions;
|
|
1519
|
+
}
|
|
1520
|
+
/** Binding to a VPC service. */
|
|
1521
|
+
interface VpcServiceBinding extends VpcServiceBindingOptions {
|
|
1522
|
+
type: "vpc-service";
|
|
1523
|
+
}
|
|
1524
|
+
interface WorkerBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> {
|
|
1525
|
+
/** The name or config of the bound Worker. */
|
|
1526
|
+
worker: TWorker$1;
|
|
1527
|
+
/** The named export to bind to (defaults to the default export). */
|
|
1528
|
+
exportName?: TExportName$1;
|
|
1529
|
+
/** Optional properties that will be made available to the service via `ctx.props`. */
|
|
1530
|
+
props?: Record<string, unknown>;
|
|
1531
|
+
/** Options that only apply during local development. */
|
|
1532
|
+
dev?: BindingDevOptions;
|
|
1533
|
+
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Service binding (Worker-to-Worker). `worker` is the name or config of the
|
|
1536
|
+
* bound Worker; `exportName` selects a named `WorkerEntrypoint` export
|
|
1537
|
+
* (defaults to the default export).
|
|
1538
|
+
*
|
|
1539
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
1540
|
+
*/
|
|
1541
|
+
interface WorkerBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> extends WorkerBindingOptions<TWorker$1, TExportName$1> {
|
|
1542
|
+
type: "worker";
|
|
1543
|
+
}
|
|
1544
|
+
/** Binding to a Worker Loader. */
|
|
1545
|
+
interface WorkerLoaderBinding {
|
|
1546
|
+
type: "worker-loader";
|
|
1547
|
+
}
|
|
1548
|
+
interface WorkflowBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> {
|
|
1549
|
+
/** The name or config of the Worker that defines the Workflow. */
|
|
1550
|
+
worker: TWorker$1;
|
|
1551
|
+
/** The exported class name of the Workflow. */
|
|
1552
|
+
exportName: TExportName$1;
|
|
1553
|
+
}
|
|
1087
1554
|
/**
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1090
|
-
*
|
|
1091
|
-
* Fields are validated at runtime by `InputWorkerSchema` and normalised before
|
|
1092
|
-
* being passed to downstream tooling.
|
|
1555
|
+
* Binding to a Workflow. `worker` is the name or config of the Worker that
|
|
1556
|
+
* defines the Workflow; `exportName` is the exported `WorkflowEntrypoint`
|
|
1557
|
+
* class name.
|
|
1093
1558
|
*/
|
|
1094
|
-
interface
|
|
1559
|
+
interface WorkflowBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> extends WorkflowBindingOptions<TWorker$1, TExportName$1> {
|
|
1560
|
+
type: "workflow";
|
|
1561
|
+
}
|
|
1562
|
+
interface Bindings {
|
|
1095
1563
|
/**
|
|
1096
|
-
*
|
|
1564
|
+
* Agent Memory namespace binding. Each binding is scoped to a namespace and
|
|
1565
|
+
* allows agents to persist and recall memory.
|
|
1566
|
+
*/
|
|
1567
|
+
agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;
|
|
1568
|
+
/**
|
|
1569
|
+
* Binding to the Workers AI project.
|
|
1097
1570
|
*
|
|
1098
|
-
*
|
|
1099
|
-
* hand when authoring a raw config object without the helper.
|
|
1571
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
1100
1572
|
*/
|
|
1101
|
-
|
|
1573
|
+
ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;
|
|
1102
1574
|
/**
|
|
1103
|
-
*
|
|
1575
|
+
* AI Search instance binding. Each binding is bound directly to a single
|
|
1576
|
+
* pre-existing instance within the "default" namespace.
|
|
1104
1577
|
*/
|
|
1105
|
-
|
|
1578
|
+
aiSearch(options: AiSearchBindingOptions): AiSearchBinding;
|
|
1106
1579
|
/**
|
|
1107
|
-
*
|
|
1108
|
-
*
|
|
1109
|
-
*
|
|
1110
|
-
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
|
|
1580
|
+
* AI Search namespace binding. Each binding is scoped to a namespace and
|
|
1581
|
+
* allows dynamic instance CRUD within it.
|
|
1111
1582
|
*/
|
|
1112
|
-
|
|
1583
|
+
aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;
|
|
1113
1584
|
/**
|
|
1114
|
-
*
|
|
1115
|
-
* the Workers runtime, usually used together with `compatibilityDate`.
|
|
1116
|
-
*
|
|
1117
|
-
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
|
|
1585
|
+
* Binding to an Analytics Engine dataset.
|
|
1118
1586
|
*
|
|
1119
|
-
*
|
|
1587
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
1120
1588
|
*/
|
|
1121
|
-
|
|
1589
|
+
analyticsEngineDataset(options?: AnalyticsEngineDatasetBindingOptions): AnalyticsEngineDatasetBinding;
|
|
1122
1590
|
/**
|
|
1123
|
-
*
|
|
1124
|
-
*
|
|
1125
|
-
* May be either a path string (e.g. `"./src/index.ts"`) or a module
|
|
1126
|
-
* namespace imported with the `cf-worker` import attribute.
|
|
1127
|
-
*
|
|
1128
|
-
* @example
|
|
1129
|
-
* ```ts
|
|
1130
|
-
* import * as entrypoint from "./src" with { type: "cf-worker" };
|
|
1131
|
-
* export default defineWorker({ entrypoint });
|
|
1132
|
-
* ```
|
|
1591
|
+
* Binding to an Artifacts instance. Artifacts provides git-compatible file
|
|
1592
|
+
* storage on Cloudflare Workers.
|
|
1133
1593
|
*/
|
|
1134
|
-
|
|
1594
|
+
artifacts(options: ArtifactsBindingOptions): ArtifactsBinding;
|
|
1135
1595
|
/**
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1138
|
-
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
1596
|
+
* Binding to the Worker's static assets.
|
|
1139
1597
|
*
|
|
1140
1598
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
1141
1599
|
*/
|
|
1142
|
-
assets
|
|
1143
|
-
/** How to handle HTML requests. */htmlHandling?: "auto-trailing-slash" | "drop-trailing-slash" | "force-trailing-slash" | "none"; /** How to handle requests that do not match an asset. */
|
|
1144
|
-
notFoundHandling?: "single-page-application" | "404-page" | "none";
|
|
1145
|
-
/**
|
|
1146
|
-
* Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
|
|
1147
|
-
*
|
|
1148
|
-
* Can also be `true`, indicating that every request should be routed to the User Worker.
|
|
1149
|
-
*/
|
|
1150
|
-
runWorkerFirst?: string[] | boolean;
|
|
1151
|
-
};
|
|
1600
|
+
assets(): AssetsBinding;
|
|
1152
1601
|
/**
|
|
1153
|
-
*
|
|
1602
|
+
* Binding to a headless browser usable from the Worker.
|
|
1154
1603
|
*
|
|
1155
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
1604
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
1156
1605
|
*/
|
|
1157
|
-
|
|
1606
|
+
browser(options?: BrowserBindingOptions): BrowserBinding;
|
|
1158
1607
|
/**
|
|
1159
|
-
*
|
|
1160
|
-
* Routing addresses, and raw sockets — that invoke this Worker.
|
|
1161
|
-
* Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
1162
|
-
* `triggers.scheduled(...)`, `triggers.email(...)`, or
|
|
1163
|
-
* `triggers.connect(...)`.
|
|
1608
|
+
* Binding to a D1 database.
|
|
1164
1609
|
*
|
|
1165
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
1610
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
|
1166
1611
|
*/
|
|
1167
|
-
|
|
1612
|
+
d1(options?: D1BindingOptions): D1Binding;
|
|
1168
1613
|
/**
|
|
1169
|
-
*
|
|
1170
|
-
*
|
|
1171
|
-
* `@cloudflare/config` unifies regular and streaming tail consumers under
|
|
1172
|
-
* a single field; pass `streaming: true` to forward streaming tail events.
|
|
1614
|
+
* Binding to a Workers for Platforms dispatch namespace.
|
|
1173
1615
|
*
|
|
1174
|
-
*
|
|
1175
|
-
*/
|
|
1176
|
-
tailConsumers?: Array<{
|
|
1177
|
-
/** The name of the service tail events will be forwarded to. */worker: string; /** Whether to stream tail events in real time. */
|
|
1178
|
-
streaming?: boolean;
|
|
1179
|
-
}>;
|
|
1180
|
-
/**
|
|
1181
|
-
* Specify the cache behavior of the Worker.
|
|
1616
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
1182
1617
|
*/
|
|
1183
|
-
|
|
1184
|
-
/** If cache is enabled for this Worker. */enabled: boolean; /** Whether cached assets may be reused across Worker versions. */
|
|
1185
|
-
crossVersionCache?: boolean;
|
|
1186
|
-
};
|
|
1618
|
+
dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;
|
|
1187
1619
|
/**
|
|
1188
|
-
*
|
|
1620
|
+
* Binding to a Durable Object class. `worker` is the name or config of the
|
|
1621
|
+
* Worker that defines the class; `exportName` is the exported class name.
|
|
1189
1622
|
*
|
|
1190
|
-
*
|
|
1623
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
1191
1624
|
*/
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
} | {
|
|
1196
|
-
mode?: "targeted";
|
|
1197
|
-
region: string;
|
|
1198
|
-
} | {
|
|
1199
|
-
mode?: "targeted";
|
|
1200
|
-
host: string;
|
|
1201
|
-
} | {
|
|
1202
|
-
mode?: "targeted";
|
|
1203
|
-
hostname: string;
|
|
1204
|
-
};
|
|
1625
|
+
durableObject<TWorker$1 extends WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1>>(options: DurableObjectBindingOptions<TWorker$1, TExportName$1>): DurableObjectBinding<TWorker$1, TExportName$1>;
|
|
1626
|
+
/** Binding to a Flagship feature-flag service. */
|
|
1627
|
+
flagship(options?: FlagshipBindingOptions): FlagshipBinding;
|
|
1205
1628
|
/**
|
|
1206
|
-
*
|
|
1207
|
-
* Only supported for the "standard" Usage Model.
|
|
1629
|
+
* Binding to a Hyperdrive configuration.
|
|
1208
1630
|
*
|
|
1209
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
1631
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
1210
1632
|
*/
|
|
1211
|
-
|
|
1212
|
-
/** Maximum allowed CPU time for a Worker's invocation in milliseconds. */cpuMs?: number; /** Maximum allowed number of fetch requests that a Worker's invocation can execute. */
|
|
1213
|
-
subrequests?: number;
|
|
1214
|
-
};
|
|
1633
|
+
hyperdrive(options: HyperdriveBindingOptions): HyperdriveBinding;
|
|
1215
1634
|
/**
|
|
1216
|
-
*
|
|
1217
|
-
*
|
|
1218
|
-
* This will not configure a corresponding Logpush job automatically.
|
|
1635
|
+
* Binding to Cloudflare Images.
|
|
1219
1636
|
*
|
|
1220
|
-
* For
|
|
1221
|
-
* https://blog.cloudflare.com/logpush-for-workers/
|
|
1637
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
|
|
1222
1638
|
*/
|
|
1223
|
-
|
|
1639
|
+
images(options?: ImagesBindingOptions): ImagesBinding$1;
|
|
1224
1640
|
/**
|
|
1225
|
-
*
|
|
1226
|
-
*
|
|
1227
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
|
|
1641
|
+
* Inline JSON value made available to the Worker on `env` under the
|
|
1642
|
+
* binding name.
|
|
1228
1643
|
*/
|
|
1229
|
-
|
|
1230
|
-
/** If observability is enabled for this Worker. */enabled?: boolean; /** The sampling rate. */
|
|
1231
|
-
headSamplingRate?: number;
|
|
1232
|
-
/**
|
|
1233
|
-
* Whether query strings are removed from request URLs in logs and traces.
|
|
1234
|
-
*
|
|
1235
|
-
* @default false
|
|
1236
|
-
*/
|
|
1237
|
-
redactQueryString?: boolean;
|
|
1238
|
-
logs?: {
|
|
1239
|
-
enabled?: boolean; /** The sampling rate. */
|
|
1240
|
-
headSamplingRate?: number; /** Set to false to disable invocation logs. */
|
|
1241
|
-
invocationLogs?: boolean;
|
|
1242
|
-
/**
|
|
1243
|
-
* If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
1244
|
-
*
|
|
1245
|
-
* @default true
|
|
1246
|
-
*/
|
|
1247
|
-
persist?: boolean;
|
|
1248
|
-
/**
|
|
1249
|
-
* What destinations logs emitted from the Worker should be sent to.
|
|
1250
|
-
*
|
|
1251
|
-
* @default []
|
|
1252
|
-
*/
|
|
1253
|
-
destinations?: string[];
|
|
1254
|
-
};
|
|
1255
|
-
traces?: {
|
|
1256
|
-
enabled?: boolean; /** The sampling rate. */
|
|
1257
|
-
headSamplingRate?: number;
|
|
1258
|
-
/**
|
|
1259
|
-
* If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
1260
|
-
*
|
|
1261
|
-
* @default true
|
|
1262
|
-
*/
|
|
1263
|
-
persist?: boolean;
|
|
1264
|
-
/**
|
|
1265
|
-
* What destinations traces emitted from the Worker should be sent to.
|
|
1266
|
-
*
|
|
1267
|
-
* @default []
|
|
1268
|
-
*/
|
|
1269
|
-
destinations?: string[];
|
|
1270
|
-
};
|
|
1271
|
-
};
|
|
1644
|
+
json<T$1 extends Json>(value: T$1): JsonBinding<T$1>;
|
|
1272
1645
|
/**
|
|
1273
|
-
*
|
|
1274
|
-
* test and deploy your Worker.
|
|
1275
|
-
*
|
|
1276
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
|
|
1646
|
+
* Binding to a Workers KV namespace.
|
|
1277
1647
|
*
|
|
1278
|
-
*
|
|
1648
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
1279
1649
|
*/
|
|
1280
|
-
|
|
1650
|
+
kv<TKey extends string = string>(options?: KvBindingOptions): TypedKvBinding<TKey>;
|
|
1651
|
+
/** Binding for forwarding logs to logfwdr. */
|
|
1652
|
+
logfwdr(options: LogfwdrBindingOptions): LogfwdrBinding;
|
|
1653
|
+
/** Binding to Cloudflare Media Transformations. */
|
|
1654
|
+
media(options?: MediaBindingOptions): MediaBinding$1;
|
|
1281
1655
|
/**
|
|
1282
|
-
*
|
|
1283
|
-
* serve Preview URLs for your Worker.
|
|
1656
|
+
* Binding to an uploaded mTLS certificate.
|
|
1284
1657
|
*
|
|
1285
|
-
*
|
|
1658
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
|
1286
1659
|
*/
|
|
1287
|
-
|
|
1660
|
+
mtlsCertificate(options: MtlsCertificateBindingOptions): MtlsCertificateBinding;
|
|
1661
|
+
/** Binding to a Cloudflare Pipeline. */
|
|
1662
|
+
pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;
|
|
1288
1663
|
/**
|
|
1289
|
-
*
|
|
1664
|
+
* Producer binding to a Cloudflare Queue.
|
|
1290
1665
|
*
|
|
1291
|
-
*
|
|
1666
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
1292
1667
|
*/
|
|
1293
|
-
|
|
1668
|
+
queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;
|
|
1294
1669
|
/**
|
|
1295
|
-
*
|
|
1296
|
-
* this configuration. Values are forwarded verbatim in the Worker's
|
|
1297
|
-
* upload metadata.
|
|
1670
|
+
* Binding to an R2 bucket.
|
|
1298
1671
|
*
|
|
1299
|
-
*
|
|
1300
|
-
*/
|
|
1301
|
-
unsafe?: {
|
|
1302
|
-
/**
|
|
1303
|
-
* Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
|
|
1304
|
-
* here will always be applied to metadata last, so can add new or override existing fields.
|
|
1305
|
-
*/
|
|
1306
|
-
metadata?: Record<string, unknown>;
|
|
1307
|
-
/**
|
|
1308
|
-
* Used for internal capnp uploads for the Workers runtime.
|
|
1309
|
-
*/
|
|
1310
|
-
capnp?: {
|
|
1311
|
-
basePath: string;
|
|
1312
|
-
sourceSchemas: string[];
|
|
1313
|
-
compiledSchema?: never;
|
|
1314
|
-
} | {
|
|
1315
|
-
basePath?: never;
|
|
1316
|
-
sourceSchemas?: never;
|
|
1317
|
-
compiledSchema: string;
|
|
1318
|
-
};
|
|
1319
|
-
};
|
|
1320
|
-
/**
|
|
1321
|
-
* Bindings exposed on the Worker's `env` object. Construct entries with
|
|
1322
|
-
* `bindings.kv(...)`, `bindings.r2(...)`, etc.
|
|
1672
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
1323
1673
|
*/
|
|
1324
|
-
|
|
1674
|
+
r2(options?: R2BindingOptions): R2Binding;
|
|
1675
|
+
/** Binding to a rate limiter. */
|
|
1676
|
+
rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
|
|
1325
1677
|
/**
|
|
1326
|
-
*
|
|
1327
|
-
*
|
|
1678
|
+
* Declares a secret that is required by your Worker, exposed on `env` under
|
|
1679
|
+
* the binding name.
|
|
1328
1680
|
*
|
|
1329
|
-
*
|
|
1681
|
+
* When defined, this binding:
|
|
1682
|
+
* - Replaces .dev.vars/.env/process.env inference for type generation
|
|
1683
|
+
* - Enables local dev validation with warnings for missing secrets
|
|
1330
1684
|
*
|
|
1331
|
-
*
|
|
1332
|
-
* - Declares Durable Object classes exported from this Worker.
|
|
1333
|
-
* For more information about Durable Objects, see the documentation at
|
|
1334
|
-
* https://developers.cloudflare.com/workers/learning/using-durable-objects.
|
|
1335
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects.
|
|
1685
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
|
|
1336
1686
|
*/
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
* Settings shared by the other exports.
|
|
1341
|
-
* Authored as a named `settings` export via
|
|
1342
|
-
* `defineSettings`.
|
|
1343
|
-
*/
|
|
1344
|
-
interface SettingsConfig {
|
|
1687
|
+
secret(): SecretBinding;
|
|
1688
|
+
/** Binding to a Secrets Store secret. */
|
|
1689
|
+
secretsStoreSecret(options: SecretsStoreSecretBindingOptions): SecretsStoreSecretBinding;
|
|
1345
1690
|
/**
|
|
1346
|
-
*
|
|
1691
|
+
* Binding for sending email from inside the Worker.
|
|
1347
1692
|
*
|
|
1348
|
-
*
|
|
1349
|
-
* hand when authoring a raw config object without the helper.
|
|
1350
|
-
*/
|
|
1351
|
-
type: "settings";
|
|
1352
|
-
/**
|
|
1353
|
-
* This is the ID of the account associated with your zone.
|
|
1354
|
-
* You might have more than one account, so make sure to use
|
|
1355
|
-
* the ID of the account associated with the zone/route you
|
|
1356
|
-
* provide, if you provide one. It can also be specified through
|
|
1357
|
-
* the CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
1693
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
1358
1694
|
*/
|
|
1359
|
-
|
|
1695
|
+
sendEmail(options?: SendEmailBindingOptions): SendEmailBinding;
|
|
1696
|
+
/** Binding to Cloudflare Stream. */
|
|
1697
|
+
stream(options?: StreamBindingOptions): StreamBinding$1;
|
|
1360
1698
|
/**
|
|
1361
|
-
*
|
|
1699
|
+
* Inline string value made available to the Worker on `env` under the
|
|
1700
|
+
* binding name.
|
|
1362
1701
|
*
|
|
1363
|
-
*
|
|
1364
|
-
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
|
|
1702
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
1365
1703
|
*/
|
|
1366
|
-
|
|
1367
|
-
} //#endregion
|
|
1368
|
-
//#region src/worker-definition.d.ts
|
|
1369
|
-
/**
|
|
1370
|
-
* Base shape of a Worker definition. Carries the authored config (under
|
|
1371
|
-
* {@link DEFINITION}) and the untyped cross-worker binding helpers.
|
|
1372
|
-
*/
|
|
1373
|
-
interface WorkerDefinition<TConfig$1 extends WorkerConfig = WorkerConfig> extends Pick<Bindings, "durableObject" | "worker"> {
|
|
1374
|
-
[DEFINITION]: {
|
|
1375
|
-
config: ConfigInput<Omit<TConfig$1, "type">>;
|
|
1376
|
-
type: "worker";
|
|
1377
|
-
};
|
|
1378
|
-
}
|
|
1379
|
-
/**
|
|
1380
|
-
* Worker definition with typed cross-worker binding helpers.
|
|
1381
|
-
*/
|
|
1382
|
-
interface TypedWorkerDefinition<TConfig$1 extends WorkerConfig, TWorkerName extends string = InferWorkerName<TConfig$1>> extends WorkerDefinition<TConfig$1> {
|
|
1704
|
+
text<T$1 extends string>(value: T$1): TextBinding<T$1>;
|
|
1383
1705
|
/**
|
|
1384
|
-
* Binding to a
|
|
1385
|
-
* that defines the class; `exportName` is the exported class name.
|
|
1706
|
+
* Binding to a Vectorize index.
|
|
1386
1707
|
*
|
|
1387
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
1708
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
1388
1709
|
*/
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1710
|
+
vectorize(options: VectorizeBindingOptions): VectorizeBinding;
|
|
1711
|
+
/** Binding to the Worker version's metadata. */
|
|
1712
|
+
versionMetadata(): VersionMetadataBinding;
|
|
1713
|
+
/** Binding to a VPC network. */
|
|
1714
|
+
vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;
|
|
1715
|
+
/** Binding to a VPC service. */
|
|
1716
|
+
vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;
|
|
1393
1717
|
/**
|
|
1394
|
-
* Service binding (Worker-to-Worker). `worker` is the name of the
|
|
1395
|
-
* Worker; `exportName` selects a named `WorkerEntrypoint` export
|
|
1396
|
-
* the default export).
|
|
1718
|
+
* Service binding (Worker-to-Worker). `worker` is the name or config of the
|
|
1719
|
+
* bound Worker; `exportName` selects a named `WorkerEntrypoint` export
|
|
1720
|
+
* (defaults to the default export).
|
|
1397
1721
|
*
|
|
1398
1722
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
1399
1723
|
*/
|
|
1400
|
-
worker<TExportName$1 extends
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
props?: Record<string, unknown>;
|
|
1404
|
-
dev?: BindingDevOptions;
|
|
1405
|
-
}): TypedWorkerBinding<TConfig$1, TExportName$1 extends string ? TExportName$1 : "default">;
|
|
1406
|
-
}
|
|
1407
|
-
type WorkerConfigExport<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
|
|
1408
|
-
/**
|
|
1409
|
-
* Authored Worker config shape — {@link WorkerConfig} without the `type`
|
|
1410
|
-
* discriminant, which `defineWorker` injects.
|
|
1411
|
-
*/
|
|
1412
|
-
type WorkerConfigInput = Omit<WorkerConfig, "type">;
|
|
1413
|
-
declare function defineWorker<const T$1 extends WorkerConfigInput>(config: (ctx: ConfigContext) => (WorkerConfigInput & T$1) | Promise<WorkerConfigInput & T$1>): TypedWorkerDefinition<T$1 & {
|
|
1414
|
-
type: "worker";
|
|
1415
|
-
}>;
|
|
1416
|
-
declare function defineWorker<const T$1 extends WorkerConfigInput>(config: (WorkerConfigInput & T$1) | Promise<WorkerConfigInput & T$1>): TypedWorkerDefinition<T$1 & {
|
|
1417
|
-
type: "worker";
|
|
1418
|
-
}>; //#endregion
|
|
1419
|
-
//#region src/inference.d.ts
|
|
1420
|
-
/**
|
|
1421
|
-
* The Worker's entry module, imported with the `{ type: "cf-worker" }` import attribute
|
|
1422
|
-
* @example
|
|
1423
|
-
* ```ts
|
|
1424
|
-
* import * as entrypoint from "./src" with { type: "cf-worker" };
|
|
1425
|
-
* ```
|
|
1426
|
-
*/
|
|
1427
|
-
type WorkerModule = Record<string, any>;
|
|
1428
|
-
/**
|
|
1429
|
-
* Default module type representing an unknown Worker's exports.
|
|
1430
|
-
* - default export can be `ExportedHandler` or a `WorkerEntrypoint` class constructor
|
|
1431
|
-
* - named exports can be `WorkerEntrypoint`, `DurableObject`, or `WorkflowEntrypoint` class constructors
|
|
1432
|
-
*/
|
|
1433
|
-
interface DefaultModule {
|
|
1434
|
-
default?: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded>;
|
|
1435
|
-
[key: string]: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded> | Constructor<Rpc.DurableObjectBranded> | Constructor<Rpc.WorkflowEntrypointBranded> | undefined;
|
|
1436
|
-
}
|
|
1437
|
-
/**
|
|
1438
|
-
* Represents a class constructor that creates instances of TInstance.
|
|
1439
|
-
*/
|
|
1440
|
-
type Constructor<TInstance> = new (...args: any[]) => TInstance;
|
|
1441
|
-
/**
|
|
1442
|
-
* Extracts the instance type from a class constructor if it extends `TInstance`.
|
|
1443
|
-
*/
|
|
1444
|
-
type ExtractInstance<T$1, TInstance> = T$1 extends Constructor<TInstance> ? InstanceType<T$1> : never;
|
|
1445
|
-
/**
|
|
1446
|
-
* Mapping from binding type literals to Cloudflare runtime types.
|
|
1447
|
-
*
|
|
1448
|
-
* Entries fall into two groups:
|
|
1449
|
-
* - Parameterized bindings (ai, json, kv, pipeline, queue, text) refine their
|
|
1450
|
-
* runtime type from the binding instance via nominal matches against the
|
|
1451
|
-
* `Typed*Binding` / `JsonBinding` / `TextBinding` interfaces from
|
|
1452
|
-
* `./bindings`. When `TBinding` does not match, the entry falls back to the
|
|
1453
|
-
* unparameterized runtime type.
|
|
1454
|
-
* - Non-parameterized bindings map their type literal directly to a runtime
|
|
1455
|
-
* type and ignore `TBinding`.
|
|
1456
|
-
*
|
|
1457
|
-
* IMPORTANT: The right-hand-side identifiers in this map (e.g. `KVNamespace`,
|
|
1458
|
-
* `ImagesBinding`, `Fetcher`) must resolve to the ambient runtime types from
|
|
1459
|
-
* `@cloudflare/workers-types`, not to local config interfaces. Several local
|
|
1460
|
-
* binding interfaces in `./bindings.ts` (`ImagesBinding`, `MediaBinding`,
|
|
1461
|
-
* `StreamBinding`) share names with ambient globals — importing those local
|
|
1462
|
-
* types into this file silently shadows the globals and breaks `InferEnv`.
|
|
1463
|
-
* Only import the `Typed*Binding`, `JsonBinding`, and `TextBinding` interfaces
|
|
1464
|
-
* from `./bindings` (their names do not collide with ambient globals); never
|
|
1465
|
-
* widen the import to a wildcard or to the plain `*Binding` interfaces.
|
|
1466
|
-
*/
|
|
1467
|
-
interface BindingTypeMap<TBinding> {
|
|
1468
|
-
ai: TBinding extends TypedAiBinding<infer T> ? Ai<T> : Ai;
|
|
1469
|
-
json: TBinding extends JsonBinding<infer T> ? T : never;
|
|
1470
|
-
kv: TBinding extends TypedKvBinding<infer T> ? KVNamespace<T> : KVNamespace;
|
|
1471
|
-
pipeline: TBinding extends TypedPipelineBinding<infer T> ? Pipeline<T> : Pipeline;
|
|
1472
|
-
queue: TBinding extends TypedQueueBinding<infer T> ? Queue<T> : Queue;
|
|
1473
|
-
text: TBinding extends TextBinding<infer T> ? T : never;
|
|
1474
|
-
"agent-memory": AgentMemoryNamespace;
|
|
1475
|
-
"ai-search": AiSearchInstance;
|
|
1476
|
-
"ai-search-namespace": AiSearchNamespace;
|
|
1477
|
-
"analytics-engine-dataset": AnalyticsEngineDataset;
|
|
1478
|
-
artifacts: Artifacts;
|
|
1479
|
-
assets: Fetcher;
|
|
1480
|
-
browser: BrowserRun;
|
|
1481
|
-
d1: D1Database;
|
|
1482
|
-
"dispatch-namespace": DispatchNamespace;
|
|
1483
|
-
"durable-object": DurableObjectNamespace;
|
|
1484
|
-
flagship: Flagship;
|
|
1485
|
-
hyperdrive: Hyperdrive;
|
|
1486
|
-
images: ImagesBinding;
|
|
1487
|
-
logfwdr: any;
|
|
1488
|
-
media: MediaBinding;
|
|
1489
|
-
"mtls-certificate": Fetcher;
|
|
1490
|
-
"rate-limit": RateLimit;
|
|
1491
|
-
r2: R2Bucket;
|
|
1492
|
-
secret: string;
|
|
1493
|
-
"secrets-store-secret": SecretsStoreSecret;
|
|
1494
|
-
"send-email": SendEmail;
|
|
1495
|
-
stream: StreamBinding;
|
|
1496
|
-
vectorize: VectorizeIndex;
|
|
1497
|
-
"version-metadata": WorkerVersionMetadata;
|
|
1498
|
-
"vpc-service": Fetcher;
|
|
1499
|
-
"vpc-network": Fetcher;
|
|
1500
|
-
"web-search": WebSearch;
|
|
1501
|
-
worker: Fetcher;
|
|
1502
|
-
"worker-loader": WorkerLoader;
|
|
1503
|
-
workflow: Workflow;
|
|
1504
|
-
}
|
|
1505
|
-
type InferBindingType<TBinding> = TBinding extends TypedWorkerBinding<infer TConfig, infer TExportName extends string> ? InferMainModule<TConfig> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? TModule[TExportName] extends Constructor<any> ? Fetcher<ExtractInstance<TModule[TExportName], Rpc.WorkerEntrypointBranded>> : Fetcher : never : never : TBinding extends TypedDurableObjectBinding<infer TConfig, infer TExportName extends string> ? InferMainModule<TConfig> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? DurableObjectNamespace<ExtractInstance<TModule[TExportName], Rpc.DurableObjectBranded>> : never : never : TBinding extends TypedWorkflowBinding<infer TConfig, infer TExportName extends string> ? InferMainModule<TConfig> extends infer TModule extends WorkerModule ? TExportName extends keyof TModule ? ExtractInstance<TModule[TExportName], Rpc.WorkflowEntrypointBranded> extends infer TWorkflow ? TWorkflow extends {
|
|
1506
|
-
run(event: {
|
|
1507
|
-
payload: infer P;
|
|
1508
|
-
}, step: any): any;
|
|
1509
|
-
} ? Workflow<P> : Workflow : Workflow : never : never : TBinding extends {
|
|
1510
|
-
type: `unsafe:${string}`;
|
|
1511
|
-
} ? any : TBinding extends {
|
|
1512
|
-
type: infer K extends keyof BindingTypeMap<TBinding>;
|
|
1513
|
-
} ? BindingTypeMap<TBinding>[K] : never;
|
|
1514
|
-
/**
|
|
1515
|
-
* Infer the Worker name from a config.
|
|
1516
|
-
*
|
|
1517
|
-
* @example
|
|
1518
|
-
* ```typescript
|
|
1519
|
-
* import { defineWorker } from "@cloudflare/config";
|
|
1520
|
-
* import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
|
|
1521
|
-
*
|
|
1522
|
-
* const config = defineWorker({ name: "my-worker", ... });
|
|
1523
|
-
*
|
|
1524
|
-
* type WorkerConfig = UnwrapConfig<typeof config>;
|
|
1525
|
-
* // Inferred as: "my-worker"
|
|
1526
|
-
* type Name = InferWorkerName<WorkerConfig>;
|
|
1527
|
-
* ```
|
|
1528
|
-
*/
|
|
1529
|
-
type InferWorkerName<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
|
|
1530
|
-
name: infer TName extends string;
|
|
1531
|
-
} ? TName : never;
|
|
1532
|
-
/**
|
|
1533
|
-
* Infer export names from a config's exports, optionally filtered by type.
|
|
1534
|
-
* When TExportType is `string` (default), returns all export names.
|
|
1535
|
-
* When TExportType is a specific literal like `"durable-object"` or `"workflow"`,
|
|
1536
|
-
* returns only exports of that type.
|
|
1537
|
-
*/
|
|
1538
|
-
type InferExportsByType<TUnwrappedConfig$1, TExportType extends string = string> = TUnwrappedConfig$1 extends {
|
|
1539
|
-
exports: infer TExports extends Record<string, {
|
|
1540
|
-
type: string;
|
|
1541
|
-
}>;
|
|
1542
|
-
} ? { [K in keyof TExports]: TExports[K] extends {
|
|
1543
|
-
type: TExportType;
|
|
1544
|
-
} ? K & string : never }[keyof TExports] : never;
|
|
1545
|
-
/**
|
|
1546
|
-
* Infer `WorkerEntrypoint` export names from a config.
|
|
1547
|
-
* Returns named module exports that are not declared as type `"durable-object"` or `"workflow"` in `exports`.
|
|
1548
|
-
* Excludes `"default"` since `exportName` should only be provided for named exports.
|
|
1549
|
-
*/
|
|
1550
|
-
type InferWorkerEntrypointExports<TUnwrappedConfig$1> = Exclude<keyof InferMainModule<TUnwrappedConfig$1> & string, "default" | InferExportsByType<TUnwrappedConfig$1, "durable-object" | "workflow">>;
|
|
1551
|
-
/**
|
|
1552
|
-
* Unwrap function and promise types to get the underlying config.
|
|
1553
|
-
* Use this to normalize a config before passing it to other inference utilities.
|
|
1554
|
-
*/
|
|
1555
|
-
type UnwrapConfig<TConfig$1> = TConfig$1 extends WorkerDefinition<infer TUnwrappedConfig> ? TUnwrappedConfig : TConfig$1 extends WorkerConfigExport<infer TUnwrappedConfig> ? TUnwrappedConfig : never;
|
|
1556
|
-
/**
|
|
1557
|
-
* Infer the `Env` interface type from a Worker config.
|
|
1558
|
-
*
|
|
1559
|
-
* Transforms a config object's `env` bindings into their
|
|
1560
|
-
* corresponding Cloudflare runtime types.
|
|
1561
|
-
*
|
|
1562
|
-
* @example
|
|
1563
|
-
* ```typescript
|
|
1564
|
-
* import { defineWorker, bindings } from "@cloudflare/config";
|
|
1565
|
-
* import type { InferEnv, UnwrapConfig } from "@cloudflare/config";
|
|
1566
|
-
*
|
|
1567
|
-
* const config = defineWorker({
|
|
1568
|
-
* env: {
|
|
1569
|
-
* MY_JSON: bindings.json({ id: string }),
|
|
1570
|
-
* MY_KV: bindings.kv(),
|
|
1571
|
-
* },
|
|
1572
|
-
* });
|
|
1573
|
-
*
|
|
1574
|
-
* type WorkerConfig = UnwrapConfig<typeof config>;
|
|
1575
|
-
* // Inferred as: { MY_JSON: { id: string }; MY_KV: KVNamespace }
|
|
1576
|
-
* export type Env = InferEnv<WorkerConfig>;
|
|
1577
|
-
* ```
|
|
1578
|
-
*/
|
|
1579
|
-
type InferEnv<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
|
|
1580
|
-
env: infer TEnv extends Record<string, any>;
|
|
1581
|
-
} ? { [K in keyof TEnv]: InferBindingType<TEnv[K]> } : never;
|
|
1582
|
-
/**
|
|
1583
|
-
* Infer the Durable Object namespace names from a Worker config's exports.
|
|
1584
|
-
* Returns a union of export names that declare a *live* Durable Object —
|
|
1585
|
-
* `type: "durable-object"` with `state` either omitted, `"created"`, or
|
|
1586
|
-
* `"expecting-transfer"`. Tombstone entries (`deleted`, `renamed`,
|
|
1587
|
-
* `transferred`) are excluded because they retire the namespace and a
|
|
1588
|
-
* binding to a tombstoned class would fail at deploy time.
|
|
1589
|
-
*
|
|
1590
|
-
* @example
|
|
1591
|
-
* ```typescript
|
|
1592
|
-
* import { defineWorker } from "@cloudflare/config";
|
|
1593
|
-
* import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
|
|
1594
|
-
*
|
|
1595
|
-
* const config = defineWorker({
|
|
1596
|
-
* exports: {
|
|
1597
|
-
* MyDurableObject: { type: "durable-object", storage: "sqlite" },
|
|
1598
|
-
* OldGone: { type: "durable-object", state: "deleted" },
|
|
1599
|
-
* },
|
|
1600
|
-
* });
|
|
1601
|
-
*
|
|
1602
|
-
* type WorkerConfig = UnwrapConfig<typeof config>;
|
|
1603
|
-
* // Inferred as: "MyDurableObject" (the deleted tombstone is excluded)
|
|
1604
|
-
* type DurableNamespaces = InferDurableNamespaces<WorkerConfig>;
|
|
1605
|
-
* ```
|
|
1606
|
-
*/
|
|
1607
|
-
type InferDurableNamespaces<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
|
|
1608
|
-
exports: infer TExports extends Record<string, {
|
|
1609
|
-
type: string;
|
|
1610
|
-
}>;
|
|
1611
|
-
} ? { [K in keyof TExports]: TExports[K] extends {
|
|
1612
|
-
type: "durable-object";
|
|
1613
|
-
} ? TExports[K] extends {
|
|
1614
|
-
state: "deleted" | "renamed" | "transferred";
|
|
1615
|
-
} ? never : K & string : never }[keyof TExports] : never;
|
|
1616
|
-
/**
|
|
1617
|
-
* Infer the main module type from a Worker config's entrypoint.
|
|
1618
|
-
* If entrypoint is a module namespace object, returns that type.
|
|
1619
|
-
* If entrypoint is a `string` or not present, returns `DefaultModule` as a fallback.
|
|
1620
|
-
*/
|
|
1621
|
-
type InferMainModule<TUnwrappedConfig$1> = TUnwrappedConfig$1 extends {
|
|
1622
|
-
entrypoint: infer TModule extends WorkerModule;
|
|
1623
|
-
} ? TModule : DefaultModule; //#endregion
|
|
1624
|
-
//#region src/settings-definition.d.ts
|
|
1625
|
-
/**
|
|
1626
|
-
* Authored settings config shape — {@link SettingsConfig} without the `type`
|
|
1627
|
-
* discriminant, which `defineSettings` injects.
|
|
1628
|
-
*/
|
|
1629
|
-
type SettingsConfigInput = Omit<SettingsConfig, "type">;
|
|
1630
|
-
/**
|
|
1631
|
-
* A settings definition created by {@link defineSettings}.
|
|
1632
|
-
*/
|
|
1633
|
-
interface SettingsDefinition {
|
|
1634
|
-
[DEFINITION]: {
|
|
1635
|
-
config: ConfigInput<SettingsConfigInput>;
|
|
1636
|
-
type: "settings";
|
|
1637
|
-
};
|
|
1724
|
+
worker<TWorker$1 extends WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = undefined>(options: WorkerBindingOptions<TWorker$1, TExportName$1>): WorkerBinding<TWorker$1, NoInfer<TExportName$1>>;
|
|
1725
|
+
/** Binding to a Worker Loader. */
|
|
1726
|
+
workerLoader(): WorkerLoaderBinding;
|
|
1638
1727
|
}
|
|
1639
|
-
|
|
1640
|
-
* Declare shared settings.
|
|
1641
|
-
* Authored as a named `settings` export.
|
|
1642
|
-
*/
|
|
1643
|
-
declare function defineSettings(config: ConfigInput<SettingsConfigInput>): SettingsDefinition; //#endregion
|
|
1728
|
+
declare const bindings: Bindings; //#endregion
|
|
1644
1729
|
//#endregion
|
|
1645
|
-
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding,
|
|
1730
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, CloudflareConfig, ConfigContext, ConnectTrigger, ContainerConfig, ContainerDefinition, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, Settings, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WorkerBinding, WorkerConfig, WorkerDefinition, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, defineConfig, defineContainer, defineWorker, exports, triggers };
|