the-moby-effect
Version:
Moby/Docker API client built using effect-ts
165 lines • 9.33 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 { SwarmService, SwarmServiceSpec } from "../generated/index.ts";
import { DockerError } from "./circular.ts";
import { BadRequest, Conflict, Forbidden, InternalServerError, NotFound, ServiceUnavailable } from "./errors.ts";
/** @since 1.0.0 */
export declare const ListFilters: Schema.fromJsonString<Schema.Struct<{
readonly id: Schema.optional<Schema.$Array<Schema.String>>;
readonly label: Schema.optional<Schema.$Array<Schema.String>>;
readonly mode: Schema.optional<Schema.$Array<Schema.Literals<readonly ["replicated", "global"]>>>;
}>>;
/**
* Services are the definitions of tasks to run on a 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/Service
*/
export declare const ServicesApi: HttpApi.HttpApi<"ServicesApi", HttpApiGroup.HttpApiGroup<"services", HttpApiEndpoint.HttpApiEndpoint<"create", "POST", "/services/create", never, never, Schema.toCodecJson<typeof SwarmServiceSpec>, Schema.toCodecStringTree<Schema.Struct<{
"X-Registry-Auth": Schema.optional<Schema.String>;
}>>, Schema.toCodecJson<Schema.Struct<{
readonly ID: Schema.brand<Schema.String, "ServiceId">;
readonly Warnings: Schema.optional<Schema.$Array<Schema.String>>;
}>>, Schema.toCodecJson<typeof BadRequest | typeof Forbidden | typeof Conflict | typeof InternalServerError | typeof ServiceUnavailable>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"delete", "DELETE", "/services/:id", Schema.toCodecStringTree<Schema.Struct<{
id: Schema.String;
}>>, never, never, never, Schema.toCodecJson<Schema.Void>, Schema.toCodecJson<typeof NotFound | typeof InternalServerError | typeof ServiceUnavailable>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"inspect", "GET", "/services/:id", Schema.toCodecStringTree<Schema.Struct<{
id: Schema.String;
}>>, Schema.toCodecStringTree<Schema.Struct<{
insertDefaults: Schema.optional<Schema.Boolean>;
}>>, never, never, Schema.toCodecJson<typeof SwarmService>, Schema.toCodecJson<typeof NotFound | typeof InternalServerError | typeof ServiceUnavailable>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"list", "GET", "/services/", never, Schema.toCodecStringTree<Schema.Struct<{
filters: Schema.optional<Schema.fromJsonString<Schema.Struct<{
readonly id: Schema.optional<Schema.$Array<Schema.String>>;
readonly label: Schema.optional<Schema.$Array<Schema.String>>;
readonly mode: Schema.optional<Schema.$Array<Schema.Literals<readonly ["replicated", "global"]>>>;
}>>>;
status: Schema.optional<Schema.Boolean>;
}>>, never, never, Schema.toCodecJson<Schema.$Array<typeof SwarmService>>, Schema.toCodecJson<typeof InternalServerError | typeof ServiceUnavailable>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"logs", "GET", "/services/: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> | HttpApiEndpoint.HttpApiEndpoint<"update", "POST", "/services/:id/update", Schema.toCodecStringTree<Schema.Struct<{
id: Schema.String;
}>>, Schema.toCodecStringTree<Schema.Struct<{
version: Schema.Number;
rollback: Schema.optional<Schema.String>;
registryAuthFrom: Schema.optional<Schema.String>;
}>>, Schema.toCodecJson<typeof SwarmServiceSpec>, Schema.toCodecStringTree<Schema.Struct<{
"X-Registry-Auth": Schema.optional<Schema.String>;
}>>, Schema.toCodecJson<Schema.Struct<{
readonly Warnings: Schema.optional<Schema.$Array<Schema.String>>;
}>>, Schema.toCodecJson<typeof BadRequest | typeof NotFound | typeof InternalServerError | typeof ServiceUnavailable>, never, never>, false>>;
declare const Services_base: Context.ServiceClass<Services, "@the-moby-effect/endpoints/Services", {
list: (options?: {
readonly filters?: {
readonly id?: readonly string[] | undefined;
readonly label?: readonly string[] | undefined;
readonly mode?: readonly ("global" | "replicated")[] | undefined;
} | undefined;
readonly status?: boolean | undefined;
}) => Effect.Effect<readonly SwarmService[], DockerError, never>;
create: (payload: (typeof SwarmServiceSpec)["~type.make.in"]) => Effect.Effect<{
readonly ID: string & import("effect/Brand").Brand<"ServiceId">;
readonly Warnings?: readonly string[] | undefined;
}, DockerError, never>;
delete: (id: string) => Effect.Effect<void, DockerError, never>;
inspect: (id: string, options?: {
readonly insertDefaults?: boolean | undefined;
}) => Effect.Effect<SwarmService, DockerError, never>;
update: (id: string, options: {
readonly version: number;
readonly rollback?: string | undefined;
readonly registryAuthFrom?: string | undefined;
}, payload: (typeof SwarmServiceSpec)["~type.make.in"]) => Effect.Effect<{
readonly Warnings?: readonly string[] | undefined;
}, 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: (options?: {
readonly filters?: {
readonly id?: readonly string[] | undefined;
readonly label?: readonly string[] | undefined;
readonly mode?: readonly ("global" | "replicated")[] | undefined;
} | undefined;
readonly status?: boolean | undefined;
}) => Effect.Effect<readonly SwarmService[], DockerError, never>;
create: (payload: (typeof SwarmServiceSpec)["~type.make.in"]) => Effect.Effect<{
readonly ID: string & import("effect/Brand").Brand<"ServiceId">;
readonly Warnings?: readonly string[] | undefined;
}, DockerError, never>;
delete: (id: string) => Effect.Effect<void, DockerError, never>;
inspect: (id: string, options?: {
readonly insertDefaults?: boolean | undefined;
}) => Effect.Effect<SwarmService, DockerError, never>;
update: (id: string, options: {
readonly version: number;
readonly rollback?: string | undefined;
readonly registryAuthFrom?: string | undefined;
}, payload: (typeof SwarmServiceSpec)["~type.make.in"]) => Effect.Effect<{
readonly Warnings?: readonly string[] | undefined;
}, 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>;
};
/**
* Services are the definitions of tasks to run on a 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/Service
*/
export declare class Services extends Services_base {
}
/**
* Services are the definitions of tasks to run on a 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/Service
*/
export declare const ServicesLayer: Layer.Layer<Services, never, HttpClient.HttpClient>;
/**
* Services are the definitions of tasks to run on a 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/Service
*/
export declare const ServicesLayerLocalSocket: Layer.Layer<Services, never, HttpClient.HttpClient>;
export {};
//# sourceMappingURL=services.d.ts.map