@farm.js/core 0.1.16 → 0.1.18
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/dist/after.cjs +12 -225
- package/dist/agent-runtime.cjs +83 -2800
- package/dist/agent-runtime.d.mts +3 -3
- package/dist/agent-runtime.d.ts +3 -3
- package/dist/api/client.cjs +17 -4026
- package/dist/api/client.d.mts +3 -3
- package/dist/api/client.d.ts +3 -3
- package/dist/api/client.mjs +3 -3
- package/dist/api/route-manager.cjs +34 -4317
- package/dist/api/route-manager.d.mts +3 -3
- package/dist/api/route-manager.d.ts +3 -3
- package/dist/api/route-manager.mjs +5 -5
- package/dist/api/runtime.cjs +29 -2660
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +6 -3
- package/dist/{api-client-B-n3pm_Q.d.mts → api-client-Cx54IR5g.d.mts} +2 -2
- package/dist/{api-client-C0_NZEBl.d.ts → api-client-DykpaKcY.d.ts} +2 -2
- package/dist/api.cjs +88 -8361
- package/dist/api.d.mts +5 -5
- package/dist/api.d.ts +5 -5
- package/dist/api.mjs +8 -8
- package/dist/{app-AyjEsCBq.d.ts → app-BHY_10Lm.d.ts} +3 -3
- package/dist/{app-CYPHeOo_.d.mts → app-BMk0do23.d.mts} +3 -3
- package/dist/app-markdown.cjs +39 -280
- package/dist/app-markdown.d.mts +4 -4
- package/dist/app-markdown.d.ts +4 -4
- package/dist/app-markdown.mjs +3 -3
- package/dist/cache.cjs +38 -1526
- package/dist/cache.d.mts +11 -1
- package/dist/cache.d.ts +11 -1
- package/dist/cache.mjs +1 -1
- package/dist/chunk-22GUSVNJ.cjs +351 -0
- package/dist/chunk-2CQ74SP6.cjs +13 -0
- package/dist/chunk-2SJ4RQ6P.cjs +57 -0
- package/dist/chunk-3376ZTRC.cjs +1 -0
- package/dist/{chunk-IL5RWYK7.mjs → chunk-3XG26Z3J.mjs} +1 -1
- package/dist/{chunk-7HDZYYS4.mjs → chunk-4OOBRCJX.mjs} +27 -5
- package/dist/chunk-4PNUXIVU.cjs +472 -0
- package/dist/chunk-4PPEPOZZ.cjs +21 -0
- package/dist/chunk-4ZFL5GFN.cjs +520 -0
- package/dist/{chunk-B76DT5Y6.mjs → chunk-57J3Y7Y3.mjs} +1 -1
- package/dist/chunk-5OVTOKGH.cjs +65 -0
- package/dist/chunk-5QIKR7RR.cjs +224 -0
- package/dist/{chunk-MOQNHLTS.mjs → chunk-5QOEPUYE.mjs} +5 -2
- package/dist/{chunk-HKLRP3BN.mjs → chunk-5SPPCN5J.mjs} +1 -1
- package/dist/chunk-5ZSWG4UX.cjs +127 -0
- package/dist/chunk-62YJ2IEB.cjs +238 -0
- package/dist/chunk-6EODJYCX.cjs +183 -0
- package/dist/chunk-6EXBPJ24.cjs +434 -0
- package/dist/chunk-6QQDAAAZ.cjs +38 -0
- package/dist/chunk-6V4TDWEC.cjs +455 -0
- package/dist/{chunk-LUC2FAGW.mjs → chunk-6VQIKZZO.mjs} +1 -1
- package/dist/chunk-72ADZ6GQ.cjs +19 -0
- package/dist/chunk-75BRBIFP.cjs +172 -0
- package/dist/{chunk-7ZWL7XOU.mjs → chunk-76DG3LF3.mjs} +1 -1
- package/dist/chunk-7W3CPVXS.cjs +24 -0
- package/dist/chunk-A6WIQH5Z.cjs +31 -0
- package/dist/{chunk-EWDK36MM.mjs → chunk-A72YEUZ3.mjs} +1 -1
- package/dist/chunk-AFOD3LYZ.cjs +377 -0
- package/dist/chunk-AMDMVWMI.cjs +39 -0
- package/dist/chunk-AORPIPNB.cjs +552 -0
- package/dist/chunk-ARJWXNQL.cjs +256 -0
- package/dist/{chunk-ZHOIQC6U.mjs → chunk-ATERBVHQ.mjs} +2 -2
- package/dist/chunk-AWRISO2H.cjs +2199 -0
- package/dist/chunk-AYJR42WX.cjs +711 -0
- package/dist/chunk-B4CH33IG.cjs +644 -0
- package/dist/chunk-BIDYX3SL.cjs +91 -0
- package/dist/chunk-BSTRERPP.cjs +40 -0
- package/dist/chunk-BYODCJD6.cjs +663 -0
- package/dist/chunk-C3VRMB6H.cjs +85 -0
- package/dist/chunk-C5GUTBZK.cjs +173 -0
- package/dist/chunk-CIAGU2X4.cjs +337 -0
- package/dist/chunk-CMGMGHUZ.cjs +27 -0
- package/dist/chunk-CXP5U3RW.cjs +54 -0
- package/dist/chunk-D2ULAULS.cjs +166 -0
- package/dist/chunk-D7JTOLFK.cjs +285 -0
- package/dist/chunk-DVM4FKZL.cjs +169 -0
- package/dist/chunk-DYEJQTDN.cjs +49 -0
- package/dist/chunk-E2BMSZ2W.cjs +151 -0
- package/dist/chunk-E3UK5IIB.cjs +593 -0
- package/dist/chunk-EM6SBQKM.cjs +470 -0
- package/dist/{chunk-27JNCYEK.mjs → chunk-EN7WTEAY.mjs} +2 -2
- package/dist/{chunk-IGO2HEV7.mjs → chunk-F6SJAKFJ.mjs} +62 -28
- package/dist/{chunk-GSDIZACQ.mjs → chunk-FG5H2VCJ.mjs} +2 -2
- package/dist/chunk-FJSWYIR7.cjs +482 -0
- package/dist/chunk-FK6GO24V.cjs +54 -0
- package/dist/chunk-FXUUWYAX.cjs +654 -0
- package/dist/chunk-G3HRIVEY.cjs +395 -0
- package/dist/chunk-G643DQCH.cjs +13 -0
- package/dist/chunk-G7HXGLEC.cjs +175 -0
- package/dist/chunk-GDSHDTJ4.cjs +152 -0
- package/dist/chunk-GNEO2XOF.cjs +2040 -0
- package/dist/{chunk-NHHKW2T6.mjs → chunk-GYKJCFTS.mjs} +170 -52
- package/dist/chunk-H6G5INWM.cjs +1094 -0
- package/dist/chunk-HBTUGXHS.cjs +180 -0
- package/dist/chunk-HREOKQWT.cjs +45 -0
- package/dist/chunk-I4J452B7.cjs +435 -0
- package/dist/chunk-I57LW5VZ.cjs +94 -0
- package/dist/chunk-I7PUUDGY.cjs +389 -0
- package/dist/chunk-IAMRBF3Z.cjs +86 -0
- package/dist/chunk-IKNRN4VS.cjs +14214 -0
- package/dist/chunk-IQXFRNY2.cjs +169 -0
- package/dist/chunk-IXTFU4PL.cjs +2355 -0
- package/dist/chunk-J2OP5GG3.cjs +725 -0
- package/dist/chunk-J3LOGE4T.cjs +42 -0
- package/dist/chunk-J7FSKED3.cjs +93 -0
- package/dist/chunk-JDNHKPTD.cjs +22 -0
- package/dist/chunk-JSROZYYO.cjs +164 -0
- package/dist/chunk-K6FNHVDR.cjs +696 -0
- package/dist/chunk-KGZIORNL.cjs +43 -0
- package/dist/{chunk-LZK5CXDW.mjs → chunk-KLSSO6YD.mjs} +2 -2
- package/dist/{chunk-TYVVIQ5M.mjs → chunk-KPNVGRBL.mjs} +32 -25
- package/dist/chunk-KR6CKSXT.cjs +15 -0
- package/dist/chunk-KROWKCUH.cjs +185 -0
- package/dist/chunk-KVFPGF2M.cjs +46 -0
- package/dist/{chunk-KUO3GBPK.mjs → chunk-L6V3P73N.mjs} +1 -1
- package/dist/chunk-LCCBO7PJ.cjs +46 -0
- package/dist/chunk-LIUGYUX3.cjs +22 -0
- package/dist/chunk-LTNGXMQ6.cjs +55 -0
- package/dist/chunk-M2L4MYDQ.cjs +14 -0
- package/dist/chunk-MCJLA63J.cjs +1 -0
- package/dist/chunk-MKB2EGIR.cjs +148 -0
- package/dist/chunk-MQ3H6LT5.cjs +202 -0
- package/dist/chunk-MT763TDW.cjs +43 -0
- package/dist/chunk-MWSK6C4J.cjs +18 -0
- package/dist/chunk-MWWVKDW3.cjs +169 -0
- package/dist/{chunk-KTGFMHET.mjs → chunk-N6UROPT7.mjs} +1 -1
- package/dist/chunk-NO3WWW3N.cjs +192 -0
- package/dist/{chunk-NDD2YVGU.mjs → chunk-NRVGEI5I.mjs} +10 -3
- package/dist/chunk-NV3A5DXM.cjs +862 -0
- package/dist/chunk-NWOD6NIT.cjs +9 -0
- package/dist/chunk-NZKJGRB3.cjs +230 -0
- package/dist/chunk-OAVTUMJP.cjs +1496 -0
- package/dist/chunk-OHY2ZWUG.cjs +25 -0
- package/dist/chunk-OI6CMLWX.cjs +47 -0
- package/dist/chunk-OIEOCXKG.cjs +453 -0
- package/dist/chunk-OWOUTKIJ.cjs +558 -0
- package/dist/chunk-OX6O6WVA.cjs +74 -0
- package/dist/chunk-OXSIH4D6.cjs +476 -0
- package/dist/chunk-OYEUREB6.cjs +35 -0
- package/dist/chunk-PCOTGFSM.cjs +139 -0
- package/dist/chunk-PZYCPSCC.cjs +35 -0
- package/dist/chunk-QBK2AA4U.cjs +445 -0
- package/dist/chunk-QBPXNZGV.cjs +487 -0
- package/dist/{chunk-IXTEENRS.mjs → chunk-QGVJVSNX.mjs} +5 -5
- package/dist/chunk-QNPEUFHQ.cjs +27 -0
- package/dist/chunk-QZRVZSPN.cjs +236 -0
- package/dist/chunk-R5A5KNVX.cjs +20 -0
- package/dist/chunk-R5JIFR6B.cjs +42 -0
- package/dist/chunk-R6AIILII.cjs +193 -0
- package/dist/chunk-RG3ZOTG5.cjs +34 -0
- package/dist/chunk-ROUTX2E5.cjs +390 -0
- package/dist/chunk-RTHIVJ2G.cjs +54 -0
- package/dist/chunk-S3A45T7F.cjs +166 -0
- package/dist/chunk-S3JO3N4H.cjs +17 -0
- package/dist/chunk-SK35NQKK.cjs +27 -0
- package/dist/chunk-SU7MH53P.cjs +180 -0
- package/dist/chunk-SVRTJOUF.cjs +113 -0
- package/dist/chunk-SWN467MP.cjs +18 -0
- package/dist/{chunk-6SCB2MXB.mjs → chunk-SXHV42UQ.mjs} +16 -1
- package/dist/{chunk-OWTIOHON.mjs → chunk-SYGGPS4A.mjs} +2 -2
- package/dist/chunk-SYQ3MOWW.cjs +73 -0
- package/dist/chunk-T5CERMEH.cjs +417 -0
- package/dist/chunk-TFAXUHWX.cjs +206 -0
- package/dist/chunk-TIWHTW3Q.cjs +24 -0
- package/dist/chunk-TKJZFIML.cjs +20 -0
- package/dist/chunk-TKNSDBBN.cjs +193 -0
- package/dist/{chunk-NC333MFA.mjs → chunk-TSWW5BVH.mjs} +7 -4
- package/dist/chunk-TWGMSEHX.cjs +525 -0
- package/dist/chunk-TYQUSXUG.cjs +1357 -0
- package/dist/chunk-U4KT7QP3.cjs +23 -0
- package/dist/{chunk-LK6FGAQR.mjs → chunk-UDBJCUPA.mjs} +7 -4
- package/dist/chunk-UJ2C4ICS.cjs +277 -0
- package/dist/chunk-UN5GHC5V.cjs +10244 -0
- package/dist/chunk-UQZ4AYTH.cjs +168 -0
- package/dist/chunk-US2QVW3E.cjs +36 -0
- package/dist/{chunk-NUD6XBMO.mjs → chunk-UTBVHYS3.mjs} +2 -2
- package/dist/{chunk-76MNRHTS.mjs → chunk-UUYF3CHN.mjs} +2 -2
- package/dist/chunk-VB6UCX3V.cjs +421 -0
- package/dist/chunk-VEKFLAQM.cjs +300 -0
- package/dist/chunk-VQDBNVOO.cjs +14 -0
- package/dist/chunk-W4E7WMXE.cjs +71 -0
- package/dist/{chunk-VVTREAG5.mjs → chunk-WD4YXVLV.mjs} +11 -3
- package/dist/{chunk-UQZPTIML.mjs → chunk-WD5PNSOB.mjs} +2 -2
- package/dist/chunk-WJ3HK3LJ.cjs +1102 -0
- package/dist/chunk-WMAPPDMM.cjs +28 -0
- package/dist/chunk-WMOGFOUJ.cjs +223 -0
- package/dist/chunk-WPYFSQKK.cjs +37 -0
- package/dist/chunk-WZMNW2IW.cjs +1415 -0
- package/dist/chunk-XGC343EY.cjs +443 -0
- package/dist/{chunk-DPZUDPVJ.mjs → chunk-XP777LRD.mjs} +1 -1
- package/dist/chunk-XSKZORAS.cjs +727 -0
- package/dist/chunk-XWAWFQFS.cjs +82 -0
- package/dist/{chunk-KATQ6I56.mjs → chunk-XWAYMDLB.mjs} +1 -1
- package/dist/chunk-Y4YMF2NQ.cjs +460 -0
- package/dist/chunk-Y4YWHNKU.cjs +250 -0
- package/dist/chunk-Y53ZSFN6.cjs +504 -0
- package/dist/chunk-YA6LLTIJ.cjs +411 -0
- package/dist/chunk-YFPGHF5F.cjs +202 -0
- package/dist/chunk-YJRZR7VU.cjs +28 -0
- package/dist/chunk-YTAABQEV.cjs +1 -0
- package/dist/chunk-YX3DBN4M.cjs +18 -0
- package/dist/chunk-YZTASLPQ.cjs +64 -0
- package/dist/chunk-Z5HIWVDP.cjs +2173 -0
- package/dist/{chunk-Q3MDL7TM.mjs → chunk-ZCNJKLA2.mjs} +30 -11
- package/dist/chunk-ZEG3OPIB.cjs +93 -0
- package/dist/chunk-ZMN3H73H.cjs +155 -0
- package/dist/client/lifecycle.cjs +6 -35
- package/dist/{client-plugins-CqVtZi5X.d.ts → client-plugins-C089bQhN.d.ts} +2 -2
- package/dist/{client-plugins-CIPRtSsW.d.mts → client-plugins-JXXmZliS.d.mts} +2 -2
- package/dist/client-plugins.cjs +7 -448
- package/dist/client-plugins.d.mts +3 -3
- package/dist/client-plugins.d.ts +3 -3
- package/dist/client.cjs +171 -9774
- package/dist/client.d.mts +8 -8
- package/dist/client.d.ts +8 -8
- package/dist/client.mjs +6 -6
- package/dist/config.cjs +8 -36
- package/dist/config.d.mts +3 -3
- package/dist/config.d.ts +3 -3
- package/dist/cron.cjs +24 -491
- package/dist/cron.mjs +2 -2
- package/dist/deferred.cjs +26 -475
- package/dist/deployment.cjs +39 -210
- package/dist/devtools-OUIPHVV6.cjs +388 -0
- package/dist/{devtools-IU7LKZOH.mjs → devtools-UFVTMQX5.mjs} +7 -7
- package/dist/devtools-client-4WAPJY5L.cjs +254 -0
- package/dist/devtools-ui-5GBDIGMK.cjs +1296 -0
- package/dist/docs.cjs +46 -5649
- package/dist/docs.mjs +9 -9
- package/dist/{endpoint-kSAxE52R.d.ts → endpoint-1zA994xL.d.ts} +1 -1
- package/dist/{endpoint-Bu3XgeMK.d.mts → endpoint-DAc96i93.d.mts} +1 -1
- package/dist/env-types.cjs +5 -226
- package/dist/env.cjs +23 -306
- package/dist/env.d.mts +5 -3
- package/dist/env.d.ts +5 -3
- package/dist/env.mjs +2 -1
- package/dist/environment/vite.cjs +8 -372
- package/dist/environment.cjs +12 -94
- package/dist/font.cjs +13 -63
- package/dist/headers.cjs +7 -123
- package/dist/i18n/client.cjs +55 -294
- package/dist/i18n/index.cjs +22 -209
- package/dist/i18n/server.cjs +22 -745
- package/dist/image/server.cjs +13 -729
- package/dist/image/sharp.cjs +33 -171
- package/dist/image.cjs +41 -85
- package/dist/index.cjs +1151 -67862
- package/dist/index.d.mts +14 -14
- package/dist/index.d.ts +14 -14
- package/dist/index.mjs +34 -34
- package/dist/instrumentation.cjs +12 -138
- package/dist/integration-orm-55F7CII5.cjs +13 -0
- package/dist/integrations.cjs +55 -4090
- package/dist/integrations.d.mts +3 -3
- package/dist/integrations.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.cjs +27 -224
- package/dist/internal/app-markdown-runtime.d.mts +3 -3
- package/dist/internal/app-markdown-runtime.d.ts +3 -3
- package/dist/internal/app-markdown-runtime.mjs +2 -2
- package/dist/internal/build-runtime.cjs +120 -52038
- package/dist/internal/build-runtime.d.mts +5 -5
- package/dist/internal/build-runtime.d.ts +5 -5
- package/dist/internal/build-runtime.mjs +23 -23
- package/dist/internal/cli-runtime.cjs +67 -13765
- package/dist/internal/cli-runtime.mjs +13 -13
- package/dist/internal/client-error-overlay.cjs +80 -733
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/client-runtime.cjs +81 -913
- package/dist/internal/compression-runtime.cjs +8 -214
- package/dist/internal/compression-runtime.d.mts +3 -3
- package/dist/internal/compression-runtime.d.ts +3 -3
- package/dist/internal/config-runtime.cjs +42 -6535
- package/dist/internal/config-runtime.d.mts +4 -4
- package/dist/internal/config-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.mjs +7 -7
- package/dist/internal/docs-precompiled-runtime.cjs +26 -46
- package/dist/internal/infra-analytics-runtime.cjs +10 -536
- package/dist/internal/isolated-boundary.cjs +14 -414
- package/dist/internal/metadata-image-runtime.cjs +7 -285
- package/dist/internal/product-telemetry-runtime.cjs +42 -97
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-node-env.cjs +6 -63
- package/dist/internal/production-runtime.cjs +418 -7073
- package/dist/internal/production-runtime.d.mts +9 -9
- package/dist/internal/production-runtime.d.ts +9 -9
- package/dist/internal/production-runtime.mjs +6 -6
- package/dist/internal/request-cookies.cjs +6 -54
- package/dist/json-ld.cjs +24 -50
- package/dist/layers-E4WPJNY5.cjs +17 -0
- package/dist/manager-G4B2IPYE.cjs +14 -0
- package/dist/markdown.cjs +21 -532
- package/dist/markdown.mjs +1 -1
- package/dist/{metadata-8g__AMPM.d.ts → metadata-BcNJP4fq.d.ts} +1 -1
- package/dist/{metadata-OMX6wFNf.d.mts → metadata-C1Z9vLbb.d.mts} +1 -1
- package/dist/middleware.cjs +36 -2988
- package/dist/middleware.d.mts +5 -5
- package/dist/middleware.d.ts +5 -5
- package/dist/middleware.mjs +4 -4
- package/dist/navigation.cjs +22 -2588
- package/dist/nitro-4I2MYLY2.cjs +652 -0
- package/dist/{nitro-3N4ZXRYM.mjs → nitro-CVZ36JM5.mjs} +4 -4
- package/dist/observability.cjs +22 -614
- package/dist/og.cjs +5 -28
- package/dist/plugin.cjs +106 -37291
- package/dist/plugin.d.mts +3 -3
- package/dist/plugin.d.ts +3 -3
- package/dist/plugin.mjs +19 -19
- package/dist/{production-runtime-W3M0eNDV.d.mts → production-runtime-jcrTlRTb.d.mts} +1 -1
- package/dist/{production-runtime-BJh7o6Cr.d.ts → production-runtime-oKmC0WU-.d.ts} +1 -1
- package/dist/query/client.cjs +113 -449
- package/dist/query/index.cjs +26 -288
- package/dist/query/parsers.cjs +23 -247
- package/dist/query/server.cjs +36 -298
- package/dist/{render-plan-io7pvDNc.d.mts → render-plan-BLIfc4jt.d.mts} +1 -1
- package/dist/{render-plan-Be4ZGTJP.d.ts → render-plan-DOB9cV-h.d.ts} +1 -1
- package/dist/renderer/react/client.cjs +9 -43
- package/dist/renderer/react/server.cjs +40 -103
- package/dist/renderer/react/vite.cjs +7 -29
- package/dist/renderer-client.cjs +126 -4261
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +3 -3
- package/dist/renderer.cjs +31 -249
- package/dist/{request-DZkHYQ89.d.mts → request-Cr53NRHr.d.mts} +1 -1
- package/dist/{request-G8JhKr4F.d.ts → request-Dt2gNuQD.d.ts} +1 -1
- package/dist/request.cjs +5 -68
- package/dist/request.d.mts +4 -4
- package/dist/request.d.ts +4 -4
- package/dist/{route-C_eLaFTZ.d.mts → route-B0XrsrFk.d.mts} +1 -1
- package/dist/{route-BxNJT447.d.ts → route-DOEpbyWZ.d.ts} +1 -1
- package/dist/{route-rendering-BcLLPJgN.d.ts → route-rendering-CWYd8Mv1.d.ts} +1 -1
- package/dist/{route-rendering-CbAKr1TY.d.mts → route-rendering-CeFBEAoZ.d.mts} +1 -1
- package/dist/router.cjs +11 -474
- package/dist/routes.cjs +42 -2424
- package/dist/routes.d.mts +4 -4
- package/dist/routes.d.ts +4 -4
- package/dist/routes.mjs +2 -2
- package/dist/schema-dev-notice-MXSZMVDG.cjs +56 -0
- package/dist/schema.cjs +6 -33
- package/dist/search-client-G3RICOFU.cjs +13 -0
- package/dist/server-action-security.cjs +25 -541
- package/dist/server-fn-client.cjs +6 -337
- package/dist/server-fn-client.d.mts +3 -3
- package/dist/server-fn-client.d.ts +3 -3
- package/dist/server-fn.cjs +32 -1799
- package/dist/server-fn.d.mts +1 -1
- package/dist/server-fn.d.ts +1 -1
- package/dist/server-fn.mjs +2 -2
- package/dist/server-plugins.cjs +15 -884
- package/dist/server-plugins.d.mts +4 -4
- package/dist/server-plugins.d.ts +4 -4
- package/dist/server-query-client.cjs +15 -1849
- package/dist/server-query-client.d.mts +1 -1
- package/dist/server-query-client.d.ts +1 -1
- package/dist/server-query-client.mjs +4 -4
- package/dist/server-query.cjs +16 -1796
- package/dist/server-query.d.mts +1 -1
- package/dist/server-query.d.ts +1 -1
- package/dist/server-query.mjs +3 -3
- package/dist/server.cjs +296 -44522
- package/dist/server.d.mts +9 -9
- package/dist/server.d.ts +9 -9
- package/dist/server.mjs +22 -22
- package/dist/{spa-router-BcS_4nqm.d.mts → spa-router-CQWiYGxS.d.mts} +2 -2
- package/dist/{spa-router-BzFBUJkn.d.ts → spa-router-Wjiw-8hB.d.ts} +2 -2
- package/dist/storage.cjs +57 -576
- package/dist/testing.cjs +92 -3148
- package/dist/testing.d.mts +3 -3
- package/dist/testing.d.ts +3 -3
- package/dist/testing.mjs +11 -7
- package/dist/theme/client.cjs +13 -108
- package/dist/theme/index.cjs +6 -68
- package/dist/theme/runtime.cjs +13 -78
- package/dist/theme/server.cjs +10 -179
- package/dist/{utils-C4yrAhNc.d.ts → utils-B0XJmG_b.d.ts} +1 -1
- package/dist/{utils-5kQP1mFR.d.mts → utils-uUxF0K0P.d.mts} +1 -1
- package/dist/version.cjs +4 -32
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +119 -37622
- package/dist/vite.d.mts +3 -3
- package/dist/vite.d.ts +3 -3
- package/dist/vite.mjs +19 -19
- package/dist/workflows.cjs +19 -1040
- package/dist/workflows.mjs +2 -2
- package/package.json +2 -2
- package/dist/{chunk-VO5SCWF5.mjs → chunk-BNGS6KJ6.mjs} +0 -0
- package/dist/{chunk-MUUZJLCI.mjs → chunk-EGJDUF4Q.mjs} +3 -3
- package/dist/{chunk-4L7SZOHZ.mjs → chunk-YHOCRI4H.mjs} +3 -3
|
@@ -0,0 +1,470 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunkNO3WWW3Ncjs = require('./chunk-NO3WWW3N.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
7
|
+
|
|
8
|
+
// src/request-context.ts
|
|
9
|
+
var REQUEST_CONTEXT_STORE_KEY = /* @__PURE__ */ Symbol.for("farm.requestContextStore");
|
|
10
|
+
function getRequestContextStore() {
|
|
11
|
+
const globalState = globalThis;
|
|
12
|
+
if (!globalState[REQUEST_CONTEXT_STORE_KEY]) {
|
|
13
|
+
globalState[REQUEST_CONTEXT_STORE_KEY] = /* @__PURE__ */ new WeakMap();
|
|
14
|
+
}
|
|
15
|
+
return globalState[REQUEST_CONTEXT_STORE_KEY];
|
|
16
|
+
}
|
|
17
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getRequestContextStore, "getRequestContextStore");
|
|
18
|
+
function getBucket(target) {
|
|
19
|
+
const requestContextStore = getRequestContextStore();
|
|
20
|
+
let bucket = requestContextStore.get(target);
|
|
21
|
+
if (!bucket) {
|
|
22
|
+
bucket = {
|
|
23
|
+
privateData: /* @__PURE__ */ new Map(),
|
|
24
|
+
exposedData: /* @__PURE__ */ new Map()
|
|
25
|
+
};
|
|
26
|
+
requestContextStore.set(target, bucket);
|
|
27
|
+
}
|
|
28
|
+
return bucket;
|
|
29
|
+
}
|
|
30
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getBucket, "getBucket");
|
|
31
|
+
function setRequestContext(target, key, value, options = {}) {
|
|
32
|
+
const bucket = getBucket(target);
|
|
33
|
+
bucket.privateData.set(key, value);
|
|
34
|
+
if (options.exposeToPage) {
|
|
35
|
+
bucket.exposedData.set(key, value);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, setRequestContext, "setRequestContext");
|
|
39
|
+
function getRequestContext(target, key) {
|
|
40
|
+
const requestContextStore = getRequestContextStore();
|
|
41
|
+
const bucket = requestContextStore.get(target);
|
|
42
|
+
return _optionalChain([bucket, 'optionalAccess', _ => _.privateData, 'access', _2 => _2.get, 'call', _3 => _3(key)]);
|
|
43
|
+
}
|
|
44
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getRequestContext, "getRequestContext");
|
|
45
|
+
function hasRequestContext(target, key) {
|
|
46
|
+
const requestContextStore = getRequestContextStore();
|
|
47
|
+
const bucket = requestContextStore.get(target);
|
|
48
|
+
return _nullishCoalesce(_optionalChain([bucket, 'optionalAccess', _4 => _4.privateData, 'access', _5 => _5.has, 'call', _6 => _6(key)]), () => ( false));
|
|
49
|
+
}
|
|
50
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, hasRequestContext, "hasRequestContext");
|
|
51
|
+
function deleteRequestContext(target, key) {
|
|
52
|
+
const requestContextStore = getRequestContextStore();
|
|
53
|
+
const bucket = requestContextStore.get(target);
|
|
54
|
+
if (!bucket) return false;
|
|
55
|
+
const removedPrivate = bucket.privateData.delete(key);
|
|
56
|
+
bucket.exposedData.delete(key);
|
|
57
|
+
return removedPrivate;
|
|
58
|
+
}
|
|
59
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, deleteRequestContext, "deleteRequestContext");
|
|
60
|
+
function clearRequestContext(target) {
|
|
61
|
+
const requestContextStore = getRequestContextStore();
|
|
62
|
+
const bucket = requestContextStore.get(target);
|
|
63
|
+
if (!bucket) return;
|
|
64
|
+
bucket.privateData.clear();
|
|
65
|
+
bucket.exposedData.clear();
|
|
66
|
+
}
|
|
67
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, clearRequestContext, "clearRequestContext");
|
|
68
|
+
function getRequestContextSnapshot(target, options = {}) {
|
|
69
|
+
const requestContextStore = getRequestContextStore();
|
|
70
|
+
const bucket = requestContextStore.get(target);
|
|
71
|
+
if (!bucket) return /* @__PURE__ */ new Map();
|
|
72
|
+
if (options.exposedOnly) {
|
|
73
|
+
return new Map(bucket.exposedData);
|
|
74
|
+
}
|
|
75
|
+
return new Map(bucket.privateData);
|
|
76
|
+
}
|
|
77
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, getRequestContextSnapshot, "getRequestContextSnapshot");
|
|
78
|
+
function copyRequestContext(source, target) {
|
|
79
|
+
const bucket = getRequestContextStore().get(source);
|
|
80
|
+
if (!bucket || source === target) return;
|
|
81
|
+
for (const [key, value] of bucket.privateData) {
|
|
82
|
+
setRequestContext(target, key, value, { exposeToPage: bucket.exposedData.has(key) });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, copyRequestContext, "copyRequestContext");
|
|
86
|
+
|
|
87
|
+
// src/server-http.ts
|
|
88
|
+
function createFarmNodeRequestAbortSignal(req, res) {
|
|
89
|
+
const controller = new AbortController();
|
|
90
|
+
let disposed = false;
|
|
91
|
+
const dispose = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
92
|
+
if (disposed) return;
|
|
93
|
+
disposed = true;
|
|
94
|
+
req.off("aborted", abort);
|
|
95
|
+
res.off("close", abortOnEarlyClose);
|
|
96
|
+
res.off("finish", dispose);
|
|
97
|
+
controller.signal.removeEventListener("abort", dispose);
|
|
98
|
+
}, "dispose");
|
|
99
|
+
const abort = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => controller.abort(), "abort");
|
|
100
|
+
const abortOnEarlyClose = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
101
|
+
if (!res.writableEnded) abort();
|
|
102
|
+
dispose();
|
|
103
|
+
}, "abortOnEarlyClose");
|
|
104
|
+
if (req.aborted) {
|
|
105
|
+
controller.abort();
|
|
106
|
+
return controller.signal;
|
|
107
|
+
}
|
|
108
|
+
req.once("aborted", abort);
|
|
109
|
+
res.once("close", abortOnEarlyClose);
|
|
110
|
+
res.once("finish", dispose);
|
|
111
|
+
controller.signal.addEventListener("abort", dispose, { once: true });
|
|
112
|
+
return controller.signal;
|
|
113
|
+
}
|
|
114
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmNodeRequestAbortSignal, "createFarmNodeRequestAbortSignal");
|
|
115
|
+
var DEFAULT_FARM_SERVER_BODY_SIZE_LIMIT = 1e7;
|
|
116
|
+
var DEFAULT_FARM_SERVER_HEADERS_TIMEOUT = 6e4;
|
|
117
|
+
var DEFAULT_FARM_SERVER_REQUEST_TIMEOUT = 3e5;
|
|
118
|
+
var DEFAULT_FARM_SERVER_KEEP_ALIVE_TIMEOUT = 5e3;
|
|
119
|
+
var DEFAULT_FARM_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT = 3e4;
|
|
120
|
+
var MAX_FARM_SERVER_TIMEOUT = 2147483647;
|
|
121
|
+
function matchesFarmIfNoneMatch(value, etag) {
|
|
122
|
+
const expected = parseEntityTag(trimOptionalWhitespace(etag));
|
|
123
|
+
if (!expected) return false;
|
|
124
|
+
const values = Array.isArray(value) ? value : [value];
|
|
125
|
+
const combined = values.filter((header) => typeof header === "string").join(",");
|
|
126
|
+
const fieldValue = trimOptionalWhitespace(combined);
|
|
127
|
+
if (!fieldValue) return false;
|
|
128
|
+
if (fieldValue === "*") return true;
|
|
129
|
+
let matched = false;
|
|
130
|
+
let hasEntityTag = false;
|
|
131
|
+
for (const candidate of splitEntityTags(fieldValue)) {
|
|
132
|
+
const token = trimOptionalWhitespace(candidate);
|
|
133
|
+
if (!token) continue;
|
|
134
|
+
const parsed = parseEntityTag(token);
|
|
135
|
+
if (!parsed) return false;
|
|
136
|
+
hasEntityTag = true;
|
|
137
|
+
if (parsed === expected) matched = true;
|
|
138
|
+
}
|
|
139
|
+
return hasEntityTag && matched;
|
|
140
|
+
}
|
|
141
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, matchesFarmIfNoneMatch, "matchesFarmIfNoneMatch");
|
|
142
|
+
function trimOptionalWhitespace(value) {
|
|
143
|
+
return value.replace(/^[\t ]+|[\t ]+$/g, "");
|
|
144
|
+
}
|
|
145
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, trimOptionalWhitespace, "trimOptionalWhitespace");
|
|
146
|
+
function parseEntityTag(value) {
|
|
147
|
+
const opaqueTag = value.startsWith("W/") ? value.slice(2) : value;
|
|
148
|
+
if (opaqueTag.length < 2 || opaqueTag[0] !== '"' || opaqueTag.at(-1) !== '"') return null;
|
|
149
|
+
for (let index = 1; index < opaqueTag.length - 1; index++) {
|
|
150
|
+
const code = opaqueTag.charCodeAt(index);
|
|
151
|
+
if (code === 33 || code >= 35 && code <= 126 || code >= 128) continue;
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
return opaqueTag;
|
|
155
|
+
}
|
|
156
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, parseEntityTag, "parseEntityTag");
|
|
157
|
+
function splitEntityTags(value) {
|
|
158
|
+
const tags = [];
|
|
159
|
+
let start = 0;
|
|
160
|
+
let quoted = false;
|
|
161
|
+
for (let index = 0; index < value.length; index++) {
|
|
162
|
+
const character = value[index];
|
|
163
|
+
if (character === '"') {
|
|
164
|
+
quoted = !quoted;
|
|
165
|
+
} else if (character === "," && !quoted) {
|
|
166
|
+
tags.push(value.slice(start, index));
|
|
167
|
+
start = index + 1;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
tags.push(value.slice(start));
|
|
171
|
+
return tags;
|
|
172
|
+
}
|
|
173
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, splitEntityTags, "splitEntityTags");
|
|
174
|
+
var _FarmRequestBodyError = class _FarmRequestBodyError extends Error {
|
|
175
|
+
constructor(code, status, message) {
|
|
176
|
+
super(message);
|
|
177
|
+
this.name = "FarmRequestBodyError";
|
|
178
|
+
this.code = code;
|
|
179
|
+
this.status = status;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, _FarmRequestBodyError, "FarmRequestBodyError");
|
|
183
|
+
var FarmRequestBodyError = _FarmRequestBodyError;
|
|
184
|
+
function resolveFarmServerConfig(config) {
|
|
185
|
+
const headersTimeout = parseFarmServerDuration(
|
|
186
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _7 => _7.headersTimeout]), () => ( DEFAULT_FARM_SERVER_HEADERS_TIMEOUT)),
|
|
187
|
+
"server.headersTimeout"
|
|
188
|
+
);
|
|
189
|
+
const requestTimeout = parseFarmServerDuration(
|
|
190
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _8 => _8.requestTimeout]), () => ( DEFAULT_FARM_SERVER_REQUEST_TIMEOUT)),
|
|
191
|
+
"server.requestTimeout"
|
|
192
|
+
);
|
|
193
|
+
if (headersTimeout > requestTimeout) {
|
|
194
|
+
throw new TypeError("server.headersTimeout must not exceed server.requestTimeout");
|
|
195
|
+
}
|
|
196
|
+
return Object.freeze({
|
|
197
|
+
bodySizeLimit: parseBodySizeLimit(
|
|
198
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _9 => _9.bodySizeLimit]), () => ( DEFAULT_FARM_SERVER_BODY_SIZE_LIMIT)),
|
|
199
|
+
"server.bodySizeLimit"
|
|
200
|
+
),
|
|
201
|
+
trustProxy: _optionalChain([config, 'optionalAccess', _10 => _10.trustProxy]) === true,
|
|
202
|
+
headersTimeout,
|
|
203
|
+
requestTimeout,
|
|
204
|
+
keepAliveTimeout: parseFarmServerDuration(
|
|
205
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _11 => _11.keepAliveTimeout]), () => ( DEFAULT_FARM_SERVER_KEEP_ALIVE_TIMEOUT)),
|
|
206
|
+
"server.keepAliveTimeout"
|
|
207
|
+
),
|
|
208
|
+
gracefulShutdownTimeout: parseFarmServerDuration(
|
|
209
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _12 => _12.gracefulShutdownTimeout]), () => ( DEFAULT_FARM_SERVER_GRACEFUL_SHUTDOWN_TIMEOUT)),
|
|
210
|
+
"server.gracefulShutdownTimeout"
|
|
211
|
+
),
|
|
212
|
+
health: resolveFarmServerHealthConfig(_optionalChain([config, 'optionalAccess', _13 => _13.health]))
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmServerConfig, "resolveFarmServerConfig");
|
|
216
|
+
function parseFarmServerDuration(value, optionName = "duration") {
|
|
217
|
+
if (typeof value === "number") {
|
|
218
|
+
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
219
|
+
throw new TypeError(`${optionName} must be a positive safe integer`);
|
|
220
|
+
}
|
|
221
|
+
if (value > MAX_FARM_SERVER_TIMEOUT) {
|
|
222
|
+
throw new TypeError(`${optionName} must not exceed ${MAX_FARM_SERVER_TIMEOUT} milliseconds`);
|
|
223
|
+
}
|
|
224
|
+
return value;
|
|
225
|
+
}
|
|
226
|
+
const match = value.trim().toLowerCase().match(/^(\d+(?:\.\d+)?)\s*(ms|s|m|h)$/);
|
|
227
|
+
if (!match) {
|
|
228
|
+
throw new TypeError(`${optionName} must be milliseconds or a duration such as "30s" or "2m"`);
|
|
229
|
+
}
|
|
230
|
+
const amount = Number(match[1]);
|
|
231
|
+
const unit = match[2];
|
|
232
|
+
const multiplier = unit === "ms" ? 1 : unit === "s" ? 1e3 : unit === "m" ? 6e4 : 36e5;
|
|
233
|
+
const milliseconds = Math.floor(amount * multiplier);
|
|
234
|
+
if (!Number.isSafeInteger(milliseconds) || milliseconds <= 0) {
|
|
235
|
+
throw new TypeError(`${optionName} must resolve to a positive safe integer`);
|
|
236
|
+
}
|
|
237
|
+
if (milliseconds > MAX_FARM_SERVER_TIMEOUT) {
|
|
238
|
+
throw new TypeError(`${optionName} must not exceed ${MAX_FARM_SERVER_TIMEOUT} milliseconds`);
|
|
239
|
+
}
|
|
240
|
+
return milliseconds;
|
|
241
|
+
}
|
|
242
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, parseFarmServerDuration, "parseFarmServerDuration");
|
|
243
|
+
function resolveFarmServerHealthConfig(config) {
|
|
244
|
+
if (config === false || config && "enabled" in config && config.enabled === false) {
|
|
245
|
+
return Object.freeze({
|
|
246
|
+
enabled: false,
|
|
247
|
+
livenessPath: "/_farm/health/live",
|
|
248
|
+
readinessPath: "/_farm/health/ready"
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
const livenessPath = normalizeHealthPath(
|
|
252
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _14 => _14.livenessPath]), () => ( "/_farm/health/live")),
|
|
253
|
+
"server.health.livenessPath"
|
|
254
|
+
);
|
|
255
|
+
const readinessPath = normalizeHealthPath(
|
|
256
|
+
_nullishCoalesce(_optionalChain([config, 'optionalAccess', _15 => _15.readinessPath]), () => ( "/_farm/health/ready")),
|
|
257
|
+
"server.health.readinessPath"
|
|
258
|
+
);
|
|
259
|
+
if (livenessPath === readinessPath) {
|
|
260
|
+
throw new TypeError("server.health livenessPath and readinessPath must be different");
|
|
261
|
+
}
|
|
262
|
+
return Object.freeze({ enabled: true, livenessPath, readinessPath });
|
|
263
|
+
}
|
|
264
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmServerHealthConfig, "resolveFarmServerHealthConfig");
|
|
265
|
+
function normalizeHealthPath(value, optionName) {
|
|
266
|
+
const path = value.trim();
|
|
267
|
+
if (!path.startsWith("/") || path.includes("?") || path.includes("#") || path.includes("*")) {
|
|
268
|
+
throw new TypeError(`${optionName} must be an absolute pathname without a query or wildcard`);
|
|
269
|
+
}
|
|
270
|
+
const normalized = path.length > 1 ? path.replace(/\/+$/, "") || "/" : path;
|
|
271
|
+
_chunkNO3WWW3Ncjs.assertBrowserStableRoutePath.call(void 0, normalized);
|
|
272
|
+
return normalized;
|
|
273
|
+
}
|
|
274
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, normalizeHealthPath, "normalizeHealthPath");
|
|
275
|
+
function parseBodySizeLimit(value, optionName = "bodySizeLimit") {
|
|
276
|
+
if (typeof value === "number") {
|
|
277
|
+
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
278
|
+
throw new TypeError(`${optionName} must be a positive safe integer`);
|
|
279
|
+
}
|
|
280
|
+
return value;
|
|
281
|
+
}
|
|
282
|
+
const match = value.trim().toLowerCase().match(/^(\d+(?:\.\d+)?)\s*(b|kb|mb|gb|kib|mib|gib)?$/);
|
|
283
|
+
if (!match) {
|
|
284
|
+
throw new TypeError(`${optionName} must be bytes or a size string such as "500kb" or "10mb"`);
|
|
285
|
+
}
|
|
286
|
+
const amount = Number(match[1]);
|
|
287
|
+
const unit = _nullishCoalesce(match[2], () => ( "b"));
|
|
288
|
+
const multiplier = {
|
|
289
|
+
b: 1,
|
|
290
|
+
kb: 1e3,
|
|
291
|
+
mb: 1e6,
|
|
292
|
+
gb: 1e9,
|
|
293
|
+
kib: 1024,
|
|
294
|
+
mib: 1048576,
|
|
295
|
+
gib: 1073741824
|
|
296
|
+
};
|
|
297
|
+
const bytes = Math.floor(amount * multiplier[unit]);
|
|
298
|
+
if (!Number.isSafeInteger(bytes) || bytes <= 0) {
|
|
299
|
+
throw new TypeError(`${optionName} must resolve to a positive safe integer`);
|
|
300
|
+
}
|
|
301
|
+
return bytes;
|
|
302
|
+
}
|
|
303
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, parseBodySizeLimit, "parseBodySizeLimit");
|
|
304
|
+
function cloneFarmRequestWithContext(request) {
|
|
305
|
+
const cloned = request.clone();
|
|
306
|
+
copyRequestContext(request, cloned);
|
|
307
|
+
return cloned;
|
|
308
|
+
}
|
|
309
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, cloneFarmRequestWithContext, "cloneFarmRequestWithContext");
|
|
310
|
+
async function bufferFarmRequestBody(request, limit) {
|
|
311
|
+
if (request.method === "GET" || request.method === "HEAD" || request.body === null) {
|
|
312
|
+
return request;
|
|
313
|
+
}
|
|
314
|
+
const bytes = await readFarmRequestBody(request, limit);
|
|
315
|
+
const body = new Uint8Array(bytes.byteLength);
|
|
316
|
+
body.set(bytes);
|
|
317
|
+
const buffered = new Request(request, {
|
|
318
|
+
// oxlint-disable-next-line unicorn/no-invalid-fetch-options -- GET and HEAD return above.
|
|
319
|
+
body: body.buffer
|
|
320
|
+
});
|
|
321
|
+
copyRequestContext(request, buffered);
|
|
322
|
+
return buffered;
|
|
323
|
+
}
|
|
324
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, bufferFarmRequestBody, "bufferFarmRequestBody");
|
|
325
|
+
async function readFarmRequestBody(request, limit) {
|
|
326
|
+
try {
|
|
327
|
+
validateContentLength(request.headers.get("content-length"), limit);
|
|
328
|
+
} catch (error) {
|
|
329
|
+
void _optionalChain([request, 'access', _16 => _16.body, 'optionalAccess', _17 => _17.cancel, 'call', _18 => _18(error), 'access', _19 => _19.catch, 'call', _20 => _20(() => {
|
|
330
|
+
})]);
|
|
331
|
+
throw error;
|
|
332
|
+
}
|
|
333
|
+
throwIfAborted(request.signal);
|
|
334
|
+
if (!request.body) return new Uint8Array();
|
|
335
|
+
const reader = request.body.getReader();
|
|
336
|
+
const chunks = [];
|
|
337
|
+
let total = 0;
|
|
338
|
+
const cancelBodyRead = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
339
|
+
void reader.cancel(request.signal.reason).catch(() => {
|
|
340
|
+
});
|
|
341
|
+
}, "cancelBodyRead");
|
|
342
|
+
request.signal.addEventListener("abort", cancelBodyRead, { once: true });
|
|
343
|
+
try {
|
|
344
|
+
while (true) {
|
|
345
|
+
throwIfAborted(request.signal);
|
|
346
|
+
const { done, value } = await reader.read();
|
|
347
|
+
throwIfAborted(request.signal);
|
|
348
|
+
if (done) break;
|
|
349
|
+
if (!value) continue;
|
|
350
|
+
total += value.byteLength;
|
|
351
|
+
if (total > limit) {
|
|
352
|
+
const error = new FarmRequestBodyError("BODY_TOO_LARGE", 413, "Request body is too large");
|
|
353
|
+
void reader.cancel(error).catch(() => {
|
|
354
|
+
});
|
|
355
|
+
throw error;
|
|
356
|
+
}
|
|
357
|
+
chunks.push(value);
|
|
358
|
+
}
|
|
359
|
+
} catch (error) {
|
|
360
|
+
if (request.signal.aborted) throwIfAborted(request.signal);
|
|
361
|
+
throw error;
|
|
362
|
+
} finally {
|
|
363
|
+
request.signal.removeEventListener("abort", cancelBodyRead);
|
|
364
|
+
reader.releaseLock();
|
|
365
|
+
}
|
|
366
|
+
const body = new Uint8Array(total);
|
|
367
|
+
let offset = 0;
|
|
368
|
+
for (const chunk of chunks) {
|
|
369
|
+
body.set(chunk, offset);
|
|
370
|
+
offset += chunk.byteLength;
|
|
371
|
+
}
|
|
372
|
+
return body;
|
|
373
|
+
}
|
|
374
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, readFarmRequestBody, "readFarmRequestBody");
|
|
375
|
+
async function readNodeRequestBody(request, limit) {
|
|
376
|
+
const rawContentLength = request.headers["content-length"];
|
|
377
|
+
const contentLength = Array.isArray(rawContentLength) ? rawContentLength[0] : rawContentLength;
|
|
378
|
+
try {
|
|
379
|
+
validateContentLength(contentLength, limit);
|
|
380
|
+
} catch (error) {
|
|
381
|
+
_optionalChain([request, 'access', _21 => _21.resume, 'optionalCall', _22 => _22()]);
|
|
382
|
+
throw error;
|
|
383
|
+
}
|
|
384
|
+
return await new Promise((resolve, reject) => {
|
|
385
|
+
const chunks = [];
|
|
386
|
+
let total = 0;
|
|
387
|
+
let settled = false;
|
|
388
|
+
const cleanup = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
389
|
+
_optionalChain([request, 'access', _23 => _23.removeListener, 'optionalCall', _24 => _24("data", onData)]);
|
|
390
|
+
_optionalChain([request, 'access', _25 => _25.removeListener, 'optionalCall', _26 => _26("end", onEnd)]);
|
|
391
|
+
_optionalChain([request, 'access', _27 => _27.removeListener, 'optionalCall', _28 => _28("error", onError)]);
|
|
392
|
+
}, "cleanup");
|
|
393
|
+
const rejectOnce = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => {
|
|
394
|
+
if (settled) return;
|
|
395
|
+
settled = true;
|
|
396
|
+
cleanup();
|
|
397
|
+
_optionalChain([request, 'access', _29 => _29.resume, 'optionalCall', _30 => _30()]);
|
|
398
|
+
reject(error);
|
|
399
|
+
}, "rejectOnce");
|
|
400
|
+
const onData = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunk) => {
|
|
401
|
+
const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
402
|
+
total += bytes.byteLength;
|
|
403
|
+
if (total > limit) {
|
|
404
|
+
rejectOnce(new FarmRequestBodyError("BODY_TOO_LARGE", 413, "Request body is too large"));
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
chunks.push(bytes);
|
|
408
|
+
}, "onData");
|
|
409
|
+
const onEnd = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => {
|
|
410
|
+
if (settled) return;
|
|
411
|
+
settled = true;
|
|
412
|
+
cleanup();
|
|
413
|
+
resolve(Buffer.concat(chunks, total));
|
|
414
|
+
}, "onEnd");
|
|
415
|
+
const onError = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => rejectOnce(error), "onError");
|
|
416
|
+
request.on("data", onData);
|
|
417
|
+
request.on("end", onEnd);
|
|
418
|
+
request.on("error", onError);
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, readNodeRequestBody, "readNodeRequestBody");
|
|
422
|
+
function createFarmRequestBodyErrorResponse(error) {
|
|
423
|
+
if (!(error instanceof FarmRequestBodyError)) return null;
|
|
424
|
+
return new Response(error.status === 413 ? "Payload Too Large" : "Bad Request", {
|
|
425
|
+
status: error.status,
|
|
426
|
+
headers: {
|
|
427
|
+
"cache-control": "no-store",
|
|
428
|
+
"content-type": "text/plain; charset=utf-8",
|
|
429
|
+
"x-content-type-options": "nosniff"
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, createFarmRequestBodyErrorResponse, "createFarmRequestBodyErrorResponse");
|
|
434
|
+
function validateContentLength(value, limit) {
|
|
435
|
+
const contentLength = _optionalChain([value, 'optionalAccess', _31 => _31.trim, 'call', _32 => _32()]);
|
|
436
|
+
if (!contentLength) return;
|
|
437
|
+
if (!/^\d+$/.test(contentLength)) {
|
|
438
|
+
throw new FarmRequestBodyError("INVALID_CONTENT_LENGTH", 400, "Invalid content-length header");
|
|
439
|
+
}
|
|
440
|
+
if (Number(contentLength) > limit) {
|
|
441
|
+
throw new FarmRequestBodyError("BODY_TOO_LARGE", 413, "Request body is too large");
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, validateContentLength, "validateContentLength");
|
|
445
|
+
function throwIfAborted(signal) {
|
|
446
|
+
if (!signal.aborted) return;
|
|
447
|
+
if (signal.reason !== void 0) throw signal.reason;
|
|
448
|
+
throw new DOMException("The operation was aborted", "AbortError");
|
|
449
|
+
}
|
|
450
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, throwIfAborted, "throwIfAborted");
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
exports.setRequestContext = setRequestContext; exports.getRequestContext = getRequestContext; exports.hasRequestContext = hasRequestContext; exports.deleteRequestContext = deleteRequestContext; exports.clearRequestContext = clearRequestContext; exports.getRequestContextSnapshot = getRequestContextSnapshot; exports.copyRequestContext = copyRequestContext; exports.createFarmNodeRequestAbortSignal = createFarmNodeRequestAbortSignal; exports.DEFAULT_FARM_SERVER_BODY_SIZE_LIMIT = DEFAULT_FARM_SERVER_BODY_SIZE_LIMIT; exports.matchesFarmIfNoneMatch = matchesFarmIfNoneMatch; exports.resolveFarmServerConfig = resolveFarmServerConfig; exports.parseBodySizeLimit = parseBodySizeLimit; exports.cloneFarmRequestWithContext = cloneFarmRequestWithContext; exports.bufferFarmRequestBody = bufferFarmRequestBody; exports.readFarmRequestBody = readFarmRequestBody; exports.readNodeRequestBody = readNodeRequestBody; exports.createFarmRequestBodyErrorResponse = createFarmRequestBodyErrorResponse;
|
|
@@ -26,13 +26,13 @@ import {
|
|
|
26
26
|
} from "./chunk-OLYK7EAK.mjs";
|
|
27
27
|
import {
|
|
28
28
|
discoverProgrammaticRoutePaths
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-BNGS6KJ6.mjs";
|
|
30
30
|
import {
|
|
31
31
|
readFarmI18nCatalogs
|
|
32
32
|
} from "./chunk-FV45CKBC.mjs";
|
|
33
33
|
import {
|
|
34
34
|
resolvePluginRoutes
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-SYGGPS4A.mjs";
|
|
36
36
|
import {
|
|
37
37
|
parseRoutePath
|
|
38
38
|
} from "./chunk-KI3MESHB.mjs";
|
|
@@ -184,6 +184,8 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
184
184
|
constructor(config = {}) {
|
|
185
185
|
this.entries = /* @__PURE__ */ new Map();
|
|
186
186
|
this.inflight = /* @__PURE__ */ new Map();
|
|
187
|
+
/** Local entries by tag, so tag counts and pruning never scan unrelated entries. */
|
|
188
|
+
this.entriesByTag = /* @__PURE__ */ new Map();
|
|
187
189
|
this.invalidatedTagVersions = /* @__PURE__ */ new Map();
|
|
188
190
|
this.activeGenerations = /* @__PURE__ */ new Set();
|
|
189
191
|
this.version = 0;
|
|
@@ -202,6 +204,7 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
202
204
|
configure(config = {}) {
|
|
203
205
|
this.generation++;
|
|
204
206
|
this.entries.clear();
|
|
207
|
+
this.entriesByTag.clear();
|
|
205
208
|
this.inflight.clear();
|
|
206
209
|
this.invalidatedTagVersions.clear();
|
|
207
210
|
this.activeGenerations.clear();
|
|
@@ -368,14 +371,12 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
368
371
|
return entry;
|
|
369
372
|
}
|
|
370
373
|
delete(key) {
|
|
371
|
-
const deleted = this.
|
|
372
|
-
if (deleted) this.pruneInvalidatedTagVersions();
|
|
374
|
+
const deleted = this.deleteLocalEntry(key);
|
|
373
375
|
emitFarmEvent({ type: "cache.delete", key, deleted });
|
|
374
376
|
return deleted;
|
|
375
377
|
}
|
|
376
378
|
async deleteAsync(key) {
|
|
377
|
-
const deleted = this.
|
|
378
|
-
if (deleted) this.pruneInvalidatedTagVersions();
|
|
379
|
+
const deleted = this.deleteLocalEntry(key);
|
|
379
380
|
if (this.adapter) {
|
|
380
381
|
await this.adapter.delete(this.createAdapterKey(key));
|
|
381
382
|
}
|
|
@@ -386,6 +387,7 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
386
387
|
const count = this.entries.size;
|
|
387
388
|
this.generation++;
|
|
388
389
|
this.entries.clear();
|
|
390
|
+
this.entriesByTag.clear();
|
|
389
391
|
this.inflight.clear();
|
|
390
392
|
this.invalidatedTagVersions.clear();
|
|
391
393
|
this.activeGenerations.clear();
|
|
@@ -471,23 +473,32 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
471
473
|
return cached.value;
|
|
472
474
|
}
|
|
473
475
|
const inflight = this.inflight.get(key);
|
|
474
|
-
if (inflight) {
|
|
476
|
+
if (inflight && !this.wasInvalidatedSince(inflight.tags, inflight.startVersion)) {
|
|
475
477
|
emitFarmEvent({ type: "cache.dedupe", key });
|
|
476
|
-
return inflight;
|
|
478
|
+
return inflight.promise;
|
|
477
479
|
}
|
|
478
480
|
const tags = Array.from(normalizeCacheOptionsTags(options));
|
|
479
481
|
const generation = this.generation;
|
|
482
|
+
const startVersion = this.version;
|
|
480
483
|
const promise = this.fillCacheEntry(key, producer, options, tags, generation).catch((error) => {
|
|
481
484
|
emitFarmEvent({ type: "cache.error", key, operation: "set", error });
|
|
482
485
|
throw error;
|
|
483
486
|
}).finally(() => {
|
|
484
|
-
if (this.inflight.get(key) === promise) {
|
|
487
|
+
if (this.inflight.get(key)?.promise === promise) {
|
|
485
488
|
this.inflight.delete(key);
|
|
486
489
|
}
|
|
487
490
|
});
|
|
488
|
-
this.inflight.set(key, promise);
|
|
491
|
+
this.inflight.set(key, { promise, tags, startVersion });
|
|
489
492
|
return promise;
|
|
490
493
|
}
|
|
494
|
+
/** A fill that started before one of its tags was invalidated cannot satisfy later readers. */
|
|
495
|
+
wasInvalidatedSince(tags, version) {
|
|
496
|
+
for (const tag of tags) {
|
|
497
|
+
const invalidatedVersion = this.invalidatedTagVersions.get(tag);
|
|
498
|
+
if (invalidatedVersion !== void 0 && invalidatedVersion > version) return true;
|
|
499
|
+
}
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
491
502
|
async fillCacheEntry(key, producer, options, tags, generation) {
|
|
492
503
|
const adapter = this.adapter;
|
|
493
504
|
const namespace = this.namespace;
|
|
@@ -528,7 +539,7 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
528
539
|
return value;
|
|
529
540
|
} finally {
|
|
530
541
|
this.activeGenerations.delete(activeGeneration);
|
|
531
|
-
this.pruneInvalidatedTagVersions();
|
|
542
|
+
this.pruneInvalidatedTagVersions(activeGeneration.tags);
|
|
532
543
|
if (leaseToken && adapter?.releaseLease) {
|
|
533
544
|
try {
|
|
534
545
|
await adapter.releaseLease(leaseKey, leaseToken);
|
|
@@ -573,18 +584,9 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
573
584
|
}
|
|
574
585
|
return void 0;
|
|
575
586
|
}
|
|
576
|
-
countEntriesForTag(tag) {
|
|
577
|
-
let count = 0;
|
|
578
|
-
for (const entry of this.entries.values()) {
|
|
579
|
-
if (entry.tags.has(tag)) {
|
|
580
|
-
count++;
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
return count;
|
|
584
|
-
}
|
|
585
587
|
countEntriesForTags(tags) {
|
|
586
588
|
let count = 0;
|
|
587
|
-
for (const entry of this.
|
|
589
|
+
for (const entry of this.entriesByTag.get(tags[0]) ?? []) {
|
|
588
590
|
if (tags.every((tag) => entry.tags.has(tag))) {
|
|
589
591
|
count++;
|
|
590
592
|
}
|
|
@@ -592,10 +594,10 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
592
594
|
return count;
|
|
593
595
|
}
|
|
594
596
|
invalidateTag(normalizedTag) {
|
|
595
|
-
const count = this.
|
|
597
|
+
const count = this.entriesByTag.get(normalizedTag)?.size ?? 0;
|
|
596
598
|
this.invalidatedTagVersions.delete(normalizedTag);
|
|
597
599
|
this.invalidatedTagVersions.set(normalizedTag, ++this.version);
|
|
598
|
-
this.pruneInvalidatedTagVersions();
|
|
600
|
+
this.pruneInvalidatedTagVersions([normalizedTag]);
|
|
599
601
|
return count;
|
|
600
602
|
}
|
|
601
603
|
toPublicEntry(entry) {
|
|
@@ -625,19 +627,51 @@ var _FarmDataCache = class _FarmDataCache {
|
|
|
625
627
|
this.entries.set(key, entry);
|
|
626
628
|
}
|
|
627
629
|
storeLocalEntry(entry) {
|
|
628
|
-
|
|
630
|
+
const removed = [];
|
|
631
|
+
const replaced = this.detachLocalEntry(entry.key);
|
|
632
|
+
if (replaced) removed.push(replaced);
|
|
629
633
|
this.entries.set(entry.key, entry);
|
|
634
|
+
for (const tag of entry.tags) {
|
|
635
|
+
let tagged = this.entriesByTag.get(tag);
|
|
636
|
+
if (!tagged) this.entriesByTag.set(tag, tagged = /* @__PURE__ */ new Set());
|
|
637
|
+
tagged.add(entry);
|
|
638
|
+
}
|
|
630
639
|
while (this.entries.size > this.maxEntries) {
|
|
631
640
|
const oldestKey = this.entries.keys().next().value;
|
|
632
641
|
if (oldestKey === void 0) break;
|
|
633
|
-
this.
|
|
642
|
+
removed.push(this.detachLocalEntry(oldestKey));
|
|
634
643
|
}
|
|
635
|
-
this.pruneInvalidatedTagVersions();
|
|
644
|
+
for (const removedEntry of removed) this.pruneInvalidatedTagVersions(removedEntry.tags);
|
|
645
|
+
}
|
|
646
|
+
deleteLocalEntry(key) {
|
|
647
|
+
const entry = this.detachLocalEntry(key);
|
|
648
|
+
if (!entry) return false;
|
|
649
|
+
this.pruneInvalidatedTagVersions(entry.tags);
|
|
650
|
+
return true;
|
|
651
|
+
}
|
|
652
|
+
detachLocalEntry(key) {
|
|
653
|
+
const entry = this.entries.get(key);
|
|
654
|
+
if (!entry) return void 0;
|
|
655
|
+
this.entries.delete(key);
|
|
656
|
+
for (const tag of entry.tags) {
|
|
657
|
+
const tagged = this.entriesByTag.get(tag);
|
|
658
|
+
if (!tagged) continue;
|
|
659
|
+
tagged.delete(entry);
|
|
660
|
+
if (tagged.size === 0) this.entriesByTag.delete(tag);
|
|
661
|
+
}
|
|
662
|
+
return entry;
|
|
636
663
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
664
|
+
/**
|
|
665
|
+
* Drop invalidation versions that no local entry or active fill can be stale against.
|
|
666
|
+
* Callers pass only the tags whose dependents just changed, so the cost is bounded by
|
|
667
|
+
* the entries sharing those tags rather than by the whole cache.
|
|
668
|
+
*/
|
|
669
|
+
pruneInvalidatedTagVersions(tags) {
|
|
670
|
+
tags: for (const tag of tags) {
|
|
671
|
+
const invalidatedVersion = this.invalidatedTagVersions.get(tag);
|
|
672
|
+
if (invalidatedVersion === void 0) continue;
|
|
673
|
+
for (const entry of this.entriesByTag.get(tag) ?? []) {
|
|
674
|
+
if (entry.createdVersion < invalidatedVersion) continue tags;
|
|
641
675
|
}
|
|
642
676
|
for (const generation of this.activeGenerations) {
|
|
643
677
|
if (generation.tags.has(tag) && generation.createdVersion < invalidatedVersion)
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
attachRevalidationListeners,
|
|
3
3
|
createServerQueryCallKey,
|
|
4
4
|
fetchServerQuery
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UUYF3CHN.mjs";
|
|
6
6
|
import {
|
|
7
7
|
getFarmClientDataCache
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5SPPCN5J.mjs";
|
|
9
9
|
import {
|
|
10
10
|
__name
|
|
11
11
|
} from "./chunk-LPEX4YW6.mjs";
|