the-moby-effect 1.48.0 → 1.48.1
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 +12 -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
package/dist/dts/MobyDemux.d.ts
CHANGED
|
@@ -3,16 +3,635 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @since 1.0.0
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
import type * as HttpClientResponse from "@effect/platform/HttpClientResponse";
|
|
7
|
+
import type * as Socket from "@effect/platform/Socket";
|
|
8
|
+
import type * as Channel from "effect/Channel";
|
|
9
|
+
import type * as Chunk from "effect/Chunk";
|
|
10
|
+
import type * as Effect from "effect/Effect";
|
|
11
|
+
import type * as ParseResult from "effect/ParseResult";
|
|
12
|
+
import type * as Pipeable from "effect/Pipeable";
|
|
13
|
+
import type * as Scope from "effect/Scope";
|
|
14
|
+
import type * as Sink from "effect/Sink";
|
|
15
|
+
import type * as Stream from "effect/Stream";
|
|
16
|
+
import * as internalMultiplexed from "./internal/demux/multiplexed.js";
|
|
17
|
+
import * as internalStdio from "./internal/demux/stdio.js";
|
|
18
|
+
/**
|
|
19
|
+
* @since 1.0.0
|
|
20
|
+
* @category Types
|
|
21
|
+
*/
|
|
22
|
+
export declare const RawContentType: "application/vnd.docker.raw-stream";
|
|
23
|
+
/**
|
|
24
|
+
* @since 1.0.0
|
|
25
|
+
* @category Types
|
|
26
|
+
*/
|
|
27
|
+
export declare const MultiplexedContentType: "application/vnd.docker.multiplexed-stream";
|
|
28
|
+
/**
|
|
29
|
+
* @since 1.0.0
|
|
30
|
+
* @category Type ids
|
|
31
|
+
*/
|
|
32
|
+
export declare const RawSocketTypeId: unique symbol;
|
|
33
|
+
/**
|
|
34
|
+
* @since 1.0.0
|
|
35
|
+
* @category Type ids
|
|
36
|
+
*/
|
|
37
|
+
export type RawSocketTypeId = typeof RawSocketTypeId;
|
|
38
|
+
/**
|
|
39
|
+
* @since 1.0.0
|
|
40
|
+
* @category Type ids
|
|
41
|
+
*/
|
|
42
|
+
export declare const RawChannelTypeId: unique symbol;
|
|
43
|
+
/**
|
|
44
|
+
* @since 1.0.0
|
|
45
|
+
* @category Type ids
|
|
46
|
+
*/
|
|
47
|
+
export type RawChannelTypeId = typeof RawChannelTypeId;
|
|
48
|
+
/**
|
|
49
|
+
* @since 1.0.0
|
|
50
|
+
* @category Type ids
|
|
51
|
+
*/
|
|
52
|
+
export declare const MultiplexedSocketTypeId: unique symbol;
|
|
53
|
+
/**
|
|
54
|
+
* @since 1.0.0
|
|
55
|
+
* @category Type ids
|
|
56
|
+
*/
|
|
57
|
+
export type MultiplexedSocketTypeId = typeof MultiplexedSocketTypeId;
|
|
58
|
+
/**
|
|
59
|
+
* @since 1.0.0
|
|
60
|
+
* @category Type ids
|
|
61
|
+
*/
|
|
62
|
+
export declare const MultiplexedChannelTypeId: unique symbol;
|
|
63
|
+
/**
|
|
64
|
+
* @since 1.0.0
|
|
65
|
+
* @category Type ids
|
|
66
|
+
*/
|
|
67
|
+
export type MultiplexedChannelTypeId = typeof MultiplexedChannelTypeId;
|
|
68
|
+
/**
|
|
69
|
+
* When the TTY setting is enabled in POST /containers/create, the stream is not
|
|
70
|
+
* multiplexed. The data exchanged over the hijacked connection is simply the
|
|
71
|
+
* raw data from the process PTY and client's stdin.
|
|
72
|
+
*
|
|
73
|
+
* Note for Leo: This exists because the input error type "IE" might not be
|
|
74
|
+
* known at the time of converting the Socket to a Channel.
|
|
75
|
+
*
|
|
76
|
+
* @since 1.0.0
|
|
77
|
+
* @category Branded Types
|
|
78
|
+
*/
|
|
79
|
+
export interface RawSocket extends Pipeable.Pipeable {
|
|
80
|
+
readonly "content-type": typeof RawContentType;
|
|
81
|
+
readonly [RawSocketTypeId]: typeof RawSocketTypeId;
|
|
82
|
+
readonly underlying: Socket.Socket;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* When the TTY setting is enabled in POST /containers/create, the stream is not
|
|
86
|
+
* multiplexed. The data exchanged over the hijacked connection is simply the
|
|
87
|
+
* raw data from the process PTY and client's stdin.
|
|
88
|
+
*
|
|
89
|
+
* Note for Leo: This exists because there is no way to convert from a Channel
|
|
90
|
+
* to a Socket. In fact, with my current effect knowledge, I believe it is
|
|
91
|
+
* impossible to implement. This is still needed though for the pack and fan
|
|
92
|
+
* implementations which seek to return these types.
|
|
93
|
+
*
|
|
94
|
+
* @since 1.0.0
|
|
95
|
+
* @category Branded Types
|
|
96
|
+
*/
|
|
97
|
+
export interface RawChannel<in IE = unknown, out OE = Socket.SocketError, out R = never> extends Pipeable.Pipeable {
|
|
98
|
+
readonly "content-type": typeof RawContentType;
|
|
99
|
+
readonly [RawChannelTypeId]: typeof RawChannelTypeId;
|
|
100
|
+
readonly underlying: Channel.Channel<Chunk.Chunk<Uint8Array>, Chunk.Chunk<string | Uint8Array | Socket.CloseEvent>, OE, IE, void, unknown, R>;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* When the TTY setting is disabled in POST /containers/create, the HTTP
|
|
104
|
+
* Content-Type header is set to application/vnd.docker.multiplexed-stream and
|
|
105
|
+
* the stream over the hijacked connected is multiplexed to separate out stdout
|
|
106
|
+
* and stderr. The stream consists of a series of frames, each containing a
|
|
107
|
+
* header and a payload.
|
|
108
|
+
*
|
|
109
|
+
* Note for Leo: This exists because the input error type "IE" might not be
|
|
110
|
+
* known at the time of converting the Socket to a Channel.
|
|
111
|
+
*
|
|
112
|
+
* @since 1.0.0
|
|
113
|
+
* @category Branded Types
|
|
114
|
+
*/
|
|
115
|
+
export interface MultiplexedSocket extends Pipeable.Pipeable {
|
|
116
|
+
readonly "content-type": typeof MultiplexedContentType;
|
|
117
|
+
readonly [MultiplexedSocketTypeId]: MultiplexedSocketTypeId;
|
|
118
|
+
readonly underlying: Socket.Socket;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* When the TTY setting is disabled in POST /containers/create, the HTTP
|
|
122
|
+
* Content-Type header is set to application/vnd.docker.multiplexed-stream and
|
|
123
|
+
* the stream over the hijacked connected is multiplexed to separate out stdout
|
|
124
|
+
* and stderr. The stream consists of a series of frames, each containing a
|
|
125
|
+
* header and a payload.
|
|
126
|
+
*
|
|
127
|
+
* Note for Leo: This exists because there is no way to convert from a Channel
|
|
128
|
+
* to a Socket. In fact, with my current effect knowledge, I believe it is
|
|
129
|
+
* impossible to implement. This is still needed though for the pack and fan
|
|
130
|
+
* implementations which seek to return these types.
|
|
131
|
+
*
|
|
132
|
+
* @since 1.0.0
|
|
133
|
+
* @category Branded Types
|
|
134
|
+
*/
|
|
135
|
+
export interface MultiplexedChannel<in IE = unknown, out OE = Socket.SocketError, out R = never> extends Pipeable.Pipeable {
|
|
136
|
+
readonly "content-type": typeof MultiplexedContentType;
|
|
137
|
+
readonly [MultiplexedChannelTypeId]: MultiplexedChannelTypeId;
|
|
138
|
+
readonly underlying: Channel.Channel<Chunk.Chunk<Uint8Array>, Chunk.Chunk<string | Uint8Array | Socket.CloseEvent>, OE, IE, void, unknown, R>;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* @since 1.0.0
|
|
142
|
+
* @category Types
|
|
143
|
+
*/
|
|
144
|
+
export type EitherRawInput<IE, OE, R> = RawSocket | RawChannel<IE, OE, R>;
|
|
145
|
+
/**
|
|
146
|
+
* @since 1.0.0
|
|
147
|
+
* @category Types
|
|
148
|
+
*/
|
|
149
|
+
export type AnyRawInput = EitherRawInput<any, any, any>;
|
|
150
|
+
/**
|
|
151
|
+
* @since 1.0.0
|
|
152
|
+
* @category Types
|
|
153
|
+
*/
|
|
154
|
+
export type EitherMultiplexedInput<IE, OE, R> = MultiplexedSocket | MultiplexedChannel<IE, OE, R>;
|
|
155
|
+
/**
|
|
156
|
+
* @since 1.0.0
|
|
157
|
+
* @category Types
|
|
158
|
+
*/
|
|
159
|
+
export type AnyMultiplexedInput = EitherMultiplexedInput<any, any, any>;
|
|
160
|
+
/**
|
|
161
|
+
* @since 1.0.0
|
|
162
|
+
* @category Types
|
|
163
|
+
*/
|
|
164
|
+
export type HomogeneousStdioRawSocketInput = {
|
|
165
|
+
stdin: RawSocket;
|
|
166
|
+
stdout?: never;
|
|
167
|
+
stderr?: never;
|
|
168
|
+
} | {
|
|
169
|
+
stdin?: never;
|
|
170
|
+
stdout: RawSocket;
|
|
171
|
+
stderr?: never;
|
|
172
|
+
} | {
|
|
173
|
+
stdin?: never;
|
|
174
|
+
stdout?: never;
|
|
175
|
+
stderr: RawSocket;
|
|
176
|
+
} | {
|
|
177
|
+
stdin: RawSocket;
|
|
178
|
+
stdout: RawSocket;
|
|
179
|
+
stderr?: never;
|
|
180
|
+
} | {
|
|
181
|
+
stdin: RawSocket;
|
|
182
|
+
stdout?: never;
|
|
183
|
+
stderr: RawSocket;
|
|
184
|
+
} | {
|
|
185
|
+
stdin?: never;
|
|
186
|
+
stdout: RawSocket;
|
|
187
|
+
stderr: RawSocket;
|
|
188
|
+
} | {
|
|
189
|
+
stdin: RawSocket;
|
|
190
|
+
stdout: RawSocket;
|
|
191
|
+
stderr: RawSocket;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* @since 1.0.0
|
|
195
|
+
* @category Types
|
|
196
|
+
*/
|
|
197
|
+
export type HomogeneousStdioRawChannelInput<IE1, IE2, IE3, OE1, OE2, OE3, R1, R2, R3> = {
|
|
198
|
+
stdin: RawChannel<IE1, OE1, R1>;
|
|
199
|
+
stdout?: never;
|
|
200
|
+
stderr?: never;
|
|
201
|
+
} | {
|
|
202
|
+
stdin?: never;
|
|
203
|
+
stdout: RawChannel<IE2, OE2, R2>;
|
|
204
|
+
stderr?: never;
|
|
205
|
+
} | {
|
|
206
|
+
stdin?: never;
|
|
207
|
+
stdout?: never;
|
|
208
|
+
stderr: RawChannel<IE3, OE3, R3>;
|
|
209
|
+
} | {
|
|
210
|
+
stdin: RawChannel<IE1, OE1, R1>;
|
|
211
|
+
stdout: RawChannel<IE2, OE2, R2>;
|
|
212
|
+
stderr?: never;
|
|
213
|
+
} | {
|
|
214
|
+
stdin: RawChannel<IE1, OE1, R1>;
|
|
215
|
+
stdout?: never;
|
|
216
|
+
stderr: RawChannel<IE3, OE3, R3>;
|
|
217
|
+
} | {
|
|
218
|
+
stdin?: never;
|
|
219
|
+
stdout: RawChannel<IE2, OE2, R2>;
|
|
220
|
+
stderr: RawChannel<IE3, OE3, R3>;
|
|
221
|
+
} | {
|
|
222
|
+
stdin: RawChannel<IE1, OE1, R1>;
|
|
223
|
+
stdout: RawChannel<IE2, OE2, R2>;
|
|
224
|
+
stderr: RawChannel<IE3, OE3, R3>;
|
|
225
|
+
};
|
|
226
|
+
/**
|
|
227
|
+
* @since 1.0.0
|
|
228
|
+
* @category Types
|
|
229
|
+
*/
|
|
230
|
+
export type HeterogeneousStdioRawInput<IE1, IE2, IE3, OE1, OE2, OE3, R1, R2, R3> = {
|
|
231
|
+
stdin: EitherRawInput<IE1, OE1, R1>;
|
|
232
|
+
stdout?: never;
|
|
233
|
+
stderr?: never;
|
|
234
|
+
} | {
|
|
235
|
+
stdin?: never;
|
|
236
|
+
stdout: EitherRawInput<IE2, OE2, R2>;
|
|
237
|
+
stderr?: never;
|
|
238
|
+
} | {
|
|
239
|
+
stdin?: never;
|
|
240
|
+
stdout?: never;
|
|
241
|
+
stderr: EitherRawInput<IE3, OE3, R3>;
|
|
242
|
+
} | {
|
|
243
|
+
stdin: EitherRawInput<IE1, OE1, R1>;
|
|
244
|
+
stdout: EitherRawInput<IE2, OE2, R2>;
|
|
245
|
+
stderr?: never;
|
|
246
|
+
} | {
|
|
247
|
+
stdin: EitherRawInput<IE1, OE1, R1>;
|
|
248
|
+
stdout?: never;
|
|
249
|
+
stderr: EitherRawInput<IE3, OE3, R3>;
|
|
250
|
+
} | {
|
|
251
|
+
stdin?: never;
|
|
252
|
+
stdout: EitherRawInput<IE2, OE2, R2>;
|
|
253
|
+
stderr: EitherRawInput<IE3, OE3, R3>;
|
|
254
|
+
} | {
|
|
255
|
+
stdin: EitherRawInput<IE1, OE1, R1>;
|
|
256
|
+
stdout: EitherRawInput<IE2, OE2, R2>;
|
|
257
|
+
stderr: EitherRawInput<IE3, OE3, R3>;
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* @since 1.0.0
|
|
261
|
+
* @category Types
|
|
262
|
+
*/
|
|
263
|
+
export type HeterogeneousStdioTupledRawInput<A1, A2, L1, L2, E1, E2, E3, R1, R2, R3, IE1, IE2, IE3, OE1, OE2, OE3, R4, R5, R6> = {
|
|
264
|
+
stdin: readonly [
|
|
265
|
+
Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>,
|
|
266
|
+
EitherRawInput<E1 | IE1, OE1, R4>
|
|
267
|
+
];
|
|
268
|
+
stdout?: never;
|
|
269
|
+
stderr?: never;
|
|
270
|
+
} | {
|
|
271
|
+
stdin?: never;
|
|
272
|
+
stdout: readonly [EitherRawInput<IE2, OE2, R5>, Sink.Sink<A1, string, L1, E2, R2>];
|
|
273
|
+
stderr?: never;
|
|
274
|
+
} | {
|
|
275
|
+
stdin?: never;
|
|
276
|
+
stdout?: never;
|
|
277
|
+
stderr: readonly [EitherRawInput<IE3, OE3, R6>, Sink.Sink<A2, string, L2, E3, R3>];
|
|
278
|
+
} | {
|
|
279
|
+
stdin: readonly [
|
|
280
|
+
Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>,
|
|
281
|
+
EitherRawInput<E1 | IE1, OE1, R4>
|
|
282
|
+
];
|
|
283
|
+
stdout: readonly [EitherRawInput<IE2, OE2, R5>, Sink.Sink<A1, string, L1, E2, R2>];
|
|
284
|
+
stderr?: never;
|
|
285
|
+
} | {
|
|
286
|
+
stdin: readonly [
|
|
287
|
+
Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>,
|
|
288
|
+
EitherRawInput<E1 | IE1, OE1, R4>
|
|
289
|
+
];
|
|
290
|
+
stdout?: never;
|
|
291
|
+
stderr: readonly [EitherRawInput<IE3, OE3, R6>, Sink.Sink<A2, string, L2, E3, R3>];
|
|
292
|
+
} | {
|
|
293
|
+
stdin?: never;
|
|
294
|
+
stdout: readonly [EitherRawInput<IE2, OE2, R5>, Sink.Sink<A1, string, L1, E2, R2>];
|
|
295
|
+
stderr: readonly [EitherRawInput<IE3, OE3, R6>, Sink.Sink<A2, string, L2, E3, R3>];
|
|
296
|
+
} | {
|
|
297
|
+
stdin: readonly [
|
|
298
|
+
Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>,
|
|
299
|
+
EitherRawInput<E1 | IE1, OE1, R4>
|
|
300
|
+
];
|
|
301
|
+
stdout: readonly [EitherRawInput<IE2, OE2, R5>, Sink.Sink<A1, string, L1, E2, R2>];
|
|
302
|
+
stderr: readonly [EitherRawInput<IE3, OE3, R6>, Sink.Sink<A2, string, L2, E3, R3>];
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* @since 1.0.0
|
|
306
|
+
* @category Types
|
|
307
|
+
*/
|
|
308
|
+
export type CompressedDemuxOutput<A1, A2> = A1 extends undefined | void ? A2 extends undefined | void ? void : readonly [stdout: undefined, stderr: A2] : A2 extends undefined | void ? readonly [stdout: A1, stderr: undefined] : readonly [stdout: A1, stderr: A2];
|
|
309
|
+
/**
|
|
310
|
+
* @since 1.0.0
|
|
311
|
+
* @category Constructors
|
|
312
|
+
*/
|
|
313
|
+
export declare const makeRawSocket: (underlying: Socket.Socket) => RawSocket;
|
|
314
|
+
/**
|
|
315
|
+
* @since 1.0.0
|
|
316
|
+
* @category Constructors
|
|
317
|
+
*/
|
|
318
|
+
export declare const makeRawChannel: <IE = unknown, OE = Socket.SocketError, R = never>(underlying: Channel.Channel<Chunk.Chunk<Uint8Array>, Chunk.Chunk<string | Uint8Array | Socket.CloseEvent>, OE, IE, void, unknown, R>) => RawChannel<IE, IE | OE, R>;
|
|
319
|
+
/**
|
|
320
|
+
* @since 1.0.0
|
|
321
|
+
* @category Constructors
|
|
322
|
+
*/
|
|
323
|
+
export declare const makeMultiplexedSocket: (underlying: Socket.Socket) => MultiplexedSocket;
|
|
324
|
+
/**
|
|
325
|
+
* @since 1.0.0
|
|
326
|
+
* @category Constructors
|
|
327
|
+
*/
|
|
328
|
+
export declare const makeMultiplexedChannel: <IE = unknown, OE = Socket.SocketError, R = never>(underlying: Channel.Channel<Chunk.Chunk<Uint8Array>, Chunk.Chunk<string | Uint8Array | Socket.CloseEvent>, OE, IE, void, unknown, R>) => MultiplexedChannel<IE, IE | OE, R>;
|
|
329
|
+
/**
|
|
330
|
+
* @since 1.0.0
|
|
331
|
+
* @category Predicates
|
|
332
|
+
*/
|
|
333
|
+
export declare const isRawSocket: (u: unknown) => u is RawSocket;
|
|
334
|
+
/**
|
|
335
|
+
* @since 1.0.0
|
|
336
|
+
* @category Predicates
|
|
337
|
+
*/
|
|
338
|
+
export declare const isRawChannel: <IE = unknown, OE = Socket.SocketError, R = never>(u: unknown) => u is RawChannel<IE, IE | OE, R>;
|
|
339
|
+
/**
|
|
340
|
+
* @since 1.0.0
|
|
341
|
+
* @category Predicates
|
|
342
|
+
*/
|
|
343
|
+
export declare const isMultiplexedSocket: (u: unknown) => u is MultiplexedSocket;
|
|
344
|
+
/**
|
|
345
|
+
* @since 1.0.0
|
|
346
|
+
* @category Predicates
|
|
347
|
+
*/
|
|
348
|
+
export declare const isMultiplexedChannel: <IE = unknown, OE = Socket.SocketError, R = never>(u: unknown) => u is MultiplexedChannel<IE, IE | OE, R>;
|
|
349
|
+
/**
|
|
350
|
+
* @since 1.0.0
|
|
351
|
+
* @category Predicates
|
|
352
|
+
*/
|
|
353
|
+
export declare const responseIsRawResponse: (response: HttpClientResponse.HttpClientResponse) => boolean;
|
|
354
|
+
/**
|
|
355
|
+
* @since 1.0.0
|
|
356
|
+
* @category Predicates
|
|
357
|
+
*/
|
|
358
|
+
export declare const responseIsMultiplexedResponse: (response: HttpClientResponse.HttpClientResponse) => boolean;
|
|
359
|
+
/**
|
|
360
|
+
* Hijacks an http response into a socket.
|
|
361
|
+
*
|
|
362
|
+
* FIXME: this function relies on a hack to expose the underlying tcp socket
|
|
363
|
+
* from the http client response. This will only work in NodeJs, not tested in
|
|
364
|
+
* Bun/Deno yet, and will never work in the browser.
|
|
365
|
+
*
|
|
366
|
+
* @since 1.0.0
|
|
367
|
+
* @category Transformations
|
|
368
|
+
*/
|
|
369
|
+
export declare const hijackResponseUnsafe: (response: HttpClientResponse.HttpClientResponse) => Effect.Effect<Socket.Socket, Socket.SocketError, never>;
|
|
370
|
+
/**
|
|
371
|
+
* Transforms an http response into a multiplexed stream socket or a raw stream
|
|
372
|
+
* socket. If the response is neither a multiplexed stream socket nor a raw or
|
|
373
|
+
* can not be transformed, then an error will be returned.
|
|
374
|
+
*
|
|
375
|
+
* FIXME: this function relies on a hack to expose the underlying tcp socket
|
|
376
|
+
* from the http client response. This will only work in NodeJs, not tested in
|
|
377
|
+
* Bun/Deno yet, and will never work in the browser.
|
|
378
|
+
*
|
|
379
|
+
* @since 1.0.0
|
|
380
|
+
* @category Predicates
|
|
381
|
+
*/
|
|
382
|
+
export declare const responseToStreamingSocketOrFailUnsafe: (response: HttpClientResponse.HttpClientResponse) => Effect.Effect<RawSocket | MultiplexedSocket, Socket.SocketError, never>;
|
|
383
|
+
/**
|
|
384
|
+
* @since 1.0.0
|
|
385
|
+
* @category Conversions
|
|
386
|
+
*/
|
|
387
|
+
export declare const asRawChannel: <IE = never, OE = Socket.SocketError, R = never>(input: EitherRawInput<IE, OE, R>) => RawChannel<IE, OE, R>;
|
|
388
|
+
/**
|
|
389
|
+
* @since 1.0.0
|
|
390
|
+
* @category Conversions
|
|
391
|
+
*/
|
|
392
|
+
export declare const asMultiplexedChannel: <IE = never, OE = Socket.SocketError, R = never>(input: EitherMultiplexedInput<IE, OE, R>) => MultiplexedChannel<IE, OE, R>;
|
|
393
|
+
/**
|
|
394
|
+
* @since 1.0.0
|
|
395
|
+
* @category Conversions
|
|
396
|
+
*/
|
|
397
|
+
export declare const rawToStream: <IE = never, OE = Socket.SocketError, R = never>(input: EitherRawInput<IE, OE, R>) => Stream.Stream<Uint8Array, IE | OE, R>;
|
|
398
|
+
/**
|
|
399
|
+
* @since 1.0.0
|
|
400
|
+
* @category Conversions
|
|
401
|
+
*/
|
|
402
|
+
export declare const multiplexedToStream: <IE = never, OE = Socket.SocketError, R = never>(input: EitherMultiplexedInput<IE, OE, R>) => Stream.Stream<Uint8Array, IE | OE, R>;
|
|
403
|
+
/**
|
|
404
|
+
* @since 1.0.0
|
|
405
|
+
* @category Conversions
|
|
406
|
+
*/
|
|
407
|
+
export declare const rawToSink: <IE = never, OE = Socket.SocketError, R = never>(input: EitherRawInput<IE, OE, R>) => Sink.Sink<void, string | Uint8Array | Socket.CloseEvent, Uint8Array, IE | OE, R>;
|
|
408
|
+
/**
|
|
409
|
+
* @since 1.0.0
|
|
410
|
+
* @category Conversions
|
|
411
|
+
*/
|
|
412
|
+
export declare const multiplexedToSink: <IE = never, OE = Socket.SocketError, R = never>(input: EitherMultiplexedInput<IE, OE, R>) => Sink.Sink<void, string | Uint8Array | Socket.CloseEvent, Uint8Array, IE | OE, R>;
|
|
413
|
+
/**
|
|
414
|
+
* @since 1.0.0
|
|
415
|
+
* @category Conversions
|
|
416
|
+
*/
|
|
417
|
+
export declare const rawFromStreamWith: <IE>() => <E, R>(input: Stream.Stream<Uint8Array, IE | E, R>) => RawChannel<IE, IE | E, R>;
|
|
418
|
+
/**
|
|
419
|
+
* @since 1.0.0
|
|
420
|
+
* @category Conversions
|
|
421
|
+
*/
|
|
422
|
+
export declare const multiplexedFromStreamWith: <IE>() => <E, R>(input: Stream.Stream<Uint8Array, IE | E, R>) => MultiplexedChannel<IE, IE | E, R>;
|
|
423
|
+
/**
|
|
424
|
+
* @since 1.0.0
|
|
425
|
+
* @category Conversions
|
|
426
|
+
*/
|
|
427
|
+
export declare const rawFromStream: <E, R>(input: Stream.Stream<Uint8Array, E, R>) => RawChannel<never, E, R>;
|
|
428
|
+
/**
|
|
429
|
+
* @since 1.0.0
|
|
430
|
+
* @category Conversions
|
|
431
|
+
*/
|
|
432
|
+
export declare const multiplexedFromStream: <E, R>(input: Stream.Stream<Uint8Array, E, R>) => MultiplexedChannel<never, E, R>;
|
|
433
|
+
/**
|
|
434
|
+
* @since 1.0.0
|
|
435
|
+
* @category Conversions
|
|
436
|
+
*/
|
|
437
|
+
export declare const rawFromSink: <E, R>(input: Sink.Sink<void, string | Uint8Array | Socket.CloseEvent, Uint8Array, E, R>) => RawChannel<never, E, R>;
|
|
438
|
+
/**
|
|
439
|
+
* @since 1.0.0
|
|
440
|
+
* @category Conversions
|
|
441
|
+
*/
|
|
442
|
+
export declare const multiplexedFromSink: <E, R>(input: Sink.Sink<void, string | Uint8Array | Socket.CloseEvent, Uint8Array, E, R>) => MultiplexedChannel<never, E, R>;
|
|
443
|
+
/**
|
|
444
|
+
* @since 1.0.0
|
|
445
|
+
* @category Conversions
|
|
446
|
+
*/
|
|
447
|
+
export declare const interleaveRaw: <IE1 = never, IE2 = never, OE1 = Socket.SocketError, OE2 = Socket.SocketError, R1 = never, R2 = never>(stdout: EitherRawInput<IE1, OE1, R1>, stderr: EitherRawInput<IE2, OE2, R2>) => Stream.Stream<Uint8Array, IE1 | IE2 | OE1 | OE2, R1 | R2>;
|
|
448
|
+
/**
|
|
449
|
+
* @since 1.0.0
|
|
450
|
+
* @category Conversions
|
|
451
|
+
*/
|
|
452
|
+
export declare const mergeRawToTaggedStream: <IE1 = never, IE2 = never, OE1 = Socket.SocketError, OE2 = Socket.SocketError, R1 = never, R2 = never>(stdout: EitherRawInput<IE1, OE1, R1>, stderr: EitherRawInput<IE2, OE2, R2>, options?: {
|
|
453
|
+
bufferSize?: number | undefined;
|
|
454
|
+
} | undefined) => Stream.Stream<{
|
|
455
|
+
_tag: "stdout";
|
|
456
|
+
value: Uint8Array;
|
|
457
|
+
} | {
|
|
458
|
+
_tag: "stderr";
|
|
459
|
+
value: Uint8Array;
|
|
460
|
+
}, IE1 | IE2 | OE1 | OE2, R1 | R2>;
|
|
461
|
+
/**
|
|
462
|
+
* Demux a raw socket. When given a raw socket of the remote process's pty,
|
|
463
|
+
* there is no way to differentiate between stdout and stderr so they are
|
|
464
|
+
* combined on the same sink.
|
|
465
|
+
*
|
|
466
|
+
* @since 1.0.0
|
|
467
|
+
* @category Demux
|
|
468
|
+
*/
|
|
469
|
+
export declare const demuxRawToSingleSink: (<A1, L1, E1, E2, R1, R2>(source: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>, sink: Sink.Sink<A1, string, L1, E2, R2>, options?: {
|
|
470
|
+
encoding?: string | undefined;
|
|
471
|
+
} | undefined) => <IE = never, OE = Socket.SocketError, R3 = never>(socket: EitherRawInput<E1 | IE, OE, R3>) => Effect.Effect<A1, E1 | E2 | IE | OE, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope>>) & (<A1, L1, E1, E2, R1, R2, IE = never, OE = Socket.SocketError, R3 = never>(socket: EitherRawInput<E1 | IE, OE, R3>, source: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>, sink: Sink.Sink<A1, string, L1, E2, R2>, options?: {
|
|
472
|
+
encoding?: string | undefined;
|
|
473
|
+
} | undefined) => Effect.Effect<A1, E1 | E2 | IE | OE, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope>>);
|
|
474
|
+
/**
|
|
475
|
+
* Demux multiple raw sockets, created from multiple container attach requests.
|
|
476
|
+
* If no options are provided for a given stream, it will be ignored. This is
|
|
477
|
+
* really just an Effect.all wrapper around {@link demuxRawSingleSink}.
|
|
478
|
+
*
|
|
479
|
+
* To demux a single raw socket, you should use {@link demuxRawSingleSink}
|
|
480
|
+
*
|
|
481
|
+
* @since 1.0.0
|
|
482
|
+
* @category Demux
|
|
483
|
+
*/
|
|
484
|
+
export declare const demuxStdioRawTupled: <A1 = void, A2 = void, L1 = never, L2 = never, E1 = never, E2 = never, E3 = never, R1 = never, R2 = never, R3 = never, IE1 = never, IE2 = never, IE3 = never, OE1 = Socket.SocketError, OE2 = Socket.SocketError, OE3 = Socket.SocketError, R4 = never, R5 = never, R6 = never>(sockets: HeterogeneousStdioTupledRawInput<A1, A2, L1, L2, E1, E2, E3, R1, R2, R3, IE1, IE2, IE3, OE1, OE2, OE3, R4, R5, R6>, options?: {
|
|
485
|
+
encoding?: string | undefined;
|
|
486
|
+
} | undefined) => Effect.Effect<CompressedDemuxOutput<A1, A2>, E1 | E2 | E3 | IE1 | IE2 | IE3 | OE1 | OE2 | OE3, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope> | Exclude<R4, Scope.Scope> | Exclude<R5, Scope.Scope> | Exclude<R6, Scope.Scope>>;
|
|
487
|
+
/**
|
|
488
|
+
* Demux multiple raw sockets, created from multiple container attach requests.
|
|
489
|
+
* If no options are provided for a given stream, it will be ignored. This is
|
|
490
|
+
* really just an Effect.all wrapper around {@link demuxRawSingleSink}.
|
|
491
|
+
*
|
|
492
|
+
* To demux a single raw socket, you should use {@link demuxRawSingleSink}
|
|
493
|
+
*
|
|
494
|
+
* @since 1.0.0
|
|
495
|
+
* @category Demux
|
|
496
|
+
*/
|
|
497
|
+
export declare const demuxStdioRawToSingleSink: (<A1, L1, E1, E2, R1, R2>(source: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>, sink: Sink.Sink<A1, string, L1, E2, R2>, options?: {
|
|
498
|
+
encoding?: string | undefined;
|
|
499
|
+
} | undefined) => <IE1 = never, IE2 = never, IE3 = never, OE1 = Socket.SocketError, OE2 = Socket.SocketError, OE3 = Socket.SocketError, R3 = never, R4 = never, R5 = never>(sockets: HeterogeneousStdioRawInput<IE1 | E1, IE2, IE3, OE1, OE2, OE3, R3, R4, R5>) => Effect.Effect<A1, E1 | E2 | IE1 | IE2 | IE3 | OE1 | OE2 | OE3, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope> | Exclude<R4, Scope.Scope> | Exclude<R5, Scope.Scope>>) & (<A1, L1, E1, E2, R1, R2, IE1 = never, IE2 = never, IE3 = never, OE1 = Socket.SocketError, OE2 = Socket.SocketError, OE3 = Socket.SocketError, R3 = never, R4 = never, R5 = never>(sockets: HeterogeneousStdioRawInput<IE1 | E1, IE2, IE3, OE1, OE2, OE3, R3, R4, R5>, source: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>, sink: Sink.Sink<A1, string, L1, E2, R2>, options?: {
|
|
500
|
+
encoding?: string | undefined;
|
|
501
|
+
} | undefined) => Effect.Effect<A1, E1 | E2 | IE1 | IE2 | IE3 | OE1 | OE2 | OE3, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope> | Exclude<R4, Scope.Scope> | Exclude<R5, Scope.Scope>>);
|
|
502
|
+
/**
|
|
503
|
+
* Demux multiple raw sockets, created from multiple container attach requests.
|
|
504
|
+
* If no options are provided for a given stream, it will be ignored. This is
|
|
505
|
+
* really just an Effect.all wrapper around {@link demuxRawSingleSink}.
|
|
506
|
+
*
|
|
507
|
+
* To demux a single raw socket, you should use {@link demuxRawSingleSink}
|
|
508
|
+
*
|
|
509
|
+
* @since 1.0.0
|
|
510
|
+
* @category Demux
|
|
511
|
+
*/
|
|
512
|
+
export declare const demuxStdioRawToSeparateSinks: (<A1, A2, L1, L2, E1, E2, E3, R1, R2, R3>(io: {
|
|
513
|
+
stdin: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>;
|
|
514
|
+
stdout: Sink.Sink<A1, string, L1, E2, R2>;
|
|
515
|
+
stderr: Sink.Sink<A2, string, L2, E3, R3>;
|
|
516
|
+
}, options?: {
|
|
517
|
+
encoding?: string | undefined;
|
|
518
|
+
} | undefined) => <IE1 = never, IE2 = never, IE3 = never, OE1 = Socket.SocketError, OE2 = Socket.SocketError, OE3 = Socket.SocketError, R4 = never, R5 = never, R6 = never>(sockets: HeterogeneousStdioRawInput<IE1 | E1, IE2, IE3, OE1, OE2, OE3, R4, R5, R6>) => Effect.Effect<CompressedDemuxOutput<A1, A2>, E1 | E2 | E3 | IE1 | IE2 | IE3 | OE1 | OE2 | OE3, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope> | Exclude<R4, Scope.Scope> | Exclude<R5, Scope.Scope> | Exclude<R6, Scope.Scope>>) & (<A1, A2, L1, L2, E1, E2, E3, R1, R2, R3, IE1 = never, IE2 = never, IE3 = never, OE1 = Socket.SocketError, OE2 = Socket.SocketError, OE3 = Socket.SocketError, R4 = never, R5 = never, R6 = never>(sockets: HeterogeneousStdioRawInput<IE1 | E1, IE2, IE3, OE1, OE2, OE3, R4, R5, R6>, io: {
|
|
519
|
+
stdin: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>;
|
|
520
|
+
stdout: Sink.Sink<A1, string, L1, E2, R2>;
|
|
521
|
+
stderr: Sink.Sink<A2, string, L2, E3, R3>;
|
|
522
|
+
}, options?: {
|
|
523
|
+
encoding?: string | undefined;
|
|
524
|
+
} | undefined) => Effect.Effect<CompressedDemuxOutput<A1, A2>, E1 | E2 | E3 | IE1 | IE2 | IE3 | OE1 | OE2 | OE3, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope> | Exclude<R4, Scope.Scope> | Exclude<R5, Scope.Scope> | Exclude<R6, Scope.Scope>>);
|
|
525
|
+
/**
|
|
526
|
+
* Demux a multiplexed socket, all output goes to a single sink.
|
|
527
|
+
*
|
|
528
|
+
* @since 1.0.0
|
|
529
|
+
* @category Demux
|
|
530
|
+
*/
|
|
531
|
+
export declare const demuxMultiplexedToSingleSink: (<A1, L1, E1, E2, R1, R2>(source: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>, sink: Sink.Sink<A1, readonly [internalMultiplexed.MultiplexedHeaderType, string], L1, E2, R2>, options?: {
|
|
532
|
+
encoding?: string | undefined;
|
|
533
|
+
} | undefined) => <IE = never, OE = Socket.SocketError, R3 = never>(socket: EitherMultiplexedInput<E1 | IE, OE, R3>) => Effect.Effect<A1, E1 | E2 | IE | OE | ParseResult.ParseError, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope>>) & (<A1, L1, E1, E2, R1, R2, IE = never, OE = Socket.SocketError, R3 = never>(socket: EitherMultiplexedInput<E1 | IE, OE, R3>, source: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>, sink: Sink.Sink<A1, readonly [internalMultiplexed.MultiplexedHeaderType, string], L1, E2, R2>, options?: {
|
|
534
|
+
encoding?: string | undefined;
|
|
535
|
+
} | undefined) => Effect.Effect<A1, E1 | E2 | IE | OE | ParseResult.ParseError, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope>>);
|
|
536
|
+
/**
|
|
537
|
+
* Demux a multiplexed socket. When given a multiplexed socket, we must parse
|
|
538
|
+
* the chunks by headers and then forward each chunk based on its datatype to
|
|
539
|
+
* the correct sink.
|
|
540
|
+
*
|
|
541
|
+
* When partitioning the stream into stdout and stderr, the first sink may
|
|
542
|
+
* advance by up to bufferSize elements further than the slower one. The default
|
|
543
|
+
* bufferSize is 16.
|
|
544
|
+
*
|
|
545
|
+
* @since 1.0.0
|
|
546
|
+
* @category Demux
|
|
547
|
+
*/
|
|
548
|
+
export declare const demuxMultiplexedToSeparateSinks: (<A1, A2, L1, L2, E1, E2, E3, R1, R2, R3>(source: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>, sink1: Sink.Sink<A1, string, L1, E2, R2>, sink2: Sink.Sink<A2, string, L2, E3, R3>, options?: {
|
|
549
|
+
bufferSize?: number | undefined;
|
|
550
|
+
encoding?: string | undefined;
|
|
551
|
+
} | undefined) => <IE = never, OE = Socket.SocketError, R4 = never>(socket: EitherMultiplexedInput<E1 | IE, OE, R4>) => Effect.Effect<CompressedDemuxOutput<A1, A2>, E1 | E2 | E3 | IE | OE | ParseResult.ParseError, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope> | Exclude<R4, Scope.Scope>>) & (<A1, A2, L1, L2, E1, E2, E3, R1, R2, R3, IE = never, OE = Socket.SocketError, R4 = never>(socket: EitherMultiplexedInput<E1 | IE, OE, R4>, source: Stream.Stream<string | Uint8Array | Socket.CloseEvent, E1, R1>, sink1: Sink.Sink<A1, string, L1, E2, R2>, sink2: Sink.Sink<A2, string, L2, E3, R3>, options?: {
|
|
552
|
+
bufferSize?: number | undefined;
|
|
553
|
+
encoding?: string | undefined;
|
|
554
|
+
} | undefined) => Effect.Effect<CompressedDemuxOutput<A1, A2>, E1 | E2 | E3 | IE | OE | ParseResult.ParseError, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope> | Exclude<R4, Scope.Scope>>);
|
|
555
|
+
/**
|
|
556
|
+
* Demux either a raw socket or a multiplexed socket to a single sink.
|
|
557
|
+
*
|
|
558
|
+
* @since 1.0.0
|
|
559
|
+
* @category Demux
|
|
560
|
+
*/
|
|
561
|
+
export declare const demuxToSingleSink: {
|
|
562
|
+
<A1, L1, E1, E2, R1, R2>(source: Stream.Stream<string | Uint8Array, E1, R1>, sink: Sink.Sink<A1, string, L1, E2, R2>, options?: {
|
|
563
|
+
encoding?: string | undefined;
|
|
564
|
+
} | undefined): <IE = never, OE = Socket.SocketError, R3 = never>(sockets: EitherRawInput<E1 | IE, OE, R3> | EitherMultiplexedInput<E1 | IE, OE, R3>) => Effect.Effect<A1, E1 | E2 | IE | OE | ParseResult.ParseError, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope>>;
|
|
565
|
+
<A1, L1, E1, E2, R1, R2, IE = never, OE = Socket.SocketError, R3 = never>(sockets: EitherRawInput<E1 | IE, OE, R3> | EitherMultiplexedInput<E1 | IE, OE, R3>, source: Stream.Stream<string | Uint8Array, E1, R1>, sink: Sink.Sink<A1, string, L1, E2, R2>, options?: {
|
|
566
|
+
encoding?: string | undefined;
|
|
567
|
+
} | undefined): Effect.Effect<A1, E1 | E2 | IE | OE | ParseResult.ParseError, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope>>;
|
|
568
|
+
};
|
|
569
|
+
/**
|
|
570
|
+
* @since 1.0.0
|
|
571
|
+
* @category Packing
|
|
572
|
+
*/
|
|
573
|
+
export declare const pack: (<IE1 = never, IE2 = never, IE3 = never, OE1 = Socket.SocketError, OE2 = Socket.SocketError, OE3 = Socket.SocketError, R1 = never, R2 = never, R3 = never>(options: {
|
|
574
|
+
requestedCapacity: number;
|
|
575
|
+
encoding?: string | undefined;
|
|
576
|
+
}) => (stdio: HeterogeneousStdioRawInput<IE1, IE2, IE3, OE1, OE2, OE3, R1, R2, R3>) => Effect.Effect<MultiplexedChannel<IE1 | IE2 | IE3, IE1 | IE2 | IE3 | OE1 | OE2 | OE3, never>, never, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope>>) & (<IE1 = never, IE2 = never, IE3 = never, OE1 = Socket.SocketError, OE2 = Socket.SocketError, OE3 = Socket.SocketError, R1 = never, R2 = never, R3 = never>(stdio: HeterogeneousStdioRawInput<IE1, IE2, IE3, OE1, OE2, OE3, R1, R2, R3>, options: {
|
|
577
|
+
requestedCapacity: number;
|
|
578
|
+
encoding?: string | undefined;
|
|
579
|
+
}) => Effect.Effect<MultiplexedChannel<IE1 | IE2 | IE3, IE1 | IE2 | IE3 | OE1 | OE2 | OE3, never>, never, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope> | Exclude<R3, Scope.Scope>>);
|
|
580
|
+
/**
|
|
581
|
+
* @since 1.0.0
|
|
582
|
+
* @category Fanning
|
|
583
|
+
*/
|
|
584
|
+
export declare const fan: (<IE = never, OE = Socket.SocketError, R = never>(options: {
|
|
585
|
+
requestedCapacity: number;
|
|
586
|
+
encoding?: string | undefined;
|
|
587
|
+
}) => (multiplexedInput: EitherMultiplexedInput<IE, OE, R>) => Effect.Effect<{
|
|
588
|
+
stdin: RawChannel<IE, IE | OE | ParseResult.ParseError, never>;
|
|
589
|
+
stdout: RawChannel<IE, IE | OE | ParseResult.ParseError, never>;
|
|
590
|
+
stderr: RawChannel<IE, IE | OE | ParseResult.ParseError, never>;
|
|
591
|
+
}, never, Exclude<R, Scope.Scope>>) & (<IE = never, OE = Socket.SocketError, R = never>(multiplexedInput: EitherMultiplexedInput<IE, OE, R>, options: {
|
|
592
|
+
requestedCapacity: number;
|
|
593
|
+
encoding?: string | undefined;
|
|
594
|
+
}) => Effect.Effect<{
|
|
595
|
+
stdin: RawChannel<IE, IE | OE | ParseResult.ParseError, never>;
|
|
596
|
+
stdout: RawChannel<IE, IE | OE | ParseResult.ParseError, never>;
|
|
597
|
+
stderr: RawChannel<IE, IE | OE | ParseResult.ParseError, never>;
|
|
598
|
+
}, never, Exclude<R, Scope.Scope>>);
|
|
599
|
+
/**
|
|
600
|
+
* Demux either a raw stream socket or a multiplexed stream socket to the
|
|
601
|
+
* console. If given a raw stream socket, then stdout and stderr will be
|
|
602
|
+
* combined on the same sink. If given a multiplexed stream socket, then stdout
|
|
603
|
+
* and stderr will be forwarded to different sinks. If given multiple raw stream
|
|
604
|
+
* sockets, then you can provide different individual sockets for stdin, stdout,
|
|
605
|
+
* and stderr.
|
|
606
|
+
*
|
|
607
|
+
* If you are looking for a way to demux to stdin, stdout, and stderr instead of
|
|
608
|
+
* the console then see {@link demuxSocketFromStdinToStdoutAndStderr}.
|
|
609
|
+
*
|
|
610
|
+
* @since 1.0.0
|
|
611
|
+
* @category DemuxStdio
|
|
612
|
+
*/
|
|
613
|
+
export declare const demuxWithInputToConsole: <E, R1, IE = never, OE = Socket.SocketError, R2 = never>(sockets: EitherMultiplexedInput<E | IE, OE, R2>, input: Stream.Stream<string | Uint8Array, E, R1>, options?: {
|
|
614
|
+
bufferSize?: number | undefined;
|
|
615
|
+
encoding?: string | undefined;
|
|
616
|
+
} | undefined) => Effect.Effect<void, E | IE | OE | ParseResult.ParseError, Exclude<R1, Scope.Scope> | Exclude<R2, Scope.Scope>>;
|
|
617
|
+
/**
|
|
618
|
+
* Demux either a raw stream socket or a multiplexed stream socket from stdin to
|
|
619
|
+
* stdout and stderr. If given a raw stream socket, then stdout and stderr will
|
|
620
|
+
* be combined on the same sink. If given a multiplexed stream socket, then
|
|
621
|
+
* stdout and stderr will be forwarded to different sinks. If given multiple raw
|
|
622
|
+
* stream sockets, then you can provide different individual sockets for stdin,
|
|
623
|
+
* stdout, and stderr.
|
|
624
|
+
*
|
|
625
|
+
* If you are looking for a way to demux to the console instead of stdin,
|
|
626
|
+
* stdout, and stderr then see {@link demuxSocketWithInputToConsole}. Since we
|
|
627
|
+
* are interacting with stdin, stdout, and stderr this function dynamically
|
|
628
|
+
* imports the `@effect/platform-node` package.
|
|
629
|
+
*
|
|
630
|
+
* @since 1.0.0
|
|
631
|
+
* @category DemuxStdio
|
|
632
|
+
*/
|
|
633
|
+
export declare const demuxFromStdinToStdoutAndStderr: <IE = never, OE = Socket.SocketError, R = never>(sockets: EitherMultiplexedInput<IE, OE, R>, options?: {
|
|
634
|
+
bufferSize?: number | undefined;
|
|
635
|
+
encoding?: string | undefined;
|
|
636
|
+
} | undefined) => Effect.Effect<void, IE | OE | internalStdio.StdinError | internalStdio.StdoutError | internalStdio.StderrError | ParseResult.ParseError, Exclude<R, Scope.Scope>>;
|
|
18
637
|
//# sourceMappingURL=MobyDemux.d.ts.map
|