@effect/platform-node 4.0.0-beta.1 → 4.0.0-beta.100
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 +1 -1
- package/dist/Mime.d.ts +9 -3
- package/dist/Mime.d.ts.map +1 -1
- package/dist/Mime.js +9 -3
- package/dist/Mime.js.map +1 -1
- package/dist/NodeChildProcessSpawner.d.ts +1 -1
- package/dist/NodeChildProcessSpawner.js +1 -1
- package/dist/NodeClusterHttp.d.ts +25 -7
- package/dist/NodeClusterHttp.d.ts.map +1 -1
- package/dist/NodeClusterHttp.js +20 -10
- package/dist/NodeClusterHttp.js.map +1 -1
- package/dist/NodeClusterSocket.d.ts +37 -11
- package/dist/NodeClusterSocket.d.ts.map +1 -1
- package/dist/NodeClusterSocket.js +37 -11
- package/dist/NodeClusterSocket.js.map +1 -1
- package/dist/NodeCrypto.d.ts +10 -0
- package/dist/NodeCrypto.d.ts.map +1 -0
- package/dist/NodeCrypto.js +22 -0
- package/dist/NodeCrypto.js.map +1 -0
- package/dist/NodeFileSystem.d.ts +4 -2
- package/dist/NodeFileSystem.d.ts.map +1 -1
- package/dist/NodeFileSystem.js +12 -3
- package/dist/NodeFileSystem.js.map +1 -1
- package/dist/NodeHttpClient.d.ts +98 -29
- package/dist/NodeHttpClient.d.ts.map +1 -1
- package/dist/NodeHttpClient.js +120 -33
- package/dist/NodeHttpClient.js.map +1 -1
- package/dist/NodeHttpIncomingMessage.d.ts +36 -9
- package/dist/NodeHttpIncomingMessage.d.ts.map +1 -1
- package/dist/NodeHttpIncomingMessage.js +40 -8
- package/dist/NodeHttpIncomingMessage.js.map +1 -1
- package/dist/NodeHttpPlatform.d.ts +10 -4
- package/dist/NodeHttpPlatform.d.ts.map +1 -1
- package/dist/NodeHttpPlatform.js +20 -7
- package/dist/NodeHttpPlatform.js.map +1 -1
- package/dist/NodeHttpServer.d.ts +60 -19
- package/dist/NodeHttpServer.d.ts.map +1 -1
- package/dist/NodeHttpServer.js +111 -54
- package/dist/NodeHttpServer.js.map +1 -1
- package/dist/NodeHttpServerRequest.d.ts +18 -5
- package/dist/NodeHttpServerRequest.d.ts.map +1 -1
- package/dist/NodeHttpServerRequest.js +11 -4
- package/dist/NodeHttpServerRequest.js.map +1 -1
- package/dist/NodeMultipart.d.ts +24 -4
- package/dist/NodeMultipart.d.ts.map +1 -1
- package/dist/NodeMultipart.js +24 -4
- package/dist/NodeMultipart.js.map +1 -1
- package/dist/NodePath.d.ts +15 -6
- package/dist/NodePath.d.ts.map +1 -1
- package/dist/NodePath.js +23 -7
- package/dist/NodePath.js.map +1 -1
- package/dist/NodeRedis.d.ts +27 -9
- package/dist/NodeRedis.d.ts.map +1 -1
- package/dist/NodeRedis.js +30 -12
- package/dist/NodeRedis.js.map +1 -1
- package/dist/NodeRuntime.d.ts +27 -36
- package/dist/NodeRuntime.d.ts.map +1 -1
- package/dist/NodeRuntime.js +17 -13
- package/dist/NodeRuntime.js.map +1 -1
- package/dist/NodeServices.d.ts +19 -5
- package/dist/NodeServices.d.ts.map +1 -1
- package/dist/NodeServices.js +7 -3
- package/dist/NodeServices.js.map +1 -1
- package/dist/NodeSink.d.ts +2 -2
- package/dist/NodeSink.js +2 -2
- package/dist/NodeSocket.d.ts +19 -4
- package/dist/NodeSocket.d.ts.map +1 -1
- package/dist/NodeSocket.js +27 -4
- package/dist/NodeSocket.js.map +1 -1
- package/dist/NodeSocketServer.d.ts +2 -2
- package/dist/NodeSocketServer.js +2 -2
- package/dist/NodeStdio.d.ts +5 -2
- package/dist/NodeStdio.d.ts.map +1 -1
- package/dist/NodeStdio.js +13 -3
- package/dist/NodeStdio.js.map +1 -1
- package/dist/NodeStream.d.ts +2 -2
- package/dist/NodeStream.js +2 -2
- package/dist/NodeTerminal.d.ts +8 -2
- package/dist/NodeTerminal.d.ts.map +1 -1
- package/dist/NodeTerminal.js +15 -3
- package/dist/NodeTerminal.js.map +1 -1
- package/dist/NodeWorker.d.ts +9 -2
- package/dist/NodeWorker.d.ts.map +1 -1
- package/dist/NodeWorker.js +22 -6
- package/dist/NodeWorker.js.map +1 -1
- package/dist/NodeWorkerRunner.d.ts +5 -1
- package/dist/NodeWorkerRunner.d.ts.map +1 -1
- package/dist/NodeWorkerRunner.js +18 -5
- package/dist/NodeWorkerRunner.js.map +1 -1
- package/dist/Undici.d.ts +18 -5
- package/dist/Undici.d.ts.map +1 -1
- package/dist/Undici.js +18 -5
- package/dist/Undici.js.map +1 -1
- package/dist/index.d.ts +28 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -26
- package/dist/index.js.map +1 -1
- package/package.json +11 -12
- package/src/Mime.ts +10 -3
- package/src/NodeChildProcessSpawner.ts +1 -1
- package/src/NodeClusterHttp.ts +30 -11
- package/src/NodeClusterSocket.ts +37 -11
- package/src/NodeCrypto.ts +24 -0
- package/src/NodeFileSystem.ts +12 -3
- package/src/NodeHttpClient.ts +128 -38
- package/src/NodeHttpIncomingMessage.ts +48 -12
- package/src/NodeHttpPlatform.ts +21 -6
- package/src/NodeHttpServer.ts +134 -59
- package/src/NodeHttpServerRequest.ts +18 -5
- package/src/NodeMultipart.ts +24 -4
- package/src/NodePath.ts +23 -7
- package/src/NodeRedis.ts +32 -14
- package/src/NodeRuntime.ts +35 -37
- package/src/NodeServices.ts +21 -5
- package/src/NodeSink.ts +2 -2
- package/src/NodeSocket.ts +33 -5
- package/src/NodeSocketServer.ts +2 -2
- package/src/NodeStdio.ts +13 -3
- package/src/NodeStream.ts +2 -2
- package/src/NodeTerminal.ts +15 -3
- package/src/NodeWorker.ts +22 -6
- package/src/NodeWorkerRunner.ts +18 -5
- package/src/Undici.ts +18 -5
- package/src/index.ts +29 -26
package/dist/NodePath.js
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js layers for Effect's `Path` service.
|
|
3
|
+
*
|
|
4
|
+
* This module provides the default, POSIX, and Windows variants of the
|
|
5
|
+
* platform-independent `Path` service by reusing the shared Node path
|
|
6
|
+
* implementation. The provided path services include Node file URL conversion
|
|
7
|
+
* behavior.
|
|
8
|
+
*
|
|
9
|
+
* @since 4.0.0
|
|
3
10
|
*/
|
|
4
11
|
import * as NodePath from "@effect/platform-node-shared/NodePath";
|
|
5
12
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
13
|
+
* Provides the default Node `Path` service using the platform's `node:path`
|
|
14
|
+
* implementation.
|
|
15
|
+
*
|
|
16
|
+
* @category layers
|
|
17
|
+
* @since 4.0.0
|
|
8
18
|
*/
|
|
9
19
|
export const layer = NodePath.layer;
|
|
10
20
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
21
|
+
* Provides the `Path` service using Node's POSIX path implementation,
|
|
22
|
+
* regardless of the host platform.
|
|
23
|
+
*
|
|
24
|
+
* @category layers
|
|
25
|
+
* @since 4.0.0
|
|
13
26
|
*/
|
|
14
27
|
export const layerPosix = NodePath.layerPosix;
|
|
15
28
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
29
|
+
* Provides the `Path` service using Node's Windows path implementation,
|
|
30
|
+
* regardless of the host platform.
|
|
31
|
+
*
|
|
32
|
+
* @category layers
|
|
33
|
+
* @since 4.0.0
|
|
18
34
|
*/
|
|
19
35
|
export const layerWin32 = NodePath.layerWin32;
|
|
20
36
|
//# sourceMappingURL=NodePath.js.map
|
package/dist/NodePath.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodePath.js","names":["NodePath","layer","layerPosix","layerWin32"],"sources":["../src/NodePath.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodePath.js","names":["NodePath","layer","layerPosix","layerWin32"],"sources":["../src/NodePath.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;AAUA,OAAO,KAAKA,QAAQ,MAAM,uCAAuC;AAIjE;;;;;;;AAOA,OAAO,MAAMC,KAAK,GAAsBD,QAAQ,CAACC,KAAK;AAEtD;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsBF,QAAQ,CAACE,UAAU;AAEhE;;;;;;;AAOA,OAAO,MAAMC,UAAU,GAAsBH,QAAQ,CAACG,UAAU","ignoreList":[]}
|
package/dist/NodeRedis.d.ts
CHANGED
|
@@ -1,30 +1,48 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js Redis integration backed by `ioredis`.
|
|
3
|
+
*
|
|
4
|
+
* This module creates a scoped `ioredis` client and exposes it in two forms:
|
|
5
|
+
* the generic `Redis` service and the {@link NodeRedis} service for direct
|
|
6
|
+
* access to the underlying client. `layer` accepts ioredis options directly,
|
|
7
|
+
* while `layerConfig` reads them from Effect config. Both layers close the
|
|
8
|
+
* client when the layer scope ends.
|
|
9
|
+
*
|
|
10
|
+
* @since 4.0.0
|
|
3
11
|
*/
|
|
4
12
|
import * as Config from "effect/Config";
|
|
13
|
+
import * as Context from "effect/Context";
|
|
5
14
|
import * as Effect from "effect/Effect";
|
|
6
15
|
import * as Layer from "effect/Layer";
|
|
7
|
-
import * as ServiceMap from "effect/ServiceMap";
|
|
8
16
|
import * as Redis from "effect/unstable/persistence/Redis";
|
|
9
17
|
import * as IoRedis from "ioredis";
|
|
10
|
-
declare const NodeRedis_base:
|
|
18
|
+
declare const NodeRedis_base: Context.ServiceClass<NodeRedis, "@effect/platform-node/NodeRedis", {
|
|
11
19
|
readonly client: IoRedis.Redis;
|
|
12
20
|
readonly use: <A>(f: (client: IoRedis.Redis) => Promise<A>) => Effect.Effect<A, Redis.RedisError>;
|
|
13
21
|
}>;
|
|
14
22
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
23
|
+
* Service tag for the Node Redis integration, exposing the underlying
|
|
24
|
+
* `ioredis` client and a `use` helper that maps client failures to
|
|
25
|
+
* `RedisError`.
|
|
26
|
+
*
|
|
27
|
+
* @category services
|
|
28
|
+
* @since 4.0.0
|
|
17
29
|
*/
|
|
18
30
|
export declare class NodeRedis extends NodeRedis_base {
|
|
19
31
|
}
|
|
20
32
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
33
|
+
* Provides `Redis` and `NodeRedis` services backed by an `ioredis` client
|
|
34
|
+
* created with the supplied options and closed when the layer scope ends.
|
|
35
|
+
*
|
|
36
|
+
* @category layers
|
|
37
|
+
* @since 4.0.0
|
|
23
38
|
*/
|
|
24
39
|
export declare const layer: (options?: IoRedis.RedisOptions | undefined) => Layer.Layer<Redis.Redis | NodeRedis>;
|
|
25
40
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
41
|
+
* Provides `Redis` and `NodeRedis` services from `Config`-backed ioredis
|
|
42
|
+
* options, closing the client when the layer scope ends.
|
|
43
|
+
*
|
|
44
|
+
* @category layers
|
|
45
|
+
* @since 4.0.0
|
|
28
46
|
*/
|
|
29
47
|
export declare const layerConfig: (options: Config.Wrap<IoRedis.RedisOptions>) => Layer.Layer<Redis.Redis | NodeRedis, Config.ConfigError>;
|
|
30
48
|
export {};
|
package/dist/NodeRedis.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRedis.d.ts","sourceRoot":"","sources":["../src/NodeRedis.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeRedis.d.ts","sourceRoot":"","sources":["../src/NodeRedis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAA;AAC1D,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;;qBAWf,OAAO,CAAC,KAAK;kBAChB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC;;AAVnG;;;;;;;GAOG;AACH,qBAAa,SAAU,SAAQ,cAGQ;CAAG;AAiC1C;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,aACN,OAAO,CAAC,YAAY,GAAG,SAAS,KACzC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,CAAuC,CAAA;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,CACxB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,SAAS,EAAE,MAAM,CAAC,WAAW,CAOzD,CAAA"}
|
package/dist/NodeRedis.js
CHANGED
|
@@ -1,19 +1,31 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js Redis integration backed by `ioredis`.
|
|
3
|
+
*
|
|
4
|
+
* This module creates a scoped `ioredis` client and exposes it in two forms:
|
|
5
|
+
* the generic `Redis` service and the {@link NodeRedis} service for direct
|
|
6
|
+
* access to the underlying client. `layer` accepts ioredis options directly,
|
|
7
|
+
* while `layerConfig` reads them from Effect config. Both layers close the
|
|
8
|
+
* client when the layer scope ends.
|
|
9
|
+
*
|
|
10
|
+
* @since 4.0.0
|
|
3
11
|
*/
|
|
4
12
|
import * as Config from "effect/Config";
|
|
13
|
+
import * as Context from "effect/Context";
|
|
5
14
|
import * as Effect from "effect/Effect";
|
|
6
15
|
import * as Fn from "effect/Function";
|
|
7
16
|
import * as Layer from "effect/Layer";
|
|
8
17
|
import * as Scope from "effect/Scope";
|
|
9
|
-
import * as ServiceMap from "effect/ServiceMap";
|
|
10
18
|
import * as Redis from "effect/unstable/persistence/Redis";
|
|
11
19
|
import * as IoRedis from "ioredis";
|
|
12
20
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
21
|
+
* Service tag for the Node Redis integration, exposing the underlying
|
|
22
|
+
* `ioredis` client and a `use` helper that maps client failures to
|
|
23
|
+
* `RedisError`.
|
|
24
|
+
*
|
|
25
|
+
* @category services
|
|
26
|
+
* @since 4.0.0
|
|
15
27
|
*/
|
|
16
|
-
export class NodeRedis extends /*#__PURE__*/
|
|
28
|
+
export class NodeRedis extends /*#__PURE__*/Context.Service()("@effect/platform-node/NodeRedis") {}
|
|
17
29
|
const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
|
|
18
30
|
const scope = yield* Effect.scope;
|
|
19
31
|
yield* Scope.addFinalizer(scope, Effect.promise(() => client.quit()));
|
|
@@ -36,16 +48,22 @@ const make = /*#__PURE__*/Effect.fnUntraced(function* (options) {
|
|
|
36
48
|
client,
|
|
37
49
|
use
|
|
38
50
|
});
|
|
39
|
-
return
|
|
51
|
+
return Context.make(NodeRedis, nodeRedis).pipe(Context.add(Redis.Redis, redis));
|
|
40
52
|
});
|
|
41
53
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
54
|
+
* Provides `Redis` and `NodeRedis` services backed by an `ioredis` client
|
|
55
|
+
* created with the supplied options and closed when the layer scope ends.
|
|
56
|
+
*
|
|
57
|
+
* @category layers
|
|
58
|
+
* @since 4.0.0
|
|
44
59
|
*/
|
|
45
|
-
export const layer = options => Layer.
|
|
60
|
+
export const layer = options => Layer.effectContext(make(options));
|
|
46
61
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
62
|
+
* Provides `Redis` and `NodeRedis` services from `Config`-backed ioredis
|
|
63
|
+
* options, closing the client when the layer scope ends.
|
|
64
|
+
*
|
|
65
|
+
* @category layers
|
|
66
|
+
* @since 4.0.0
|
|
49
67
|
*/
|
|
50
|
-
export const layerConfig = options => Layer.
|
|
68
|
+
export const layerConfig = options => Layer.effectContext(Config.unwrap(options).pipe(Effect.flatMap(make)));
|
|
51
69
|
//# sourceMappingURL=NodeRedis.js.map
|
package/dist/NodeRedis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRedis.js","names":["Config","Effect","Fn","Layer","Scope","
|
|
1
|
+
{"version":3,"file":"NodeRedis.js","names":["Config","Context","Effect","Fn","Layer","Scope","Redis","IoRedis","NodeRedis","Service","make","fnUntraced","options","scope","addFinalizer","promise","client","quit","use","f","tryPromise","try","catch","cause","RedisError","redis","send","command","args","call","nodeRedis","identity","pipe","add","layer","effectContext","layerConfig","unwrap","flatMap"],"sources":["../src/NodeRedis.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,EAAE,MAAM,iBAAiB;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,mCAAmC;AAC1D,OAAO,KAAKC,OAAO,MAAM,SAAS;AAElC;;;;;;;;AAQA,OAAM,MAAOC,SAAU,sBAAQP,OAAO,CAACQ,OAAO,EAG1C,CAAC,iCAAiC,CAAC;AAEvC,MAAMC,IAAI,gBAAGR,MAAM,CAACS,UAAU,CAAC,WAC7BC,OAA8B;EAE9B,MAAMC,KAAK,GAAG,OAAOX,MAAM,CAACW,KAAK;EACjC,OAAOR,KAAK,CAACS,YAAY,CAACD,KAAK,EAAEX,MAAM,CAACa,OAAO,CAAC,MAAMC,MAAM,CAACC,IAAI,EAAE,CAAC,CAAC;EACrE,MAAMD,MAAM,GAAG,IAAIT,OAAO,CAACD,KAAK,CAACM,OAAO,IAAI,EAAE,CAAC;EAE/C,MAAMM,GAAG,GAAOC,CAAwC,IACtDjB,MAAM,CAACkB,UAAU,CAAC;IAChBC,GAAG,EAAEA,CAAA,KAAMF,CAAC,CAACH,MAAM,CAAC;IACpBM,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;MAAED;IAAK,CAAE;GACjD,CAAC;EAEJ,MAAME,KAAK,GAAG,OAAOnB,KAAK,CAACI,IAAI,CAAC;IAC9BgB,IAAI,EAAEA,CAAcC,OAAe,EAAE,GAAGC,IAA2B,KACjE1B,MAAM,CAACkB,UAAU,CAAC;MAChBC,GAAG,EAAEA,CAAA,KAAML,MAAM,CAACa,IAAI,CAACF,OAAO,EAAE,GAAGC,IAAI,CAAe;MACtDN,KAAK,EAAGC,KAAK,IAAK,IAAIjB,KAAK,CAACkB,UAAU,CAAC;QAAED;MAAK,CAAE;KACjD;GACJ,CAAC;EAEF,MAAMO,SAAS,GAAG3B,EAAE,CAAC4B,QAAQ,CAAuB;IAClDf,MAAM;IACNE;GACD,CAAC;EAEF,OAAOjB,OAAO,CAACS,IAAI,CAACF,SAAS,EAAEsB,SAAS,CAAC,CAACE,IAAI,CAC5C/B,OAAO,CAACgC,GAAG,CAAC3B,KAAK,CAACA,KAAK,EAAEmB,KAAK,CAAC,CAChC;AACH,CAAC,CAAC;AAEF;;;;;;;AAOA,OAAO,MAAMS,KAAK,GAChBtB,OAA0C,IACDR,KAAK,CAAC+B,aAAa,CAACzB,IAAI,CAACE,OAAO,CAAC,CAAC;AAE7E;;;;;;;AAOA,OAAO,MAAMwB,WAAW,GAGtBxB,OAA0C,IAE1CR,KAAK,CAAC+B,aAAa,CACjBnC,MAAM,CAACqC,MAAM,CAACzB,OAAO,CAAC,CAACoB,IAAI,CACzB9B,MAAM,CAACoC,OAAO,CAAC5B,IAAI,CAAC,CACrB,CACF","ignoreList":[]}
|
package/dist/NodeRuntime.d.ts
CHANGED
|
@@ -3,6 +3,12 @@ import type * as Runtime from "effect/Runtime";
|
|
|
3
3
|
/**
|
|
4
4
|
* Helps you run a main effect with built-in error handling, logging, and signal management.
|
|
5
5
|
*
|
|
6
|
+
* **When to use**
|
|
7
|
+
*
|
|
8
|
+
* Use to run a Node.js application's main Effect with structured error
|
|
9
|
+
* handling, log management, interrupt support, or advanced teardown
|
|
10
|
+
* capabilities.
|
|
11
|
+
*
|
|
6
12
|
* **Details**
|
|
7
13
|
*
|
|
8
14
|
* This function launches an Effect as the main entry point, setting exit codes
|
|
@@ -11,26 +17,23 @@ import type * as Runtime from "effect/Runtime";
|
|
|
11
17
|
* behaviors can be turned off. You can also provide custom teardown logic to
|
|
12
18
|
* finalize resources or produce different exit codes.
|
|
13
19
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* An optional object that can include:
|
|
20
|
+
* The optional configuration object can include:
|
|
17
21
|
* - `disableErrorReporting`: Turn off automatic error logging.
|
|
18
|
-
* - `disablePrettyLogger`: Avoid adding the pretty logger.
|
|
19
22
|
* - `teardown`: Provide custom finalization logic.
|
|
20
23
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* Use this function to run an Effect as your application’s main program, especially
|
|
24
|
-
* when you need structured error handling, log management, interrupt support,
|
|
25
|
-
* or advanced teardown capabilities.
|
|
26
|
-
*
|
|
27
|
-
* @since 1.0.0
|
|
28
|
-
* @category Run main
|
|
24
|
+
* @category running
|
|
25
|
+
* @since 4.0.0
|
|
29
26
|
*/
|
|
30
27
|
export declare const runMain: {
|
|
31
28
|
/**
|
|
32
29
|
* Helps you run a main effect with built-in error handling, logging, and signal management.
|
|
33
30
|
*
|
|
31
|
+
* **When to use**
|
|
32
|
+
*
|
|
33
|
+
* Use to run a Node.js application's main Effect with structured error
|
|
34
|
+
* handling, log management, interrupt support, or advanced teardown
|
|
35
|
+
* capabilities.
|
|
36
|
+
*
|
|
34
37
|
* **Details**
|
|
35
38
|
*
|
|
36
39
|
* This function launches an Effect as the main entry point, setting exit codes
|
|
@@ -39,21 +42,12 @@ export declare const runMain: {
|
|
|
39
42
|
* behaviors can be turned off. You can also provide custom teardown logic to
|
|
40
43
|
* finalize resources or produce different exit codes.
|
|
41
44
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* An optional object that can include:
|
|
45
|
+
* The optional configuration object can include:
|
|
45
46
|
* - `disableErrorReporting`: Turn off automatic error logging.
|
|
46
|
-
* - `disablePrettyLogger`: Avoid adding the pretty logger.
|
|
47
47
|
* - `teardown`: Provide custom finalization logic.
|
|
48
48
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* Use this function to run an Effect as your application’s main program, especially
|
|
52
|
-
* when you need structured error handling, log management, interrupt support,
|
|
53
|
-
* or advanced teardown capabilities.
|
|
54
|
-
*
|
|
55
|
-
* @since 1.0.0
|
|
56
|
-
* @category Run main
|
|
49
|
+
* @category running
|
|
50
|
+
* @since 4.0.0
|
|
57
51
|
*/
|
|
58
52
|
(options?: {
|
|
59
53
|
readonly disableErrorReporting?: boolean | undefined;
|
|
@@ -62,6 +56,12 @@ export declare const runMain: {
|
|
|
62
56
|
/**
|
|
63
57
|
* Helps you run a main effect with built-in error handling, logging, and signal management.
|
|
64
58
|
*
|
|
59
|
+
* **When to use**
|
|
60
|
+
*
|
|
61
|
+
* Use to run a Node.js application's main Effect with structured error
|
|
62
|
+
* handling, log management, interrupt support, or advanced teardown
|
|
63
|
+
* capabilities.
|
|
64
|
+
*
|
|
65
65
|
* **Details**
|
|
66
66
|
*
|
|
67
67
|
* This function launches an Effect as the main entry point, setting exit codes
|
|
@@ -70,21 +70,12 @@ export declare const runMain: {
|
|
|
70
70
|
* behaviors can be turned off. You can also provide custom teardown logic to
|
|
71
71
|
* finalize resources or produce different exit codes.
|
|
72
72
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* An optional object that can include:
|
|
73
|
+
* The optional configuration object can include:
|
|
76
74
|
* - `disableErrorReporting`: Turn off automatic error logging.
|
|
77
|
-
* - `disablePrettyLogger`: Avoid adding the pretty logger.
|
|
78
75
|
* - `teardown`: Provide custom finalization logic.
|
|
79
76
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* Use this function to run an Effect as your application’s main program, especially
|
|
83
|
-
* when you need structured error handling, log management, interrupt support,
|
|
84
|
-
* or advanced teardown capabilities.
|
|
85
|
-
*
|
|
86
|
-
* @since 1.0.0
|
|
87
|
-
* @category Run main
|
|
77
|
+
* @category running
|
|
78
|
+
* @since 4.0.0
|
|
88
79
|
*/
|
|
89
80
|
<E, A>(effect: Effect<A, E>, options?: {
|
|
90
81
|
readonly disableErrorReporting?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRuntime.d.ts","sourceRoot":"","sources":["../src/NodeRuntime.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeRuntime.d.ts","sourceRoot":"","sources":["../src/NodeRuntime.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,KAAK,OAAO,MAAM,gBAAgB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,OAAO,EAAE;IACpB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CACE,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAA;KACjD,GACA,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAA;IACvC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,CAAC,CAAC,EAAE,CAAC,EACH,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;QACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAA;KACjD,GACA,IAAI,CAAA;CACc,CAAA"}
|
package/dist/NodeRuntime.js
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js process runner for Effect programs.
|
|
3
|
+
*
|
|
4
|
+
* This module exports `runMain`, which runs one Effect as the main process
|
|
5
|
+
* fiber in Node.js. It reuses the shared Node runtime runner, including its
|
|
6
|
+
* error reporting, `SIGINT` / `SIGTERM` interruption, and optional teardown
|
|
7
|
+
* behavior.
|
|
8
|
+
*
|
|
9
|
+
* @since 4.0.0
|
|
3
10
|
*/
|
|
4
11
|
import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
|
|
5
12
|
/**
|
|
6
13
|
* Helps you run a main effect with built-in error handling, logging, and signal management.
|
|
7
14
|
*
|
|
15
|
+
* **When to use**
|
|
16
|
+
*
|
|
17
|
+
* Use to run a Node.js application's main Effect with structured error
|
|
18
|
+
* handling, log management, interrupt support, or advanced teardown
|
|
19
|
+
* capabilities.
|
|
20
|
+
*
|
|
8
21
|
* **Details**
|
|
9
22
|
*
|
|
10
23
|
* This function launches an Effect as the main entry point, setting exit codes
|
|
@@ -13,21 +26,12 @@ import * as NodeRuntime from "@effect/platform-node-shared/NodeRuntime";
|
|
|
13
26
|
* behaviors can be turned off. You can also provide custom teardown logic to
|
|
14
27
|
* finalize resources or produce different exit codes.
|
|
15
28
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* An optional object that can include:
|
|
29
|
+
* The optional configuration object can include:
|
|
19
30
|
* - `disableErrorReporting`: Turn off automatic error logging.
|
|
20
|
-
* - `disablePrettyLogger`: Avoid adding the pretty logger.
|
|
21
31
|
* - `teardown`: Provide custom finalization logic.
|
|
22
32
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* Use this function to run an Effect as your application’s main program, especially
|
|
26
|
-
* when you need structured error handling, log management, interrupt support,
|
|
27
|
-
* or advanced teardown capabilities.
|
|
28
|
-
*
|
|
29
|
-
* @since 1.0.0
|
|
30
|
-
* @category Run main
|
|
33
|
+
* @category running
|
|
34
|
+
* @since 4.0.0
|
|
31
35
|
*/
|
|
32
36
|
export const runMain = NodeRuntime.runMain;
|
|
33
37
|
//# sourceMappingURL=NodeRuntime.js.map
|
package/dist/NodeRuntime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeRuntime.js","names":["NodeRuntime","runMain"],"sources":["../src/NodeRuntime.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeRuntime.js","names":["NodeRuntime","runMain"],"sources":["../src/NodeRuntime.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;AAUA,OAAO,KAAKA,WAAW,MAAM,0CAA0C;AAIvE;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,MAAMC,OAAO,GA8DhBD,WAAW,CAACC,OAAO","ignoreList":[]}
|
package/dist/NodeServices.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Aggregate Node.js platform services layer.
|
|
3
|
+
*
|
|
4
|
+
* This module defines the `NodeServices` union and a single `layer` that
|
|
5
|
+
* provides Node-backed child process spawning, crypto, filesystem, path, stdio,
|
|
6
|
+
* and terminal services. Use the layer when a Node program wants the standard
|
|
7
|
+
* platform services from one place.
|
|
8
|
+
*
|
|
9
|
+
* @since 4.0.0
|
|
3
10
|
*/
|
|
11
|
+
import type { Crypto } from "effect/Crypto";
|
|
4
12
|
import type { FileSystem } from "effect/FileSystem";
|
|
5
13
|
import * as Layer from "effect/Layer";
|
|
6
14
|
import type { Path } from "effect/Path";
|
|
@@ -8,13 +16,19 @@ import type { Stdio } from "effect/Stdio";
|
|
|
8
16
|
import type { Terminal } from "effect/Terminal";
|
|
9
17
|
import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
|
|
10
18
|
/**
|
|
11
|
-
*
|
|
19
|
+
* The union of core services provided by the Node platform layer, including
|
|
20
|
+
* child process spawning, filesystem, path, stdio, and terminal services.
|
|
21
|
+
*
|
|
12
22
|
* @category models
|
|
23
|
+
* @since 4.0.0
|
|
13
24
|
*/
|
|
14
|
-
export type NodeServices = ChildProcessSpawner | FileSystem | Path | Stdio | Terminal;
|
|
25
|
+
export type NodeServices = ChildProcessSpawner | Crypto | FileSystem | Path | Stdio | Terminal;
|
|
15
26
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
27
|
+
* Provides the default Node implementations for child process spawning,
|
|
28
|
+
* filesystem, path, stdio, and terminal services.
|
|
29
|
+
*
|
|
30
|
+
* @category layers
|
|
31
|
+
* @since 4.0.0
|
|
18
32
|
*/
|
|
19
33
|
export declare const layer: Layer.Layer<NodeServices>;
|
|
20
34
|
//# sourceMappingURL=NodeServices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeServices.d.ts","sourceRoot":"","sources":["../src/NodeServices.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeServices.d.ts","sourceRoot":"","sources":["../src/NodeServices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAQtF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE9F;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAS3C,CAAA"}
|
package/dist/NodeServices.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
2
|
import * as NodeChildProcessSpawner from "./NodeChildProcessSpawner.js";
|
|
3
|
+
import * as NodeCrypto from "./NodeCrypto.js";
|
|
3
4
|
import * as NodeFileSystem from "./NodeFileSystem.js";
|
|
4
5
|
import * as NodePath from "./NodePath.js";
|
|
5
6
|
import * as NodeStdio from "./NodeStdio.js";
|
|
6
7
|
import * as NodeTerminal from "./NodeTerminal.js";
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* Provides the default Node implementations for child process spawning,
|
|
10
|
+
* filesystem, path, stdio, and terminal services.
|
|
11
|
+
*
|
|
12
|
+
* @category layers
|
|
13
|
+
* @since 4.0.0
|
|
10
14
|
*/
|
|
11
|
-
export const layer = /*#__PURE__*/Layer.provideMerge(NodeChildProcessSpawner.layer, /*#__PURE__*/Layer.mergeAll(NodeFileSystem.layer, NodePath.layer, NodeStdio.layer, NodeTerminal.layer));
|
|
15
|
+
export const layer = /*#__PURE__*/Layer.provideMerge(NodeChildProcessSpawner.layer, /*#__PURE__*/Layer.mergeAll(NodeFileSystem.layer, NodeCrypto.layer, NodePath.layer, NodeStdio.layer, NodeTerminal.layer));
|
|
12
16
|
//# sourceMappingURL=NodeServices.js.map
|
package/dist/NodeServices.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeServices.js","names":["Layer","NodeChildProcessSpawner","NodeFileSystem","NodePath","NodeStdio","NodeTerminal","layer","provideMerge","mergeAll"],"sources":["../src/NodeServices.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeServices.js","names":["Layer","NodeChildProcessSpawner","NodeCrypto","NodeFileSystem","NodePath","NodeStdio","NodeTerminal","layer","provideMerge","mergeAll"],"sources":["../src/NodeServices.ts"],"sourcesContent":[null],"mappings":"AAYA,OAAO,KAAKA,KAAK,MAAM,cAAc;AAKrC,OAAO,KAAKC,uBAAuB,MAAM,8BAA8B;AACvE,OAAO,KAAKC,UAAU,MAAM,iBAAiB;AAC7C,OAAO,KAAKC,cAAc,MAAM,qBAAqB;AACrD,OAAO,KAAKC,QAAQ,MAAM,eAAe;AACzC,OAAO,KAAKC,SAAS,MAAM,gBAAgB;AAC3C,OAAO,KAAKC,YAAY,MAAM,mBAAmB;AAWjD;;;;;;;AAOA,OAAO,MAAMC,KAAK,gBAA8BP,KAAK,CAACQ,YAAY,CAChEP,uBAAuB,CAACM,KAAK,eAC7BP,KAAK,CAACS,QAAQ,CACZN,cAAc,CAACI,KAAK,EACpBL,UAAU,CAACK,KAAK,EAChBH,QAAQ,CAACG,KAAK,EACdF,SAAS,CAACE,KAAK,EACfD,YAAY,CAACC,KAAK,CACnB,CACF","ignoreList":[]}
|
package/dist/NodeSink.d.ts
CHANGED
package/dist/NodeSink.js
CHANGED
package/dist/NodeSocket.d.ts
CHANGED
|
@@ -3,21 +3,36 @@ import type * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import * as Socket from "effect/unstable/socket/Socket";
|
|
5
5
|
/**
|
|
6
|
-
* @since
|
|
6
|
+
* @since 4.0.0
|
|
7
7
|
*/
|
|
8
8
|
export * from "@effect/platform-node-shared/NodeSocket";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Provides a `Socket.WebSocketConstructor`, using `globalThis.WebSocket` when
|
|
11
|
+
* available and falling back to the `ws` package otherwise.
|
|
12
|
+
*
|
|
11
13
|
* @category layers
|
|
14
|
+
* @since 4.0.0
|
|
12
15
|
*/
|
|
13
16
|
export declare const layerWebSocketConstructor: Layer.Layer<Socket.WebSocketConstructor>;
|
|
14
17
|
/**
|
|
15
|
-
*
|
|
18
|
+
* Provides a `Socket.WebSocketConstructor` backed explicitly by the `ws`
|
|
19
|
+
* package.
|
|
20
|
+
*
|
|
16
21
|
* @category layers
|
|
22
|
+
* @since 4.0.0
|
|
23
|
+
*/
|
|
24
|
+
export declare const layerWebSocketConstructorWS: Layer.Layer<Socket.WebSocketConstructor>;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a `Socket.Socket` layer for a WebSocket URL using the Node WebSocket
|
|
27
|
+
* constructor layer, honoring protocol, open-timeout, and close-code error
|
|
28
|
+
* options.
|
|
29
|
+
*
|
|
30
|
+
* @category layers
|
|
31
|
+
* @since 4.0.0
|
|
17
32
|
*/
|
|
18
33
|
export declare const layerWebSocket: (url: string | Effect.Effect<string>, options?: {
|
|
19
34
|
readonly closeCodeIsError?: ((code: number) => boolean) | undefined;
|
|
20
|
-
readonly openTimeout?: Duration.
|
|
35
|
+
readonly openTimeout?: Duration.Input | undefined;
|
|
21
36
|
readonly protocols?: string | Array<string> | undefined;
|
|
22
37
|
} | undefined) => Layer.Layer<Socket.Socket, never, never>;
|
|
23
38
|
//# sourceMappingURL=NodeSocket.d.ts.map
|
package/dist/NodeSocket.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeSocket.d.ts","sourceRoot":"","sources":["../src/NodeSocket.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeSocket.d.ts","sourceRoot":"","sources":["../src/NodeSocket.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,QAAQ,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAE5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAA;AAEvD;;GAEG;AACH,cAAc,yCAAyC,CAAA;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,KAAK,CACjD,MAAM,CAAC,oBAAoB,CAM3B,CAAA;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,EAAE,KAAK,CAAC,KAAK,CACnD,MAAM,CAAC,oBAAoB,CAG5B,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,CAC3B,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EACnC,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,SAAS,CAAA;IACnE,QAAQ,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,KAAK,GAAG,SAAS,CAAA;IACjD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,CAAA;CACxD,GAAG,SAAS,KACV,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAI3C,CAAA"}
|
package/dist/NodeSocket.js
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Node.js socket constructors and layers for Effect sockets.
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports the shared Node socket support for TCP connections,
|
|
5
|
+
* Unix domain socket connections, and Node `Duplex` streams. It also provides
|
|
6
|
+
* WebSocket constructor layers: one that uses `globalThis.WebSocket` when
|
|
7
|
+
* present and falls back to `ws`, one that always uses `ws`, and one that
|
|
8
|
+
* creates a `Socket.Socket` layer for a WebSocket URL.
|
|
9
|
+
*
|
|
10
|
+
* @since 4.0.0
|
|
3
11
|
*/
|
|
4
12
|
import { NodeWS as WS } from "@effect/platform-node-shared/NodeSocket";
|
|
5
13
|
import { flow } from "effect/Function";
|
|
6
14
|
import * as Layer from "effect/Layer";
|
|
7
15
|
import * as Socket from "effect/unstable/socket/Socket";
|
|
8
16
|
/**
|
|
9
|
-
* @since
|
|
17
|
+
* @since 4.0.0
|
|
10
18
|
*/
|
|
11
19
|
export * from "@effect/platform-node-shared/NodeSocket";
|
|
12
20
|
/**
|
|
13
|
-
*
|
|
21
|
+
* Provides a `Socket.WebSocketConstructor`, using `globalThis.WebSocket` when
|
|
22
|
+
* available and falling back to the `ws` package otherwise.
|
|
23
|
+
*
|
|
14
24
|
* @category layers
|
|
25
|
+
* @since 4.0.0
|
|
15
26
|
*/
|
|
16
27
|
export const layerWebSocketConstructor = /*#__PURE__*/Layer.sync(Socket.WebSocketConstructor)(() => {
|
|
17
28
|
if ("WebSocket" in globalThis) {
|
|
@@ -20,8 +31,20 @@ export const layerWebSocketConstructor = /*#__PURE__*/Layer.sync(Socket.WebSocke
|
|
|
20
31
|
return (url, protocols) => new WS.WebSocket(url, protocols);
|
|
21
32
|
});
|
|
22
33
|
/**
|
|
23
|
-
*
|
|
34
|
+
* Provides a `Socket.WebSocketConstructor` backed explicitly by the `ws`
|
|
35
|
+
* package.
|
|
36
|
+
*
|
|
24
37
|
* @category layers
|
|
38
|
+
* @since 4.0.0
|
|
39
|
+
*/
|
|
40
|
+
export const layerWebSocketConstructorWS = /*#__PURE__*/Layer.succeed(Socket.WebSocketConstructor)((url, protocols) => new WS.WebSocket(url, protocols));
|
|
41
|
+
/**
|
|
42
|
+
* Creates a `Socket.Socket` layer for a WebSocket URL using the Node WebSocket
|
|
43
|
+
* constructor layer, honoring protocol, open-timeout, and close-code error
|
|
44
|
+
* options.
|
|
45
|
+
*
|
|
46
|
+
* @category layers
|
|
47
|
+
* @since 4.0.0
|
|
25
48
|
*/
|
|
26
49
|
export const layerWebSocket = /*#__PURE__*/flow(Socket.makeWebSocket, /*#__PURE__*/Layer.effect(Socket.Socket), /*#__PURE__*/Layer.provide(layerWebSocketConstructor));
|
|
27
50
|
//# sourceMappingURL=NodeSocket.js.map
|
package/dist/NodeSocket.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeSocket.js","names":["NodeWS","WS","flow","Layer","Socket","layerWebSocketConstructor","sync","WebSocketConstructor","globalThis","url","protocols","WebSocket","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/NodeSocket.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NodeSocket.js","names":["NodeWS","WS","flow","Layer","Socket","layerWebSocketConstructor","sync","WebSocketConstructor","globalThis","url","protocols","WebSocket","layerWebSocketConstructorWS","succeed","layerWebSocket","makeWebSocket","effect","provide"],"sources":["../src/NodeSocket.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,SAASA,MAAM,IAAIC,EAAE,QAAQ,yCAAyC;AAGtE,SAASC,IAAI,QAAQ,iBAAiB;AACtC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,+BAA+B;AAEvD;;;AAGA,cAAc,yCAAyC;AAEvD;;;;;;;AAOA,OAAO,MAAMC,yBAAyB,gBAElCF,KAAK,CAACG,IAAI,CAACF,MAAM,CAACG,oBAAoB,CAAC,CAAC,MAAK;EAC/C,IAAI,WAAW,IAAIC,UAAU,EAAE;IAC7B,OAAO,CAACC,GAAG,EAAEC,SAAS,KAAK,IAAIF,UAAU,CAACG,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAC;EACrE;EACA,OAAO,CAACD,GAAG,EAAEC,SAAS,KAAK,IAAIT,EAAE,CAACU,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAoC;AAChG,CAAC,CAAC;AAEF;;;;;;;AAOA,OAAO,MAAME,2BAA2B,gBAEpCT,KAAK,CAACU,OAAO,CAACT,MAAM,CAACG,oBAAoB,CAAC,CAC5C,CAACE,GAAG,EAAEC,SAAS,KAAK,IAAIT,EAAE,CAACU,SAAS,CAACF,GAAG,EAAEC,SAAS,CAAoC,CACxF;AAED;;;;;;;;AAQA,OAAO,MAAMI,cAAc,gBAOqBZ,IAAI,CAClDE,MAAM,CAACW,aAAa,eACpBZ,KAAK,CAACa,MAAM,CAACZ,MAAM,CAACA,MAAM,CAAC,eAC3BD,KAAK,CAACc,OAAO,CAACZ,yBAAyB,CAAC,CACzC","ignoreList":[]}
|
package/dist/NodeSocketServer.js
CHANGED
package/dist/NodeStdio.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type * as Layer from "effect/Layer";
|
|
2
2
|
import type { Stdio } from "effect/Stdio";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Provides the `Stdio` service backed by the current process arguments,
|
|
5
|
+
* stdin, stdout, and stderr streams.
|
|
6
|
+
*
|
|
7
|
+
* @category layers
|
|
8
|
+
* @since 4.0.0
|
|
6
9
|
*/
|
|
7
10
|
export declare const layer: Layer.Layer<Stdio>;
|
|
8
11
|
//# sourceMappingURL=NodeStdio.d.ts.map
|
package/dist/NodeStdio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeStdio.d.ts","sourceRoot":"","sources":["../src/NodeStdio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeStdio.d.ts","sourceRoot":"","sources":["../src/NodeStdio.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEzC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAmB,CAAA"}
|