the-moby-effect
Version:
Moby/Docker API client built using effect-ts
83 lines • 4.85 kB
TypeScript
import * as Context from "effect/Context";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Schema from "effect/Schema";
import * as HttpClient from "effect/unstable/http/HttpClient";
import * as HttpApi from "effect/unstable/httpapi/HttpApi";
import * as HttpApiEndpoint from "effect/unstable/httpapi/HttpApiEndpoint";
import * as HttpApiGroup from "effect/unstable/httpapi/HttpApiGroup";
import type { MultiplexedSocket, RawSocket } from "../../MobyDemux.ts";
import { ContainerExecStartOptions, ContainerExecOptions as ExecConfig, ContainerExecInspect as ExecInspectResponse } from "../generated/index.ts";
import { ExecIdentifier } from "../schemas/id.ts";
import { DockerError } from "./circular.ts";
import { BadRequest, Conflict, InternalServerError, NotFound } from "./errors.ts";
/**
* @since 1.0.0
* @category HttpApi
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Exec
*/
export declare const ExecsApi: HttpApi.HttpApi<"ExecsApi", HttpApiGroup.HttpApiGroup<"exec", HttpApiEndpoint.HttpApiEndpoint<"container", "POST", "/containers/:id/exec", Schema.toCodecStringTree<Schema.Struct<{
id: Schema.String;
}>>, never, Schema.toCodecJson<typeof ExecConfig>, never, Schema.toCodecJson<Schema.Struct<{
readonly Id: Schema.brand<Schema.String, "ExecId">;
}>>, Schema.toCodecJson<typeof NotFound | typeof Conflict | typeof InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"inspect", "GET", "/exec/:id/json", Schema.toCodecStringTree<Schema.Struct<{
id: Schema.brand<Schema.String, "ExecId">;
}>>, never, never, never, Schema.toCodecJson<typeof ExecInspectResponse>, Schema.toCodecJson<typeof NotFound | typeof InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"resize", "POST", "/exec/:id/resize", Schema.toCodecStringTree<Schema.Struct<{
id: Schema.brand<Schema.String, "ExecId">;
}>>, Schema.toCodecStringTree<Schema.Struct<{
h: Schema.Number;
w: Schema.Number;
}>>, never, never, Schema.toCodecJson<Schema.Void>, Schema.toCodecJson<typeof BadRequest | typeof NotFound | typeof InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"start", "POST", "/exec/:id/start", Schema.toCodecStringTree<Schema.Struct<{
id: Schema.brand<Schema.String, "ExecId">;
}>>, never, Schema.toCodecJson<typeof ContainerExecStartOptions>, Schema.toCodecStringTree<Schema.Struct<{
Upgrade: Schema.Literal<"tcp">;
Connection: Schema.Literal<"Upgrade">;
}>>, Schema.toCodecJson<Schema.Void>, Schema.toCodecJson<typeof NotFound | typeof Conflict | typeof InternalServerError>, never, never>, false>>;
declare const Execs_base: Context.ServiceClass<Execs, "@the-moby-effect/endpoints/Execs", {
container: (id: string, payload: (typeof ExecConfig)["~type.make.in"]) => Effect.Effect<{
readonly Id: string & import("effect/Brand").Brand<"ExecId">;
}, DockerError, never>;
start: <const T extends boolean = false>(id: ExecIdentifier, payload: Omit<(typeof ContainerExecStartOptions)["~type.make.in"], "Detach"> & {
Detach: T;
}) => Effect.Effect<[T] extends [false] ? RawSocket | MultiplexedSocket : void, DockerError, never>;
resize: (id: ExecIdentifier, params: {
w: number;
h: number;
}) => Effect.Effect<void, DockerError, never>;
inspect: (id: ExecIdentifier) => Effect.Effect<ExecInspectResponse, DockerError, never>;
}> & {
readonly make: Effect.Effect<{
container: (id: string, payload: (typeof ExecConfig)["~type.make.in"]) => Effect.Effect<{
readonly Id: string & import("effect/Brand").Brand<"ExecId">;
}, DockerError, never>;
start: <const T extends boolean = false>(id: ExecIdentifier, payload: Omit<(typeof ContainerExecStartOptions)["~type.make.in"], "Detach"> & {
Detach: T;
}) => Effect.Effect<[T] extends [false] ? RawSocket | MultiplexedSocket : void, DockerError, never>;
resize: (id: ExecIdentifier, params: {
w: number;
h: number;
}) => Effect.Effect<void, DockerError, never>;
inspect: (id: ExecIdentifier) => Effect.Effect<ExecInspectResponse, DockerError, never>;
}, never, HttpClient.HttpClient>;
};
/**
* @since 1.0.0
* @category Services
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Exec
*/
export declare class Execs extends Execs_base {
}
/**
* @since 1.0.0
* @category Layers
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Exec
*/
export declare const ExecsLayer: Layer.Layer<Execs, never, HttpClient.HttpClient>;
/**
* @since 1.0.0
* @category Layers
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Exec
*/
export declare const ExecsLayerLocalSocket: Layer.Layer<Execs, never, HttpClient.HttpClient>;
export {};
//# sourceMappingURL=execs.d.ts.map