@smthrs/platform-bun 0.0.0-stage → 1.0.0-rc.13
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/CHANGELOG.md +73 -0
- package/LICENSE +21 -0
- package/README.md +110 -2
- package/dist/cjs/BunFileSystem.d.ts +44 -0
- package/dist/cjs/BunFileSystem.d.ts.map +1 -0
- package/dist/cjs/BunFileSystem.js +38 -0
- package/dist/cjs/BunFileSystem.js.map +7 -0
- package/dist/cjs/BunHost.d.ts +205 -0
- package/dist/cjs/BunHost.d.ts.map +1 -0
- package/dist/cjs/BunHost.js +148 -0
- package/dist/cjs/BunHost.js.map +7 -0
- package/dist/cjs/index.d.ts +26 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +37 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/BunFileSystem.d.ts +44 -0
- package/dist/esm/BunFileSystem.d.ts.map +1 -0
- package/dist/esm/BunFileSystem.js +35 -0
- package/dist/esm/BunFileSystem.js.map +1 -0
- package/dist/esm/BunHost.d.ts +205 -0
- package/dist/esm/BunHost.d.ts.map +1 -0
- package/dist/esm/BunHost.js +248 -0
- package/dist/esm/BunHost.js.map +1 -0
- package/dist/esm/index.d.ts +26 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/vendor/adapters.json +3067 -0
- package/dist/vendor/bun/BunAddressResolver.d.ts +15 -0
- package/dist/vendor/bun/BunAddressResolver.js +8 -0
- package/dist/vendor/bun/BunChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/bun/BunChildProcessSpawner.js +14 -0
- package/dist/vendor/bun/BunClusterHttp.d.ts +76 -0
- package/dist/vendor/bun/BunClusterHttp.js +39 -0
- package/dist/vendor/bun/BunClusterSocket.d.ts +70 -0
- package/dist/vendor/bun/BunClusterSocket.js +22 -0
- package/dist/vendor/bun/BunCrypto.d.ts +11 -0
- package/dist/vendor/bun/BunCrypto.js +8 -0
- package/dist/vendor/bun/BunDatagramSocket.d.ts +227 -0
- package/dist/vendor/bun/BunDatagramSocket.js +11 -0
- package/dist/vendor/bun/BunDns.d.ts +72 -0
- package/dist/vendor/bun/BunDns.js +12 -0
- package/dist/vendor/bun/BunFileSystem.d.ts +11 -0
- package/dist/vendor/bun/BunFileSystem.js +9 -0
- package/dist/vendor/bun/BunHttpClient.d.ts +10 -0
- package/dist/vendor/bun/BunHttpClient.js +1 -0
- package/dist/vendor/bun/BunHttpPlatform.d.ts +11 -0
- package/dist/vendor/bun/BunHttpPlatform.js +11 -0
- package/dist/vendor/bun/BunHttpServer.d.ts +151 -0
- package/dist/vendor/bun/BunHttpServer.js +38 -0
- package/dist/vendor/bun/BunHttpServerRequest.d.ts +20 -0
- package/dist/vendor/bun/BunHttpServerRequest.js +7 -0
- package/dist/vendor/bun/BunMultipart.d.ts +34 -0
- package/dist/vendor/bun/BunMultipart.js +12 -0
- package/dist/vendor/bun/BunPath.d.ts +27 -0
- package/dist/vendor/bun/BunPath.js +12 -0
- package/dist/vendor/bun/BunRedis.d.ts +53 -0
- package/dist/vendor/bun/BunRedis.js +11 -0
- package/dist/vendor/bun/BunRuntime.d.ts +88 -0
- package/dist/vendor/bun/BunRuntime.js +8 -0
- package/dist/vendor/bun/BunServices.d.ts +37 -0
- package/dist/vendor/bun/BunServices.js +23 -0
- package/dist/vendor/bun/BunSink.d.ts +9 -0
- package/dist/vendor/bun/BunSink.js +12 -0
- package/dist/vendor/bun/BunSocket.d.ts +45 -0
- package/dist/vendor/bun/BunSocket.js +29 -0
- package/dist/vendor/bun/BunSocketServer.d.ts +9 -0
- package/dist/vendor/bun/BunSocketServer.js +21 -0
- package/dist/vendor/bun/BunStdio.d.ts +12 -0
- package/dist/vendor/bun/BunStdio.js +10 -0
- package/dist/vendor/bun/BunStream.d.ts +20 -0
- package/dist/vendor/bun/BunStream.js +30 -0
- package/dist/vendor/bun/BunTerminal.d.ts +24 -0
- package/dist/vendor/bun/BunTerminal.js +10 -0
- package/dist/vendor/bun/BunWorker.d.ts +22 -0
- package/dist/vendor/bun/BunWorker.js +9 -0
- package/dist/vendor/bun/BunWorkerRunner.d.ts +13 -0
- package/dist/vendor/bun/BunWorkerRunner.js +7 -0
- package/dist/vendor/bun/LICENSE +21 -0
- package/dist/vendor/bun/index.d.ts +130 -0
- package/dist/vendor/bun/index.js +121 -0
- package/dist/vendor/chunk-226TYKP6.js +60 -0
- package/dist/vendor/chunk-2ADOI6ZN.js +18 -0
- package/dist/vendor/chunk-2AP6TO77.js +71 -0
- package/dist/vendor/chunk-2LGUVSNM.js +20 -0
- package/dist/vendor/chunk-3SUO3TTE.js +40 -0
- package/dist/vendor/chunk-4O4Z52A2.js +48 -0
- package/dist/vendor/chunk-4YK2MHSO.js +20 -0
- package/dist/vendor/chunk-6B775XB2.js +85 -0
- package/dist/vendor/chunk-6KYVM2ZC.js +419 -0
- package/dist/vendor/chunk-6QPSLCUZ.js +0 -0
- package/dist/vendor/chunk-6R444NFO.js +104 -0
- package/dist/vendor/chunk-7JOAEKDV.js +503 -0
- package/dist/vendor/chunk-7VJC3PHX.js +63 -0
- package/dist/vendor/chunk-7ZKNPDTP.js +26 -0
- package/dist/vendor/chunk-ABPRHPJP.js +15 -0
- package/dist/vendor/chunk-AMAL6TRE.js +93 -0
- package/dist/vendor/chunk-AW6WQVI7.js +29 -0
- package/dist/vendor/chunk-BHV44Z6K.js +36 -0
- package/dist/vendor/chunk-BIR74JJK.js +93 -0
- package/dist/vendor/chunk-BTXZUHUI.js +7 -0
- package/dist/vendor/chunk-BVV46N3V.js +515 -0
- package/dist/vendor/chunk-C7UMBJO6.js +31 -0
- package/dist/vendor/chunk-CN4K2U6M.js +20 -0
- package/dist/vendor/chunk-D6XNHJPW.js +18 -0
- package/dist/vendor/chunk-DHTPLWAP.js +34 -0
- package/dist/vendor/chunk-DWSNOBD4.js +18 -0
- package/dist/vendor/chunk-DX4VFONH.js +81 -0
- package/dist/vendor/chunk-EIO7BKW3.js +63 -0
- package/dist/vendor/chunk-FIPFWLCV.js +144 -0
- package/dist/vendor/chunk-GITB76ZP.js +22 -0
- package/dist/vendor/chunk-GMORYZG4.js +62 -0
- package/dist/vendor/chunk-HXGVOKHF.js +22 -0
- package/dist/vendor/chunk-HYPKWCVW.js +374 -0
- package/dist/vendor/chunk-IJON5WTO.js +34 -0
- package/dist/vendor/chunk-IXI7RW3A.js +580 -0
- package/dist/vendor/chunk-J43O5GFH.js +28 -0
- package/dist/vendor/chunk-JTST2Z7N.js +58 -0
- package/dist/vendor/chunk-JYD572EF.js +18 -0
- package/dist/vendor/chunk-K6GWBGJM.js +16 -0
- package/dist/vendor/chunk-KANNAI65.js +62 -0
- package/dist/vendor/chunk-KEMBVIRS.js +128 -0
- package/dist/vendor/chunk-LOB26XOO.js +0 -0
- package/dist/vendor/chunk-M2QOSF47.js +53 -0
- package/dist/vendor/chunk-MLKGABMK.js +9 -0
- package/dist/vendor/chunk-NGGMPIWR.js +65 -0
- package/dist/vendor/chunk-NNTJGFLB.js +21 -0
- package/dist/vendor/chunk-NU53DHQR.js +18 -0
- package/dist/vendor/chunk-OAY4MA3I.js +28 -0
- package/dist/vendor/chunk-OV2KKGBA.js +16 -0
- package/dist/vendor/chunk-PBM2HJOX.js +118 -0
- package/dist/vendor/chunk-Q5UCOQNO.js +70 -0
- package/dist/vendor/chunk-Q7YXUH7M.js +414 -0
- package/dist/vendor/chunk-QKYYD3AZ.js +131 -0
- package/dist/vendor/chunk-QLI7T34M.js +18 -0
- package/dist/vendor/chunk-QR2ZOVOL.js +18 -0
- package/dist/vendor/chunk-R2PFJKSP.js +274 -0
- package/dist/vendor/chunk-RX5TKFP7.js +51 -0
- package/dist/vendor/chunk-S3MN5OXB.js +34 -0
- package/dist/vendor/chunk-T5WDTZCE.js +249 -0
- package/dist/vendor/chunk-TBMTA5LD.js +14 -0
- package/dist/vendor/chunk-TCKM3JXD.js +325 -0
- package/dist/vendor/chunk-UXIG7ALP.js +229 -0
- package/dist/vendor/chunk-V577GRCI.js +438 -0
- package/dist/vendor/chunk-VS6VBUH6.js +57 -0
- package/dist/vendor/chunk-WGUQHMX2.js +18 -0
- package/dist/vendor/chunk-WNS3OER2.js +18 -0
- package/dist/vendor/chunk-X6FYP2EH.js +109 -0
- package/dist/vendor/chunk-XAVBQY4D.js +20 -0
- package/dist/vendor/chunk-XAZH2ZEU.js +43 -0
- package/dist/vendor/chunk-XDPP24MG.js +129 -0
- package/dist/vendor/chunk-XF3WZCMZ.js +26 -0
- package/dist/vendor/chunk-XXVMTKX5.js +0 -0
- package/dist/vendor/chunk-YJGNV6EV.js +85 -0
- package/dist/vendor/chunk-ZJEHEPDQ.js +18 -0
- package/dist/vendor/cjs/bun/BunAddressResolver.d.ts +15 -0
- package/dist/vendor/cjs/bun/BunAddressResolver.js +1 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.d.ts +76 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.d.ts +70 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunCrypto.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunCrypto.js +1 -0
- package/dist/vendor/cjs/bun/BunDatagramSocket.d.ts +227 -0
- package/dist/vendor/cjs/bun/BunDatagramSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunDns.d.ts +72 -0
- package/dist/vendor/cjs/bun/BunDns.js +1 -0
- package/dist/vendor/cjs/bun/BunFileSystem.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunFileSystem.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpClient.d.ts +10 -0
- package/dist/vendor/cjs/bun/BunHttpClient.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServer.d.ts +151 -0
- package/dist/vendor/cjs/bun/BunHttpServer.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.d.ts +20 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/bun/BunMultipart.d.ts +34 -0
- package/dist/vendor/cjs/bun/BunMultipart.js +1 -0
- package/dist/vendor/cjs/bun/BunPath.d.ts +27 -0
- package/dist/vendor/cjs/bun/BunPath.js +1 -0
- package/dist/vendor/cjs/bun/BunRedis.d.ts +53 -0
- package/dist/vendor/cjs/bun/BunRedis.js +1 -0
- package/dist/vendor/cjs/bun/BunRuntime.d.ts +88 -0
- package/dist/vendor/cjs/bun/BunRuntime.js +1 -0
- package/dist/vendor/cjs/bun/BunServices.d.ts +37 -0
- package/dist/vendor/cjs/bun/BunServices.js +1 -0
- package/dist/vendor/cjs/bun/BunSink.d.ts +9 -0
- package/dist/vendor/cjs/bun/BunSink.js +1 -0
- package/dist/vendor/cjs/bun/BunSocket.d.ts +45 -0
- package/dist/vendor/cjs/bun/BunSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunSocketServer.d.ts +9 -0
- package/dist/vendor/cjs/bun/BunSocketServer.js +1 -0
- package/dist/vendor/cjs/bun/BunStdio.d.ts +12 -0
- package/dist/vendor/cjs/bun/BunStdio.js +1 -0
- package/dist/vendor/cjs/bun/BunStream.d.ts +20 -0
- package/dist/vendor/cjs/bun/BunStream.js +1 -0
- package/dist/vendor/cjs/bun/BunTerminal.d.ts +24 -0
- package/dist/vendor/cjs/bun/BunTerminal.js +1 -0
- package/dist/vendor/cjs/bun/BunWorker.d.ts +22 -0
- package/dist/vendor/cjs/bun/BunWorker.js +1 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.d.ts +13 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.js +1 -0
- package/dist/vendor/cjs/bun/index.d.ts +130 -0
- package/dist/vendor/cjs/bun/index.js +1 -0
- package/dist/vendor/cjs/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/cjs/node/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +54 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +85 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeCrypto.d.ts +11 -0
- package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeDns.d.ts +51 -0
- package/dist/vendor/cjs/node/NodeDns.js +1 -0
- package/dist/vendor/cjs/node/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpClient.d.ts +303 -0
- package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +64 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +38 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServer.d.ts +131 -0
- package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +32 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipart.d.ts +50 -0
- package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +105 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
- package/dist/vendor/cjs/node/NodePath.d.ts +30 -0
- package/dist/vendor/cjs/node/NodePath.js +1 -0
- package/dist/vendor/cjs/node/NodeRedis.d.ts +78 -0
- package/dist/vendor/cjs/node/NodeRedis.js +1 -0
- package/dist/vendor/cjs/node/NodeRuntime.d.ts +88 -0
- package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node/NodeServices.d.ts +37 -0
- package/dist/vendor/cjs/node/NodeServices.js +1 -0
- package/dist/vendor/cjs/node/NodeSink.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeSink.js +1 -0
- package/dist/vendor/cjs/node/NodeSocket.d.ts +45 -0
- package/dist/vendor/cjs/node/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeSocketServer.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node/NodeStdio.d.ts +12 -0
- package/dist/vendor/cjs/node/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node/NodeStream.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeStream.js +1 -0
- package/dist/vendor/cjs/node/NodeTerminal.d.ts +24 -0
- package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node/NodeWorker.d.ts +24 -0
- package/dist/vendor/cjs/node/NodeWorker.js +1 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +13 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
- package/dist/vendor/cjs/node/Undici.d.ts +31 -0
- package/dist/vendor/cjs/node/Undici.js +1 -0
- package/dist/vendor/cjs/node/index.d.ts +140 -0
- package/dist/vendor/cjs/node/index.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +66 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +35 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +30 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/cjs/node-shared/NodeDns.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +12 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +40 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
- package/dist/vendor/cjs/node-shared/NodePath.d.ts +30 -0
- package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +51 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSink.d.ts +73 -0
- package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +144 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +87 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +13 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStream.d.ts +194 -0
- package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +24 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node-shared/index.d.ts +85 -0
- package/dist/vendor/cjs/node-shared/index.js +1 -0
- package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
- package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node-shared/internal/utils.d.ts +2 -0
- package/dist/vendor/cjs/node-shared/internal/utils.js +1 -0
- package/dist/vendor/cjs/package.json +1 -0
- package/dist/vendor/cjs/platform-bun.d.ts +130 -0
- package/dist/vendor/cjs/platform-bun.js +1 -0
- package/dist/vendor/cjs/platform-node-shared.d.ts +85 -0
- package/dist/vendor/cjs/platform-node-shared.js +1 -0
- package/dist/vendor/cjs/platform-node.d.ts +140 -0
- package/dist/vendor/cjs/platform-node.js +1 -0
- package/dist/vendor/node/LICENSE +21 -0
- package/dist/vendor/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/node/NodeAddressResolver.js +8 -0
- package/dist/vendor/node/NodeChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
- package/dist/vendor/node/NodeClusterHttp.d.ts +54 -0
- package/dist/vendor/node/NodeClusterHttp.js +43 -0
- package/dist/vendor/node/NodeClusterSocket.d.ts +85 -0
- package/dist/vendor/node/NodeClusterSocket.js +30 -0
- package/dist/vendor/node/NodeCrypto.d.ts +11 -0
- package/dist/vendor/node/NodeCrypto.js +8 -0
- package/dist/vendor/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/node/NodeDatagramSocket.js +12 -0
- package/dist/vendor/node/NodeDns.d.ts +51 -0
- package/dist/vendor/node/NodeDns.js +12 -0
- package/dist/vendor/node/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/node/NodeFileSystem.js +9 -0
- package/dist/vendor/node/NodeHttpClient.d.ts +303 -0
- package/dist/vendor/node/NodeHttpClient.js +54 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +64 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
- package/dist/vendor/node/NodeHttpPlatform.d.ts +38 -0
- package/dist/vendor/node/NodeHttpPlatform.js +16 -0
- package/dist/vendor/node/NodeHttpServer.d.ts +131 -0
- package/dist/vendor/node/NodeHttpServer.js +46 -0
- package/dist/vendor/node/NodeHttpServerRequest.d.ts +32 -0
- package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
- package/dist/vendor/node/NodeMultipart.d.ts +50 -0
- package/dist/vendor/node/NodeMultipart.js +15 -0
- package/dist/vendor/node/NodeMultipartParser.d.ts +105 -0
- package/dist/vendor/node/NodeMultipartParser.js +11 -0
- package/dist/vendor/node/NodePath.d.ts +30 -0
- package/dist/vendor/node/NodePath.js +12 -0
- package/dist/vendor/node/NodeRedis.d.ts +78 -0
- package/dist/vendor/node/NodeRedis.js +11 -0
- package/dist/vendor/node/NodeRuntime.d.ts +88 -0
- package/dist/vendor/node/NodeRuntime.js +8 -0
- package/dist/vendor/node/NodeServices.d.ts +37 -0
- package/dist/vendor/node/NodeServices.js +23 -0
- package/dist/vendor/node/NodeSink.d.ts +9 -0
- package/dist/vendor/node/NodeSink.js +12 -0
- package/dist/vendor/node/NodeSocket.d.ts +45 -0
- package/dist/vendor/node/NodeSocket.js +31 -0
- package/dist/vendor/node/NodeSocketServer.d.ts +9 -0
- package/dist/vendor/node/NodeSocketServer.js +21 -0
- package/dist/vendor/node/NodeStdio.d.ts +12 -0
- package/dist/vendor/node/NodeStdio.js +10 -0
- package/dist/vendor/node/NodeStream.d.ts +9 -0
- package/dist/vendor/node/NodeStream.js +27 -0
- package/dist/vendor/node/NodeTerminal.d.ts +24 -0
- package/dist/vendor/node/NodeTerminal.js +10 -0
- package/dist/vendor/node/NodeWorker.d.ts +24 -0
- package/dist/vendor/node/NodeWorker.js +9 -0
- package/dist/vendor/node/NodeWorkerRunner.d.ts +13 -0
- package/dist/vendor/node/NodeWorkerRunner.js +7 -0
- package/dist/vendor/node/Undici.d.ts +31 -0
- package/dist/vendor/node/Undici.js +9 -0
- package/dist/vendor/node/index.d.ts +140 -0
- package/dist/vendor/node/index.js +130 -0
- package/dist/vendor/node-shared/LICENSE +21 -0
- package/dist/vendor/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/node-shared/NodeAddressResolver.js +7 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +66 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
- package/dist/vendor/node-shared/NodeClusterSocket.d.ts +35 -0
- package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
- package/dist/vendor/node-shared/NodeCrypto.d.ts +30 -0
- package/dist/vendor/node-shared/NodeCrypto.js +9 -0
- package/dist/vendor/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/node-shared/NodeDatagramSocket.js +11 -0
- package/dist/vendor/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/node-shared/NodeDns.js +31 -0
- package/dist/vendor/node-shared/NodeFileSystem.d.ts +12 -0
- package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
- package/dist/vendor/node-shared/NodeHttpCompression.d.ts +40 -0
- package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
- package/dist/vendor/node-shared/NodePath.d.ts +30 -0
- package/dist/vendor/node-shared/NodePath.js +11 -0
- package/dist/vendor/node-shared/NodeRuntime.d.ts +51 -0
- package/dist/vendor/node-shared/NodeRuntime.js +7 -0
- package/dist/vendor/node-shared/NodeSink.d.ts +73 -0
- package/dist/vendor/node-shared/NodeSink.js +11 -0
- package/dist/vendor/node-shared/NodeSocket.d.ts +144 -0
- package/dist/vendor/node-shared/NodeSocket.js +23 -0
- package/dist/vendor/node-shared/NodeSocketServer.d.ts +87 -0
- package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
- package/dist/vendor/node-shared/NodeStdio.d.ts +13 -0
- package/dist/vendor/node-shared/NodeStdio.js +9 -0
- package/dist/vendor/node-shared/NodeStream.d.ts +194 -0
- package/dist/vendor/node-shared/NodeStream.js +26 -0
- package/dist/vendor/node-shared/NodeTerminal.d.ts +24 -0
- package/dist/vendor/node-shared/NodeTerminal.js +9 -0
- package/dist/vendor/node-shared/index.d.ts +85 -0
- package/dist/vendor/node-shared/index.js +70 -0
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +7 -0
- package/dist/vendor/node-shared/internal/utils.d.ts +2 -0
- package/dist/vendor/node-shared/internal/utils.js +7 -0
- package/dist/vendor/platform-bun.d.ts +130 -0
- package/dist/vendor/platform-bun.js +121 -0
- package/dist/vendor/platform-node-shared.d.ts +85 -0
- package/dist/vendor/platform-node-shared.js +70 -0
- package/dist/vendor/platform-node.d.ts +140 -0
- package/dist/vendor/platform-node.js +130 -0
- package/docs/README.md +135 -0
- package/docs/api.md +264 -0
- package/docs/concepts/host-surface.md +152 -0
- package/docs/concepts/runtime-parity.md +80 -0
- package/docs/guides/bind-a-repository-root.md +109 -0
- package/docs/guides/configure-the-filesystem-helper.md +113 -0
- package/docs/guides/contain-child-processes.md +178 -0
- package/docs/installation.md +131 -0
- package/docs/quickstart.md +163 -0
- package/docs/troubleshooting.md +163 -0
- package/package.json +146 -3
- package/src/BunFileSystem.ts +47 -0
- package/src/BunHost.ts +345 -0
- package/src/index.ts +27 -0
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bun UDP adapter for `effect/socket/DatagramSocket`, built on the native
|
|
3
|
+
* `Bun.udpSocket`. Requires Bun 1.4 or later: earlier versions throw `EAGAIN`
|
|
4
|
+
* from `send` instead of returning `false`, and never fire `drain`.
|
|
5
|
+
*
|
|
6
|
+
* `make` opens a new Bun socket for each reader acquisition, `fromUdpSocket`
|
|
7
|
+
* adopts a socket the caller creates, and `layer` provides the
|
|
8
|
+
* `DatagramSocket` service.
|
|
9
|
+
*
|
|
10
|
+
* The reader owns the native socket, so a send-only client must still acquire
|
|
11
|
+
* a reader, or its writes wait forever. Bun sends synchronously: a send error
|
|
12
|
+
* fails the write that caused it, and when the kernel buffer is full the write
|
|
13
|
+
* waits for `drain` and sends what is left.
|
|
14
|
+
*
|
|
15
|
+
* `writeAll` sends the batch with one `sendMany` call and fails with its first
|
|
16
|
+
* error. Which datagrams went out is unspecified, nothing is resent, and the
|
|
17
|
+
* error has no `address`, because Bun reports one error for the whole call.
|
|
18
|
+
*
|
|
19
|
+
* ICMP reports, such as a refused port, arrive after the write has completed,
|
|
20
|
+
* so they go to the `onError` option as a `DatagramSocketReadError` with no
|
|
21
|
+
* address.
|
|
22
|
+
*
|
|
23
|
+
* On macOS and Windows a poll error closes the socket without any event. The
|
|
24
|
+
* adapter notices on the next write, which fails with
|
|
25
|
+
* `DatagramSocketClosedError`, as do the reader and any write waiting for
|
|
26
|
+
* `drain`. Until then those waiting writes and `pull` keep waiting. The same
|
|
27
|
+
* applies when the caller closes a socket adopted with `fromUdpSocket`.
|
|
28
|
+
*
|
|
29
|
+
* **Example** (Echo server)
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { BunDatagramSocket } from "@effect/platform-bun"
|
|
33
|
+
* import { Effect } from "effect"
|
|
34
|
+
*
|
|
35
|
+
* const echo = Effect.gen(function*() {
|
|
36
|
+
* const socket = yield* BunDatagramSocket.make({ bind: { port: 9000 } })
|
|
37
|
+
* const reader = yield* socket.reader
|
|
38
|
+
* const writer = yield* socket.writer
|
|
39
|
+
* while (true) {
|
|
40
|
+
* for (const received of yield* reader.pull) {
|
|
41
|
+
* yield* writer.write({ payload: received.payload, address: received })
|
|
42
|
+
* }
|
|
43
|
+
* }
|
|
44
|
+
* }).pipe(Effect.scoped)
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* **Example** (Send-only client with a connected socket)
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* import { BunDatagramSocket } from "@effect/platform-bun"
|
|
51
|
+
* import { Effect } from "effect"
|
|
52
|
+
*
|
|
53
|
+
* const send = (payload: string) =>
|
|
54
|
+
* Effect.gen(function*() {
|
|
55
|
+
* const socket = yield* BunDatagramSocket.make({
|
|
56
|
+
* connect: { address: "localhost", port: 9000 }
|
|
57
|
+
* })
|
|
58
|
+
* // Required even for send-only clients.
|
|
59
|
+
* yield* socket.reader
|
|
60
|
+
* const writer = yield* socket.writer
|
|
61
|
+
* yield* writer.write({ payload })
|
|
62
|
+
* }).pipe(Effect.scoped)
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* **Example** (Adopting a socket)
|
|
66
|
+
*
|
|
67
|
+
* ```ts
|
|
68
|
+
* import { BunDatagramSocket } from "@effect/platform-bun"
|
|
69
|
+
* import { Effect } from "effect"
|
|
70
|
+
*
|
|
71
|
+
* const receive = Effect.gen(function*() {
|
|
72
|
+
* // `fromUdpSocket` replaces the socket's handlers with its own
|
|
73
|
+
* const socket = yield* BunDatagramSocket.fromUdpSocket(
|
|
74
|
+
* Effect.promise(() => Bun.udpSocket({ hostname: "127.0.0.1", port: 9000 }))
|
|
75
|
+
* )
|
|
76
|
+
* const reader = yield* socket.reader
|
|
77
|
+
* return yield* reader.pull
|
|
78
|
+
* }).pipe(Effect.scoped)
|
|
79
|
+
* ```
|
|
80
|
+
*
|
|
81
|
+
* @stability experimental
|
|
82
|
+
* @since 4.0.0
|
|
83
|
+
*/
|
|
84
|
+
import * as Effect from "effect/Effect";
|
|
85
|
+
import * as Layer from "effect/Layer";
|
|
86
|
+
import * as NetAddress from "effect/net/NetAddress";
|
|
87
|
+
import type * as Scope from "effect/Scope";
|
|
88
|
+
import * as DatagramSocket from "effect/socket/DatagramSocket";
|
|
89
|
+
/**
|
|
90
|
+
* An open-time endpoint. Hostnames resolve once per reader acquisition via
|
|
91
|
+
* `node:dns.lookup`, avoiding Bun's synchronous `getaddrinfo`.
|
|
92
|
+
* An `InetAddress` can be passed directly.
|
|
93
|
+
*
|
|
94
|
+
* @stability experimental
|
|
95
|
+
* @category models
|
|
96
|
+
* @since 4.0.0
|
|
97
|
+
*/
|
|
98
|
+
export interface Endpoint {
|
|
99
|
+
readonly address: string | NetAddress.IpAddress;
|
|
100
|
+
readonly port: number;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The local address and port to bind. Defaults to `0.0.0.0` (or `::` for
|
|
104
|
+
* `family: "ipv6"`) and an ephemeral port.
|
|
105
|
+
*
|
|
106
|
+
* @stability experimental
|
|
107
|
+
* @category models
|
|
108
|
+
* @since 4.0.0
|
|
109
|
+
*/
|
|
110
|
+
export interface BindOptions {
|
|
111
|
+
readonly address?: string | NetAddress.IpAddress | undefined;
|
|
112
|
+
readonly port?: number | undefined;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Options for `fromUdpSocket`. The caller configures the adopted socket, so
|
|
116
|
+
* only the options that live in JavaScript apply.
|
|
117
|
+
*
|
|
118
|
+
* @stability experimental
|
|
119
|
+
* @category models
|
|
120
|
+
* @since 4.0.0
|
|
121
|
+
*/
|
|
122
|
+
export interface AdoptOptions {
|
|
123
|
+
readonly peer?: Endpoint | undefined;
|
|
124
|
+
readonly receiveBuffer?: DatagramSocket.ReceiveBufferOptions | undefined;
|
|
125
|
+
readonly onError?: ((error: DatagramSocket.DatagramSocketError) => void) | undefined;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Options for `make` and `layer`.
|
|
129
|
+
*
|
|
130
|
+
* **Details**
|
|
131
|
+
*
|
|
132
|
+
* `peer` is a default destination and doesn't filter senders. `connect`
|
|
133
|
+
* connects the socket when Bun creates it, so the kernel filters senders. The
|
|
134
|
+
* two can't be combined.
|
|
135
|
+
*
|
|
136
|
+
* Family selection, in order: explicit `family`, a `bind` IP literal, the
|
|
137
|
+
* `peer` or `connect` address, a `bind` hostname, then `"ipv4"`. Hostname
|
|
138
|
+
* lookups use the family selected so far, or prefer IPv4 if none is set.
|
|
139
|
+
*
|
|
140
|
+
* `reuseAddress` means `SO_REUSEADDR` on Linux and `SO_REUSEPORT` on BSD and
|
|
141
|
+
* macOS.
|
|
142
|
+
*
|
|
143
|
+
* `multicast.interface` is the egress interface for datagrams sent to a group,
|
|
144
|
+
* which is a different socket option from the ingress `interface` of
|
|
145
|
+
* `Reader.joinMulticast`.
|
|
146
|
+
*
|
|
147
|
+
* @stability experimental
|
|
148
|
+
* @category models
|
|
149
|
+
* @since 4.0.0
|
|
150
|
+
*/
|
|
151
|
+
export type Options = {
|
|
152
|
+
readonly bind?: BindOptions | undefined;
|
|
153
|
+
readonly family?: "ipv4" | "ipv6" | undefined;
|
|
154
|
+
readonly reuseAddress?: boolean | undefined;
|
|
155
|
+
readonly reusePort?: boolean | undefined;
|
|
156
|
+
readonly ipv6Only?: boolean | undefined;
|
|
157
|
+
readonly broadcast?: boolean | undefined;
|
|
158
|
+
readonly ttl?: number | undefined;
|
|
159
|
+
readonly multicast?: {
|
|
160
|
+
readonly interface?: NetAddress.MulticastInterface | undefined;
|
|
161
|
+
readonly loopback?: boolean | undefined;
|
|
162
|
+
readonly ttl?: number | undefined;
|
|
163
|
+
} | undefined;
|
|
164
|
+
readonly receiveBuffer?: DatagramSocket.ReceiveBufferOptions | undefined;
|
|
165
|
+
readonly onError?: ((error: DatagramSocket.DatagramSocketError) => void) | undefined;
|
|
166
|
+
} & ({
|
|
167
|
+
readonly peer?: Endpoint | undefined;
|
|
168
|
+
readonly connect?: undefined;
|
|
169
|
+
} | {
|
|
170
|
+
readonly connect: Endpoint;
|
|
171
|
+
readonly peer?: undefined;
|
|
172
|
+
});
|
|
173
|
+
/**
|
|
174
|
+
* A native Bun UDP socket, connected or not.
|
|
175
|
+
*
|
|
176
|
+
* @stability experimental
|
|
177
|
+
* @category models
|
|
178
|
+
* @since 4.0.0
|
|
179
|
+
*/
|
|
180
|
+
export type UdpSocket = Bun.udp.Socket<"buffer"> | Bun.udp.ConnectedSocket<"buffer">;
|
|
181
|
+
/**
|
|
182
|
+
* Creates a `DatagramSocket` that opens and binds a new Bun UDP socket for
|
|
183
|
+
* each reader acquisition.
|
|
184
|
+
*
|
|
185
|
+
* **Details**
|
|
186
|
+
*
|
|
187
|
+
* Creating the socket never fails. Binding, applying options and resolving
|
|
188
|
+
* names happen on reader acquisition and fail it with a `DatagramSocketError`.
|
|
189
|
+
* Hostnames in `bind`, `peer` and `connect` are resolved once per acquisition;
|
|
190
|
+
* sends never wait for DNS.
|
|
191
|
+
*
|
|
192
|
+
* Invalid `receiveBuffer.capacity` values cause a defect; use a positive
|
|
193
|
+
* safe integer.
|
|
194
|
+
*
|
|
195
|
+
* @stability experimental
|
|
196
|
+
* @category constructors
|
|
197
|
+
* @since 4.0.0
|
|
198
|
+
*/
|
|
199
|
+
export declare const make: (options?: Options) => Effect.Effect<DatagramSocket.DatagramSocket>;
|
|
200
|
+
/**
|
|
201
|
+
* Adopts a Bun UDP socket.
|
|
202
|
+
*
|
|
203
|
+
* **Details**
|
|
204
|
+
*
|
|
205
|
+
* `acquire` runs once per reader acquisition, inside the reader's scope, and
|
|
206
|
+
* the adapter closes the socket when that scope ends. Whether the socket is
|
|
207
|
+
* connected is checked once at open.
|
|
208
|
+
*
|
|
209
|
+
* The adapter installs its own `data`, `drain` and `error` handlers with
|
|
210
|
+
* `socket.reload`, which replaces the ones the caller passed to
|
|
211
|
+
* `Bun.udpSocket`. Packets that arrive before `acquire` completes still go to
|
|
212
|
+
* the caller's handlers.
|
|
213
|
+
*
|
|
214
|
+
* @stability experimental
|
|
215
|
+
* @category constructors
|
|
216
|
+
* @since 4.0.0
|
|
217
|
+
*/
|
|
218
|
+
export declare const fromUdpSocket: <R>(acquire: Effect.Effect<UdpSocket, DatagramSocket.DatagramSocketError, R>, options?: AdoptOptions) => Effect.Effect<DatagramSocket.DatagramSocket, never, Exclude<R, Scope.Scope>>;
|
|
219
|
+
/**
|
|
220
|
+
* Provides a `DatagramSocket` built with `make`.
|
|
221
|
+
*
|
|
222
|
+
* @stability experimental
|
|
223
|
+
* @category layers
|
|
224
|
+
* @since 4.0.0
|
|
225
|
+
*/
|
|
226
|
+
export declare const layer: (options?: Options) => Layer.Layer<DatagramSocket.DatagramSocket>;
|
|
227
|
+
//# sourceMappingURL=BunDatagramSocket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunDatagramSocket.js")
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bun implementation of Effect's `Dns` service.
|
|
3
|
+
*
|
|
4
|
+
* Address lookups use `Bun.dns.lookup` with the `system` backend, which calls
|
|
5
|
+
* the operating system resolver (`getaddrinfo`) and therefore also reads the
|
|
6
|
+
* hosts file. Bun's `node:dns` lookup uses c-ares instead, which bypasses the
|
|
7
|
+
* system's name service configuration. Record queries and reverse lookups use
|
|
8
|
+
* `NodeDns.resolver` without the UTF-8 correction of `NodeDns.make`,
|
|
9
|
+
* because Bun already decodes TXT and CAA character strings as UTF-8.
|
|
10
|
+
*
|
|
11
|
+
* **Gotchas**
|
|
12
|
+
*
|
|
13
|
+
* Bun returns each character string of a TXT record as a separate record, so
|
|
14
|
+
* a record made of several strings arrives as several TXT records whose chunks
|
|
15
|
+
* cannot be reassembled (https://github.com/oven-sh/bun/issues/44692).
|
|
16
|
+
*
|
|
17
|
+
* Bun's resolver cannot query TLSA records, so TLSA queries fail with
|
|
18
|
+
* `Unsupported`.
|
|
19
|
+
*
|
|
20
|
+
* @stability experimental
|
|
21
|
+
* @since 4.0.0
|
|
22
|
+
*/
|
|
23
|
+
import * as NodeDns from "../node-shared/NodeDns.js";
|
|
24
|
+
import * as Config from "effect/Config";
|
|
25
|
+
import * as Effect from "effect/Effect";
|
|
26
|
+
import * as Layer from "effect/Layer";
|
|
27
|
+
import * as Dns from "effect/net/Dns";
|
|
28
|
+
import type * as NetAddress from "effect/net/NetAddress";
|
|
29
|
+
export type {
|
|
30
|
+
/**
|
|
31
|
+
* Options for the Bun `Dns` service: name servers, timeout, and tries for
|
|
32
|
+
* record queries and reverse lookups.
|
|
33
|
+
*
|
|
34
|
+
* @stability experimental
|
|
35
|
+
* @category re-exports
|
|
36
|
+
* @since 4.0.0
|
|
37
|
+
*/
|
|
38
|
+
Options } from "../node-shared/NodeDns.js";
|
|
39
|
+
/**
|
|
40
|
+
* Creates a Bun `Dns` service whose resolver lives as long as the scope.
|
|
41
|
+
*
|
|
42
|
+
* @stability experimental
|
|
43
|
+
* @category constructors
|
|
44
|
+
* @since 4.0.0
|
|
45
|
+
*/
|
|
46
|
+
export declare const make: (options?: NodeDns.Options | undefined) => Effect.Effect<{
|
|
47
|
+
lookup<F extends NetAddress.IpFamily>(host: import("effect/net/Host").DomainNameInput, options: {
|
|
48
|
+
readonly family: F;
|
|
49
|
+
}): Effect.Effect<import("effect/Array").NonEmptyReadonlyArray<NetAddress.FamilyAddress<F>>, Dns.DnsError>;
|
|
50
|
+
lookup(host: import("effect/net/Host").DomainNameInput, options?: Dns.LookupOptions): Effect.Effect<import("effect/Array").NonEmptyReadonlyArray<NetAddress.IpAddress>, Dns.DnsError>;
|
|
51
|
+
resolve<T extends Dns.RecordType>(name: import("effect/net/Host").DomainNameInput, type: T): Effect.Effect<import("effect/Array").NonEmptyReadonlyArray<Dns.RecordFor<T>>, Dns.DnsError>;
|
|
52
|
+
reverse(address: NetAddress.IpAddressInput): Effect.Effect<import("effect/Array").NonEmptyReadonlyArray<import("effect/net/Host").DomainName>, Dns.DnsError>;
|
|
53
|
+
}, NetAddress.NetAddressError, import("effect/Scope").Scope>;
|
|
54
|
+
/**
|
|
55
|
+
* Layer that provides the Bun `Dns` service using the system resolver
|
|
56
|
+
* configuration.
|
|
57
|
+
*
|
|
58
|
+
* @stability experimental
|
|
59
|
+
* @category layers
|
|
60
|
+
* @since 4.0.0
|
|
61
|
+
*/
|
|
62
|
+
export declare const layer: Layer.Layer<Dns.Dns>;
|
|
63
|
+
/**
|
|
64
|
+
* Creates a layer that provides the Bun `Dns` service with options read
|
|
65
|
+
* from configuration.
|
|
66
|
+
*
|
|
67
|
+
* @stability experimental
|
|
68
|
+
* @category layers
|
|
69
|
+
* @since 4.0.0
|
|
70
|
+
*/
|
|
71
|
+
export declare const layerConfig: (options: Config.Wrap<NodeDns.Options>) => Layer.Layer<Dns.Dns, Config.ConfigError | NetAddress.NetAddressError>;
|
|
72
|
+
//# sourceMappingURL=BunDns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunDns.js")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FileSystem } from "effect/FileSystem";
|
|
2
|
+
import type * as Layer from "effect/Layer";
|
|
3
|
+
/**
|
|
4
|
+
* Layer that provides the `FileSystem` service for Bun using the shared Node file-system implementation.
|
|
5
|
+
*
|
|
6
|
+
* @stability unstable
|
|
7
|
+
* @category layers
|
|
8
|
+
* @since 4.0.0
|
|
9
|
+
*/
|
|
10
|
+
export declare const layer: Layer.Layer<FileSystem, never, never>;
|
|
11
|
+
//# sourceMappingURL=BunFileSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunFileSystem.js")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunHttpClient.js")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as Platform from "effect/http/HttpPlatform";
|
|
2
|
+
import * as Layer from "effect/Layer";
|
|
3
|
+
/**
|
|
4
|
+
* Layer that provides the Bun `HttpPlatform`, including file responses backed by `Bun.file`.
|
|
5
|
+
*
|
|
6
|
+
* @stability unstable
|
|
7
|
+
* @category layers
|
|
8
|
+
* @since 4.0.0
|
|
9
|
+
*/
|
|
10
|
+
export declare const layer: Layer.Layer<Platform.HttpPlatform, never, never>;
|
|
11
|
+
//# sourceMappingURL=BunHttpPlatform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunHttpPlatform.js")
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bun implementation of the Effect `HttpServer`.
|
|
3
|
+
*
|
|
4
|
+
* `make` creates a scoped HTTP server from `Bun.serve`, converting Bun
|
|
5
|
+
* `Request` values into `HttpServerRequest` values and Effect
|
|
6
|
+
* `HttpServerResponse` values back into Web `Response` values. The server
|
|
7
|
+
* supports streaming bodies, multipart requests, file responses through
|
|
8
|
+
* `BunHttpPlatform`, and WebSocket upgrades. This module also provides layers
|
|
9
|
+
* for the server alone, the Bun HTTP support services, the combined server,
|
|
10
|
+
* configurable server options, and a test server with an HTTP client.
|
|
11
|
+
*
|
|
12
|
+
* @stability unstable
|
|
13
|
+
* @since 4.0.0
|
|
14
|
+
*/
|
|
15
|
+
import type { ServerWebSocket } from "bun";
|
|
16
|
+
import * as Config from "effect/Config";
|
|
17
|
+
import type { ConfigError } from "effect/Config";
|
|
18
|
+
import * as Deferred from "effect/Deferred";
|
|
19
|
+
import * as Duration from "effect/Duration";
|
|
20
|
+
import * as Effect from "effect/Effect";
|
|
21
|
+
import type * as FileSystem from "effect/FileSystem";
|
|
22
|
+
import * as Etag from "effect/http/Etag";
|
|
23
|
+
import type { HttpClient } from "effect/http/HttpClient";
|
|
24
|
+
import type { HttpPlatform } from "effect/http/HttpPlatform";
|
|
25
|
+
import * as Server from "effect/http/HttpServer";
|
|
26
|
+
import * as Error from "effect/http/HttpServerError";
|
|
27
|
+
import * as ServerRequest from "effect/http/HttpServerRequest";
|
|
28
|
+
import * as ServerResponse from "effect/http/HttpServerResponse";
|
|
29
|
+
import * as Layer from "effect/Layer";
|
|
30
|
+
import * as NetAddress from "effect/net/NetAddress";
|
|
31
|
+
import type * as Path from "effect/Path";
|
|
32
|
+
import * as Scope from "effect/Scope";
|
|
33
|
+
import * as Socket from "effect/socket/Socket";
|
|
34
|
+
import * as BunServices from "./BunServices.ts";
|
|
35
|
+
/**
|
|
36
|
+
* Bun serve options accepted by the HTTP server, extended with typed route definitions.
|
|
37
|
+
*
|
|
38
|
+
* @stability unstable
|
|
39
|
+
* @category options
|
|
40
|
+
* @since 4.0.0
|
|
41
|
+
*/
|
|
42
|
+
export type ServeOptions<R extends string> = (Bun.Serve.UnixServeOptions<WebSocketContext> | Bun.Serve.HostnamePortServeOptions<WebSocketContext>) & {
|
|
43
|
+
readonly routes?: Bun.Serve.Routes<WebSocketContext, R>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* WebSocket tuning options forwarded to `Bun.serve`'s `websocket` handler.
|
|
47
|
+
*
|
|
48
|
+
* **Details**
|
|
49
|
+
*
|
|
50
|
+
* The lifecycle handlers (`open`, `message`, `close`, ...) are managed by the
|
|
51
|
+
* server and cannot be overridden; everything else — such as
|
|
52
|
+
* `perMessageDeflate` compression, payload limits, and idle timeouts — passes
|
|
53
|
+
* through, e.g.
|
|
54
|
+
* `BunHttpServer.layer({ port: 3000, websocket: { perMessageDeflate: true } })`.
|
|
55
|
+
*
|
|
56
|
+
* The `compressionThreshold` option controls the minimum message size in bytes
|
|
57
|
+
* that is compressed when per-message deflate is negotiated. It defaults to
|
|
58
|
+
* 1024, matching the default threshold of Node's `ws` server.
|
|
59
|
+
*
|
|
60
|
+
* @stability unstable
|
|
61
|
+
* @category options
|
|
62
|
+
* @since 4.0.0
|
|
63
|
+
*/
|
|
64
|
+
export type WebSocketOptions = Omit<Bun.WebSocketHandler<WebSocketContext>, "open" | "message" | "close" | "drain" | "ping" | "pong" | "data" | "binaryType"> & {
|
|
65
|
+
/**
|
|
66
|
+
* The minimum message size in bytes that is compressed when per-message
|
|
67
|
+
* deflate is negotiated.
|
|
68
|
+
*
|
|
69
|
+
* @default 1024
|
|
70
|
+
*/
|
|
71
|
+
readonly compressionThreshold?: number | undefined;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Creates a scoped Bun `HttpServer` from `Bun.serve` options, stopping the server on scope finalization with optional graceful shutdown settings.
|
|
75
|
+
*
|
|
76
|
+
* @stability unstable
|
|
77
|
+
* @category constructors
|
|
78
|
+
* @since 4.0.0
|
|
79
|
+
*/
|
|
80
|
+
export declare const make: <R extends string>(options: ServeOptions<R> & {
|
|
81
|
+
readonly disablePreemptiveShutdown?: boolean | undefined;
|
|
82
|
+
readonly gracefulShutdownTimeout?: Duration.Input | undefined;
|
|
83
|
+
readonly websocket?: WebSocketOptions | undefined;
|
|
84
|
+
}) => Effect.Effect<{
|
|
85
|
+
readonly serve: {
|
|
86
|
+
<E, R_1>(effect: Effect.Effect<ServerResponse.HttpServerResponse, E, R_1>): Effect.Effect<void, never, Exclude<R_1, ServerRequest.HttpServerRequest> | Scope.Scope>;
|
|
87
|
+
<E, R_1, App extends Effect.Effect<ServerResponse.HttpServerResponse, any, any>>(effect: Effect.Effect<ServerResponse.HttpServerResponse, E, R_1>, middleware: import("effect/http/HttpMiddleware").HttpMiddleware.Applied<App, E, R_1>): Effect.Effect<void, never, Exclude<Effect.Services<App>, ServerRequest.HttpServerRequest> | Scope.Scope>;
|
|
88
|
+
};
|
|
89
|
+
readonly address: NetAddress.SocketAddress;
|
|
90
|
+
}, Error.ServeError, Scope.Scope>;
|
|
91
|
+
/**
|
|
92
|
+
* Layer that provides only `HttpServer` by constructing a scoped Bun server from the supplied serve options.
|
|
93
|
+
*
|
|
94
|
+
* @stability unstable
|
|
95
|
+
* @category layers
|
|
96
|
+
* @since 4.0.0
|
|
97
|
+
*/
|
|
98
|
+
export declare const layerServer: <R extends string>(options: ServeOptions<R> & {
|
|
99
|
+
readonly disablePreemptiveShutdown?: boolean | undefined;
|
|
100
|
+
readonly gracefulShutdownTimeout?: Duration.Input | undefined;
|
|
101
|
+
readonly websocket?: WebSocketOptions | undefined;
|
|
102
|
+
}) => Layer.Layer<Server.HttpServer, Error.ServeError>;
|
|
103
|
+
/**
|
|
104
|
+
* Layer that provides Bun HTTP support services: `HttpPlatform`, weak ETag generation, and `BunServices`.
|
|
105
|
+
*
|
|
106
|
+
* @stability unstable
|
|
107
|
+
* @category layers
|
|
108
|
+
* @since 4.0.0
|
|
109
|
+
*/
|
|
110
|
+
export declare const layerHttpServices: Layer.Layer<HttpPlatform | Etag.Generator | BunServices.BunServices>;
|
|
111
|
+
/**
|
|
112
|
+
* Layer that provides a Bun `HttpServer` together with the Bun HTTP platform, ETag generator, and Bun services.
|
|
113
|
+
*
|
|
114
|
+
* @stability unstable
|
|
115
|
+
* @category layers
|
|
116
|
+
* @since 4.0.0
|
|
117
|
+
*/
|
|
118
|
+
export declare const layer: <R extends string>(options: ServeOptions<R> & {
|
|
119
|
+
readonly disablePreemptiveShutdown?: boolean | undefined;
|
|
120
|
+
readonly gracefulShutdownTimeout?: Duration.Input | undefined;
|
|
121
|
+
readonly websocket?: WebSocketOptions | undefined;
|
|
122
|
+
}) => Layer.Layer<Server.HttpServer | HttpPlatform | Etag.Generator | BunServices.BunServices, Error.ServeError>;
|
|
123
|
+
/**
|
|
124
|
+
* Layer that starts a Bun HTTP server on an ephemeral port for tests.
|
|
125
|
+
*
|
|
126
|
+
* @stability unstable
|
|
127
|
+
* @category testing
|
|
128
|
+
* @since 4.0.0
|
|
129
|
+
*/
|
|
130
|
+
export declare const layerTest: Layer.Layer<Server.HttpServer | HttpPlatform | FileSystem.FileSystem | Etag.Generator | Path.Path | HttpClient>;
|
|
131
|
+
/**
|
|
132
|
+
* Creates the Bun HTTP server and support-services layer from configurable serve options.
|
|
133
|
+
*
|
|
134
|
+
* @stability unstable
|
|
135
|
+
* @category layers
|
|
136
|
+
* @since 4.0.0
|
|
137
|
+
*/
|
|
138
|
+
export declare const layerConfig: <R extends string>(options: Config.Wrap<ServeOptions<R> & {
|
|
139
|
+
readonly disablePreemptiveShutdown?: boolean | undefined;
|
|
140
|
+
readonly gracefulShutdownTimeout?: Duration.Input | undefined;
|
|
141
|
+
readonly websocket?: WebSocketOptions | undefined;
|
|
142
|
+
}>) => Layer.Layer<Server.HttpServer | HttpPlatform | FileSystem.FileSystem | Etag.Generator | Path.Path, ConfigError | Error.ServeError>;
|
|
143
|
+
interface WebSocketContext {
|
|
144
|
+
readonly deferred: Deferred.Deferred<ServerWebSocket<WebSocketContext>>;
|
|
145
|
+
readonly buffer: Array<Uint8Array | string>;
|
|
146
|
+
closeError: Socket.SocketError | undefined;
|
|
147
|
+
run: (_: Uint8Array | string) => void;
|
|
148
|
+
onClose: (error: Socket.SocketError) => void;
|
|
149
|
+
}
|
|
150
|
+
export {};
|
|
151
|
+
//# sourceMappingURL=BunHttpServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunHttpServer.js")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accessor for the Bun request behind an Effect HTTP server request.
|
|
3
|
+
*
|
|
4
|
+
* This module exports `toBunServerRequest`, which returns the underlying
|
|
5
|
+
* `Bun.BunRequest` stored inside a Bun-backed `HttpServerRequest`. It is meant
|
|
6
|
+
* for code that needs to interoperate with Bun-specific request APIs.
|
|
7
|
+
*
|
|
8
|
+
* @stability unstable
|
|
9
|
+
* @since 4.0.0
|
|
10
|
+
*/
|
|
11
|
+
import type { HttpServerRequest } from "effect/http/HttpServerRequest";
|
|
12
|
+
/**
|
|
13
|
+
* Returns the underlying `Bun.BunRequest` from an Effect `HttpServerRequest`.
|
|
14
|
+
*
|
|
15
|
+
* @stability unstable
|
|
16
|
+
* @category accessors
|
|
17
|
+
* @since 4.0.0
|
|
18
|
+
*/
|
|
19
|
+
export declare const toBunServerRequest: <T extends string = string>(self: HttpServerRequest) => Bun.BunRequest<T>;
|
|
20
|
+
//# sourceMappingURL=BunHttpServerRequest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunHttpServerRequest.js")
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bun-specific helpers for parsing HTTP `multipart/form-data` request bodies.
|
|
3
|
+
*
|
|
4
|
+
* This module adapts a Bun `Request` body and headers into the shared
|
|
5
|
+
* `Multipart` model. `stream` returns multipart parts as a `Stream`, while
|
|
6
|
+
* `persisted` collects the form and writes file parts to scoped temporary files
|
|
7
|
+
* through the current `FileSystem`, `Path`, and `Scope` services.
|
|
8
|
+
*
|
|
9
|
+
* @stability unstable
|
|
10
|
+
* @since 4.0.0
|
|
11
|
+
*/
|
|
12
|
+
import type * as Effect from "effect/Effect";
|
|
13
|
+
import type { FileSystem } from "effect/FileSystem";
|
|
14
|
+
import * as Multipart from "effect/http/Multipart";
|
|
15
|
+
import type { Path } from "effect/Path";
|
|
16
|
+
import type * as Scope from "effect/Scope";
|
|
17
|
+
import * as Stream from "effect/Stream";
|
|
18
|
+
/**
|
|
19
|
+
* Parses a Bun `Request` body as multipart data and returns a stream of multipart parts.
|
|
20
|
+
*
|
|
21
|
+
* @stability unstable
|
|
22
|
+
* @category constructors
|
|
23
|
+
* @since 4.0.0
|
|
24
|
+
*/
|
|
25
|
+
export declare const stream: (source: Request) => Stream.Stream<Multipart.Part, Multipart.MultipartError>;
|
|
26
|
+
/**
|
|
27
|
+
* Parses and persists multipart data from a Bun `Request`, requiring file-system, path, and scope services.
|
|
28
|
+
*
|
|
29
|
+
* @stability unstable
|
|
30
|
+
* @category constructors
|
|
31
|
+
* @since 4.0.0
|
|
32
|
+
*/
|
|
33
|
+
export declare const persisted: (source: Request) => Effect.Effect<Multipart.Persisted, Multipart.MultipartError, FileSystem | Path | Scope.Scope>;
|
|
34
|
+
//# sourceMappingURL=BunMultipart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunMultipart.js")
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type * as Layer from "effect/Layer";
|
|
2
|
+
import type { Path } from "effect/Path";
|
|
3
|
+
/**
|
|
4
|
+
* Layer that provides the default `Path` service for Bun using the shared Node path implementation.
|
|
5
|
+
*
|
|
6
|
+
* @stability unstable
|
|
7
|
+
* @category layers
|
|
8
|
+
* @since 4.0.0
|
|
9
|
+
*/
|
|
10
|
+
export declare const layer: Layer.Layer<Path>;
|
|
11
|
+
/**
|
|
12
|
+
* Layer that provides the POSIX `Path` service for Bun using the shared Node path implementation.
|
|
13
|
+
*
|
|
14
|
+
* @stability unstable
|
|
15
|
+
* @category layers
|
|
16
|
+
* @since 4.0.0
|
|
17
|
+
*/
|
|
18
|
+
export declare const layerPosix: Layer.Layer<Path>;
|
|
19
|
+
/**
|
|
20
|
+
* Layer that provides the Win32 `Path` service for Bun using the shared Node path implementation.
|
|
21
|
+
*
|
|
22
|
+
* @stability unstable
|
|
23
|
+
* @category layers
|
|
24
|
+
* @since 4.0.0
|
|
25
|
+
*/
|
|
26
|
+
export declare const layerWin32: Layer.Layer<Path>;
|
|
27
|
+
//# sourceMappingURL=BunPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunPath.js")
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bun Redis integration backed by Bun's built-in `RedisClient`.
|
|
3
|
+
*
|
|
4
|
+
* This module creates scoped Bun `RedisClient` connections and exposes them as
|
|
5
|
+
* both the portable `Redis` service and the Bun-specific `BunRedis` service for
|
|
6
|
+
* direct access to the raw client. The `layer` helper accepts Redis options
|
|
7
|
+
* directly, while `layerConfig` reads them from Effect config. Both close the
|
|
8
|
+
* underlying client when the layer scope finalizes.
|
|
9
|
+
*
|
|
10
|
+
* @stability unstable
|
|
11
|
+
* @since 4.0.0
|
|
12
|
+
*/
|
|
13
|
+
import type { RedisClient, RedisOptions } from "bun";
|
|
14
|
+
import * as Config from "effect/Config";
|
|
15
|
+
import * as Context from "effect/Context";
|
|
16
|
+
import * as Effect from "effect/Effect";
|
|
17
|
+
import * as Layer from "effect/Layer";
|
|
18
|
+
import * as Redis from "effect/persistence/Redis";
|
|
19
|
+
declare const BunRedis_base: Context.ServiceClass<BunRedis, "@effect/platform-bun/BunRedis", {
|
|
20
|
+
readonly client: RedisClient;
|
|
21
|
+
readonly use: <A>(f: (client: RedisClient) => Promise<A>) => Effect.Effect<A, Redis.RedisError>;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Service tag for Bun Redis integration, exposing the raw `RedisClient` and a `use` helper that maps client promise failures to `RedisError`.
|
|
25
|
+
*
|
|
26
|
+
* @stability unstable
|
|
27
|
+
* @category services
|
|
28
|
+
* @since 4.0.0
|
|
29
|
+
*/
|
|
30
|
+
export declare class BunRedis extends BunRedis_base {
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Creates scoped Bun Redis layers for `Redis.Redis` and `BunRedis`, closing the underlying client when the scope finalizes.
|
|
34
|
+
*
|
|
35
|
+
* @stability unstable
|
|
36
|
+
* @category layers
|
|
37
|
+
* @since 4.0.0
|
|
38
|
+
*/
|
|
39
|
+
export declare const layer: (options?: ({
|
|
40
|
+
readonly url?: string;
|
|
41
|
+
} & RedisOptions) | undefined) => Layer.Layer<Redis.Redis | BunRedis>;
|
|
42
|
+
/**
|
|
43
|
+
* Creates scoped Bun Redis layers from configurable Redis options, closing the underlying client when the scope finalizes.
|
|
44
|
+
*
|
|
45
|
+
* @stability unstable
|
|
46
|
+
* @category layers
|
|
47
|
+
* @since 4.0.0
|
|
48
|
+
*/
|
|
49
|
+
export declare const layerConfig: (options: Config.Wrap<{
|
|
50
|
+
readonly url?: string;
|
|
51
|
+
} & RedisOptions>) => Layer.Layer<Redis.Redis | BunRedis, Config.ConfigError>;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=BunRedis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../bun/BunRedis.js")
|