@effect/platform-node 4.0.0-beta.70 → 4.0.0-beta.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Mime.d.ts +6 -0
- package/dist/Mime.d.ts.map +1 -1
- package/dist/Mime.js +6 -0
- package/dist/Mime.js.map +1 -1
- package/dist/NodeCrypto.d.ts +1 -1
- package/dist/NodeCrypto.d.ts.map +1 -1
- package/dist/NodeCrypto.js +10 -2
- package/dist/NodeCrypto.js.map +1 -1
- package/dist/NodeFileSystem.d.ts.map +1 -1
- package/dist/NodeFileSystem.js +22 -14
- package/dist/NodeFileSystem.js.map +1 -1
- package/dist/NodeHttpClient.d.ts +44 -26
- package/dist/NodeHttpClient.d.ts.map +1 -1
- package/dist/NodeHttpClient.js +42 -24
- package/dist/NodeHttpClient.js.map +1 -1
- package/dist/NodeHttpIncomingMessage.d.ts +35 -14
- package/dist/NodeHttpIncomingMessage.d.ts.map +1 -1
- package/dist/NodeHttpIncomingMessage.js +34 -13
- package/dist/NodeHttpIncomingMessage.js.map +1 -1
- package/dist/NodeHttpServerRequest.d.ts +2 -2
- package/dist/NodeHttpServerRequest.js +2 -2
- package/dist/NodeMultipart.d.ts +31 -16
- package/dist/NodeMultipart.d.ts.map +1 -1
- package/dist/NodeMultipart.js +29 -14
- package/dist/NodeMultipart.js.map +1 -1
- package/dist/NodePath.d.ts.map +1 -1
- package/dist/NodePath.js +24 -11
- package/dist/NodePath.js.map +1 -1
- package/dist/NodeRedis.d.ts +34 -16
- package/dist/NodeRedis.d.ts.map +1 -1
- package/dist/NodeRedis.js +33 -15
- package/dist/NodeRedis.js.map +1 -1
- package/dist/NodeRuntime.d.ts +3 -3
- package/dist/NodeRuntime.d.ts.map +1 -1
- package/dist/NodeRuntime.js +26 -12
- package/dist/NodeRuntime.js.map +1 -1
- package/dist/NodeServices.d.ts +31 -16
- package/dist/NodeServices.d.ts.map +1 -1
- package/dist/NodeServices.js.map +1 -1
- package/dist/NodeSocket.d.ts.map +1 -1
- package/dist/NodeSocket.js +31 -16
- package/dist/NodeSocket.js.map +1 -1
- package/dist/NodeStdio.d.ts.map +1 -1
- package/dist/NodeStdio.js +21 -13
- package/dist/NodeStdio.js.map +1 -1
- package/dist/NodeTerminal.d.ts.map +1 -1
- package/dist/NodeTerminal.js +18 -8
- package/dist/NodeTerminal.js.map +1 -1
- package/dist/NodeWorker.d.ts.map +1 -1
- package/dist/NodeWorker.js +28 -14
- package/dist/NodeWorker.js.map +1 -1
- package/dist/NodeWorkerRunner.d.ts.map +1 -1
- package/dist/NodeWorkerRunner.js +35 -15
- package/dist/NodeWorkerRunner.js.map +1 -1
- package/dist/Undici.d.ts +13 -0
- package/dist/Undici.d.ts.map +1 -1
- package/dist/Undici.js +13 -0
- package/dist/Undici.js.map +1 -1
- package/dist/index.d.ts +0 -350
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -350
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/Mime.ts +7 -0
- package/src/NodeCrypto.ts +10 -2
- package/src/NodeFileSystem.ts +22 -14
- package/src/NodeHttpClient.ts +42 -24
- package/src/NodeHttpIncomingMessage.ts +34 -13
- package/src/NodeHttpServerRequest.ts +2 -2
- package/src/NodeMultipart.ts +29 -14
- package/src/NodePath.ts +24 -11
- package/src/NodeRedis.ts +33 -15
- package/src/NodeRuntime.ts +28 -14
- package/src/NodeServices.ts +31 -16
- package/src/NodeSocket.ts +29 -14
- package/src/NodeStdio.ts +21 -13
- package/src/NodeTerminal.ts +18 -8
- package/src/NodeWorker.ts +28 -14
- package/src/NodeWorkerRunner.ts +35 -15
- package/src/Undici.ts +13 -0
- package/src/index.ts +0 -350
package/dist/NodeStdio.js
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Node.js
|
|
2
|
+
* Node.js `Stdio` layer for the current process.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* command-line arguments
|
|
6
|
-
* `process.stdin`, and
|
|
7
|
-
* `process.stderr`. It is
|
|
8
|
-
*
|
|
9
|
-
* Effect services.
|
|
4
|
+
* The exported layer satisfies the platform-independent `Stdio` service by
|
|
5
|
+
* reading command-line arguments from `process.argv`, consuming input from
|
|
6
|
+
* `process.stdin`, and writing output streams to `process.stdout` and
|
|
7
|
+
* `process.stderr`. It is the stdio bridge used by CLIs, scripts, command
|
|
8
|
+
* runners, and tests that intentionally communicate through the host process.
|
|
10
9
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
10
|
+
* **Mental model**
|
|
11
|
+
*
|
|
12
|
+
* Effects should depend on `Stdio`; this module decides that the backing
|
|
13
|
+
* streams are the global Node process handles. Provide `NodeStdio.layer` when a
|
|
14
|
+
* program only needs standard input and output, or `NodeServices.layer` when the
|
|
15
|
+
* same entrypoint also needs the other default Node services.
|
|
16
|
+
*
|
|
17
|
+
* **Gotchas**
|
|
18
|
+
*
|
|
19
|
+
* The process stdio streams are shared resources. The layer leaves stdin open
|
|
20
|
+
* and does not end stdout or stderr by default, avoiding accidental closure of
|
|
21
|
+
* handles that other code in the same process may still use. Stdio might be a
|
|
22
|
+
* pipe, file, or TTY; terminal-specific behavior such as raw mode, echo, color
|
|
23
|
+
* detection, and cursor movement belongs with terminal APIs rather than this
|
|
24
|
+
* service.
|
|
17
25
|
*
|
|
18
26
|
* @since 4.0.0
|
|
19
27
|
*/
|
package/dist/NodeStdio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeStdio.js","names":["NodeStdio","layer"],"sources":["../src/NodeStdio.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeStdio.js","names":["NodeStdio","layer"],"sources":["../src/NodeStdio.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,OAAO,KAAKA,SAAS,MAAM,wCAAwC;AAInE;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAuBD,SAAS,CAACC,KAAK","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTerminal.d.ts","sourceRoot":"","sources":["../src/NodeTerminal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeTerminal.d.ts","sourceRoot":"","sources":["../src/NodeTerminal.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE1D;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,OAAO,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAqB,CAAA;AAErH;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAsB,CAAA"}
|
package/dist/NodeTerminal.js
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
2
|
+
* Node.js implementation of the Effect `Terminal` service.
|
|
3
|
+
*
|
|
4
|
+
* `NodeTerminal` connects `Terminal` to the current process' stdin and stdout
|
|
5
|
+
* so Node programs can read lines, stream key presses, write display output,
|
|
6
|
+
* and inspect terminal dimensions through the Effect service environment.
|
|
7
|
+
*
|
|
8
|
+
* **Mental model**
|
|
9
|
+
*
|
|
10
|
+
* `make` acquires a scoped terminal backed by process streams, and `layer`
|
|
11
|
+
* provides that service with the default key sequence for quitting input. When
|
|
12
|
+
* stdin is a TTY, low-level key input temporarily enables raw mode for the
|
|
13
|
+
* lifetime of the scope; finalization restores the previous terminal state.
|
|
14
|
+
*
|
|
15
|
+
* **Gotchas**
|
|
16
|
+
*
|
|
17
|
+
* In non-TTY environments such as CI, pipes, or redirected input, terminal
|
|
10
18
|
* dimensions may be reported as zero and raw-mode key handling is unavailable.
|
|
19
|
+
* For plain stdin/stdout byte streams, use the standard I/O service instead of
|
|
20
|
+
* the interactive terminal service.
|
|
11
21
|
*
|
|
12
22
|
* @since 4.0.0
|
|
13
23
|
*/
|
package/dist/NodeTerminal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTerminal.js","names":["NodeTerminal","make","layer"],"sources":["../src/NodeTerminal.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeTerminal.js","names":["NodeTerminal","make","layer"],"sources":["../src/NodeTerminal.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,KAAKA,YAAY,MAAM,2CAA2C;AAMzE;;;;;;;AAOA,OAAO,MAAMC,IAAI,GAAmFD,YAAY,CAACC,IAAI;AAErH;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAoBF,YAAY,CAACE,KAAK","ignoreList":[]}
|
package/dist/NodeWorker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeWorker.d.ts","sourceRoot":"","sources":["../src/NodeWorker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeWorker.d.ts","sourceRoot":"","sources":["../src/NodeWorker.ts"],"names":[],"mappings":"AAsCA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,MAAM,MAAM,gCAAgC,CAAA;AAExD,OAAO,KAAK,KAAK,YAAY,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,KAAK,aAAa,MAAM,qBAAqB,CAAA;AAEzD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CA2E5D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAChB,OAAO,CAAC,EAAE,EAAE,MAAM,KAAK,aAAa,CAAC,MAAM,GAAG,YAAY,CAAC,YAAY,KACtE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,OAAO,CAIlD,CAAA"}
|
package/dist/NodeWorker.js
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Parent-side Node.js support for Effect workers.
|
|
3
3
|
*
|
|
4
|
-
* This module
|
|
5
|
-
*
|
|
6
|
-
* processes through Effect's worker protocol
|
|
7
|
-
*
|
|
8
|
-
* CPU-bound work, isolating Node resources, or hosting services that should
|
|
9
|
-
* exchange typed messages with the parent process.
|
|
4
|
+
* This module installs the `WorkerPlatform` used by a Node program that owns
|
|
5
|
+
* workers. It supports both `node:worker_threads` workers and IPC-enabled child
|
|
6
|
+
* processes, routing messages through Effect's worker protocol so higher-level
|
|
7
|
+
* worker clients can treat either runtime as the same parent-side transport.
|
|
10
8
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `
|
|
18
|
-
*
|
|
9
|
+
* **Mental model**
|
|
10
|
+
*
|
|
11
|
+
* `NodeWorker` runs in the parent process. The worker entrypoint should install
|
|
12
|
+
* `NodeWorkerRunner`, which receives parent messages, runs the registered
|
|
13
|
+
* Effect handler, and sends replies back over the same channel. Use `layer`
|
|
14
|
+
* when you want this module to provide both the platform and a `Worker.Spawner`;
|
|
15
|
+
* use `layerPlatform` when the spawner is provided elsewhere.
|
|
16
|
+
*
|
|
17
|
+
* **Common tasks**
|
|
18
|
+
*
|
|
19
|
+
* - Spawn CPU-bound or resource-isolated work in `worker_threads`.
|
|
20
|
+
* - Spawn a child process that was created with an IPC channel.
|
|
21
|
+
* - Share one parent-side worker implementation across both Node transports.
|
|
22
|
+
*
|
|
23
|
+
* **Gotchas**
|
|
24
|
+
*
|
|
25
|
+
* Worker-thread spawners can use `postMessage` transfer lists for values such as
|
|
26
|
+
* `ArrayBuffer` and `MessagePort`; transferring moves ownership, and invalid
|
|
27
|
+
* transfer lists surface as send or receive failures. Child-process spawners
|
|
28
|
+
* must provide an IPC channel, for example via `child_process.fork` or
|
|
29
|
+
* `stdio: "ipc"`; their messages use Node IPC serialization and transfer lists
|
|
30
|
+
* are not forwarded to `ChildProcess.send`. Scope finalization sends the worker
|
|
31
|
+
* close signal and waits for exit before falling back to `terminate()` or
|
|
32
|
+
* `SIGKILL`.
|
|
19
33
|
*
|
|
20
34
|
* @since 4.0.0
|
|
21
35
|
*/
|
package/dist/NodeWorker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeWorker.js","names":["Deferred","Effect","Exit","Layer","Scope","Worker","WorkerError","WorkerReceiveError","layerPlatform","succeed","WorkerPlatform","makePlatform","setup","scope","worker","exitDeferred","makeUnsafe","thing","postMessage","msg","t","kill","terminate","_","send","on","doneUnsafe","void","as","addFinalizer","suspend","await","pipe","timeout","catchCause","sync","listen","deferred","emit","port","message","cause","reason","code","layer","spawn","merge","layerSpawner"],"sources":["../src/NodeWorker.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeWorker.js","names":["Deferred","Effect","Exit","Layer","Scope","Worker","WorkerError","WorkerReceiveError","layerPlatform","succeed","WorkerPlatform","makePlatform","setup","scope","worker","exitDeferred","makeUnsafe","thing","postMessage","msg","t","kill","terminate","_","send","on","doneUnsafe","void","as","addFinalizer","suspend","await","pipe","timeout","catchCause","sync","listen","deferred","emit","port","message","cause","reason","code","layer","spawn","merge","layerSpaw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AAC;QACdoC,MAAM,EAAE,IAAInC,kBAAkB,CAAC;UAC7BiC,OAAO,EAAE,mCAAmC,GAAGG;SAChD;OACF,CAAC,CACH;IACH,CAAC,CAAC;IACF,OAAO1C,MAAM,CAAC0B,IAAI;EACpB;CACD,CAAC,CACH;AAED;;;;;;;AAOA,OAAO,MAAMiB,KAAK,GAChBC,KAAuE,IAEvE1C,KAAK,CAAC2C,KAAK,CACTzC,MAAM,CAAC0C,YAAY,CAACF,KAAK,CAAC,EAC1BrC,aAAa,CACd","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeWorkerRunner.d.ts","sourceRoot":"","sources":["../src/NodeWorkerRunner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeWorkerRunner.d.ts","sourceRoot":"","sources":["../src/NodeWorkerRunner.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,YAAY,MAAM,sCAAsC,CAAA;AAGpE;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,oBAAoB,CA+E/D,CAAA"}
|
package/dist/NodeWorkerRunner.js
CHANGED
|
@@ -1,21 +1,41 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js runtime support for workers that serve Effect worker requests.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
8
|
-
* over the parent channel.
|
|
4
|
+
* `NodeWorkerRunner` supplies the Node implementation of the Effect worker
|
|
5
|
+
* runner platform. Install {@link layer} inside code that is already running in
|
|
6
|
+
* a `node:worker_threads` worker or in a child process with an IPC channel. The
|
|
7
|
+
* layer listens for parent messages, runs handlers registered through
|
|
8
|
+
* `WorkerRunner`, and replies over the same parent channel.
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
10
|
+
* **Mental model**
|
|
11
|
+
*
|
|
12
|
+
* - The parent process creates a worker with the Node worker APIs.
|
|
13
|
+
* - The worker process provides this module's {@link layer} to its runner program.
|
|
14
|
+
* - Startup sends a ready message to the parent, then request messages are
|
|
15
|
+
* dispatched to the registered Effect handler.
|
|
16
|
+
* - Responses are sent with Node `postMessage` for worker threads or
|
|
17
|
+
* `process.send` for child processes.
|
|
18
|
+
* - Shutdown is initiated by the parent protocol and closes or unreferences the
|
|
19
|
+
* parent channel.
|
|
20
|
+
*
|
|
21
|
+
* **Common tasks**
|
|
22
|
+
*
|
|
23
|
+
* - Provide {@link layer} in the worker entrypoint before running `WorkerRunner`.
|
|
24
|
+
* - Host CPU-bound work or isolated Node resources behind the Effect worker protocol.
|
|
25
|
+
* - Return transferable values when using `worker_threads`.
|
|
26
|
+
*
|
|
27
|
+
* **Gotchas**
|
|
28
|
+
*
|
|
29
|
+
* - The runner must start inside an actual worker context; otherwise the layer
|
|
30
|
+
* fails because neither `parentPort` nor `process.send` is available.
|
|
31
|
+
* - Transfer lists only apply to `worker_threads`; child-process IPC uses Node
|
|
32
|
+
* serialization.
|
|
33
|
+
* - Long-running handlers should remain interruptible and keep cleanup in
|
|
34
|
+
* scopes so parent-driven shutdown can release resources.
|
|
35
|
+
*
|
|
36
|
+
* **See also**
|
|
37
|
+
*
|
|
38
|
+
* - {@link layer} for the Node worker runner platform.
|
|
19
39
|
*
|
|
20
40
|
* @since 4.0.0
|
|
21
41
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","Layer","WorkerError","WorkerReceiveError","WorkerSpawnError","WorkerRunner","WorkerThreads","layer","succeed","WorkerRunnerPlatform","start","gen","parentPort","process","send","reason","message","sendUnsafe","_portId","transfers","postMessage","_transfers","sync","run","handler","scopedWith","fnUntraced","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","context","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","on","result","isEffect","fiber","addObserver","close","channel","unref","doneUnsafe","void","await"],"sources":["../src/NodeWorkerRunner.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeWorkerRunner.js","names":["Cause","Deferred","Effect","Exit","Fiber","Layer","WorkerError","WorkerReceiveError","WorkerSpawnError","WorkerRunner","WorkerThreads","layer","succeed","WorkerRunnerPlatform","start","gen","parentPort","process","send","reason","message","sendUnsafe","_portId","transfers","postMessage","_transfers","sync","run","handler","scopedWith","fnUntraced","scope","closeLatch","makeUnsafe","trackFiber","runIn","services","context","runFork","runForkWith","onExit","exit","_tag","hasInterruptsOnly","cause","logError","on","result","isEffect","fiber","addObserver","close","channel","unref","doneUnsafe","void","await"],"sources":["../src/NodeWorkerRunner.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,IAAI,MAAM,aAAa;AACnC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,SAASC,WAAW,EAAEC,kBAAkB,EAAEC,gBAAgB,QAAQ,qCAAqC;AACvG,OAAO,KAAKC,YAAY,MAAM,sCAAsC;AACpE,OAAO,KAAKC,aAAa,MAAM,qBAAqB;AAEpD;;;;;;;;AAQA,OAAO,MAAMC,KAAK,gBAAmDN,KAAK,CAACO,OAAO,CAACH,YAAY,CAACI,oBAAoB,CAAC,CAAC;EACpHC,KAAKA,CAAA;IACH,OAAOZ,MAAM,CAACa,GAAG,CAAC,aAAS;MACzB,I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BAA6B;gBACtCwB;eACD;aACF,CAAC,CACH;UACH,CAAC,CAAC;QACJ;QAEAvB,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAElB,OAAO,OAAOpB,QAAQ,CAACuD,KAAK,CAACxB,UAAU,CAAC;MAC1C,CAAC,CAAC,CAAC;MAEL,OAAO;QAAEL,GAAG;QAAET,IAAI;QAAEG;MAAU,CAAE;IAClC,CAAC,CAAC;EACJ;CACD,CAAC","ignoreList":[]}
|
package/dist/Undici.d.ts
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Re-export of the Undici HTTP client package used by the Node platform.
|
|
3
|
+
*
|
|
4
|
+
* This module gives Effect applications a package-local import for Undici
|
|
5
|
+
* primitives while working with `@effect/platform-node`. Import named Undici
|
|
6
|
+
* APIs from here when configuring Node HTTP client dispatchers, creating agents
|
|
7
|
+
* or mock agents, setting the process-global dispatcher, or sharing the same
|
|
8
|
+
* Undici types with integrations that use the platform HTTP client.
|
|
9
|
+
*
|
|
10
|
+
* The module does not wrap or reinterpret Undici behavior. It forwards the
|
|
11
|
+
* installed `undici` named exports and default export, so connection pooling,
|
|
12
|
+
* dispatcher lifetimes, mocking, aborts, and request options follow Undici's
|
|
13
|
+
* own semantics.
|
|
14
|
+
*
|
|
2
15
|
* @since 4.0.0
|
|
3
16
|
*/
|
|
4
17
|
import Undici from "undici";
|
package/dist/Undici.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Undici.d.ts","sourceRoot":"","sources":["../src/Undici.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Undici.d.ts","sourceRoot":"","sources":["../src/Undici.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B;;;GAGG;AACH,cAAc,QAAQ,CAAA;AAEtB;;;GAGG;AACH,eAAe,MAAM,CAAA"}
|
package/dist/Undici.js
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* Re-export of the Undici HTTP client package used by the Node platform.
|
|
3
|
+
*
|
|
4
|
+
* This module gives Effect applications a package-local import for Undici
|
|
5
|
+
* primitives while working with `@effect/platform-node`. Import named Undici
|
|
6
|
+
* APIs from here when configuring Node HTTP client dispatchers, creating agents
|
|
7
|
+
* or mock agents, setting the process-global dispatcher, or sharing the same
|
|
8
|
+
* Undici types with integrations that use the platform HTTP client.
|
|
9
|
+
*
|
|
10
|
+
* The module does not wrap or reinterpret Undici behavior. It forwards the
|
|
11
|
+
* installed `undici` named exports and default export, so connection pooling,
|
|
12
|
+
* dispatcher lifetimes, mocking, aborts, and request options follow Undici's
|
|
13
|
+
* own semantics.
|
|
14
|
+
*
|
|
2
15
|
* @since 4.0.0
|
|
3
16
|
*/
|
|
4
17
|
import Undici from "undici";
|
package/dist/Undici.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Undici.js","names":["Undici"],"sources":["../src/Undici.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Undici.js","names":["Undici"],"sources":["../src/Undici.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;AAgBA,OAAOA,MAAM,MAAM,QAAQ;AAE3B;;;;AAIA,cAAc,QAAQ;AAEtB;;;;AAIA,eAAeA,MAAM","ignoreList":[]}
|