the-moby-effect 1.48.0 → 1.48.2
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/cjs/Callbacks.js.map +1 -1
- package/dist/cjs/DindEngine.js.map +1 -1
- package/dist/cjs/DockerEngine.js +1 -1
- package/dist/cjs/DockerEngine.js.map +1 -1
- package/dist/cjs/MobyConnection.js.map +1 -1
- package/dist/cjs/MobyDemux.js +301 -66
- package/dist/cjs/MobyDemux.js.map +1 -1
- package/dist/cjs/MobyPlatforms.js +3 -3
- package/dist/cjs/MobyPlatforms.js.map +1 -1
- package/dist/cjs/internal/convey/sinks.js.map +1 -1
- package/dist/cjs/internal/demux/compressed.js +1 -4
- package/dist/cjs/internal/demux/compressed.js.map +1 -1
- package/dist/cjs/internal/demux/demux.js.map +1 -1
- package/dist/cjs/internal/demux/fan.js +1 -4
- package/dist/cjs/internal/demux/fan.js.map +1 -1
- package/dist/cjs/internal/demux/hijack.js +4 -44
- package/dist/cjs/internal/demux/hijack.js.map +1 -1
- package/dist/cjs/internal/demux/multiplexed.js +22 -97
- package/dist/cjs/internal/demux/multiplexed.js.map +1 -1
- package/dist/cjs/internal/demux/pack.js +1 -4
- package/dist/cjs/internal/demux/pack.js.map +1 -1
- package/dist/cjs/internal/demux/raw.js +27 -115
- package/dist/cjs/internal/demux/raw.js.map +1 -1
- package/dist/cjs/internal/demux/stdio.js +2 -30
- package/dist/cjs/internal/demux/stdio.js.map +1 -1
- package/dist/cjs/internal/endpoints/configs.js.map +1 -1
- package/dist/cjs/internal/endpoints/containers.js +3 -4
- package/dist/cjs/internal/endpoints/containers.js.map +1 -1
- package/dist/cjs/internal/endpoints/distribution.js.map +1 -1
- package/dist/cjs/internal/endpoints/execs.js +2 -2
- package/dist/cjs/internal/endpoints/execs.js.map +1 -1
- package/dist/cjs/internal/endpoints/images.js.map +1 -1
- package/dist/cjs/internal/endpoints/networks.js.map +1 -1
- package/dist/cjs/internal/endpoints/nodes.js.map +1 -1
- package/dist/cjs/internal/endpoints/plugins.js.map +1 -1
- package/dist/cjs/internal/endpoints/secrets.js.map +1 -1
- package/dist/cjs/internal/endpoints/services.js.map +1 -1
- package/dist/cjs/internal/endpoints/session.js.map +1 -1
- package/dist/cjs/internal/endpoints/swarm.js.map +1 -1
- package/dist/cjs/internal/endpoints/system.js.map +1 -1
- package/dist/cjs/internal/endpoints/tasks.js.map +1 -1
- package/dist/cjs/internal/endpoints/volumes.js.map +1 -1
- package/dist/cjs/internal/engines/dind.js.map +1 -1
- package/dist/cjs/internal/engines/docker.js +32 -36
- package/dist/cjs/internal/engines/docker.js.map +1 -1
- package/dist/cjs/internal/engines/dockerCompose.js +1 -1
- package/dist/cjs/internal/engines/dockerCompose.js.map +1 -1
- package/dist/cjs/internal/platforms/agnostic.js +6 -6
- package/dist/cjs/internal/platforms/agnostic.js.map +1 -1
- package/dist/cjs/internal/platforms/fetch.js +1 -1
- package/dist/cjs/internal/platforms/fetch.js.map +1 -1
- package/dist/cjs/internal/platforms/node.js +1 -1
- package/dist/cjs/internal/platforms/node.js.map +1 -1
- package/dist/cjs/internal/platforms/undici.js +1 -1
- package/dist/cjs/internal/platforms/undici.js.map +1 -1
- package/dist/cjs/internal/platforms/web.js +1 -1
- package/dist/cjs/internal/platforms/web.js.map +1 -1
- package/dist/cjs/internal/schemas/cidrBlock.js.map +1 -1
- package/dist/dts/Callbacks.d.ts +6 -6
- package/dist/dts/Callbacks.d.ts.map +1 -1
- package/dist/dts/DindEngine.d.ts +1 -1
- package/dist/dts/DindEngine.d.ts.map +1 -1
- package/dist/dts/DockerEngine.d.ts +14 -14
- package/dist/dts/DockerEngine.d.ts.map +1 -1
- package/dist/dts/MobyConnection.d.ts +3 -3
- package/dist/dts/MobyConnection.d.ts.map +1 -1
- package/dist/dts/MobyDemux.d.ts +631 -12
- package/dist/dts/MobyDemux.d.ts.map +1 -1
- package/dist/dts/MobyPlatforms.d.ts +3 -5
- package/dist/dts/MobyPlatforms.d.ts.map +1 -1
- package/dist/dts/Promises.d.ts +3 -3
- package/dist/dts/internal/blobs/constants.d.ts +5 -1
- package/dist/dts/internal/blobs/constants.d.ts.map +1 -1
- package/dist/dts/internal/demux/compressed.d.ts +1 -10
- package/dist/dts/internal/demux/compressed.d.ts.map +1 -1
- package/dist/dts/internal/demux/demux.d.ts +2 -3
- package/dist/dts/internal/demux/demux.d.ts.map +1 -1
- package/dist/dts/internal/demux/fan.d.ts +1 -25
- package/dist/dts/internal/demux/fan.d.ts.map +1 -1
- package/dist/dts/internal/demux/hijack.d.ts +1 -53
- package/dist/dts/internal/demux/hijack.d.ts.map +1 -1
- package/dist/dts/internal/demux/multiplexed.d.ts +1 -217
- package/dist/dts/internal/demux/multiplexed.d.ts.map +1 -1
- package/dist/dts/internal/demux/pack.d.ts +1 -16
- package/dist/dts/internal/demux/pack.d.ts.map +1 -1
- package/dist/dts/internal/demux/raw.d.ts +1 -364
- package/dist/dts/internal/demux/raw.d.ts.map +1 -1
- package/dist/dts/internal/demux/stdio.d.ts +0 -44
- package/dist/dts/internal/demux/stdio.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/configs.d.ts +4 -4
- package/dist/dts/internal/endpoints/configs.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/containers.d.ts +7 -8
- package/dist/dts/internal/endpoints/containers.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/distribution.d.ts +4 -4
- package/dist/dts/internal/endpoints/distribution.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/execs.d.ts +7 -8
- package/dist/dts/internal/endpoints/execs.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/images.d.ts +4 -4
- package/dist/dts/internal/endpoints/images.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/networks.d.ts +4 -4
- package/dist/dts/internal/endpoints/networks.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/nodes.d.ts +4 -4
- package/dist/dts/internal/endpoints/nodes.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/plugins.d.ts +5 -5
- package/dist/dts/internal/endpoints/plugins.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/secrets.d.ts +4 -4
- package/dist/dts/internal/endpoints/secrets.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/services.d.ts +4 -4
- package/dist/dts/internal/endpoints/services.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/session.d.ts +3 -3
- package/dist/dts/internal/endpoints/session.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/swarm.d.ts +4 -4
- package/dist/dts/internal/endpoints/swarm.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/system.d.ts +4 -4
- package/dist/dts/internal/endpoints/system.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/tasks.d.ts +3 -3
- package/dist/dts/internal/endpoints/tasks.d.ts.map +1 -1
- package/dist/dts/internal/endpoints/volumes.d.ts +4 -4
- package/dist/dts/internal/endpoints/volumes.d.ts.map +1 -1
- package/dist/dts/internal/generated/ContainerCreateRequest.generated.d.ts +3 -3
- package/dist/dts/internal/generated/ContainerHostConfig.generated.d.ts +3 -3
- package/dist/dts/internal/generated/ContainerPathStat.generated.d.ts +2 -2
- package/dist/dts/internal/generated/PluginPrivilege.generated.d.ts +2 -2
- package/dist/dts/internal/generated/SystemRuntimeWithStatus.generated.d.ts +2 -2
- package/dist/dts/internal/schemas/cidrBlock.d.ts +2 -2
- package/dist/dts/internal/schemas/cidrBlock.d.ts.map +1 -1
- package/dist/esm/Callbacks.js.map +1 -1
- package/dist/esm/DindEngine.js.map +1 -1
- package/dist/esm/DockerEngine.js +1 -1
- package/dist/esm/DockerEngine.js.map +1 -1
- package/dist/esm/MobyConnection.js.map +1 -1
- package/dist/esm/MobyDemux.js +292 -12
- package/dist/esm/MobyDemux.js.map +1 -1
- package/dist/esm/MobyPlatforms.js +2 -3
- package/dist/esm/MobyPlatforms.js.map +1 -1
- package/dist/esm/internal/convey/sinks.js.map +1 -1
- package/dist/esm/internal/demux/compressed.js +1 -4
- package/dist/esm/internal/demux/compressed.js.map +1 -1
- package/dist/esm/internal/demux/demux.js.map +1 -1
- package/dist/esm/internal/demux/fan.js +1 -4
- package/dist/esm/internal/demux/fan.js.map +1 -1
- package/dist/esm/internal/demux/hijack.js +4 -44
- package/dist/esm/internal/demux/hijack.js.map +1 -1
- package/dist/esm/internal/demux/multiplexed.js +22 -97
- package/dist/esm/internal/demux/multiplexed.js.map +1 -1
- package/dist/esm/internal/demux/pack.js +1 -4
- package/dist/esm/internal/demux/pack.js.map +1 -1
- package/dist/esm/internal/demux/raw.js +24 -112
- package/dist/esm/internal/demux/raw.js.map +1 -1
- package/dist/esm/internal/demux/stdio.js +2 -30
- package/dist/esm/internal/demux/stdio.js.map +1 -1
- package/dist/esm/internal/endpoints/configs.js.map +1 -1
- package/dist/esm/internal/endpoints/containers.js +3 -4
- package/dist/esm/internal/endpoints/containers.js.map +1 -1
- package/dist/esm/internal/endpoints/distribution.js.map +1 -1
- package/dist/esm/internal/endpoints/execs.js +2 -2
- package/dist/esm/internal/endpoints/execs.js.map +1 -1
- package/dist/esm/internal/endpoints/images.js.map +1 -1
- package/dist/esm/internal/endpoints/networks.js.map +1 -1
- package/dist/esm/internal/endpoints/nodes.js.map +1 -1
- package/dist/esm/internal/endpoints/plugins.js.map +1 -1
- package/dist/esm/internal/endpoints/secrets.js.map +1 -1
- package/dist/esm/internal/endpoints/services.js.map +1 -1
- package/dist/esm/internal/endpoints/session.js.map +1 -1
- package/dist/esm/internal/endpoints/swarm.js.map +1 -1
- package/dist/esm/internal/endpoints/system.js.map +1 -1
- package/dist/esm/internal/endpoints/tasks.js.map +1 -1
- package/dist/esm/internal/endpoints/volumes.js.map +1 -1
- package/dist/esm/internal/engines/dind.js.map +1 -1
- package/dist/esm/internal/engines/docker.js +32 -36
- package/dist/esm/internal/engines/docker.js.map +1 -1
- package/dist/esm/internal/engines/dockerCompose.js +1 -1
- package/dist/esm/internal/engines/dockerCompose.js.map +1 -1
- package/dist/esm/internal/platforms/agnostic.js +3 -3
- package/dist/esm/internal/platforms/agnostic.js.map +1 -1
- package/dist/esm/internal/platforms/fetch.js +1 -1
- package/dist/esm/internal/platforms/fetch.js.map +1 -1
- package/dist/esm/internal/platforms/needs.js +1 -0
- package/dist/esm/internal/platforms/needs.js.map +1 -1
- package/dist/esm/internal/platforms/node.js +1 -1
- package/dist/esm/internal/platforms/node.js.map +1 -1
- package/dist/esm/internal/platforms/undici.js +1 -1
- package/dist/esm/internal/platforms/undici.js.map +1 -1
- package/dist/esm/internal/platforms/web.js +1 -1
- package/dist/esm/internal/platforms/web.js.map +1 -1
- package/dist/esm/internal/schemas/cidrBlock.js.map +1 -1
- package/package.json +23 -12
- package/src/Callbacks.ts +4 -4
- package/src/DindEngine.ts +1 -2
- package/src/DockerEngine.ts +25 -27
- package/src/MobyConnection.ts +3 -4
- package/src/MobyDemux.ts +749 -12
- package/src/MobyPlatforms.ts +11 -5
- package/src/internal/blobs/constants.ts +4 -1
- package/src/internal/convey/sinks.ts +1 -2
- package/src/internal/demux/compressed.ts +6 -19
- package/src/internal/demux/demux.ts +6 -10
- package/src/internal/demux/fan.ts +16 -25
- package/src/internal/demux/hijack.ts +11 -50
- package/src/internal/demux/multiplexed.ts +55 -205
- package/src/internal/demux/pack.ts +9 -16
- package/src/internal/demux/raw.ts +66 -336
- package/src/internal/demux/stdio.ts +7 -39
- package/src/internal/endpoints/configs.ts +5 -4
- package/src/internal/endpoints/containers.ts +10 -11
- package/src/internal/endpoints/distribution.ts +5 -4
- package/src/internal/endpoints/execs.ts +18 -11
- package/src/internal/endpoints/images.ts +5 -4
- package/src/internal/endpoints/networks.ts +5 -4
- package/src/internal/endpoints/nodes.ts +5 -4
- package/src/internal/endpoints/plugins.ts +6 -5
- package/src/internal/endpoints/secrets.ts +5 -4
- package/src/internal/endpoints/services.ts +5 -4
- package/src/internal/endpoints/session.ts +4 -3
- package/src/internal/endpoints/swarm.ts +5 -4
- package/src/internal/endpoints/system.ts +5 -4
- package/src/internal/endpoints/tasks.ts +4 -3
- package/src/internal/endpoints/volumes.ts +5 -4
- package/src/internal/engines/dind.ts +3 -4
- package/src/internal/engines/docker.ts +23 -32
- package/src/internal/engines/dockerCompose.ts +2 -2
- package/src/internal/platforms/agnostic.ts +3 -3
- package/src/internal/platforms/fetch.ts +1 -1
- package/src/internal/platforms/needs.ts +2 -0
- package/src/internal/platforms/node.ts +1 -1
- package/src/internal/platforms/undici.ts +1 -1
- package/src/internal/platforms/web.ts +1 -1
- package/src/internal/schemas/cidrBlock.ts +2 -1
|
@@ -1,23 +1,22 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Socket from "@effect/platform/Socket";
|
|
8
11
|
import * as Effect from "effect/Effect";
|
|
9
12
|
import * as Function from "effect/Function";
|
|
10
|
-
import * as Layer from "effect/Layer";
|
|
11
13
|
import * as Option from "effect/Option";
|
|
12
|
-
import * as ParseResult from "effect/ParseResult";
|
|
13
14
|
import * as Predicate from "effect/Predicate";
|
|
14
15
|
import * as Schema from "effect/Schema";
|
|
15
16
|
import * as Stream from "effect/Stream";
|
|
16
17
|
import * as Tuple from "effect/Tuple";
|
|
18
|
+
import * as MobyDemux from "../../MobyDemux.js";
|
|
17
19
|
|
|
18
|
-
import { responseToStreamingSocketOrFailUnsafe } from "../demux/hijack.js";
|
|
19
|
-
import { MultiplexedSocket } from "../demux/multiplexed.js";
|
|
20
|
-
import { makeRawSocket, RawSocket } from "../demux/raw.js";
|
|
21
20
|
import {
|
|
22
21
|
ContainerChange,
|
|
23
22
|
ContainerConfig,
|
|
@@ -431,7 +430,7 @@ export class Containers extends Effect.Service<Containers>()("@the-moby-effect/e
|
|
|
431
430
|
readonly stderr?: boolean | undefined;
|
|
432
431
|
}
|
|
433
432
|
| undefined
|
|
434
|
-
): Effect.Effect<RawSocket | MultiplexedSocket, ContainersError, never> =>
|
|
433
|
+
): Effect.Effect<MobyDemux.RawSocket | MobyDemux.MultiplexedSocket, ContainersError, never> =>
|
|
435
434
|
Function.pipe(
|
|
436
435
|
HttpClientRequest.post(`/containers/${encodeURIComponent(id)}/attach`),
|
|
437
436
|
HttpClientRequest.setHeader("Upgrade", "tcp"),
|
|
@@ -443,7 +442,7 @@ export class Containers extends Effect.Service<Containers>()("@the-moby-effect/e
|
|
|
443
442
|
maybeAddQueryParameter("stdout", Option.fromNullable(options?.stdout)),
|
|
444
443
|
maybeAddQueryParameter("stderr", Option.fromNullable(options?.stderr)),
|
|
445
444
|
maybeUpgradedClient.execute,
|
|
446
|
-
Effect.flatMap(responseToStreamingSocketOrFailUnsafe),
|
|
445
|
+
Effect.flatMap(MobyDemux.responseToStreamingSocketOrFailUnsafe),
|
|
447
446
|
Effect.mapError((cause) => new ContainersError({ method: "attach", cause }))
|
|
448
447
|
);
|
|
449
448
|
|
|
@@ -460,7 +459,7 @@ export class Containers extends Effect.Service<Containers>()("@the-moby-effect/e
|
|
|
460
459
|
readonly stderr?: boolean | undefined;
|
|
461
460
|
}
|
|
462
461
|
| undefined
|
|
463
|
-
): Effect.Effect<RawSocket, ContainersError, never> =>
|
|
462
|
+
): Effect.Effect<MobyDemux.RawSocket, ContainersError, never> =>
|
|
464
463
|
Function.pipe(
|
|
465
464
|
HttpClientRequest.get(`/containers/${encodeURIComponent(id)}/attach/ws`),
|
|
466
465
|
maybeAddQueryParameter("detachKeys", Option.fromNullable(options?.detachKeys)),
|
|
@@ -470,7 +469,7 @@ export class Containers extends Effect.Service<Containers>()("@the-moby-effect/e
|
|
|
470
469
|
maybeAddQueryParameter("stdout", Option.fromNullable(options?.stdout)),
|
|
471
470
|
maybeAddQueryParameter("stderr", Option.fromNullable(options?.stderr)),
|
|
472
471
|
websocketRequest,
|
|
473
|
-
Effect.map(makeRawSocket),
|
|
472
|
+
Effect.map(MobyDemux.makeRawSocket),
|
|
474
473
|
Effect.provideService(HttpClient.HttpClient, contextClient),
|
|
475
474
|
Effect.provideService(Socket.WebSocketConstructor, websocketConstructor),
|
|
476
475
|
Effect.mapError((cause) => new ContainersError({ method: "attachWebsocket", cause }))
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Effect from "effect/Effect";
|
|
8
11
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
|
-
import * as ParseResult from "effect/ParseResult";
|
|
11
12
|
import * as Predicate from "effect/Predicate";
|
|
12
13
|
|
|
13
14
|
import { RegistryDistributionInspect } from "../generated/index.js";
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Socket from "@effect/platform/Socket";
|
|
4
|
+
import type * as Layer from "effect/Layer";
|
|
5
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
6
|
+
|
|
1
7
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
8
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
9
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
10
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
|
-
import * as Socket from "@effect/platform/Socket";
|
|
8
11
|
import * as Effect from "effect/Effect";
|
|
9
12
|
import * as Function from "effect/Function";
|
|
10
|
-
import * as Layer from "effect/Layer";
|
|
11
13
|
import * as Option from "effect/Option";
|
|
12
|
-
import * as ParseResult from "effect/ParseResult";
|
|
13
14
|
import * as Predicate from "effect/Predicate";
|
|
14
15
|
import * as Schema from "effect/Schema";
|
|
15
16
|
import * as Tuple from "effect/Tuple";
|
|
17
|
+
import * as MobyDemux from "../../MobyDemux.js";
|
|
16
18
|
|
|
17
|
-
import { responseToStreamingSocketOrFailUnsafe } from "../demux/hijack.js";
|
|
18
|
-
import { MultiplexedSocket } from "../demux/multiplexed.js";
|
|
19
|
-
import { RawSocket } from "../demux/raw.js";
|
|
20
19
|
import {
|
|
21
20
|
ContainerExecOptions as ContainerExecStartConfig,
|
|
22
21
|
ContainerExecOptions as ExecConfig,
|
|
@@ -111,8 +110,16 @@ export class Execs extends Effect.Service<Execs>()("@the-moby-effect/endpoints/E
|
|
|
111
110
|
const start_ = <T extends boolean | undefined = undefined>(
|
|
112
111
|
id: string,
|
|
113
112
|
execStartConfig: Omit<typeof ContainerExecStartConfig.Encoded, "Detach"> & { Detach?: T }
|
|
114
|
-
): Effect.Effect<
|
|
115
|
-
|
|
113
|
+
): Effect.Effect<
|
|
114
|
+
T extends true ? void : MobyDemux.MultiplexedSocket | MobyDemux.RawSocket,
|
|
115
|
+
ExecsError,
|
|
116
|
+
never
|
|
117
|
+
> => {
|
|
118
|
+
type U = Effect.Effect<
|
|
119
|
+
T extends true ? void : MobyDemux.MultiplexedSocket | MobyDemux.RawSocket,
|
|
120
|
+
ExecsError,
|
|
121
|
+
never
|
|
122
|
+
>;
|
|
116
123
|
|
|
117
124
|
const response = Function.pipe(
|
|
118
125
|
Schema.decode(ContainerExecStartConfig)(execStartConfig),
|
|
@@ -125,7 +132,7 @@ export class Execs extends Effect.Service<Execs>()("@the-moby-effect/endpoints/E
|
|
|
125
132
|
);
|
|
126
133
|
|
|
127
134
|
const toStreamingSock = Function.compose(
|
|
128
|
-
responseToStreamingSocketOrFailUnsafe,
|
|
135
|
+
MobyDemux.responseToStreamingSocketOrFailUnsafe,
|
|
129
136
|
Effect.mapError((cause) => new ExecsError({ method: "start", cause }))
|
|
130
137
|
);
|
|
131
138
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Effect from "effect/Effect";
|
|
8
11
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
12
|
import * as Option from "effect/Option";
|
|
11
|
-
import * as ParseResult from "effect/ParseResult";
|
|
12
13
|
import * as Predicate from "effect/Predicate";
|
|
13
14
|
import * as Schema from "effect/Schema";
|
|
14
15
|
import * as Stream from "effect/Stream";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Effect from "effect/Effect";
|
|
8
11
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
12
|
import * as Option from "effect/Option";
|
|
11
|
-
import * as ParseResult from "effect/ParseResult";
|
|
12
13
|
import * as Predicate from "effect/Predicate";
|
|
13
14
|
import * as Schema from "effect/Schema";
|
|
14
15
|
import * as Tuple from "effect/Tuple";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Effect from "effect/Effect";
|
|
8
11
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
12
|
import * as Option from "effect/Option";
|
|
11
|
-
import * as ParseResult from "effect/ParseResult";
|
|
12
13
|
import * as Predicate from "effect/Predicate";
|
|
13
14
|
import * as Schema from "effect/Schema";
|
|
14
15
|
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
import type * as Stream from "effect/Stream";
|
|
6
|
+
|
|
1
7
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
8
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
9
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
10
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
11
|
import * as Effect from "effect/Effect";
|
|
8
12
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
13
|
import * as Option from "effect/Option";
|
|
11
|
-
import * as ParseResult from "effect/ParseResult";
|
|
12
14
|
import * as Predicate from "effect/Predicate";
|
|
13
15
|
import * as Schema from "effect/Schema";
|
|
14
|
-
import * as Stream from "effect/Stream";
|
|
15
16
|
|
|
16
17
|
import { Plugin, PluginPrivilege } from "../generated/index.js";
|
|
17
18
|
import { maybeAddHeader, maybeAddQueryParameter } from "./common.js";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Effect from "effect/Effect";
|
|
8
11
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
12
|
import * as Option from "effect/Option";
|
|
11
|
-
import * as ParseResult from "effect/ParseResult";
|
|
12
13
|
import * as Predicate from "effect/Predicate";
|
|
13
14
|
import * as Schema from "effect/Schema";
|
|
14
15
|
import * as Tuple from "effect/Tuple";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Effect from "effect/Effect";
|
|
8
11
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
12
|
import * as Option from "effect/Option";
|
|
11
|
-
import * as ParseResult from "effect/ParseResult";
|
|
12
13
|
import * as Predicate from "effect/Predicate";
|
|
13
14
|
import * as Schema from "effect/Schema";
|
|
14
15
|
import * as Stream from "effect/Stream";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
2
|
+
import type * as Socket from "@effect/platform/Socket";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
|
|
1
5
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
6
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
3
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
4
7
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
5
|
-
import * as Socket from "@effect/platform/Socket";
|
|
6
8
|
import * as Effect from "effect/Effect";
|
|
7
9
|
import * as Function from "effect/Function";
|
|
8
|
-
import * as Layer from "effect/Layer";
|
|
9
10
|
import * as Predicate from "effect/Predicate";
|
|
10
11
|
|
|
11
12
|
import { hijackResponseUnsafe } from "../demux/hijack.js";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Effect from "effect/Effect";
|
|
8
11
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
12
|
import * as Option from "effect/Option";
|
|
11
|
-
import * as ParseResult from "effect/ParseResult";
|
|
12
13
|
import * as Predicate from "effect/Predicate";
|
|
13
14
|
import * as Schema from "effect/Schema";
|
|
14
15
|
import * as Tuple from "effect/Tuple";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Effect from "effect/Effect";
|
|
8
11
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
12
|
import * as Option from "effect/Option";
|
|
11
|
-
import * as ParseResult from "effect/ParseResult";
|
|
12
13
|
import * as Predicate from "effect/Predicate";
|
|
13
14
|
import * as Schema from "effect/Schema";
|
|
14
15
|
import * as Stream from "effect/Stream";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
2
|
+
import type * as Layer from "effect/Layer";
|
|
3
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
4
|
+
|
|
1
5
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
6
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
3
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
4
7
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
5
8
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
6
9
|
import * as Effect from "effect/Effect";
|
|
7
10
|
import * as Function from "effect/Function";
|
|
8
|
-
import * as Layer from "effect/Layer";
|
|
9
11
|
import * as Option from "effect/Option";
|
|
10
|
-
import * as ParseResult from "effect/ParseResult";
|
|
11
12
|
import * as Predicate from "effect/Predicate";
|
|
12
13
|
import * as Schema from "effect/Schema";
|
|
13
14
|
import * as Stream from "effect/Stream";
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
+
import type * as HttpBody from "@effect/platform/HttpBody";
|
|
2
|
+
import type * as HttpClientError from "@effect/platform/HttpClientError";
|
|
3
|
+
import type * as Layer from "effect/Layer";
|
|
4
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
5
|
+
|
|
1
6
|
import * as PlatformError from "@effect/platform/Error";
|
|
2
|
-
import * as HttpBody from "@effect/platform/HttpBody";
|
|
3
7
|
import * as HttpClient from "@effect/platform/HttpClient";
|
|
4
|
-
import * as HttpClientError from "@effect/platform/HttpClientError";
|
|
5
8
|
import * as HttpClientRequest from "@effect/platform/HttpClientRequest";
|
|
6
9
|
import * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
10
|
import * as Effect from "effect/Effect";
|
|
8
11
|
import * as Function from "effect/Function";
|
|
9
|
-
import * as Layer from "effect/Layer";
|
|
10
12
|
import * as Option from "effect/Option";
|
|
11
|
-
import * as ParseResult from "effect/ParseResult";
|
|
12
13
|
import * as Predicate from "effect/Predicate";
|
|
13
14
|
import * as Schema from "effect/Schema";
|
|
14
15
|
import * as Tuple from "effect/Tuple";
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type * as PlatformError from "@effect/platform/Error";
|
|
2
2
|
import type * as ParseResult from "effect/ParseResult";
|
|
3
|
+
import type * as Schema from "effect/Schema";
|
|
3
4
|
import type * as Scope from "effect/Scope";
|
|
5
|
+
import type * as TarCommon from "eftar/Common";
|
|
4
6
|
import type * as DindEngine from "../../DindEngine.js";
|
|
7
|
+
import type * as BlobConstants from "../blobs/constants.js";
|
|
5
8
|
|
|
6
9
|
import * as FileSystem from "@effect/platform/FileSystem";
|
|
7
10
|
import * as Path from "@effect/platform/Path";
|
|
@@ -14,18 +17,15 @@ import * as Match from "effect/Match";
|
|
|
14
17
|
import * as Number from "effect/Number";
|
|
15
18
|
import * as Option from "effect/Option";
|
|
16
19
|
import * as Schedule from "effect/Schedule";
|
|
17
|
-
import * as Schema from "effect/Schema";
|
|
18
20
|
import * as Stream from "effect/Stream";
|
|
19
21
|
import * as String from "effect/String";
|
|
20
22
|
import * as Tuple from "effect/Tuple";
|
|
21
|
-
import * as TarCommon from "eftar/Common";
|
|
22
23
|
import * as Tar from "eftar/Tar";
|
|
23
24
|
import * as Untar from "eftar/Untar";
|
|
24
25
|
import * as DockerEngine from "../../DockerEngine.js";
|
|
25
26
|
import * as MobyConnection from "../../MobyConnection.js";
|
|
26
27
|
import * as MobyConvey from "../../MobyConvey.js";
|
|
27
28
|
import * as MobyEndpoints from "../../MobyEndpoints.js";
|
|
28
|
-
import * as BlobConstants from "../blobs/constants.js";
|
|
29
29
|
import * as internalHttpBlob from "../blobs/http.js";
|
|
30
30
|
import * as internalHttpsBlob from "../blobs/https.js";
|
|
31
31
|
import * as internalSocketBlob from "../blobs/socket.js";
|
|
@@ -165,7 +165,6 @@ const waitForDindContainerToBeReady = (
|
|
|
165
165
|
export const makeDindLayerFromPlatformConstructor =
|
|
166
166
|
<
|
|
167
167
|
PlatformLayerConstructor extends (
|
|
168
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
169
168
|
connectionOptions: any
|
|
170
169
|
) => Layer.Layer<Layer.Layer.Success<DockerEngine.DockerLayer>, unknown, unknown>,
|
|
171
170
|
SupportedConnectionOptions extends MobyConnection.MobyConnectionOptions = PlatformLayerConstructor extends (
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import type * as Socket from "@effect/platform/Socket";
|
|
1
2
|
import type * as ParseResult from "effect/ParseResult";
|
|
2
3
|
import type * as Scope from "effect/Scope";
|
|
3
4
|
import type * as MobySchemas from "../../MobySchemas.js";
|
|
4
5
|
|
|
5
|
-
import * as Socket from "@effect/platform/Socket";
|
|
6
6
|
import * as Array from "effect/Array";
|
|
7
7
|
import * as Channel from "effect/Channel";
|
|
8
8
|
import * as Effect from "effect/Effect";
|
|
@@ -13,6 +13,7 @@ import * as MutableHashMap from "effect/MutableHashMap";
|
|
|
13
13
|
import * as Option from "effect/Option";
|
|
14
14
|
import * as Predicate from "effect/Predicate";
|
|
15
15
|
import * as Schedule from "effect/Schedule";
|
|
16
|
+
import * as Schema from "effect/Schema";
|
|
16
17
|
import * as Sink from "effect/Sink";
|
|
17
18
|
import * as Stream from "effect/Stream";
|
|
18
19
|
import * as Tuple from "effect/Tuple";
|
|
@@ -272,28 +273,6 @@ const execWebsocketsRegistry = Global.globalValue("the-moby-effect/engines/docke
|
|
|
272
273
|
MutableHashMap.empty<string, Effect.Semaphore>()
|
|
273
274
|
);
|
|
274
275
|
|
|
275
|
-
/** @internal */
|
|
276
|
-
const validShellEntrypoints = Global.globalValue(
|
|
277
|
-
"the-moby-effect/engines/docker/execWebsocketsValidShellEntrypoints",
|
|
278
|
-
() =>
|
|
279
|
-
new Set([
|
|
280
|
-
"/bin/sh", // Basic shell available in most containers
|
|
281
|
-
"/bin/bash", // Bash shell (common in many Linux distributions)
|
|
282
|
-
"/usr/bin/bash", // Alternative location for bash
|
|
283
|
-
"/bin/dash", // Debian Almquist shell (lightweight shell)
|
|
284
|
-
"/bin/ash", // Lightweight shell used in Alpine Linux
|
|
285
|
-
"/bin/zsh", // Z shell
|
|
286
|
-
"/usr/bin/zsh", // Alternative location for zsh
|
|
287
|
-
"/bin/ksh", // Korn shell
|
|
288
|
-
"/bin/tcsh", // TENEX C shell
|
|
289
|
-
"/bin/csh", // C shell
|
|
290
|
-
"/usr/bin/fish", // Friendly interactive shell
|
|
291
|
-
"/usr/local/bin/bash", // Alternative location for bash
|
|
292
|
-
"/usr/local/bin/sh", // Alternative location for sh
|
|
293
|
-
"/busybox/sh", // Busybox shell
|
|
294
|
-
])
|
|
295
|
-
);
|
|
296
|
-
|
|
297
276
|
/** @internal */
|
|
298
277
|
export const execWebsocketsNonBlocking = ({
|
|
299
278
|
command,
|
|
@@ -320,15 +299,27 @@ export const execWebsocketsNonBlocking = ({
|
|
|
320
299
|
const acquire = Effect.gen(function* () {
|
|
321
300
|
const inspect = yield* containers.inspect(containerId);
|
|
322
301
|
const command = Array.join(inspect.Config?.Cmd ?? [], " ");
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
302
|
+
yield* Effect.mapError(
|
|
303
|
+
Schema.decodeUnknown(
|
|
304
|
+
Schema.Literal(
|
|
305
|
+
"/bin/sh", // Basic shell available in most containers
|
|
306
|
+
"/bin/bash", // Bash shell (common in many Linux distributions)
|
|
307
|
+
"/usr/bin/bash", // Alternative location for bash
|
|
308
|
+
"/bin/dash", // Debian Almquist shell (lightweight shell)
|
|
309
|
+
"/bin/ash", // Lightweight shell used in Alpine Linux
|
|
310
|
+
"/bin/zsh", // Z shell
|
|
311
|
+
"/usr/bin/zsh", // Alternative location for zsh
|
|
312
|
+
"/bin/ksh", // Korn shell
|
|
313
|
+
"/bin/tcsh", // TENEX C shell
|
|
314
|
+
"/bin/csh", // C shell
|
|
315
|
+
"/usr/bin/fish", // Friendly interactive shell
|
|
316
|
+
"/usr/local/bin/bash", // Alternative location for bash
|
|
317
|
+
"/usr/local/bin/sh", // Alternative location for sh
|
|
318
|
+
"/busybox/sh" // Busybox shell
|
|
319
|
+
)
|
|
320
|
+
)(command),
|
|
321
|
+
(cause) => new MobyEndpoints.ContainersError({ method: "exec", cause })
|
|
322
|
+
);
|
|
332
323
|
yield* mutex.take(1);
|
|
333
324
|
});
|
|
334
325
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type * as ParseResult from "effect/ParseResult";
|
|
2
|
+
import type * as Scope from "effect/Scope";
|
|
2
3
|
import type * as DockerComposeEngine from "../../DockerComposeEngine.js";
|
|
3
4
|
|
|
4
5
|
import * as PlatformError from "@effect/platform/Error";
|
|
@@ -10,7 +11,6 @@ import * as Function from "effect/Function";
|
|
|
10
11
|
import * as Layer from "effect/Layer";
|
|
11
12
|
import * as Predicate from "effect/Predicate";
|
|
12
13
|
import * as Record from "effect/Record";
|
|
13
|
-
import * as Scope from "effect/Scope";
|
|
14
14
|
import * as Sink from "effect/Sink";
|
|
15
15
|
import * as Stream from "effect/Stream";
|
|
16
16
|
import * as String from "effect/String";
|
|
@@ -152,7 +152,7 @@ export const make: Effect.Effect<
|
|
|
152
152
|
Stream.flatMap(stream, (a: A) => Stream.fromEffect(Effect.map(effect, Function.constant(a))));
|
|
153
153
|
|
|
154
154
|
return streamFailableEnsuring(
|
|
155
|
-
MobyDemux.
|
|
155
|
+
MobyDemux.mergeRawToTaggedStream(stdout, stderr),
|
|
156
156
|
MobyDemux.demuxRawToSingleSink(stdin, Stream.make(new Socket.CloseEvent()), Sink.drain)
|
|
157
157
|
);
|
|
158
158
|
}).pipe(
|
|
@@ -72,7 +72,7 @@ export const websocketRequest = (
|
|
|
72
72
|
});
|
|
73
73
|
|
|
74
74
|
/** @internal */
|
|
75
|
-
export const
|
|
75
|
+
export const makeAgnosticHttpClientLayer = (
|
|
76
76
|
connectionOptions: MobyConnection.MobyConnectionOptions
|
|
77
77
|
): Layer.Layer<HttpClient.HttpClient, never, HttpClient.HttpClient> =>
|
|
78
78
|
Function.pipe(
|
|
@@ -110,10 +110,10 @@ export const makeAgnosticWebsocketLayer = (
|
|
|
110
110
|
);
|
|
111
111
|
|
|
112
112
|
/** @internal */
|
|
113
|
-
export const
|
|
113
|
+
export const makeAgnosticLayer = (
|
|
114
114
|
connectionOptions: MobyConnection.MobyConnectionOptions
|
|
115
115
|
): Layer.Layer<Socket.WebSocketConstructor | HttpClient.HttpClient, never, HttpClient.HttpClient> => {
|
|
116
|
-
const httpClientLayer =
|
|
116
|
+
const httpClientLayer = makeAgnosticHttpClientLayer(connectionOptions);
|
|
117
117
|
const websocketLayer = makeAgnosticWebsocketLayer(connectionOptions);
|
|
118
118
|
return Layer.merge(websocketLayer, httpClientLayer);
|
|
119
119
|
};
|
|
@@ -10,4 +10,4 @@ import * as internalAgnostic from "./agnostic.js";
|
|
|
10
10
|
export const makeFetchHttpClientLayer = (
|
|
11
11
|
connectionOptions: MobyConnection.HttpConnectionOptionsTagged | MobyConnection.HttpsConnectionOptionsTagged
|
|
12
12
|
): Layer.Layer<HttpClient.HttpClient | Socket.WebSocketConstructor, never, never> =>
|
|
13
|
-
Layer.provide(internalAgnostic.
|
|
13
|
+
Layer.provide(internalAgnostic.makeAgnosticLayer(connectionOptions), FetchHttpClient.layer);
|
|
@@ -155,6 +155,6 @@ export const makeNodeHttpClientLayer = (
|
|
|
155
155
|
),
|
|
156
156
|
Layer.unwrapEffect
|
|
157
157
|
);
|
|
158
|
-
const agnosticHttpClientLayer = internalAgnostic.
|
|
158
|
+
const agnosticHttpClientLayer = internalAgnostic.makeAgnosticLayer(connectionOptions);
|
|
159
159
|
return Layer.provide(agnosticHttpClientLayer, nodeHttpClientLayer);
|
|
160
160
|
};
|
|
@@ -127,6 +127,6 @@ export const makeUndiciHttpClientLayer = (
|
|
|
127
127
|
Layer.unwrapEffect
|
|
128
128
|
);
|
|
129
129
|
|
|
130
|
-
const agnosticHttpClientLayer = internalAgnostic.
|
|
130
|
+
const agnosticHttpClientLayer = internalAgnostic.makeAgnosticLayer(connectionOptions);
|
|
131
131
|
return Layer.provide(agnosticHttpClientLayer, undiciLayer);
|
|
132
132
|
};
|
|
@@ -16,6 +16,6 @@ export const makeWebHttpClientLayer = (
|
|
|
16
16
|
Effect.map((browserHttpClientLazy) => browserHttpClientLazy.layerXMLHttpRequest),
|
|
17
17
|
Layer.unwrapEffect
|
|
18
18
|
);
|
|
19
|
-
const agnosticHttpClientLayer = internalAgnostic.
|
|
19
|
+
const agnosticHttpClientLayer = internalAgnostic.makeAgnosticLayer(connectionOptions);
|
|
20
20
|
return Layer.provide(agnosticHttpClientLayer, browserLayer);
|
|
21
21
|
};
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
import type * as Family from "./family.js";
|
|
8
|
+
|
|
7
9
|
import * as Array from "effect/Array";
|
|
8
10
|
import * as Effect from "effect/Effect";
|
|
9
11
|
import * as Function from "effect/Function";
|
|
@@ -12,7 +14,6 @@ import * as Schema from "effect/Schema";
|
|
|
12
14
|
import * as Stream from "effect/Stream";
|
|
13
15
|
import * as Address from "./address.js";
|
|
14
16
|
import * as CidrBlockMask from "./cidrBlockMask.js";
|
|
15
|
-
import * as Family from "./family.js";
|
|
16
17
|
import * as IPv4 from "./ipv4.js";
|
|
17
18
|
import * as IPv6 from "./ipv6.js";
|
|
18
19
|
|