@effect/platform-bun 4.0.0-beta.9 → 4.0.0-beta.91
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/BunChildProcessSpawner.d.ts +1 -1
- package/dist/BunChildProcessSpawner.js +1 -1
- package/dist/BunClusterHttp.d.ts +44 -7
- package/dist/BunClusterHttp.d.ts.map +1 -1
- package/dist/BunClusterHttp.js +41 -10
- package/dist/BunClusterHttp.js.map +1 -1
- package/dist/BunClusterSocket.d.ts +27 -9
- package/dist/BunClusterSocket.d.ts.map +1 -1
- package/dist/BunClusterSocket.js +27 -9
- package/dist/BunClusterSocket.js.map +1 -1
- package/dist/BunCrypto.d.ts +10 -0
- package/dist/BunCrypto.d.ts.map +1 -0
- package/dist/BunCrypto.js +22 -0
- package/dist/BunCrypto.js.map +1 -0
- package/dist/BunFileSystem.d.ts +4 -2
- package/dist/BunFileSystem.d.ts.map +1 -1
- package/dist/BunFileSystem.js +11 -3
- package/dist/BunFileSystem.js.map +1 -1
- package/dist/BunHttpClient.d.ts +2 -2
- package/dist/BunHttpClient.js +2 -2
- package/dist/BunHttpPlatform.d.ts +4 -2
- package/dist/BunHttpPlatform.d.ts.map +1 -1
- package/dist/BunHttpPlatform.js +5 -3
- package/dist/BunHttpPlatform.js.map +1 -1
- package/dist/BunHttpServer.d.ts +57 -20
- package/dist/BunHttpServer.d.ts.map +1 -1
- package/dist/BunHttpServer.js +63 -36
- package/dist/BunHttpServer.js.map +1 -1
- package/dist/BunHttpServerRequest.d.ts +11 -3
- package/dist/BunHttpServerRequest.d.ts.map +1 -1
- package/dist/BunHttpServerRequest.js +4 -2
- package/dist/BunHttpServerRequest.js.map +1 -1
- package/dist/BunMultipart.d.ts +16 -5
- package/dist/BunMultipart.d.ts.map +1 -1
- package/dist/BunMultipart.js +15 -5
- package/dist/BunMultipart.js.map +1 -1
- package/dist/BunPath.d.ts +12 -6
- package/dist/BunPath.d.ts.map +1 -1
- package/dist/BunPath.js +20 -7
- package/dist/BunPath.js.map +1 -1
- package/dist/BunRedis.d.ts +23 -9
- package/dist/BunRedis.d.ts.map +1 -1
- package/dist/BunRedis.js +26 -12
- package/dist/BunRedis.js.map +1 -1
- package/dist/BunRuntime.d.ts +21 -30
- package/dist/BunRuntime.d.ts.map +1 -1
- package/dist/BunRuntime.js +14 -11
- package/dist/BunRuntime.js.map +1 -1
- package/dist/BunServices.d.ts +19 -5
- package/dist/BunServices.d.ts.map +1 -1
- package/dist/BunServices.js +7 -3
- package/dist/BunServices.js.map +1 -1
- package/dist/BunSink.d.ts +2 -2
- package/dist/BunSink.js +2 -2
- package/dist/BunSocket.d.ts +18 -4
- package/dist/BunSocket.d.ts.map +1 -1
- package/dist/BunSocket.js +10 -3
- package/dist/BunSocket.js.map +1 -1
- package/dist/BunSocketServer.d.ts +2 -2
- package/dist/BunSocketServer.js +2 -2
- package/dist/BunStdio.d.ts +5 -2
- package/dist/BunStdio.d.ts.map +1 -1
- package/dist/BunStdio.js +13 -3
- package/dist/BunStdio.js.map +1 -1
- package/dist/BunStream.d.ts +5 -4
- package/dist/BunStream.d.ts.map +1 -1
- package/dist/BunStream.js +14 -5
- package/dist/BunStream.js.map +1 -1
- package/dist/BunTerminal.d.ts +8 -2
- package/dist/BunTerminal.d.ts.map +1 -1
- package/dist/BunTerminal.js +15 -3
- package/dist/BunTerminal.js.map +1 -1
- package/dist/BunWorker.d.ts +9 -2
- package/dist/BunWorker.d.ts.map +1 -1
- package/dist/BunWorker.js +20 -4
- package/dist/BunWorker.js.map +1 -1
- package/dist/BunWorkerRunner.d.ts +5 -1
- package/dist/BunWorkerRunner.d.ts.map +1 -1
- package/dist/BunWorkerRunner.js +17 -5
- package/dist/BunWorkerRunner.js.map +1 -1
- package/dist/index.d.ts +25 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -23
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/src/BunChildProcessSpawner.ts +1 -1
- package/src/BunClusterHttp.ts +49 -11
- package/src/BunClusterSocket.ts +27 -9
- package/src/BunCrypto.ts +24 -0
- package/src/BunFileSystem.ts +11 -3
- package/src/BunHttpClient.ts +2 -2
- package/src/BunHttpPlatform.ts +14 -4
- package/src/BunHttpServer.ts +108 -57
- package/src/BunHttpServerRequest.ts +11 -3
- package/src/BunMultipart.ts +24 -6
- package/src/BunPath.ts +20 -7
- package/src/BunRedis.ts +28 -14
- package/src/BunRuntime.ts +28 -31
- package/src/BunServices.ts +21 -5
- package/src/BunSink.ts +2 -2
- package/src/BunSocket.ts +18 -4
- package/src/BunSocketServer.ts +2 -2
- package/src/BunStdio.ts +13 -3
- package/src/BunStream.ts +14 -5
- package/src/BunTerminal.ts +15 -3
- package/src/BunWorker.ts +20 -4
- package/src/BunWorkerRunner.ts +17 -5
- package/src/index.ts +26 -23
package/dist/BunClusterHttp.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Bun HTTP and WebSocket layers for Effect Cluster runners.
|
|
3
|
+
*
|
|
4
|
+
* `layerHttpServer` provides the Bun HTTP server used by cluster runners. The
|
|
5
|
+
* main `layer` builds a sharding layer for HTTP or WebSocket transport,
|
|
6
|
+
* choosing serialization, runner health checks, runner storage, message
|
|
7
|
+
* storage, and optional client-only mode from the supplied options.
|
|
8
|
+
*
|
|
9
|
+
* @since 4.0.0
|
|
3
10
|
*/
|
|
4
11
|
import type * as Config from "effect/Config";
|
|
5
12
|
import * as Layer from "effect/Layer";
|
|
@@ -17,18 +24,48 @@ import { layerK8sHttpClient } from "./BunClusterSocket.ts";
|
|
|
17
24
|
import type { BunServices } from "./BunServices.ts";
|
|
18
25
|
export {
|
|
19
26
|
/**
|
|
20
|
-
*
|
|
21
|
-
*
|
|
27
|
+
* Layer that provides a Kubernetes HTTP client for runner health checks.
|
|
28
|
+
*
|
|
29
|
+
* @category re-exports
|
|
30
|
+
* @since 4.0.0
|
|
22
31
|
*/
|
|
23
32
|
layerK8sHttpClient };
|
|
24
33
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
34
|
+
* Layer that provides a Bun HTTP server for cluster runners.
|
|
35
|
+
*
|
|
36
|
+
* @category layers
|
|
37
|
+
* @since 4.0.0
|
|
27
38
|
*/
|
|
28
39
|
export declare const layerHttpServer: Layer.Layer<HttpPlatform | Etag.Generator | BunServices | HttpServer, ServeError, ShardingConfig.ShardingConfig>;
|
|
29
40
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
41
|
+
* Creates Bun cluster layers for HTTP or WebSocket transport, configuring serialization, storage, runner health, and optional client-only mode.
|
|
42
|
+
*
|
|
43
|
+
* **When to use**
|
|
44
|
+
*
|
|
45
|
+
* Use to install the complete Bun HTTP or WebSocket cluster layer, including
|
|
46
|
+
* client-only cluster access when a process should connect without serving
|
|
47
|
+
* runner RPCs.
|
|
48
|
+
*
|
|
49
|
+
* **Details**
|
|
50
|
+
*
|
|
51
|
+
* `serialization` defaults to MessagePack, `runnerHealth` defaults to ping
|
|
52
|
+
* checks, SQL-backed storage is used by default, and `shardingConfig` is
|
|
53
|
+
* overlaid on environment-loaded sharding configuration. `local` storage uses
|
|
54
|
+
* no-op message storage plus in-memory runner storage, while `byo` leaves both
|
|
55
|
+
* message and runner storage for the caller to provide.
|
|
56
|
+
*
|
|
57
|
+
* **Gotchas**
|
|
58
|
+
*
|
|
59
|
+
* `clientOnly` does not start the HTTP server or receive shard assignments.
|
|
60
|
+
* Non-client-only mode listens with `runnerListenAddress` when present, falling
|
|
61
|
+
* back to `runnerAddress`. HTTP and WebSocket runner RPCs use the default
|
|
62
|
+
* `HttpRunner` route.
|
|
63
|
+
*
|
|
64
|
+
* @see {@link layerHttpServer} for the server layer used by non-client-only transports
|
|
65
|
+
* @see {@link layerK8sHttpClient} for Kubernetes runner health support
|
|
66
|
+
*
|
|
67
|
+
* @category layers
|
|
68
|
+
* @since 4.0.0
|
|
32
69
|
*/
|
|
33
70
|
export declare const layer: <const ClientOnly extends boolean = false, const Storage extends "local" | "sql" | "byo" = never>(options: {
|
|
34
71
|
readonly transport: "http" | "websocket";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunClusterHttp.d.ts","sourceRoot":"","sources":["../src/BunClusterHttp.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BunClusterHttp.d.ts","sourceRoot":"","sources":["../src/BunClusterHttp.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAE5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAA;AAExE,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAA;AAC1D,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAA;AAGxE,OAAO,KAAK,KAAK,IAAI,MAAM,2BAA2B,CAAA;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAA;AAEtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAG1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAGnD,OAAO;AACL;;;;;GAKG;AACH,kBAAkB,EACnB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CACrC,YAAY,GACZ,IAAI,CAAC,SAAS,GACd,WAAW,GACX,UAAU,EACZ,UAAU,EACV,cAAc,CAAC,cA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Ac,CAAC,cAAc,EAC1D,UAAU,GAAG,MAAM,CAAC,WAAW,EAC/B,OAAO,SAAS,OAAO,GAAG,KAAK,GAC3B,KAAK,SAAS,OAAO,GAAG,CAAC,cAAc,CAAC,cAAc,GAAG,aAAa,CAAC,aAAa,CAAC,GACrF,SAAS,CAiDhB,CAAA"}
|
package/dist/BunClusterHttp.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
2
|
import * as Layer from "effect/Layer";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
3
4
|
import * as HttpRunner from "effect/unstable/cluster/HttpRunner";
|
|
4
5
|
import * as MessageStorage from "effect/unstable/cluster/MessageStorage";
|
|
5
6
|
import * as RunnerHealth from "effect/unstable/cluster/RunnerHealth";
|
|
@@ -16,25 +17,55 @@ import * as BunHttpServer from "./BunHttpServer.js";
|
|
|
16
17
|
import * as BunSocket from "./BunSocket.js";
|
|
17
18
|
export {
|
|
18
19
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
20
|
+
* Layer that provides a Kubernetes HTTP client for runner health checks.
|
|
21
|
+
*
|
|
22
|
+
* @category re-exports
|
|
23
|
+
* @since 4.0.0
|
|
21
24
|
*/
|
|
22
25
|
layerK8sHttpClient };
|
|
23
26
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
27
|
+
* Layer that provides a Bun HTTP server for cluster runners.
|
|
28
|
+
*
|
|
29
|
+
* @category layers
|
|
30
|
+
* @since 4.0.0
|
|
26
31
|
*/
|
|
27
32
|
export const layerHttpServer = /*#__PURE__*/Effect.gen(function* () {
|
|
28
33
|
const config = yield* ShardingConfig.ShardingConfig;
|
|
29
|
-
const listenAddress = config.runnerListenAddress
|
|
30
|
-
if (listenAddress
|
|
31
|
-
return yield* Effect.die("BunClusterHttp.layerHttpServer: ShardingConfig.runnerAddress is
|
|
34
|
+
const listenAddress = Option.orElse(config.runnerListenAddress, () => config.runnerAddress);
|
|
35
|
+
if (Option.isNone(listenAddress)) {
|
|
36
|
+
return yield* Effect.die("BunClusterHttp.layerHttpServer: ShardingConfig.runnerAddress is None");
|
|
32
37
|
}
|
|
33
|
-
return BunHttpServer.layer(listenAddress);
|
|
38
|
+
return BunHttpServer.layer(listenAddress.value);
|
|
34
39
|
}).pipe(Layer.unwrap);
|
|
35
40
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
41
|
+
* Creates Bun cluster layers for HTTP or WebSocket transport, configuring serialization, storage, runner health, and optional client-only mode.
|
|
42
|
+
*
|
|
43
|
+
* **When to use**
|
|
44
|
+
*
|
|
45
|
+
* Use to install the complete Bun HTTP or WebSocket cluster layer, including
|
|
46
|
+
* client-only cluster access when a process should connect without serving
|
|
47
|
+
* runner RPCs.
|
|
48
|
+
*
|
|
49
|
+
* **Details**
|
|
50
|
+
*
|
|
51
|
+
* `serialization` defaults to MessagePack, `runnerHealth` defaults to ping
|
|
52
|
+
* checks, SQL-backed storage is used by default, and `shardingConfig` is
|
|
53
|
+
* overlaid on environment-loaded sharding configuration. `local` storage uses
|
|
54
|
+
* no-op message storage plus in-memory runner storage, while `byo` leaves both
|
|
55
|
+
* message and runner storage for the caller to provide.
|
|
56
|
+
*
|
|
57
|
+
* **Gotchas**
|
|
58
|
+
*
|
|
59
|
+
* `clientOnly` does not start the HTTP server or receive shard assignments.
|
|
60
|
+
* Non-client-only mode listens with `runnerListenAddress` when present, falling
|
|
61
|
+
* back to `runnerAddress`. HTTP and WebSocket runner RPCs use the default
|
|
62
|
+
* `HttpRunner` route.
|
|
63
|
+
*
|
|
64
|
+
* @see {@link layerHttpServer} for the server layer used by non-client-only transports
|
|
65
|
+
* @see {@link layerK8sHttpClient} for Kubernetes runner health support
|
|
66
|
+
*
|
|
67
|
+
* @category layers
|
|
68
|
+
* @since 4.0.0
|
|
38
69
|
*/
|
|
39
70
|
export const layer = options => {
|
|
40
71
|
const layer = options.clientOnly
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunClusterHttp.js","names":["Effect","Layer","HttpRunner","MessageStorage","RunnerHealth","Runners","RunnerStorage","ShardingConfig","SqlMessageStorage","SqlRunnerStorage","FetchHttpClient","RpcSerialization","layerK8sHttpClient","BunFileSystem","BunHttpServer","BunSocket","layerHttpServer","gen","config","listenAddress","runnerListenAddress","runnerAddress","
|
|
1
|
+
{"version":3,"file":"BunClusterHttp.js","names":["Effect","Layer","Option","HttpRunner","MessageStorage","RunnerHealth","Runners","RunnerStorage","ShardingConfig","SqlMessageStorage","SqlRunnerStorage","FetchHttpClient","RpcSerialization","layerK8sHttpClient","BunFileSystem","BunHttpServer","BunSocket","layerHttpServer","gen","config","listenAddress","orElse","runnerListenAddress","runnerAddress","isNone","die","layer","value","pipe","unwrap","options","clientOnly","transport","provide","layerHttpClientOnly","layerWebsocketClientOnly","layerWebSocketConstructor","layerHttp","layerWebsocket","runnerHealth","empty","layerK8s","runnerHealthK8s","layerPing","layerRpc","layerClientProtocolHttpDefault","layerClientProtocolWebsocketDefault","provideMerge","storage","layerNoop","orDie","layerMemory","layerFromEnv","shardingConfig","serialization","layerNdjson","layerMsgPack"],"sources":["../src/BunClusterHttp.ts"],"sourcesContent":[null],"mappings":"AAWA,OAAO,KAAKA,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,UAAU,MAAM,oCAAoC;AAChE,OAAO,KAAKC,cAAc,MAAM,wCAAwC;AACxE,OAAO,KAAKC,YAAY,MAAM,sCAAsC;AACpE,OAAO,KAAKC,OAAO,MAAM,iCAAiC;AAC1D,OAAO,KAAKC,aAAa,MAAM,uCAAuC;AAEtE,OAAO,KAAKC,cAAc,MAAM,wCAAwC;AACxE,OAAO,KAAKC,iBAAiB,MAAM,2CAA2C;AAC9E,OAAO,KAAKC,gBAAgB,MAAM,0CAA0C;AAE5E,OAAO,KAAKC,eAAe,MAAM,sCAAsC;AAIvE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,OAAO,KAAK,KAAK,GAC1B/C,KAAK,CAACuC,KAAK,GACXvC,KAAK,CAACiD,KAAK,CAACxC,gBAAgB,CAACgB,KAAK,CAAC,CACxC,EACDzB,KAAK,CAACgC,OAAO,CAACzB,cAAc,CAAC4C,YAAY,CAACtB,OAAO,EAAEuB,cAAc,CAAC,CAAC,EACnEpD,KAAK,CAACgC,OAAO,CACXH,OAAO,EAAEwB,aAAa,KAAK,QAAQ,GAAG1C,gBAAgB,CAAC2C,WAAW,GAAG3C,gBAAgB,CAAC4C,YAAY,CACnG,CACK;AACV,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Bun socket layers for Effect Cluster runners.
|
|
3
|
+
*
|
|
4
|
+
* The main `layer` builds a sharding layer for socket transport, choosing
|
|
5
|
+
* serialization, runner health checks, runner storage, message storage, and
|
|
6
|
+
* optional client-only mode from the supplied options. This module also
|
|
7
|
+
* re-exports the shared socket client and server protocol layers and provides
|
|
8
|
+
* `layerK8sHttpClient` for Kubernetes runner health checks.
|
|
9
|
+
*
|
|
10
|
+
* @since 4.0.0
|
|
3
11
|
*/
|
|
4
12
|
import { layerClientProtocol, layerSocketServer } from "@effect/platform-node-shared/NodeClusterSocket";
|
|
5
13
|
import type * as Config from "effect/Config";
|
|
@@ -14,18 +22,26 @@ import type * as SocketServer from "effect/unstable/socket/SocketServer";
|
|
|
14
22
|
import type { SqlClient } from "effect/unstable/sql/SqlClient";
|
|
15
23
|
export {
|
|
16
24
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
25
|
+
* Provides the cluster `RpcClientProtocol` using the shared socket client
|
|
26
|
+
* implementation.
|
|
27
|
+
*
|
|
28
|
+
* @category re-exports
|
|
29
|
+
* @since 4.0.0
|
|
19
30
|
*/
|
|
20
31
|
layerClientProtocol,
|
|
21
32
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
33
|
+
* Provides the socket server used by Bun cluster runners through the shared
|
|
34
|
+
* socket server implementation.
|
|
35
|
+
*
|
|
36
|
+
* @category re-exports
|
|
37
|
+
* @since 4.0.0
|
|
24
38
|
*/
|
|
25
39
|
layerSocketServer };
|
|
26
40
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
41
|
+
* Creates Bun socket cluster layers, configuring serialization, storage, runner health, and optional client-only mode.
|
|
42
|
+
*
|
|
43
|
+
* @category layers
|
|
44
|
+
* @since 4.0.0
|
|
29
45
|
*/
|
|
30
46
|
export declare const layer: <const ClientOnly extends boolean = false, const Storage extends "local" | "sql" | "byo" = never>(options?: {
|
|
31
47
|
readonly serialization?: "msgpack" | "ndjson" | undefined;
|
|
@@ -39,8 +55,10 @@ export declare const layer: <const ClientOnly extends boolean = false, const Sto
|
|
|
39
55
|
readonly shardingConfig?: Partial<ShardingConfig.ShardingConfig["Service"]> | undefined;
|
|
40
56
|
}) => ClientOnly extends true ? Layer.Layer<Sharding | Runners.Runners | ("byo" extends Storage ? never : MessageStorage.MessageStorage), Config.ConfigError, "local" extends Storage ? never : "byo" extends Storage ? (MessageStorage.MessageStorage | RunnerStorage.RunnerStorage) : SqlClient> : Layer.Layer<Sharding | Runners.Runners | ("byo" extends Storage ? never : MessageStorage.MessageStorage), SocketServer.SocketServerError | Config.ConfigError, "local" extends Storage ? never : "byo" extends Storage ? (MessageStorage.MessageStorage | RunnerStorage.RunnerStorage) : SqlClient>;
|
|
41
57
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
58
|
+
* Layer that provides `K8sHttpClient`, using the Kubernetes service-account CA certificate when it is available.
|
|
59
|
+
*
|
|
60
|
+
* @category layers
|
|
61
|
+
* @since 4.0.0
|
|
44
62
|
*/
|
|
45
63
|
export declare const layerK8sHttpClient: Layer.Layer<K8sHttpClient.K8sHttpClient>;
|
|
46
64
|
//# sourceMappingURL=BunClusterSocket.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunClusterSocket.d.ts","sourceRoot":"","sources":["../src/BunClusterSocket.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BunClusterSocket.d.ts","sourceRoot":"","sources":["../src/BunClusterSocket.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAA;AACvG,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAG5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAA;AAExE,OAAO,KAAK,OAAO,MAAM,iCAAiC,CAAA;AAC1D,OAAO,KAAK,aAAa,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,KAAK,cAAc,MAAM,wCAAwC,CAAA;AAMxE,OAAO,KAAK,KAAK,YAAY,MAAM,qCAAqC,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAG9D,OAAO;AACL;;;;;;GAMG;AACH,mBAAmB;AACnB;;;;;;GAMG;AACH,iBAAiB,EAClB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAChB,KAAK,CAAC,UAAU,SAAS,OAAO,GAAG,KAAK,EACxC,KAAK,CAAC,OAAO,SAAS,OAAO,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,EAErD,UAAU;IACR,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;IACzD,QAAQ,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAA;IAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,SA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transport, choosing
|
|
5
|
+
* serialization, runner health checks, runner storage, message storage, and
|
|
6
|
+
* optional client-only mode from the supplied options. This module also
|
|
7
|
+
* re-exports the shared socket client and server protocol layers and provides
|
|
8
|
+
* `layerK8sHttpClient` for Kubernetes runner health checks.
|
|
9
|
+
*
|
|
10
|
+
* @since 4.0.0
|
|
3
11
|
*/
|
|
4
12
|
import { layerClientProtocol, layerSocketServer } from "@effect/platform-node-shared/NodeClusterSocket";
|
|
5
13
|
import * as Effect from "effect/Effect";
|
|
@@ -19,18 +27,26 @@ import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
|
19
27
|
import * as BunFileSystem from "./BunFileSystem.js";
|
|
20
28
|
export {
|
|
21
29
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
30
|
+
* Provides the cluster `RpcClientProtocol` using the shared socket client
|
|
31
|
+
* implementation.
|
|
32
|
+
*
|
|
33
|
+
* @category re-exports
|
|
34
|
+
* @since 4.0.0
|
|
24
35
|
*/
|
|
25
36
|
layerClientProtocol,
|
|
26
37
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
38
|
+
* Provides the socket server used by Bun cluster runners through the shared
|
|
39
|
+
* socket server implementation.
|
|
40
|
+
*
|
|
41
|
+
* @category re-exports
|
|
42
|
+
* @since 4.0.0
|
|
29
43
|
*/
|
|
30
44
|
layerSocketServer };
|
|
31
45
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
46
|
+
* Creates Bun socket cluster layers, configuring serialization, storage, runner health, and optional client-only mode.
|
|
47
|
+
*
|
|
48
|
+
* @category layers
|
|
49
|
+
* @since 4.0.0
|
|
34
50
|
*/
|
|
35
51
|
export const layer = options => {
|
|
36
52
|
const layer = options?.clientOnly
|
|
@@ -42,8 +58,10 @@ export const layer = options => {
|
|
|
42
58
|
return layer.pipe(Layer.provide(runnerHealth), Layer.provideMerge(options?.storage === "local" ? MessageStorage.layerNoop : options?.storage === "byo" ? Layer.empty : Layer.orDie(SqlMessageStorage.layer)), Layer.provide(options?.storage === "local" ? RunnerStorage.layerMemory : options?.storage === "byo" ? Layer.empty : Layer.orDie(SqlRunnerStorage.layer)), Layer.provide(ShardingConfig.layerFromEnv(options?.shardingConfig)), Layer.provide(options?.serialization === "ndjson" ? RpcSerialization.layerNdjson : RpcSerialization.layerMsgPack));
|
|
43
59
|
};
|
|
44
60
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
61
|
+
* Layer that provides `K8sHttpClient`, using the Kubernetes service-account CA certificate when it is available.
|
|
62
|
+
*
|
|
63
|
+
* @category layers
|
|
64
|
+
* @since 4.0.0
|
|
47
65
|
*/
|
|
48
66
|
export const layerK8sHttpClient = /*#__PURE__*/K8sHttpClient.layer.pipe(/*#__PURE__*/Layer.provide(/*#__PURE__*/Layer.unwrap(/*#__PURE__*/Effect.gen(function* () {
|
|
49
67
|
const fs = yield* FileSystem.FileSystem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunClusterSocket.js","names":["layerClientProtocol","layerSocketServer","Effect","FileSystem","Layer","K8sHttpClient","MessageStorage","RunnerHealth","Runners","RunnerStorage","ShardingConfig","SocketRunner","SqlMessageStorage","SqlRunnerStorage","FetchHttpClient","RpcSerialization","BunFileSystem","layer","options","clientOnly","provide","layerClientOnly","runnerHealth","empty","layerK8s","runnerHealthK8s","pipe","layerK8sHttpClient","layerPing","layerRpc","provideMerge","storage","layerNoop","orDie","layerMemory","layerFromEnv","shardingConfig","serialization","layerNdjson","layerMsgPack","unwrap","gen","fs","caCertOption","readFile","option","_tag","fresh","succeed","RequestInit","tls","ca","value"],"sources":["../src/BunClusterSocket.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BunClusterSocket.js","names":["layerClientProtocol","layerSocketServer","Effect","FileSystem","Layer","K8sHttpClient","MessageStorage","RunnerHealth","Runners","RunnerStorage","ShardingConfig","SocketRunner","SqlMessageStorage","SqlRunnerStorage","FetchHttpClient","RpcSerialization","BunFileSystem","layer","options","clientOnly","provide","layerClientOnly","runnerHealth","empty","layerK8s","runnerHealthK8s","pipe","layerK8sHttpClient","layerPing","layerRpc","provideMerge","storage","layerNoop","orDie","layerMemory","layerFromEnv","shardingConfig","serialization","layerNdjson","layerMsgPack","unwrap","gen","fs","caCertOption","readFile","option","_tag","fresh","succeed","RequestInit","tls","ca","value"],"sources":["../src/BunClusterSocket.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;AAWA,SAASA,mBAAmB,EAAEC,iBAAiB,QAAQ,gDAAgD;AAEvG,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,UAAU,MAAM,mBAAmB;AAC/C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,aAAa,MAAM,uCAAuC;AACtE,OAAO,KAAKC,cAAc,MAAM,wCAAwC;AACxE,OAAO,KAAKC,YAAY,MAAM,sCAAsC;AACpE,OAAO,KAAKC,OAAO,MAAM,iCAAiC;AAC1D,OAAO,KAAKC,aAAa,MAAM,uCAAuC;AAEtE,OAAO,KAAKC,cAAc,MAAM,wCAAwC;AACxE,OAAO,KAAKC,YAAY,MAAM,sCAAsC;AACpE,OAAO,KAAKC,iBAAiB,MAAM,2CAA2C;AAC9E,OAAO,KAAKC,gBAAgB,MAAM,0CAA0C;AAC5E,OAAO,KAAKC,eAAe,MAAM,sCAAsC;AACvE,OAAO,KAAKC,gBAAgB,MAAM,sCAAsC;AAGxE,OAAO,KAAKC,aAAa,MAAM,oBAAoB;AAEnD;AACE;;;;;;;AAOAhB,mBAAmB;AACnB;;;;;;;AAOAC,iBAAiB;AAGnB;;;;;;AAMA,OAAO,MAAMgB,KAAK,GAIhBC,OAUC,IAcG;EAEJ,MAAMD,KAAK,GAA+BC,OAAO,EAAEC;EACjD;EAAA,EACEf,KAAK,CAACgB,OAAO,CAACT,YAAY,CAACU,eAAe,EAAErB,mBAAmB;EACjE;EAAA,EACEI,KAAK,CAACgB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B,WAAW,GAAGvB,gBAAgB,CAACwB,YAAY,CACnG,CACK;AACV,CAAC;AAED;;;;;;AAMA,OAAO,MAAMZ,kBAAkB,gBAA6CtB,aAAa,CAACY,KAAK,CAACS,IAAI,cAClGtB,KAAK,CAACgB,OAAO,cAAChB,KAAK,CAACoC,MAAM,cAACtC,MAAM,CAACuC,GAAG,CAAC,aAAS;EAC7C,MAAMC,EAAE,GAAG,OAAOvC,UAAU,CAACA,UAAU;EACvC,MAAMwC,YAAY,GAAG,OAAOD,EAAE,CAACE,QAAQ,CAAC,sDAAsD,CAAC,CAAClB,IAAI,CAClGxB,MAAM,CAAC2C,MAAM,CACd;EACD,IAAIF,YAAY,CAACG,IAAI,KAAK,MAAM,EAAE;IAChC,OAAOhC,eAAe,CAACG,KAAK;EAC9B;EAEA,OAAOb,KAAK,CAAC2C,KAAK,CAACjC,eAAe,CAACG,KAAK,CAAC,CAACS,IAAI,CAC5CtB,KAAK,CAACgB,OAAO,CAAChB,KAAK,CAAC4C,OAAO,CAAClC,eAAe,CAACmC,WAAW,EAAE;IACvDC,GAAG,EAAE;MACHC,EAAE,EAAER,YAAY,CAACS;;GAEb,CAAC,CAAC,CACX;AACH,CAAC,CAAC,CAAC,CAAC,eACJhD,KAAK,CAACgB,OAAO,CAACJ,aAAa,CAACC,KAAK,CAAC,CACnC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type * as Crypto from "effect/Crypto";
|
|
2
|
+
import type * as Layer from "effect/Layer";
|
|
3
|
+
/**
|
|
4
|
+
* Layer that provides the Bun Crypto service implementation.
|
|
5
|
+
*
|
|
6
|
+
* @category layers
|
|
7
|
+
* @since 1.0.0
|
|
8
|
+
*/
|
|
9
|
+
export declare const layer: Layer.Layer<Crypto.Crypto>;
|
|
10
|
+
//# sourceMappingURL=BunCrypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BunCrypto.d.ts","sourceRoot":"","sources":["../src/BunCrypto.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAoB,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `BunCrypto` module provides Bun's `Crypto` service layer for Effect
|
|
3
|
+
* programs. Provide {@link layer} at the edge of a Bun app, CLI, script, or
|
|
4
|
+
* test to satisfy `effect/Crypto` with cryptographically secure random bytes,
|
|
5
|
+
* UUID generation, random values, and SHA digest operations.
|
|
6
|
+
*
|
|
7
|
+
* This adapter reuses the shared Node-compatible implementation, so randomness
|
|
8
|
+
* and digest behavior follow Bun's `node:crypto` compatibility layer. SHA-1 is
|
|
9
|
+
* present for interoperability with existing protocols, not for new
|
|
10
|
+
* security-sensitive designs.
|
|
11
|
+
*
|
|
12
|
+
* @since 1.0.0
|
|
13
|
+
*/
|
|
14
|
+
import * as NodeCrypto from "@effect/platform-node-shared/NodeCrypto";
|
|
15
|
+
/**
|
|
16
|
+
* Layer that provides the Bun Crypto service implementation.
|
|
17
|
+
*
|
|
18
|
+
* @category layers
|
|
19
|
+
* @since 1.0.0
|
|
20
|
+
*/
|
|
21
|
+
export const layer = NodeCrypto.layer;
|
|
22
|
+
//# sourceMappingURL=BunCrypto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BunCrypto.js","names":["NodeCrypto","layer"],"sources":["../src/BunCrypto.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;AAaA,OAAO,KAAKA,UAAU,MAAM,yCAAyC;AAIrE;;;;;;AAMA,OAAO,MAAMC,KAAK,GAA+BD,UAAU,CAACC,KAAK","ignoreList":[]}
|
package/dist/BunFileSystem.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { FileSystem } from "effect/FileSystem";
|
|
2
2
|
import type * as Layer from "effect/Layer";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Layer that provides the `FileSystem` service for Bun using the shared Node file-system implementation.
|
|
5
|
+
*
|
|
6
|
+
* @category layers
|
|
7
|
+
* @since 4.0.0
|
|
6
8
|
*/
|
|
7
9
|
export declare const layer: Layer.Layer<FileSystem, never, never>;
|
|
8
10
|
//# sourceMappingURL=BunFileSystem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunFileSystem.d.ts","sourceRoot":"","sources":["../src/BunFileSystem.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BunFileSystem.d.ts","sourceRoot":"","sources":["../src/BunFileSystem.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAwB,CAAA"}
|
package/dist/BunFileSystem.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Bun layer for Effect's `FileSystem` service.
|
|
3
|
+
*
|
|
4
|
+
* This module exposes one `layer` that provides `FileSystem` in Bun by using
|
|
5
|
+
* the shared Node file-system implementation. Once the layer is provided,
|
|
6
|
+
* programs use the standard `effect/FileSystem` service operations.
|
|
7
|
+
*
|
|
8
|
+
* @since 4.0.0
|
|
3
9
|
*/
|
|
4
10
|
import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem";
|
|
5
11
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
12
|
+
* Layer that provides the `FileSystem` service for Bun using the shared Node file-system implementation.
|
|
13
|
+
*
|
|
14
|
+
* @category layers
|
|
15
|
+
* @since 4.0.0
|
|
8
16
|
*/
|
|
9
17
|
export const layer = NodeFileSystem.layer;
|
|
10
18
|
//# sourceMappingURL=BunFileSystem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunFileSystem.js","names":["NodeFileSystem","layer"],"sources":["../src/BunFileSystem.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"BunFileSystem.js","names":["NodeFileSystem","layer"],"sources":["../src/BunFileSystem.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;AASA,OAAO,KAAKA,cAAc,MAAM,6CAA6C;AAI7E;;;;;;AAMA,OAAO,MAAMC,KAAK,GAA0CD,cAAc,CAACC,KAAK","ignoreList":[]}
|
package/dist/BunHttpClient.d.ts
CHANGED
package/dist/BunHttpClient.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as Layer from "effect/Layer";
|
|
2
2
|
import * as Platform from "effect/unstable/http/HttpPlatform";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Layer that provides the Bun `HttpPlatform`, including file responses backed by `Bun.file`.
|
|
5
|
+
*
|
|
6
|
+
* @category layers
|
|
7
|
+
* @since 4.0.0
|
|
6
8
|
*/
|
|
7
9
|
export declare const layer: Layer.Layer<Platform.HttpPlatform, never, never>;
|
|
8
10
|
//# sourceMappingURL=BunHttpPlatform.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunHttpPlatform.d.ts","sourceRoot":"","sources":["../src/BunHttpPlatform.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BunHttpPlatform.d.ts","sourceRoot":"","sources":["../src/BunHttpPlatform.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAErC,OAAO,KAAK,QAAQ,MAAM,mCAAmC,CAAA;AAyB7D;;;;;GAKG;AACH,eAAO,MAAM,KAAK,kDAGjB,CAAA"}
|
package/dist/BunHttpPlatform.js
CHANGED
|
@@ -4,8 +4,8 @@ import * as Platform from "effect/unstable/http/HttpPlatform";
|
|
|
4
4
|
import * as Response from "effect/unstable/http/HttpServerResponse";
|
|
5
5
|
import * as BunFileSystem from "./BunFileSystem.js";
|
|
6
6
|
/**
|
|
7
|
-
* @since 1.0.0
|
|
8
7
|
* @category constructors
|
|
8
|
+
* @since 4.0.0
|
|
9
9
|
*/
|
|
10
10
|
const make = /*#__PURE__*/Platform.make({
|
|
11
11
|
fileResponse(path, status, statusText, headers, start, end, _contentLength) {
|
|
@@ -28,8 +28,10 @@ const make = /*#__PURE__*/Platform.make({
|
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* Layer that provides the Bun `HttpPlatform`, including file responses backed by `Bun.file`.
|
|
32
|
+
*
|
|
33
|
+
* @category layers
|
|
34
|
+
* @since 4.0.0
|
|
33
35
|
*/
|
|
34
36
|
export const layer = /*#__PURE__*/Layer.effect(Platform.HttpPlatform)(make).pipe(/*#__PURE__*/Layer.provide(BunFileSystem.layer), /*#__PURE__*/Layer.provide(Etag.layer));
|
|
35
37
|
//# sourceMappingURL=BunHttpPlatform.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BunHttpPlatform.js","names":["Layer","Etag","Platform","Response","BunFileSystem","make","fileResponse","path","status","statusText","headers","start","end","_contentLength","file","Bun","undefined","slice","raw","fileWebResponse","_options","layer","effect","HttpPlatform","pipe","provide"],"sources":["../src/BunHttpPlatform.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"BunHttpPlatform.js","names":["Layer","Etag","Platform","Response","BunFileSystem","make","fileResponse","path","status","statusText","headers","start","end","_contentLength","file","Bun","undefined","slice","raw","fileWebResponse","_options","layer","effect","HttpPlatform","pipe","provide"],"sources":["../src/BunHttpPlatform.ts"],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