@farm.js/core 0.1.77 → 0.1.78
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 +1 -1
- package/dist/after.mjs +1 -1
- package/dist/{agent-mcp-handler-PJKZHYSA.mjs → agent-mcp-handler-EDJNU224.mjs} +1 -1
- package/dist/{agent-mcp-handler-73SGWVZT.cjs → agent-mcp-handler-LNBYLRTZ.cjs} +1 -1
- package/dist/{agent-mcp.d-B1h3RznZ.d.ts → agent-mcp.d-BErtnhV2.d.ts} +1 -1
- package/dist/{agent-mcp.d-WFQotg8M.d.mts → agent-mcp.d-CYHfcjur.d.mts} +1 -1
- package/dist/agent-runtime.cjs +3 -3
- package/dist/agent-runtime.d.mts +2 -2
- package/dist/agent-runtime.d.ts +2 -2
- package/dist/agent-runtime.mjs +2 -2
- package/dist/analyzer-KVTUYGTT.cjs +16 -0
- package/dist/{analyzer-64YS2OXQ.mjs → analyzer-M2BG6QYU.mjs} +3 -3
- package/dist/api/client.cjs +1 -1
- package/dist/api/client.mjs +1 -1
- package/dist/api/client.native.cjs +1 -1
- package/dist/api/client.native.mjs +1 -1
- package/dist/api/node.cjs +1 -1
- package/dist/api/node.d.mts +4 -4
- package/dist/api/node.d.ts +4 -4
- package/dist/api/node.mjs +1 -1
- package/dist/api/route-manager.cjs +5 -5
- package/dist/api/route-manager.d.mts +4 -4
- package/dist/api/route-manager.d.ts +4 -4
- package/dist/api/route-manager.mjs +4 -4
- package/dist/api/runtime.cjs +1 -1
- package/dist/api/runtime.d.mts +3 -3
- package/dist/api/runtime.d.ts +3 -3
- package/dist/api/runtime.mjs +1 -1
- package/dist/api.cjs +6 -6
- package/dist/api.d.mts +5 -5
- package/dist/api.d.ts +5 -5
- package/dist/api.mjs +5 -5
- package/dist/{app-manifest.d-EZEYG-tD.d.mts → app-manifest.d-6NCkLQ1y.d.mts} +1 -1
- package/dist/{app-manifest.d-Ktsqsuk9.d.ts → app-manifest.d-DuqLBcmi.d.ts} +1 -1
- package/dist/app-markdown.cjs +1 -1
- package/dist/app-markdown.d.mts +3 -3
- package/dist/app-markdown.d.ts +3 -3
- package/dist/app-markdown.mjs +1 -1
- package/dist/{app.d-CSh3y8w8.d.ts → app.d-Bz6vYBFF.d.ts} +4 -4
- package/dist/{app.d-DTkqYcIr.d.mts → app.d-Dk2HkvPh.d.mts} +4 -4
- package/dist/cache.cjs +1 -1
- package/dist/cache.mjs +1 -1
- package/dist/{chunk-IIVZTGGP.cjs → chunk-26CNCIFI.cjs} +2 -2
- package/dist/{chunk-PUEPDMWY.cjs → chunk-2G6JPLSL.cjs} +19 -19
- package/dist/{chunk-HFJLMALC.cjs → chunk-5DREJN4G.cjs} +4 -4
- package/dist/{chunk-LTDMJD2F.cjs → chunk-5KISFWD2.cjs} +4 -4
- package/dist/{chunk-5WFPZG7K.mjs → chunk-5REIO5DT.mjs} +4 -4
- package/dist/{chunk-SYPEMXW2.mjs → chunk-6MZSTPD2.mjs} +1 -1
- package/dist/{chunk-63EFR2WF.cjs → chunk-6XDDE7M6.cjs} +3 -3
- package/dist/{chunk-IXC6WDMT.mjs → chunk-7JTVN6IJ.mjs} +1 -1
- package/dist/{chunk-QODXWUGQ.mjs → chunk-7RQ5KAK6.mjs} +1 -1
- package/dist/{chunk-QVBXTSIZ.mjs → chunk-7V5M43ND.mjs} +1 -1
- package/dist/{chunk-ORWXJDUN.mjs → chunk-A37D6LOS.mjs} +1 -1
- package/dist/{chunk-7EOSFIPN.cjs → chunk-A4WWKG2B.cjs} +2 -2
- package/dist/{chunk-65XXHTVJ.mjs → chunk-A7EJATEW.mjs} +2 -2
- package/dist/{chunk-IHMSLS2O.mjs → chunk-AHGOHPRN.mjs} +13 -13
- package/dist/{chunk-JRBWBMP2.mjs → chunk-B3IRRANH.mjs} +1 -1
- package/dist/{chunk-GC2BSXQS.cjs → chunk-BZJYPIFZ.cjs} +7 -7
- package/dist/{chunk-WHNNDFCJ.mjs → chunk-CBP7AKZH.mjs} +1 -1
- package/dist/{chunk-QUEYL2WM.cjs → chunk-CKNZJFK5.cjs} +1 -1
- package/dist/{chunk-YRQ44JTF.cjs → chunk-DD2ANOEF.cjs} +254 -168
- package/dist/{chunk-MQW4LHJR.cjs → chunk-DPBQRDWW.cjs} +1 -1
- package/dist/{chunk-YTGNMKRA.mjs → chunk-E7V2GYBP.mjs} +1 -1
- package/dist/{chunk-NTHAZLVS.mjs → chunk-EBFTAVGD.mjs} +126 -40
- package/dist/{chunk-RFXEQYPH.cjs → chunk-EVVV2XZ2.cjs} +33 -20
- package/dist/{chunk-YROK6CJC.cjs → chunk-F7PKUP6P.cjs} +9 -9
- package/dist/{chunk-JD42G6BN.cjs → chunk-FOULIN4S.cjs} +2 -2
- package/dist/{chunk-OQZF6H6G.cjs → chunk-H5OVJHXY.cjs} +4 -4
- package/dist/{chunk-SIYELCIX.cjs → chunk-HVMQAVZK.cjs} +78 -78
- package/dist/{chunk-D2RLADWN.mjs → chunk-IGE5BAWK.mjs} +33 -20
- package/dist/{chunk-FTQUNBRN.cjs → chunk-IWGGRXD2.cjs} +2 -2
- package/dist/{chunk-SFSTZ7TB.cjs → chunk-K3ZELA6U.cjs} +2 -2
- package/dist/{chunk-DZ3AZ7UK.cjs → chunk-KZ5BOWJS.cjs} +9 -9
- package/dist/{chunk-ZBE5EHVJ.mjs → chunk-LIC6CMLB.mjs} +5 -5
- package/dist/{chunk-NQZWLIPT.cjs → chunk-LJKTJNOF.cjs} +3 -3
- package/dist/{chunk-UYACD4SH.cjs → chunk-LMXGCFAM.cjs} +1 -1
- package/dist/{chunk-7SAGHWWU.cjs → chunk-MBD34AS5.cjs} +2 -2
- package/dist/{chunk-WZVESREI.cjs → chunk-NB2ZEBIS.cjs} +186 -164
- package/dist/{chunk-DSRWQ4SJ.cjs → chunk-NNGBTJCX.cjs} +3 -3
- package/dist/{chunk-QDHR54S6.cjs → chunk-OBVBII5K.cjs} +5 -5
- package/dist/{chunk-PMKUTZGR.cjs → chunk-ODYKCC6W.cjs} +6 -6
- package/dist/{chunk-3AJQFVWW.mjs → chunk-OGVOKAQU.mjs} +1 -1
- package/dist/{chunk-BTHNOAOF.mjs → chunk-PNWRH6TR.mjs} +2 -2
- package/dist/{chunk-3GMD2E4Q.mjs → chunk-QES76U42.mjs} +1 -1
- package/dist/{chunk-FNVGK72M.mjs → chunk-R77D7TCZ.mjs} +6 -6
- package/dist/{chunk-7EXFAJST.mjs → chunk-RIMEFQYO.mjs} +42 -20
- package/dist/{chunk-2QPTZMGK.mjs → chunk-S6RUJRWI.mjs} +1 -1
- package/dist/chunk-TIZJYHB7.mjs +42 -0
- package/dist/chunk-UZM3PDKK.cjs +46 -0
- package/dist/{chunk-TQOYIPMQ.mjs → chunk-VCW6BR6U.mjs} +1 -1
- package/dist/{chunk-SL2BSPDJ.mjs → chunk-VO5XDZHK.mjs} +1 -1
- package/dist/{chunk-WXMR3OHY.mjs → chunk-VRI43FDN.mjs} +1 -1
- package/dist/{chunk-SMYDCZBW.mjs → chunk-VRJAMU34.mjs} +1 -1
- package/dist/{chunk-CF74ABRI.mjs → chunk-WJ4NUY2H.mjs} +2 -2
- package/dist/{chunk-FPGSIOWS.mjs → chunk-X2SEYK7I.mjs} +2 -2
- package/dist/{chunk-FCHEO3LG.cjs → chunk-XGS76V7L.cjs} +2 -2
- package/dist/{chunk-3QM74STY.cjs → chunk-Y2FEFQAY.cjs} +3 -3
- package/dist/{chunk-FVVGEGQ2.cjs → chunk-ZCYGYIC2.cjs} +2 -2
- package/dist/{chunk-OCKQ3YOH.mjs → chunk-ZEWIWAS2.mjs} +1 -1
- package/dist/{cli-runtime.d-DljFfr8T.d.ts → cli-runtime.d-BG9q2_vC.d.ts} +6 -6
- package/dist/{cli-runtime.d-HSkdfvoq.d.mts → cli-runtime.d-CGMGs1Zz.d.mts} +6 -6
- package/dist/client/lifecycle.cjs +1 -1
- package/dist/client/lifecycle.mjs +1 -1
- package/dist/{client-component.d-_otXB__v.d.ts → client-component.d-B84GPb_u.d.ts} +1 -1
- package/dist/{client-component.d-B-1dIlsw.d.mts → client-component.d-CdsG1E7p.d.mts} +1 -1
- package/dist/client-plugins.cjs +1 -1
- package/dist/{client-plugins.d-BmBzvfSP.d.mts → client-plugins.d-DX-iCJWE.d.mts} +1 -1
- package/dist/{client-plugins.d-MjxlvbCK.d.ts → client-plugins.d-FptsHgls.d.ts} +1 -1
- package/dist/client-plugins.d.mts +2 -2
- package/dist/client-plugins.d.ts +2 -2
- package/dist/client-plugins.mjs +1 -1
- package/dist/client.cjs +1 -1
- package/dist/client.d.mts +7 -7
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.mts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/config.mjs +1 -1
- package/dist/cron.cjs +1 -1
- package/dist/cron.mjs +1 -1
- package/dist/deferred.cjs +1 -1
- package/dist/deferred.mjs +1 -1
- package/dist/deployment.cjs +1 -1
- package/dist/deployment.mjs +1 -1
- package/dist/desktop.cjs +1 -1
- package/dist/desktop.d.mts +3 -3
- package/dist/desktop.d.ts +3 -3
- package/dist/desktop.mjs +1 -1
- package/dist/{dev-guard-ZDIELV6Q.mjs → dev-guard-K3GJDPEQ.mjs} +1 -1
- package/dist/{dev-guard-ZLLKVO5T.cjs → dev-guard-VIEEA4LS.cjs} +1 -1
- package/dist/{devtools-7LHXG2VS.mjs → devtools-7P3OUNLV.mjs} +4 -4
- package/dist/{devtools-NNQN66EZ.cjs → devtools-TMATFNUY.cjs} +5 -5
- package/dist/{devtools-client-X5OQCXDF.cjs → devtools-client-BKBCCORT.cjs} +1 -1
- package/dist/{devtools-client-SU4XH46J.mjs → devtools-client-L4MUWD6K.mjs} +1 -1
- package/dist/{devtools-ui-CYBVFLPH.mjs → devtools-ui-BOG33MT5.mjs} +1 -1
- package/dist/{devtools-ui-SYRUXUA7.cjs → devtools-ui-C2EMF2SO.cjs} +1 -1
- package/dist/docs.cjs +6 -6
- package/dist/docs.d.mts +4 -4
- package/dist/docs.d.ts +4 -4
- package/dist/docs.mjs +5 -5
- package/dist/env-types.cjs +1 -1
- package/dist/env-types.mjs +1 -1
- package/dist/env.cjs +1 -1
- package/dist/env.mjs +1 -1
- package/dist/environment/vite.cjs +4 -4
- package/dist/environment/vite.mjs +3 -3
- package/dist/environment.cjs +1 -1
- package/dist/environment.mjs +1 -1
- package/dist/font.cjs +1 -1
- package/dist/font.mjs +1 -1
- package/dist/{handler.d-C53zFDmp.d.ts → handler.d-Cy3XbY_W.d.ts} +1 -1
- package/dist/{handler.d-CaYopqaD.d.mts → handler.d-DSwLTpa5.d.mts} +1 -1
- package/dist/headers.cjs +1 -1
- package/dist/{headers.d-MBkD9ZLf.d.mts → headers.d-DiL9YTH3.d.mts} +1 -1
- package/dist/{headers.d-BvtpC90T.d.ts → headers.d-Qbjo38a0.d.ts} +1 -1
- package/dist/headers.mjs +1 -1
- package/dist/i18n/client.cjs +1 -1
- package/dist/i18n/client.mjs +1 -1
- package/dist/i18n/index.cjs +1 -1
- package/dist/i18n/index.mjs +1 -1
- package/dist/i18n/server.cjs +1 -1
- package/dist/i18n/server.mjs +1 -1
- package/dist/image/server.cjs +1 -1
- package/dist/image/server.mjs +1 -1
- package/dist/image/sharp.cjs +1 -1
- package/dist/image/sharp.mjs +1 -1
- package/dist/image.cjs +1 -1
- package/dist/image.mjs +1 -1
- package/dist/index.cjs +37 -37
- package/dist/{index.d-Mikf-tdP.d.mts → index.d-CqQKX3s6.d.mts} +1 -1
- package/dist/{index.d-2hQpPZ-P.d.ts → index.d-OccJoC6I.d.ts} +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.mjs +33 -33
- package/dist/instrumentation.cjs +1 -1
- package/dist/instrumentation.mjs +1 -1
- package/dist/integrations/orm.cjs +4 -4
- package/dist/integrations/orm.d.mts +2 -2
- package/dist/integrations/orm.d.ts +2 -2
- package/dist/integrations/orm.mjs +3 -3
- package/dist/integrations.cjs +3 -3
- package/dist/integrations.d.mts +2 -2
- package/dist/integrations.d.ts +2 -2
- package/dist/integrations.mjs +2 -2
- package/dist/internal/app-markdown-runtime.cjs +1 -1
- 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 +1 -1
- package/dist/internal/build-runtime.cjs +28 -28
- package/dist/internal/build-runtime.d.mts +5 -5
- package/dist/internal/build-runtime.d.ts +5 -5
- package/dist/internal/build-runtime.mjs +27 -27
- package/dist/internal/cli-runtime.cjs +13 -13
- package/dist/internal/cli-runtime.d.mts +8 -8
- package/dist/internal/cli-runtime.d.ts +8 -8
- package/dist/internal/cli-runtime.mjs +12 -12
- package/dist/internal/client-error-overlay.cjs +5 -5
- package/dist/internal/client-error-overlay.mjs +2 -2
- package/dist/internal/client-runtime.cjs +1 -1
- package/dist/internal/client-runtime.d.mts +5 -5
- package/dist/internal/client-runtime.d.ts +5 -5
- package/dist/internal/client-runtime.mjs +1 -1
- package/dist/internal/compression-runtime.cjs +1 -1
- package/dist/internal/compression-runtime.d.mts +2 -2
- package/dist/internal/compression-runtime.d.ts +2 -2
- package/dist/internal/compression-runtime.mjs +1 -1
- package/dist/internal/config-runtime.cjs +6 -6
- package/dist/internal/config-runtime.d.mts +4 -4
- package/dist/internal/config-runtime.d.ts +4 -4
- package/dist/internal/config-runtime.mjs +5 -5
- package/dist/internal/desktop-guard.cjs +1 -1
- package/dist/internal/desktop-guard.mjs +1 -1
- package/dist/internal/docs-precompiled-runtime.cjs +1 -1
- package/dist/internal/docs-precompiled-runtime.mjs +1 -1
- package/dist/internal/form-actions-client.cjs +1 -1
- package/dist/internal/form-actions-client.mjs +1 -1
- package/dist/internal/form-actions.cjs +1 -1
- package/dist/internal/form-actions.mjs +1 -1
- package/dist/internal/infra-analytics-runtime.cjs +7 -7
- package/dist/internal/infra-analytics-runtime.mjs +5 -5
- package/dist/internal/island-codec.cjs +1 -1
- package/dist/internal/island-codec.mjs +1 -1
- package/dist/internal/island-value-store.cjs +1 -1
- package/dist/internal/island-value-store.mjs +1 -1
- package/dist/internal/islands-boot.cjs +27 -6
- package/dist/internal/islands-boot.mjs +24 -3
- package/dist/internal/islands-runtime.cjs +1 -1
- package/dist/internal/islands-runtime.mjs +1 -1
- package/dist/internal/islands-server.cjs +1 -1
- package/dist/internal/islands-server.mjs +1 -1
- package/dist/internal/islx-client.cjs +1 -1
- package/dist/internal/islx-react.cjs +1 -1
- package/dist/internal/islx-server.cjs +1 -1
- package/dist/internal/isolated-boundary.cjs +1 -1
- package/dist/internal/isolated-boundary.mjs +1 -1
- package/dist/internal/metadata-image-runtime.cjs +1 -1
- package/dist/internal/metadata-image-runtime.mjs +1 -1
- package/dist/internal/native-server-fns.cjs +5 -5
- package/dist/internal/native-server-fns.mjs +4 -4
- package/dist/internal/product-telemetry-runtime.cjs +4 -4
- package/dist/internal/product-telemetry-runtime.mjs +3 -3
- package/dist/internal/production-node-env.cjs +1 -1
- package/dist/internal/production-node-env.mjs +1 -1
- package/dist/internal/production-runtime.cjs +7 -7
- package/dist/internal/production-runtime.d.mts +11 -11
- package/dist/internal/production-runtime.d.ts +11 -11
- package/dist/internal/production-runtime.mjs +6 -6
- package/dist/internal/react-cache.cjs +1 -1
- package/dist/internal/react-cache.mjs +1 -1
- package/dist/internal/request-cookies.cjs +1 -1
- package/dist/internal/request-cookies.mjs +1 -1
- package/dist/internal/server-fn-transform.cjs +1 -1
- package/dist/internal/server-fn-transform.mjs +1 -1
- package/dist/internal/server-tree.cjs +1 -1
- package/dist/internal/server-tree.mjs +1 -1
- package/dist/internal/start-manifest.cjs +1 -1
- package/dist/internal/start-manifest.d.mts +2 -2
- package/dist/internal/start-manifest.d.ts +2 -2
- package/dist/internal/start-manifest.mjs +1 -1
- package/dist/internal/vercel-edge-middleware.cjs +1 -1
- package/dist/internal/vercel-edge-middleware.mjs +1 -1
- package/dist/json-ld.cjs +1 -1
- package/dist/json-ld.mjs +1 -1
- package/dist/{layers-I7VE5Q2Y.mjs → layers-5ZD4764G.mjs} +1 -1
- package/dist/{layers-WP5K5F7W.cjs → layers-HMEGUEXM.cjs} +1 -1
- package/dist/libsql-http-2QD224YS.mjs +600 -0
- package/dist/libsql-http-M6LMNXCN.cjs +600 -0
- package/dist/{manager-YO2RHDYU.mjs → manager-OMTC5FOJ.mjs} +2 -2
- package/dist/{manager-R7FV4A56.cjs → manager-PX4QN4HK.cjs} +4 -4
- package/dist/markdown.cjs +1 -1
- package/dist/markdown.d.mts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/markdown.mjs +1 -1
- package/dist/middleware.cjs +5 -5
- package/dist/middleware.d.mts +2 -2
- package/dist/middleware.d.ts +2 -2
- package/dist/middleware.mjs +4 -4
- package/dist/mobile.cjs +1 -1
- package/dist/mobile.mjs +1 -1
- package/dist/{modules-KOKD4XS6.mjs → modules-3Q2ZCY4Q.mjs} +1 -1
- package/dist/{modules-QTP7WJPD.cjs → modules-KDHFBQ6L.cjs} +1 -1
- package/dist/{mount.d-DsP46XCy.d.mts → mount.d-AcJaUtHF.d.mts} +1 -1
- package/dist/{mount.d-GU-tNxbE.d.ts → mount.d-CPzqOm-a.d.ts} +1 -1
- package/dist/{native-server-fn-handler-LII4MDRR.mjs → native-server-fn-handler-WYYY4YBN.mjs} +1 -1
- package/dist/{native-server-fn-handler-IWNKQEXK.cjs → native-server-fn-handler-XRTZR7SZ.cjs} +1 -1
- package/dist/{native-specs-LDV6IZ4N.mjs → native-specs-A7YOL463.mjs} +1 -1
- package/dist/{native-specs-5OLED4MM.cjs → native-specs-JDPH26AO.cjs} +1 -1
- package/dist/{native-tree-G6ZWS7IR.mjs → native-tree-JDI3LJSH.mjs} +1 -1
- package/dist/{native-tree-D3PW64ZL.cjs → native-tree-MNUFN5G6.cjs} +1 -1
- package/dist/native.cjs +1 -1
- package/dist/native.mjs +1 -1
- package/dist/{navigation-delegate.d-CUtNOYLi.d.mts → navigation-delegate.d-C4i5Y39E.d.mts} +1 -1
- package/dist/{navigation-delegate.d-DsxNPrLT.d.ts → navigation-delegate.d-_Df9DnPY.d.ts} +1 -1
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.mts +5 -5
- package/dist/navigation.d.ts +5 -5
- package/dist/navigation.mjs +1 -1
- package/dist/{nitro-HKMVYIXY.cjs → nitro-NUCTYEKJ.cjs} +3 -3
- package/dist/{nitro-RHLKLYXH.mjs → nitro-VCJ6QQSI.mjs} +2 -2
- package/dist/{node-module-bundle-LIZ2KMVW.cjs → node-module-bundle-M6BISE2P.cjs} +1 -1
- package/dist/{node-module-bundle-VR6NV6AI.mjs → node-module-bundle-XPLBMXRD.mjs} +1 -1
- package/dist/observability.cjs +1 -1
- package/dist/observability.mjs +1 -1
- package/dist/og.cjs +1 -1
- package/dist/og.mjs +1 -1
- package/dist/platform.cjs +1 -1
- package/dist/platform.mjs +1 -1
- package/dist/{plugin-MW7IDV76.cjs → plugin-AGEFSU7K.cjs} +3 -3
- package/dist/{plugin-2KWR2X4B.mjs → plugin-TV6W7YNK.mjs} +2 -2
- package/dist/plugin.cjs +21 -21
- package/dist/plugin.d.mts +6 -6
- package/dist/plugin.d.ts +6 -6
- package/dist/plugin.mjs +20 -20
- package/dist/{port-CLL4BC4O.mjs → port-CEZTV776.mjs} +1 -1
- package/dist/{port-HASZTQGY.cjs → port-STMSGUVU.cjs} +1 -1
- package/dist/query/client.cjs +1 -1
- package/dist/query/client.mjs +1 -1
- package/dist/query/index.cjs +1 -1
- package/dist/query/index.mjs +1 -1
- package/dist/query/parsers.cjs +1 -1
- package/dist/query/parsers.mjs +1 -1
- package/dist/query/server.cjs +1 -1
- package/dist/query/server.mjs +1 -1
- package/dist/{render-plan.d-B7Xp-PPW.d.mts → render-plan.d-4V_NmaA6.d.mts} +1 -1
- package/dist/{render-plan.d-8K6S0h0L.d.ts → render-plan.d-CslZE7o7.d.ts} +1 -1
- package/dist/renderer/none/server.cjs +1 -1
- package/dist/renderer/none/server.mjs +1 -1
- package/dist/renderer/react/client.cjs +1 -1
- package/dist/renderer/react/client.mjs +1 -1
- package/dist/renderer/react/server.cjs +1 -1
- package/dist/renderer/react/server.mjs +1 -1
- package/dist/renderer/react/vite.cjs +1 -1
- package/dist/renderer/react/vite.mjs +1 -1
- package/dist/renderer-client.cjs +1 -1
- package/dist/renderer-client.d.mts +5 -5
- package/dist/renderer-client.d.ts +5 -5
- package/dist/renderer-client.mjs +1 -1
- package/dist/renderer.cjs +1 -1
- package/dist/renderer.mjs +1 -1
- package/dist/request.cjs +1 -1
- package/dist/{request.d-CuQxmOqX.d.ts → request.d-CbV3y7j3.d.ts} +1 -1
- package/dist/{request.d-nhqciCAz.d.mts → request.d-CmLTxEgS.d.mts} +1 -1
- package/dist/request.d.mts +3 -3
- package/dist/request.d.ts +3 -3
- package/dist/request.mjs +1 -1
- package/dist/{route-rendering.d-BSsdDYC1.d.ts → route-rendering.d-CETnXNez.d.ts} +1 -1
- package/dist/{route-rendering.d-CeF1FOnl.d.mts → route-rendering.d-CmoqfOmj.d.mts} +1 -1
- package/dist/router.cjs +1 -1
- package/dist/{router.d-C7yGlhDL.d.ts → router.d-Dga3N5YO.d.ts} +1 -1
- package/dist/{router.d-D462OX24.d.mts → router.d-ktz7pwYm.d.mts} +1 -1
- package/dist/router.mjs +1 -1
- package/dist/routes.cjs +1 -1
- package/dist/routes.d.mts +2 -2
- package/dist/routes.d.ts +2 -2
- package/dist/routes.mjs +1 -1
- package/dist/{rsc-pipeline-7PV6ARDS.cjs → rsc-pipeline-JLYD26AR.cjs} +9 -9
- package/dist/{rsc-pipeline-EZU4W4RL.mjs → rsc-pipeline-N7CWJW7T.mjs} +8 -8
- package/dist/{runtime-QOE3NRXF.cjs → runtime-F5NSS4DD.cjs} +11 -11
- package/dist/{runtime-RWLFEPS3.mjs → runtime-QXX2A4TS.mjs} +8 -8
- package/dist/{runtime.d-CORDJQMy.d.ts → runtime.d-BWLZUOfA.d.ts} +1 -1
- package/dist/{runtime.d-C-BHQMy5.d.mts → runtime.d-DuaXEM0p.d.mts} +1 -1
- package/dist/safe-fetch.cjs +1 -1
- package/dist/safe-fetch.mjs +1 -1
- package/dist/{schema-dev-notice-CA55V57L.mjs → schema-dev-notice-2GN5V7Y2.mjs} +1 -1
- package/dist/{schema-dev-notice-RWA2UTR6.cjs → schema-dev-notice-6VCOZGG2.cjs} +1 -1
- package/dist/schema.cjs +1 -1
- package/dist/schema.mjs +1 -1
- package/dist/{search-client-ZZLKVO5R.cjs → search-client-6NVC6HM2.cjs} +1 -1
- package/dist/{search-client-OXH6GBNO.mjs → search-client-W4PEFAQB.mjs} +1 -1
- package/dist/server-action-security.cjs +1 -1
- package/dist/server-action-security.mjs +1 -1
- package/dist/{server-components-status.d-BbADqqjq.d.ts → server-components-status.d-C5JpC7_Y.d.ts} +1 -1
- package/dist/{server-components-status.d-BJ6huueH.d.mts → server-components-status.d-CqxtJmqP.d.mts} +1 -1
- package/dist/server-fn-client.cjs +1 -1
- package/dist/server-fn-client.mjs +1 -1
- package/dist/server-fn.cjs +1 -1
- package/dist/server-fn.mjs +1 -1
- package/dist/server-plugins.cjs +1 -1
- package/dist/server-plugins.d.mts +4 -4
- package/dist/server-plugins.d.ts +4 -4
- package/dist/server-plugins.mjs +1 -1
- package/dist/server-query-client.cjs +1 -1
- package/dist/server-query-client.mjs +1 -1
- package/dist/server-query.cjs +1 -1
- package/dist/server-query.mjs +1 -1
- package/dist/server.cjs +91 -69
- package/dist/server.d.mts +12 -12
- package/dist/server.d.ts +12 -12
- package/dist/server.mjs +50 -28
- package/dist/{session-WPAT6H76.mjs → session-AK2OA5UZ.mjs} +3 -3
- package/dist/session-H4TWP73H.cjs +24 -0
- package/dist/{spa-router.d-DfjafHyX.d.mts → spa-router.d-BLE188EL.d.mts} +2 -2
- package/dist/{spa-router.d-DyGJLQc_.d.ts → spa-router.d-C3LzwTlY.d.ts} +2 -2
- package/dist/{ssg.d-D11lz_wr.d.ts → ssg.d-DisOfj0I.d.ts} +2 -2
- package/dist/{ssg.d-iiLTyLAO.d.mts → ssg.d-QrFyU6T4.d.mts} +2 -2
- package/dist/storage.cjs +3 -3
- package/dist/storage.d.mts +2 -2
- package/dist/storage.d.ts +2 -2
- package/dist/storage.mjs +2 -2
- package/dist/testing.cjs +4 -4
- package/dist/testing.d.mts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.mjs +4 -4
- package/dist/theme/client.cjs +1 -1
- package/dist/theme/client.mjs +1 -1
- package/dist/theme/index.cjs +1 -1
- package/dist/theme/index.mjs +1 -1
- package/dist/theme/runtime.cjs +1 -1
- package/dist/theme/runtime.mjs +1 -1
- package/dist/theme/server.cjs +1 -1
- package/dist/theme/server.mjs +1 -1
- package/dist/{types.d-DC97bnjj.d.mts → types.d-DW2vyaUq.d.mts} +6 -1
- package/dist/{types.d-DC97bnjj.d.ts → types.d-DW2vyaUq.d.ts} +6 -1
- package/dist/{utils.d-D-GQeEfa.d.ts → utils.d-7YcgfTCK.d.ts} +1 -1
- package/dist/{utils.d-fW-95yEh.d.mts → utils.d-BlWZFgdL.d.mts} +1 -1
- package/dist/version.cjs +3 -3
- package/dist/version.mjs +2 -2
- package/dist/vite.cjs +21 -21
- package/dist/vite.d.mts +7 -7
- package/dist/vite.d.ts +7 -7
- package/dist/vite.mjs +20 -20
- package/dist/workflows.cjs +3 -3
- package/dist/workflows.mjs +2 -2
- package/package.json +3 -5
- package/dist/analyzer-HTNXLX6N.cjs +0 -16
- package/dist/chunk-BTZ5O6VM.cjs +0 -14
- package/dist/chunk-Y6FXYEAI.mjs +0 -10
- package/dist/session-OU7M4CIF.cjs +0 -24
- package/dist/{chunk-WW62HKA2.cjs → chunk-4SLHSODZ.cjs} +2 -2
- package/dist/{chunk-RL47VZ6J.mjs → chunk-522K362I.mjs} +0 -0
- package/dist/{chunk-AF3PNVVF.cjs → chunk-AOTD2N5P.cjs} +0 -0
- package/dist/{chunk-PC5OZ4YR.cjs → chunk-CUZT7474.cjs} +0 -0
- package/dist/{chunk-BEXH6BGH.mjs → chunk-JKFN3YVG.mjs} +0 -0
- package/dist/{chunk-YTNE4KGC.cjs → chunk-MALGIHIC.cjs} +0 -0
- package/dist/{chunk-UOE6ZZZP.mjs → chunk-Q3DO7MVK.mjs} +0 -0
- package/dist/{chunk-GAAK3HDZ.mjs → chunk-XT2CHTDN.mjs} +3 -3
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__export,
|
|
3
|
+
__privateAdd,
|
|
4
|
+
__privateGet,
|
|
5
|
+
__privateSet,
|
|
6
|
+
__publicField,
|
|
7
|
+
__reExport
|
|
8
|
+
} from "./chunk-TIZJYHB7.mjs";
|
|
9
|
+
|
|
10
|
+
// ../../node_modules/.pnpm/@libsql+client@0.17.4/node_modules/@libsql/client/lib-esm/http.js
|
|
11
|
+
var http_exports = {};
|
|
12
|
+
__export(http_exports, {
|
|
13
|
+
HttpClient: () => HttpClient,
|
|
14
|
+
HttpTransaction: () => HttpTransaction,
|
|
15
|
+
_createClient: () => _createClient,
|
|
16
|
+
createClient: () => createClient
|
|
17
|
+
});
|
|
18
|
+
import * as hrana2 from "@libsql/hrana-client";
|
|
19
|
+
import { LibsqlError as LibsqlError2 } from "@libsql/core/api";
|
|
20
|
+
import { expandConfig } from "@libsql/core/config";
|
|
21
|
+
|
|
22
|
+
// ../../node_modules/.pnpm/@libsql+client@0.17.4/node_modules/@libsql/client/lib-esm/hrana.js
|
|
23
|
+
import * as hrana from "@libsql/hrana-client";
|
|
24
|
+
import { LibsqlError, LibsqlBatchError } from "@libsql/core/api";
|
|
25
|
+
import { transactionModeToBegin, ResultSetImpl } from "@libsql/core/util";
|
|
26
|
+
var _mode, _version, _started;
|
|
27
|
+
var HranaTransaction = class {
|
|
28
|
+
/** @private */
|
|
29
|
+
constructor(mode, version) {
|
|
30
|
+
__privateAdd(this, _mode);
|
|
31
|
+
__privateAdd(this, _version);
|
|
32
|
+
// Promise that is resolved when the BEGIN statement completes, or `undefined` if we haven't executed the
|
|
33
|
+
// BEGIN statement yet.
|
|
34
|
+
__privateAdd(this, _started);
|
|
35
|
+
__privateSet(this, _mode, mode);
|
|
36
|
+
__privateSet(this, _version, version);
|
|
37
|
+
__privateSet(this, _started, void 0);
|
|
38
|
+
}
|
|
39
|
+
execute(stmt) {
|
|
40
|
+
return this.batch([stmt]).then((results) => results[0]);
|
|
41
|
+
}
|
|
42
|
+
async batch(stmts) {
|
|
43
|
+
const stream = this._getStream();
|
|
44
|
+
if (stream.closed) {
|
|
45
|
+
throw new LibsqlError("Cannot execute statements because the transaction is closed", "TRANSACTION_CLOSED");
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
const hranaStmts = stmts.map(stmtToHrana);
|
|
49
|
+
let rowsPromises;
|
|
50
|
+
if (__privateGet(this, _started) === void 0) {
|
|
51
|
+
this._getSqlCache().apply(hranaStmts);
|
|
52
|
+
const batch = stream.batch(__privateGet(this, _version) >= 3);
|
|
53
|
+
const beginStep = batch.step();
|
|
54
|
+
const beginPromise = beginStep.run(transactionModeToBegin(__privateGet(this, _mode)));
|
|
55
|
+
let lastStep = beginStep;
|
|
56
|
+
rowsPromises = hranaStmts.map((hranaStmt) => {
|
|
57
|
+
const stmtStep = batch.step().condition(hrana.BatchCond.ok(lastStep));
|
|
58
|
+
if (__privateGet(this, _version) >= 3) {
|
|
59
|
+
stmtStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));
|
|
60
|
+
}
|
|
61
|
+
const rowsPromise = stmtStep.query(hranaStmt);
|
|
62
|
+
rowsPromise.catch(() => void 0);
|
|
63
|
+
lastStep = stmtStep;
|
|
64
|
+
return rowsPromise;
|
|
65
|
+
});
|
|
66
|
+
__privateSet(this, _started, batch.execute().then(() => beginPromise).then(() => void 0));
|
|
67
|
+
try {
|
|
68
|
+
await __privateGet(this, _started);
|
|
69
|
+
} catch (e) {
|
|
70
|
+
this.close();
|
|
71
|
+
throw e;
|
|
72
|
+
}
|
|
73
|
+
} else {
|
|
74
|
+
if (__privateGet(this, _version) < 3) {
|
|
75
|
+
await __privateGet(this, _started);
|
|
76
|
+
} else {
|
|
77
|
+
}
|
|
78
|
+
this._getSqlCache().apply(hranaStmts);
|
|
79
|
+
const batch = stream.batch(__privateGet(this, _version) >= 3);
|
|
80
|
+
let lastStep = void 0;
|
|
81
|
+
rowsPromises = hranaStmts.map((hranaStmt) => {
|
|
82
|
+
const stmtStep = batch.step();
|
|
83
|
+
if (lastStep !== void 0) {
|
|
84
|
+
stmtStep.condition(hrana.BatchCond.ok(lastStep));
|
|
85
|
+
}
|
|
86
|
+
if (__privateGet(this, _version) >= 3) {
|
|
87
|
+
stmtStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));
|
|
88
|
+
}
|
|
89
|
+
const rowsPromise = stmtStep.query(hranaStmt);
|
|
90
|
+
rowsPromise.catch(() => void 0);
|
|
91
|
+
lastStep = stmtStep;
|
|
92
|
+
return rowsPromise;
|
|
93
|
+
});
|
|
94
|
+
await batch.execute();
|
|
95
|
+
}
|
|
96
|
+
const resultSets = [];
|
|
97
|
+
for (let i = 0; i < rowsPromises.length; i++) {
|
|
98
|
+
try {
|
|
99
|
+
const rows = await rowsPromises[i];
|
|
100
|
+
if (rows === void 0) {
|
|
101
|
+
throw new LibsqlBatchError("Statement in a transaction was not executed, probably because the transaction has been rolled back", i, "TRANSACTION_CLOSED");
|
|
102
|
+
}
|
|
103
|
+
resultSets.push(resultSetFromHrana(rows));
|
|
104
|
+
} catch (e) {
|
|
105
|
+
if (e instanceof LibsqlBatchError) {
|
|
106
|
+
throw e;
|
|
107
|
+
}
|
|
108
|
+
const mappedError = mapHranaError(e);
|
|
109
|
+
if (mappedError instanceof LibsqlError) {
|
|
110
|
+
throw new LibsqlBatchError(mappedError.message, i, mappedError.code, mappedError.extendedCode, mappedError.rawCode, mappedError.cause instanceof Error ? mappedError.cause : void 0);
|
|
111
|
+
}
|
|
112
|
+
throw mappedError;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return resultSets;
|
|
116
|
+
} catch (e) {
|
|
117
|
+
throw mapHranaError(e);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async executeMultiple(sql) {
|
|
121
|
+
const stream = this._getStream();
|
|
122
|
+
if (stream.closed) {
|
|
123
|
+
throw new LibsqlError("Cannot execute statements because the transaction is closed", "TRANSACTION_CLOSED");
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
if (__privateGet(this, _started) === void 0) {
|
|
127
|
+
__privateSet(this, _started, stream.run(transactionModeToBegin(__privateGet(this, _mode))).then(() => void 0));
|
|
128
|
+
try {
|
|
129
|
+
await __privateGet(this, _started);
|
|
130
|
+
} catch (e) {
|
|
131
|
+
this.close();
|
|
132
|
+
throw e;
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
await __privateGet(this, _started);
|
|
136
|
+
}
|
|
137
|
+
await stream.sequence(sql);
|
|
138
|
+
} catch (e) {
|
|
139
|
+
throw mapHranaError(e);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
async rollback() {
|
|
143
|
+
try {
|
|
144
|
+
const stream = this._getStream();
|
|
145
|
+
if (stream.closed) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
if (__privateGet(this, _started) !== void 0) {
|
|
149
|
+
} else {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
const promise = stream.run("ROLLBACK").catch((e) => {
|
|
153
|
+
throw mapHranaError(e);
|
|
154
|
+
});
|
|
155
|
+
stream.closeGracefully();
|
|
156
|
+
await promise;
|
|
157
|
+
} catch (e) {
|
|
158
|
+
throw mapHranaError(e);
|
|
159
|
+
} finally {
|
|
160
|
+
this.close();
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
async commit() {
|
|
164
|
+
try {
|
|
165
|
+
const stream = this._getStream();
|
|
166
|
+
if (stream.closed) {
|
|
167
|
+
throw new LibsqlError("Cannot commit the transaction because it is already closed", "TRANSACTION_CLOSED");
|
|
168
|
+
}
|
|
169
|
+
if (__privateGet(this, _started) !== void 0) {
|
|
170
|
+
await __privateGet(this, _started);
|
|
171
|
+
} else {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const promise = stream.run("COMMIT").catch((e) => {
|
|
175
|
+
throw mapHranaError(e);
|
|
176
|
+
});
|
|
177
|
+
stream.closeGracefully();
|
|
178
|
+
await promise;
|
|
179
|
+
} catch (e) {
|
|
180
|
+
throw mapHranaError(e);
|
|
181
|
+
} finally {
|
|
182
|
+
this.close();
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
_mode = new WeakMap();
|
|
187
|
+
_version = new WeakMap();
|
|
188
|
+
_started = new WeakMap();
|
|
189
|
+
async function executeHranaBatch(mode, version, batch, hranaStmts, disableForeignKeys = false) {
|
|
190
|
+
if (disableForeignKeys) {
|
|
191
|
+
batch.step().run("PRAGMA foreign_keys=off");
|
|
192
|
+
}
|
|
193
|
+
const beginStep = batch.step();
|
|
194
|
+
const beginPromise = beginStep.run(transactionModeToBegin(mode));
|
|
195
|
+
let lastStep = beginStep;
|
|
196
|
+
const stmtPromises = hranaStmts.map((hranaStmt) => {
|
|
197
|
+
const stmtStep = batch.step().condition(hrana.BatchCond.ok(lastStep));
|
|
198
|
+
if (version >= 3) {
|
|
199
|
+
stmtStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));
|
|
200
|
+
}
|
|
201
|
+
const stmtPromise = stmtStep.query(hranaStmt);
|
|
202
|
+
lastStep = stmtStep;
|
|
203
|
+
return stmtPromise;
|
|
204
|
+
});
|
|
205
|
+
const commitStep = batch.step().condition(hrana.BatchCond.ok(lastStep));
|
|
206
|
+
if (version >= 3) {
|
|
207
|
+
commitStep.condition(hrana.BatchCond.not(hrana.BatchCond.isAutocommit(batch)));
|
|
208
|
+
}
|
|
209
|
+
const commitPromise = commitStep.run("COMMIT");
|
|
210
|
+
const rollbackStep = batch.step().condition(hrana.BatchCond.not(hrana.BatchCond.ok(commitStep)));
|
|
211
|
+
rollbackStep.run("ROLLBACK").catch((_) => void 0);
|
|
212
|
+
if (disableForeignKeys) {
|
|
213
|
+
batch.step().run("PRAGMA foreign_keys=on");
|
|
214
|
+
}
|
|
215
|
+
await batch.execute();
|
|
216
|
+
const resultSets = [];
|
|
217
|
+
await beginPromise;
|
|
218
|
+
for (let i = 0; i < stmtPromises.length; i++) {
|
|
219
|
+
try {
|
|
220
|
+
const hranaRows = await stmtPromises[i];
|
|
221
|
+
if (hranaRows === void 0) {
|
|
222
|
+
throw new LibsqlBatchError("Statement in a batch was not executed, probably because the transaction has been rolled back", i, "TRANSACTION_CLOSED");
|
|
223
|
+
}
|
|
224
|
+
resultSets.push(resultSetFromHrana(hranaRows));
|
|
225
|
+
} catch (e) {
|
|
226
|
+
if (e instanceof LibsqlBatchError) {
|
|
227
|
+
throw e;
|
|
228
|
+
}
|
|
229
|
+
const mappedError = mapHranaError(e);
|
|
230
|
+
if (mappedError instanceof LibsqlError) {
|
|
231
|
+
throw new LibsqlBatchError(mappedError.message, i, mappedError.code, mappedError.extendedCode, mappedError.rawCode, mappedError.cause instanceof Error ? mappedError.cause : void 0);
|
|
232
|
+
}
|
|
233
|
+
throw mappedError;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
await commitPromise;
|
|
237
|
+
return resultSets;
|
|
238
|
+
}
|
|
239
|
+
function stmtToHrana(stmt) {
|
|
240
|
+
let sql;
|
|
241
|
+
let args;
|
|
242
|
+
if (Array.isArray(stmt)) {
|
|
243
|
+
[sql, args] = stmt;
|
|
244
|
+
} else if (typeof stmt === "string") {
|
|
245
|
+
sql = stmt;
|
|
246
|
+
} else {
|
|
247
|
+
sql = stmt.sql;
|
|
248
|
+
args = stmt.args;
|
|
249
|
+
}
|
|
250
|
+
const hranaStmt = new hrana.Stmt(sql);
|
|
251
|
+
if (args) {
|
|
252
|
+
if (Array.isArray(args)) {
|
|
253
|
+
hranaStmt.bindIndexes(args);
|
|
254
|
+
} else {
|
|
255
|
+
for (const [key, value] of Object.entries(args)) {
|
|
256
|
+
hranaStmt.bindName(key, value);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return hranaStmt;
|
|
261
|
+
}
|
|
262
|
+
function resultSetFromHrana(hranaRows) {
|
|
263
|
+
const columns = hranaRows.columnNames.map((c) => c ?? "");
|
|
264
|
+
const columnTypes = hranaRows.columnDecltypes.map((c) => c ?? "");
|
|
265
|
+
const rows = hranaRows.rows;
|
|
266
|
+
const rowsAffected = hranaRows.affectedRowCount;
|
|
267
|
+
const lastInsertRowid = hranaRows.lastInsertRowid !== void 0 ? hranaRows.lastInsertRowid : void 0;
|
|
268
|
+
return new ResultSetImpl(columns, columnTypes, rows, rowsAffected, lastInsertRowid);
|
|
269
|
+
}
|
|
270
|
+
function mapHranaError(e) {
|
|
271
|
+
if (e instanceof hrana.ClientError) {
|
|
272
|
+
const code = mapHranaErrorCode(e);
|
|
273
|
+
return new LibsqlError(e.message, code, void 0, void 0, e);
|
|
274
|
+
}
|
|
275
|
+
return e;
|
|
276
|
+
}
|
|
277
|
+
function mapHranaErrorCode(e) {
|
|
278
|
+
if (e instanceof hrana.ResponseError && e.code !== void 0) {
|
|
279
|
+
return e.code;
|
|
280
|
+
} else if (e instanceof hrana.ProtoError) {
|
|
281
|
+
return "HRANA_PROTO_ERROR";
|
|
282
|
+
} else if (e instanceof hrana.ClosedError) {
|
|
283
|
+
return e.cause instanceof hrana.ClientError ? mapHranaErrorCode(e.cause) : "HRANA_CLOSED_ERROR";
|
|
284
|
+
} else if (e instanceof hrana.WebSocketError) {
|
|
285
|
+
return "HRANA_WEBSOCKET_ERROR";
|
|
286
|
+
} else if (e instanceof hrana.HttpServerError) {
|
|
287
|
+
return "SERVER_ERROR";
|
|
288
|
+
} else if (e instanceof hrana.ProtocolVersionError) {
|
|
289
|
+
return "PROTOCOL_VERSION_ERROR";
|
|
290
|
+
} else if (e instanceof hrana.InternalError) {
|
|
291
|
+
return "INTERNAL_ERROR";
|
|
292
|
+
} else {
|
|
293
|
+
return "UNKNOWN";
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// ../../node_modules/.pnpm/@libsql+client@0.17.4/node_modules/@libsql/client/lib-esm/sql_cache.js
|
|
298
|
+
var _owner, _sqls;
|
|
299
|
+
var SqlCache = class {
|
|
300
|
+
constructor(owner, capacity) {
|
|
301
|
+
__privateAdd(this, _owner);
|
|
302
|
+
__privateAdd(this, _sqls);
|
|
303
|
+
__publicField(this, "capacity");
|
|
304
|
+
__privateSet(this, _owner, owner);
|
|
305
|
+
__privateSet(this, _sqls, new Lru());
|
|
306
|
+
this.capacity = capacity;
|
|
307
|
+
}
|
|
308
|
+
// Replaces SQL strings with cached `hrana.Sql` objects in the statements in `hranaStmts`. After this
|
|
309
|
+
// function returns, we guarantee that all `hranaStmts` refer to valid (not closed) `hrana.Sql` objects,
|
|
310
|
+
// but _we may invalidate any other `hrana.Sql` objects_ (by closing them, thus removing them from the
|
|
311
|
+
// server).
|
|
312
|
+
//
|
|
313
|
+
// In practice, this means that after calling this function, you can use the statements only up to the
|
|
314
|
+
// first `await`, because concurrent code may also use the cache and invalidate those statements.
|
|
315
|
+
apply(hranaStmts) {
|
|
316
|
+
if (this.capacity <= 0) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const usedSqlObjs = /* @__PURE__ */ new Set();
|
|
320
|
+
for (const hranaStmt of hranaStmts) {
|
|
321
|
+
if (typeof hranaStmt.sql !== "string") {
|
|
322
|
+
continue;
|
|
323
|
+
}
|
|
324
|
+
const sqlText = hranaStmt.sql;
|
|
325
|
+
if (sqlText.length >= 5e3) {
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
let sqlObj = __privateGet(this, _sqls).get(sqlText);
|
|
329
|
+
if (sqlObj === void 0) {
|
|
330
|
+
while (__privateGet(this, _sqls).size + 1 > this.capacity) {
|
|
331
|
+
const [evictSqlText, evictSqlObj] = __privateGet(this, _sqls).peekLru();
|
|
332
|
+
if (usedSqlObjs.has(evictSqlObj)) {
|
|
333
|
+
break;
|
|
334
|
+
}
|
|
335
|
+
evictSqlObj.close();
|
|
336
|
+
__privateGet(this, _sqls).delete(evictSqlText);
|
|
337
|
+
}
|
|
338
|
+
if (__privateGet(this, _sqls).size + 1 <= this.capacity) {
|
|
339
|
+
sqlObj = __privateGet(this, _owner).storeSql(sqlText);
|
|
340
|
+
__privateGet(this, _sqls).set(sqlText, sqlObj);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (sqlObj !== void 0) {
|
|
344
|
+
hranaStmt.sql = sqlObj;
|
|
345
|
+
usedSqlObjs.add(sqlObj);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
_owner = new WeakMap();
|
|
351
|
+
_sqls = new WeakMap();
|
|
352
|
+
var _cache;
|
|
353
|
+
var Lru = class {
|
|
354
|
+
constructor() {
|
|
355
|
+
// This maps keys to the cache values. The entries are ordered by their last use (entires that were used
|
|
356
|
+
// most recently are at the end).
|
|
357
|
+
__privateAdd(this, _cache);
|
|
358
|
+
__privateSet(this, _cache, /* @__PURE__ */ new Map());
|
|
359
|
+
}
|
|
360
|
+
get(key) {
|
|
361
|
+
const value = __privateGet(this, _cache).get(key);
|
|
362
|
+
if (value !== void 0) {
|
|
363
|
+
__privateGet(this, _cache).delete(key);
|
|
364
|
+
__privateGet(this, _cache).set(key, value);
|
|
365
|
+
}
|
|
366
|
+
return value;
|
|
367
|
+
}
|
|
368
|
+
set(key, value) {
|
|
369
|
+
__privateGet(this, _cache).set(key, value);
|
|
370
|
+
}
|
|
371
|
+
peekLru() {
|
|
372
|
+
for (const entry of __privateGet(this, _cache).entries()) {
|
|
373
|
+
return entry;
|
|
374
|
+
}
|
|
375
|
+
return void 0;
|
|
376
|
+
}
|
|
377
|
+
delete(key) {
|
|
378
|
+
__privateGet(this, _cache).delete(key);
|
|
379
|
+
}
|
|
380
|
+
get size() {
|
|
381
|
+
return __privateGet(this, _cache).size;
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
_cache = new WeakMap();
|
|
385
|
+
|
|
386
|
+
// ../../node_modules/.pnpm/@libsql+client@0.17.4/node_modules/@libsql/client/lib-esm/http.js
|
|
387
|
+
__reExport(http_exports, api_star);
|
|
388
|
+
import { encodeBaseUrl } from "@libsql/core/uri";
|
|
389
|
+
import { supportedUrlLink } from "@libsql/core/util";
|
|
390
|
+
import promiseLimit from "promise-limit";
|
|
391
|
+
import * as api_star from "@libsql/core/api";
|
|
392
|
+
function createClient(config) {
|
|
393
|
+
return _createClient(expandConfig(config, true));
|
|
394
|
+
}
|
|
395
|
+
function _createClient(config) {
|
|
396
|
+
if (config.scheme !== "https" && config.scheme !== "http") {
|
|
397
|
+
throw new LibsqlError2(`The HTTP client supports only "libsql:", "https:" and "http:" URLs, got ${JSON.stringify(config.scheme + ":")}. For more information, please read ${supportedUrlLink}`, "URL_SCHEME_NOT_SUPPORTED");
|
|
398
|
+
}
|
|
399
|
+
if (config.encryptionKey !== void 0) {
|
|
400
|
+
throw new LibsqlError2("Encryption key is not supported by the remote client.", "ENCRYPTION_KEY_NOT_SUPPORTED");
|
|
401
|
+
}
|
|
402
|
+
if (config.scheme === "http" && config.tls) {
|
|
403
|
+
throw new LibsqlError2(`A "http:" URL cannot opt into TLS by using ?tls=1`, "URL_INVALID");
|
|
404
|
+
} else if (config.scheme === "https" && !config.tls) {
|
|
405
|
+
throw new LibsqlError2(`A "https:" URL cannot opt out of TLS by using ?tls=0`, "URL_INVALID");
|
|
406
|
+
}
|
|
407
|
+
const url = encodeBaseUrl(config.scheme, config.authority, config.path);
|
|
408
|
+
return new HttpClient(url, config.authToken, config.intMode, config.fetch, config.concurrency, config.remoteEncryptionKey);
|
|
409
|
+
}
|
|
410
|
+
var sqlCacheCapacity = 30;
|
|
411
|
+
var _client, _url, _intMode, _customFetch, _concurrency, _authToken, _remoteEncryptionKey, _promiseLimitFunction;
|
|
412
|
+
var HttpClient = class {
|
|
413
|
+
/** @private */
|
|
414
|
+
constructor(url, authToken, intMode, customFetch, concurrency, remoteEncryptionKey) {
|
|
415
|
+
__privateAdd(this, _client);
|
|
416
|
+
__publicField(this, "protocol");
|
|
417
|
+
__privateAdd(this, _url);
|
|
418
|
+
__privateAdd(this, _intMode);
|
|
419
|
+
__privateAdd(this, _customFetch);
|
|
420
|
+
__privateAdd(this, _concurrency);
|
|
421
|
+
__privateAdd(this, _authToken);
|
|
422
|
+
__privateAdd(this, _remoteEncryptionKey);
|
|
423
|
+
__privateAdd(this, _promiseLimitFunction);
|
|
424
|
+
__privateSet(this, _url, url);
|
|
425
|
+
__privateSet(this, _authToken, authToken);
|
|
426
|
+
__privateSet(this, _intMode, intMode);
|
|
427
|
+
__privateSet(this, _customFetch, customFetch);
|
|
428
|
+
__privateSet(this, _concurrency, concurrency);
|
|
429
|
+
__privateSet(this, _remoteEncryptionKey, remoteEncryptionKey);
|
|
430
|
+
__privateSet(this, _client, hrana2.openHttp(__privateGet(this, _url), __privateGet(this, _authToken), __privateGet(this, _customFetch), remoteEncryptionKey));
|
|
431
|
+
__privateGet(this, _client).intMode = __privateGet(this, _intMode);
|
|
432
|
+
this.protocol = "http";
|
|
433
|
+
__privateSet(this, _promiseLimitFunction, promiseLimit(__privateGet(this, _concurrency)));
|
|
434
|
+
}
|
|
435
|
+
async limit(fn) {
|
|
436
|
+
return __privateGet(this, _promiseLimitFunction).call(this, fn);
|
|
437
|
+
}
|
|
438
|
+
async execute(stmtOrSql, args) {
|
|
439
|
+
let stmt;
|
|
440
|
+
if (typeof stmtOrSql === "string") {
|
|
441
|
+
stmt = {
|
|
442
|
+
sql: stmtOrSql,
|
|
443
|
+
args: args || []
|
|
444
|
+
};
|
|
445
|
+
} else {
|
|
446
|
+
stmt = stmtOrSql;
|
|
447
|
+
}
|
|
448
|
+
return this.limit(async () => {
|
|
449
|
+
try {
|
|
450
|
+
const hranaStmt = stmtToHrana(stmt);
|
|
451
|
+
let rowsPromise;
|
|
452
|
+
const stream = __privateGet(this, _client).openStream();
|
|
453
|
+
try {
|
|
454
|
+
rowsPromise = stream.query(hranaStmt);
|
|
455
|
+
} finally {
|
|
456
|
+
stream.closeGracefully();
|
|
457
|
+
}
|
|
458
|
+
const rowsResult = await rowsPromise;
|
|
459
|
+
return resultSetFromHrana(rowsResult);
|
|
460
|
+
} catch (e) {
|
|
461
|
+
throw mapHranaError(e);
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
async batch(stmts, mode = "deferred") {
|
|
466
|
+
return this.limit(async () => {
|
|
467
|
+
try {
|
|
468
|
+
const normalizedStmts = stmts.map((stmt) => {
|
|
469
|
+
if (Array.isArray(stmt)) {
|
|
470
|
+
return {
|
|
471
|
+
sql: stmt[0],
|
|
472
|
+
args: stmt[1] || []
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
return stmt;
|
|
476
|
+
});
|
|
477
|
+
const hranaStmts = normalizedStmts.map(stmtToHrana);
|
|
478
|
+
const version = await __privateGet(this, _client).getVersion();
|
|
479
|
+
let resultsPromise;
|
|
480
|
+
const stream = __privateGet(this, _client).openStream();
|
|
481
|
+
try {
|
|
482
|
+
const sqlCache = new SqlCache(stream, sqlCacheCapacity);
|
|
483
|
+
sqlCache.apply(hranaStmts);
|
|
484
|
+
const batch = stream.batch(false);
|
|
485
|
+
resultsPromise = executeHranaBatch(mode, version, batch, hranaStmts);
|
|
486
|
+
} finally {
|
|
487
|
+
stream.closeGracefully();
|
|
488
|
+
}
|
|
489
|
+
const results = await resultsPromise;
|
|
490
|
+
return results;
|
|
491
|
+
} catch (e) {
|
|
492
|
+
throw mapHranaError(e);
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
async migrate(stmts) {
|
|
497
|
+
return this.limit(async () => {
|
|
498
|
+
try {
|
|
499
|
+
const hranaStmts = stmts.map(stmtToHrana);
|
|
500
|
+
const version = await __privateGet(this, _client).getVersion();
|
|
501
|
+
let resultsPromise;
|
|
502
|
+
const stream = __privateGet(this, _client).openStream();
|
|
503
|
+
try {
|
|
504
|
+
const batch = stream.batch(false);
|
|
505
|
+
resultsPromise = executeHranaBatch("deferred", version, batch, hranaStmts, true);
|
|
506
|
+
} finally {
|
|
507
|
+
stream.closeGracefully();
|
|
508
|
+
}
|
|
509
|
+
const results = await resultsPromise;
|
|
510
|
+
return results;
|
|
511
|
+
} catch (e) {
|
|
512
|
+
throw mapHranaError(e);
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
async transaction(mode = "write") {
|
|
517
|
+
return this.limit(async () => {
|
|
518
|
+
try {
|
|
519
|
+
const version = await __privateGet(this, _client).getVersion();
|
|
520
|
+
return new HttpTransaction(__privateGet(this, _client).openStream(), mode, version);
|
|
521
|
+
} catch (e) {
|
|
522
|
+
throw mapHranaError(e);
|
|
523
|
+
}
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
async executeMultiple(sql) {
|
|
527
|
+
return this.limit(async () => {
|
|
528
|
+
try {
|
|
529
|
+
let promise;
|
|
530
|
+
const stream = __privateGet(this, _client).openStream();
|
|
531
|
+
try {
|
|
532
|
+
promise = stream.sequence(sql);
|
|
533
|
+
} finally {
|
|
534
|
+
stream.closeGracefully();
|
|
535
|
+
}
|
|
536
|
+
await promise;
|
|
537
|
+
} catch (e) {
|
|
538
|
+
throw mapHranaError(e);
|
|
539
|
+
}
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
sync() {
|
|
543
|
+
throw new LibsqlError2("sync not supported in http mode", "SYNC_NOT_SUPPORTED");
|
|
544
|
+
}
|
|
545
|
+
close() {
|
|
546
|
+
__privateGet(this, _client).close();
|
|
547
|
+
}
|
|
548
|
+
async reconnect() {
|
|
549
|
+
try {
|
|
550
|
+
if (!this.closed) {
|
|
551
|
+
__privateGet(this, _client).close();
|
|
552
|
+
}
|
|
553
|
+
} finally {
|
|
554
|
+
__privateSet(this, _client, hrana2.openHttp(__privateGet(this, _url), __privateGet(this, _authToken), __privateGet(this, _customFetch), __privateGet(this, _remoteEncryptionKey)));
|
|
555
|
+
__privateGet(this, _client).intMode = __privateGet(this, _intMode);
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
get closed() {
|
|
559
|
+
return __privateGet(this, _client).closed;
|
|
560
|
+
}
|
|
561
|
+
};
|
|
562
|
+
_client = new WeakMap();
|
|
563
|
+
_url = new WeakMap();
|
|
564
|
+
_intMode = new WeakMap();
|
|
565
|
+
_customFetch = new WeakMap();
|
|
566
|
+
_concurrency = new WeakMap();
|
|
567
|
+
_authToken = new WeakMap();
|
|
568
|
+
_remoteEncryptionKey = new WeakMap();
|
|
569
|
+
_promiseLimitFunction = new WeakMap();
|
|
570
|
+
var _stream, _sqlCache;
|
|
571
|
+
var HttpTransaction = class extends HranaTransaction {
|
|
572
|
+
/** @private */
|
|
573
|
+
constructor(stream, mode, version) {
|
|
574
|
+
super(mode, version);
|
|
575
|
+
__privateAdd(this, _stream);
|
|
576
|
+
__privateAdd(this, _sqlCache);
|
|
577
|
+
__privateSet(this, _stream, stream);
|
|
578
|
+
__privateSet(this, _sqlCache, new SqlCache(stream, sqlCacheCapacity));
|
|
579
|
+
}
|
|
580
|
+
/** @private */
|
|
581
|
+
_getStream() {
|
|
582
|
+
return __privateGet(this, _stream);
|
|
583
|
+
}
|
|
584
|
+
/** @private */
|
|
585
|
+
_getSqlCache() {
|
|
586
|
+
return __privateGet(this, _sqlCache);
|
|
587
|
+
}
|
|
588
|
+
close() {
|
|
589
|
+
__privateGet(this, _stream).close();
|
|
590
|
+
}
|
|
591
|
+
get closed() {
|
|
592
|
+
return __privateGet(this, _stream).closed;
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
_stream = new WeakMap();
|
|
596
|
+
_sqlCache = new WeakMap();
|
|
597
|
+
export {
|
|
598
|
+
createClient
|
|
599
|
+
};
|
|
600
|
+
/*! Includes @libsql/client/http 0.17.4, MIT License, https://github.com/tursodatabase/libsql-client-ts */
|