@farm.js/core 0.1.31 → 0.1.35
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 +1 -1
- package/dist/agent-runtime.cjs +70 -15
- package/dist/agent-runtime.d.mts +4 -5
- package/dist/agent-runtime.d.ts +4 -5
- package/dist/agent-runtime.mjs +59 -4
- package/dist/api/route-manager.cjs +17 -14
- package/dist/api/route-manager.d.mts +6 -7
- package/dist/api/route-manager.d.ts +6 -7
- package/dist/api/route-manager.mjs +16 -13
- package/dist/api/runtime.cjs +12 -8
- package/dist/api/runtime.d.mts +4 -5
- package/dist/api/runtime.d.ts +4 -5
- package/dist/api/runtime.mjs +12 -8
- package/dist/api.cjs +20 -17
- package/dist/api.d.mts +7 -8
- package/dist/api.d.ts +7 -8
- package/dist/api.mjs +19 -16
- package/dist/{app-sUJ3jnTZ.d.ts → app-BXB3JZYc.d.ts} +38 -12
- package/dist/{app-DAuUTIZf.d.mts → app-D_j9AAVL.d.mts} +38 -12
- package/dist/app-markdown.cjs +8 -6
- package/dist/app-markdown.d.mts +6 -7
- package/dist/app-markdown.d.ts +6 -7
- package/dist/app-markdown.mjs +7 -5
- package/dist/cache.cjs +2 -2
- package/dist/cache.d.mts +10 -1
- package/dist/cache.d.ts +10 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-BXFWA23T.mjs → chunk-22LTEMGQ.mjs} +3 -3
- package/dist/{chunk-YZTASLPQ.cjs → chunk-27ZWSI3W.cjs} +2 -2
- package/dist/{chunk-WBIH66JK.mjs → chunk-2ELDTQRN.mjs} +5 -2
- package/dist/{chunk-K7CELQLK.cjs → chunk-2F2ER724.cjs} +54 -29
- package/dist/{chunk-O3DTUAX2.mjs → chunk-2G2NNLE2.mjs} +6 -77
- package/dist/{chunk-NRVGEI5I.mjs → chunk-2NNMOPDN.mjs} +4 -210
- package/dist/{chunk-CTV2TTNP.cjs → chunk-3BHT4WMP.cjs} +16 -87
- package/dist/chunk-3BU22U3M.cjs +237 -0
- package/dist/{chunk-MM5D6VLP.mjs → chunk-3KZS4SUS.mjs} +33 -14
- package/dist/{chunk-VA62MHFV.mjs → chunk-3PXS2MHU.mjs} +1 -1
- package/dist/chunk-3SDFA7UF.cjs +701 -0
- package/dist/{chunk-4IEPYMHF.mjs → chunk-3UEVPCGW.mjs} +1 -1
- package/dist/{chunk-MXDTKXO6.cjs → chunk-3UH7MRCP.cjs} +73 -26
- package/dist/{chunk-7QOCTYBS.mjs → chunk-4JHOT46A.mjs} +37 -1
- package/dist/{chunk-6L6DQR5W.mjs → chunk-4KU5Q7C2.mjs} +917 -305
- package/dist/{chunk-3FCFQP5V.cjs → chunk-4MMGO7YW.cjs} +25 -25
- package/dist/{chunk-5HGR3W6O.mjs → chunk-5SJWVY6R.mjs} +8 -0
- package/dist/{chunk-KZLND3D2.cjs → chunk-62XKI4Z3.cjs} +7 -5
- package/dist/{chunk-FJZ3DQLK.mjs → chunk-6DU6UFUE.mjs} +13 -12
- package/dist/{chunk-TEN4FIZU.mjs → chunk-6ETPZTJI.mjs} +513 -3
- package/dist/{chunk-VUMAE7NC.mjs → chunk-6TJOML4E.mjs} +92 -31
- package/dist/{chunk-3ATMYLLJ.mjs → chunk-6WCPV6G2.mjs} +1 -1
- package/dist/{chunk-FYRBX5IY.cjs → chunk-73MC7ZL6.cjs} +2 -2
- package/dist/chunk-75RZHGLS.cjs +135 -0
- package/dist/{chunk-QZRVZSPN.cjs → chunk-77GNHH2Z.cjs} +3 -3
- package/dist/{chunk-FXUUWYAX.cjs → chunk-7GLPRTTF.cjs} +12 -2
- package/dist/{chunk-A777V5WU.cjs → chunk-7L5V3KQO.cjs} +2 -2
- package/dist/{chunk-4ZQQL4IU.mjs → chunk-AHGECQEW.mjs} +1 -1
- package/dist/{chunk-RG3ZOTG5.cjs → chunk-AI7QMY7O.cjs} +10 -3
- package/dist/{chunk-YMCXWPWK.mjs → chunk-BCMSYSN2.mjs} +4 -1
- package/dist/{chunk-I6XDAKWQ.mjs → chunk-BTHHUD7Q.mjs} +14 -0
- package/dist/{chunk-LI2LMOLR.mjs → chunk-C35ZBVRD.mjs} +12 -3
- package/dist/chunk-C4SPBWFM.cjs +26 -0
- package/dist/{chunk-YQVSHTMR.mjs → chunk-CP6X4AEU.mjs} +1 -1
- package/dist/{chunk-QZCT2CQ4.mjs → chunk-CXEN47J3.mjs} +64 -2
- package/dist/{chunk-WNLBF77X.cjs → chunk-D227TIEN.cjs} +28 -16
- package/dist/{chunk-ROUTX2E5.cjs → chunk-DBNKI4NF.cjs} +12 -3
- package/dist/{chunk-J3LOGE4T.cjs → chunk-DQQOKWYA.cjs} +5 -5
- package/dist/chunk-E5GNDG5F.mjs +701 -0
- package/dist/{chunk-X7KZBF63.cjs → chunk-EFCQPQMG.cjs} +40 -4
- package/dist/{chunk-K3F2E6GS.cjs → chunk-EJQT6KZN.cjs} +2 -2
- package/dist/{chunk-3LUF2PE2.cjs → chunk-EK4QAEFZ.cjs} +67 -5
- package/dist/{chunk-VVBO3QH7.mjs → chunk-ENLZ4R3Y.mjs} +10 -1
- package/dist/{chunk-KJ2TIHZZ.cjs → chunk-EUV4YR3V.cjs} +3 -2
- package/dist/{chunk-E76XC6ZG.mjs → chunk-EZDQRNQ7.mjs} +2 -2
- package/dist/{chunk-TOVMYGYW.mjs → chunk-F2SE2VDO.mjs} +1 -1
- package/dist/{chunk-MNUGPHLN.mjs → chunk-F6Z3Y5KL.mjs} +5 -3
- package/dist/{chunk-DFLLARUK.cjs → chunk-F7JZENPF.cjs} +35 -34
- package/dist/{chunk-BSPQVJ4A.mjs → chunk-FDR64H6B.mjs} +13 -0
- package/dist/{chunk-5OVTOKGH.cjs → chunk-FFFW3OQ7.cjs} +2 -2
- package/dist/{chunk-D4JE5NNV.cjs → chunk-FNO7A7CM.cjs} +5 -5
- package/dist/{chunk-Z5HIWVDP.cjs → chunk-FTFYRMQQ.cjs} +80 -91
- package/dist/chunk-FZ6YYU2W.mjs +65 -0
- package/dist/{chunk-X7WVQMIB.mjs → chunk-G5RT7EXW.mjs} +11 -5
- package/dist/{chunk-IXUY2F5U.mjs → chunk-GCXWJJKH.mjs} +4 -7
- package/dist/{chunk-ES4B2IXW.cjs → chunk-GFHLGIYC.cjs} +8 -8
- package/dist/{chunk-SORB3MAR.cjs → chunk-GQ3Z3IZI.cjs} +17 -17
- package/dist/{chunk-75WGQVQA.cjs → chunk-HITLGIAO.cjs} +10 -1
- package/dist/{chunk-HBTUGXHS.cjs → chunk-HLJ6MBUZ.cjs} +7 -4
- package/dist/{chunk-JLCQGPXE.mjs → chunk-HMIJDL7S.mjs} +51 -62
- package/dist/{chunk-F6XEGFHO.mjs → chunk-HUMR6LSU.mjs} +11 -1
- package/dist/{chunk-IMB4PIAR.cjs → chunk-ICUQICNC.cjs} +1441 -828
- package/dist/{chunk-ZCU4NZ3M.cjs → chunk-IE7XCHH3.cjs} +4 -4
- package/dist/{chunk-I26CZYPV.cjs → chunk-IHNIDL6H.cjs} +50 -7
- package/dist/{chunk-2FQHH5SC.mjs → chunk-IHNMMXHV.mjs} +49 -24
- package/dist/{chunk-YVGAEAA5.cjs → chunk-IPXLADVO.cjs} +522 -12
- package/dist/{chunk-VHJGDMCG.cjs → chunk-IWZKTWHZ.cjs} +2 -2
- package/dist/chunk-JG6DJF5A.mjs +238 -0
- package/dist/{chunk-KROWKCUH.cjs → chunk-JGLC4TO3.cjs} +8 -1
- package/dist/{chunk-5TISYEQF.mjs → chunk-JM5XPKWH.mjs} +10 -3
- package/dist/{chunk-BJJATPEC.mjs → chunk-KN7K4VQN.mjs} +1 -1
- package/dist/{chunk-WPYFSQKK.cjs → chunk-KNBBQHO2.cjs} +15 -1
- package/dist/{chunk-XWAWFQFS.cjs → chunk-KXWRO25S.cjs} +7 -4
- package/dist/chunk-LSKZMJMP.cjs +65 -0
- package/dist/{chunk-2N5PX3LS.mjs → chunk-LYV44OIR.mjs} +7 -1
- package/dist/chunk-M7MKQXAF.cjs +87 -0
- package/dist/{chunk-IV6CQY7O.mjs → chunk-MSSFIQGM.mjs} +63 -13
- package/dist/{chunk-KH7BN726.cjs → chunk-N4UOK6ZI.cjs} +8 -2
- package/dist/{chunk-JNGIWIY6.mjs → chunk-NPC7VWJE.mjs} +2 -2
- package/dist/chunk-NRDBW4MP.mjs +45 -0
- package/dist/{chunk-ILWLPEVO.mjs → chunk-NRSN7G7E.mjs} +2 -2
- package/dist/chunk-OFZUJMCU.mjs +601 -0
- package/dist/{chunk-L4DVIHOC.mjs → chunk-OKZUAXHF.mjs} +1 -1
- package/dist/{chunk-EM6SBQKM.cjs → chunk-OMVAU7NT.cjs} +27 -2
- package/dist/{chunk-AHAJGAYD.mjs → chunk-PDOCJ6RY.mjs} +2 -2
- package/dist/{chunk-IFI5FXEZ.cjs → chunk-PFQKNERH.cjs} +562 -251
- package/dist/{chunk-S5GDHOE4.mjs → chunk-PZNL3WEG.mjs} +48 -5
- package/dist/{chunk-GZYH4OER.mjs → chunk-Q3VLETLE.mjs} +2 -2
- package/dist/{chunk-WG2KHOMN.mjs → chunk-QAU5JD57.mjs} +571 -260
- package/dist/{chunk-FV45CKBC.mjs → chunk-QCFBDFRS.mjs} +1 -1
- package/dist/{chunk-75BRBIFP.cjs → chunk-QCVE2OCI.cjs} +5 -8
- package/dist/{chunk-6ZCMSZ5U.mjs → chunk-QE6VAKLT.mjs} +1 -1
- package/dist/{chunk-QG5HNS7P.mjs → chunk-QORUJDIV.mjs} +2 -2
- package/dist/chunk-RHAZ22ZN.mjs +87 -0
- package/dist/{chunk-CUMINO7Z.cjs → chunk-RU3M2FIK.cjs} +18 -14
- package/dist/{chunk-DGXN3L4D.mjs → chunk-SAZVVAJH.mjs} +5 -5
- package/dist/{chunk-MKMBQSNQ.mjs → chunk-SC2WYWPF.mjs} +3 -3
- package/dist/{chunk-QCFFHV5H.mjs → chunk-SMHH4VDG.mjs} +1 -1
- package/dist/{chunk-UAFSBWNT.mjs → chunk-SOMHP6GF.mjs} +63 -16
- package/dist/{chunk-ND224OE2.cjs → chunk-TKSCR644.cjs} +34 -15
- package/dist/{chunk-4V7GIE2U.mjs → chunk-UAORZ7QA.mjs} +3 -3
- package/dist/{chunk-IQXFRNY2.cjs → chunk-UFDAAQFX.cjs} +2 -2
- package/dist/{chunk-6VYZOPOT.mjs → chunk-UJD4PHYB.mjs} +15 -11
- package/dist/{chunk-ZHVYQL3H.cjs → chunk-ULAWS2PA.cjs} +97 -36
- package/dist/{chunk-5ZSWG4UX.cjs → chunk-UXFQ3UDA.cjs} +14 -1
- package/dist/{chunk-MPEYMSCF.cjs → chunk-VFQT3LAO.cjs} +5 -5
- package/dist/{chunk-2FXWWUE5.cjs → chunk-VZJR7UTG.cjs} +6 -6
- package/dist/{chunk-2AKFKCHA.mjs → chunk-W7LF2J2S.mjs} +1 -1
- package/dist/chunk-WWFTAUFG.cjs +45 -0
- package/dist/{chunk-JBC2FKRW.mjs → chunk-WWIKMBRN.mjs} +2 -1
- package/dist/{chunk-75DYEVXI.cjs → chunk-X6W5FFH6.cjs} +11 -11
- package/dist/{chunk-EXLKRR4U.cjs → chunk-XBML5KMG.cjs} +12 -12
- package/dist/{chunk-PZNCMPJF.cjs → chunk-XCACDAZZ.cjs} +18 -12
- package/dist/{chunk-JATSG2ZO.mjs → chunk-XCMCS4DA.mjs} +15 -3
- package/dist/{chunk-UJ2C4ICS.cjs → chunk-XJXBIP67.cjs} +4 -4
- package/dist/{chunk-XF7Q24PF.mjs → chunk-Y7RKTKYI.mjs} +25 -0
- package/dist/{chunk-VYZSOYR4.cjs → chunk-YC6V7PWE.cjs} +1 -1
- package/dist/{chunk-F6OHXPWR.mjs → chunk-YFILVET3.mjs} +8 -1
- package/dist/{chunk-JLRDISQL.cjs → chunk-YKX5BK66.cjs} +7 -7
- package/dist/{chunk-DYEJQTDN.cjs → chunk-YSCV4SJF.cjs} +4 -4
- package/dist/chunk-YSLWRWWP.cjs +601 -0
- package/dist/{chunk-5LJCOSKT.mjs → chunk-YULD7ICZ.mjs} +1 -1
- package/dist/{chunk-2SDO73HK.cjs → chunk-YWN746US.cjs} +64 -14
- package/dist/chunk-Z2HLU4IX.cjs +238 -0
- package/dist/chunk-ZLAT2CWY.mjs +135 -0
- package/dist/{chunk-T5CERMEH.cjs → chunk-ZXGAFZDO.cjs} +2 -2
- package/dist/{client-plugins-BX2ptm4H.d.mts → client-plugins-CvIslxWi.d.mts} +232 -8
- package/dist/{client-plugins-BmxM5KW_.d.ts → client-plugins-HIyulDym.d.ts} +232 -8
- package/dist/client-plugins.d.mts +4 -5
- package/dist/client-plugins.d.ts +4 -5
- package/dist/client.cjs +10 -10
- package/dist/client.d.mts +8 -9
- package/dist/client.d.ts +8 -9
- package/dist/client.mjs +9 -9
- package/dist/config.d.mts +4 -5
- package/dist/config.d.ts +4 -5
- package/dist/{devtools-EWRDHCD5.cjs → devtools-EAUY43BS.cjs} +14 -12
- package/dist/{devtools-BPBCYOU6.mjs → devtools-EE5RIBTH.mjs} +13 -11
- package/dist/docs.cjs +17 -15
- package/dist/docs.d.mts +46 -4
- package/dist/docs.d.ts +46 -4
- package/dist/docs.mjs +16 -14
- package/dist/environment/vite.cjs +2 -2
- package/dist/environment/vite.mjs +1 -1
- package/dist/headers.cjs +4 -4
- package/dist/headers.mjs +3 -3
- package/dist/i18n/client.cjs +14 -13
- package/dist/i18n/client.d.mts +2 -2
- package/dist/i18n/client.d.ts +2 -2
- package/dist/i18n/client.mjs +5 -4
- package/dist/i18n/index.cjs +3 -2
- package/dist/i18n/index.d.mts +3 -3
- package/dist/i18n/index.d.ts +3 -3
- package/dist/i18n/index.mjs +2 -1
- package/dist/i18n/server.cjs +6 -5
- package/dist/i18n/server.d.mts +5 -5
- package/dist/i18n/server.d.ts +5 -5
- package/dist/i18n/server.mjs +5 -4
- package/dist/image/server.cjs +3 -3
- package/dist/image/server.mjs +2 -2
- package/dist/image/sharp.cjs +10 -10
- package/dist/image/sharp.mjs +2 -2
- package/dist/{index-a-8Z5kZU.d.mts → index-BJJfLxJo.d.mts} +2 -2
- package/dist/{index-BWVfxIsO.d.ts → index-CwoOP-MW.d.ts} +2 -2
- package/dist/index.cjs +75 -60
- package/dist/index.d.mts +21 -22
- package/dist/index.d.ts +21 -22
- package/dist/index.mjs +79 -64
- package/dist/integrations.cjs +7 -4
- package/dist/integrations.d.mts +4 -5
- package/dist/integrations.d.ts +4 -5
- package/dist/integrations.mjs +8 -5
- package/dist/internal/app-markdown-runtime.cjs +7 -5
- package/dist/internal/app-markdown-runtime.d.mts +17 -7
- package/dist/internal/app-markdown-runtime.d.ts +17 -7
- package/dist/internal/app-markdown-runtime.mjs +6 -4
- package/dist/internal/build-runtime.cjs +44 -41
- package/dist/internal/build-runtime.d.mts +6 -7
- package/dist/internal/build-runtime.d.ts +6 -7
- package/dist/internal/build-runtime.mjs +43 -40
- package/dist/internal/cli-runtime.cjs +23 -20
- package/dist/internal/cli-runtime.mjs +22 -19
- package/dist/internal/client-error-overlay.cjs +6 -6
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +5 -3
- package/dist/internal/client-runtime.d.mts +9 -1
- package/dist/internal/client-runtime.d.ts +9 -1
- package/dist/internal/client-runtime.mjs +4 -2
- package/dist/internal/compression-runtime.d.mts +4 -5
- package/dist/internal/compression-runtime.d.ts +4 -5
- package/dist/internal/config-runtime.cjs +14 -12
- package/dist/internal/config-runtime.d.mts +5 -6
- package/dist/internal/config-runtime.d.ts +5 -6
- package/dist/internal/config-runtime.mjs +13 -11
- package/dist/internal/infra-analytics-runtime.cjs +4 -4
- package/dist/internal/infra-analytics-runtime.mjs +2 -2
- package/dist/internal/isolated-boundary.cjs +3 -2
- package/dist/internal/isolated-boundary.d.mts +1 -0
- package/dist/internal/isolated-boundary.d.ts +1 -0
- package/dist/internal/isolated-boundary.mjs +2 -1
- package/dist/internal/metadata-image-runtime.cjs +3 -3
- package/dist/internal/metadata-image-runtime.mjs +2 -2
- package/dist/internal/product-telemetry-runtime.cjs +2 -2
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/internal/production-runtime.cjs +61 -31
- package/dist/internal/production-runtime.d.mts +165 -18
- package/dist/internal/production-runtime.d.ts +165 -18
- package/dist/internal/production-runtime.mjs +57 -27
- package/dist/internal/request-cookies.cjs +4 -2
- package/dist/internal/request-cookies.d.mts +9 -1
- package/dist/internal/request-cookies.d.ts +9 -1
- package/dist/internal/request-cookies.mjs +3 -1
- package/dist/internal/server-tree.cjs +12 -0
- package/dist/internal/server-tree.d.mts +27 -0
- package/dist/internal/server-tree.d.ts +27 -0
- package/dist/internal/server-tree.mjs +12 -0
- package/dist/markdown.cjs +4 -4
- package/dist/markdown.d.mts +4 -5
- package/dist/markdown.d.ts +4 -5
- package/dist/markdown.mjs +3 -3
- package/dist/{metadata-DsEaK7mQ.d.mts → metadata-BnLDsUOS.d.ts} +16 -2
- package/dist/{metadata-fwZ3gfG6.d.ts → metadata-WGpBYcGn.d.mts} +16 -2
- package/dist/middleware.cjs +18 -8
- package/dist/middleware.d.mts +27 -9
- package/dist/middleware.d.ts +27 -9
- package/dist/middleware.mjs +18 -8
- package/dist/navigation.cjs +7 -7
- package/dist/navigation.d.mts +7 -8
- package/dist/navigation.d.ts +7 -8
- package/dist/navigation.mjs +6 -6
- package/dist/{nitro-NAKCRVHX.mjs → nitro-MXRDCXWZ.mjs} +5 -5
- package/dist/{nitro-VYDZGYFY.cjs → nitro-OVPLKPE2.cjs} +7 -7
- package/dist/{observability-BupkiN0m.d.mts → observability-CoXunYhS.d.mts} +4 -3
- package/dist/{observability-BupkiN0m.d.ts → observability-CoXunYhS.d.ts} +4 -3
- package/dist/observability.d.mts +1 -1
- package/dist/observability.d.ts +1 -1
- package/dist/plugin.cjs +39 -36
- package/dist/plugin.d.mts +4 -5
- package/dist/plugin.d.ts +4 -5
- package/dist/plugin.mjs +38 -35
- package/dist/{production-runtime-Baqgwtvc.d.mts → production-runtime-0sRnuYc-.d.mts} +11 -4
- package/dist/{production-runtime-DNkpFnmg.d.ts → production-runtime-Crq6CJ-2.d.ts} +11 -4
- package/dist/query/client.cjs +8 -8
- package/dist/query/client.mjs +4 -4
- package/dist/{render-plan-rkIK9wd9.d.ts → render-plan-8ozZh2Qv.d.ts} +1 -1
- package/dist/{render-plan-DhwQnmmX.d.mts → render-plan-gs9GGPzw.d.mts} +1 -1
- package/dist/renderer/react/server.cjs +10 -4
- package/dist/renderer/react/server.d.mts +2 -1
- package/dist/renderer/react/server.d.ts +2 -1
- package/dist/renderer/react/server.mjs +7 -1
- package/dist/renderer-client.cjs +40 -20
- package/dist/renderer-client.d.mts +6 -7
- package/dist/renderer-client.d.ts +6 -7
- package/dist/renderer-client.mjs +29 -9
- package/dist/renderer.d.mts +2 -0
- package/dist/renderer.d.ts +2 -0
- package/dist/{request-BcY4RYPC.d.ts → request-B5G8rLBH.d.ts} +7 -2
- package/dist/{request-CFy1BltJ.d.mts → request-fkhiynXe.d.mts} +7 -2
- package/dist/request.cjs +2 -2
- package/dist/request.d.mts +5 -6
- package/dist/request.d.ts +5 -6
- package/dist/request.mjs +1 -1
- package/dist/{resolver-PPEeiJ6M.d.ts → resolver-DadfRL6F.d.ts} +1 -1
- package/dist/{resolver-DhW0CqZN.d.mts → resolver-khasx3fU.d.mts} +1 -1
- package/dist/{route-rendering-BkS0TBlB.d.mts → route-rendering-CLnS7AZj.d.mts} +1 -1
- package/dist/{route-rendering-D4XpMjam.d.ts → route-rendering-lS5nUMua.d.ts} +1 -1
- package/dist/{router-Cq7BcZxg.d.ts → router-4iuiYnOW.d.ts} +1 -1
- package/dist/{router-C4zPlC3V.d.mts → router-ifU8Dui1.d.mts} +1 -1
- package/dist/routes.cjs +3 -3
- package/dist/routes.d.mts +4 -5
- package/dist/routes.d.ts +4 -5
- package/dist/routes.mjs +2 -2
- package/dist/{runtime-BirxPwbZ.d.ts → runtime-BgDQzBiu.d.ts} +2 -2
- package/dist/{runtime-AOJge4vQ.d.mts → runtime-CV2UCV-5.d.mts} +2 -2
- package/dist/server-action-security.cjs +3 -3
- package/dist/server-action-security.mjs +2 -2
- package/dist/server-fn.cjs +5 -5
- package/dist/server-fn.mjs +4 -4
- package/dist/server-plugins.cjs +4 -4
- package/dist/server-plugins.d.mts +5 -6
- package/dist/server-plugins.d.ts +5 -6
- package/dist/server-plugins.mjs +3 -3
- package/dist/server-query-client.cjs +3 -3
- package/dist/server-query-client.mjs +2 -2
- package/dist/server-query.cjs +6 -6
- package/dist/server-query.mjs +5 -5
- package/dist/server.cjs +66 -63
- package/dist/server.d.mts +13 -14
- package/dist/server.d.ts +13 -14
- package/dist/server.mjs +43 -40
- package/dist/{spa-router-DzPZH-AO.d.mts → spa-router-Bq7VCOwx.d.mts} +3 -3
- package/dist/{spa-router-B1HI3X9k.d.ts → spa-router-DaJk5Re4.d.ts} +3 -3
- package/dist/testing.cjs +22 -20
- package/dist/testing.d.mts +4 -5
- package/dist/testing.d.ts +4 -5
- package/dist/testing.mjs +18 -16
- package/dist/theme/server.cjs +4 -3
- package/dist/theme/server.mjs +3 -2
- package/dist/{types-Z0aotQ8w.d.mts → types-CnH8DOqo.d.mts} +1 -1
- package/dist/{types-Z0aotQ8w.d.ts → types-CnH8DOqo.d.ts} +1 -1
- package/dist/{utils-DMD1Hzta.d.ts → utils-BXLmFsVR.d.ts} +1 -1
- package/dist/{utils-CEBktlBG.d.mts → utils-XJn0c9bj.d.mts} +1 -1
- package/dist/version.cjs +2 -2
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +39 -36
- package/dist/vite.d.mts +4 -5
- package/dist/vite.d.ts +4 -5
- package/dist/vite.mjs +38 -35
- package/dist/{workflows-CR9ex-gz.d.ts → workflows-jZ4BcdoZ.d.mts} +1 -1
- package/dist/{workflows-CR9ex-gz.d.mts → workflows-jZ4BcdoZ.d.ts} +1 -1
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.d.mts +1 -1
- package/dist/workflows.d.ts +1 -1
- package/dist/workflows.mjs +2 -2
- package/package.json +10 -2
- package/dist/chunk-22GUSVNJ.cjs +0 -351
- package/dist/chunk-5MKEDGLD.cjs +0 -53
- package/dist/chunk-O6XNAMBV.mjs +0 -53
- package/dist/chunk-SWN467MP.cjs +0 -18
- package/dist/chunk-XGC343EY.cjs +0 -443
- package/dist/chunk-ZSH2Y4LN.mjs +0 -351
- package/dist/types-DFbjpjXX.d.mts +0 -105
- package/dist/types-DFbjpjXX.d.ts +0 -105
- /package/dist/{chunk-SUIBNSNO.cjs → chunk-SJNMVDDF.cjs} +0 -0
- /package/dist/{chunk-LNZ7JZUS.mjs → chunk-UDNPLXW7.mjs} +0 -0
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } 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
2
|
|
|
3
|
+
var _chunkG643DQCHcjs = require('./chunk-G643DQCH.cjs');
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _chunkG643DQCHcjs = require('./chunk-G643DQCH.cjs');
|
|
7
|
+
var _chunkZ2HLU4IXcjs = require('./chunk-Z2HLU4IX.cjs');
|
|
10
8
|
|
|
11
9
|
|
|
12
10
|
|
|
@@ -18,7 +16,7 @@ var _chunkG643DQCHcjs = require('./chunk-G643DQCH.cjs');
|
|
|
18
16
|
|
|
19
17
|
|
|
20
18
|
|
|
21
|
-
var
|
|
19
|
+
var _chunkOMVAU7NTcjs = require('./chunk-OMVAU7NT.cjs');
|
|
22
20
|
|
|
23
21
|
|
|
24
22
|
|
|
@@ -36,6 +34,12 @@ var _chunkDVM4FKZLcjs = require('./chunk-DVM4FKZL.cjs');
|
|
|
36
34
|
var _chunkUS2QVW3Ecjs = require('./chunk-US2QVW3E.cjs');
|
|
37
35
|
|
|
38
36
|
|
|
37
|
+
var _chunkBIDYX3SLcjs = require('./chunk-BIDYX3SL.cjs');
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
var _chunkI57LW5VZcjs = require('./chunk-I57LW5VZ.cjs');
|
|
41
|
+
|
|
42
|
+
|
|
39
43
|
|
|
40
44
|
|
|
41
45
|
|
|
@@ -44,56 +48,6 @@ var _chunkNO3WWW3Ncjs = require('./chunk-NO3WWW3N.cjs');
|
|
|
44
48
|
|
|
45
49
|
var _chunkS3JO3N4Hcjs = require('./chunk-S3JO3N4H.cjs');
|
|
46
50
|
|
|
47
|
-
// src/integration-request-security.ts
|
|
48
|
-
function resolveIntegrationAllowedOrigins(values, label) {
|
|
49
|
-
return Object.freeze((_nullishCoalesce(values, () => ( []))).map((value) => _chunkSVRTJOUFcjs.normalizeAllowedOriginPattern.call(void 0, value, label)));
|
|
50
|
-
}
|
|
51
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveIntegrationAllowedOrigins, "resolveIntegrationAllowedOrigins");
|
|
52
|
-
function validateIntegrationRequestOrigin(request, policy = {}) {
|
|
53
|
-
const allowedOrigins = _nullishCoalesce(policy.allowedOrigins, () => ( []));
|
|
54
|
-
const requireOriginMetadata = _nullishCoalesce(policy.requireOriginMetadata, () => ( true));
|
|
55
|
-
const fetchSite = _optionalChain([request, 'access', _ => _.headers, 'access', _2 => _2.get, 'call', _3 => _3("sec-fetch-site"), 'optionalAccess', _4 => _4.trim, 'call', _5 => _5(), 'access', _6 => _6.toLowerCase, 'call', _7 => _7()]);
|
|
56
|
-
const source = _chunkSVRTJOUFcjs.getRequestSourceOrigin.call(void 0, request);
|
|
57
|
-
if (!source.ok) {
|
|
58
|
-
return { ok: false, reason: source.reason };
|
|
59
|
-
}
|
|
60
|
-
if (source.origin === null) {
|
|
61
|
-
if (fetchSite === "same-origin") {
|
|
62
|
-
return { ok: true };
|
|
63
|
-
}
|
|
64
|
-
if (requireOriginMetadata) {
|
|
65
|
-
return { ok: false, reason: fetchSite === "cross-site" ? "cross-site" : "missing-origin" };
|
|
66
|
-
}
|
|
67
|
-
return fetchSite === "cross-site" ? { ok: false, reason: "cross-site" } : { ok: true };
|
|
68
|
-
}
|
|
69
|
-
const requestUrl = new URL(request.url);
|
|
70
|
-
const matchesConfiguredOrigin = allowedOrigins.some(
|
|
71
|
-
(pattern) => _chunkSVRTJOUFcjs.matchesAllowedOrigin.call(void 0, source.origin, pattern)
|
|
72
|
-
);
|
|
73
|
-
const matchesRequest = source.origin === requestUrl.origin || _chunkSVRTJOUFcjs.matchesHostHeader.call(void 0, source.origin, request);
|
|
74
|
-
if (!matchesRequest && !matchesConfiguredOrigin) {
|
|
75
|
-
return { ok: false, reason: "cross-site" };
|
|
76
|
-
}
|
|
77
|
-
if (fetchSite === "cross-site" && !matchesConfiguredOrigin) {
|
|
78
|
-
return { ok: false, reason: "cross-site" };
|
|
79
|
-
}
|
|
80
|
-
return { ok: true };
|
|
81
|
-
}
|
|
82
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, validateIntegrationRequestOrigin, "validateIntegrationRequestOrigin");
|
|
83
|
-
function describeIntegrationOriginRejection(reason) {
|
|
84
|
-
switch (reason) {
|
|
85
|
-
case "missing-origin":
|
|
86
|
-
return "Request is missing same-origin metadata.";
|
|
87
|
-
case "opaque-origin":
|
|
88
|
-
return "Opaque origins are not allowed.";
|
|
89
|
-
case "invalid-origin":
|
|
90
|
-
return "Invalid request origin.";
|
|
91
|
-
case "cross-site":
|
|
92
|
-
return "Cross-site request was rejected.";
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
_chunkS3JO3N4Hcjs.__name.call(void 0, describeIntegrationOriginRejection, "describeIntegrationOriginRejection");
|
|
96
|
-
|
|
97
51
|
// src/plugin-integration-context.ts
|
|
98
52
|
var FARM_PLUGIN_INTEGRATION_CONTEXT = /* @__PURE__ */ Symbol.for("@farm.js/core/plugin-integration-context");
|
|
99
53
|
function setFarmPluginIntegrationContext(plugin, integration) {
|
|
@@ -294,13 +248,13 @@ function defineIntegration(integration) {
|
|
|
294
248
|
integrationRoute: routeFactory
|
|
295
249
|
}) : integration.endpoints;
|
|
296
250
|
const endpointRoutes = flattenIntegrationEndpoints(endpoints);
|
|
297
|
-
const allRoutes = _optionalChain([routes, 'optionalAccess',
|
|
251
|
+
const allRoutes = _optionalChain([routes, 'optionalAccess', _ => _.length]) || endpointRoutes.length ? [...routes || [], ...endpointRoutes] : void 0;
|
|
298
252
|
for (const route of allRoutes || []) {
|
|
299
253
|
_chunkNO3WWW3Ncjs.assertUniqueRouteParameters.call(void 0, route.path, "api");
|
|
300
254
|
_chunkDVM4FKZLcjs.validateConfigRouteSource.call(void 0, route.path, `Integration route "${route.path}"`);
|
|
301
255
|
_chunkNO3WWW3Ncjs.assertTerminalCatchAll.call(void 0, route.path, "api");
|
|
302
256
|
}
|
|
303
|
-
const derivedApi = integration.api || (_optionalChain([allRoutes, 'optionalAccess',
|
|
257
|
+
const derivedApi = integration.api || (_optionalChain([allRoutes, 'optionalAccess', _2 => _2.length]) ? _chunkNZKJGRB3cjs.api.fromRoutes(
|
|
304
258
|
allRoutes
|
|
305
259
|
) : void 0);
|
|
306
260
|
return {
|
|
@@ -402,7 +356,7 @@ function getIntegrationProviders(integrations) {
|
|
|
402
356
|
}
|
|
403
357
|
const providers = [];
|
|
404
358
|
for (const integration of Object.values(integrations)) {
|
|
405
|
-
if (!integration || !isFarmIntegration(integration) || !_optionalChain([integration, 'access',
|
|
359
|
+
if (!integration || !isFarmIntegration(integration) || !_optionalChain([integration, 'access', _3 => _3.providers, 'optionalAccess', _4 => _4.length])) {
|
|
406
360
|
continue;
|
|
407
361
|
}
|
|
408
362
|
for (const provider of integration.providers) {
|
|
@@ -430,7 +384,7 @@ function getIntegrationDocumentNavigationMatchers(integrations) {
|
|
|
430
384
|
}
|
|
431
385
|
const matchers = [];
|
|
432
386
|
for (const integration of Object.values(integrations)) {
|
|
433
|
-
if (!integration || !isFarmIntegration(integration) || !_optionalChain([integration, 'access',
|
|
387
|
+
if (!integration || !isFarmIntegration(integration) || !_optionalChain([integration, 'access', _5 => _5.documentNavigations, 'optionalAccess', _6 => _6.length])) {
|
|
434
388
|
continue;
|
|
435
389
|
}
|
|
436
390
|
for (const navigation of integration.documentNavigations) {
|
|
@@ -603,7 +557,7 @@ async function parseIntegrationConfigSchema(integration, schema, value) {
|
|
|
603
557
|
}
|
|
604
558
|
throw createIntegrationConfigValidationError(integration, result.error);
|
|
605
559
|
}
|
|
606
|
-
if (_optionalChain([schema, 'access',
|
|
560
|
+
if (_optionalChain([schema, 'access', _7 => _7["~standard"], 'optionalAccess', _8 => _8.validate])) {
|
|
607
561
|
const result = await schema["~standard"].validate(value);
|
|
608
562
|
if ("value" in result) {
|
|
609
563
|
return result.value;
|
|
@@ -654,7 +608,7 @@ async function resolveIntegrationConfig(integration, context) {
|
|
|
654
608
|
value,
|
|
655
609
|
await resolveIntegrationConfigPart(config.input, context)
|
|
656
610
|
);
|
|
657
|
-
value = mergeIntegrationConfigValue(value, await _optionalChain([config, 'access',
|
|
611
|
+
value = mergeIntegrationConfigValue(value, await _optionalChain([config, 'access', _9 => _9.resolve, 'optionalCall', _10 => _10(context)]));
|
|
658
612
|
return config.schema ? parseIntegrationConfigSchema(integration, config.schema, value) : value;
|
|
659
613
|
}
|
|
660
614
|
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveIntegrationConfig, "resolveIntegrationConfig");
|
|
@@ -692,7 +646,7 @@ function createIntegrationLifecycleLogger(integration, phase) {
|
|
|
692
646
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createIntegrationLifecycleLogger, "createIntegrationLifecycleLogger");
|
|
693
647
|
async function emitIntegrationLog(integration, event) {
|
|
694
648
|
try {
|
|
695
|
-
await _optionalChain([integration, 'access',
|
|
649
|
+
await _optionalChain([integration, 'access', _11 => _11.log, 'optionalCall', _12 => _12(event)]);
|
|
696
650
|
} catch (e) {
|
|
697
651
|
}
|
|
698
652
|
}
|
|
@@ -885,9 +839,9 @@ function createIntegrationPlugin(integrationKey, integration) {
|
|
|
885
839
|
if (!bodyLoaded) {
|
|
886
840
|
bodyLoaded = true;
|
|
887
841
|
if (req.method && req.method !== "GET" && req.method !== "HEAD") {
|
|
888
|
-
requestBody = await
|
|
842
|
+
requestBody = await _chunkOMVAU7NTcjs.readNodeRequestBody.call(void 0,
|
|
889
843
|
req,
|
|
890
|
-
|
|
844
|
+
_chunkOMVAU7NTcjs.resolveFarmServerConfig.call(void 0, context.config.server).bodySizeLimit
|
|
891
845
|
);
|
|
892
846
|
}
|
|
893
847
|
}
|
|
@@ -897,14 +851,14 @@ function createIntegrationPlugin(integrationKey, integration) {
|
|
|
897
851
|
try {
|
|
898
852
|
return createWebRequest(req, fullUrl, await getRequestBody());
|
|
899
853
|
} catch (error) {
|
|
900
|
-
const response =
|
|
854
|
+
const response = _chunkOMVAU7NTcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
901
855
|
if (!response) throw error;
|
|
902
856
|
await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, response);
|
|
903
857
|
return null;
|
|
904
858
|
}
|
|
905
859
|
}, "createHandlerRequest");
|
|
906
860
|
for (const entry of middleware) {
|
|
907
|
-
const params =
|
|
861
|
+
const params = resolveIntegrationMiddlewareParams(entry, pathname, context.config);
|
|
908
862
|
if (!params) {
|
|
909
863
|
continue;
|
|
910
864
|
}
|
|
@@ -1266,7 +1220,7 @@ async function validateIntegrationRouteInput(route, request, url) {
|
|
|
1266
1220
|
};
|
|
1267
1221
|
}
|
|
1268
1222
|
const schemas = route.input;
|
|
1269
|
-
if (!_optionalChain([schemas, 'optionalAccess',
|
|
1223
|
+
if (!_optionalChain([schemas, 'optionalAccess', _13 => _13.body]) && !_optionalChain([schemas, 'optionalAccess', _14 => _14.query])) {
|
|
1270
1224
|
return {
|
|
1271
1225
|
success: true,
|
|
1272
1226
|
input: {}
|
|
@@ -1329,7 +1283,7 @@ async function parseIntegrationInputSchema(source, schema, value) {
|
|
|
1329
1283
|
issues: normalizeIntegrationValidationIssues(source, result.error)
|
|
1330
1284
|
};
|
|
1331
1285
|
}
|
|
1332
|
-
if (_optionalChain([schema, 'access',
|
|
1286
|
+
if (_optionalChain([schema, 'access', _15 => _15["~standard"], 'optionalAccess', _16 => _16.validate])) {
|
|
1333
1287
|
const result = await schema["~standard"].validate(value);
|
|
1334
1288
|
if ("value" in result) {
|
|
1335
1289
|
return {
|
|
@@ -1455,7 +1409,7 @@ async function readIntegrationValidationBody(request, format) {
|
|
|
1455
1409
|
}
|
|
1456
1410
|
_chunkS3JO3N4Hcjs.__name.call(void 0, readIntegrationValidationBody, "readIntegrationValidationBody");
|
|
1457
1411
|
function getIntegrationRouteBodyFormat(route) {
|
|
1458
|
-
return route.bodyFormat || _optionalChain([route, 'access',
|
|
1412
|
+
return route.bodyFormat || _optionalChain([route, 'access', _17 => _17.__operation, 'optionalAccess', _18 => _18.bodyFormat]) || "json";
|
|
1459
1413
|
}
|
|
1460
1414
|
_chunkS3JO3N4Hcjs.__name.call(void 0, getIntegrationRouteBodyFormat, "getIntegrationRouteBodyFormat");
|
|
1461
1415
|
function createIntegrationRouteArgs(input) {
|
|
@@ -1533,7 +1487,7 @@ function createLazyIntegrationOrmModel(resolveOrm, modelName) {
|
|
|
1533
1487
|
return async (...args) => {
|
|
1534
1488
|
const orm = await resolveOrm();
|
|
1535
1489
|
const model = orm[modelName];
|
|
1536
|
-
const member = _optionalChain([model, 'optionalAccess',
|
|
1490
|
+
const member = _optionalChain([model, 'optionalAccess', _19 => _19[prop]]);
|
|
1537
1491
|
if (typeof member !== "function") {
|
|
1538
1492
|
throw new Error(
|
|
1539
1493
|
`Integration ORM model "${String(modelName)}" does not expose "${String(prop)}".`
|
|
@@ -1604,26 +1558,26 @@ function createFormInput(formData) {
|
|
|
1604
1558
|
_chunkS3JO3N4Hcjs.__name.call(void 0, createFormInput, "createFormInput");
|
|
1605
1559
|
async function dispatchIntegrationRequest(runtime, request, options = {}) {
|
|
1606
1560
|
try {
|
|
1607
|
-
request = await
|
|
1561
|
+
request = await _chunkOMVAU7NTcjs.bufferFarmRequestBody.call(void 0,
|
|
1608
1562
|
request,
|
|
1609
|
-
|
|
1563
|
+
_chunkOMVAU7NTcjs.resolveFarmServerConfig.call(void 0, runtime.config.server).bodySizeLimit
|
|
1610
1564
|
);
|
|
1611
1565
|
} catch (error) {
|
|
1612
|
-
const response =
|
|
1566
|
+
const response = _chunkOMVAU7NTcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
|
|
1613
1567
|
if (response) return response;
|
|
1614
1568
|
throw error;
|
|
1615
1569
|
}
|
|
1616
1570
|
const integration = runtime.integration;
|
|
1617
1571
|
const url = new URL(request.url);
|
|
1618
1572
|
const pathname = url.pathname;
|
|
1619
|
-
const requestId = request.headers.get("x-request-id") || _optionalChain([options, 'access',
|
|
1573
|
+
const requestId = request.headers.get("x-request-id") || _optionalChain([options, 'access', _20 => _20.currentRequest, 'optionalAccess', _21 => _21.headers, 'access', _22 => _22.get, 'call', _23 => _23("x-request-id")]) || String(Date.now());
|
|
1620
1574
|
const routes = normalizeIntegrationRoutes(integration.routes || []);
|
|
1621
1575
|
const pathSegments = _chunkUS2QVW3Ecjs.canonicalizeRequestPathSegments.call(void 0, pathname);
|
|
1622
1576
|
const method = normalizeIntegrationRequestMethod(request.method);
|
|
1623
1577
|
const middleware = [...integration.middleware || []];
|
|
1624
1578
|
const forwardedSetCookies = [];
|
|
1625
1579
|
for (const entry of middleware) {
|
|
1626
|
-
const params =
|
|
1580
|
+
const params = resolveIntegrationMiddlewareParams(entry, pathname, runtime.config);
|
|
1627
1581
|
if (!params) {
|
|
1628
1582
|
continue;
|
|
1629
1583
|
}
|
|
@@ -1865,7 +1819,7 @@ async function dispatchIntegrationRequest(runtime, request, options = {}) {
|
|
|
1865
1819
|
}
|
|
1866
1820
|
}
|
|
1867
1821
|
if (forwardedSetCookies.length > 0) {
|
|
1868
|
-
_optionalChain([options, 'access',
|
|
1822
|
+
_optionalChain([options, 'access', _24 => _24.onForwardedCookies, 'optionalCall', _25 => _25(forwardedSetCookies)]);
|
|
1869
1823
|
}
|
|
1870
1824
|
return null;
|
|
1871
1825
|
}
|
|
@@ -1977,38 +1931,38 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createServerIntegrationHandlerContext, "cr
|
|
|
1977
1931
|
function createServerIntegrationRequestContextStore(request, currentRequest) {
|
|
1978
1932
|
return {
|
|
1979
1933
|
get(key) {
|
|
1980
|
-
const requestValue =
|
|
1934
|
+
const requestValue = _chunkOMVAU7NTcjs.getRequestContext.call(void 0, request, key);
|
|
1981
1935
|
if (requestValue !== void 0) {
|
|
1982
1936
|
return requestValue;
|
|
1983
1937
|
}
|
|
1984
1938
|
if (currentRequest) {
|
|
1985
|
-
return
|
|
1939
|
+
return _chunkOMVAU7NTcjs.getRequestContext.call(void 0, currentRequest, key);
|
|
1986
1940
|
}
|
|
1987
1941
|
return void 0;
|
|
1988
1942
|
},
|
|
1989
1943
|
set(key, value, options) {
|
|
1990
|
-
|
|
1944
|
+
_chunkOMVAU7NTcjs.setRequestContext.call(void 0, request, key, value, options);
|
|
1991
1945
|
if (currentRequest) {
|
|
1992
|
-
|
|
1946
|
+
_chunkOMVAU7NTcjs.setRequestContext.call(void 0, currentRequest, key, value, options);
|
|
1993
1947
|
}
|
|
1994
1948
|
},
|
|
1995
1949
|
has(key) {
|
|
1996
|
-
return
|
|
1950
|
+
return _chunkOMVAU7NTcjs.hasRequestContext.call(void 0, request, key) || !!currentRequest && _chunkOMVAU7NTcjs.hasRequestContext.call(void 0, currentRequest, key);
|
|
1997
1951
|
},
|
|
1998
1952
|
delete(key) {
|
|
1999
|
-
const deletedRequest =
|
|
2000
|
-
const deletedCurrent = currentRequest ?
|
|
1953
|
+
const deletedRequest = _chunkOMVAU7NTcjs.deleteRequestContext.call(void 0, request, key);
|
|
1954
|
+
const deletedCurrent = currentRequest ? _chunkOMVAU7NTcjs.deleteRequestContext.call(void 0, currentRequest, key) : false;
|
|
2001
1955
|
return deletedRequest || deletedCurrent;
|
|
2002
1956
|
},
|
|
2003
1957
|
clear() {
|
|
2004
|
-
|
|
1958
|
+
_chunkOMVAU7NTcjs.clearRequestContext.call(void 0, request);
|
|
2005
1959
|
if (currentRequest) {
|
|
2006
|
-
|
|
1960
|
+
_chunkOMVAU7NTcjs.clearRequestContext.call(void 0, currentRequest);
|
|
2007
1961
|
}
|
|
2008
1962
|
},
|
|
2009
1963
|
snapshot(options) {
|
|
2010
|
-
const merged = currentRequest ?
|
|
2011
|
-
const requestSnapshot =
|
|
1964
|
+
const merged = currentRequest ? _chunkOMVAU7NTcjs.getRequestContextSnapshot.call(void 0, currentRequest, options) : /* @__PURE__ */ new Map();
|
|
1965
|
+
const requestSnapshot = _chunkOMVAU7NTcjs.getRequestContextSnapshot.call(void 0, request, options);
|
|
2012
1966
|
for (const [key, value] of requestSnapshot) {
|
|
2013
1967
|
merged.set(key, value);
|
|
2014
1968
|
}
|
|
@@ -2046,6 +2000,44 @@ function matchesMethod(methods, normalizedMethod) {
|
|
|
2046
2000
|
return methods.some((candidate) => candidate === "ALL" || candidate === normalizedMethod);
|
|
2047
2001
|
}
|
|
2048
2002
|
_chunkS3JO3N4Hcjs.__name.call(void 0, matchesMethod, "matchesMethod");
|
|
2003
|
+
var compiledIntegrationGuards = /* @__PURE__ */ new WeakMap();
|
|
2004
|
+
var noMiddlewareContext = {};
|
|
2005
|
+
function resolveIntegrationMiddlewareParams(entry, pathname, config) {
|
|
2006
|
+
const params = resolveMatcherParams(entry.matcher, pathname);
|
|
2007
|
+
if (params || !entry.matcher) return params;
|
|
2008
|
+
const routePathname = resolveIntegrationRoutePathname(pathname, config);
|
|
2009
|
+
if (routePathname !== pathname) {
|
|
2010
|
+
const routeParams = resolveMatcherParams(entry.matcher, routePathname);
|
|
2011
|
+
if (routeParams) return routeParams;
|
|
2012
|
+
}
|
|
2013
|
+
let compiled = compiledIntegrationGuards.get(entry);
|
|
2014
|
+
if (!compiled) {
|
|
2015
|
+
compiled = _chunkZ2HLU4IXcjs.compileMiddlewareConfig.call(void 0, {
|
|
2016
|
+
matcher: typeof entry.matcher === "string" ? entry.matcher : [...entry.matcher]
|
|
2017
|
+
});
|
|
2018
|
+
compiledIntegrationGuards.set(entry, compiled);
|
|
2019
|
+
}
|
|
2020
|
+
for (const candidate of routePathname === pathname ? [pathname] : [pathname, routePathname]) {
|
|
2021
|
+
const result = _chunkZ2HLU4IXcjs.matchesCompiledMiddlewareConfig.call(void 0, candidate, compiled, noMiddlewareContext);
|
|
2022
|
+
if (result.matched) return _nullishCoalesce(result.params, () => ( {}));
|
|
2023
|
+
}
|
|
2024
|
+
return null;
|
|
2025
|
+
}
|
|
2026
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveIntegrationMiddlewareParams, "resolveIntegrationMiddlewareParams");
|
|
2027
|
+
function resolveIntegrationRoutePathname(pathname, config) {
|
|
2028
|
+
const basePath = typeof _optionalChain([config, 'optionalAccess', _26 => _26.basePath]) === "string" ? config.basePath : void 0;
|
|
2029
|
+
let routePathname = basePath ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, pathname, basePath) : pathname;
|
|
2030
|
+
const i18n = _optionalChain([config, 'optionalAccess', _27 => _27.i18n]);
|
|
2031
|
+
if (i18n && Array.isArray(i18n.locales) && i18n.locales.length > 0) {
|
|
2032
|
+
routePathname = _chunkBIDYX3SLcjs.resolveFarmLocalePath.call(void 0, routePathname, {
|
|
2033
|
+
locales: i18n.locales,
|
|
2034
|
+
defaultLocale: i18n.defaultLocale,
|
|
2035
|
+
routing: i18n.routing || "prefix-except-default"
|
|
2036
|
+
}).pathname;
|
|
2037
|
+
}
|
|
2038
|
+
return routePathname;
|
|
2039
|
+
}
|
|
2040
|
+
_chunkS3JO3N4Hcjs.__name.call(void 0, resolveIntegrationRoutePathname, "resolveIntegrationRoutePathname");
|
|
2049
2041
|
function resolveMatcherParams(matcher, pathname) {
|
|
2050
2042
|
if (!matcher) {
|
|
2051
2043
|
return {};
|
|
@@ -2167,7 +2159,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeMatcher, "normalizeMatcher");
|
|
|
2167
2159
|
|
|
2168
2160
|
|
|
2169
2161
|
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
exports.resolveIntegrationAllowedOrigins = resolveIntegrationAllowedOrigins; exports.validateIntegrationRequestOrigin = validateIntegrationRequestOrigin; exports.describeIntegrationOriginRejection = describeIntegrationOriginRejection; exports.getFarmPluginIntegrationContext = getFarmPluginIntegrationContext; exports.FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY; exports.FARM_INTEGRATION_SET_COOKIES_KEY = FARM_INTEGRATION_SET_COOKIES_KEY; exports.forwardIntegrationSetCookies = forwardIntegrationSetCookies; exports.defineIntegrationSchema = defineIntegrationSchema; exports.getFarmIntegrationPluginServerRuntime = getFarmIntegrationPluginServerRuntime; exports.getFarmIntegrationPluginOwner = getFarmIntegrationPluginOwner; exports.createIntegrationRoute = createIntegrationRoute; exports.integrationRoute = integrationRoute; exports.defineIntegration = defineIntegration; exports.isFarmIntegration = isFarmIntegration; exports.resolveIntegrationPlugins = resolveIntegrationPlugins; exports.getIntegrationProviders = getIntegrationProviders; exports.isFarmIntegrationProviderComponentReference = isFarmIntegrationProviderComponentReference; exports.getIntegrationDocumentNavigationMatchers = getIntegrationDocumentNavigationMatchers; exports.getIntegrationSchemas = getIntegrationSchemas; exports.getRegisteredIntegrationRuntime = getRegisteredIntegrationRuntime; exports.getRegisteredIntegrations = getRegisteredIntegrations; exports.getRegisteredIntegrationSchemas = getRegisteredIntegrationSchemas; exports.matchIntegrationRoute = matchIntegrationRoute; exports.matchRegisteredIntegrationRoute = matchRegisteredIntegrationRoute; exports.getRegisteredIntegrationAPIManifest = getRegisteredIntegrationAPIManifest; exports.dispatchIntegrationRequest = dispatchIntegrationRequest; exports.dispatchIntegrationRequests = dispatchIntegrationRequests;
|
|
2162
|
+
exports.getFarmPluginIntegrationContext = getFarmPluginIntegrationContext; exports.FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY = FARM_INTEGRATION_INTERNAL_DISPATCH_CONTEXT_KEY; exports.FARM_INTEGRATION_SET_COOKIES_KEY = FARM_INTEGRATION_SET_COOKIES_KEY; exports.forwardIntegrationSetCookies = forwardIntegrationSetCookies; exports.defineIntegrationSchema = defineIntegrationSchema; exports.getFarmIntegrationPluginServerRuntime = getFarmIntegrationPluginServerRuntime; exports.getFarmIntegrationPluginOwner = getFarmIntegrationPluginOwner; exports.createIntegrationRoute = createIntegrationRoute; exports.integrationRoute = integrationRoute; exports.defineIntegration = defineIntegration; exports.isFarmIntegration = isFarmIntegration; exports.resolveIntegrationPlugins = resolveIntegrationPlugins; exports.getIntegrationProviders = getIntegrationProviders; exports.isFarmIntegrationProviderComponentReference = isFarmIntegrationProviderComponentReference; exports.getIntegrationDocumentNavigationMatchers = getIntegrationDocumentNavigationMatchers; exports.getIntegrationSchemas = getIntegrationSchemas; exports.getRegisteredIntegrationRuntime = getRegisteredIntegrationRuntime; exports.getRegisteredIntegrations = getRegisteredIntegrations; exports.getRegisteredIntegrationSchemas = getRegisteredIntegrationSchemas; exports.matchIntegrationRoute = matchIntegrationRoute; exports.matchRegisteredIntegrationRoute = matchRegisteredIntegrationRoute; exports.getRegisteredIntegrationAPIManifest = getRegisteredIntegrationAPIManifest; exports.dispatchIntegrationRequest = dispatchIntegrationRequest; exports.dispatchIntegrationRequests = dispatchIntegrationRequests;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getRequestSourceOrigin,
|
|
3
|
+
matchesAllowedOrigin,
|
|
4
|
+
matchesHostHeader,
|
|
5
|
+
normalizeAllowedOriginPattern
|
|
6
|
+
} from "./chunk-FP2INE7H.mjs";
|
|
7
|
+
import {
|
|
8
|
+
__name
|
|
9
|
+
} from "./chunk-LPEX4YW6.mjs";
|
|
10
|
+
|
|
11
|
+
// src/integration-request-security.ts
|
|
12
|
+
function resolveIntegrationAllowedOrigins(values, label) {
|
|
13
|
+
return Object.freeze((values ?? []).map((value) => normalizeAllowedOriginPattern(value, label)));
|
|
14
|
+
}
|
|
15
|
+
__name(resolveIntegrationAllowedOrigins, "resolveIntegrationAllowedOrigins");
|
|
16
|
+
function validateIntegrationRequestOrigin(request, policy = {}) {
|
|
17
|
+
const allowedOrigins = policy.allowedOrigins ?? [];
|
|
18
|
+
const requireOriginMetadata = policy.requireOriginMetadata ?? true;
|
|
19
|
+
const fetchSite = request.headers.get("sec-fetch-site")?.trim().toLowerCase();
|
|
20
|
+
const source = getRequestSourceOrigin(request);
|
|
21
|
+
if (!source.ok) {
|
|
22
|
+
return { ok: false, reason: source.reason };
|
|
23
|
+
}
|
|
24
|
+
if (source.origin === null) {
|
|
25
|
+
if (fetchSite === "same-origin") {
|
|
26
|
+
return { ok: true };
|
|
27
|
+
}
|
|
28
|
+
if (requireOriginMetadata) {
|
|
29
|
+
return { ok: false, reason: fetchSite === "cross-site" ? "cross-site" : "missing-origin" };
|
|
30
|
+
}
|
|
31
|
+
return fetchSite === "cross-site" ? { ok: false, reason: "cross-site" } : { ok: true };
|
|
32
|
+
}
|
|
33
|
+
const requestUrl = new URL(request.url);
|
|
34
|
+
const matchesConfiguredOrigin = allowedOrigins.some(
|
|
35
|
+
(pattern) => matchesAllowedOrigin(source.origin, pattern)
|
|
36
|
+
);
|
|
37
|
+
const matchesRequest = source.origin === requestUrl.origin || matchesHostHeader(source.origin, request);
|
|
38
|
+
if (!matchesRequest && !matchesConfiguredOrigin) {
|
|
39
|
+
return { ok: false, reason: "cross-site" };
|
|
40
|
+
}
|
|
41
|
+
if (fetchSite === "cross-site" && !matchesConfiguredOrigin) {
|
|
42
|
+
return { ok: false, reason: "cross-site" };
|
|
43
|
+
}
|
|
44
|
+
return { ok: true };
|
|
45
|
+
}
|
|
46
|
+
__name(validateIntegrationRequestOrigin, "validateIntegrationRequestOrigin");
|
|
47
|
+
function describeIntegrationOriginRejection(reason) {
|
|
48
|
+
switch (reason) {
|
|
49
|
+
case "missing-origin":
|
|
50
|
+
return "Request is missing same-origin metadata.";
|
|
51
|
+
case "opaque-origin":
|
|
52
|
+
return "Opaque origins are not allowed.";
|
|
53
|
+
case "invalid-origin":
|
|
54
|
+
return "Invalid request origin.";
|
|
55
|
+
case "cross-site":
|
|
56
|
+
return "Cross-site request was rejected.";
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
__name(describeIntegrationOriginRejection, "describeIntegrationOriginRejection");
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
resolveIntegrationAllowedOrigins,
|
|
63
|
+
validateIntegrationRequestOrigin,
|
|
64
|
+
describeIntegrationOriginRejection
|
|
65
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isEndpointFailure,
|
|
3
3
|
resolvePluginRoutes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3UEVPCGW.mjs";
|
|
5
5
|
import {
|
|
6
6
|
registerAPIRouteShape
|
|
7
7
|
} from "./chunk-W3B4PKAW.mjs";
|
|
@@ -9,13 +9,16 @@ import {
|
|
|
9
9
|
omitFarmResponseBody
|
|
10
10
|
} from "./chunk-5WI2S4CO.mjs";
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
validateIntegrationRequestOrigin
|
|
13
|
+
} from "./chunk-FZ6YYU2W.mjs";
|
|
14
14
|
import {
|
|
15
15
|
DEFAULT_FARM_SERVER_BODY_SIZE_LIMIT,
|
|
16
16
|
bufferFarmRequestBody,
|
|
17
17
|
createFarmRequestBodyErrorResponse
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Y7RKTKYI.mjs";
|
|
19
|
+
import {
|
|
20
|
+
resolveFarmAPICanonicalPathname
|
|
21
|
+
} from "./chunk-BTHHUD7Q.mjs";
|
|
19
22
|
import {
|
|
20
23
|
createStaticAPIRouteMatcher,
|
|
21
24
|
matchAPIRoute
|
|
@@ -31,7 +34,7 @@ import {
|
|
|
31
34
|
} from "./chunk-4SIYUGRY.mjs";
|
|
32
35
|
import {
|
|
33
36
|
_runWithCurrentRequest
|
|
34
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-FDR64H6B.mjs";
|
|
35
38
|
import {
|
|
36
39
|
__name
|
|
37
40
|
} from "./chunk-LPEX4YW6.mjs";
|
|
@@ -388,6 +391,9 @@ async function readRequestBody(request) {
|
|
|
388
391
|
}
|
|
389
392
|
if (!text) return { body: void 0 };
|
|
390
393
|
if (contentType === void 0) {
|
|
394
|
+
if (!validateIntegrationRequestOrigin(request, { requireOriginMetadata: false }).ok) {
|
|
395
|
+
return { body: void 0 };
|
|
396
|
+
}
|
|
391
397
|
try {
|
|
392
398
|
return { body: JSON.parse(text) };
|
|
393
399
|
} catch {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
decodeCookieName
|
|
3
|
+
} from "./chunk-JM5XPKWH.mjs";
|
|
1
4
|
import {
|
|
2
5
|
localizeFarmPathname,
|
|
3
6
|
resolveFarmLocalePath
|
|
@@ -139,13 +142,7 @@ function readCookie(header, name) {
|
|
|
139
142
|
for (const part of header.split(";")) {
|
|
140
143
|
const separator = part.indexOf("=");
|
|
141
144
|
if (separator < 0) continue;
|
|
142
|
-
|
|
143
|
-
try {
|
|
144
|
-
key = decodeURIComponent(part.slice(0, separator).trim());
|
|
145
|
-
} catch {
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
if (key !== name) continue;
|
|
145
|
+
if (decodeCookieName(part.slice(0, separator).trim()) !== name) continue;
|
|
149
146
|
try {
|
|
150
147
|
return decodeURIComponent(part.slice(separator + 1).trim());
|
|
151
148
|
} catch {
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkZXGAFZDOcjs = require('./chunk-ZXGAFZDO.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkYWN746UScjs = require('./chunk-YWN746US.cjs');
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
|
|
@@ -70,13 +70,13 @@ async function _invokeServerFunction(value, input, request) {
|
|
|
70
70
|
throw new TypeError("Expected a function created with createServerFn or createServerQuery");
|
|
71
71
|
}
|
|
72
72
|
try {
|
|
73
|
-
const data = await
|
|
73
|
+
const data = await _chunkZXGAFZDOcjs.runWithServerActionRequest.call(void 0, request, () => runner.run(input));
|
|
74
74
|
return { ok: true, data };
|
|
75
75
|
} catch (error) {
|
|
76
76
|
if (error instanceof ServerFnInputError) {
|
|
77
77
|
return { ok: false, reason: "input", error: error.cause };
|
|
78
78
|
}
|
|
79
|
-
if (
|
|
79
|
+
if (_chunkZXGAFZDOcjs.isServerFnFailure.call(void 0, error)) return { ok: false, reason: "failure", failure: error };
|
|
80
80
|
const redirect = _chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error);
|
|
81
81
|
if (redirect) {
|
|
82
82
|
return { ok: false, reason: "redirect", url: redirect.url, status: redirect.status };
|
|
@@ -117,9 +117,9 @@ function createServerFn(options) {
|
|
|
117
117
|
} catch (cause) {
|
|
118
118
|
throw labelInputErrors && isSchemaValidationFailure(cause) ? new ServerFnInputError(cause) : cause;
|
|
119
119
|
}
|
|
120
|
-
const executionContext =
|
|
120
|
+
const executionContext = _chunkZXGAFZDOcjs.getServerActionExecutionContext.call(void 0, );
|
|
121
121
|
const request = _nullishCoalesce(_optionalChain([executionContext, 'optionalAccess', _ => _.request]), () => ( _chunkU4KT7QP3cjs._resolveCurrentRequest.call(void 0, )));
|
|
122
|
-
const signal = _nullishCoalesce(_nullishCoalesce(_optionalChain([executionContext, 'optionalAccess', _2 => _2.signal]), () => ( _optionalChain([request, 'optionalAccess', _3 => _3.signal]))), () => (
|
|
122
|
+
const signal = _nullishCoalesce(_nullishCoalesce(_optionalChain([executionContext, 'optionalAccess', _2 => _2.signal]), () => ( _optionalChain([request, 'optionalAccess', _3 => _3.signal]))), () => ( _chunkZXGAFZDOcjs.getServerActionSignal.call(void 0, )));
|
|
123
123
|
const handlerContext = {
|
|
124
124
|
input,
|
|
125
125
|
rawInput,
|
|
@@ -139,7 +139,7 @@ function createServerFn(options) {
|
|
|
139
139
|
context: resolvedContext,
|
|
140
140
|
result: parsedResult
|
|
141
141
|
}) : options.invalidates;
|
|
142
|
-
await
|
|
142
|
+
await _chunkYWN746UScjs.applyFarmCacheInvalidationTargets.call(void 0, declaration);
|
|
143
143
|
}
|
|
144
144
|
return parsedResult;
|
|
145
145
|
}, "run");
|
|
@@ -245,7 +245,7 @@ function createServerFnErrorHandler(definitions) {
|
|
|
245
245
|
throw new TypeError(`Server function error "${code}" is not declared`);
|
|
246
246
|
}
|
|
247
247
|
const parsed = parseServerFnFailureData(code, definition.data, data);
|
|
248
|
-
throw new (0,
|
|
248
|
+
throw new (0, _chunkZXGAFZDOcjs.ServerFnFailure)(code, parsed, {
|
|
249
249
|
status: definition.status,
|
|
250
250
|
message: _nullishCoalesce(definition.message, () => ( "Server function failed"))
|
|
251
251
|
});
|