@effect/platform-node 0.19.2 → 0.19.3
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/Command/dist/effect-platform-node-Command.cjs.d.mts +2 -0
- package/Command/dist/effect-platform-node-Command.cjs.d.mts.map +1 -0
- package/Command/dist/effect-platform-node-Command.cjs.d.ts +2 -0
- package/Command/dist/effect-platform-node-Command.cjs.d.ts.map +1 -0
- package/Command/dist/effect-platform-node-Command.cjs.dev.js +72 -0
- package/Command/dist/effect-platform-node-Command.cjs.js +7 -0
- package/Command/dist/effect-platform-node-Command.cjs.mjs +18 -0
- package/Command/dist/effect-platform-node-Command.cjs.prod.js +72 -0
- package/Command/dist/effect-platform-node-Command.esm.js +5 -0
- package/Command/package.json +4 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.mts +2 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.mts.map +1 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.ts +2 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.d.ts.map +1 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.dev.js +27 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.js +7 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.mjs +4 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.cjs.prod.js +27 -0
- package/CommandExecutor/dist/effect-platform-node-CommandExecutor.esm.js +14 -0
- package/CommandExecutor/package.json +4 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.d.mts +2 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.d.mts.map +1 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.d.ts +2 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.d.ts.map +1 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.dev.js +12 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.js +7 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.mjs +3 -0
- package/Effectify/dist/effect-platform-node-Effectify.cjs.prod.js +12 -0
- package/Effectify/dist/effect-platform-node-Effectify.esm.js +5 -0
- package/Effectify/package.json +4 -0
- package/Error/dist/effect-platform-node-Error.cjs.d.mts +2 -0
- package/Error/dist/effect-platform-node-Error.cjs.d.mts.map +1 -0
- package/Error/dist/effect-platform-node-Error.cjs.d.ts +2 -0
- package/Error/dist/effect-platform-node-Error.cjs.d.ts.map +1 -0
- package/Error/dist/effect-platform-node-Error.cjs.dev.js +28 -0
- package/Error/dist/effect-platform-node-Error.cjs.js +7 -0
- package/Error/dist/effect-platform-node-Error.cjs.mjs +7 -0
- package/Error/dist/effect-platform-node-Error.cjs.prod.js +28 -0
- package/Error/dist/effect-platform-node-Error.esm.js +5 -0
- package/Error/package.json +4 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.mts +2 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.mts.map +1 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.ts +2 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.d.ts.map +1 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.dev.js +29 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.js +7 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.mjs +5 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.cjs.prod.js +29 -0
- package/FileSystem/dist/effect-platform-node-FileSystem.esm.js +14 -0
- package/FileSystem/package.json +4 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.mts +2 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.mts.map +1 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.ts +2 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.d.ts.map +1 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.dev.js +19 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.js +7 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.mjs +1 -0
- package/Http/Etag/dist/effect-platform-node-Http-Etag.cjs.prod.js +19 -0
- package/Http/Etag/package.json +4 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.mts +2 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.mts.map +1 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.ts +2 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.d.ts.map +1 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.dev.js +31 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.js +7 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.mjs +1 -0
- package/Http/FormData/dist/effect-platform-node-Http-FormData.cjs.prod.js +31 -0
- package/Http/FormData/package.json +4 -0
- package/Http/Http/Etag/dist/effect-platform-node-Http-Etag.esm.js +23 -0
- package/Http/Http/FormData/dist/effect-platform-node-Http-FormData.esm.js +23 -0
- package/Http/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.esm.js +65 -0
- package/{mjs/Http/Platform.mjs → Http/Http/Platform/dist/effect-platform-node-Http-Platform.esm.js} +9 -8
- package/Http/Http/Server/dist/effect-platform-node-Http-Server.esm.js +29 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.mts +2 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.mts.map +1 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.ts +2 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.d.ts.map +1 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.dev.js +39 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.js +7 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.mjs +10 -0
- package/Http/NodeClient/dist/effect-platform-node-Http-NodeClient.cjs.prod.js +39 -0
- package/Http/NodeClient/package.json +4 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.mts +2 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.mts.map +1 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.ts +2 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.d.ts.map +1 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.dev.js +51 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.js +7 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.mjs +1 -0
- package/Http/Platform/dist/effect-platform-node-Http-Platform.cjs.prod.js +51 -0
- package/Http/Platform/package.json +4 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.mts +2 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.mts.map +1 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.ts +2 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.d.ts.map +1 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.dev.js +61 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.js +7 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.mjs +1 -0
- package/Http/Server/dist/effect-platform-node-Http-Server.cjs.prod.js +61 -0
- package/Http/Server/package.json +4 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.mts +2 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.mts.map +1 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.ts +2 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.d.ts.map +1 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.dev.js +67 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.js +7 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.mjs +10 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.cjs.prod.js +67 -0
- package/HttpClient/dist/effect-platform-node-HttpClient.esm.js +20 -0
- package/HttpClient/package.json +4 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.mts +2 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.mts.map +1 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.ts +2 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.d.ts.map +1 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.dev.js +96 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.js +7 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.mjs +14 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.cjs.prod.js +96 -0
- package/HttpServer/dist/effect-platform-node-HttpServer.esm.js +28 -0
- package/HttpServer/package.json +4 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.mts +2 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.mts.map +1 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.ts +2 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.d.ts.map +1 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.dev.js +32 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.js +7 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.mjs +1 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.cjs.prod.js +32 -0
- package/KeyValueStore/dist/effect-platform-node-KeyValueStore.esm.js +19 -0
- package/KeyValueStore/package.json +4 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.mts +2 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.mts.map +1 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.ts +2 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.d.ts.map +1 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.dev.js +33 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.js +7 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.mjs +3 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.cjs.prod.js +33 -0
- package/NodeContext/dist/effect-platform-node-NodeContext.esm.js +22 -0
- package/NodeContext/package.json +4 -0
- package/Path/dist/effect-platform-node-Path.cjs.d.mts +2 -0
- package/Path/dist/effect-platform-node-Path.cjs.d.mts.map +1 -0
- package/Path/dist/effect-platform-node-Path.cjs.d.ts +2 -0
- package/Path/dist/effect-platform-node-Path.cjs.d.ts.map +1 -0
- package/Path/dist/effect-platform-node-Path.cjs.dev.js +21 -0
- package/Path/dist/effect-platform-node-Path.cjs.js +7 -0
- package/Path/dist/effect-platform-node-Path.cjs.mjs +6 -0
- package/Path/dist/effect-platform-node-Path.cjs.prod.js +21 -0
- package/Path/dist/effect-platform-node-Path.esm.js +26 -0
- package/Path/package.json +4 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.d.mts +2 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.d.mts.map +1 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.d.ts +2 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.d.ts.map +1 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.dev.js +16 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.js +7 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.mjs +4 -0
- package/Runtime/dist/effect-platform-node-Runtime.cjs.prod.js +16 -0
- package/Runtime/dist/effect-platform-node-Runtime.esm.js +14 -0
- package/Runtime/package.json +4 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.d.mts +2 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.d.mts.map +1 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.d.ts +2 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.d.ts.map +1 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.dev.js +13 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.js +7 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.mjs +3 -0
- package/Sink/dist/effect-platform-node-Sink.cjs.prod.js +13 -0
- package/Sink/dist/effect-platform-node-Sink.esm.js +18 -0
- package/Sink/package.json +4 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.d.mts +2 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.d.mts.map +1 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.d.ts +2 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.d.ts.map +1 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.dev.js +16 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.js +7 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.mjs +5 -0
- package/Stream/dist/effect-platform-node-Stream.cjs.prod.js +16 -0
- package/Stream/dist/effect-platform-node-Stream.esm.js +30 -0
- package/Stream/package.json +4 -0
- package/dist/Command-15b84341.cjs.dev.js +29 -0
- package/dist/Command-2fc875e9.cjs.prod.js +29 -0
- package/dist/CommandExecutor-b7cb55b8.cjs.dev.js +195 -0
- package/dist/CommandExecutor-bccc7563.cjs.prod.js +195 -0
- package/dist/Effectify-1676f59e.cjs.prod.js +14 -0
- package/dist/Effectify-c94620ca.cjs.dev.js +14 -0
- package/dist/Error-004c8162.cjs.prod.js +18 -0
- package/dist/Error-6db0ba89.cjs.dev.js +18 -0
- package/dist/Etag-7a3db878.cjs.prod.js +112 -0
- package/dist/Etag-b38be81c.cjs.dev.js +112 -0
- package/dist/FileSystem-a207377d.cjs.prod.js +433 -0
- package/dist/FileSystem-d7b8eeac.cjs.dev.js +433 -0
- package/dist/FormData-053407d4.cjs.dev.js +67 -0
- package/dist/FormData-c7339a7b.cjs.prod.js +67 -0
- package/dist/HttpClient-595a26fa.cjs.prod.js +54 -0
- package/dist/HttpClient-6c942c00.cjs.dev.js +54 -0
- package/dist/HttpServer-2a788d37.cjs.prod.js +64 -0
- package/dist/HttpServer-cc291592.cjs.dev.js +64 -0
- package/dist/KeyValueStore-35cb6494.cjs.prod.js +62 -0
- package/dist/KeyValueStore-af7495b6.cjs.dev.js +62 -0
- package/dist/NodeClient-8db3bc84.cjs.prod.js +280 -0
- package/dist/NodeClient-ab5848bf.cjs.dev.js +280 -0
- package/dist/NodeContext-3c96e955.cjs.dev.js +50 -0
- package/dist/NodeContext-dff7bc0b.cjs.prod.js +50 -0
- package/dist/Path-bf4c3b07.cjs.prod.js +104 -0
- package/dist/Path-feae3dcf.cjs.dev.js +104 -0
- package/dist/Runtime-6aeac6f0.cjs.dev.js +68 -0
- package/dist/Runtime-e746c66d.cjs.prod.js +68 -0
- package/dist/Server-4638865c.cjs.prod.js +301 -0
- package/dist/Server-86853bf9.cjs.dev.js +301 -0
- package/dist/Sink-536c2b16.cjs.dev.js +26 -0
- package/dist/Sink-735101fa.cjs.prod.js +26 -0
- package/dist/Stream-53f57af5.cjs.dev.js +42 -0
- package/dist/Stream-7424efca.cjs.prod.js +42 -0
- package/dist/declarations/src/Command.d.ts.map +1 -0
- package/{CommandExecutor.d.ts → dist/declarations/src/CommandExecutor.d.ts} +3 -0
- package/dist/declarations/src/CommandExecutor.d.ts.map +1 -0
- package/dist/declarations/src/Effectify.d.ts.map +1 -0
- package/dist/declarations/src/Error.d.ts.map +1 -0
- package/dist/declarations/src/FileSystem.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/Etag.d.ts +5 -0
- package/dist/declarations/src/Http/Etag.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/FormData.d.ts +5 -0
- package/dist/declarations/src/Http/FormData.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/NodeClient.d.ts +3 -0
- package/dist/declarations/src/Http/NodeClient.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/Platform.d.ts +5 -0
- package/dist/declarations/src/Http/Platform.d.ts.map +1 -0
- package/{Http → dist/declarations/src/Http}/Server.d.ts +5 -0
- package/dist/declarations/src/Http/Server.d.ts.map +1 -0
- package/{HttpClient.d.ts → dist/declarations/src/HttpClient.d.ts} +1 -1
- package/dist/declarations/src/HttpClient.d.ts.map +1 -0
- package/{HttpServer.d.ts → dist/declarations/src/HttpServer.d.ts} +3 -3
- package/dist/declarations/src/HttpServer.d.ts.map +1 -0
- package/{KeyValueStore.d.ts → dist/declarations/src/KeyValueStore.d.ts} +5 -0
- package/dist/declarations/src/KeyValueStore.d.ts.map +1 -0
- package/{NodeContext.d.ts → dist/declarations/src/NodeContext.d.ts} +3 -6
- package/dist/declarations/src/NodeContext.d.ts.map +1 -0
- package/dist/declarations/src/Path.d.ts.map +1 -0
- package/{Runtime.d.ts → dist/declarations/src/Runtime.d.ts} +3 -0
- package/dist/declarations/src/Runtime.d.ts.map +1 -0
- package/dist/declarations/src/Sink.d.ts.map +1 -0
- package/{Stream.d.ts → dist/declarations/src/Stream.d.ts} +3 -0
- package/dist/declarations/src/Stream.d.ts.map +1 -0
- package/dist/declarations/src/index.d.ts +55 -0
- package/dist/declarations/src/index.d.ts.map +1 -0
- package/dist/effect-platform-node.cjs.d.mts +2 -0
- package/dist/effect-platform-node.cjs.d.mts.map +1 -0
- package/dist/effect-platform-node.cjs.d.ts +2 -0
- package/dist/effect-platform-node.cjs.d.ts.map +1 -0
- package/dist/effect-platform-node.cjs.dev.js +93 -0
- package/dist/effect-platform-node.cjs.js +7 -0
- package/dist/effect-platform-node.cjs.mjs +15 -0
- package/dist/effect-platform-node.cjs.prod.js +93 -0
- package/dist/effect-platform-node.esm.js +26 -0
- package/{internal/error.js → dist/error-4f074a3a.cjs.prod.js} +5 -8
- package/dist/error-e477c10b.cjs.dev.js +41 -0
- package/dist/formData-09ad7f6d.cjs.prod.js +141 -0
- package/dist/formData-fac89256.cjs.dev.js +141 -0
- package/dist/incomingMessage-28bc73d7.cjs.dev.js +85 -0
- package/dist/incomingMessage-ed443788.cjs.prod.js +85 -0
- package/dist/platform-1c31462c.cjs.dev.js +73 -0
- package/dist/platform-d09ef04f.cjs.prod.js +73 -0
- package/dist/sink-da49e187.cjs.prod.js +57 -0
- package/dist/sink-daf9e0e5.cjs.dev.js +57 -0
- package/dist/stream-1456ece0.cjs.dev.js +120 -0
- package/dist/stream-ef8b6a66.cjs.prod.js +120 -0
- package/{mjs/internal/commandExecutor.mjs → internal/commandExecutor.esm.js} +20 -15
- package/{mjs/internal/error.mjs → internal/error.esm.js} +5 -3
- package/{mjs/internal/fileSystem.mjs → internal/fileSystem.esm.js} +68 -20
- package/{mjs/internal/http/etag.mjs → internal/http/etag.esm.js} +10 -6
- package/{mjs/internal/http/formData.mjs → internal/http/formData.esm.js} +24 -23
- package/{mjs/internal/http/incomingMessage.mjs → internal/http/incomingMessage.esm.js} +14 -13
- package/{mjs/internal/http/nodeClient.mjs → internal/http/nodeClient.esm.js} +34 -26
- package/{mjs/internal/http/platform.mjs → internal/http/platform.esm.js} +16 -13
- package/{mjs/internal/http/server.mjs → internal/http/server.esm.js} +30 -27
- package/{mjs/internal/path.mjs → internal/path.esm.js} +15 -10
- package/{mjs/internal/runtime.mjs → internal/runtime.esm.js} +7 -5
- package/{mjs/internal/sink.mjs → internal/sink.esm.js} +7 -5
- package/{mjs/internal/stream.mjs → internal/stream.esm.js} +13 -8
- package/package.json +174 -31
- package/src/CommandExecutor.ts +1 -1
- package/src/FileSystem.ts +1 -1
- package/src/Http/Etag.ts +1 -1
- package/src/Http/FormData.ts +1 -1
- package/src/Http/NodeClient.ts +1 -1
- package/src/Http/Platform.ts +1 -1
- package/src/Http/Server.ts +1 -1
- package/src/HttpClient.ts +1 -1
- package/src/HttpServer.ts +3 -3
- package/src/KeyValueStore.ts +2 -2
- package/src/NodeContext.ts +3 -3
- package/src/Path.ts +1 -1
- package/src/Runtime.ts +1 -1
- package/src/Sink.ts +1 -1
- package/src/Stream.ts +1 -1
- package/src/index.ts +13 -13
- package/src/internal/commandExecutor.ts +3 -3
- package/src/internal/fileSystem.ts +1 -1
- package/src/internal/http/formData.ts +1 -1
- package/src/internal/http/incomingMessage.ts +1 -1
- package/src/internal/http/nodeClient.ts +3 -3
- package/src/internal/http/platform.ts +2 -2
- package/src/internal/http/server.ts +4 -4
- package/src/internal/sink.ts +1 -1
- package/src/internal/stream.ts +1 -1
- package/Command.d.ts.map +0 -1
- package/Command.js +0 -103
- package/Command.js.map +0 -1
- package/CommandExecutor.d.ts.map +0 -1
- package/CommandExecutor.js +0 -26
- package/CommandExecutor.js.map +0 -1
- package/Effectify.d.ts.map +0 -1
- package/Effectify.js +0 -13
- package/Effectify.js.map +0 -1
- package/Error.d.ts.map +0 -1
- package/Error.js +0 -25
- package/Error.js.map +0 -1
- package/FileSystem.d.ts.map +0 -1
- package/FileSystem.js +0 -32
- package/FileSystem.js.map +0 -1
- package/Http/Etag.d.ts.map +0 -1
- package/Http/Etag.js +0 -46
- package/Http/Etag.js.map +0 -1
- package/Http/FormData.d.ts.map +0 -1
- package/Http/FormData.js +0 -46
- package/Http/FormData.js.map +0 -1
- package/Http/NodeClient.d.ts.map +0 -1
- package/Http/NodeClient.js +0 -54
- package/Http/NodeClient.js.map +0 -1
- package/Http/Platform.d.ts.map +0 -1
- package/Http/Platform.js +0 -46
- package/Http/Platform.js.map +0 -1
- package/Http/Server.d.ts.map +0 -1
- package/Http/Server.js +0 -52
- package/Http/Server.js.map +0 -1
- package/HttpClient.d.ts.map +0 -1
- package/HttpClient.js +0 -25
- package/HttpClient.js.map +0 -1
- package/HttpServer.d.ts.map +0 -1
- package/HttpServer.js +0 -33
- package/HttpServer.js.map +0 -1
- package/KeyValueStore.d.ts.map +0 -1
- package/KeyValueStore.js +0 -43
- package/KeyValueStore.js.map +0 -1
- package/NodeContext.d.ts.map +0 -1
- package/NodeContext.js +0 -23
- package/NodeContext.js.map +0 -1
- package/Path.d.ts.map +0 -1
- package/Path.js +0 -36
- package/Path.js.map +0 -1
- package/Runtime.d.ts.map +0 -1
- package/Runtime.js +0 -26
- package/Runtime.js.map +0 -1
- package/Sink.d.ts.map +0 -1
- package/Sink.js +0 -19
- package/Sink.js.map +0 -1
- package/Stream.d.ts.map +0 -1
- package/Stream.js +0 -29
- package/Stream.js.map +0 -1
- package/index.d.ts +0 -55
- package/index.d.ts.map +0 -1
- package/index.js +0 -35
- package/index.js.map +0 -1
- package/internal/commandExecutor.d.ts +0 -2
- package/internal/commandExecutor.d.ts.map +0 -1
- package/internal/commandExecutor.js +0 -151
- package/internal/commandExecutor.js.map +0 -1
- package/internal/error.d.ts +0 -2
- package/internal/error.d.ts.map +0 -1
- package/internal/error.js.map +0 -1
- package/internal/fileSystem.d.ts +0 -2
- package/internal/fileSystem.d.ts.map +0 -1
- package/internal/fileSystem.js +0 -345
- package/internal/fileSystem.js.map +0 -1
- package/internal/http/etag.d.ts +0 -2
- package/internal/http/etag.d.ts.map +0 -1
- package/internal/http/etag.js +0 -51
- package/internal/http/etag.js.map +0 -1
- package/internal/http/formData.d.ts +0 -6
- package/internal/http/formData.d.ts.map +0 -1
- package/internal/http/formData.js +0 -116
- package/internal/http/formData.js.map +0 -1
- package/internal/http/incomingMessage.d.ts +0 -2
- package/internal/http/incomingMessage.d.ts.map +0 -1
- package/internal/http/incomingMessage.js +0 -66
- package/internal/http/incomingMessage.js.map +0 -1
- package/internal/http/nodeClient.d.ts +0 -2
- package/internal/http/nodeClient.d.ts.map +0 -1
- package/internal/http/nodeClient.js +0 -169
- package/internal/http/nodeClient.js.map +0 -1
- package/internal/http/platform.d.ts +0 -2
- package/internal/http/platform.d.ts.map +0 -1
- package/internal/http/platform.js +0 -50
- package/internal/http/platform.js.map +0 -1
- package/internal/http/server.d.ts +0 -2
- package/internal/http/server.d.ts.map +0 -1
- package/internal/http/server.js +0 -226
- package/internal/http/server.js.map +0 -1
- package/internal/path.d.ts +0 -2
- package/internal/path.d.ts.map +0 -1
- package/internal/path.js +0 -49
- package/internal/path.js.map +0 -1
- package/internal/runtime.d.ts +0 -2
- package/internal/runtime.d.ts.map +0 -1
- package/internal/runtime.js +0 -35
- package/internal/runtime.js.map +0 -1
- package/internal/sink.d.ts +0 -2
- package/internal/sink.d.ts.map +0 -1
- package/internal/sink.js +0 -41
- package/internal/sink.js.map +0 -1
- package/internal/stream.d.ts +0 -2
- package/internal/stream.d.ts.map +0 -1
- package/internal/stream.js +0 -100
- package/internal/stream.js.map +0 -1
- package/mjs/Command.mjs +0 -85
- package/mjs/Command.mjs.map +0 -1
- package/mjs/CommandExecutor.mjs +0 -16
- package/mjs/CommandExecutor.mjs.map +0 -1
- package/mjs/Effectify.mjs +0 -10
- package/mjs/Effectify.mjs.map +0 -1
- package/mjs/Error.mjs +0 -20
- package/mjs/Error.mjs.map +0 -1
- package/mjs/FileSystem.mjs +0 -21
- package/mjs/FileSystem.mjs.map +0 -1
- package/mjs/Http/Etag.mjs +0 -21
- package/mjs/Http/Etag.mjs.map +0 -1
- package/mjs/Http/FormData.mjs +0 -21
- package/mjs/Http/FormData.mjs.map +0 -1
- package/mjs/Http/NodeClient.mjs +0 -45
- package/mjs/Http/NodeClient.mjs.map +0 -1
- package/mjs/Http/Platform.mjs.map +0 -1
- package/mjs/Http/Server.mjs +0 -26
- package/mjs/Http/Server.mjs.map +0 -1
- package/mjs/HttpClient.mjs +0 -69
- package/mjs/HttpClient.mjs.map +0 -1
- package/mjs/HttpServer.mjs +0 -101
- package/mjs/HttpServer.mjs.map +0 -1
- package/mjs/KeyValueStore.mjs +0 -19
- package/mjs/KeyValueStore.mjs.map +0 -1
- package/mjs/NodeContext.mjs +0 -14
- package/mjs/NodeContext.mjs.map +0 -1
- package/mjs/Path.mjs +0 -26
- package/mjs/Path.mjs.map +0 -1
- package/mjs/Runtime.mjs +0 -16
- package/mjs/Runtime.mjs.map +0 -1
- package/mjs/Sink.mjs +0 -10
- package/mjs/Sink.mjs.map +0 -1
- package/mjs/Stream.mjs +0 -20
- package/mjs/Stream.mjs.map +0 -1
- package/mjs/index.mjs +0 -27
- package/mjs/index.mjs.map +0 -1
- package/mjs/internal/commandExecutor.mjs.map +0 -1
- package/mjs/internal/error.mjs.map +0 -1
- package/mjs/internal/fileSystem.mjs.map +0 -1
- package/mjs/internal/http/etag.mjs.map +0 -1
- package/mjs/internal/http/formData.mjs.map +0 -1
- package/mjs/internal/http/incomingMessage.mjs.map +0 -1
- package/mjs/internal/http/nodeClient.mjs.map +0 -1
- package/mjs/internal/http/platform.mjs.map +0 -1
- package/mjs/internal/http/server.mjs.map +0 -1
- package/mjs/internal/path.mjs.map +0 -1
- package/mjs/internal/runtime.mjs.map +0 -1
- package/mjs/internal/sink.mjs.map +0 -1
- package/mjs/internal/stream.mjs.map +0 -1
- package/tsconfig.build.json +0 -11
- package/tsconfig.examples.json +0 -12
- package/tsconfig.json +0 -11
- package/tsconfig.test.json +0 -17
- /package/{Command.d.ts → dist/declarations/src/Command.d.ts} +0 -0
- /package/{Effectify.d.ts → dist/declarations/src/Effectify.d.ts} +0 -0
- /package/{Error.d.ts → dist/declarations/src/Error.d.ts} +0 -0
- /package/{FileSystem.d.ts → dist/declarations/src/FileSystem.d.ts} +0 -0
- /package/{Path.d.ts → dist/declarations/src/Path.d.ts} +0 -0
- /package/{Sink.d.ts → dist/declarations/src/Sink.d.ts} +0 -0
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import
|
|
1
|
+
import { effectify } from '@effect/platform/Effectify';
|
|
2
|
+
import * as Error from '@effect/platform/Error';
|
|
3
|
+
import * as FileSystem from '@effect/platform/FileSystem';
|
|
4
|
+
import * as Effect from 'effect/Effect';
|
|
5
|
+
import { pipe } from 'effect/Function';
|
|
6
|
+
import * as Layer from 'effect/Layer';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
8
|
+
import * as Crypto from 'node:crypto';
|
|
9
|
+
import * as NFS from 'node:fs';
|
|
10
|
+
import * as OS from 'node:os';
|
|
11
|
+
import * as NodePath from 'node:path';
|
|
12
|
+
import { handleErrnoException } from './error.esm.js';
|
|
13
|
+
|
|
13
14
|
const handleBadArgument = method => err => Error.BadArgument({
|
|
14
15
|
module: "FileSystem",
|
|
15
16
|
method,
|
|
16
17
|
message: err.message ?? String(err)
|
|
17
18
|
});
|
|
19
|
+
|
|
18
20
|
// == access
|
|
21
|
+
|
|
19
22
|
const access = /*#__PURE__*/(() => {
|
|
20
23
|
const nodeAccess = /*#__PURE__*/effectify(NFS.access, /*#__PURE__*/handleErrnoException("FileSystem", "access"), /*#__PURE__*/handleBadArgument("access"));
|
|
21
24
|
return (path, options) => {
|
|
@@ -29,7 +32,9 @@ const access = /*#__PURE__*/(() => {
|
|
|
29
32
|
return nodeAccess(path, mode);
|
|
30
33
|
};
|
|
31
34
|
})();
|
|
35
|
+
|
|
32
36
|
// == copy
|
|
37
|
+
|
|
33
38
|
const copy = /*#__PURE__*/(() => {
|
|
34
39
|
const nodeCp = /*#__PURE__*/effectify(NFS.cp, /*#__PURE__*/handleErrnoException("FileSystem", "copy"), /*#__PURE__*/handleBadArgument("copy"));
|
|
35
40
|
return (fromPath, toPath, options) => nodeCp(fromPath, toPath, {
|
|
@@ -38,27 +43,37 @@ const copy = /*#__PURE__*/(() => {
|
|
|
38
43
|
recursive: true
|
|
39
44
|
});
|
|
40
45
|
})();
|
|
46
|
+
|
|
41
47
|
// == copyFile
|
|
48
|
+
|
|
42
49
|
const copyFile = /*#__PURE__*/(() => {
|
|
43
50
|
const nodeCopyFile = /*#__PURE__*/effectify(NFS.copyFile, /*#__PURE__*/handleErrnoException("FileSystem", "copyFile"), /*#__PURE__*/handleBadArgument("copyFile"));
|
|
44
51
|
return (fromPath, toPath) => nodeCopyFile(fromPath, toPath);
|
|
45
52
|
})();
|
|
53
|
+
|
|
46
54
|
// == chmod
|
|
55
|
+
|
|
47
56
|
const chmod = /*#__PURE__*/(() => {
|
|
48
57
|
const nodeChmod = /*#__PURE__*/effectify(NFS.chmod, /*#__PURE__*/handleErrnoException("FileSystem", "chmod"), /*#__PURE__*/handleBadArgument("chmod"));
|
|
49
58
|
return (path, mode) => nodeChmod(path, mode);
|
|
50
59
|
})();
|
|
60
|
+
|
|
51
61
|
// == chown
|
|
62
|
+
|
|
52
63
|
const chown = /*#__PURE__*/(() => {
|
|
53
64
|
const nodeChown = /*#__PURE__*/effectify(NFS.chown, /*#__PURE__*/handleErrnoException("FileSystem", "chown"), /*#__PURE__*/handleBadArgument("chown"));
|
|
54
65
|
return (path, uid, gid) => nodeChown(path, uid, gid);
|
|
55
66
|
})();
|
|
67
|
+
|
|
56
68
|
// == link
|
|
69
|
+
|
|
57
70
|
const link = /*#__PURE__*/(() => {
|
|
58
71
|
const nodeLink = /*#__PURE__*/effectify(NFS.link, /*#__PURE__*/handleErrnoException("FileSystem", "link"), /*#__PURE__*/handleBadArgument("link"));
|
|
59
72
|
return (existingPath, newPath) => nodeLink(existingPath, newPath);
|
|
60
73
|
})();
|
|
74
|
+
|
|
61
75
|
// == makeDirectory
|
|
76
|
+
|
|
62
77
|
const makeDirectory = /*#__PURE__*/(() => {
|
|
63
78
|
const nodeMkdir = /*#__PURE__*/effectify(NFS.mkdir, /*#__PURE__*/handleErrnoException("FileSystem", "makeDirectory"), /*#__PURE__*/handleBadArgument("makeDirectory"));
|
|
64
79
|
return (path, options) => nodeMkdir(path, {
|
|
@@ -66,17 +81,21 @@ const makeDirectory = /*#__PURE__*/(() => {
|
|
|
66
81
|
mode: options?.mode
|
|
67
82
|
});
|
|
68
83
|
})();
|
|
84
|
+
|
|
69
85
|
// == makeTempDirectory
|
|
86
|
+
|
|
70
87
|
const makeTempDirectoryFactory = method => {
|
|
71
88
|
const nodeMkdtemp = effectify(NFS.mkdtemp, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
72
89
|
return options => Effect.suspend(() => {
|
|
73
90
|
const prefix = options?.prefix ?? "";
|
|
74
|
-
const directory = typeof options?.directory === "string" ?
|
|
75
|
-
return nodeMkdtemp(prefix ?
|
|
91
|
+
const directory = typeof options?.directory === "string" ? NodePath.join(options.directory, ".") : OS.tmpdir();
|
|
92
|
+
return nodeMkdtemp(prefix ? NodePath.join(directory, prefix) : directory + "/");
|
|
76
93
|
});
|
|
77
94
|
};
|
|
78
95
|
const makeTempDirectory = /*#__PURE__*/makeTempDirectoryFactory("makeTempDirectory");
|
|
96
|
+
|
|
79
97
|
// == remove
|
|
98
|
+
|
|
80
99
|
const removeFactory = method => {
|
|
81
100
|
const nodeRm = effectify(NFS.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
82
101
|
return (path, options) => nodeRm(path, {
|
|
@@ -84,7 +103,9 @@ const removeFactory = method => {
|
|
|
84
103
|
});
|
|
85
104
|
};
|
|
86
105
|
const remove = /*#__PURE__*/removeFactory("remove");
|
|
106
|
+
|
|
87
107
|
// == makeTempDirectoryScoped
|
|
108
|
+
|
|
88
109
|
const makeTempDirectoryScoped = /*#__PURE__*/(() => {
|
|
89
110
|
const makeDirectory = /*#__PURE__*/makeTempDirectoryFactory("makeTempDirectoryScoped");
|
|
90
111
|
const removeDirectory = /*#__PURE__*/removeFactory("makeTempDirectoryScoped");
|
|
@@ -92,7 +113,9 @@ const makeTempDirectoryScoped = /*#__PURE__*/(() => {
|
|
|
92
113
|
recursive: true
|
|
93
114
|
})));
|
|
94
115
|
})();
|
|
116
|
+
|
|
95
117
|
// == open
|
|
118
|
+
|
|
96
119
|
const openFactory = method => {
|
|
97
120
|
const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
98
121
|
const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
|
|
@@ -109,11 +132,11 @@ const makeFile = /*#__PURE__*/(() => {
|
|
|
109
132
|
const nodeWrite = /*#__PURE__*/nodeWriteFactory("write");
|
|
110
133
|
const nodeWriteAll = /*#__PURE__*/nodeWriteFactory("writeAll");
|
|
111
134
|
class FileImpl {
|
|
135
|
+
semaphore = Effect.unsafeMakeSemaphore(1);
|
|
136
|
+
position = 0n;
|
|
112
137
|
constructor(fd, append) {
|
|
113
138
|
this.fd = fd;
|
|
114
139
|
this.append = append;
|
|
115
|
-
this.semaphore = Effect.unsafeMakeSemaphore(1);
|
|
116
|
-
this.position = 0n;
|
|
117
140
|
this[FileSystem.FileTypeId] = FileSystem.FileTypeId;
|
|
118
141
|
}
|
|
119
142
|
get stat() {
|
|
@@ -198,31 +221,38 @@ const makeFile = /*#__PURE__*/(() => {
|
|
|
198
221
|
return this.semaphore.withPermits(1)(this.writeAllChunk(buffer));
|
|
199
222
|
}
|
|
200
223
|
}
|
|
201
|
-
FileSystem.FileTypeId;
|
|
202
224
|
return (fd, append) => new FileImpl(fd, append);
|
|
203
225
|
})();
|
|
226
|
+
|
|
204
227
|
// == makeTempFile
|
|
228
|
+
|
|
205
229
|
const makeTempFileFactory = method => {
|
|
206
230
|
const makeDirectory = makeTempDirectoryFactory(method);
|
|
207
231
|
const open = openFactory(method);
|
|
208
232
|
const randomHexString = bytes => Effect.sync(() => Crypto.randomBytes(bytes).toString("hex"));
|
|
209
|
-
return options => pipe(Effect.zip(makeDirectory(options), randomHexString(6)), Effect.map(([directory, random]) =>
|
|
233
|
+
return options => pipe(Effect.zip(makeDirectory(options), randomHexString(6)), Effect.map(([directory, random]) => NodePath.join(directory, random)), Effect.tap(path => Effect.scoped(open(path, {
|
|
210
234
|
flag: "w+"
|
|
211
235
|
}))));
|
|
212
236
|
};
|
|
213
237
|
const makeTempFile = /*#__PURE__*/makeTempFileFactory("makeTempFile");
|
|
238
|
+
|
|
214
239
|
// == makeTempFileScoped
|
|
240
|
+
|
|
215
241
|
const makeTempFileScoped = /*#__PURE__*/(() => {
|
|
216
242
|
const makeFile = /*#__PURE__*/makeTempFileFactory("makeTempFileScoped");
|
|
217
243
|
const removeFile = /*#__PURE__*/removeFactory("makeTempFileScoped");
|
|
218
244
|
return options => Effect.acquireRelease(makeFile(options), file => Effect.orDie(removeFile(file)));
|
|
219
245
|
})();
|
|
246
|
+
|
|
220
247
|
// == readDirectory
|
|
248
|
+
|
|
221
249
|
const readDirectory = /*#__PURE__*/(() => {
|
|
222
250
|
const nodeReadDirectory = /*#__PURE__*/effectify(NFS.readdir, /*#__PURE__*/handleErrnoException("FileSystem", "readDirectory"), /*#__PURE__*/handleBadArgument("readDirectory"));
|
|
223
251
|
return (path, options) => nodeReadDirectory(path, options);
|
|
224
252
|
})();
|
|
253
|
+
|
|
225
254
|
// == readFile
|
|
255
|
+
|
|
226
256
|
const readFile = path => Effect.async((resume, signal) => {
|
|
227
257
|
try {
|
|
228
258
|
NFS.readFile(path, {
|
|
@@ -238,22 +268,30 @@ const readFile = path => Effect.async((resume, signal) => {
|
|
|
238
268
|
resume(Effect.fail(handleBadArgument("readFile")(err)));
|
|
239
269
|
}
|
|
240
270
|
});
|
|
271
|
+
|
|
241
272
|
// == readLink
|
|
273
|
+
|
|
242
274
|
const readLink = /*#__PURE__*/(() => {
|
|
243
275
|
const nodeReadLink = /*#__PURE__*/effectify(NFS.readlink, /*#__PURE__*/handleErrnoException("FileSystem", "readLink"), /*#__PURE__*/handleBadArgument("readLink"));
|
|
244
276
|
return path => nodeReadLink(path);
|
|
245
277
|
})();
|
|
278
|
+
|
|
246
279
|
// == realPath
|
|
280
|
+
|
|
247
281
|
const realPath = /*#__PURE__*/(() => {
|
|
248
282
|
const nodeRealPath = /*#__PURE__*/effectify(NFS.realpath, /*#__PURE__*/handleErrnoException("FileSystem", "realPath"), /*#__PURE__*/handleBadArgument("realPath"));
|
|
249
283
|
return path => nodeRealPath(path);
|
|
250
284
|
})();
|
|
285
|
+
|
|
251
286
|
// == rename
|
|
287
|
+
|
|
252
288
|
const rename = /*#__PURE__*/(() => {
|
|
253
289
|
const nodeRename = /*#__PURE__*/effectify(NFS.rename, /*#__PURE__*/handleErrnoException("FileSystem", "rename"), /*#__PURE__*/handleBadArgument("rename"));
|
|
254
290
|
return (oldPath, newPath) => nodeRename(oldPath, newPath);
|
|
255
291
|
})();
|
|
292
|
+
|
|
256
293
|
// == stat
|
|
294
|
+
|
|
257
295
|
const makeFileInfo = stat => ({
|
|
258
296
|
type: stat.isFile() ? "File" : stat.isDirectory() ? "Directory" : stat.isSymbolicLink() ? "SymbolicLink" : stat.isBlockDevice() ? "BlockDevice" : stat.isCharacterDevice() ? "CharacterDevice" : stat.isFIFO() ? "FIFO" : stat.isSocket() ? "Socket" : "Unknown",
|
|
259
297
|
mtime: Option.fromNullable(stat.mtime),
|
|
@@ -274,22 +312,30 @@ const stat = /*#__PURE__*/(() => {
|
|
|
274
312
|
const nodeStat = /*#__PURE__*/effectify(NFS.stat, /*#__PURE__*/handleErrnoException("FileSystem", "stat"), /*#__PURE__*/handleBadArgument("stat"));
|
|
275
313
|
return path => Effect.map(nodeStat(path), makeFileInfo);
|
|
276
314
|
})();
|
|
315
|
+
|
|
277
316
|
// == symlink
|
|
317
|
+
|
|
278
318
|
const symlink = /*#__PURE__*/(() => {
|
|
279
319
|
const nodeSymlink = /*#__PURE__*/effectify(NFS.symlink, /*#__PURE__*/handleErrnoException("FileSystem", "symlink"), /*#__PURE__*/handleBadArgument("symlink"));
|
|
280
320
|
return (target, path) => nodeSymlink(target, path);
|
|
281
321
|
})();
|
|
322
|
+
|
|
282
323
|
// == truncate
|
|
324
|
+
|
|
283
325
|
const truncate = /*#__PURE__*/(() => {
|
|
284
326
|
const nodeTruncate = /*#__PURE__*/effectify(NFS.truncate, /*#__PURE__*/handleErrnoException("FileSystem", "truncate"), /*#__PURE__*/handleBadArgument("truncate"));
|
|
285
327
|
return (path, length) => nodeTruncate(path, length !== undefined ? Number(length) : undefined);
|
|
286
328
|
})();
|
|
329
|
+
|
|
287
330
|
// == utimes
|
|
331
|
+
|
|
288
332
|
const utimes = /*#__PURE__*/(() => {
|
|
289
333
|
const nodeUtimes = /*#__PURE__*/effectify(NFS.utimes, /*#__PURE__*/handleErrnoException("FileSystem", "utime"), /*#__PURE__*/handleBadArgument("utime"));
|
|
290
334
|
return (path, atime, mtime) => nodeUtimes(path, atime, mtime);
|
|
291
335
|
})();
|
|
336
|
+
|
|
292
337
|
// == writeFile
|
|
338
|
+
|
|
293
339
|
const writeFile = (path, data, options) => Effect.async((resume, signal) => {
|
|
294
340
|
try {
|
|
295
341
|
NFS.writeFile(path, data, {
|
|
@@ -332,6 +378,8 @@ const fileSystemImpl = /*#__PURE__*/FileSystem.make({
|
|
|
332
378
|
utimes,
|
|
333
379
|
writeFile
|
|
334
380
|
});
|
|
381
|
+
|
|
335
382
|
/** @internal */
|
|
336
|
-
|
|
337
|
-
|
|
383
|
+
const layer = /*#__PURE__*/Layer.succeed(FileSystem.FileSystem, fileSystemImpl);
|
|
384
|
+
|
|
385
|
+
export { layer };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as Etag from
|
|
2
|
-
import * as Effect from
|
|
3
|
-
import * as Layer from
|
|
1
|
+
import * as Etag from '@effect/platform/Http/Etag';
|
|
2
|
+
import * as Effect from 'effect/Effect';
|
|
3
|
+
import * as Layer from 'effect/Layer';
|
|
4
|
+
|
|
4
5
|
const fromFileInfo = info => {
|
|
5
6
|
const mtime = info.mtime._tag === "Some" ? info.mtime.value.getTime().toString(16) : "0";
|
|
6
7
|
return `${info.size.toString(16)}-${mtime}`;
|
|
@@ -8,8 +9,9 @@ const fromFileInfo = info => {
|
|
|
8
9
|
const fromFileWeb = file => {
|
|
9
10
|
return `${file.size.toString(16)}-${file.lastModified.toString(16)}`;
|
|
10
11
|
};
|
|
12
|
+
|
|
11
13
|
/** @internal */
|
|
12
|
-
|
|
14
|
+
const layer = /*#__PURE__*/Layer.succeed(Etag.Generator, /*#__PURE__*/Etag.Generator.of({
|
|
13
15
|
[Etag.GeneratorTypeId]: Etag.GeneratorTypeId,
|
|
14
16
|
fromFileInfo(info) {
|
|
15
17
|
return Effect.sync(() => ({
|
|
@@ -24,8 +26,9 @@ export const layer = /*#__PURE__*/Layer.succeed(Etag.Generator, /*#__PURE__*/Eta
|
|
|
24
26
|
}));
|
|
25
27
|
}
|
|
26
28
|
}));
|
|
29
|
+
|
|
27
30
|
/** @internal */
|
|
28
|
-
|
|
31
|
+
const layerWeak = /*#__PURE__*/Layer.succeed(Etag.Generator, /*#__PURE__*/Etag.Generator.of({
|
|
29
32
|
[Etag.GeneratorTypeId]: Etag.GeneratorTypeId,
|
|
30
33
|
fromFileInfo(info) {
|
|
31
34
|
return Effect.sync(() => ({
|
|
@@ -40,4 +43,5 @@ export const layerWeak = /*#__PURE__*/Layer.succeed(Etag.Generator, /*#__PURE__*
|
|
|
40
43
|
}));
|
|
41
44
|
}
|
|
42
45
|
}));
|
|
43
|
-
|
|
46
|
+
|
|
47
|
+
export { layer, layerWeak };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
13
|
-
import
|
|
14
|
-
|
|
1
|
+
import * as FileSystem from '@effect/platform/FileSystem';
|
|
2
|
+
import * as FormData from '@effect/platform/Http/FormData';
|
|
3
|
+
import * as Path from '@effect/platform/Path';
|
|
4
|
+
import Busboy from 'busboy';
|
|
5
|
+
import * as Chunk from 'effect/Chunk';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as FiberRef from 'effect/FiberRef';
|
|
8
|
+
import { pipe } from 'effect/Function';
|
|
9
|
+
import * as Option from 'effect/Option';
|
|
10
|
+
import * as Stream from 'effect/Stream';
|
|
11
|
+
import * as NFS from 'node:fs';
|
|
12
|
+
import * as NodeStreamP from 'node:stream/promises';
|
|
13
|
+
import { fromReadable, toString } from '../../Stream/dist/effect-platform-node-Stream.esm.js';
|
|
14
|
+
|
|
15
|
+
const stream = (source, headers) => pipe(Effect.Do, Effect.bind("maxParts", () => FiberRef.get(FormData.maxParts)), Effect.bind("maxFields", () => FiberRef.get(FormData.maxFields)), Effect.bind("maxFiles", () => FiberRef.get(FormData.maxFiles)), Effect.bind("fieldMimeTypes", () => FiberRef.get(FormData.fieldMimeTypes)), Effect.bind("maxFieldSize", () => FiberRef.get(FormData.maxFieldSize)), Effect.bind("maxFileSize", () => FiberRef.get(FormData.maxFileSize)), Effect.bind("busboy", ({
|
|
15
16
|
maxFieldSize,
|
|
16
17
|
maxFields,
|
|
17
18
|
maxFileSize,
|
|
@@ -46,7 +47,7 @@ export const stream = (source, headers) => pipe(Effect.Do, Effect.bind("maxParts
|
|
|
46
47
|
stream.once("limit", () => {
|
|
47
48
|
emit.fail(FormData.FormDataError("FileTooLarge", new Error("maxFileSize exceeded")));
|
|
48
49
|
});
|
|
49
|
-
emit.single(new FileImpl(name, info.filename, info.mimeType,
|
|
50
|
+
emit.single(new FileImpl(name, info.filename, info.mimeType, fromReadable(() => stream, error => FormData.FormDataError("InternalError", error)), stream));
|
|
50
51
|
});
|
|
51
52
|
busboy.on("error", _ => {
|
|
52
53
|
emit.fail(FormData.FormDataError("InternalError", _));
|
|
@@ -55,34 +56,33 @@ export const stream = (source, headers) => pipe(Effect.Do, Effect.bind("maxParts
|
|
|
55
56
|
emit.end();
|
|
56
57
|
});
|
|
57
58
|
source.pipe(busboy);
|
|
58
|
-
}), part => part._tag === "File" && Chunk.some(fieldMimeTypes, _ => part.contentType.includes(_)) ? Effect.map(
|
|
59
|
+
}), part => part._tag === "File" && Chunk.some(fieldMimeTypes, _ => part.contentType.includes(_)) ? Effect.map(toString({
|
|
59
60
|
readable: () => part.source,
|
|
60
61
|
onFailure: error => FormData.FormDataError("InternalError", error)
|
|
61
62
|
}), content => new FieldImpl(part.key, part.contentType, content)) : Effect.succeed(part))), Stream.unwrapScoped);
|
|
62
63
|
class FieldImpl {
|
|
64
|
+
_tag = "Field";
|
|
63
65
|
constructor(key, contentType, value) {
|
|
64
66
|
this.key = key;
|
|
65
67
|
this.contentType = contentType;
|
|
66
68
|
this.value = value;
|
|
67
|
-
this._tag = "Field";
|
|
68
69
|
this[FormData.TypeId] = FormData.TypeId;
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
FormData.TypeId;
|
|
72
72
|
class FileImpl {
|
|
73
|
+
_tag = "File";
|
|
73
74
|
constructor(key, name, contentType, content, source) {
|
|
74
75
|
this.key = key;
|
|
75
76
|
this.name = name;
|
|
76
77
|
this.contentType = contentType;
|
|
77
78
|
this.content = content;
|
|
78
79
|
this.source = source;
|
|
79
|
-
this._tag = "File";
|
|
80
80
|
this[FormData.TypeId] = FormData.TypeId;
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
|
|
84
84
|
/** @internal */
|
|
85
|
-
|
|
85
|
+
const formData = (source, headers) => Effect.flatMap(Effect.all([Effect.mapError(Effect.flatMap(FileSystem.FileSystem, fs => fs.makeTempDirectoryScoped()), error => FormData.FormDataError("InternalError", error)), Path.Path]), ([dir, path_]) => Stream.runFoldEffect(stream(source, headers), new globalThis.FormData(), (formData, part) => {
|
|
86
86
|
if (part._tag === "Field") {
|
|
87
87
|
formData.append(part.key, part.value);
|
|
88
88
|
return Effect.succeed(formData);
|
|
@@ -96,10 +96,11 @@ export const formData = (source, headers) => Effect.flatMap(Effect.all([Effect.m
|
|
|
96
96
|
});
|
|
97
97
|
formData.append(part.key, blob, path);
|
|
98
98
|
return Effect.as(Effect.tryPromise({
|
|
99
|
-
try: signal => NodeStreamP.pipeline(file.source,
|
|
99
|
+
try: signal => NodeStreamP.pipeline(file.source, NFS.createWriteStream(path), {
|
|
100
100
|
signal
|
|
101
101
|
}),
|
|
102
102
|
catch: error => FormData.FormDataError("InternalError", error)
|
|
103
103
|
}), formData);
|
|
104
104
|
}));
|
|
105
|
-
|
|
105
|
+
|
|
106
|
+
export { formData, stream };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
1
|
+
import * as Headers from '@effect/platform/Http/Headers';
|
|
2
|
+
import * as IncomingMessage from '@effect/platform/Http/IncomingMessage';
|
|
3
|
+
import * as UrlParams from '@effect/platform/Http/UrlParams';
|
|
4
|
+
import * as Effect from 'effect/Effect';
|
|
5
|
+
import * as FiberRef from 'effect/FiberRef';
|
|
6
|
+
import * as Option from 'effect/Option';
|
|
7
|
+
import { toString, fromReadable, toUint8Array } from '../../Stream/dist/effect-platform-node-Stream.esm.js';
|
|
8
|
+
|
|
8
9
|
/** @internal */
|
|
9
|
-
|
|
10
|
+
class IncomingMessageImpl {
|
|
10
11
|
constructor(source, onError, remoteAddressOverride) {
|
|
11
12
|
this.source = source;
|
|
12
13
|
this.onError = onError;
|
|
@@ -23,7 +24,7 @@ export class IncomingMessageImpl {
|
|
|
23
24
|
if (this.textEffect) {
|
|
24
25
|
return this.textEffect;
|
|
25
26
|
}
|
|
26
|
-
this.textEffect = Effect.runSync(Effect.cached(Effect.flatMap(FiberRef.get(IncomingMessage.maxBodySize), maxBodySize =>
|
|
27
|
+
this.textEffect = Effect.runSync(Effect.cached(Effect.flatMap(FiberRef.get(IncomingMessage.maxBodySize), maxBodySize => toString({
|
|
27
28
|
readable: () => this.source,
|
|
28
29
|
onFailure: this.onError,
|
|
29
30
|
maxBytes: Option.getOrUndefined(maxBodySize)
|
|
@@ -43,15 +44,15 @@ export class IncomingMessageImpl {
|
|
|
43
44
|
}));
|
|
44
45
|
}
|
|
45
46
|
get stream() {
|
|
46
|
-
return
|
|
47
|
+
return fromReadable(() => this.source, this.onError);
|
|
47
48
|
}
|
|
48
49
|
get arrayBuffer() {
|
|
49
|
-
return Effect.flatMap(FiberRef.get(IncomingMessage.maxBodySize), maxBodySize =>
|
|
50
|
+
return Effect.flatMap(FiberRef.get(IncomingMessage.maxBodySize), maxBodySize => toUint8Array({
|
|
50
51
|
readable: () => this.source,
|
|
51
52
|
onFailure: this.onError,
|
|
52
53
|
maxBytes: Option.getOrUndefined(maxBodySize)
|
|
53
54
|
}));
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
|
|
58
|
+
export { IncomingMessageImpl };
|
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import * as
|
|
9
|
-
import
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import * as Client from '@effect/platform/Http/Client';
|
|
2
|
+
import * as Error from '@effect/platform/Http/ClientError';
|
|
3
|
+
import * as ClientResponse from '@effect/platform/Http/ClientResponse';
|
|
4
|
+
import * as UrlParams from '@effect/platform/Http/UrlParams';
|
|
5
|
+
import * as Context from 'effect/Context';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import { pipe } from 'effect/Function';
|
|
8
|
+
import * as Layer from 'effect/Layer';
|
|
9
|
+
import * as Stream from 'effect/Stream';
|
|
10
|
+
import * as Http from 'node:http';
|
|
11
|
+
import * as Https from 'node:https';
|
|
12
|
+
import { Readable } from 'node:stream';
|
|
13
|
+
import { pipeline } from 'node:stream/promises';
|
|
14
|
+
import { fromWritable } from '../../Sink/dist/effect-platform-node-Sink.esm.js';
|
|
15
|
+
import { IncomingMessageImpl } from './incomingMessage.esm.js';
|
|
16
|
+
|
|
16
17
|
/** @internal */
|
|
17
|
-
|
|
18
|
+
const HttpAgentTypeId = /*#__PURE__*/Symbol.for("@effect/platform-node/Http/NodeClient/HttpAgent");
|
|
19
|
+
|
|
18
20
|
/** @internal */
|
|
19
|
-
|
|
21
|
+
const HttpAgent = /*#__PURE__*/Context.Tag(HttpAgentTypeId);
|
|
22
|
+
|
|
20
23
|
/** @internal */
|
|
21
|
-
|
|
24
|
+
const makeAgent = options => Effect.map(Effect.all([Effect.acquireRelease(Effect.sync(() => new Http.Agent(options)), agent => Effect.sync(() => agent.destroy())), Effect.acquireRelease(Effect.sync(() => new Https.Agent(options)), agent => Effect.sync(() => agent.destroy()))]), ([http, https]) => ({
|
|
22
25
|
[HttpAgentTypeId]: HttpAgentTypeId,
|
|
23
26
|
http,
|
|
24
27
|
https
|
|
25
28
|
}));
|
|
29
|
+
|
|
26
30
|
/** @internal */
|
|
27
|
-
|
|
31
|
+
const makeAgentLayer = options => Layer.scoped(HttpAgent, makeAgent(options));
|
|
32
|
+
|
|
28
33
|
/** @internal */
|
|
29
|
-
|
|
34
|
+
const agentLayer = /*#__PURE__*/makeAgentLayer();
|
|
30
35
|
const fromAgent = agent => Client.make(request => Effect.flatMap(UrlParams.makeUrl(request.url, request.urlParams, _ => Error.RequestError({
|
|
31
36
|
request,
|
|
32
37
|
reason: "InvalidUrl",
|
|
@@ -82,7 +87,7 @@ const sendBody = (nodeRequest, request, body) => Effect.suspend(() => {
|
|
|
82
87
|
request,
|
|
83
88
|
reason: "Encode",
|
|
84
89
|
error: _
|
|
85
|
-
})),
|
|
90
|
+
})), fromWritable(() => nodeRequest, _ => Error.RequestError({
|
|
86
91
|
request,
|
|
87
92
|
reason: "Transport",
|
|
88
93
|
error: _
|
|
@@ -149,11 +154,14 @@ class ClientResponseImpl extends IncomingMessageImpl {
|
|
|
149
154
|
};
|
|
150
155
|
}
|
|
151
156
|
}
|
|
152
|
-
|
|
157
|
+
|
|
153
158
|
/** @internal */
|
|
154
|
-
|
|
159
|
+
const make = /*#__PURE__*/Effect.map(HttpAgent, fromAgent);
|
|
160
|
+
|
|
155
161
|
/** @internal */
|
|
156
|
-
|
|
162
|
+
const layerWithoutAgent = /*#__PURE__*/Layer.effect(Client.Client, make);
|
|
163
|
+
|
|
157
164
|
/** @internal */
|
|
158
|
-
|
|
159
|
-
|
|
165
|
+
const layer = /*#__PURE__*/Layer.provide(agentLayer, layerWithoutAgent);
|
|
166
|
+
|
|
167
|
+
export { HttpAgent, HttpAgentTypeId, agentLayer, layer, layerWithoutAgent, make, makeAgent, makeAgentLayer };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import * as
|
|
5
|
-
import
|
|
6
|
-
import * as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
1
|
+
import * as Platform from '@effect/platform/Http/Platform';
|
|
2
|
+
import * as ServerResponse from '@effect/platform/Http/ServerResponse';
|
|
3
|
+
import { pipe } from 'effect/Function';
|
|
4
|
+
import * as Layer from 'effect/Layer';
|
|
5
|
+
import Mime from 'mime';
|
|
6
|
+
import * as NFS from 'node:fs';
|
|
7
|
+
import { Readable } from 'node:stream';
|
|
8
|
+
import { layer as layer$1 } from '../../FileSystem/dist/effect-platform-node-FileSystem.esm.js';
|
|
9
|
+
import { layer as layer$2 } from '../../Http/Http/Etag/dist/effect-platform-node-Http-Etag.esm.js';
|
|
10
|
+
|
|
10
11
|
/** @internal */
|
|
11
|
-
|
|
12
|
+
const make = /*#__PURE__*/Platform.make({
|
|
12
13
|
fileResponse(path, status, statusText, headers, start, end, contentLength) {
|
|
13
|
-
const stream =
|
|
14
|
+
const stream = NFS.createReadStream(path, {
|
|
14
15
|
start,
|
|
15
16
|
end
|
|
16
17
|
});
|
|
@@ -36,6 +37,8 @@ export const make = /*#__PURE__*/Platform.make({
|
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
});
|
|
40
|
+
|
|
39
41
|
/** @internal */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
const layer = /*#__PURE__*/pipe( /*#__PURE__*/Layer.effect(Platform.Platform, make), /*#__PURE__*/Layer.use(layer$1), /*#__PURE__*/Layer.use(layer$2));
|
|
43
|
+
|
|
44
|
+
export { layer, make };
|