@smthrs/platform-node 1.0.0-rc.5 → 1.0.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/bin/win32-x64/smithers-jj-export.exe +0 -0
- package/dist/cjs/EgressHttpClient.d.ts +1 -1
- package/dist/cjs/EgressHttpClient.d.ts.map +1 -1
- package/dist/cjs/EgressHttpClient.js +4 -4
- package/dist/cjs/EgressHttpClient.js.map +2 -2
- package/dist/cjs/NodeHost.d.ts +2 -2
- package/dist/cjs/NodeHost.d.ts.map +1 -1
- package/dist/cjs/NodeHost.js.map +2 -2
- package/dist/cjs/ProcessConfinement.js +1 -1
- package/dist/cjs/ProcessConfinement.js.map +2 -2
- package/dist/cjs/ProcessReaper.d.ts +1 -1
- package/dist/cjs/ProcessReaper.d.ts.map +1 -1
- package/dist/cjs/ProcessReaper.js +1 -1
- package/dist/cjs/ProcessReaper.js.map +1 -1
- package/dist/cjs/ScopedProcess.d.ts +2 -2
- package/dist/cjs/ScopedProcess.d.ts.map +1 -1
- package/dist/cjs/ScopedProcess.js +1 -1
- package/dist/cjs/ScopedProcess.js.map +2 -2
- package/dist/cjs/internal/PipedProcess.d.ts +2 -2
- package/dist/cjs/internal/PipedProcess.d.ts.map +1 -1
- package/dist/cjs/internal/PipedProcess.js +2 -2
- package/dist/cjs/internal/PipedProcess.js.map +2 -2
- package/dist/cjs/internal/ProcessCleanup.d.ts +1 -1
- package/dist/cjs/internal/ProcessCleanup.d.ts.map +1 -1
- package/dist/cjs/internal/ProcessCleanup.js.map +1 -1
- package/dist/cjs/internal/ProcessSupervisor.d.ts +2 -2
- package/dist/cjs/internal/ProcessSupervisor.d.ts.map +1 -1
- package/dist/cjs/internal/ProcessSupervisor.js +2 -2
- package/dist/cjs/internal/ProcessSupervisor.js.map +2 -2
- package/dist/esm/EgressHttpClient.d.ts +1 -1
- package/dist/esm/EgressHttpClient.d.ts.map +1 -1
- package/dist/esm/EgressHttpClient.js +4 -4
- package/dist/esm/EgressHttpClient.js.map +1 -1
- package/dist/esm/NodeHost.d.ts +2 -2
- package/dist/esm/NodeHost.d.ts.map +1 -1
- package/dist/esm/NodeHost.js.map +1 -1
- package/dist/esm/ProcessConfinement.js +1 -1
- package/dist/esm/ProcessConfinement.js.map +1 -1
- package/dist/esm/ProcessReaper.d.ts +1 -1
- package/dist/esm/ProcessReaper.d.ts.map +1 -1
- package/dist/esm/ProcessReaper.js +1 -1
- package/dist/esm/ProcessReaper.js.map +1 -1
- package/dist/esm/ScopedProcess.d.ts +2 -2
- package/dist/esm/ScopedProcess.d.ts.map +1 -1
- package/dist/esm/ScopedProcess.js +1 -1
- package/dist/esm/ScopedProcess.js.map +1 -1
- package/dist/esm/internal/PipedProcess.d.ts +2 -2
- package/dist/esm/internal/PipedProcess.d.ts.map +1 -1
- package/dist/esm/internal/PipedProcess.js +2 -2
- package/dist/esm/internal/PipedProcess.js.map +1 -1
- package/dist/esm/internal/ProcessCleanup.d.ts +1 -1
- package/dist/esm/internal/ProcessCleanup.d.ts.map +1 -1
- package/dist/esm/internal/ProcessCleanup.js.map +1 -1
- package/dist/esm/internal/ProcessSupervisor.d.ts +2 -2
- package/dist/esm/internal/ProcessSupervisor.d.ts.map +1 -1
- package/dist/esm/internal/ProcessSupervisor.js +2 -2
- package/dist/esm/internal/ProcessSupervisor.js.map +1 -1
- package/dist/vendor/adapters.json +622 -382
- package/dist/vendor/{chunk-42QKY6T6.js → chunk-2ZAGBWTH.js} +1 -1
- package/dist/vendor/{chunk-3GR5VZ2M.js → chunk-3SL3HKQA.js} +3 -3
- package/dist/vendor/{chunk-VANKHF46.js → chunk-423HXGL6.js} +55 -23
- package/dist/vendor/{chunk-6ME2W7TF.js → chunk-4WIQ2XN7.js} +2 -2
- package/dist/vendor/{chunk-Y35ZAO5U.js → chunk-6FSJ2PMW.js} +8 -8
- package/dist/vendor/{chunk-5ZMHBXIK.js → chunk-6L2NJEOV.js} +11 -4
- package/dist/vendor/{chunk-TFIKFFSC.js → chunk-7NMJM44J.js} +2 -2
- package/dist/vendor/{chunk-OXNGN5H7.js → chunk-A7UXCEJA.js} +1 -1
- package/dist/vendor/chunk-ADP5LRUF.js +274 -0
- package/dist/vendor/{chunk-DS7GF46S.js → chunk-AWNTTSHL.js} +2 -2
- package/dist/vendor/{chunk-IIJ52ZU6.js → chunk-BUKVIAEM.js} +2 -2
- package/dist/vendor/{chunk-BKTBUBQY.js → chunk-BY3SDXID.js} +71 -7
- package/dist/vendor/{chunk-JJ24ARBQ.js → chunk-C3PGUWW5.js} +53 -33
- package/dist/vendor/{chunk-J7A4CZDO.js → chunk-D2ZL4PLZ.js} +8 -7
- package/dist/vendor/{chunk-XDKNKFBW.js → chunk-D4HEMNGU.js} +2 -2
- package/dist/vendor/{chunk-DVOAHXPG.js → chunk-FFD6R5JZ.js} +3 -3
- package/dist/vendor/{chunk-UFH5UUZK.js → chunk-HDV6VIRM.js} +1 -1
- package/dist/vendor/chunk-IWSDM4CG.js +16 -0
- package/dist/vendor/{chunk-KUUXSID7.js → chunk-KABHKTVG.js} +2 -2
- package/dist/vendor/{chunk-B3FZ67QU.js → chunk-KFDBU6RR.js} +4 -3
- package/dist/vendor/chunk-LNWGIDIG.js +20 -0
- package/dist/vendor/{chunk-TXKLEBBL.js → chunk-MUEED3C3.js} +3 -2
- package/dist/vendor/{chunk-EZWY45HP.js → chunk-N6TK35N5.js} +2 -2
- package/dist/vendor/{chunk-QPLDT6A6.js → chunk-NQO6V4KI.js} +29 -13
- package/dist/vendor/{chunk-AMQKOQNT.js → chunk-NTEWGPPG.js} +9 -9
- package/dist/vendor/chunk-NUJQMLJP.js +325 -0
- package/dist/vendor/{chunk-54RLBMTZ.js → chunk-OF3N2FN4.js} +1 -1
- package/dist/vendor/{chunk-RO2R4MJH.js → chunk-PA32ARKD.js} +17 -17
- package/dist/vendor/{chunk-JG5TTWPT.js → chunk-PECOFLCU.js} +3 -3
- package/dist/vendor/{chunk-VZBDV3TV.js → chunk-PU7QVYND.js} +2 -2
- package/dist/vendor/{chunk-2Y7WC4KU.js → chunk-QHR2RC5M.js} +2 -2
- package/dist/vendor/{chunk-QYBKAIA6.js → chunk-R327POEZ.js} +2 -2
- package/dist/vendor/chunk-RKVXYKHJ.js +29 -0
- package/dist/vendor/{chunk-XH4U3JSV.js → chunk-RQH5DSBA.js} +2 -2
- package/dist/vendor/{chunk-DWSHTSVX.js → chunk-S6QUQLBV.js} +5 -5
- package/dist/vendor/{chunk-KOZMM5PZ.js → chunk-UPIQ52FQ.js} +12 -12
- package/dist/vendor/{chunk-EGBNVEEW.js → chunk-UUQXJRMK.js} +1 -1
- package/dist/vendor/{chunk-LEUPYT3Q.js → chunk-UUYTTEDH.js} +1 -1
- package/dist/vendor/{chunk-NBVRTDTV.js → chunk-V2EB7FHY.js} +2 -2
- package/dist/vendor/{chunk-M32LDTW7.js → chunk-VIWU4EBF.js} +2 -2
- package/dist/vendor/{chunk-SIR62W3Y.js → chunk-VWSWEUN5.js} +51 -31
- package/dist/vendor/{chunk-MBSKBQ5D.js → chunk-WPZDL2D7.js} +1 -1
- package/dist/vendor/chunk-YDY5P7GL.js +20 -0
- package/dist/vendor/{chunk-FNZOJHSV.js → chunk-YFD4QFIL.js} +17 -17
- package/dist/vendor/{chunk-GXCHI7BM.js → chunk-ZVJCBTJG.js} +5 -5
- 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 +1 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +13 -22
- package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +14 -8
- package/dist/vendor/cjs/node/NodeCrypto.d.ts +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 +1 -0
- package/dist/vendor/cjs/node/NodeHttpClient.d.ts +21 -2
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +5 -3
- package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +8 -6
- package/dist/vendor/cjs/node/NodeHttpServer.d.ts +21 -10
- package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +4 -1
- package/dist/vendor/cjs/node/NodeMultipart.d.ts +5 -1
- package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +9 -1
- package/dist/vendor/cjs/node/NodePath.d.ts +3 -0
- package/dist/vendor/cjs/node/NodeRedis.d.ts +5 -1
- package/dist/vendor/cjs/node/NodeRuntime.d.ts +3 -0
- package/dist/vendor/cjs/node/NodeServices.d.ts +4 -1
- package/dist/vendor/cjs/node/NodeSink.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeSocket.d.ts +10 -3
- package/dist/vendor/cjs/node/NodeSocketServer.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeStdio.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeStream.d.ts +1 -0
- package/dist/vendor/cjs/node/NodeTerminal.d.ts +6 -3
- package/dist/vendor/cjs/node/NodeWorker.d.ts +3 -1
- package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +2 -1
- package/dist/vendor/cjs/node/Undici.d.ts +3 -0
- package/dist/vendor/cjs/node/index.d.ts +40 -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 +12 -3
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +17 -4
- package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +3 -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 +1 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +5 -1
- package/dist/vendor/cjs/node-shared/NodePath.d.ts +3 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +4 -0
- package/dist/vendor/cjs/node-shared/NodeSink.d.ts +4 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +11 -1
- package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +8 -1
- package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +1 -0
- package/dist/vendor/cjs/node-shared/NodeStream.d.ts +15 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +6 -4
- package/dist/vendor/cjs/node-shared/index.d.ts +29 -0
- package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +1 -1
- package/dist/vendor/cjs/platform-node-shared.d.ts +29 -0
- package/dist/vendor/cjs/platform-node.d.ts +40 -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 +1 -0
- package/dist/vendor/node/NodeChildProcessSpawner.js +6 -6
- package/dist/vendor/node/NodeClusterHttp.d.ts +13 -22
- package/dist/vendor/node/NodeClusterHttp.js +32 -32
- package/dist/vendor/node/NodeClusterSocket.d.ts +14 -8
- package/dist/vendor/node/NodeClusterSocket.js +15 -15
- package/dist/vendor/node/NodeCrypto.d.ts +1 -0
- package/dist/vendor/node/NodeCrypto.js +2 -2
- 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 +1 -0
- package/dist/vendor/node/NodeFileSystem.js +3 -3
- package/dist/vendor/node/NodeHttpClient.d.ts +21 -2
- package/dist/vendor/node/NodeHttpClient.js +6 -6
- package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +5 -3
- package/dist/vendor/node/NodeHttpIncomingMessage.js +4 -4
- package/dist/vendor/node/NodeHttpPlatform.d.ts +8 -6
- package/dist/vendor/node/NodeHttpPlatform.js +8 -8
- package/dist/vendor/node/NodeHttpServer.d.ts +21 -10
- package/dist/vendor/node/NodeHttpServer.js +26 -26
- package/dist/vendor/node/NodeHttpServerRequest.d.ts +4 -1
- package/dist/vendor/node/NodeHttpServerRequest.js +1 -1
- package/dist/vendor/node/NodeMultipart.d.ts +5 -1
- package/dist/vendor/node/NodeMultipart.js +5 -5
- package/dist/vendor/node/NodeMultipartParser.d.ts +9 -1
- package/dist/vendor/node/NodeMultipartParser.js +1 -1
- package/dist/vendor/node/NodePath.d.ts +3 -0
- package/dist/vendor/node/NodePath.js +2 -2
- package/dist/vendor/node/NodeRedis.d.ts +5 -1
- package/dist/vendor/node/NodeRedis.js +1 -1
- package/dist/vendor/node/NodeRuntime.d.ts +3 -0
- package/dist/vendor/node/NodeRuntime.js +2 -2
- package/dist/vendor/node/NodeServices.d.ts +4 -1
- package/dist/vendor/node/NodeServices.js +17 -17
- package/dist/vendor/node/NodeSink.d.ts +1 -0
- package/dist/vendor/node/NodeSink.js +2 -2
- package/dist/vendor/node/NodeSocket.d.ts +10 -3
- package/dist/vendor/node/NodeSocket.js +2 -2
- package/dist/vendor/node/NodeSocketServer.d.ts +1 -0
- package/dist/vendor/node/NodeSocketServer.js +3 -3
- package/dist/vendor/node/NodeStdio.d.ts +1 -0
- package/dist/vendor/node/NodeStdio.js +4 -4
- package/dist/vendor/node/NodeStream.d.ts +1 -0
- package/dist/vendor/node/NodeStream.js +3 -3
- package/dist/vendor/node/NodeTerminal.d.ts +6 -3
- package/dist/vendor/node/NodeTerminal.js +2 -2
- package/dist/vendor/node/NodeWorker.d.ts +3 -1
- package/dist/vendor/node/NodeWorker.js +1 -1
- package/dist/vendor/node/NodeWorkerRunner.d.ts +2 -1
- package/dist/vendor/node/NodeWorkerRunner.js +1 -1
- package/dist/vendor/node/Undici.d.ts +3 -0
- package/dist/vendor/node/Undici.js +1 -1
- package/dist/vendor/node/index.d.ts +40 -0
- package/dist/vendor/node/index.js +70 -55
- 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 +12 -3
- package/dist/vendor/node-shared/NodeChildProcessSpawner.js +5 -5
- package/dist/vendor/node-shared/NodeClusterSocket.d.ts +17 -4
- package/dist/vendor/node-shared/NodeClusterSocket.js +3 -3
- package/dist/vendor/node-shared/NodeCrypto.d.ts +3 -0
- package/dist/vendor/node-shared/NodeCrypto.js +1 -1
- 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 +1 -0
- package/dist/vendor/node-shared/NodeFileSystem.js +2 -2
- package/dist/vendor/node-shared/NodeHttpCompression.d.ts +5 -1
- package/dist/vendor/node-shared/NodeHttpCompression.js +1 -1
- package/dist/vendor/node-shared/NodePath.d.ts +3 -0
- package/dist/vendor/node-shared/NodePath.js +1 -1
- package/dist/vendor/node-shared/NodeRuntime.d.ts +4 -0
- package/dist/vendor/node-shared/NodeRuntime.js +1 -1
- package/dist/vendor/node-shared/NodeSink.d.ts +4 -0
- package/dist/vendor/node-shared/NodeSink.js +1 -1
- package/dist/vendor/node-shared/NodeSocket.d.ts +11 -1
- package/dist/vendor/node-shared/NodeSocket.js +1 -1
- package/dist/vendor/node-shared/NodeSocketServer.d.ts +8 -1
- package/dist/vendor/node-shared/NodeSocketServer.js +2 -2
- package/dist/vendor/node-shared/NodeStdio.d.ts +1 -0
- package/dist/vendor/node-shared/NodeStdio.js +3 -3
- package/dist/vendor/node-shared/NodeStream.d.ts +15 -0
- package/dist/vendor/node-shared/NodeStream.js +2 -2
- package/dist/vendor/node-shared/NodeTerminal.d.ts +6 -4
- package/dist/vendor/node-shared/NodeTerminal.js +1 -1
- package/dist/vendor/node-shared/index.d.ts +29 -0
- package/dist/vendor/node-shared/index.js +34 -22
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +1 -1
- package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +1 -1
- package/dist/vendor/node-shared/internal/utils.js +1 -1
- package/dist/vendor/platform-node-shared.d.ts +29 -0
- package/dist/vendor/platform-node-shared.js +34 -22
- package/dist/vendor/platform-node.d.ts +40 -0
- package/dist/vendor/platform-node.js +70 -55
- package/docs/README.md +2 -2
- package/docs/api.md +2 -2
- package/docs/concepts/host-bundle.md +2 -2
- package/docs/installation.md +8 -9
- package/docs/quickstart.md +2 -2
- package/package.json +12 -12
- package/src/EgressHttpClient.ts +4 -4
- package/src/NodeHost.ts +2 -2
- package/src/ProcessConfinement.ts +1 -1
- package/src/ProcessReaper.ts +2 -2
- package/src/ScopedProcess.ts +2 -2
- package/src/internal/PipedProcess.ts +2 -2
- package/src/internal/ProcessCleanup.ts +1 -1
- package/src/internal/ProcessSupervisor.ts +2 -2
- /package/dist/vendor/{chunk-M7CLUILA.js → chunk-3WUGYBFU.js} +0 -0
- /package/dist/vendor/{chunk-ZJMRMY57.js → chunk-ASGOJ3XA.js} +0 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node.js implementation of Effect's `Dns` service.
|
|
3
|
+
*
|
|
4
|
+
* Address lookups use the operating system resolver through `dns.lookup`,
|
|
5
|
+
* including the hosts file. Record queries and reverse lookups share one
|
|
6
|
+
* `dns.Resolver`. Interruption discards a query's result but cannot cancel
|
|
7
|
+
* that query; closing the scope cancels all pending queries.
|
|
8
|
+
*
|
|
9
|
+
* Unrepresentable records, such as invalid `Host.DomainName` values, are
|
|
10
|
+
* skipped. If every record is skipped, the query fails with `InvalidResponse`.
|
|
11
|
+
* `make` decodes Node.js's Latin-1 TXT and CAA strings as UTF-8. TLSA queries
|
|
12
|
+
* need Node.js 22.15 or 23.9 and later, and fail with `Unsupported` on runtimes
|
|
13
|
+
* without `resolveTlsa`. Other runtimes reuse `lookup`, `resolver`, and the
|
|
14
|
+
* conversion helpers to build their services.
|
|
15
|
+
*
|
|
16
|
+
* @stability experimental
|
|
17
|
+
* @since 4.0.0
|
|
18
|
+
*/
|
|
19
|
+
import * as Arr from "effect/Array";
|
|
20
|
+
import * as Config from "effect/Config";
|
|
21
|
+
import * as Duration from "effect/Duration";
|
|
22
|
+
import * as Effect from "effect/Effect";
|
|
23
|
+
import * as Layer from "effect/Layer";
|
|
24
|
+
import * as Dns from "effect/net/Dns";
|
|
25
|
+
import * as Host from "effect/net/Host";
|
|
26
|
+
import * as NetAddress from "effect/net/NetAddress";
|
|
27
|
+
import * as Result from "effect/Result";
|
|
28
|
+
/**
|
|
29
|
+
* Options for the Node.js `Dns` service and `resolver`.
|
|
30
|
+
*
|
|
31
|
+
* **Details**
|
|
32
|
+
*
|
|
33
|
+
* `nameServers` replaces the system name servers, which are converted like
|
|
34
|
+
* `Dns.nameServerFromInput`, and an empty list keeps the system name servers.
|
|
35
|
+
* `timeout` is the time allowed for each attempt and `tries` the number of
|
|
36
|
+
* attempts per name server. Address lookups always use the operating system
|
|
37
|
+
* resolver and are not affected.
|
|
38
|
+
*
|
|
39
|
+
* `timeout` is rounded up to whole milliseconds and `tries` down to a whole
|
|
40
|
+
* number, and both are clamped to 1 through 2^31 - 1, so `Duration.infinity`
|
|
41
|
+
* uses the longest timeout the resolver supports.
|
|
42
|
+
*
|
|
43
|
+
* **Gotchas**
|
|
44
|
+
*
|
|
45
|
+
* Invalid name servers fail with a `NetAddress.NetAddressError` when the
|
|
46
|
+
* service is created, and so do IPv6 name servers with a scope ID, such as
|
|
47
|
+
* link-local addresses, because the resolver drops the scope.
|
|
48
|
+
*
|
|
49
|
+
* @stability experimental
|
|
50
|
+
* @category models
|
|
51
|
+
* @since 4.0.0
|
|
52
|
+
*/
|
|
53
|
+
export interface Options {
|
|
54
|
+
readonly nameServers?: ReadonlyArray<NetAddress.IpAddressInput | NetAddress.InetAddressInput> | undefined;
|
|
55
|
+
readonly timeout?: Duration.Input | undefined;
|
|
56
|
+
readonly tries?: number | undefined;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Converts a failure of `node:dns` or of Bun's DNS functions to a
|
|
60
|
+
* `Dns.DnsError`, choosing the reason from the error's `code`.
|
|
61
|
+
*
|
|
62
|
+
* **Details**
|
|
63
|
+
*
|
|
64
|
+
* Bun prefixes c-ares codes with `DNS_`, such as `DNS_ENOTFOUND`; the prefix is
|
|
65
|
+
* ignored. Errors without a known code get the reason `Unknown`.
|
|
66
|
+
*
|
|
67
|
+
* @stability experimental
|
|
68
|
+
* @category converting
|
|
69
|
+
* @since 4.0.0
|
|
70
|
+
*/
|
|
71
|
+
export declare const dnsErrorFromCause: (cause: unknown, method: Dns.DnsError["method"], hostname: string, recordType?: Dns.RecordType) => Dns.DnsError;
|
|
72
|
+
/**
|
|
73
|
+
* Converts a name returned by a resolver to a fully qualified
|
|
74
|
+
* `Host.DomainName`, throwing when it is not a valid domain name.
|
|
75
|
+
*
|
|
76
|
+
* @stability experimental
|
|
77
|
+
* @category converting
|
|
78
|
+
* @since 4.0.0
|
|
79
|
+
*/
|
|
80
|
+
export declare const domainNameFromResolverUnsafe: (name: string) => Host.DomainName;
|
|
81
|
+
/**
|
|
82
|
+
* Converts a name returned by a resolver to fully qualified text, for names
|
|
83
|
+
* that need not be host names, such as PTR targets and SOA mailboxes.
|
|
84
|
+
*
|
|
85
|
+
* **Details**
|
|
86
|
+
*
|
|
87
|
+
* Resolvers write bytes as `\DDD` escapes, c-ares in decimal (`radix` 10) and
|
|
88
|
+
* `Deno.resolveDns` in octal (`radix` 8), and escape special characters with
|
|
89
|
+
* a backslash, such as `\.` for a dot inside a label or `\(` for a
|
|
90
|
+
* parenthesis. Decoding the bytes as UTF-8 and removing the escapes gives the
|
|
91
|
+
* text of the name, keeping only the `\.` and `\\` escapes.
|
|
92
|
+
*
|
|
93
|
+
* @stability experimental
|
|
94
|
+
* @category converting
|
|
95
|
+
* @since 4.0.0
|
|
96
|
+
*/
|
|
97
|
+
export declare const nameTextFromResolver: (name: string, radix?: 8 | 10) => string;
|
|
98
|
+
/**
|
|
99
|
+
* Converts a number of seconds that a resolver reports as a signed 32-bit
|
|
100
|
+
* integer, such as the SOA refresh, retry, and expire intervals, to a
|
|
101
|
+
* `Duration`.
|
|
102
|
+
*
|
|
103
|
+
* @stability experimental
|
|
104
|
+
* @category converting
|
|
105
|
+
* @since 4.0.0
|
|
106
|
+
*/
|
|
107
|
+
export declare const secondsFromInt32: (value: number) => Duration.Duration;
|
|
108
|
+
/**
|
|
109
|
+
* Decodes a string that holds one byte per character as UTF-8.
|
|
110
|
+
*
|
|
111
|
+
* **Details**
|
|
112
|
+
*
|
|
113
|
+
* Node.js and `Deno.resolveDns` decode each byte of TXT and CAA character
|
|
114
|
+
* strings as one Latin-1 character; decoding the bytes as UTF-8 matches other
|
|
115
|
+
* runtimes. Strings with only ASCII characters are returned unchanged.
|
|
116
|
+
*
|
|
117
|
+
* @stability experimental
|
|
118
|
+
* @category converting
|
|
119
|
+
* @since 4.0.0
|
|
120
|
+
*/
|
|
121
|
+
export declare const utf8FromLatin1: (value: string) => string;
|
|
122
|
+
/**
|
|
123
|
+
* Converts the entries of a resolver's answer to a query for `name` to records
|
|
124
|
+
* of a record type, skipping entries whose data cannot be represented, such as
|
|
125
|
+
* names that are not valid `Host.DomainName` values.
|
|
126
|
+
*
|
|
127
|
+
* **Details**
|
|
128
|
+
*
|
|
129
|
+
* When the answer has entries but every one is skipped, the conversion fails
|
|
130
|
+
* with an `InvalidResponse` error whose cause is the first entry's failure,
|
|
131
|
+
* rather than returning no records, which would be reported as `NotFound`.
|
|
132
|
+
*
|
|
133
|
+
* @stability experimental
|
|
134
|
+
* @category converting
|
|
135
|
+
* @since 4.0.0
|
|
136
|
+
*/
|
|
137
|
+
export declare const recordsFromResolver: <T extends Dns.RecordType, A>(name: string, type: T, entries: ReadonlyArray<A>, fields: (entry: A) => Dns.RecordFields<T>) => Result.Result<Array<Dns.RecordFor<T>>, Dns.DnsError>;
|
|
138
|
+
/**
|
|
139
|
+
* Converts an IP family to the numeric family used by `dns.lookup`, with `0`
|
|
140
|
+
* for addresses of either family.
|
|
141
|
+
*
|
|
142
|
+
* @stability experimental
|
|
143
|
+
* @category converting
|
|
144
|
+
* @since 4.0.0
|
|
145
|
+
*/
|
|
146
|
+
export declare const toFamily: (family: NetAddress.IpFamily | undefined) => 0 | 4 | 6;
|
|
147
|
+
/**
|
|
148
|
+
* Converts the entries returned by an address lookup, such as `dns.lookup`
|
|
149
|
+
* with `all: true`, to IP addresses, keeping their order.
|
|
150
|
+
*
|
|
151
|
+
* **Details**
|
|
152
|
+
*
|
|
153
|
+
* IPv6 zones are dropped, and addresses that cannot be parsed are skipped.
|
|
154
|
+
*
|
|
155
|
+
* @stability experimental
|
|
156
|
+
* @category converting
|
|
157
|
+
* @since 4.0.0
|
|
158
|
+
*/
|
|
159
|
+
export declare const addressesFromLookup: (entries: ReadonlyArray<{
|
|
160
|
+
readonly address: string;
|
|
161
|
+
}>) => Array<NetAddress.IpAddress>;
|
|
162
|
+
/**
|
|
163
|
+
* Looks up the addresses of a host name with `dns.lookup`, keeping the order
|
|
164
|
+
* returned by the operating system resolver.
|
|
165
|
+
*
|
|
166
|
+
* @stability experimental
|
|
167
|
+
* @category resolving
|
|
168
|
+
* @since 4.0.0
|
|
169
|
+
*/
|
|
170
|
+
export declare const lookup: (host: string, family?: NetAddress.IpFamily | undefined) => Effect.Effect<Array<NetAddress.IpAddress>, Dns.DnsError>;
|
|
171
|
+
/**
|
|
172
|
+
* Creates a function that queries DNS records with the runtime's `node:dns`
|
|
173
|
+
* module.
|
|
174
|
+
*
|
|
175
|
+
* **Details**
|
|
176
|
+
*
|
|
177
|
+
* All queries share one `dns.Resolver`, which is cancelled when the scope
|
|
178
|
+
* closes. Names in records are fully qualified, and TXT and CAA character
|
|
179
|
+
* strings are returned as the runtime decodes them, without the UTF-8
|
|
180
|
+
* correction that `make` applies for Node.js. Records are converted with
|
|
181
|
+
* `recordsFromResolver`.
|
|
182
|
+
*
|
|
183
|
+
* @stability experimental
|
|
184
|
+
* @category constructors
|
|
185
|
+
* @since 4.0.0
|
|
186
|
+
*/
|
|
187
|
+
export declare const resolver: (options?: Options | undefined) => Effect.Effect<(name: string, type: Dns.RecordType) => Effect.Effect<Array<Dns.DnsRecord>, Dns.DnsError>, NetAddress.NetAddressError, import("effect/Scope").Scope>;
|
|
188
|
+
/**
|
|
189
|
+
* Creates a Node.js `Dns` service whose resolver lives as long as the scope.
|
|
190
|
+
*
|
|
191
|
+
* @stability experimental
|
|
192
|
+
* @category constructors
|
|
193
|
+
* @since 4.0.0
|
|
194
|
+
*/
|
|
195
|
+
export declare const make: (options?: Options | undefined) => Effect.Effect<{
|
|
196
|
+
lookup<F extends NetAddress.IpFamily>(host: Host.DomainNameInput, options: {
|
|
197
|
+
readonly family: F;
|
|
198
|
+
}): Effect.Effect<Arr.NonEmptyReadonlyArray<NetAddress.FamilyAddress<F>>, Dns.DnsError>;
|
|
199
|
+
lookup(host: Host.DomainNameInput, options?: Dns.LookupOptions): Effect.Effect<Arr.NonEmptyReadonlyArray<NetAddress.IpAddress>, Dns.DnsError>;
|
|
200
|
+
resolve<T extends Dns.RecordType>(name: Host.DomainNameInput, type: T): Effect.Effect<Arr.NonEmptyReadonlyArray<Dns.RecordFor<T>>, Dns.DnsError>;
|
|
201
|
+
reverse(address: NetAddress.IpAddressInput): Effect.Effect<Arr.NonEmptyReadonlyArray<Host.DomainName>, Dns.DnsError>;
|
|
202
|
+
}, NetAddress.NetAddressError, import("effect/Scope").Scope>;
|
|
203
|
+
/**
|
|
204
|
+
* Layer that provides the Node.js `Dns` service using the system resolver
|
|
205
|
+
* configuration.
|
|
206
|
+
*
|
|
207
|
+
* @stability experimental
|
|
208
|
+
* @category layers
|
|
209
|
+
* @since 4.0.0
|
|
210
|
+
*/
|
|
211
|
+
export declare const layer: Layer.Layer<Dns.Dns>;
|
|
212
|
+
/**
|
|
213
|
+
* Creates a layer that provides the Node.js `Dns` service with options read
|
|
214
|
+
* from configuration.
|
|
215
|
+
*
|
|
216
|
+
* @stability experimental
|
|
217
|
+
* @category layers
|
|
218
|
+
* @since 4.0.0
|
|
219
|
+
*/
|
|
220
|
+
export declare const layerConfig: (options: Config.Wrap<Options>) => Layer.Layer<Dns.Dns, Config.ConfigError | NetAddress.NetAddressError>;
|
|
221
|
+
//# sourceMappingURL=NodeDns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require("../../node-shared/NodeDns.js")
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import type * as Platform from "effect/
|
|
1
|
+
import type * as Platform from "effect/http/HttpPlatform";
|
|
2
2
|
import type { Duplex } from "node:stream";
|
|
3
3
|
/**
|
|
4
4
|
* The compression algorithms supported by the runtime's `node:zlib`. `zstd`
|
|
5
5
|
* requires Node.js 22.15 or newer.
|
|
6
6
|
*
|
|
7
|
+
* @stability unstable
|
|
7
8
|
* @category constants
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
@@ -13,6 +14,7 @@ export declare const algorithms: ReadonlySet<Platform.CompressionAlgorithm>;
|
|
|
13
14
|
* the asynchronous `node:zlib` APIs, setting the exact `Content-Length` of the
|
|
14
15
|
* compressed body. All other bodies are delegated to `fallback`.
|
|
15
16
|
*
|
|
17
|
+
* @stability unstable
|
|
16
18
|
* @category constructors
|
|
17
19
|
* @since 4.0.0
|
|
18
20
|
*/
|
|
@@ -21,6 +23,7 @@ export declare const make: (fallback: Platform.Compression) => Platform.Compress
|
|
|
21
23
|
* Creates a `node:zlib` compression transform stream that flushes each input
|
|
22
24
|
* chunk, for streaming response bodies.
|
|
23
25
|
*
|
|
26
|
+
* @stability unstable
|
|
24
27
|
* @category constructors
|
|
25
28
|
* @since 4.0.0
|
|
26
29
|
*/
|
|
@@ -29,6 +32,7 @@ export declare const compressTransform: (algorithm: Platform.CompressionAlgorith
|
|
|
29
32
|
* A Web `ReadableStream` version of `compressTransform`, for platforms that
|
|
30
33
|
* stream response bodies as Web streams.
|
|
31
34
|
*
|
|
35
|
+
* @stability unstable
|
|
32
36
|
* @category constructors
|
|
33
37
|
* @since 4.0.0
|
|
34
38
|
*/
|
|
@@ -4,6 +4,7 @@ import { Path } from "effect/Path";
|
|
|
4
4
|
* Provides the `Path` service using Node's POSIX path implementation plus
|
|
5
5
|
* file URL conversion helpers.
|
|
6
6
|
*
|
|
7
|
+
* @stability unstable
|
|
7
8
|
* @category layers
|
|
8
9
|
* @since 4.0.0
|
|
9
10
|
*/
|
|
@@ -12,6 +13,7 @@ export declare const layerPosix: Layer.Layer<Path>;
|
|
|
12
13
|
* Provides the `Path` service using Node's Windows path implementation plus
|
|
13
14
|
* file URL conversion helpers.
|
|
14
15
|
*
|
|
16
|
+
* @stability unstable
|
|
15
17
|
* @category layers
|
|
16
18
|
* @since 4.0.0
|
|
17
19
|
*/
|
|
@@ -20,6 +22,7 @@ export declare const layerWin32: Layer.Layer<Path>;
|
|
|
20
22
|
* Provides the default `Path` service using the host platform's Node path
|
|
21
23
|
* implementation plus file URL conversion helpers.
|
|
22
24
|
*
|
|
25
|
+
* @stability unstable
|
|
23
26
|
* @category layers
|
|
24
27
|
* @since 4.0.0
|
|
25
28
|
*/
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* fiber, interrupts that fiber on `SIGINT` or `SIGTERM`, and delegates final
|
|
7
7
|
* exit-code handling to the configured teardown.
|
|
8
8
|
*
|
|
9
|
+
* @stability unstable
|
|
9
10
|
* @since 4.0.0
|
|
10
11
|
*/
|
|
11
12
|
import type { Effect } from "effect/Effect";
|
|
@@ -15,6 +16,7 @@ import * as Runtime from "effect/Runtime";
|
|
|
15
16
|
* `SIGINT` or `SIGTERM` and invoking the configured teardown to determine the
|
|
16
17
|
* process exit code.
|
|
17
18
|
*
|
|
19
|
+
* @stability unstable
|
|
18
20
|
* @category running
|
|
19
21
|
* @since 4.0.0
|
|
20
22
|
*/
|
|
@@ -24,6 +26,7 @@ export declare const runMain: {
|
|
|
24
26
|
* `SIGINT` or `SIGTERM` and invoking the configured teardown to determine the
|
|
25
27
|
* process exit code.
|
|
26
28
|
*
|
|
29
|
+
* @stability unstable
|
|
27
30
|
* @category running
|
|
28
31
|
* @since 4.0.0
|
|
29
32
|
*/
|
|
@@ -36,6 +39,7 @@ export declare const runMain: {
|
|
|
36
39
|
* `SIGINT` or `SIGTERM` and invoking the configured teardown to determine the
|
|
37
40
|
* process exit code.
|
|
38
41
|
*
|
|
42
|
+
* @stability unstable
|
|
39
43
|
* @category running
|
|
40
44
|
* @since 4.0.0
|
|
41
45
|
*/
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* the supplied `onError` function, and can end the writable when the upstream
|
|
8
8
|
* data is done.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @since 4.0.0
|
|
11
12
|
*/
|
|
12
13
|
import type { NonEmptyReadonlyArray } from "effect/Array";
|
|
@@ -20,6 +21,7 @@ import type { Writable } from "node:stream";
|
|
|
20
21
|
* backpressure, mapping writable errors with `onError`, and ending the stream
|
|
21
22
|
* on completion unless `endOnDone` is `false`.
|
|
22
23
|
*
|
|
24
|
+
* @stability unstable
|
|
23
25
|
* @category constructors
|
|
24
26
|
* @since 4.0.0
|
|
25
27
|
*/
|
|
@@ -34,6 +36,7 @@ export declare const fromWritable: <E, A = Uint8Array | string>(options: {
|
|
|
34
36
|
* Node writable stream, respecting backpressure and optionally ending the
|
|
35
37
|
* writable when upstream is done.
|
|
36
38
|
*
|
|
39
|
+
* @stability unstable
|
|
37
40
|
* @category constructors
|
|
38
41
|
* @since 4.0.0
|
|
39
42
|
*/
|
|
@@ -56,6 +59,7 @@ export declare const fromWritableChannel: <IE, E, A = Uint8Array | string>(optio
|
|
|
56
59
|
* The loop waits for `drain` when needed, fails on writable errors, and ends
|
|
57
60
|
* the writable on upstream completion unless `endOnDone` is `false`.
|
|
58
61
|
*
|
|
62
|
+
* @stability unstable
|
|
59
63
|
* @category converting
|
|
60
64
|
* @since 4.0.0
|
|
61
65
|
*/
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* channels, or layers. It also exposes the `NetSocket` service tag for the
|
|
7
7
|
* underlying Node socket and re-exports the `ws` package namespace.
|
|
8
8
|
*
|
|
9
|
+
* @stability unstable
|
|
9
10
|
* @since 4.0.0
|
|
10
11
|
*/
|
|
11
12
|
import * as Arr from "effect/Array";
|
|
@@ -15,11 +16,12 @@ import type * as Duration from "effect/Duration";
|
|
|
15
16
|
import * as Effect from "effect/Effect";
|
|
16
17
|
import * as Layer from "effect/Layer";
|
|
17
18
|
import * as Scope from "effect/Scope";
|
|
18
|
-
import * as Socket from "effect/
|
|
19
|
+
import * as Socket from "effect/socket/Socket";
|
|
19
20
|
import * as Net from "node:net";
|
|
20
21
|
import type { Duplex } from "node:stream";
|
|
21
22
|
import * as Tls from "node:tls";
|
|
22
23
|
/**
|
|
24
|
+
* @stability unstable
|
|
23
25
|
* @category re-exports
|
|
24
26
|
* @since 4.0.0
|
|
25
27
|
*/
|
|
@@ -29,6 +31,7 @@ declare const NetSocket_base: Context.ServiceClass<NetSocket, "@effect/platform-
|
|
|
29
31
|
* Service tag for the underlying Node `net.Socket` associated with the current
|
|
30
32
|
* socket connection.
|
|
31
33
|
*
|
|
34
|
+
* @stability unstable
|
|
32
35
|
* @category services
|
|
33
36
|
* @since 4.0.0
|
|
34
37
|
*/
|
|
@@ -47,6 +50,7 @@ export declare class NetSocket extends NetSocket_base {
|
|
|
47
50
|
* Supports `openTimeout` and closes or destroys the underlying socket when the
|
|
48
51
|
* reader scope is finalized.
|
|
49
52
|
*
|
|
53
|
+
* @stability unstable
|
|
50
54
|
* @category constructors
|
|
51
55
|
* @since 4.0.0
|
|
52
56
|
*/
|
|
@@ -70,6 +74,7 @@ export declare const makeNet: (options: Net.NetConnectOpts & {
|
|
|
70
74
|
* the internal buffer is full. `writeAll` corks the stream around the batch.
|
|
71
75
|
* Releasing the writer scope half-closes the stream (`end()`).
|
|
72
76
|
*
|
|
77
|
+
* @stability unstable
|
|
73
78
|
* @category constructors
|
|
74
79
|
* @since 4.0.0
|
|
75
80
|
*/
|
|
@@ -81,6 +86,7 @@ export declare const fromDuplex: <RO>(open: Effect.Effect<Duplex, Socket.SocketE
|
|
|
81
86
|
* Creates a `Channel` over a TCP socket, reading arrays of `Uint8Array`
|
|
82
87
|
* chunks and writing arrays of bytes, strings, or socket close events.
|
|
83
88
|
*
|
|
89
|
+
* @stability unstable
|
|
84
90
|
* @category constructors
|
|
85
91
|
* @since 4.0.0
|
|
86
92
|
*/
|
|
@@ -89,6 +95,7 @@ export declare const makeNetChannel: <IE = never>(options: Net.NetConnectOpts) =
|
|
|
89
95
|
* Provides a `Socket.Socket` by opening a TCP connection with the supplied
|
|
90
96
|
* Node `net` connection options.
|
|
91
97
|
*
|
|
98
|
+
* @stability unstable
|
|
92
99
|
* @category layers
|
|
93
100
|
* @since 4.0.0
|
|
94
101
|
*/
|
|
@@ -109,6 +116,7 @@ export declare const layerNet: (options: Net.NetConnectOpts) => Layer.Layer<Sock
|
|
|
109
116
|
* certificate, fails with a `SocketOpenError`. Supports `openTimeout` and
|
|
110
117
|
* destroys the underlying socket when the reader scope is finalized.
|
|
111
118
|
*
|
|
119
|
+
* @stability unstable
|
|
112
120
|
* @category constructors
|
|
113
121
|
* @since 4.0.0
|
|
114
122
|
*/
|
|
@@ -119,6 +127,7 @@ export declare const makeTls: (options: Tls.ConnectionOptions & {
|
|
|
119
127
|
* Creates a `Channel` over a TLS socket, reading arrays of `Uint8Array`
|
|
120
128
|
* chunks and writing arrays of bytes, strings, or socket close events.
|
|
121
129
|
*
|
|
130
|
+
* @stability unstable
|
|
122
131
|
* @category constructors
|
|
123
132
|
* @since 4.0.0
|
|
124
133
|
*/
|
|
@@ -127,6 +136,7 @@ export declare const makeTlsChannel: <IE = never>(options: Tls.ConnectionOptions
|
|
|
127
136
|
* Provides a `Socket.Socket` by opening a TLS connection with the supplied
|
|
128
137
|
* Node `tls` connection options.
|
|
129
138
|
*
|
|
139
|
+
* @stability unstable
|
|
130
140
|
* @category layers
|
|
131
141
|
* @since 4.0.0
|
|
132
142
|
*/
|
|
@@ -2,7 +2,7 @@ import * as Context from "effect/Context";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import * as Scope from "effect/Scope";
|
|
5
|
-
import * as SocketServer from "effect/
|
|
5
|
+
import * as SocketServer from "effect/socket/SocketServer";
|
|
6
6
|
import type * as Http from "node:http";
|
|
7
7
|
import * as Net from "node:net";
|
|
8
8
|
import * as Tls from "node:tls";
|
|
@@ -13,6 +13,7 @@ declare const IncomingMessage_base: Context.ServiceClass<IncomingMessage, "@effe
|
|
|
13
13
|
* Service tag for the Node `IncomingMessage` associated with the current
|
|
14
14
|
* WebSocket server connection.
|
|
15
15
|
*
|
|
16
|
+
* @stability unstable
|
|
16
17
|
* @category services
|
|
17
18
|
* @since 4.0.0
|
|
18
19
|
*/
|
|
@@ -23,6 +24,7 @@ export declare class IncomingMessage extends IncomingMessage_base {
|
|
|
23
24
|
* listening with the supplied options, queues pending connections until `run`
|
|
24
25
|
* is called, and closes the server when the scope ends.
|
|
25
26
|
*
|
|
27
|
+
* @stability unstable
|
|
26
28
|
* @category constructors
|
|
27
29
|
* @since 4.0.0
|
|
28
30
|
*/
|
|
@@ -31,6 +33,7 @@ export declare const make: (options: Net.ServerOpts & Net.ListenOptions) => Effe
|
|
|
31
33
|
* Provides a TCP `SocketServer` by creating and managing a scoped Node
|
|
32
34
|
* `net.Server` with the supplied server and listen options.
|
|
33
35
|
*
|
|
36
|
+
* @stability unstable
|
|
34
37
|
* @category layers
|
|
35
38
|
* @since 4.0.0
|
|
36
39
|
*/
|
|
@@ -47,6 +50,7 @@ export declare const layer: (options: Net.ServerOpts & Net.ListenOptions) => Lay
|
|
|
47
50
|
* also provided as `NodeSocket.NetSocket`. Connections that fail the handshake
|
|
48
51
|
* are destroyed and the server keeps listening.
|
|
49
52
|
*
|
|
53
|
+
* @stability unstable
|
|
50
54
|
* @category constructors
|
|
51
55
|
* @since 4.0.0
|
|
52
56
|
*/
|
|
@@ -55,6 +59,7 @@ export declare const makeTls: (options: Tls.TlsOptions & Net.ListenOptions) => E
|
|
|
55
59
|
* Provides a TLS `SocketServer` by creating and managing a scoped Node
|
|
56
60
|
* `tls.Server` with the supplied TLS and listen options.
|
|
57
61
|
*
|
|
62
|
+
* @stability unstable
|
|
58
63
|
* @category layers
|
|
59
64
|
* @since 4.0.0
|
|
60
65
|
*/
|
|
@@ -64,6 +69,7 @@ export declare const layerTls: (options: Tls.TlsOptions & Net.ListenOptions) =>
|
|
|
64
69
|
* providing the WebSocket and its Node `IncomingMessage` to connection
|
|
65
70
|
* handlers and closing the server when the scope ends.
|
|
66
71
|
*
|
|
72
|
+
* @stability unstable
|
|
67
73
|
* @category constructors
|
|
68
74
|
* @since 4.0.0
|
|
69
75
|
*/
|
|
@@ -72,6 +78,7 @@ export declare const makeWebSocket: (options: NodeWS.ServerOptions<typeof NodeWS
|
|
|
72
78
|
* Provides a WebSocket `SocketServer` backed by the `ws` package and managed
|
|
73
79
|
* with the supplied server options.
|
|
74
80
|
*
|
|
81
|
+
* @stability unstable
|
|
75
82
|
* @category layers
|
|
76
83
|
* @since 4.0.0
|
|
77
84
|
*/
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* `Readable`, and collects readable payloads into strings, array buffers, or
|
|
8
8
|
* `Uint8Array`s with optional byte limits.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @since 4.0.0
|
|
11
12
|
*/
|
|
12
13
|
import * as Arr from "effect/Array";
|
|
@@ -23,6 +24,7 @@ import { Readable } from "node:stream";
|
|
|
23
24
|
* an optional chunk size, mapping stream errors with `onError`, and destroying
|
|
24
25
|
* the readable on completion unless `closeOnDone` is `false`.
|
|
25
26
|
*
|
|
27
|
+
* @stability unstable
|
|
26
28
|
* @category constructors
|
|
27
29
|
* @since 4.0.0
|
|
28
30
|
*/
|
|
@@ -37,6 +39,7 @@ export declare const fromReadable: <A = Uint8Array, E = Cause.UnknownError>(opti
|
|
|
37
39
|
* errors with `onError` and destroying the readable on completion unless
|
|
38
40
|
* `closeOnDone` is `false`.
|
|
39
41
|
*
|
|
42
|
+
* @stability unstable
|
|
40
43
|
* @category constructors
|
|
41
44
|
* @since 4.0.0
|
|
42
45
|
*/
|
|
@@ -51,6 +54,7 @@ export declare const fromReadableChannel: <A = Uint8Array, E = Cause.UnknownErro
|
|
|
51
54
|
* backpressure while emitting chunks read from the duplex and optionally ending
|
|
52
55
|
* the writable side when upstream completes.
|
|
53
56
|
*
|
|
57
|
+
* @stability unstable
|
|
54
58
|
* @category constructors
|
|
55
59
|
* @since 4.0.0
|
|
56
60
|
*/
|
|
@@ -65,6 +69,7 @@ export declare const fromDuplex: <IE, I = Uint8Array, O = Uint8Array, E = Cause.
|
|
|
65
69
|
* Pipes an Effect `Stream` through a Node `Duplex`, writing the stream's
|
|
66
70
|
* chunks to the duplex and emitting chunks read back from it.
|
|
67
71
|
*
|
|
72
|
+
* @stability unstable
|
|
68
73
|
* @category combinators
|
|
69
74
|
* @since 4.0.0
|
|
70
75
|
*/
|
|
@@ -73,6 +78,7 @@ export declare const pipeThroughDuplex: {
|
|
|
73
78
|
* Pipes an Effect `Stream` through a Node `Duplex`, writing the stream's
|
|
74
79
|
* chunks to the duplex and emitting chunks read back from it.
|
|
75
80
|
*
|
|
81
|
+
* @stability unstable
|
|
76
82
|
* @category combinators
|
|
77
83
|
* @since 4.0.0
|
|
78
84
|
*/
|
|
@@ -87,6 +93,7 @@ export declare const pipeThroughDuplex: {
|
|
|
87
93
|
* Pipes an Effect `Stream` through a Node `Duplex`, writing the stream's
|
|
88
94
|
* chunks to the duplex and emitting chunks read back from it.
|
|
89
95
|
*
|
|
96
|
+
* @stability unstable
|
|
90
97
|
* @category combinators
|
|
91
98
|
* @since 4.0.0
|
|
92
99
|
*/
|
|
@@ -102,6 +109,7 @@ export declare const pipeThroughDuplex: {
|
|
|
102
109
|
* Pipes a stream of strings or bytes through a Node `Duplex` using default
|
|
103
110
|
* options and `Cause.UnknownError` for stream failures.
|
|
104
111
|
*
|
|
112
|
+
* @stability unstable
|
|
105
113
|
* @category combinators
|
|
106
114
|
* @since 4.0.0
|
|
107
115
|
*/
|
|
@@ -110,6 +118,7 @@ export declare const pipeThroughSimple: {
|
|
|
110
118
|
* Pipes a stream of strings or bytes through a Node `Duplex` using default
|
|
111
119
|
* options and `Cause.UnknownError` for stream failures.
|
|
112
120
|
*
|
|
121
|
+
* @stability unstable
|
|
113
122
|
* @category combinators
|
|
114
123
|
* @since 4.0.0
|
|
115
124
|
*/
|
|
@@ -118,6 +127,7 @@ export declare const pipeThroughSimple: {
|
|
|
118
127
|
* Pipes a stream of strings or bytes through a Node `Duplex` using default
|
|
119
128
|
* options and `Cause.UnknownError` for stream failures.
|
|
120
129
|
*
|
|
130
|
+
* @stability unstable
|
|
121
131
|
* @category combinators
|
|
122
132
|
* @since 4.0.0
|
|
123
133
|
*/
|
|
@@ -128,6 +138,7 @@ export declare const pipeThroughSimple: {
|
|
|
128
138
|
* Effect context to run the stream and destroying the readable if the stream
|
|
129
139
|
* fails.
|
|
130
140
|
*
|
|
141
|
+
* @stability unstable
|
|
131
142
|
* @category converting
|
|
132
143
|
* @since 4.0.0
|
|
133
144
|
*/
|
|
@@ -136,6 +147,7 @@ export declare const toReadable: <E, R>(stream: Stream.Stream<string | Uint8Arra
|
|
|
136
147
|
* Converts a service-free Effect `Stream` into a Node `Readable` using an
|
|
137
148
|
* empty Effect context.
|
|
138
149
|
*
|
|
150
|
+
* @stability unstable
|
|
139
151
|
* @category converting
|
|
140
152
|
* @since 4.0.0
|
|
141
153
|
*/
|
|
@@ -145,6 +157,7 @@ export declare const toReadableNever: <E>(stream: Stream.Stream<string | Uint8Ar
|
|
|
145
157
|
* failing through `onError` on stream errors or when `maxBytes` is exceeded
|
|
146
158
|
* and destroying the stream on interruption or failure.
|
|
147
159
|
*
|
|
160
|
+
* @stability unstable
|
|
148
161
|
* @category converting
|
|
149
162
|
* @since 4.0.0
|
|
150
163
|
*/
|
|
@@ -158,6 +171,7 @@ export declare const toString: <E = Cause.UnknownError>(readable: LazyArg<Readab
|
|
|
158
171
|
* `onError` on stream errors or when `maxBytes` is exceeded and destroying the
|
|
159
172
|
* stream on interruption or failure.
|
|
160
173
|
*
|
|
174
|
+
* @stability unstable
|
|
161
175
|
* @category converting
|
|
162
176
|
* @since 4.0.0
|
|
163
177
|
*/
|
|
@@ -169,6 +183,7 @@ export declare const toArrayBuffer: <E = Cause.UnknownError>(readable: LazyArg<R
|
|
|
169
183
|
* Consumes a Node readable stream into a `Uint8Array`, using the same error
|
|
170
184
|
* mapping and `maxBytes` handling as `toArrayBuffer`.
|
|
171
185
|
*
|
|
186
|
+
* @stability unstable
|
|
172
187
|
* @category converting
|
|
173
188
|
* @since 4.0.0
|
|
174
189
|
*/
|
|
@@ -3,18 +3,20 @@ import * as Layer from "effect/Layer";
|
|
|
3
3
|
import type * as Scope from "effect/Scope";
|
|
4
4
|
import * as Terminal from "effect/Terminal";
|
|
5
5
|
/**
|
|
6
|
-
* Creates a scoped process-backed `Terminal` using Node `readline
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Creates a scoped process-backed `Terminal` using Node `readline` and TTY raw mode.
|
|
7
|
+
* By default, Esc, Ctrl+C, and Ctrl+D end key input. Supply `shouldQuit` to
|
|
8
|
+
* override these quit keys.
|
|
9
9
|
*
|
|
10
|
+
* @stability unstable
|
|
10
11
|
* @category constructors
|
|
11
12
|
* @since 4.0.0
|
|
12
13
|
*/
|
|
13
14
|
export declare const make: (shouldQuit?: (input: Terminal.UserInput) => boolean) => Effect.Effect<Terminal.Terminal, never, Scope.Scope>;
|
|
14
15
|
/**
|
|
15
16
|
* Provides the default process-backed `Terminal` service, ending key input on
|
|
16
|
-
* Ctrl+C or Ctrl+D.
|
|
17
|
+
* bare Esc, Ctrl+C, or Ctrl+D.
|
|
17
18
|
*
|
|
19
|
+
* @stability unstable
|
|
18
20
|
* @category layers
|
|
19
21
|
* @since 4.0.0
|
|
20
22
|
*/
|