cf 0.9.1 → 0.11.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 +20 -5
- package/dist/_meta/agent-context.json +46 -39
- package/dist/_meta/commands.json +9358 -10581
- package/dist/_meta/hand-written-commands.json +784 -0
- package/dist/_meta/schemas.json +14870 -14667
- package/dist/abuse-reports-sDBTV0qZ.mjs +8 -0
- package/dist/{access-CxyW_sIW.mjs → access-DcNzuCue.mjs} +1 -1
- package/dist/account-BX90zXn5.mjs +2 -0
- package/dist/account-tags-Bz3JG5hI.mjs +9 -0
- package/dist/accounts-DCuW3xyZ.mjs +28 -0
- package/dist/{acm-CHacxa3s.mjs → acm-zjfShZLS.mjs} +1 -1
- package/dist/{addressing-BnqNmmYN.mjs → addressing-DORQ64Ux.mjs} +11 -11
- package/dist/{agent-context-Bu6yvDqA.mjs → agent-context-BgPR_aQr.mjs} +1 -1
- package/dist/agent-memory-C0hAUMeC.mjs +6 -0
- package/dist/ai-BpEBGMT2.mjs +5 -0
- package/dist/ai-audit-DnU3vn3E.mjs +2 -0
- package/dist/ai-gateway-COOrr_Yw.mjs +13 -0
- package/dist/ai-search-DKbN9Tyd.mjs +7 -0
- package/dist/ai-security-C_I5lo58.mjs +4 -0
- package/dist/{alerting-qa8SkXlD.mjs → alerting-4T8gmZs-.mjs} +4 -4
- package/dist/analytics-Bxh4TCP7.mjs +3 -0
- package/dist/analytics_engine-fV56bjVN.mjs +2 -0
- package/dist/{api-security-MfHbfZyf.mjs → api-security-COk_i184.mjs} +20 -20
- package/dist/argo-DIRfvxvv.mjs +2 -0
- package/dist/args-DlUhyGU0.mjs +2 -0
- package/dist/artifacts-BBfXNfUg.mjs +4 -0
- package/dist/audit-logs-BlOrlAWe.mjs +2 -0
- package/dist/{auth-DuLchM18.mjs → auth-D3X9HYhD.mjs} +3 -3
- package/dist/auth-DPhNN3Ly.mjs +5 -0
- package/dist/billing-B9e4PnvN.mjs +3 -0
- package/dist/body-parser-BshbixEq.mjs +2 -0
- package/dist/bot-management-D2JVeS-V.mjs +5 -0
- package/dist/botnet-feed-BTzTYs5d.mjs +3 -0
- package/dist/brand-protection-C5Q6Gpw9.mjs +3 -0
- package/dist/{browser-extension-q79xHrVW.mjs → browser-extension-u5uA0Lwk.mjs} +1 -1
- package/dist/browser-run-CHGOCTdG.mjs +4 -0
- package/dist/build-D0FhOj40.mjs +8 -0
- package/dist/{cache-Cl7vKJwH.mjs → cache-C6V7PbQM.mjs} +1 -1
- package/dist/{calls-DtK_ANxq.mjs → calls-Bye8Tyy-.mjs} +1 -1
- package/dist/certificate-authorities-B-U_e6JJ.mjs +2 -0
- package/dist/cf-Ds4JFovl.mjs +18 -0
- package/dist/chunk-LQW53VED-22IYZovK.mjs +119 -0
- package/dist/chunk-QBZBEHZB-CKzQKcIp.mjs +2 -0
- package/dist/{client-certificates-BtPU9GsQ.mjs → client-certificates-3RrC-6LG.mjs} +1 -1
- package/dist/{client-side-security-DAn-3jwp.mjs → client-side-security-DIdKvRMT.mjs} +1 -1
- package/dist/cloud-connector-CL1jPQud.mjs +2 -0
- package/dist/cloudforce-one-DULeqLkR.mjs +36 -0
- package/dist/command-C9VP3xaA.mjs +2 -0
- package/dist/{completions-BHE4pRjB.mjs → completions-CqgGKRAC.mjs} +3 -3
- package/dist/config.d.mts +1460 -1348
- package/dist/config.mjs +1 -1
- package/dist/connector-interrupts-CXlLObDv.mjs +2 -0
- package/dist/connector-telemetry-events-BrYX4ig4.mjs +2 -0
- package/dist/connector-telemetry-events-latest-BbpcII3_.mjs +2 -0
- package/dist/connector-telemetry-snapshots-BdeBQYcM.mjs +2 -0
- package/dist/connector-telemetry-snapshots-latest-DuCiimXl.mjs +2 -0
- package/dist/{connectors-Bo6ZT8PT.mjs → connectors-BQwyBJ4_.mjs} +1 -1
- package/dist/containers-BrQtGiNp.mjs +58 -0
- package/dist/{content-scan-D03UfK2X.mjs → content-scan-DNzhXYkY.mjs} +1 -1
- package/dist/{csamScanner-DgS-7ADh.mjs → csamScanner-CFq5s1Q3.mjs} +1 -1
- package/dist/{ct-alerting-8AKtNnUg.mjs → ct-alerting-CH6UmsGQ.mjs} +1 -1
- package/dist/custom-certificates-DnG73Wg2.mjs +5 -0
- package/dist/custom-csrs-bhClr2SU.mjs +3 -0
- package/dist/custom-hostnames-C0eiGvG9.mjs +5 -0
- package/dist/custom-nameservers-CVMhhLm6.mjs +3 -0
- package/dist/custom-pages-DTINMR30.mjs +3 -0
- package/dist/d1-sKdExJYF.mjs +20 -0
- package/dist/data-security-mV3a6UfW.mjs +7 -0
- package/dist/dcv-delegation-dBu3jdRw.mjs +2 -0
- package/dist/delegate.mjs +1 -1
- package/dist/{deploy-DGlmjPTS.mjs → deploy-BL59O1O1.mjs} +1 -1
- package/dist/deploy-input-Dz6q-__n.mjs +2 -0
- package/dist/{dev-BbLV0Ti-.mjs → dev-BDaavgH1.mjs} +2 -2
- package/dist/diagnostics-CJV6qWUA.mjs +3 -0
- package/dist/{directory-CCndFkbQ.mjs → directory-B5zCMusW.mjs} +1 -1
- package/dist/{dispatch-namespaces-C48JQ9EA.mjs → dispatch-namespaces-Dg5lu5xX.mjs} +1 -1
- package/dist/dist-BHi7UhXO.mjs +72 -0
- package/dist/dist-BWpErtDM.mjs +384 -0
- package/dist/{dls-BBq99pjI.mjs → dls-t0hnIe_P.mjs} +1 -1
- package/dist/dns-C8FC2hbh.mjs +29 -0
- package/dist/{dns-firewall-DdwVtm12.mjs → dns-firewall-CuhhUm55.mjs} +1 -1
- package/dist/{dot-prop-6SRZBKHT-C_xd7eTS.mjs → dot-prop-6SRZBKHT-wwGHcwAa.mjs} +1 -1
- package/dist/dry-run-DL2V6yFm.mjs +2 -0
- package/dist/durable-objects-BLrgM3Cw.mjs +2 -0
- package/dist/email-auth-BmYrl0pO.mjs +2 -0
- package/dist/email-routing-CF3_Z957.mjs +6 -0
- package/dist/email-security-F7OYcMkZ.mjs +18 -0
- package/dist/email-sending-EyU3WvGQ.mjs +7 -0
- package/dist/fieldExtractors-Cno37T2m.mjs +3 -0
- package/dist/firewall-8YWWy4iB.mjs +11 -0
- package/dist/flagship-C4x0l-8J.mjs +4 -0
- package/dist/{fraud-AH47n-wL.mjs → fraud-HR_SdUx3.mjs} +1 -1
- package/dist/google-tag-gateway-BdcS0WnX.mjs +2 -0
- package/dist/{healthchecks-DfEUG007.mjs → healthchecks-4qOvjrTN.mjs} +2 -2
- package/dist/{hostnames-DQUiD3Vr.mjs → hostnames-DehdYOMz.mjs} +1 -1
- package/dist/{hyperdrive-RyQboMWI.mjs → hyperdrive-3gD3hn70.mjs} +1 -1
- package/dist/iam-DR72hmii.mjs +6 -0
- package/dist/images-CeKc5JPh.mjs +8 -0
- package/dist/index.mjs +1 -1
- package/dist/intel-DtFix9WL.mjs +8 -0
- package/dist/{interactive-mV8PABm6.mjs → interactive-C7M55Wxx.mjs} +1 -1
- package/dist/ips-CtWCjXAN.mjs +2 -0
- package/dist/{keyless-certificates-oNu5jWKF.mjs → keyless-certificates-Dk24yQFz.mjs} +1 -1
- package/dist/keys-BmhG6Kn1.mjs +2 -0
- package/dist/{kv-Bi9B4E0A.mjs → kv-BuVPAuZP.mjs} +1 -1
- package/dist/{leaked-credential-checks-DKRjBLcr.mjs → leaked-credential-checks-XcZmt1I-.mjs} +1 -1
- package/dist/load-balancers-CylN-l7n.mjs +6 -0
- package/dist/{local-DTyuGwTw.mjs → local-Be3lg_9E.mjs} +1 -1
- package/dist/{local-runtime-IAXhEugU.mjs → local-runtime-Ce7k598H.mjs} +1 -1
- package/dist/logexplorer-CvRPoKbj.mjs +17 -0
- package/dist/logo-matches-Heuft3yF.mjs +2 -0
- package/dist/logos-DRYjGBDq.mjs +3 -0
- package/dist/logpush-Dve9jOMp.mjs +4 -0
- package/dist/{logs-DmWWL5f9.mjs → logs-SC86FE89.mjs} +1 -1
- package/dist/{magic-cloud-networking-XbTa6P52.mjs → magic-cloud-networking-DXzeqwX-.mjs} +4 -4
- package/dist/magic-network-monitoring-DW0Jl74i.mjs +4 -0
- package/dist/magic-transit-BK_3asH2.mjs +111 -0
- package/dist/managed-transforms-B6TV4qoE.mjs +3 -0
- package/dist/matches-Iss9Fo4R.mjs +2 -0
- package/dist/mcp-8wxXT6JU.mjs +4 -0
- package/dist/mesh-Bf9UAS4J.mjs +4 -0
- package/dist/{moq-CJpE-eNj.mjs → moq-ZKMFOeVz.mjs} +1 -1
- package/dist/mtls-certificates-DoWm6GiE.mjs +3 -0
- package/dist/{network-D2WRXCDe.mjs → network-B1lBARU9.mjs} +1 -1
- package/dist/{network-interconnects-Clq4X1U8.mjs → network-interconnects-CLYIFHfU.mjs} +1 -1
- package/dist/oauth-DuEONNgC.mjs +14 -0
- package/dist/{oauth-clients-hilWfAlm.mjs → oauth-clients-DgiTzLzu.mjs} +1 -1
- package/dist/oauth-scopes-BOBRMxjm.mjs +2 -0
- package/dist/observability-Jya7-zkl.mjs +4 -0
- package/dist/{open-PBXRGS4R-C46yIm3u.mjs → open-PBXRGS4R-CX8K4WYl.mjs} +3 -3
- package/dist/{organization-D41rIvJa.mjs → organization-CYxYV4e0.mjs} +6 -6
- package/dist/organizations-SacGUW44.mjs +2 -0
- package/dist/origin-ca-certificates-Ph1bJGQ1.mjs +3 -0
- package/dist/origin-post-quantum-encryption-BBLiGAGB.mjs +2 -0
- package/dist/origin-tls-client-auth-DSDgTN2X.mjs +4 -0
- package/dist/{output-DgW1hQGX.mjs → output-Ccqw2WOb.mjs} +1 -1
- package/dist/page-rules-BqEyFR2c.mjs +27 -0
- package/dist/pages-CQ7ZVWk1.mjs +14 -0
- package/dist/pay-per-crawl-BMe_3_Qj.mjs +4 -0
- package/dist/pipelines-6De2Pe2C.mjs +6 -0
- package/dist/precursor-iwK-1P_d.mjs +4 -0
- package/dist/progress-BqQcF5QH.mjs +2 -0
- package/dist/project-settings-C_1-JI6Y.mjs +3 -0
- package/dist/prompt-B0sWIs9c.mjs +3 -0
- package/dist/{public-BwQqexwo-DbWj8rrr.mjs → public-BYCVISMH-DnMJ5Jct.mjs} +1 -1
- package/dist/queries-c7zvnfEQ.mjs +3 -0
- package/dist/queues-BU6y16qS.mjs +6 -0
- package/dist/r2-Jo3QMahK.mjs +24 -0
- package/dist/{r2-data-catalog-DLtf9d6o.mjs → r2-data-catalog-B-tw-JdG.mjs} +1 -1
- package/dist/radar-DIYAMEof.mjs +2 -0
- package/dist/{rate-limits-B1YjnGue.mjs → rate-limits-DewOcznT.mjs} +1 -1
- package/dist/raw-fetch-Cc-MjHeL.mjs +2 -0
- package/dist/realtimekit-cnZEVNDn.mjs +7 -0
- package/dist/registrar-BsWr_aPM.mjs +23 -0
- package/dist/{registrar-sandbox-0i1T3zne.mjs → registrar-sandbox-BlcpUyIH.mjs} +6 -6
- package/dist/{registry-DDcSvd8H.mjs → registry-jifR3_Y6.mjs} +1 -1
- package/dist/reporting--1AyTV7k.mjs +2 -0
- package/dist/request-tracers-C_VX7X6-.mjs +2 -0
- package/dist/{resource-sharing-Ctdi9D-j.mjs → resource-sharing-Br5dqr3o.mjs} +1 -1
- package/dist/resource-tagging-C33U6T74.mjs +2 -0
- package/dist/rules-BfjzALMi.mjs +4 -0
- package/dist/rulesets-3i_1Vwt-.mjs +5 -0
- package/dist/rum-CjmIckiR.mjs +4 -0
- package/dist/{schema-BeXPWeK9.mjs → schema-1mwmslUV.mjs} +1 -1
- package/dist/schema-flags-llLJuFFw.mjs +5 -0
- package/dist/{scim-BgGsmHrL.mjs → scim-pApmzA5B.mjs} +1 -1
- package/dist/sdk-ZctLa5jW.mjs +3 -0
- package/dist/{secrets-store-BCpFhYFv.mjs → secrets-store-DBC9WJau.mjs} +1 -1
- package/dist/security-center-Djm06dq-.mjs +2 -0
- package/dist/{security-txt-Be2Bif0z.mjs → security-txt-Ci7bP4zH.mjs} +1 -1
- package/dist/{share-Bz2tFTUP.mjs → share-Dj-MNXrw.mjs} +4 -4
- package/dist/shared-BJvq4DkR.mjs +290 -0
- package/dist/smart-shield--8EpJjrF.mjs +4 -0
- package/dist/snippets-Dyz0PH60.mjs +4 -0
- package/dist/{spawn-CHkoow5W.mjs → spawn-C5Z7oWdp.mjs} +108 -112
- package/dist/{spectrum-BA0a42eM.mjs → spectrum-rAHWz8rH.mjs} +1 -1
- package/dist/{speed-mmOjxOzo.mjs → speed-BKepWBXj.mjs} +1 -1
- package/dist/src-gJma71Ec.mjs +108 -0
- package/dist/{ssl-Yr6kELqg.mjs → ssl-KdFiY3ev.mjs} +1 -1
- package/dist/startup-profile-GLNPHQ9U.mjs +17 -0
- package/dist/{state-DZC531l2.mjs → state-Cu3cItUg.mjs} +1 -1
- package/dist/{stream-Cu0kYWbc.mjs → stream-CKJ6Tb0M.mjs} +13 -13
- package/dist/submit-BxbKKhBn.mjs +2 -0
- package/dist/tags-DA8dq9fx.mjs +2 -0
- package/dist/tenant-DLXw48hS.mjs +2 -0
- package/dist/tenant-custom-nameservers-9G93XuvU.mjs +3 -0
- package/dist/{tools-D2Xxfkrc.mjs → tools-x8bj9E6b.mjs} +1 -1
- package/dist/{tunnel-CDYkWjnt.mjs → tunnel-CNQA5Flp.mjs} +1 -1
- package/dist/tunnels-CC10EOsU.mjs +2 -0
- package/dist/turnstile-CH58hnf4.mjs +23 -0
- package/dist/{ui-DIpjthrV.mjs → ui-CmnnBm_O.mjs} +1 -1
- package/dist/url-info-BpCgdUtL.mjs +2 -0
- package/dist/{url-normalization-BeKkOZz7.mjs → url-normalization-BzuynEy1.mjs} +1 -1
- package/dist/url-scanner-APIZbhB7.mjs +2 -0
- package/dist/user-2-NGebfI.mjs +12 -0
- package/dist/values-S_bNv819.mjs +2 -0
- package/dist/{vectorize-CjXfiFH4.mjs → vectorize-Bv7feLBC.mjs} +1 -1
- package/dist/waiting-rooms-Dk4LIpvm.mjs +11 -0
- package/dist/{web-assets-BzM5vVzy.mjs → web-assets-C1UmOyzD.mjs} +1 -1
- package/dist/web3-GnUocVYH.mjs +4 -0
- package/dist/workers-J1-PLwdl.mjs +28 -0
- package/dist/{workers-builds-B44wc67O.mjs → workers-builds-DCHmWOMS.mjs} +4 -4
- package/dist/{workflows-rFuQWClt.mjs → workflows-CArfEI2c.mjs} +2 -2
- package/dist/zaraz-mg2YlR3_.mjs +2 -0
- package/dist/zero-trust-DVdUPtj1.mjs +93 -0
- package/dist/zone-DMAfrDJX.mjs +2 -0
- package/dist/zones-CNwxUi7I.mjs +21 -0
- package/package.json +10 -7
- package/dist/abuse-reports-CzDAjFpo.mjs +0 -8
- package/dist/account-Dd4-tDYJ.mjs +0 -2
- package/dist/account-tags-65fAlHrf.mjs +0 -9
- package/dist/accounts-Bp5KGc6r.mjs +0 -28
- package/dist/agent-memory-D--BQS0W.mjs +0 -6
- package/dist/ai-BnVlQDiI.mjs +0 -5
- package/dist/ai-audit-CfpDKXkD.mjs +0 -2
- package/dist/ai-gateway-oG4j_oYN.mjs +0 -13
- package/dist/ai-search-B2l3B_jn.mjs +0 -7
- package/dist/ai-security-byjIIrfl.mjs +0 -4
- package/dist/analytics-DeIKjC9n.mjs +0 -3
- package/dist/analytics_engine-BnECMIWJ.mjs +0 -2
- package/dist/argo-DFerMyXF.mjs +0 -2
- package/dist/artifacts-CtyEYYDa.mjs +0 -4
- package/dist/audit-logs-retFtvow.mjs +0 -2
- package/dist/auth-aazs91XL.mjs +0 -5
- package/dist/billing-CxQVqpGZ.mjs +0 -3
- package/dist/body-parser-CYD7PKFC.mjs +0 -2
- package/dist/bot-management-Rli7v7tg.mjs +0 -5
- package/dist/botnet-feed-Cw6XSEf8.mjs +0 -3
- package/dist/brand-protection-CTvnHGfV.mjs +0 -3
- package/dist/browser-run-FwtwnBzA.mjs +0 -4
- package/dist/build-Dji9BYmV.mjs +0 -2
- package/dist/certificate-authorities-DZP1RzAs.mjs +0 -2
- package/dist/cf-oSz9pud_.mjs +0 -18
- package/dist/chunk-LQW53VED-Xakf_rUn.mjs +0 -499
- package/dist/cloud-connector-BpVcvhjZ.mjs +0 -2
- package/dist/cloudforce-one-2PecncfX.mjs +0 -30
- package/dist/connector-interrupts-ollUcksZ.mjs +0 -2
- package/dist/connector-telemetry-events-D5_3X7XW.mjs +0 -2
- package/dist/connector-telemetry-snapshots-CJ9gLRFR.mjs +0 -2
- package/dist/containers-Bog7j0Hw.mjs +0 -54
- package/dist/custom-certificates-4y35UC1X.mjs +0 -5
- package/dist/custom-csrs-DwBrLh-H.mjs +0 -4
- package/dist/custom-hostnames-CDIAnsRa.mjs +0 -5
- package/dist/custom-nameservers-stk7ymnP.mjs +0 -3
- package/dist/custom-pages-vfDxrXbt.mjs +0 -4
- package/dist/d1-Cllm-iTT.mjs +0 -20
- package/dist/data-security-rnoSCEdL.mjs +0 -7
- package/dist/dcv-delegation-DCRCOL6l.mjs +0 -2
- package/dist/deploy-input-DhCo1I0I.mjs +0 -242
- package/dist/diagnostics-D5Yo2xqx.mjs +0 -3
- package/dist/dist-COfwjT96.mjs +0 -72
- package/dist/dns-DdQYtenF.mjs +0 -29
- package/dist/durable-objects-BvxXBht_.mjs +0 -2
- package/dist/email-CGOC_evd.mjs +0 -2
- package/dist/email-auth-DFvXKSkg.mjs +0 -2
- package/dist/email-routing-QBRPBlyl.mjs +0 -6
- package/dist/email-security-BFagcRPP.mjs +0 -18
- package/dist/email-sending-Ddhe7xjN.mjs +0 -7
- package/dist/filters-CGisPGD1.mjs +0 -4
- package/dist/firewall-DD8U-Brd.mjs +0 -11
- package/dist/flagship-FJHc4mFi.mjs +0 -4
- package/dist/google-tag-gateway-149kbuG_.mjs +0 -2
- package/dist/iam-BhHYhMXO.mjs +0 -6
- package/dist/images-CDViyKtZ.mjs +0 -8
- package/dist/intel-YHZbPlS3.mjs +0 -8
- package/dist/ips-BpCdldFx.mjs +0 -2
- package/dist/keys-yYtv7Ztr.mjs +0 -2
- package/dist/load-balancers-jRCN75mX.mjs +0 -7
- package/dist/logexplorer-kO8CULiK.mjs +0 -24
- package/dist/logo-matches-LyDAYPbI.mjs +0 -2
- package/dist/logos-O9f5bGSB.mjs +0 -3
- package/dist/logpush-dtXLu3Ck.mjs +0 -5
- package/dist/magic-network-monitoring-CpfkgZMp.mjs +0 -4
- package/dist/magic-transit-DwgZeIj-.mjs +0 -111
- package/dist/managed-transforms-DCmogkxv.mjs +0 -3
- package/dist/matches-BAeN8VM1.mjs +0 -2
- package/dist/mcp-DKZ2D050.mjs +0 -4
- package/dist/media-CnxgOViL.mjs +0 -2
- package/dist/mesh-CzIPtuaM.mjs +0 -4
- package/dist/mtls-certificates-Bbm_1lQI.mjs +0 -3
- package/dist/oauth-BPizUUqP.mjs +0 -15
- package/dist/oauth-scopes-CmbgsPYd.mjs +0 -2
- package/dist/observability-DXYgDdU5.mjs +0 -4
- package/dist/organizations-eNzfOwlP.mjs +0 -2
- package/dist/origin-ca-certificates-DaiAmw45.mjs +0 -3
- package/dist/origin-post-quantum-encryption-7YztBged.mjs +0 -2
- package/dist/origin-tls-client-auth-DRwURM8s.mjs +0 -4
- package/dist/page-rules-B2Csdc4h.mjs +0 -18
- package/dist/pages-BAL6Q7OY.mjs +0 -14
- package/dist/pay-per-crawl-C-1-ZAtn.mjs +0 -4
- package/dist/pipelines-cyQOuFLb.mjs +0 -6
- package/dist/precursor-BrweY39h.mjs +0 -4
- package/dist/progress-B84wYh91.mjs +0 -2
- package/dist/prompt-CDtLWxNv.mjs +0 -3
- package/dist/queries-oM8uGZy5.mjs +0 -3
- package/dist/queues-CTx04ZNw.mjs +0 -6
- package/dist/r2-CnlIUn7R.mjs +0 -24
- package/dist/radar-CGNgGh8v.mjs +0 -2
- package/dist/raw-fetch-Dz-QBoP_.mjs +0 -2
- package/dist/realtimekit-BPwzhNS9.mjs +0 -7
- package/dist/registrar-BEcb90RX.mjs +0 -21
- package/dist/reporting-CLbjHlnw.mjs +0 -2
- package/dist/request-tracers-BcKpofP1.mjs +0 -2
- package/dist/resource-tagging-DGEyVTDN.mjs +0 -2
- package/dist/rules-CmuB5rIN.mjs +0 -4
- package/dist/rulesets-CGaMq8vG.mjs +0 -8
- package/dist/rum-QT6EP4JK.mjs +0 -4
- package/dist/schema-flags-DHryz6SF.mjs +0 -5
- package/dist/sdk-m4xeaua4.mjs +0 -3
- package/dist/security-center-BNm4uPVB.mjs +0 -2
- package/dist/session-Ckt20hHa.mjs +0 -2
- package/dist/shared-BzPQog8H.mjs +0 -2
- package/dist/smart-shield-SODkOUyO.mjs +0 -4
- package/dist/snippets-B5jY8v_7.mjs +0 -4
- package/dist/src-CHW7s5IS.mjs +0 -108
- package/dist/submit-Dl_27e0n.mjs +0 -2
- package/dist/tags-Cdo_Pwtr.mjs +0 -2
- package/dist/tenant-EX-ANl6X.mjs +0 -2
- package/dist/tenant-custom-nameservers-BPHUeckw.mjs +0 -3
- package/dist/triggers-Bf9hbP3h.mjs +0 -2
- package/dist/tunnels-CgyX8R2J.mjs +0 -2
- package/dist/turnstile-BUtzlW-0.mjs +0 -23
- package/dist/url-info-CJsa1Oc9.mjs +0 -2
- package/dist/url-scanner-Cz-yl0_3.mjs +0 -2
- package/dist/user-BxHjEqpd.mjs +0 -12
- package/dist/values-C43NurfT.mjs +0 -2
- package/dist/versions-BFbc90Wu.mjs +0 -2
- package/dist/waiting-rooms-C5jSQv_r.mjs +0 -11
- package/dist/web3-Ctv9HGiR.mjs +0 -4
- package/dist/workers-D-YbIedB.mjs +0 -24
- package/dist/zaraz-BA6kY-b6.mjs +0 -2
- package/dist/zero-trust-DOFLlUz1.mjs +0 -102
- package/dist/zone-B_rgejLV.mjs +0 -2
- package/dist/zone-tags-BWdza4rH.mjs +0 -9
- package/dist/zones-DTWO7Vvn.mjs +0 -21
- /package/dist/{Page-C-JHZnIy.mjs → Page-9ry_XAVC.mjs} +0 -0
- /package/dist/{alerts-B85uj2Vx.mjs → alerts-15-IW4jE.mjs} +0 -0
- /package/dist/{autorag-Do9l_LyY.mjs → autorag-CFwRkEKw.mjs} +0 -0
- /package/dist/{brands-DateHCdd.mjs → brands-BgT1vu9B.mjs} +0 -0
- /package/dist/{chunk-6EUZQHAF-l8tR2Qyj.mjs → chunk-6EUZQHAF-C3w62dek.mjs} +0 -0
- /package/dist/{chunk-Q72B4Q5Z-CPy_WJKU.mjs → chunk-Q72B4Q5Z-DVMMVVEs.mjs} +0 -0
- /package/dist/{clear-CB2kgcEB.mjs → clear-BlCK85Me.mjs} +0 -0
- /package/dist/{cli-types-BWdZbsFE.mjs → cli-types-DAYeL_Mj.mjs} +0 -0
- /package/dist/{domain-info-DJHEt8JJ.mjs → domain-info-C7LBxPBt.mjs} +0 -0
- /package/dist/{health-buY5f5pp.mjs → health-DZFfafkX.mjs} +0 -0
- /package/dist/{input-validation-BBKJRoRB.mjs → input-validation-QDIYu7Vb.mjs} +0 -0
- /package/dist/{internal-CwyoJUHh.mjs → internal-BKHC2D1Y.mjs} +0 -0
- /package/dist/{live-wEpA5V_n.mjs → live-DwCvDmaH.mjs} +0 -0
- /package/dist/{metadata-8AkOftcB.mjs → metadata-B5yfL0ln.mjs} +0 -0
- /package/dist/{rate-limit-analytics-Bf1uT0lT.mjs → rate-limit-analytics-B8Vuu1sU.mjs} +0 -0
- /package/dist/{ready-CBSCPiHE.mjs → ready-D9H2zHHI.mjs} +0 -0
- /package/dist/{recent-submissions-Dpmq1f7z.mjs → recent-submissions-BPo0J80d.mjs} +0 -0
- /package/dist/{refute-u7ZPQJZy.mjs → refute-2W8NLCN4.mjs} +0 -0
- /package/dist/{resolve-XgxRJ-Ys.mjs → resolve-B8CyM1mi.mjs} +0 -0
- /package/dist/{scan-logo-Ba8WZAyp.mjs → scan-logo-D5x6F1Y0.mjs} +0 -0
- /package/dist/{scan-page-Bcq3Ei86.mjs → scan-page-CWhta3x7.mjs} +0 -0
- /package/dist/{search-D9WDwnV4.mjs → search-DZmBQJL9.mjs} +0 -0
- /package/dist/{signed-url-CjPbG5zV.mjs → signed-url-CQrmWgz5.mjs} +0 -0
- /package/dist/{submission-info-Z9hhp9Rq.mjs → submission-info-C98A0bqq.mjs} +0 -0
- /package/dist/{theme-BePJemMn.mjs → theme-CrIBazAF.mjs} +0 -0
- /package/dist/{total-queries-aKAYX1iX.mjs → total-queries-BZoaFoDE.mjs} +0 -0
- /package/dist/{tracked-domains-Ck7Jm4Kn.mjs → tracked-domains-CNHogPHx.mjs} +0 -0
- /package/dist/{verify-2yi0H93r.mjs → verify-4e4L9IRk.mjs} +0 -0
package/dist/config.d.mts
CHANGED
|
@@ -1,1645 +1,1757 @@
|
|
|
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.12.0/node_modules/@cloudflare/config/dist/public-CxIWEZqM.d.mts
|
|
5
|
+
//#region src/inference.d.ts
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* The Worker's entry module, imported with the `{ type: "cf-worker" }` import attribute
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import * as entrypoint from "./src" with { type: "cf-worker" };
|
|
11
|
+
* ```
|
|
8
12
|
*/
|
|
9
|
-
type
|
|
10
|
-
[key: string]: Json;
|
|
11
|
-
}; //#endregion
|
|
12
|
-
//#region src/bindings.d.ts
|
|
13
|
-
/** Options that control a binding during local development. */
|
|
14
|
-
interface BindingDevOptions {
|
|
15
|
-
/** Whether the binding should connect to the remote resource. */
|
|
16
|
-
remote?: boolean;
|
|
17
|
-
}
|
|
18
|
-
interface AgentMemoryBindingOptions {
|
|
19
|
-
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
20
|
-
namespace: string;
|
|
21
|
-
/** Options that only apply during local development. */
|
|
22
|
-
dev?: BindingDevOptions;
|
|
23
|
-
}
|
|
13
|
+
type WorkerModule = Record<string, any>;
|
|
24
14
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
15
|
+
* Default module type representing an unknown Worker's exports.
|
|
16
|
+
* - default export can be `ExportedHandler` or a `WorkerEntrypoint` class constructor
|
|
17
|
+
* - named exports can be `WorkerEntrypoint`, `DurableObject`, or `WorkflowEntrypoint` class constructors
|
|
27
18
|
*/
|
|
28
|
-
interface
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
interface AiBindingOptions {
|
|
32
|
-
/** Options that only apply during local development. */
|
|
33
|
-
dev?: BindingDevOptions;
|
|
19
|
+
interface DefaultModule {
|
|
20
|
+
default?: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded>;
|
|
21
|
+
[key: string]: ExportedHandler | Constructor<Rpc.WorkerEntrypointBranded> | Constructor<Rpc.DurableObjectBranded> | Constructor<Rpc.WorkflowEntrypointBranded> | undefined;
|
|
34
22
|
}
|
|
35
23
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
24
|
+
* Represents a class constructor that creates instances of TInstance.
|
|
39
25
|
*/
|
|
40
|
-
|
|
41
|
-
type: "ai";
|
|
42
|
-
}
|
|
26
|
+
type Constructor<TInstance> = new (...args: any[]) => TInstance;
|
|
43
27
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
28
|
+
* Extracts the instance type from a class constructor if it extends `TInstance`.
|
|
47
29
|
*/
|
|
48
|
-
|
|
49
|
-
/** @internal Carries type parameters for inference */
|
|
50
|
-
__typeParams: [TAiModelList];
|
|
51
|
-
}
|
|
52
|
-
interface AiSearchBindingOptions {
|
|
53
|
-
/** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
|
|
54
|
-
name: string;
|
|
55
|
-
/** Options that only apply during local development. */
|
|
56
|
-
dev?: BindingDevOptions;
|
|
57
|
-
}
|
|
30
|
+
type ExtractInstance<T$1, TInstance> = T$1 extends Constructor<TInstance> ? InstanceType<T$1> : never;
|
|
58
31
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
32
|
+
* Mapping from binding type literals to Cloudflare runtime types.
|
|
33
|
+
*
|
|
34
|
+
* Entries fall into two groups:
|
|
35
|
+
* - Parameterized bindings (ai, json, kv, pipeline, queue, text) refine their
|
|
36
|
+
* runtime type from the binding instance via nominal matches against the
|
|
37
|
+
* `Typed*Binding` / `JsonBinding` / `TextBinding` interfaces from
|
|
38
|
+
* `./bindings`. When `TBinding` does not match, the entry falls back to the
|
|
39
|
+
* unparameterized runtime type.
|
|
40
|
+
* - Non-parameterized bindings map their type literal directly to a runtime
|
|
41
|
+
* type and ignore `TBinding`.
|
|
42
|
+
*
|
|
43
|
+
* IMPORTANT: The right-hand-side identifiers in this map (e.g. `KVNamespace`,
|
|
44
|
+
* `ImagesBinding`, `Fetcher`) must resolve to the ambient runtime types from
|
|
45
|
+
* `@cloudflare/workers-types`, not to local config interfaces. Several local
|
|
46
|
+
* binding interfaces in `./bindings.ts` (`ImagesBinding`, `MediaBinding`,
|
|
47
|
+
* `StreamBinding`) share names with ambient globals — importing those local
|
|
48
|
+
* types into this file silently shadows the globals and breaks `InferEnv`.
|
|
49
|
+
* Only import the `Typed*Binding`, `JsonBinding`, and `TextBinding` interfaces
|
|
50
|
+
* from `./bindings` (their names do not collide with ambient globals); never
|
|
51
|
+
* widen the import to a wildcard or to the plain `*Binding` interfaces.
|
|
61
52
|
*/
|
|
62
|
-
interface
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
53
|
+
interface BindingTypeMap<TBinding> {
|
|
54
|
+
ai: TBinding extends TypedAiBinding<infer T> ? Ai<T> : Ai;
|
|
55
|
+
json: TBinding extends JsonBinding<infer T> ? T : never;
|
|
56
|
+
kv: TBinding extends TypedKvBinding<infer T> ? KVNamespace<T> : KVNamespace;
|
|
57
|
+
pipeline: TBinding extends TypedPipelineBinding<infer T> ? Pipeline<T> : Pipeline;
|
|
58
|
+
queue: TBinding extends TypedQueueBinding<infer T> ? Queue<T> : Queue;
|
|
59
|
+
text: TBinding extends TextBinding<infer T> ? T : never;
|
|
60
|
+
"agent-memory": AgentMemoryNamespace;
|
|
61
|
+
"ai-search": AiSearchInstance;
|
|
62
|
+
"ai-search-namespace": AiSearchNamespace;
|
|
63
|
+
"analytics-engine-dataset": AnalyticsEngineDataset;
|
|
64
|
+
artifacts: Artifacts;
|
|
65
|
+
assets: Fetcher;
|
|
66
|
+
browser: BrowserRun;
|
|
67
|
+
d1: D1Database;
|
|
68
|
+
"dispatch-namespace": DispatchNamespace;
|
|
69
|
+
"durable-object": DurableObjectNamespace;
|
|
70
|
+
flagship: Flagship;
|
|
71
|
+
hyperdrive: Hyperdrive;
|
|
72
|
+
images: ImagesBinding;
|
|
73
|
+
logfwdr: any;
|
|
74
|
+
media: MediaBinding;
|
|
75
|
+
"mtls-certificate": Fetcher;
|
|
76
|
+
"rate-limit": RateLimit;
|
|
77
|
+
r2: R2Bucket;
|
|
78
|
+
secret: string;
|
|
79
|
+
"secrets-store-secret": SecretsStoreSecret;
|
|
80
|
+
"send-email": SendEmail;
|
|
81
|
+
stream: StreamBinding;
|
|
82
|
+
vectorize: VectorizeIndex;
|
|
83
|
+
"version-metadata": WorkerVersionMetadata;
|
|
84
|
+
"vpc-service": Fetcher;
|
|
85
|
+
"vpc-network": Fetcher;
|
|
86
|
+
"web-search": WebSearch;
|
|
87
|
+
worker: Fetcher;
|
|
88
|
+
"worker-loader": WorkerLoader;
|
|
89
|
+
workflow: Workflow;
|
|
70
90
|
}
|
|
91
|
+
type SelectedWorkerExportName<TBinding> = TBinding extends {
|
|
92
|
+
exportName?: infer TExportName;
|
|
93
|
+
} ? TExportName extends string ? TExportName : "default" : "default";
|
|
94
|
+
type InferBindingType<TBinding> = TBinding extends {
|
|
95
|
+
type: "worker";
|
|
96
|
+
worker: infer TWorker extends WorkerReference;
|
|
97
|
+
} ? 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 {
|
|
98
|
+
type: "durable-object";
|
|
99
|
+
worker: infer TWorker extends WorkerReference;
|
|
100
|
+
exportName: infer TExportName extends string;
|
|
101
|
+
} ? 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 {
|
|
102
|
+
type: "workflow";
|
|
103
|
+
worker: infer TWorker extends WorkerReference;
|
|
104
|
+
exportName: infer TExportName extends string;
|
|
105
|
+
} ? 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 {
|
|
106
|
+
run(event: {
|
|
107
|
+
payload: infer P;
|
|
108
|
+
}, step: any): any;
|
|
109
|
+
} ? Workflow<P> : Workflow : Workflow : never : never : TBinding extends {
|
|
110
|
+
type: `unsafe:${string}`;
|
|
111
|
+
} ? any : TBinding extends {
|
|
112
|
+
type: infer K extends keyof BindingTypeMap<TBinding>;
|
|
113
|
+
} ? BindingTypeMap<TBinding>[K] : never;
|
|
71
114
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
115
|
+
* Infer export names from a config's exports, optionally filtered by type.
|
|
116
|
+
* When TExportType is `string` (default), returns all export names.
|
|
117
|
+
* When TExportType is a specific literal like `"durable-object"` or `"workflow"`,
|
|
118
|
+
* returns only exports of that type.
|
|
74
119
|
*/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
120
|
+
type InferExportsByType<TUnwrappedConfig, TExportType extends string = string> = TUnwrappedConfig extends {
|
|
121
|
+
exports: infer TExports extends Record<string, {
|
|
122
|
+
type: string;
|
|
123
|
+
}>;
|
|
124
|
+
} ? { [K in keyof TExports]: TExports[K] extends {
|
|
125
|
+
type: TExportType;
|
|
126
|
+
} ? K & string : never }[keyof TExports] : never;
|
|
82
127
|
/**
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
128
|
+
* Infer `WorkerEntrypoint` export names from a config.
|
|
129
|
+
* Returns named module exports that are not declared as type `"durable-object"` or `"workflow"` in `exports`.
|
|
130
|
+
* Excludes `"default"` since `exportName` should only be provided for named exports.
|
|
86
131
|
*/
|
|
87
|
-
|
|
88
|
-
type: "analytics-engine-dataset";
|
|
89
|
-
}
|
|
90
|
-
interface ArtifactsBindingOptions {
|
|
91
|
-
/** The namespace to use. */
|
|
92
|
-
namespace: string;
|
|
93
|
-
/** Options that only apply during local development. */
|
|
94
|
-
dev?: BindingDevOptions;
|
|
95
|
-
}
|
|
132
|
+
type InferWorkerEntrypointExports<TUnwrappedConfig> = Exclude<keyof InferMainModule<TUnwrappedConfig> & string, "default" | InferExportsByType<TUnwrappedConfig, "durable-object" | "workflow">>;
|
|
96
133
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
134
|
+
* Unwrap function and promise types to get the underlying config.
|
|
135
|
+
* Use this to normalize a config before passing it to other inference utilities.
|
|
99
136
|
*/
|
|
100
|
-
|
|
101
|
-
type: "artifacts";
|
|
102
|
-
}
|
|
137
|
+
type UnwrapConfig<TConfig$1> = TConfig$1 extends ((...args: any[]) => infer TReturn) ? UnwrapConfig<TReturn> : TConfig$1 extends Promise<infer TCompletion> ? UnwrapConfig<TCompletion> : TConfig$1;
|
|
103
138
|
/**
|
|
104
|
-
*
|
|
139
|
+
* Infer the `Env` interface type from a Worker config.
|
|
105
140
|
*
|
|
106
|
-
*
|
|
107
|
-
|
|
108
|
-
interface AssetsBinding {
|
|
109
|
-
type: "assets";
|
|
110
|
-
}
|
|
111
|
-
interface BrowserBindingOptions {
|
|
112
|
-
/** Options that only apply during local development. */
|
|
113
|
-
dev?: BindingDevOptions;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Binding to a headless browser usable from the Worker.
|
|
141
|
+
* Transforms a config object's `env` bindings into their
|
|
142
|
+
* corresponding Cloudflare runtime types.
|
|
117
143
|
*
|
|
118
|
-
*
|
|
119
|
-
|
|
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
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Binding to a D1 database.
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* import { defineWorker, bindings } from "@cloudflare/config";
|
|
147
|
+
* import type { InferEnv, UnwrapConfig } from "@cloudflare/config";
|
|
133
148
|
*
|
|
134
|
-
*
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
|
|
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
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Binding to a Workers for Platforms dispatch namespace.
|
|
149
|
+
* const config = defineWorker({
|
|
150
|
+
* env: {
|
|
151
|
+
* MY_JSON: bindings.json({ id: string }),
|
|
152
|
+
* MY_KV: bindings.kv(),
|
|
153
|
+
* },
|
|
154
|
+
* });
|
|
152
155
|
*
|
|
153
|
-
*
|
|
156
|
+
* type WorkerConfig = UnwrapConfig<typeof config>;
|
|
157
|
+
* // Inferred as: { MY_JSON: { id: string }; MY_KV: KVNamespace }
|
|
158
|
+
* export type Env = InferEnv<WorkerConfig>;
|
|
159
|
+
* ```
|
|
154
160
|
*/
|
|
155
|
-
|
|
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;
|
|
163
|
-
}
|
|
161
|
+
type InferEnv<TUnwrappedConfig> = TUnwrappedConfig extends {
|
|
162
|
+
env: infer TEnv extends Record<string, any>;
|
|
163
|
+
} ? { [K in keyof TEnv]: InferBindingType<TEnv[K]> } : never;
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
166
|
-
*
|
|
165
|
+
* Infer the Durable Object namespace names from a Worker config's exports.
|
|
166
|
+
* Returns a union of export names that declare a *live* Durable Object —
|
|
167
|
+
* `type: "durable-object"` with `state` either omitted, `"created"`, or
|
|
168
|
+
* `"expecting-transfer"`. Tombstone entries (`deleted`, `renamed`,
|
|
169
|
+
* `transferred`) are excluded because they retire the namespace and a
|
|
170
|
+
* binding to a tombstoned class would fail at deploy time.
|
|
167
171
|
*
|
|
168
|
-
*
|
|
172
|
+
* @example
|
|
173
|
+
* ```typescript
|
|
174
|
+
* import { defineWorker } from "@cloudflare/config";
|
|
175
|
+
* import type { InferDurableNamespaces, UnwrapConfig } from "@cloudflare/config";
|
|
176
|
+
*
|
|
177
|
+
* const config = defineWorker({
|
|
178
|
+
* exports: {
|
|
179
|
+
* MyDurableObject: { type: "durable-object", storage: "sqlite" },
|
|
180
|
+
* OldGone: { type: "durable-object", state: "deleted" },
|
|
181
|
+
* },
|
|
182
|
+
* });
|
|
183
|
+
*
|
|
184
|
+
* type WorkerConfig = UnwrapConfig<typeof config>;
|
|
185
|
+
* // Inferred as: "MyDurableObject" (the deleted tombstone is excluded)
|
|
186
|
+
* type DurableNamespaces = InferDurableNamespaces<WorkerConfig>;
|
|
187
|
+
* ```
|
|
169
188
|
*/
|
|
170
|
-
|
|
189
|
+
type InferDurableNamespaces<TUnwrappedConfig> = TUnwrappedConfig extends {
|
|
190
|
+
exports: infer TExports extends Record<string, {
|
|
191
|
+
type: string;
|
|
192
|
+
}>;
|
|
193
|
+
} ? { [K in keyof TExports]: TExports[K] extends {
|
|
171
194
|
type: "durable-object";
|
|
172
|
-
}
|
|
195
|
+
} ? TExports[K] extends {
|
|
196
|
+
state: "deleted" | "renamed" | "transferred";
|
|
197
|
+
} ? never : K & string : never }[keyof TExports] : never;
|
|
173
198
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
199
|
+
* Infer the main module type from a Worker config's entrypoint.
|
|
200
|
+
* If entrypoint is a module namespace object, returns that type.
|
|
201
|
+
* If entrypoint is a `string` or not present, returns `DefaultModule` as a fallback.
|
|
178
202
|
*/
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
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
|
-
}
|
|
203
|
+
type InferMainModule<TUnwrappedConfig> = TUnwrappedConfig extends {
|
|
204
|
+
entrypoint: infer TModule extends WorkerModule;
|
|
205
|
+
} ? TModule : DefaultModule; //#endregion
|
|
206
|
+
//#region src/utils.d.ts
|
|
203
207
|
/**
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
208
|
+
* Represents any valid JSON value.
|
|
207
209
|
*/
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
210
|
+
type Json = string | number | boolean | null | Json[] | {
|
|
211
|
+
[key: string]: Json;
|
|
212
|
+
}; //#endregion
|
|
213
|
+
//#region src/definition.d.ts
|
|
214
|
+
interface ConfigContext {
|
|
215
|
+
/**
|
|
216
|
+
* The mode the config is being evaluated in.
|
|
217
|
+
* Set via the `--mode` CLI flag.
|
|
218
|
+
* 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)).
|
|
219
|
+
* In Wrangler the mode defaults to `undefined`.
|
|
220
|
+
*/
|
|
221
|
+
mode: string | undefined;
|
|
214
222
|
}
|
|
215
223
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
|
|
224
|
+
* The authored config in any of its supported shapes: a plain value, a promise,
|
|
225
|
+
* or a function of {@link ConfigContext}.
|
|
219
226
|
*/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
227
|
+
type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
|
|
228
|
+
type ConfigObject = Record<string, unknown>;
|
|
229
|
+
type ConfigWithType<T$1 extends ConfigObject, TType extends string> = T$1 & {
|
|
230
|
+
type: TType;
|
|
231
|
+
}; //#endregion
|
|
232
|
+
//#region src/container-definition.d.ts
|
|
233
|
+
type ContainerConfigExport<T$1 extends ContainerConfig = ContainerConfig> = ConfigInput<T$1>;
|
|
234
|
+
type DistributiveOmit<T$1, K$1 extends PropertyKey> = T$1 extends unknown ? Omit<T$1, K$1> : never;
|
|
235
|
+
/**
|
|
236
|
+
* Authored Container config shape — {@link ContainerConfig} without the `type`
|
|
237
|
+
* discriminant, which `defineContainer` injects.
|
|
238
|
+
*/
|
|
239
|
+
type ContainerConfigInput = DistributiveOmit<ContainerConfig, "type">;
|
|
240
|
+
/** Declare a Container application. */
|
|
241
|
+
declare const defineContainer: <const TInput extends ConfigInput<ContainerConfigInput>>(config: TInput) => TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => TResult extends Promise<infer TConfig extends {
|
|
242
|
+
[x: string]: unknown;
|
|
243
|
+
}> ? Promise<ConfigWithType<TConfig, "container">> : TResult extends {
|
|
244
|
+
[x: string]: unknown;
|
|
245
|
+
} ? ConfigWithType<TResult, "container"> : never : TInput extends Promise<infer TConfig extends {
|
|
246
|
+
[x: string]: unknown;
|
|
247
|
+
}> ? Promise<ConfigWithType<TConfig, "container">> : TInput extends {
|
|
248
|
+
[x: string]: unknown;
|
|
249
|
+
} ? ConfigWithType<TInput, "container"> : never; //#endregion
|
|
250
|
+
//#region src/exports.d.ts
|
|
223
251
|
/**
|
|
224
|
-
*
|
|
225
|
-
*
|
|
252
|
+
* Storage backend for the Durable Object.
|
|
253
|
+
*
|
|
254
|
+
* Containers are only supported on the SQLite storage engine, so `container` is
|
|
255
|
+
* only offered alongside `storage: "sqlite"`.
|
|
226
256
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}
|
|
257
|
+
type DurableObjectStorageOptions<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = {
|
|
258
|
+
/**
|
|
259
|
+
* Selects the SQLite-backed storage engine (recommended for new
|
|
260
|
+
* classes).
|
|
261
|
+
*/
|
|
262
|
+
storage: "sqlite";
|
|
263
|
+
/**
|
|
264
|
+
* Attach a Container application to this Durable Object by config reference.
|
|
265
|
+
*/
|
|
266
|
+
container?: TContainer;
|
|
267
|
+
} | {
|
|
268
|
+
/** Selects the legacy key-value storage engine. */storage: "legacy-kv";
|
|
269
|
+
};
|
|
238
270
|
/**
|
|
239
|
-
*
|
|
271
|
+
* Declares a provisioned Durable Object class exported from this Worker.
|
|
240
272
|
*
|
|
241
|
-
* For
|
|
273
|
+
* For more information about Durable Objects, see the documentation at
|
|
274
|
+
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
275
|
+
*
|
|
276
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
242
277
|
*/
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
}
|
|
278
|
+
type DurableObjectCreatedExportOptions<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = {
|
|
279
|
+
state?: "created";
|
|
280
|
+
} & DurableObjectStorageOptions<TContainer>;
|
|
246
281
|
/**
|
|
247
|
-
*
|
|
282
|
+
* Retire a provisioned Durable Object namespace whose class has
|
|
283
|
+
* been removed from code.
|
|
248
284
|
*
|
|
249
|
-
*
|
|
285
|
+
* During deploy, the class must not be exported in the uploaded code, and no
|
|
286
|
+
* other Worker may hold a `durableObject` binding to the namespace.
|
|
250
287
|
*/
|
|
251
|
-
interface
|
|
252
|
-
|
|
253
|
-
__typeParams: [TKey];
|
|
254
|
-
}
|
|
255
|
-
interface LogfwdrBindingOptions {
|
|
256
|
-
/** The destination for this logged message. */
|
|
257
|
-
destination: string;
|
|
258
|
-
}
|
|
259
|
-
/** Binding for forwarding logs to logfwdr. */
|
|
260
|
-
interface LogfwdrBinding extends LogfwdrBindingOptions {
|
|
261
|
-
type: "logfwdr";
|
|
262
|
-
}
|
|
263
|
-
interface MediaBindingOptions {
|
|
264
|
-
/** Options that only apply during local development. */
|
|
265
|
-
dev?: BindingDevOptions;
|
|
266
|
-
}
|
|
267
|
-
/** Binding to Cloudflare Media Transformations. */
|
|
268
|
-
interface MediaBinding$1 extends MediaBindingOptions {
|
|
269
|
-
type: "media";
|
|
270
|
-
}
|
|
271
|
-
interface MtlsCertificateBindingOptions {
|
|
272
|
-
/** The UUID of the uploaded mTLS certificate. */
|
|
273
|
-
id: string;
|
|
274
|
-
/** Options that only apply during local development. */
|
|
275
|
-
dev?: BindingDevOptions;
|
|
288
|
+
interface DurableObjectDeletedExportOptions {
|
|
289
|
+
state: "deleted";
|
|
276
290
|
}
|
|
277
291
|
/**
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
292
|
+
* Rename a provisioned Durable Object namespace's class. The
|
|
293
|
+
* `renamedTo` value must also appear as a live (`state: "created"`)
|
|
294
|
+
* `durableObject` entry in the same `exports` map.
|
|
281
295
|
*/
|
|
282
|
-
interface
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
/** Binding to a Cloudflare Pipeline. */
|
|
292
|
-
interface PipelineBinding extends PipelineBindingOptions {
|
|
293
|
-
type: "pipeline";
|
|
294
|
-
}
|
|
295
|
-
/** Binding to a Cloudflare Pipeline. */
|
|
296
|
-
interface TypedPipelineBinding<TRecord extends PipelineRecord = PipelineRecord> extends PipelineBinding {
|
|
297
|
-
/** @internal Carries type parameters for inference */
|
|
298
|
-
__typeParams: [TRecord];
|
|
299
|
-
}
|
|
300
|
-
interface QueueBindingOptions {
|
|
301
|
-
/** The name of this Queue. */
|
|
302
|
-
name?: string;
|
|
303
|
-
/** The number of seconds to wait before delivering a message. */
|
|
304
|
-
deliveryDelay?: number;
|
|
305
|
-
/** Options that only apply during local development. */
|
|
306
|
-
dev?: BindingDevOptions;
|
|
296
|
+
interface DurableObjectRenamedExportOptions {
|
|
297
|
+
state: "renamed";
|
|
298
|
+
/**
|
|
299
|
+
* The destination class name. Must be a valid JavaScript identifier and
|
|
300
|
+
* must appear as a live (`state: "created"`) `durableObject` entry in the
|
|
301
|
+
* same `exports` map.
|
|
302
|
+
*/
|
|
303
|
+
renamedTo: string;
|
|
307
304
|
}
|
|
308
305
|
/**
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
306
|
+
* Transfer ownership of a Durable Object namespace to another Worker in the same account.
|
|
307
|
+
* The target Worker must first deploy an `expectingTransfer` entry naming this Worker via `transferFrom`.
|
|
312
308
|
*/
|
|
313
|
-
interface
|
|
314
|
-
|
|
309
|
+
interface DurableObjectTransferredExportOptions {
|
|
310
|
+
state: "transferred";
|
|
311
|
+
/**
|
|
312
|
+
* The destination Worker. Must reference a Worker in the same account.
|
|
313
|
+
*/
|
|
314
|
+
transferredTo: string;
|
|
315
315
|
}
|
|
316
316
|
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
319
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
317
|
+
* Prepare to receive cross-Worker Durable Object transfer.
|
|
318
|
+
* Once the source Worker's `transferred` export is deployed, this entry becomes a normal live `durable-object` export.
|
|
320
319
|
*/
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
320
|
+
type DurableObjectExpectingTransferExportOptions<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = {
|
|
321
|
+
state: "expecting-transfer";
|
|
322
|
+
/**
|
|
323
|
+
* The source Worker for the two-phase cross-Worker transfer.
|
|
324
|
+
*/
|
|
325
|
+
transferFrom: string;
|
|
326
|
+
} & DurableObjectStorageOptions<TContainer>;
|
|
327
|
+
type DurableObjectCreatedExport<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = DurableObjectCreatedExportOptions<TContainer> & {
|
|
328
|
+
type: "durable-object";
|
|
329
|
+
};
|
|
330
|
+
interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
|
|
331
|
+
type: "durable-object";
|
|
324
332
|
}
|
|
325
|
-
interface
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
333
|
+
interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
|
|
334
|
+
type: "durable-object";
|
|
335
|
+
}
|
|
336
|
+
interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
|
|
337
|
+
type: "durable-object";
|
|
338
|
+
}
|
|
339
|
+
type DurableObjectExpectingTransferExport<TContainer extends ContainerConfigExport | undefined = ContainerConfigExport | undefined> = DurableObjectExpectingTransferExportOptions<TContainer> & {
|
|
340
|
+
type: "durable-object";
|
|
341
|
+
};
|
|
342
|
+
type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
|
|
343
|
+
type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
|
|
344
|
+
interface WorkerEntrypointExportOptions {
|
|
345
|
+
cache?: {
|
|
346
|
+
/** Whether cache is enabled for this entrypoint. */enabled: boolean;
|
|
336
347
|
};
|
|
337
348
|
}
|
|
349
|
+
interface WorkerEntrypointExport extends WorkerEntrypointExportOptions {
|
|
350
|
+
type: "worker";
|
|
351
|
+
}
|
|
338
352
|
/**
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
353
|
+
* Configuration for named exports declared by the Worker. Each entry's
|
|
354
|
+
* key is the exported class name; the value configures the export.
|
|
342
355
|
*/
|
|
343
|
-
interface
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
356
|
+
interface Exports {
|
|
357
|
+
/**
|
|
358
|
+
* Declares a Durable Object class defined by this Worker.
|
|
359
|
+
*
|
|
360
|
+
* For more information about Durable Objects, see the documentation at
|
|
361
|
+
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
362
|
+
*
|
|
363
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
364
|
+
*/
|
|
365
|
+
durableObject<TContainer extends ContainerConfigExport | undefined = undefined>(options: DurableObjectCreatedExportOptions<TContainer>): DurableObjectCreatedExport<TContainer>;
|
|
366
|
+
/**
|
|
367
|
+
* Retire a provisioned Durable Object namespace whose class has been removed from code.
|
|
368
|
+
*/
|
|
369
|
+
durableObject(options: DurableObjectDeletedExportOptions): DurableObjectDeletedExport;
|
|
370
|
+
/**
|
|
371
|
+
* Rename a provisioned Durable Object namespace's class.
|
|
372
|
+
*/
|
|
373
|
+
durableObject(options: DurableObjectRenamedExportOptions): DurableObjectRenamedExport;
|
|
374
|
+
/**
|
|
375
|
+
* Transfer ownership of a Durable Object namespace to another Worker in the same account.
|
|
376
|
+
*/
|
|
377
|
+
durableObject(options: DurableObjectTransferredExportOptions): DurableObjectTransferredExport;
|
|
378
|
+
/**
|
|
379
|
+
* Prepare to receive cross-Worker Durable Object transfer.
|
|
380
|
+
* The source Worker must follow up with a deployment containing a `transferred` export to commit the transfer.
|
|
381
|
+
*/
|
|
382
|
+
durableObject<TContainer extends ContainerConfigExport | undefined = undefined>(options: DurableObjectExpectingTransferExportOptions<TContainer>): DurableObjectExpectingTransferExport<TContainer>;
|
|
383
|
+
durableObject(options: DurableObjectExportOptions): DurableObjectExports;
|
|
384
|
+
/** Declares a WorkerEntrypoint export defined by this Worker. */
|
|
385
|
+
worker(options?: WorkerEntrypointExportOptions): WorkerEntrypointExport;
|
|
358
386
|
}
|
|
359
387
|
/**
|
|
360
|
-
*
|
|
361
|
-
* the binding name.
|
|
388
|
+
* Exports builder for configuring Worker exports.
|
|
362
389
|
*
|
|
363
|
-
*
|
|
364
|
-
*
|
|
365
|
-
*
|
|
390
|
+
* @example
|
|
391
|
+
* ```typescript
|
|
392
|
+
* import { defineContainer, defineWorker, exports } from "@cloudflare/config";
|
|
366
393
|
*
|
|
367
|
-
*
|
|
394
|
+
* const myContainer = defineContainer({
|
|
395
|
+
* name: "my-container",
|
|
396
|
+
* image: { dockerfile: "./Dockerfile" },
|
|
397
|
+
* });
|
|
398
|
+
*
|
|
399
|
+
* export default defineWorker({
|
|
400
|
+
* exports: {
|
|
401
|
+
* MyDurableObject: exports.durableObject({ storage: "sqlite" }),
|
|
402
|
+
* MyContainerDO: exports.durableObject({ storage: "sqlite", container: myContainer }),
|
|
403
|
+
* OldClass: exports.durableObject({ state: "deleted" }),
|
|
404
|
+
* OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
|
|
405
|
+
* Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
|
|
406
|
+
* Incoming: exports.durableObject({ state: "expecting-transfer", storage: "sqlite", transferFrom: "source-worker" }),
|
|
407
|
+
* },
|
|
408
|
+
* });
|
|
409
|
+
* ```
|
|
368
410
|
*/
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
|
|
380
|
-
|
|
411
|
+
declare const exports: Exports; //#endregion
|
|
412
|
+
//#region src/triggers.d.ts
|
|
413
|
+
interface FetchTriggerOptions {
|
|
414
|
+
/**
|
|
415
|
+
* A route that your Worker should be published to.
|
|
416
|
+
*
|
|
417
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
418
|
+
*/
|
|
419
|
+
pattern: string;
|
|
420
|
+
/**
|
|
421
|
+
* The DNS zone the pattern is attached to. Required when the
|
|
422
|
+
* pattern is ambiguous.
|
|
423
|
+
*/
|
|
424
|
+
zone?: string;
|
|
381
425
|
}
|
|
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
426
|
/**
|
|
397
|
-
*
|
|
427
|
+
* Fetch trigger — a route that your Worker should be published to.
|
|
398
428
|
*
|
|
399
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
429
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
400
430
|
*/
|
|
401
|
-
|
|
402
|
-
type: "
|
|
403
|
-
};
|
|
404
|
-
interface StreamBindingOptions {
|
|
405
|
-
/** Options that only apply during local development. */
|
|
406
|
-
dev?: BindingDevOptions;
|
|
431
|
+
interface FetchTrigger extends FetchTriggerOptions {
|
|
432
|
+
type: "fetch";
|
|
407
433
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
434
|
+
interface QueueConsumerTriggerOptions {
|
|
435
|
+
/** The name of the queue from which this consumer should consume. */
|
|
436
|
+
name: string;
|
|
437
|
+
/** The queue to send messages that failed to be consumed. */
|
|
438
|
+
deadLetterQueue?: string;
|
|
439
|
+
/** The maximum number of messages per batch. */
|
|
440
|
+
maxBatchSize?: number;
|
|
441
|
+
/** The maximum number of seconds to wait to fill a batch with messages. */
|
|
442
|
+
maxBatchTimeout?: number;
|
|
443
|
+
/**
|
|
444
|
+
* The maximum number of concurrent consumer Worker invocations.
|
|
445
|
+
* Leaving this unset will allow your consumer to scale to the
|
|
446
|
+
* maximum concurrency needed to keep up with the message backlog.
|
|
447
|
+
*/
|
|
448
|
+
maxConcurrency?: number | null;
|
|
449
|
+
/** The maximum number of retries for each message. */
|
|
450
|
+
maxRetries?: number;
|
|
451
|
+
/** The number of seconds to wait before retrying a message. */
|
|
452
|
+
retryDelay?: number;
|
|
453
|
+
/** The number of milliseconds to wait for pulled messages to become visible again. */
|
|
454
|
+
visibilityTimeoutMs?: number;
|
|
411
455
|
}
|
|
412
456
|
/**
|
|
413
|
-
*
|
|
414
|
-
*
|
|
457
|
+
* Queue consumer trigger — invokes this Worker when messages arrive on the
|
|
458
|
+
* named queue.
|
|
415
459
|
*
|
|
416
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
460
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
417
461
|
*/
|
|
418
|
-
interface
|
|
419
|
-
type: "
|
|
420
|
-
/** The string value made available to the Worker. */
|
|
421
|
-
value: T$1;
|
|
462
|
+
interface QueueConsumerTrigger extends QueueConsumerTriggerOptions {
|
|
463
|
+
type: "queue";
|
|
422
464
|
}
|
|
423
|
-
interface
|
|
424
|
-
/**
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
[key: string]: unknown;
|
|
465
|
+
interface ScheduledTriggerOptions {
|
|
466
|
+
/**
|
|
467
|
+
* A "cron" definition to trigger a Worker's "scheduled" function.
|
|
468
|
+
*
|
|
469
|
+
* Lets you call Workers periodically, much like a cron job.
|
|
470
|
+
*
|
|
471
|
+
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
472
|
+
*/
|
|
473
|
+
schedule: string;
|
|
433
474
|
}
|
|
434
475
|
/**
|
|
435
|
-
*
|
|
436
|
-
*
|
|
437
|
-
*
|
|
476
|
+
* Scheduled (cron) trigger — invokes this Worker on the given schedules.
|
|
477
|
+
*
|
|
478
|
+
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
438
479
|
*/
|
|
439
|
-
interface
|
|
440
|
-
type:
|
|
480
|
+
interface ScheduledTrigger extends ScheduledTriggerOptions {
|
|
481
|
+
type: "scheduled";
|
|
441
482
|
}
|
|
442
|
-
interface
|
|
443
|
-
/**
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
483
|
+
interface EmailTriggerOptions {
|
|
484
|
+
/**
|
|
485
|
+
* Inbound Email Routing addresses handled by this Worker.
|
|
486
|
+
*
|
|
487
|
+
* Each entry is a literal recipient address (e.g. `"support@example.com"`)
|
|
488
|
+
* or a `*@domain` catch-all (e.g. `"*@example.com"`).
|
|
489
|
+
*/
|
|
490
|
+
addresses: string[];
|
|
447
491
|
}
|
|
448
492
|
/**
|
|
449
|
-
*
|
|
450
|
-
*
|
|
451
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
493
|
+
* Email trigger — invokes this Worker for the configured Email Routing
|
|
494
|
+
* addresses.
|
|
452
495
|
*/
|
|
453
|
-
interface
|
|
454
|
-
type: "
|
|
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";
|
|
496
|
+
interface EmailTrigger extends EmailTriggerOptions {
|
|
497
|
+
type: "email";
|
|
482
498
|
}
|
|
483
|
-
interface
|
|
484
|
-
/**
|
|
485
|
-
|
|
499
|
+
interface ConnectTriggerOptions {
|
|
500
|
+
/** The transport protocol to listen for. */
|
|
501
|
+
protocol: "tcp";
|
|
502
|
+
/** The port to listen on. */
|
|
503
|
+
port: number;
|
|
504
|
+
/** The address to bind to. Defaults to `127.0.0.1`. */
|
|
505
|
+
address?: string;
|
|
486
506
|
}
|
|
487
507
|
/**
|
|
488
|
-
*
|
|
489
|
-
*
|
|
508
|
+
* Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
|
|
509
|
+
* handler for raw socket connections received on the configured
|
|
510
|
+
* protocol/port.
|
|
490
511
|
*/
|
|
491
|
-
interface
|
|
492
|
-
type: "
|
|
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";
|
|
512
|
+
interface ConnectTrigger extends ConnectTriggerOptions {
|
|
513
|
+
type: "connect";
|
|
513
514
|
}
|
|
514
515
|
/**
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
*
|
|
516
|
+
* Event triggers — fetch routes, queue consumers, cron schedules, Email
|
|
517
|
+
* Routing addresses, and raw sockets — that invoke this Worker.
|
|
518
|
+
* Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
519
|
+
* `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
|
|
518
520
|
*
|
|
519
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
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
|
-
}
|
|
544
|
-
/**
|
|
545
|
-
* Binding to a Workflow. `worker` is the name of the Worker that defines
|
|
546
|
-
* the Workflow; `exportName` is the exported `WorkflowEntrypoint` class name.
|
|
521
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
547
522
|
*/
|
|
548
|
-
interface
|
|
549
|
-
worker: string;
|
|
550
|
-
exportName: TExportName$1;
|
|
551
|
-
/** @internal Carries the config type for inference */
|
|
552
|
-
__config: TConfig$1;
|
|
553
|
-
}
|
|
554
|
-
interface Bindings {
|
|
523
|
+
interface Triggers {
|
|
555
524
|
/**
|
|
556
|
-
*
|
|
557
|
-
*
|
|
525
|
+
* Fetch trigger — a route that your Worker should be published to.
|
|
526
|
+
*
|
|
527
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
558
528
|
*/
|
|
559
|
-
|
|
529
|
+
fetch(options: FetchTriggerOptions): FetchTrigger;
|
|
560
530
|
/**
|
|
561
|
-
*
|
|
531
|
+
* Queue consumer trigger — invokes this Worker when messages arrive on the
|
|
532
|
+
* named queue.
|
|
562
533
|
*
|
|
563
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
534
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
564
535
|
*/
|
|
565
|
-
|
|
536
|
+
queue(options: QueueConsumerTriggerOptions): QueueConsumerTrigger;
|
|
566
537
|
/**
|
|
567
|
-
*
|
|
568
|
-
*
|
|
538
|
+
* Scheduled (cron) trigger — invokes this Worker on the given schedules.
|
|
539
|
+
*
|
|
540
|
+
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
569
541
|
*/
|
|
570
|
-
|
|
542
|
+
scheduled(options: ScheduledTriggerOptions): ScheduledTrigger;
|
|
571
543
|
/**
|
|
572
|
-
*
|
|
573
|
-
*
|
|
544
|
+
* Email trigger — invokes this Worker for the configured Email Routing
|
|
545
|
+
* addresses.
|
|
574
546
|
*/
|
|
575
|
-
|
|
547
|
+
email(options: EmailTriggerOptions): EmailTrigger;
|
|
576
548
|
/**
|
|
577
|
-
*
|
|
578
|
-
*
|
|
579
|
-
*
|
|
549
|
+
* Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
|
|
550
|
+
* handler for raw socket connections received on the configured
|
|
551
|
+
* protocol/port.
|
|
580
552
|
*/
|
|
581
|
-
|
|
553
|
+
connect(options: ConnectTriggerOptions): ConnectTrigger;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Triggers builder for configuring event triggers.
|
|
557
|
+
*
|
|
558
|
+
* @example
|
|
559
|
+
* ```typescript
|
|
560
|
+
* import { defineWorker, triggers } from "@cloudflare/config";
|
|
561
|
+
*
|
|
562
|
+
* export default defineWorker({
|
|
563
|
+
* triggers: [
|
|
564
|
+
* triggers.fetch({ pattern: "example.com/*", zone: "example.com" }),
|
|
565
|
+
* triggers.queue({ name: "my-queue" }),
|
|
566
|
+
* triggers.scheduled({ schedule: "0 * * * *" }),
|
|
567
|
+
* triggers.scheduled({ schedule: "30 0 * * *" }),
|
|
568
|
+
* triggers.email({ addresses: ["support@example.com"] }),
|
|
569
|
+
* triggers.connect({ protocol: "tcp", port: 5432 }),
|
|
570
|
+
* ],
|
|
571
|
+
* });
|
|
572
|
+
* ```
|
|
573
|
+
*/
|
|
574
|
+
declare const triggers: Triggers; //#endregion
|
|
575
|
+
//#region src/types.d.ts
|
|
576
|
+
/**
|
|
577
|
+
* Union of all binding definitions accepted in `env`.
|
|
578
|
+
*/
|
|
579
|
+
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 | WebSearchBinding | WorkerBinding | WorkerLoaderBinding;
|
|
580
|
+
/**
|
|
581
|
+
* Union of all trigger definitions accepted in `triggers`.
|
|
582
|
+
*/
|
|
583
|
+
type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
|
|
584
|
+
/**
|
|
585
|
+
* Union of all export definitions accepted in `exports`. Worker entries
|
|
586
|
+
* configure WorkerEntrypoint exports. Durable Object entries configure live
|
|
587
|
+
* classes and tombstone lifecycle operations.
|
|
588
|
+
*/
|
|
589
|
+
type Export = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport | WorkerEntrypointExport;
|
|
590
|
+
/** An image source accepted in an authored Container configuration. */
|
|
591
|
+
type ContainerImage = {
|
|
592
|
+
/** The path to a Dockerfile. */dockerfile: string;
|
|
582
593
|
/**
|
|
583
|
-
*
|
|
584
|
-
*
|
|
594
|
+
* Build context of the application.
|
|
595
|
+
*
|
|
596
|
+
* @default The directory containing `dockerfile`.
|
|
585
597
|
*/
|
|
586
|
-
|
|
598
|
+
buildContext?: string; /** Image variables available to the image at build time only. */
|
|
599
|
+
buildVars?: Record<string, string>;
|
|
600
|
+
} | {
|
|
587
601
|
/**
|
|
588
|
-
*
|
|
602
|
+
* Reference to an existing image.
|
|
589
603
|
*
|
|
590
|
-
* For
|
|
604
|
+
* For supported registries, refer to
|
|
605
|
+
* https://developers.cloudflare.com/containers/guides/image-management/#use-pre-built-container-images
|
|
591
606
|
*/
|
|
592
|
-
|
|
607
|
+
reference: string;
|
|
608
|
+
};
|
|
609
|
+
/** Fields shared by all Container application configurations. */
|
|
610
|
+
interface BaseContainerConfig {
|
|
593
611
|
/**
|
|
594
|
-
*
|
|
612
|
+
* Discriminates this config as a Container config.
|
|
595
613
|
*
|
|
596
|
-
*
|
|
614
|
+
* Injected automatically by `defineContainer`; only needs to be written by
|
|
615
|
+
* hand when authoring a raw config object without the helper.
|
|
597
616
|
*/
|
|
598
|
-
|
|
617
|
+
type: "container";
|
|
599
618
|
/**
|
|
600
|
-
*
|
|
619
|
+
* Name of the application.
|
|
601
620
|
*
|
|
602
|
-
*
|
|
621
|
+
* This is also the identifier used to reference the Container from a Durable
|
|
622
|
+
* Object's `exports` entry via its `container` field.
|
|
603
623
|
*/
|
|
604
|
-
|
|
624
|
+
name: string;
|
|
625
|
+
/** Configures observability for Container instances. */
|
|
626
|
+
observability?: {
|
|
627
|
+
/** Whether observability is enabled. */enabled?: boolean;
|
|
628
|
+
logs?: {
|
|
629
|
+
/** Whether log collection is enabled. */enabled?: boolean;
|
|
630
|
+
};
|
|
631
|
+
} & ({
|
|
632
|
+
/** Percentage of Container instances targeted for observability. */targetInstancePercentage?: number;
|
|
633
|
+
targetInstanceCount?: never;
|
|
634
|
+
} | {
|
|
635
|
+
targetInstancePercentage?: never; /** Number of Container instances targeted for observability. */
|
|
636
|
+
targetInstanceCount?: number;
|
|
637
|
+
});
|
|
605
638
|
/**
|
|
606
|
-
*
|
|
639
|
+
* Passed through without client-side validation or transformation.
|
|
607
640
|
*
|
|
608
|
-
*
|
|
641
|
+
* @hidden
|
|
609
642
|
*/
|
|
610
|
-
|
|
643
|
+
unsafe?: Record<string, unknown>;
|
|
644
|
+
}
|
|
645
|
+
/** A Container application managed with a standard scheduling policy. */
|
|
646
|
+
interface StandardContainerConfig extends BaseContainerConfig {
|
|
647
|
+
/** The image to build or deploy. */
|
|
648
|
+
image: ContainerImage;
|
|
611
649
|
/**
|
|
612
|
-
*
|
|
613
|
-
* that defines the class; `exportName` is the exported class name.
|
|
650
|
+
* Maximum number of application instances.
|
|
614
651
|
*
|
|
615
|
-
*
|
|
652
|
+
* @default 20
|
|
616
653
|
*/
|
|
617
|
-
|
|
618
|
-
/** Binding to a Flagship feature-flag service. */
|
|
619
|
-
flagship(options?: FlagshipBindingOptions): FlagshipBinding;
|
|
654
|
+
maxInstances?: number;
|
|
620
655
|
/**
|
|
621
|
-
*
|
|
656
|
+
* The instance type to be used for the Container.
|
|
657
|
+
* Select from one of the following named instance types:
|
|
622
658
|
*
|
|
623
|
-
*
|
|
659
|
+
* - lite: 1/16 vCPU, 256 MiB memory, and 2 GB disk
|
|
660
|
+
* - basic: 1/4 vCPU, 1 GiB memory, and 4 GB disk
|
|
661
|
+
* - standard-1: 1/2 vCPU, 4 GiB memory, and 8 GB disk
|
|
662
|
+
* - standard-2: 1 vCPU, 6 GiB memory, and 12 GB disk
|
|
663
|
+
* - standard-3: 2 vCPU, 8 GiB memory, and 16 GB disk
|
|
664
|
+
* - standard-4: 4 vCPU, 12 GiB memory, and 20 GB disk
|
|
665
|
+
*
|
|
666
|
+
* Customers on an enterprise plan have the additional option to set custom
|
|
667
|
+
* limits.
|
|
668
|
+
*
|
|
669
|
+
* @default "lite"
|
|
624
670
|
*/
|
|
625
|
-
|
|
671
|
+
instanceType?: "basic" | "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4" | {
|
|
672
|
+
/** @default 0.0625 (1/16 vCPU) */vcpu?: number; /** @default 256 MiB */
|
|
673
|
+
memoryMib?: number; /** @default 2 GB */
|
|
674
|
+
diskMb?: number;
|
|
675
|
+
};
|
|
626
676
|
/**
|
|
627
|
-
*
|
|
677
|
+
* The scheduling policy of the application.
|
|
628
678
|
*
|
|
629
|
-
*
|
|
679
|
+
* @default "default"
|
|
630
680
|
*/
|
|
631
|
-
|
|
681
|
+
schedulingPolicy?: "default" | "regional";
|
|
682
|
+
ssh?: {
|
|
683
|
+
/**
|
|
684
|
+
* If enabled, users with write access to the Container application can
|
|
685
|
+
* connect to it over SSH.
|
|
686
|
+
*
|
|
687
|
+
* @default false
|
|
688
|
+
*/
|
|
689
|
+
enabled: boolean;
|
|
690
|
+
/**
|
|
691
|
+
* Port that the SSH service is running on.
|
|
692
|
+
*
|
|
693
|
+
* @default 22
|
|
694
|
+
*/
|
|
695
|
+
port?: number;
|
|
696
|
+
};
|
|
697
|
+
/** SSH public keys to put in the Container's authorized_keys file. */
|
|
698
|
+
authorizedKeys?: Array<{
|
|
699
|
+
name: string;
|
|
700
|
+
publicKey: string;
|
|
701
|
+
}>;
|
|
702
|
+
/** Scheduling constraints for Container placement. */
|
|
703
|
+
constraints?: {
|
|
704
|
+
/** Limit Container placement to specific geographic regions. */regions?: Array<"ENAM" | "WNAM" | "EEUR" | "WEUR" | "APAC" | "SAM" | "ME" | "OC" | "AFR">; /** Restrict Containers to compliance boundaries. */
|
|
705
|
+
jurisdiction?: "eu" | "fedramp";
|
|
706
|
+
};
|
|
707
|
+
rollout?: {
|
|
708
|
+
/**
|
|
709
|
+
* How a rollout should be created. It supports the following modes:
|
|
710
|
+
*
|
|
711
|
+
* - full-auto: The Container application will be rolled out fully
|
|
712
|
+
* automatically.
|
|
713
|
+
* - none: The Container application will not have a rollout or update.
|
|
714
|
+
* - full-manual: The Container application will be rolled out by manually
|
|
715
|
+
* progressing through the rollout steps.
|
|
716
|
+
*
|
|
717
|
+
* @default "full-auto"
|
|
718
|
+
* @hidden
|
|
719
|
+
*/
|
|
720
|
+
kind?: "full-auto" | "none" | "full-manual";
|
|
721
|
+
/**
|
|
722
|
+
* Configures what percentage of instances should be updated at each step of
|
|
723
|
+
* a rollout. You can specify this as a single number or an array of numbers.
|
|
724
|
+
*
|
|
725
|
+
* If this is a single number, each step will progress by that percentage.
|
|
726
|
+
* The options are 5, 10, 20, 25, 50, or 100.
|
|
727
|
+
*
|
|
728
|
+
* If this is an array, each step specifies the cumulative rollout progress.
|
|
729
|
+
* The final step must be 100.
|
|
730
|
+
*
|
|
731
|
+
* @default [10, 100]
|
|
732
|
+
*/
|
|
733
|
+
stepPercentage?: number | number[];
|
|
734
|
+
/**
|
|
735
|
+
* Configures the grace period, in seconds, for active instances before they
|
|
736
|
+
* are shut down during a rollout.
|
|
737
|
+
*
|
|
738
|
+
* @default 0
|
|
739
|
+
*/
|
|
740
|
+
activeGracePeriod?: number;
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
/** A Container application managed by a Durable Object. */
|
|
744
|
+
interface DurableObjectContainerConfig extends BaseContainerConfig {
|
|
745
|
+
schedulingPolicy: "durable-object";
|
|
746
|
+
/** Named images that the Durable Object can start. */
|
|
747
|
+
images?: Record<string, ContainerImage>;
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Container application configuration. This is the input shape passed to
|
|
751
|
+
* `defineContainer` and is validated at runtime by `InputContainerSchema`.
|
|
752
|
+
*/
|
|
753
|
+
type ContainerConfig = DurableObjectContainerConfig | StandardContainerConfig;
|
|
754
|
+
/**
|
|
755
|
+
* Worker configuration. This is the input shape passed to
|
|
756
|
+
* [`defineWorker`](https://developers.cloudflare.com/workers/wrangler/configuration/).
|
|
757
|
+
*
|
|
758
|
+
* Fields are validated at runtime by `InputWorkerSchema` and normalised before
|
|
759
|
+
* being passed to downstream tooling.
|
|
760
|
+
*/
|
|
761
|
+
interface WorkerConfig {
|
|
632
762
|
/**
|
|
633
|
-
*
|
|
634
|
-
*
|
|
763
|
+
* Discriminates this config as a Worker config.
|
|
764
|
+
*
|
|
765
|
+
* Injected automatically by `defineWorker`; only needs to be written by
|
|
766
|
+
* hand when authoring a raw config object without the helper.
|
|
635
767
|
*/
|
|
636
|
-
|
|
768
|
+
type: "worker";
|
|
637
769
|
/**
|
|
638
|
-
*
|
|
639
|
-
*
|
|
640
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
770
|
+
* The name of your Worker.
|
|
641
771
|
*/
|
|
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;
|
|
772
|
+
name: string;
|
|
647
773
|
/**
|
|
648
|
-
*
|
|
774
|
+
* A date in the form yyyy-mm-dd, which will be used to determine
|
|
775
|
+
* which version of the Workers runtime is used.
|
|
649
776
|
*
|
|
650
|
-
*
|
|
777
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
|
|
651
778
|
*/
|
|
652
|
-
|
|
653
|
-
/** Binding to a Cloudflare Pipeline. */
|
|
654
|
-
pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;
|
|
779
|
+
compatibilityDate: string;
|
|
655
780
|
/**
|
|
656
|
-
*
|
|
781
|
+
* A list of flags that enable features from upcoming features of
|
|
782
|
+
* the Workers runtime, usually used together with `compatibilityDate`.
|
|
657
783
|
*
|
|
658
|
-
*
|
|
784
|
+
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
|
|
785
|
+
*
|
|
786
|
+
* @default []
|
|
659
787
|
*/
|
|
660
|
-
|
|
788
|
+
compatibilityFlags?: string[];
|
|
661
789
|
/**
|
|
662
|
-
*
|
|
790
|
+
* The entrypoint module that will be executed.
|
|
663
791
|
*
|
|
664
|
-
*
|
|
792
|
+
* May be either a path string (e.g. `"./src/index.ts"`) or a module
|
|
793
|
+
* namespace imported with the `cf-worker` import attribute.
|
|
794
|
+
*
|
|
795
|
+
* @example
|
|
796
|
+
* ```ts
|
|
797
|
+
* import * as entrypoint from "./src" with { type: "cf-worker" };
|
|
798
|
+
* export default defineWorker({ entrypoint });
|
|
799
|
+
* ```
|
|
665
800
|
*/
|
|
666
|
-
|
|
667
|
-
/** Binding to a rate limiter. */
|
|
668
|
-
rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
|
|
801
|
+
entrypoint?: string | WorkerModule;
|
|
669
802
|
/**
|
|
670
|
-
*
|
|
671
|
-
* the binding name.
|
|
803
|
+
* Specify the directory of static assets to deploy/serve.
|
|
672
804
|
*
|
|
673
|
-
*
|
|
674
|
-
* - Replaces .dev.vars/.env/process.env inference for type generation
|
|
675
|
-
* - Enables local dev validation with warnings for missing secrets
|
|
805
|
+
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
676
806
|
*
|
|
677
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
807
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
678
808
|
*/
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
809
|
+
assets?: {
|
|
810
|
+
/** 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. */
|
|
811
|
+
notFoundHandling?: "single-page-application" | "404-page" | "none";
|
|
812
|
+
/**
|
|
813
|
+
* Matches will be routed to the User Worker, and matches to negative rules will go to the Asset Worker.
|
|
814
|
+
*
|
|
815
|
+
* Can also be `true`, indicating that every request should be routed to the User Worker.
|
|
816
|
+
*/
|
|
817
|
+
runWorkerFirst?: string[] | boolean;
|
|
818
|
+
};
|
|
682
819
|
/**
|
|
683
|
-
*
|
|
820
|
+
* Custom domains that your Worker should be published to.
|
|
684
821
|
*
|
|
685
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
822
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#types-of-routes
|
|
686
823
|
*/
|
|
687
|
-
|
|
688
|
-
/** Binding to Cloudflare Stream. */
|
|
689
|
-
stream(options?: StreamBindingOptions): StreamBinding$1;
|
|
824
|
+
domains?: string[];
|
|
690
825
|
/**
|
|
691
|
-
*
|
|
692
|
-
*
|
|
826
|
+
* Event triggers — fetch routes, queue consumers, cron schedules, Email
|
|
827
|
+
* Routing addresses, and raw sockets — that invoke this Worker.
|
|
828
|
+
* Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
829
|
+
* `triggers.scheduled(...)`, `triggers.email(...)`, or
|
|
830
|
+
* `triggers.connect(...)`.
|
|
693
831
|
*
|
|
694
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
832
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
695
833
|
*/
|
|
696
|
-
|
|
834
|
+
triggers?: Trigger[];
|
|
697
835
|
/**
|
|
698
|
-
*
|
|
836
|
+
* A list of Tail Workers that are bound to this Worker.
|
|
699
837
|
*
|
|
700
|
-
*
|
|
838
|
+
* `@cloudflare/config` unifies regular and streaming tail consumers under
|
|
839
|
+
* a single field; pass `streaming: true` to forward streaming tail events.
|
|
840
|
+
*
|
|
841
|
+
* @default []
|
|
701
842
|
*/
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;
|
|
707
|
-
/** Binding to a VPC service. */
|
|
708
|
-
vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;
|
|
843
|
+
tailConsumers?: Array<{
|
|
844
|
+
/** The name of the service tail events will be forwarded to. */worker: string; /** Whether to stream tail events in real time. */
|
|
845
|
+
streaming?: boolean;
|
|
846
|
+
}>;
|
|
709
847
|
/**
|
|
710
|
-
*
|
|
711
|
-
* the binding is zero-config — only the variable name is required.
|
|
848
|
+
* Specify the cache behavior of the Worker.
|
|
712
849
|
*/
|
|
713
|
-
|
|
850
|
+
cache?: {
|
|
851
|
+
/** If cache is enabled for this Worker. */enabled: boolean; /** Whether cached assets may be reused across Worker versions. */
|
|
852
|
+
crossVersionCache?: boolean;
|
|
853
|
+
};
|
|
714
854
|
/**
|
|
715
|
-
*
|
|
716
|
-
* Worker; `exportName` selects a named `WorkerEntrypoint` export (defaults to
|
|
717
|
-
* the default export).
|
|
855
|
+
* Specify how the Worker should be located to minimize round-trip time.
|
|
718
856
|
*
|
|
719
|
-
*
|
|
857
|
+
* More details: https://developers.cloudflare.com/workers/platform/smart-placement/
|
|
720
858
|
*/
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
859
|
+
placement?: {
|
|
860
|
+
mode: "off" | "smart";
|
|
861
|
+
hint?: string;
|
|
862
|
+
} | {
|
|
863
|
+
mode?: "targeted";
|
|
864
|
+
region: string;
|
|
865
|
+
} | {
|
|
866
|
+
mode?: "targeted";
|
|
867
|
+
host: string;
|
|
868
|
+
} | {
|
|
869
|
+
mode?: "targeted";
|
|
870
|
+
hostname: string;
|
|
871
|
+
};
|
|
728
872
|
/**
|
|
729
|
-
*
|
|
873
|
+
* Specify limits for runtime behavior.
|
|
874
|
+
* Only supported for the "standard" Usage Model.
|
|
730
875
|
*
|
|
731
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
732
|
-
*/
|
|
733
|
-
pattern: string;
|
|
734
|
-
/**
|
|
735
|
-
* The DNS zone the pattern is attached to. Required when the
|
|
736
|
-
* pattern is ambiguous.
|
|
737
|
-
*/
|
|
738
|
-
zone?: string;
|
|
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;
|
|
757
|
-
/**
|
|
758
|
-
* The maximum number of concurrent consumer Worker invocations.
|
|
759
|
-
* Leaving this unset will allow your consumer to scale to the
|
|
760
|
-
* maximum concurrency needed to keep up with the message backlog.
|
|
876
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#limits
|
|
761
877
|
*/
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
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 {
|
|
878
|
+
limits?: {
|
|
879
|
+
/** 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. */
|
|
880
|
+
subrequests?: number;
|
|
881
|
+
};
|
|
780
882
|
/**
|
|
781
|
-
*
|
|
883
|
+
* Send Trace Events from this Worker to Workers Logpush.
|
|
782
884
|
*
|
|
783
|
-
*
|
|
885
|
+
* This will not configure a corresponding Logpush job automatically.
|
|
784
886
|
*
|
|
785
|
-
*
|
|
887
|
+
* For more information about Workers Logpush, see:
|
|
888
|
+
* https://blog.cloudflare.com/logpush-for-workers/
|
|
786
889
|
*/
|
|
787
|
-
|
|
788
|
-
}
|
|
789
|
-
/**
|
|
790
|
-
* Scheduled (cron) trigger — invokes this Worker on the given schedules.
|
|
791
|
-
*
|
|
792
|
-
* More details here https://developers.cloudflare.com/workers/platform/cron-triggers
|
|
793
|
-
*/
|
|
794
|
-
interface ScheduledTrigger extends ScheduledTriggerOptions {
|
|
795
|
-
type: "scheduled";
|
|
796
|
-
}
|
|
797
|
-
interface EmailTriggerOptions {
|
|
890
|
+
logpush?: boolean;
|
|
798
891
|
/**
|
|
799
|
-
*
|
|
892
|
+
* Specify the observability behavior of the Worker.
|
|
800
893
|
*
|
|
801
|
-
*
|
|
802
|
-
* or a `*@domain` catch-all (e.g. `"*@example.com"`).
|
|
894
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#observability
|
|
803
895
|
*/
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
896
|
+
observability?: {
|
|
897
|
+
/** If observability is enabled for this Worker. */enabled?: boolean; /** The sampling rate. */
|
|
898
|
+
headSamplingRate?: number;
|
|
899
|
+
/**
|
|
900
|
+
* Whether query strings are removed from request URLs in logs and traces.
|
|
901
|
+
*
|
|
902
|
+
* @default false
|
|
903
|
+
*/
|
|
904
|
+
redactQueryString?: boolean;
|
|
905
|
+
logs?: {
|
|
906
|
+
enabled?: boolean; /** The sampling rate. */
|
|
907
|
+
headSamplingRate?: number; /** Set to false to disable invocation logs. */
|
|
908
|
+
invocationLogs?: boolean;
|
|
909
|
+
/**
|
|
910
|
+
* If logs should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
911
|
+
*
|
|
912
|
+
* @default true
|
|
913
|
+
*/
|
|
914
|
+
persist?: boolean;
|
|
915
|
+
/**
|
|
916
|
+
* What destinations logs emitted from the Worker should be sent to.
|
|
917
|
+
*
|
|
918
|
+
* @default []
|
|
919
|
+
*/
|
|
920
|
+
destinations?: string[];
|
|
921
|
+
};
|
|
922
|
+
traces?: {
|
|
923
|
+
enabled?: boolean; /** The sampling rate. */
|
|
924
|
+
headSamplingRate?: number;
|
|
925
|
+
/**
|
|
926
|
+
* If traces should be persisted to the Cloudflare observability platform where they can be queried in the dashboard.
|
|
927
|
+
*
|
|
928
|
+
* @default true
|
|
929
|
+
*/
|
|
930
|
+
persist?: boolean;
|
|
931
|
+
/**
|
|
932
|
+
* What destinations traces emitted from the Worker should be sent to.
|
|
933
|
+
*
|
|
934
|
+
* @default []
|
|
935
|
+
*/
|
|
936
|
+
destinations?: string[];
|
|
937
|
+
};
|
|
938
|
+
};
|
|
838
939
|
/**
|
|
839
|
-
*
|
|
940
|
+
* Whether we use `<name>.<subdomain>.workers.dev` to
|
|
941
|
+
* test and deploy your Worker.
|
|
840
942
|
*
|
|
841
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
842
|
-
*/
|
|
843
|
-
fetch(options: FetchTriggerOptions): FetchTrigger;
|
|
844
|
-
/**
|
|
845
|
-
* Queue consumer trigger — invokes this Worker when messages arrive on the
|
|
846
|
-
* named queue.
|
|
943
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
|
|
847
944
|
*
|
|
848
|
-
*
|
|
945
|
+
* @default true
|
|
849
946
|
*/
|
|
850
|
-
|
|
947
|
+
workersDev?: boolean;
|
|
851
948
|
/**
|
|
852
|
-
*
|
|
949
|
+
* Whether we use `<version>-<name>.<subdomain>.workers.dev` to
|
|
950
|
+
* serve Preview URLs for your Worker.
|
|
853
951
|
*
|
|
854
|
-
*
|
|
952
|
+
* @default false
|
|
855
953
|
*/
|
|
856
|
-
|
|
954
|
+
previewUrls?: boolean;
|
|
857
955
|
/**
|
|
858
|
-
*
|
|
859
|
-
*
|
|
956
|
+
* Designates this Worker as an internal-only "first-party" Worker.
|
|
957
|
+
*
|
|
958
|
+
* @internal
|
|
860
959
|
*/
|
|
861
|
-
|
|
960
|
+
firstPartyWorker?: boolean;
|
|
862
961
|
/**
|
|
863
|
-
*
|
|
864
|
-
*
|
|
865
|
-
*
|
|
962
|
+
* "Unsafe" tables for runtime features that aren't directly supported by
|
|
963
|
+
* this configuration. Values are forwarded verbatim in the Worker's
|
|
964
|
+
* upload metadata.
|
|
965
|
+
*
|
|
966
|
+
* @default {}
|
|
866
967
|
*/
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
968
|
+
unsafe?: {
|
|
969
|
+
/**
|
|
970
|
+
* Arbitrary key/value pairs that will be included in the uploaded metadata. Values specified
|
|
971
|
+
* here will always be applied to metadata last, so can add new or override existing fields.
|
|
972
|
+
*/
|
|
973
|
+
metadata?: Record<string, unknown>;
|
|
974
|
+
/**
|
|
975
|
+
* Used for internal capnp uploads for the Workers runtime.
|
|
976
|
+
*/
|
|
977
|
+
capnp?: {
|
|
978
|
+
basePath: string;
|
|
979
|
+
sourceSchemas: string[];
|
|
980
|
+
compiledSchema?: never;
|
|
981
|
+
} | {
|
|
982
|
+
basePath?: never;
|
|
983
|
+
sourceSchemas?: never;
|
|
984
|
+
compiledSchema: string;
|
|
985
|
+
};
|
|
986
|
+
};
|
|
987
|
+
/**
|
|
988
|
+
* Bindings exposed on the Worker's `env` object. Construct entries with
|
|
989
|
+
* `bindings.kv(...)`, `bindings.r2(...)`, etc.
|
|
990
|
+
*/
|
|
991
|
+
env?: Record<string, Binding>;
|
|
992
|
+
/**
|
|
993
|
+
* Configuration for named exports declared by the Worker. Each entry's
|
|
994
|
+
* key is the exported class name; the value configures the export.
|
|
995
|
+
*
|
|
996
|
+
* Only one export kind is currently supported:
|
|
997
|
+
*
|
|
998
|
+
* - Construct entries with `exports.durableObject(...)`.
|
|
999
|
+
* - Declares Durable Object classes exported from this Worker.
|
|
1000
|
+
* For more information about Durable Objects, see the documentation at
|
|
1001
|
+
* https://developers.cloudflare.com/workers/learning/using-durable-objects.
|
|
1002
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects.
|
|
1003
|
+
*/
|
|
1004
|
+
exports?: Record<string, Export>;
|
|
1005
|
+
}
|
|
890
1006
|
/**
|
|
891
|
-
*
|
|
892
|
-
*
|
|
893
|
-
*
|
|
894
|
-
* only offered alongside `storage: "sqlite"`.
|
|
1007
|
+
* Settings shared by the other exports.
|
|
1008
|
+
* Authored as a named `settings` export via
|
|
1009
|
+
* `defineSettings`.
|
|
895
1010
|
*/
|
|
896
|
-
|
|
1011
|
+
interface SettingsConfig {
|
|
897
1012
|
/**
|
|
898
|
-
*
|
|
899
|
-
*
|
|
1013
|
+
* Discriminates this config as a settings config.
|
|
1014
|
+
*
|
|
1015
|
+
* Injected automatically by `defineSettings`; only needs to be written by
|
|
1016
|
+
* hand when authoring a raw config object without the helper.
|
|
900
1017
|
*/
|
|
901
|
-
|
|
1018
|
+
type: "settings";
|
|
902
1019
|
/**
|
|
903
|
-
*
|
|
904
|
-
*
|
|
1020
|
+
* This is the ID of the account associated with your zone.
|
|
1021
|
+
* You might have more than one account, so make sure to use
|
|
1022
|
+
* the ID of the account associated with the zone/route you
|
|
1023
|
+
* provide, if you provide one. It can also be specified through
|
|
1024
|
+
* the CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
905
1025
|
*/
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
1026
|
+
accountId?: string;
|
|
1027
|
+
/**
|
|
1028
|
+
* Specify the compliance region mode of the Worker.
|
|
1029
|
+
*
|
|
1030
|
+
* Although if the user does not specify a compliance region, the default is `public`,
|
|
1031
|
+
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
|
|
1032
|
+
*/
|
|
1033
|
+
complianceRegion?: "public" | "fedramp-high";
|
|
1034
|
+
} //#endregion
|
|
1035
|
+
//#region src/worker-definition.d.ts
|
|
1036
|
+
type WorkerConfigExport<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
|
|
910
1037
|
/**
|
|
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
|
|
1038
|
+
* Authored Worker config shape — {@link WorkerConfig} without the `type`
|
|
1039
|
+
* discriminant, which `defineWorker` injects.
|
|
917
1040
|
*/
|
|
918
|
-
type
|
|
919
|
-
|
|
920
|
-
|
|
1041
|
+
type WorkerConfigInput = Omit<WorkerConfig, "type">;
|
|
1042
|
+
declare const defineWorker: <const TInput extends ConfigInput<WorkerConfigInput>>(config: TInput) => TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => TResult extends Promise<infer TConfig extends {
|
|
1043
|
+
[x: string]: unknown;
|
|
1044
|
+
}> ? Promise<ConfigWithType<TConfig, "worker">> : TResult extends {
|
|
1045
|
+
[x: string]: unknown;
|
|
1046
|
+
} ? ConfigWithType<TResult, "worker"> : never : TInput extends Promise<infer TConfig extends {
|
|
1047
|
+
[x: string]: unknown;
|
|
1048
|
+
}> ? Promise<ConfigWithType<TConfig, "worker">> : TInput extends {
|
|
1049
|
+
[x: string]: unknown;
|
|
1050
|
+
} ? ConfigWithType<TInput, "worker"> : never; //#endregion
|
|
1051
|
+
//#region src/bindings.d.ts
|
|
1052
|
+
/** Options that control a binding during local development. */
|
|
1053
|
+
interface BindingDevOptions {
|
|
1054
|
+
/** Whether the binding should connect to the remote resource. */
|
|
1055
|
+
remote?: boolean;
|
|
1056
|
+
}
|
|
1057
|
+
interface AgentMemoryBindingOptions {
|
|
1058
|
+
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
1059
|
+
namespace: string;
|
|
1060
|
+
/** Options that only apply during local development. */
|
|
1061
|
+
dev?: BindingDevOptions;
|
|
1062
|
+
}
|
|
921
1063
|
/**
|
|
922
|
-
*
|
|
923
|
-
*
|
|
924
|
-
*
|
|
925
|
-
* During deploy, the class must not be exported in the uploaded code, and no
|
|
926
|
-
* other Worker may hold a `durableObject` binding to the namespace.
|
|
1064
|
+
* Agent Memory namespace binding. Each binding is scoped to a namespace and
|
|
1065
|
+
* allows agents to persist and recall memory.
|
|
927
1066
|
*/
|
|
928
|
-
interface
|
|
929
|
-
|
|
1067
|
+
interface AgentMemoryBinding extends AgentMemoryBindingOptions {
|
|
1068
|
+
type: "agent-memory";
|
|
1069
|
+
}
|
|
1070
|
+
interface AiBindingOptions {
|
|
1071
|
+
/** Options that only apply during local development. */
|
|
1072
|
+
dev?: BindingDevOptions;
|
|
930
1073
|
}
|
|
931
1074
|
/**
|
|
932
|
-
*
|
|
933
|
-
*
|
|
934
|
-
*
|
|
1075
|
+
* Binding to the Workers AI project.
|
|
1076
|
+
*
|
|
1077
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
935
1078
|
*/
|
|
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;
|
|
1079
|
+
interface AiBinding extends AiBindingOptions {
|
|
1080
|
+
type: "ai";
|
|
944
1081
|
}
|
|
945
1082
|
/**
|
|
946
|
-
*
|
|
947
|
-
*
|
|
1083
|
+
* Binding to the Workers AI project.
|
|
1084
|
+
*
|
|
1085
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
948
1086
|
*/
|
|
949
|
-
interface
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
1087
|
+
interface TypedAiBinding<TAiModelList extends AiModelListType = AiModels> extends AiBinding {
|
|
1088
|
+
/** @internal Carries type parameters for inference */
|
|
1089
|
+
__typeParams: [TAiModelList];
|
|
1090
|
+
}
|
|
1091
|
+
interface AiSearchBindingOptions {
|
|
1092
|
+
/** The user-chosen instance name. Must exist in Cloudflare at deploy time. */
|
|
1093
|
+
name: string;
|
|
1094
|
+
/** Options that only apply during local development. */
|
|
1095
|
+
dev?: BindingDevOptions;
|
|
955
1096
|
}
|
|
956
1097
|
/**
|
|
957
|
-
*
|
|
958
|
-
*
|
|
1098
|
+
* AI Search instance binding. Each binding is bound directly to a single
|
|
1099
|
+
* pre-existing instance within the "default" namespace.
|
|
959
1100
|
*/
|
|
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";
|
|
1101
|
+
interface AiSearchBinding extends AiSearchBindingOptions {
|
|
1102
|
+
type: "ai-search";
|
|
972
1103
|
}
|
|
973
|
-
interface
|
|
974
|
-
|
|
1104
|
+
interface AiSearchNamespaceBindingOptions {
|
|
1105
|
+
/** The user-chosen namespace name. Must exist in Cloudflare at deploy time. */
|
|
1106
|
+
namespace: string;
|
|
1107
|
+
/** Options that only apply during local development. */
|
|
1108
|
+
dev?: BindingDevOptions;
|
|
975
1109
|
}
|
|
976
|
-
|
|
977
|
-
|
|
1110
|
+
/**
|
|
1111
|
+
* AI Search namespace binding. Each binding is scoped to a namespace and
|
|
1112
|
+
* allows dynamic instance CRUD within it.
|
|
1113
|
+
*/
|
|
1114
|
+
interface AiSearchNamespaceBinding extends AiSearchNamespaceBindingOptions {
|
|
1115
|
+
type: "ai-search-namespace";
|
|
978
1116
|
}
|
|
979
|
-
|
|
980
|
-
|
|
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
|
-
};
|
|
1117
|
+
interface AnalyticsEngineDatasetBindingOptions {
|
|
1118
|
+
/** The name of this dataset to write to. */
|
|
1119
|
+
name?: string;
|
|
988
1120
|
}
|
|
989
|
-
|
|
990
|
-
|
|
1121
|
+
/**
|
|
1122
|
+
* Binding to an Analytics Engine dataset.
|
|
1123
|
+
*
|
|
1124
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
1125
|
+
*/
|
|
1126
|
+
interface AnalyticsEngineDatasetBinding extends AnalyticsEngineDatasetBindingOptions {
|
|
1127
|
+
type: "analytics-engine-dataset";
|
|
1128
|
+
}
|
|
1129
|
+
interface ArtifactsBindingOptions {
|
|
1130
|
+
/** The namespace to use. */
|
|
1131
|
+
namespace: string;
|
|
1132
|
+
/** Options that only apply during local development. */
|
|
1133
|
+
dev?: BindingDevOptions;
|
|
991
1134
|
}
|
|
992
1135
|
/**
|
|
993
|
-
*
|
|
994
|
-
*
|
|
1136
|
+
* Binding to an Artifacts instance. Artifacts provides git-compatible file
|
|
1137
|
+
* storage on Cloudflare Workers.
|
|
995
1138
|
*/
|
|
996
|
-
interface
|
|
997
|
-
|
|
998
|
-
* Declares a Durable Object class defined by this Worker.
|
|
999
|
-
*
|
|
1000
|
-
* For more information about Durable Objects, see the documentation at
|
|
1001
|
-
* https://developers.cloudflare.com/workers/learning/using-durable-objects
|
|
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;
|
|
1139
|
+
interface ArtifactsBinding extends ArtifactsBindingOptions {
|
|
1140
|
+
type: "artifacts";
|
|
1026
1141
|
}
|
|
1027
1142
|
/**
|
|
1028
|
-
*
|
|
1143
|
+
* Binding to the Worker's static assets.
|
|
1029
1144
|
*
|
|
1030
|
-
*
|
|
1031
|
-
|
|
1032
|
-
|
|
1145
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
1146
|
+
*/
|
|
1147
|
+
interface AssetsBinding {
|
|
1148
|
+
type: "assets";
|
|
1149
|
+
}
|
|
1150
|
+
interface BrowserBindingOptions {
|
|
1151
|
+
/** Options that only apply during local development. */
|
|
1152
|
+
dev?: BindingDevOptions;
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Binding to a headless browser usable from the Worker.
|
|
1033
1156
|
*
|
|
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
|
-
* ```
|
|
1157
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
1045
1158
|
*/
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1159
|
+
interface BrowserBinding extends BrowserBindingOptions {
|
|
1160
|
+
type: "browser";
|
|
1161
|
+
}
|
|
1162
|
+
interface D1BindingOptions {
|
|
1163
|
+
/** The UUID of this D1 database (not required). */
|
|
1164
|
+
id?: string;
|
|
1165
|
+
/** The name of this D1 database. */
|
|
1166
|
+
name?: string;
|
|
1167
|
+
/** Options that only apply during local development. */
|
|
1168
|
+
dev?: BindingDevOptions;
|
|
1056
1169
|
}
|
|
1057
|
-
declare const DEFINITION: unique symbol;
|
|
1058
1170
|
/**
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1171
|
+
* Binding to a D1 database.
|
|
1172
|
+
*
|
|
1173
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
|
1061
1174
|
*/
|
|
1062
|
-
|
|
1175
|
+
interface D1Binding extends D1BindingOptions {
|
|
1176
|
+
type: "d1";
|
|
1177
|
+
}
|
|
1178
|
+
interface DispatchNamespaceBindingOptions {
|
|
1179
|
+
/** The namespace to bind to. */
|
|
1180
|
+
namespace?: string;
|
|
1181
|
+
/** Details about the outbound Worker which will handle outbound requests from your namespace. */
|
|
1182
|
+
outbound?: {
|
|
1183
|
+
/** 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. */
|
|
1184
|
+
parameters?: string[];
|
|
1185
|
+
};
|
|
1186
|
+
/** Options that only apply during local development. */
|
|
1187
|
+
dev?: BindingDevOptions;
|
|
1188
|
+
}
|
|
1063
1189
|
/**
|
|
1064
|
-
*
|
|
1190
|
+
* Binding to a Workers for Platforms dispatch namespace.
|
|
1065
1191
|
*
|
|
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`.
|
|
1192
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
1070
1193
|
*/
|
|
1071
|
-
|
|
1072
|
-
|
|
1194
|
+
interface DispatchNamespaceBinding extends DispatchNamespaceBindingOptions {
|
|
1195
|
+
type: "dispatch-namespace";
|
|
1196
|
+
}
|
|
1197
|
+
type WorkerReference = string | WorkerConfigExport;
|
|
1198
|
+
type ReferencedWorkerConfig<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? never : UnwrapConfig<TWorker$1>;
|
|
1199
|
+
type DurableObjectExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferDurableNamespaces<ReferencedWorkerConfig<TWorker$1>>;
|
|
1200
|
+
type WorkerEntrypointExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferWorkerEntrypointExports<ReferencedWorkerConfig<TWorker$1>>;
|
|
1201
|
+
type WorkflowExportName<TWorker$1 extends WorkerReference> = TWorker$1 extends string ? string : InferExportsByType<ReferencedWorkerConfig<TWorker$1>, "workflow">;
|
|
1202
|
+
interface DurableObjectBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> {
|
|
1203
|
+
/** The name or config of the Worker that defines the Durable Object class. */
|
|
1204
|
+
worker: TWorker$1;
|
|
1205
|
+
/** The exported class name of the Durable Object. */
|
|
1206
|
+
exportName: TExportName$1;
|
|
1207
|
+
}
|
|
1073
1208
|
/**
|
|
1074
|
-
*
|
|
1209
|
+
* Binding to a Durable Object class. `worker` is the name or config of the
|
|
1210
|
+
* Worker that defines the class; `exportName` is the exported class name.
|
|
1211
|
+
*
|
|
1212
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
1075
1213
|
*/
|
|
1076
|
-
|
|
1214
|
+
interface DurableObjectBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1> = DurableObjectExportName<TWorker$1>> extends DurableObjectBindingOptions<TWorker$1, TExportName$1> {
|
|
1215
|
+
type: "durable-object";
|
|
1216
|
+
}
|
|
1217
|
+
interface FlagshipBindingOptions {
|
|
1218
|
+
/** The Flagship app ID to bind to. */
|
|
1219
|
+
id?: string;
|
|
1220
|
+
/** Options that only apply during local development. */
|
|
1221
|
+
dev?: BindingDevOptions;
|
|
1222
|
+
}
|
|
1223
|
+
/** Binding to a Flagship feature-flag service. */
|
|
1224
|
+
interface FlagshipBinding extends FlagshipBindingOptions {
|
|
1225
|
+
type: "flagship";
|
|
1226
|
+
}
|
|
1227
|
+
interface HyperdriveBindingOptions {
|
|
1228
|
+
/** The ID of the Hyperdrive configuration. */
|
|
1229
|
+
id: string;
|
|
1230
|
+
/** Options that only apply during local development. */
|
|
1231
|
+
dev?: {
|
|
1232
|
+
/** The database connection string used during local development. */connectionString?: string;
|
|
1233
|
+
};
|
|
1234
|
+
}
|
|
1077
1235
|
/**
|
|
1078
|
-
*
|
|
1236
|
+
* Binding to a Hyperdrive configuration.
|
|
1237
|
+
*
|
|
1238
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
1079
1239
|
*/
|
|
1080
|
-
|
|
1240
|
+
interface HyperdriveBinding extends HyperdriveBindingOptions {
|
|
1241
|
+
type: "hyperdrive";
|
|
1242
|
+
}
|
|
1243
|
+
interface ImagesBindingOptions {
|
|
1244
|
+
/** Options that only apply during local development. */
|
|
1245
|
+
dev?: BindingDevOptions;
|
|
1246
|
+
}
|
|
1081
1247
|
/**
|
|
1082
|
-
*
|
|
1083
|
-
*
|
|
1084
|
-
*
|
|
1248
|
+
* Binding to Cloudflare Images.
|
|
1249
|
+
*
|
|
1250
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
|
|
1085
1251
|
*/
|
|
1086
|
-
|
|
1252
|
+
interface ImagesBinding$1 extends ImagesBindingOptions {
|
|
1253
|
+
type: "images";
|
|
1254
|
+
}
|
|
1087
1255
|
/**
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1256
|
+
* Inline JSON value made available to the Worker on `env` under the
|
|
1257
|
+
* binding name.
|
|
1258
|
+
*/
|
|
1259
|
+
interface JsonBinding<T$1 extends Json = Json> {
|
|
1260
|
+
type: "json";
|
|
1261
|
+
/** The JSON value made available to the Worker. */
|
|
1262
|
+
value: T$1;
|
|
1263
|
+
}
|
|
1264
|
+
interface KvBindingOptions {
|
|
1265
|
+
/** The ID of the KV namespace. */
|
|
1266
|
+
id?: string;
|
|
1267
|
+
/** Options that only apply during local development. */
|
|
1268
|
+
dev?: BindingDevOptions;
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* Binding to a Workers KV namespace.
|
|
1090
1272
|
*
|
|
1091
|
-
*
|
|
1092
|
-
* being passed to downstream tooling.
|
|
1273
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
1093
1274
|
*/
|
|
1094
|
-
interface
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1275
|
+
interface KvBinding extends KvBindingOptions {
|
|
1276
|
+
type: "kv";
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Binding to a Workers KV namespace.
|
|
1280
|
+
*
|
|
1281
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
1282
|
+
*/
|
|
1283
|
+
interface TypedKvBinding<TKey extends string = string> extends KvBinding {
|
|
1284
|
+
/** @internal Carries type parameters for inference */
|
|
1285
|
+
__typeParams: [TKey];
|
|
1286
|
+
}
|
|
1287
|
+
interface LogfwdrBindingOptions {
|
|
1288
|
+
/** The destination for this logged message. */
|
|
1289
|
+
destination: string;
|
|
1290
|
+
}
|
|
1291
|
+
/** Binding for forwarding logs to logfwdr. */
|
|
1292
|
+
interface LogfwdrBinding extends LogfwdrBindingOptions {
|
|
1293
|
+
type: "logfwdr";
|
|
1294
|
+
}
|
|
1295
|
+
interface MediaBindingOptions {
|
|
1296
|
+
/** Options that only apply during local development. */
|
|
1297
|
+
dev?: BindingDevOptions;
|
|
1298
|
+
}
|
|
1299
|
+
/** Binding to Cloudflare Media Transformations. */
|
|
1300
|
+
interface MediaBinding$1 extends MediaBindingOptions {
|
|
1301
|
+
type: "media";
|
|
1302
|
+
}
|
|
1303
|
+
interface MtlsCertificateBindingOptions {
|
|
1304
|
+
/** The UUID of the uploaded mTLS certificate. */
|
|
1305
|
+
id: string;
|
|
1306
|
+
/** Options that only apply during local development. */
|
|
1307
|
+
dev?: BindingDevOptions;
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* Binding to an uploaded mTLS certificate.
|
|
1311
|
+
*
|
|
1312
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
|
1313
|
+
*/
|
|
1314
|
+
interface MtlsCertificateBinding extends MtlsCertificateBindingOptions {
|
|
1315
|
+
type: "mtls-certificate";
|
|
1316
|
+
}
|
|
1317
|
+
interface PipelineBindingOptions {
|
|
1318
|
+
/** Name of the Pipeline to bind. */
|
|
1105
1319
|
name: string;
|
|
1320
|
+
/** Options that only apply during local development. */
|
|
1321
|
+
dev?: BindingDevOptions;
|
|
1322
|
+
}
|
|
1323
|
+
/** Binding to a Cloudflare Pipeline. */
|
|
1324
|
+
interface PipelineBinding extends PipelineBindingOptions {
|
|
1325
|
+
type: "pipeline";
|
|
1326
|
+
}
|
|
1327
|
+
/** Binding to a Cloudflare Pipeline. */
|
|
1328
|
+
interface TypedPipelineBinding<TRecord extends PipelineRecord = PipelineRecord> extends PipelineBinding {
|
|
1329
|
+
/** @internal Carries type parameters for inference */
|
|
1330
|
+
__typeParams: [TRecord];
|
|
1331
|
+
}
|
|
1332
|
+
interface QueueBindingOptions {
|
|
1333
|
+
/** The name of this Queue. */
|
|
1334
|
+
name?: string;
|
|
1335
|
+
/** The number of seconds to wait before delivering a message. */
|
|
1336
|
+
deliveryDelay?: number;
|
|
1337
|
+
/** Options that only apply during local development. */
|
|
1338
|
+
dev?: BindingDevOptions;
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* Producer binding to a Cloudflare Queue.
|
|
1342
|
+
*
|
|
1343
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
1344
|
+
*/
|
|
1345
|
+
interface QueueBinding extends QueueBindingOptions {
|
|
1346
|
+
type: "queue";
|
|
1347
|
+
}
|
|
1348
|
+
/**
|
|
1349
|
+
* Producer binding to a Cloudflare Queue.
|
|
1350
|
+
*
|
|
1351
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
1352
|
+
*/
|
|
1353
|
+
interface TypedQueueBinding<TBody = unknown> extends QueueBinding {
|
|
1354
|
+
/** @internal Carries type parameters for inference */
|
|
1355
|
+
__typeParams: [TBody];
|
|
1356
|
+
}
|
|
1357
|
+
interface R2BindingOptions {
|
|
1358
|
+
/** The name of this R2 bucket at the edge. */
|
|
1359
|
+
name?: string;
|
|
1360
|
+
/** The jurisdiction that the bucket exists in. Default if not present. */
|
|
1361
|
+
jurisdiction?: string;
|
|
1362
|
+
/** Settings that only apply to local development. */
|
|
1363
|
+
dev?: BindingDevOptions & {
|
|
1364
|
+
/** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */experimentalS3Credentials?: {
|
|
1365
|
+
accessKeyId: string;
|
|
1366
|
+
secretAccessKey: string;
|
|
1367
|
+
};
|
|
1368
|
+
};
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* Binding to an R2 bucket.
|
|
1372
|
+
*
|
|
1373
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
1374
|
+
*/
|
|
1375
|
+
interface R2Binding extends R2BindingOptions {
|
|
1376
|
+
type: "r2";
|
|
1377
|
+
}
|
|
1378
|
+
interface RateLimitBindingOptions {
|
|
1379
|
+
/** The namespace ID for this rate limiter. */
|
|
1380
|
+
namespace: string;
|
|
1381
|
+
/** Simple rate limiting configuration. */
|
|
1382
|
+
simple: {
|
|
1383
|
+
/** 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). */
|
|
1384
|
+
period: 10 | 60;
|
|
1385
|
+
};
|
|
1386
|
+
}
|
|
1387
|
+
/** Binding to a rate limiter. */
|
|
1388
|
+
interface RateLimitBinding extends RateLimitBindingOptions {
|
|
1389
|
+
type: "rate-limit";
|
|
1390
|
+
}
|
|
1391
|
+
/**
|
|
1392
|
+
* Declares a secret that is required by your Worker, exposed on `env` under
|
|
1393
|
+
* the binding name.
|
|
1394
|
+
*
|
|
1395
|
+
* When defined, this binding:
|
|
1396
|
+
* - Replaces .dev.vars/.env/process.env inference for type generation
|
|
1397
|
+
* - Enables local dev validation with warnings for missing secrets
|
|
1398
|
+
*
|
|
1399
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
|
|
1400
|
+
*/
|
|
1401
|
+
interface SecretBinding {
|
|
1402
|
+
type: "secret";
|
|
1403
|
+
}
|
|
1404
|
+
interface SecretsStoreSecretBindingOptions {
|
|
1405
|
+
/** ID of the secret store. */
|
|
1406
|
+
storeId: string;
|
|
1407
|
+
/** Name of the secret. */
|
|
1408
|
+
secretName: string;
|
|
1409
|
+
}
|
|
1410
|
+
/** Binding to a Secrets Store secret. */
|
|
1411
|
+
interface SecretsStoreSecretBinding extends SecretsStoreSecretBindingOptions {
|
|
1412
|
+
type: "secrets-store-secret";
|
|
1413
|
+
}
|
|
1414
|
+
type SendEmailDestinationOptions = {
|
|
1415
|
+
/** If this binding should be restricted to a specific verified address. */destinationAddress: string;
|
|
1416
|
+
allowedDestinationAddresses?: never;
|
|
1417
|
+
} | {
|
|
1418
|
+
destinationAddress?: never; /** If this binding should be restricted to a set of verified addresses. */
|
|
1419
|
+
allowedDestinationAddresses: string[];
|
|
1420
|
+
} | {
|
|
1421
|
+
destinationAddress?: never;
|
|
1422
|
+
allowedDestinationAddresses?: never;
|
|
1423
|
+
};
|
|
1424
|
+
type SendEmailBindingOptions = SendEmailDestinationOptions & {
|
|
1425
|
+
/** If this binding should be restricted to a set of sender addresses. */allowedSenderAddresses?: string[]; /** Options that only apply during local development. */
|
|
1426
|
+
dev?: BindingDevOptions;
|
|
1427
|
+
};
|
|
1428
|
+
/**
|
|
1429
|
+
* Binding for sending email from inside the Worker.
|
|
1430
|
+
*
|
|
1431
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
1432
|
+
*/
|
|
1433
|
+
type SendEmailBinding = SendEmailBindingOptions & {
|
|
1434
|
+
type: "send-email";
|
|
1435
|
+
};
|
|
1436
|
+
interface StreamBindingOptions {
|
|
1437
|
+
/** Options that only apply during local development. */
|
|
1438
|
+
dev?: BindingDevOptions;
|
|
1439
|
+
}
|
|
1440
|
+
/** Binding to Cloudflare Stream. */
|
|
1441
|
+
interface StreamBinding$1 extends StreamBindingOptions {
|
|
1442
|
+
type: "stream";
|
|
1443
|
+
}
|
|
1444
|
+
/**
|
|
1445
|
+
* Inline string value made available to the Worker on `env` under the
|
|
1446
|
+
* binding name.
|
|
1447
|
+
*
|
|
1448
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
1449
|
+
*/
|
|
1450
|
+
interface TextBinding<T$1 extends string = string> {
|
|
1451
|
+
type: "text";
|
|
1452
|
+
/** The string value made available to the Worker. */
|
|
1453
|
+
value: T$1;
|
|
1454
|
+
}
|
|
1455
|
+
interface UnsafeBindingOptions {
|
|
1456
|
+
/** Local-dev plugin configuration for this unsafe binding. */
|
|
1457
|
+
dev?: {
|
|
1458
|
+
/** The plugin package that provides the binding's local-dev implementation. */plugin: {
|
|
1459
|
+
package: string;
|
|
1460
|
+
name: string;
|
|
1461
|
+
}; /** Plugin-specific options. */
|
|
1462
|
+
options?: Record<string, unknown>;
|
|
1463
|
+
};
|
|
1464
|
+
[key: string]: unknown;
|
|
1465
|
+
}
|
|
1466
|
+
/**
|
|
1467
|
+
* Escape-hatch binding for runtime features that aren't directly supported
|
|
1468
|
+
* by this configuration. Included in the Worker's upload metadata without
|
|
1469
|
+
* changes.
|
|
1470
|
+
*/
|
|
1471
|
+
interface UnsafeBinding extends UnsafeBindingOptions {
|
|
1472
|
+
type: `unsafe:${string}`;
|
|
1473
|
+
}
|
|
1474
|
+
interface VectorizeBindingOptions {
|
|
1475
|
+
/** The name of the Vectorize index. */
|
|
1476
|
+
name: string;
|
|
1477
|
+
/** Options that only apply during local development. */
|
|
1478
|
+
dev?: BindingDevOptions;
|
|
1479
|
+
}
|
|
1480
|
+
/**
|
|
1481
|
+
* Binding to a Vectorize index.
|
|
1482
|
+
*
|
|
1483
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
1484
|
+
*/
|
|
1485
|
+
interface VectorizeBinding extends VectorizeBindingOptions {
|
|
1486
|
+
type: "vectorize";
|
|
1487
|
+
}
|
|
1488
|
+
/** Binding to the Worker version's metadata. */
|
|
1489
|
+
interface VersionMetadataBinding {
|
|
1490
|
+
type: "version-metadata";
|
|
1491
|
+
}
|
|
1492
|
+
type VpcNetworkBindingOptions = {
|
|
1493
|
+
/** The tunnel ID of the Cloudflare Tunnel to route traffic through. Mutually exclusive with `networkId`. */tunnelId: string;
|
|
1494
|
+
networkId?: never; /** Options that only apply during local development. */
|
|
1495
|
+
dev?: BindingDevOptions;
|
|
1496
|
+
} | {
|
|
1497
|
+
tunnelId?: never; /** The network ID to route traffic through. Mutually exclusive with `tunnelId`. */
|
|
1498
|
+
networkId: string; /** Options that only apply during local development. */
|
|
1499
|
+
dev?: BindingDevOptions;
|
|
1500
|
+
};
|
|
1501
|
+
/** Binding to a VPC network. */
|
|
1502
|
+
type VpcNetworkBinding = VpcNetworkBindingOptions & {
|
|
1503
|
+
type: "vpc-network";
|
|
1504
|
+
};
|
|
1505
|
+
interface VpcServiceBindingOptions {
|
|
1506
|
+
/** The service ID of the VPC connectivity service. */
|
|
1507
|
+
id: string;
|
|
1508
|
+
/** Options that only apply during local development. */
|
|
1509
|
+
dev?: BindingDevOptions;
|
|
1510
|
+
}
|
|
1511
|
+
/** Binding to a VPC service. */
|
|
1512
|
+
interface VpcServiceBinding extends VpcServiceBindingOptions {
|
|
1513
|
+
type: "vpc-service";
|
|
1514
|
+
}
|
|
1515
|
+
interface WebSearchBindingOptions {
|
|
1516
|
+
/** Options that only apply during local development. */
|
|
1517
|
+
dev?: BindingDevOptions;
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Cloudflare Web Search binding. There is exactly one shared web corpus, so
|
|
1521
|
+
* the binding is zero-config — only the variable name is required.
|
|
1522
|
+
*/
|
|
1523
|
+
interface WebSearchBinding extends WebSearchBindingOptions {
|
|
1524
|
+
type: "web-search";
|
|
1525
|
+
}
|
|
1526
|
+
interface WorkerBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> {
|
|
1527
|
+
/** The name or config of the bound Worker. */
|
|
1528
|
+
worker: TWorker$1;
|
|
1529
|
+
/** The named export to bind to (defaults to the default export). */
|
|
1530
|
+
exportName?: TExportName$1;
|
|
1531
|
+
/** Optional properties that will be made available to the service via `ctx.props`. */
|
|
1532
|
+
props?: Record<string, unknown>;
|
|
1533
|
+
/** Options that only apply during local development. */
|
|
1534
|
+
dev?: BindingDevOptions;
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* Service binding (Worker-to-Worker). `worker` is the name or config of the
|
|
1538
|
+
* bound Worker; `exportName` selects a named `WorkerEntrypoint` export
|
|
1539
|
+
* (defaults to the default export).
|
|
1540
|
+
*
|
|
1541
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
1542
|
+
*/
|
|
1543
|
+
interface WorkerBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = WorkerEntrypointExportName<TWorker$1> | undefined> extends WorkerBindingOptions<TWorker$1, TExportName$1> {
|
|
1544
|
+
type: "worker";
|
|
1545
|
+
}
|
|
1546
|
+
/** Binding to a Worker Loader. */
|
|
1547
|
+
interface WorkerLoaderBinding {
|
|
1548
|
+
type: "worker-loader";
|
|
1549
|
+
}
|
|
1550
|
+
interface WorkflowBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> {
|
|
1551
|
+
/** The name or config of the Worker that defines the Workflow. */
|
|
1552
|
+
worker: TWorker$1;
|
|
1553
|
+
/** The exported class name of the Workflow. */
|
|
1554
|
+
exportName: TExportName$1;
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* Binding to a Workflow. `worker` is the name or config of the Worker that
|
|
1558
|
+
* defines the Workflow; `exportName` is the exported `WorkflowEntrypoint`
|
|
1559
|
+
* class name.
|
|
1560
|
+
*/
|
|
1561
|
+
interface WorkflowBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> extends WorkflowBindingOptions<TWorker$1, TExportName$1> {
|
|
1562
|
+
type: "workflow";
|
|
1563
|
+
}
|
|
1564
|
+
interface Bindings {
|
|
1106
1565
|
/**
|
|
1107
|
-
*
|
|
1108
|
-
*
|
|
1109
|
-
*
|
|
1110
|
-
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-dates
|
|
1566
|
+
* Agent Memory namespace binding. Each binding is scoped to a namespace and
|
|
1567
|
+
* allows agents to persist and recall memory.
|
|
1111
1568
|
*/
|
|
1112
|
-
|
|
1569
|
+
agentMemory(options: AgentMemoryBindingOptions): AgentMemoryBinding;
|
|
1113
1570
|
/**
|
|
1114
|
-
*
|
|
1115
|
-
* the Workers runtime, usually used together with `compatibilityDate`.
|
|
1116
|
-
*
|
|
1117
|
-
* More details at https://developers.cloudflare.com/workers/configuration/compatibility-flags/
|
|
1571
|
+
* Binding to the Workers AI project.
|
|
1118
1572
|
*
|
|
1119
|
-
*
|
|
1573
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workers-ai
|
|
1120
1574
|
*/
|
|
1121
|
-
|
|
1575
|
+
ai<TAiModelList extends AiModelListType = AiModels>(options?: AiBindingOptions): TypedAiBinding<TAiModelList>;
|
|
1122
1576
|
/**
|
|
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
|
-
* ```
|
|
1577
|
+
* AI Search instance binding. Each binding is bound directly to a single
|
|
1578
|
+
* pre-existing instance within the "default" namespace.
|
|
1133
1579
|
*/
|
|
1134
|
-
|
|
1580
|
+
aiSearch(options: AiSearchBindingOptions): AiSearchBinding;
|
|
1135
1581
|
/**
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1138
|
-
* More details at https://developers.cloudflare.com/workers/frameworks/
|
|
1139
|
-
*
|
|
1140
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
1582
|
+
* AI Search namespace binding. Each binding is scoped to a namespace and
|
|
1583
|
+
* allows dynamic instance CRUD within it.
|
|
1141
1584
|
*/
|
|
1142
|
-
|
|
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
|
-
};
|
|
1585
|
+
aiSearchNamespace(options: AiSearchNamespaceBindingOptions): AiSearchNamespaceBinding;
|
|
1152
1586
|
/**
|
|
1153
|
-
*
|
|
1587
|
+
* Binding to an Analytics Engine dataset.
|
|
1154
1588
|
*
|
|
1155
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
1589
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#analytics-engine-datasets
|
|
1156
1590
|
*/
|
|
1157
|
-
|
|
1591
|
+
analyticsEngineDataset(options?: AnalyticsEngineDatasetBindingOptions): AnalyticsEngineDatasetBinding;
|
|
1158
1592
|
/**
|
|
1159
|
-
*
|
|
1160
|
-
*
|
|
1161
|
-
* Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
|
|
1162
|
-
* `triggers.scheduled(...)`, `triggers.email(...)`, or
|
|
1163
|
-
* `triggers.connect(...)`.
|
|
1164
|
-
*
|
|
1165
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
|
|
1593
|
+
* Binding to an Artifacts instance. Artifacts provides git-compatible file
|
|
1594
|
+
* storage on Cloudflare Workers.
|
|
1166
1595
|
*/
|
|
1167
|
-
|
|
1596
|
+
artifacts(options: ArtifactsBindingOptions): ArtifactsBinding;
|
|
1168
1597
|
/**
|
|
1169
|
-
*
|
|
1170
|
-
*
|
|
1171
|
-
* `@cloudflare/config` unifies regular and streaming tail consumers under
|
|
1172
|
-
* a single field; pass `streaming: true` to forward streaming tail events.
|
|
1598
|
+
* Binding to the Worker's static assets.
|
|
1173
1599
|
*
|
|
1174
|
-
*
|
|
1600
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#assets
|
|
1175
1601
|
*/
|
|
1176
|
-
|
|
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
|
-
}>;
|
|
1602
|
+
assets(): AssetsBinding;
|
|
1180
1603
|
/**
|
|
1181
|
-
*
|
|
1604
|
+
* Binding to a headless browser usable from the Worker.
|
|
1605
|
+
*
|
|
1606
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#browser-rendering
|
|
1182
1607
|
*/
|
|
1183
|
-
|
|
1184
|
-
/** If cache is enabled for this Worker. */enabled: boolean; /** Whether cached assets may be reused across Worker versions. */
|
|
1185
|
-
crossVersionCache?: boolean;
|
|
1186
|
-
};
|
|
1608
|
+
browser(options?: BrowserBindingOptions): BrowserBinding;
|
|
1187
1609
|
/**
|
|
1188
|
-
*
|
|
1610
|
+
* Binding to a D1 database.
|
|
1189
1611
|
*
|
|
1190
|
-
*
|
|
1612
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#d1-databases
|
|
1191
1613
|
*/
|
|
1192
|
-
|
|
1193
|
-
mode: "off" | "smart";
|
|
1194
|
-
hint?: string;
|
|
1195
|
-
} | {
|
|
1196
|
-
mode?: "targeted";
|
|
1197
|
-
region: string;
|
|
1198
|
-
} | {
|
|
1199
|
-
mode?: "targeted";
|
|
1200
|
-
host: string;
|
|
1201
|
-
} | {
|
|
1202
|
-
mode?: "targeted";
|
|
1203
|
-
hostname: string;
|
|
1204
|
-
};
|
|
1614
|
+
d1(options?: D1BindingOptions): D1Binding;
|
|
1205
1615
|
/**
|
|
1206
|
-
*
|
|
1207
|
-
* Only supported for the "standard" Usage Model.
|
|
1616
|
+
* Binding to a Workers for Platforms dispatch namespace.
|
|
1208
1617
|
*
|
|
1209
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
1618
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#dispatch-namespace-bindings-workers-for-platforms
|
|
1210
1619
|
*/
|
|
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
|
-
};
|
|
1620
|
+
dispatchNamespace(options?: DispatchNamespaceBindingOptions): DispatchNamespaceBinding;
|
|
1215
1621
|
/**
|
|
1216
|
-
*
|
|
1217
|
-
*
|
|
1218
|
-
* This will not configure a corresponding Logpush job automatically.
|
|
1622
|
+
* Binding to a Durable Object class. `worker` is the name or config of the
|
|
1623
|
+
* Worker that defines the class; `exportName` is the exported class name.
|
|
1219
1624
|
*
|
|
1220
|
-
* For
|
|
1221
|
-
* https://blog.cloudflare.com/logpush-for-workers/
|
|
1625
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
|
|
1222
1626
|
*/
|
|
1223
|
-
|
|
1627
|
+
durableObject<TWorker$1 extends WorkerReference, TExportName$1 extends DurableObjectExportName<TWorker$1>>(options: DurableObjectBindingOptions<TWorker$1, TExportName$1>): DurableObjectBinding<TWorker$1, TExportName$1>;
|
|
1628
|
+
/** Binding to a Flagship feature-flag service. */
|
|
1629
|
+
flagship(options?: FlagshipBindingOptions): FlagshipBinding;
|
|
1224
1630
|
/**
|
|
1225
|
-
*
|
|
1631
|
+
* Binding to a Hyperdrive configuration.
|
|
1226
1632
|
*
|
|
1227
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
1633
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#hyperdrive
|
|
1228
1634
|
*/
|
|
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
|
-
};
|
|
1635
|
+
hyperdrive(options: HyperdriveBindingOptions): HyperdriveBinding;
|
|
1272
1636
|
/**
|
|
1273
|
-
*
|
|
1274
|
-
* test and deploy your Worker.
|
|
1275
|
-
*
|
|
1276
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#workersdev
|
|
1637
|
+
* Binding to Cloudflare Images.
|
|
1277
1638
|
*
|
|
1278
|
-
*
|
|
1639
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#images
|
|
1279
1640
|
*/
|
|
1280
|
-
|
|
1641
|
+
images(options?: ImagesBindingOptions): ImagesBinding$1;
|
|
1281
1642
|
/**
|
|
1282
|
-
*
|
|
1283
|
-
*
|
|
1284
|
-
*
|
|
1285
|
-
* @default false
|
|
1643
|
+
* Inline JSON value made available to the Worker on `env` under the
|
|
1644
|
+
* binding name.
|
|
1286
1645
|
*/
|
|
1287
|
-
|
|
1646
|
+
json<T$1 extends Json>(value: T$1): JsonBinding<T$1>;
|
|
1288
1647
|
/**
|
|
1289
|
-
*
|
|
1648
|
+
* Binding to a Workers KV namespace.
|
|
1290
1649
|
*
|
|
1291
|
-
*
|
|
1650
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#kv-namespaces
|
|
1292
1651
|
*/
|
|
1293
|
-
|
|
1652
|
+
kv<TKey extends string = string>(options?: KvBindingOptions): TypedKvBinding<TKey>;
|
|
1653
|
+
/** Binding for forwarding logs to logfwdr. */
|
|
1654
|
+
logfwdr(options: LogfwdrBindingOptions): LogfwdrBinding;
|
|
1655
|
+
/** Binding to Cloudflare Media Transformations. */
|
|
1656
|
+
media(options?: MediaBindingOptions): MediaBinding$1;
|
|
1294
1657
|
/**
|
|
1295
|
-
*
|
|
1296
|
-
* this configuration. Values are forwarded verbatim in the Worker's
|
|
1297
|
-
* upload metadata.
|
|
1658
|
+
* Binding to an uploaded mTLS certificate.
|
|
1298
1659
|
*
|
|
1299
|
-
*
|
|
1660
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#mtls-certificates
|
|
1300
1661
|
*/
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
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
|
-
};
|
|
1662
|
+
mtlsCertificate(options: MtlsCertificateBindingOptions): MtlsCertificateBinding;
|
|
1663
|
+
/** Binding to a Cloudflare Pipeline. */
|
|
1664
|
+
pipeline<TRecord extends PipelineRecord = PipelineRecord>(options: PipelineBindingOptions): TypedPipelineBinding<TRecord>;
|
|
1320
1665
|
/**
|
|
1321
|
-
*
|
|
1322
|
-
*
|
|
1666
|
+
* Producer binding to a Cloudflare Queue.
|
|
1667
|
+
*
|
|
1668
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#queues
|
|
1323
1669
|
*/
|
|
1324
|
-
|
|
1670
|
+
queue<TBody = unknown>(options?: QueueBindingOptions): TypedQueueBinding<TBody>;
|
|
1325
1671
|
/**
|
|
1326
|
-
*
|
|
1327
|
-
* key is the exported class name; the value configures the export.
|
|
1328
|
-
*
|
|
1329
|
-
* Only one export kind is currently supported:
|
|
1672
|
+
* Binding to an R2 bucket.
|
|
1330
1673
|
*
|
|
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.
|
|
1674
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#r2-buckets
|
|
1336
1675
|
*/
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
* Settings shared by the other exports.
|
|
1341
|
-
* Authored as a named `settings` export via
|
|
1342
|
-
* `defineSettings`.
|
|
1343
|
-
*/
|
|
1344
|
-
interface SettingsConfig {
|
|
1676
|
+
r2(options?: R2BindingOptions): R2Binding;
|
|
1677
|
+
/** Binding to a rate limiter. */
|
|
1678
|
+
rateLimit(options: RateLimitBindingOptions): RateLimitBinding;
|
|
1345
1679
|
/**
|
|
1346
|
-
*
|
|
1680
|
+
* Declares a secret that is required by your Worker, exposed on `env` under
|
|
1681
|
+
* the binding name.
|
|
1682
|
+
*
|
|
1683
|
+
* When defined, this binding:
|
|
1684
|
+
* - Replaces .dev.vars/.env/process.env inference for type generation
|
|
1685
|
+
* - Enables local dev validation with warnings for missing secrets
|
|
1347
1686
|
*
|
|
1348
|
-
*
|
|
1349
|
-
* hand when authoring a raw config object without the helper.
|
|
1687
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#secrets-configuration-property
|
|
1350
1688
|
*/
|
|
1351
|
-
|
|
1689
|
+
secret(): SecretBinding;
|
|
1690
|
+
/** Binding to a Secrets Store secret. */
|
|
1691
|
+
secretsStoreSecret(options: SecretsStoreSecretBindingOptions): SecretsStoreSecretBinding;
|
|
1352
1692
|
/**
|
|
1353
|
-
*
|
|
1354
|
-
*
|
|
1355
|
-
*
|
|
1356
|
-
* provide, if you provide one. It can also be specified through
|
|
1357
|
-
* the CLOUDFLARE_ACCOUNT_ID environment variable.
|
|
1693
|
+
* Binding for sending email from inside the Worker.
|
|
1694
|
+
*
|
|
1695
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#email-bindings
|
|
1358
1696
|
*/
|
|
1359
|
-
|
|
1697
|
+
sendEmail(options?: SendEmailBindingOptions): SendEmailBinding;
|
|
1698
|
+
/** Binding to Cloudflare Stream. */
|
|
1699
|
+
stream(options?: StreamBindingOptions): StreamBinding$1;
|
|
1360
1700
|
/**
|
|
1361
|
-
*
|
|
1701
|
+
* Inline string value made available to the Worker on `env` under the
|
|
1702
|
+
* binding name.
|
|
1362
1703
|
*
|
|
1363
|
-
*
|
|
1364
|
-
* it can be set to `undefined` in configuration to delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable.
|
|
1704
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#environment-variables
|
|
1365
1705
|
*/
|
|
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> {
|
|
1706
|
+
text<T$1 extends string>(value: T$1): TextBinding<T$1>;
|
|
1383
1707
|
/**
|
|
1384
|
-
* Binding to a
|
|
1385
|
-
* that defines the class; `exportName` is the exported class name.
|
|
1708
|
+
* Binding to a Vectorize index.
|
|
1386
1709
|
*
|
|
1387
|
-
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#
|
|
1710
|
+
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#vectorize-indexes
|
|
1711
|
+
*/
|
|
1712
|
+
vectorize(options: VectorizeBindingOptions): VectorizeBinding;
|
|
1713
|
+
/** Binding to the Worker version's metadata. */
|
|
1714
|
+
versionMetadata(): VersionMetadataBinding;
|
|
1715
|
+
/** Binding to a VPC network. */
|
|
1716
|
+
vpcNetwork(options: VpcNetworkBindingOptions): VpcNetworkBinding;
|
|
1717
|
+
/** Binding to a VPC service. */
|
|
1718
|
+
vpcService(options: VpcServiceBindingOptions): VpcServiceBinding;
|
|
1719
|
+
/**
|
|
1720
|
+
* Cloudflare Web Search binding. There is exactly one shared web corpus, so
|
|
1721
|
+
* the binding is zero-config — only the variable name is required.
|
|
1388
1722
|
*/
|
|
1389
|
-
|
|
1390
|
-
worker: TWorkerName;
|
|
1391
|
-
exportName: TExportName$1;
|
|
1392
|
-
}): TypedDurableObjectBinding<TConfig$1, TExportName$1>;
|
|
1723
|
+
webSearch(options?: WebSearchBindingOptions): WebSearchBinding;
|
|
1393
1724
|
/**
|
|
1394
|
-
* Service binding (Worker-to-Worker). `worker` is the name of the
|
|
1395
|
-
* Worker; `exportName` selects a named `WorkerEntrypoint` export
|
|
1396
|
-
* the default export).
|
|
1725
|
+
* Service binding (Worker-to-Worker). `worker` is the name or config of the
|
|
1726
|
+
* bound Worker; `exportName` selects a named `WorkerEntrypoint` export
|
|
1727
|
+
* (defaults to the default export).
|
|
1397
1728
|
*
|
|
1398
1729
|
* For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#service-bindings
|
|
1399
1730
|
*/
|
|
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;
|
|
1731
|
+
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>>;
|
|
1732
|
+
/** Binding to a Worker Loader. */
|
|
1733
|
+
workerLoader(): WorkerLoaderBinding;
|
|
1504
1734
|
}
|
|
1505
|
-
|
|
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
|
|
1735
|
+
declare const bindings: Bindings; //#endregion
|
|
1624
1736
|
//#region src/settings-definition.d.ts
|
|
1737
|
+
type SettingsConfigExport<T$1 extends SettingsConfig = SettingsConfig> = ConfigInput<T$1>;
|
|
1625
1738
|
/**
|
|
1626
1739
|
* Authored settings config shape — {@link SettingsConfig} without the `type`
|
|
1627
1740
|
* discriminant, which `defineSettings` injects.
|
|
1628
1741
|
*/
|
|
1629
1742
|
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
|
-
};
|
|
1638
|
-
}
|
|
1639
1743
|
/**
|
|
1640
1744
|
* Declare shared settings.
|
|
1641
1745
|
* Authored as a named `settings` export.
|
|
1642
1746
|
*/
|
|
1643
|
-
declare
|
|
1747
|
+
declare const defineSettings: <const TInput extends ConfigInput<SettingsConfigInput>>(config: TInput) => TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => TResult extends Promise<infer TConfig extends {
|
|
1748
|
+
[x: string]: unknown;
|
|
1749
|
+
}> ? Promise<ConfigWithType<TConfig, "settings">> : TResult extends {
|
|
1750
|
+
[x: string]: unknown;
|
|
1751
|
+
} ? ConfigWithType<TResult, "settings"> : never : TInput extends Promise<infer TConfig extends {
|
|
1752
|
+
[x: string]: unknown;
|
|
1753
|
+
}> ? Promise<ConfigWithType<TConfig, "settings">> : TInput extends {
|
|
1754
|
+
[x: string]: unknown;
|
|
1755
|
+
} ? ConfigWithType<TInput, "settings"> : never; //#endregion
|
|
1644
1756
|
//#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, SettingsConfig,
|
|
1757
|
+
export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, BindingDevOptions, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, ContainerConfig, ContainerConfigExport, ContainerConfigInput, 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, SettingsConfig, SettingsConfigExport, SettingsConfigInput, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkerReference, WorkflowBinding, bindings, defineContainer, defineSettings, defineWorker, exports, triggers };
|