the-moby-effect
Version:
Moby/Docker API client built using effect-ts
109 lines • 6.02 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 Stream from "effect/Stream";
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 * as HttpApiSchema from "effect/unstable/httpapi/HttpApiSchema";
import { SwarmTask } from "../generated/index.ts";
import { DockerError } from "./circular.ts";
import { InternalServerError, NotFound, ServiceUnavailable } from "./errors.ts";
/** @since 1.0.0 */
export declare const TaskListFilters: Schema.fromJsonString<Schema.Struct<{
readonly "desired-state": Schema.optional<Schema.$Array<Schema.Literals<readonly ["running", "shutdown", "accepted"]>>>;
readonly id: Schema.optional<Schema.$Array<Schema.String>>;
readonly name: Schema.optional<Schema.$Array<Schema.String>>;
readonly node: Schema.optional<Schema.$Array<Schema.String>>;
readonly service: Schema.optional<Schema.$Array<Schema.String>>;
readonly label: Schema.optional<Schema.$Array<Schema.String>>;
}>>;
/**
* A task is a container running on a swarm. It is the atomic scheduling unit of
* swarm. Swarm mode must be enabled for these endpoints to work.
*
* @since 1.0.0
* @category HttpApi
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Task
*/
export declare const TasksApi: HttpApi.HttpApi<"TasksApi", HttpApiGroup.HttpApiGroup<"tasks", HttpApiEndpoint.HttpApiEndpoint<"inspect", "GET", "/tasks/:id", Schema.toCodecStringTree<Schema.Struct<{
id: Schema.String;
}>>, never, never, never, Schema.toCodecJson<typeof SwarmTask>, Schema.toCodecJson<typeof NotFound | typeof InternalServerError | typeof ServiceUnavailable>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", "/tasks/", never, Schema.toCodecStringTree<Schema.Struct<{
filters: Schema.optional<Schema.fromJsonString<Schema.Struct<{
readonly "desired-state": Schema.optional<Schema.$Array<Schema.Literals<readonly ["running", "shutdown", "accepted"]>>>;
readonly id: Schema.optional<Schema.$Array<Schema.String>>;
readonly name: Schema.optional<Schema.$Array<Schema.String>>;
readonly node: Schema.optional<Schema.$Array<Schema.String>>;
readonly service: Schema.optional<Schema.$Array<Schema.String>>;
readonly label: Schema.optional<Schema.$Array<Schema.String>>;
}>>>;
}>>, never, never, Schema.toCodecJson<Schema.$Array<typeof SwarmTask>>, Schema.toCodecJson<typeof InternalServerError | typeof ServiceUnavailable>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"logs", "GET", "/tasks/:id/logs", Schema.toCodecStringTree<Schema.Struct<{
id: Schema.String;
}>>, Schema.toCodecStringTree<Schema.Struct<{
details: Schema.optional<Schema.Boolean>;
follow: Schema.optional<Schema.Boolean>;
stdout: Schema.optional<Schema.Boolean>;
stderr: Schema.optional<Schema.Boolean>;
since: Schema.optional<Schema.Number>;
timestamps: Schema.optional<Schema.Boolean>;
tail: Schema.optional<Schema.String>;
}>>, never, never, HttpApiSchema.StreamUint8Array, Schema.toCodecJson<typeof NotFound | typeof InternalServerError | typeof ServiceUnavailable>, never, never>, false>>;
declare const Tasks_base: Context.ServiceClass<Tasks, "@the-moby-effect/endpoints/Tasks", {
list: (filters?: Schema.Schema.Type<typeof TaskListFilters>) => Effect.Effect<readonly SwarmTask[], DockerError, never>;
inspect: (id: string) => Effect.Effect<SwarmTask, DockerError, never>;
logs: (id: string, options?: {
readonly details?: boolean | undefined;
readonly follow?: boolean | undefined;
readonly stdout?: boolean | undefined;
readonly stderr?: boolean | undefined;
readonly since?: number | undefined;
readonly timestamps?: boolean | undefined;
readonly tail?: string | undefined;
}) => Effect.Effect<Stream.Stream<string, DockerError, never>, DockerError, never>;
}> & {
readonly make: Effect.Effect<{
list: (filters?: Schema.Schema.Type<typeof TaskListFilters>) => Effect.Effect<readonly SwarmTask[], DockerError, never>;
inspect: (id: string) => Effect.Effect<SwarmTask, DockerError, never>;
logs: (id: string, options?: {
readonly details?: boolean | undefined;
readonly follow?: boolean | undefined;
readonly stdout?: boolean | undefined;
readonly stderr?: boolean | undefined;
readonly since?: number | undefined;
readonly timestamps?: boolean | undefined;
readonly tail?: string | undefined;
}) => Effect.Effect<Stream.Stream<string, DockerError, never>, DockerError, never>;
}, never, HttpClient.HttpClient>;
};
/**
* A task is a container running on a swarm. It is the atomic scheduling unit of
* swarm. Swarm mode must be enabled for these endpoints to work.
*
* @since 1.0.0
* @category Services
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Task
*/
export declare class Tasks extends Tasks_base {
}
/**
* A task is a container running on a swarm. It is the atomic scheduling unit of
* swarm. Swarm mode must be enabled for these endpoints to work.
*
* @since 1.0.0
* @category Layers
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Task
*/
export declare const TasksLayer: Layer.Layer<Tasks, never, HttpClient.HttpClient>;
/**
* A task is a container running on a swarm. It is the atomic scheduling unit of
* swarm. Swarm mode must be enabled for these endpoints to work.
*
* @since 1.0.0
* @category Layers
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Task
*/
export declare const TasksLayerLocalSocket: Layer.Layer<Tasks, never, HttpClient.HttpClient>;
export {};
//# sourceMappingURL=tasks.d.ts.map