@gjermundgaraba/clankerbox-sdk 0.12.0 → 0.12.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.
|
@@ -253,7 +253,7 @@ interface Options {
|
|
|
253
253
|
readonly readTimeout?: Duration.Duration | undefined;
|
|
254
254
|
}
|
|
255
255
|
interface CreateOptions {
|
|
256
|
-
/** The host to create on
|
|
256
|
+
/** The host to create on instead of placing by base: a `--host` flag or a profile's `host`. */
|
|
257
257
|
readonly host?: string | undefined;
|
|
258
258
|
}
|
|
259
259
|
interface Interface {
|
|
@@ -264,10 +264,10 @@ interface Interface {
|
|
|
264
264
|
readonly machine: (id: string) => Effect.Effect<Machine, ClankerboxError>;
|
|
265
265
|
readonly checkpoint: (id: string) => Effect.Effect<Checkpoint, ClankerboxError>;
|
|
266
266
|
/**
|
|
267
|
-
* Creates a machine
|
|
268
|
-
*
|
|
267
|
+
* Creates a machine named `name` on the options' host, or else on the first host in the
|
|
268
|
+
* list that offers the spec's base.
|
|
269
269
|
*/
|
|
270
|
-
readonly create: (
|
|
270
|
+
readonly create: (name: string, spec: MachineSpec, options?: CreateOptions) => Effect.Effect<Machine, ClankerboxError>;
|
|
271
271
|
readonly start: (id: string) => Effect.Effect<Machine, ClankerboxError>;
|
|
272
272
|
readonly stop: (id: string) => Effect.Effect<Machine, ClankerboxError>;
|
|
273
273
|
readonly delete: (id: string) => Effect.Effect<void, ClankerboxError>;
|
|
@@ -107,8 +107,6 @@ const describeId = (id) => {
|
|
|
107
107
|
};
|
|
108
108
|
/** A full `<host>_<name>` ID. */
|
|
109
109
|
const Id = Schema.String.check(Schema.makeFilter((id) => describeId(id) ?? true));
|
|
110
|
-
/** Whether `create`'s target is a full ID rather than a bare name: a name has no `_`. */
|
|
111
|
-
const isId = (target) => target.includes(separator);
|
|
112
110
|
/** Splits an ID at its `_` into host and name. */
|
|
113
111
|
const parseId = (id) => {
|
|
114
112
|
const problem = describeId(id);
|
|
@@ -129,7 +127,7 @@ const formatId = (host, name) => {
|
|
|
129
127
|
};
|
|
130
128
|
//#endregion
|
|
131
129
|
//#region package.json
|
|
132
|
-
var version$1 = "0.12.
|
|
130
|
+
var version$1 = "0.12.2";
|
|
133
131
|
//#endregion
|
|
134
132
|
//#region src/resources.ts
|
|
135
133
|
/** The resources a host reports: machines, checkpoints and the host itself. */
|
|
@@ -543,12 +541,8 @@ const make = (hosts, options) => Effect.gen(function* () {
|
|
|
543
541
|
access: "read"
|
|
544
542
|
}) : new Precondition({ message });
|
|
545
543
|
}).pipe(Effect.scoped);
|
|
546
|
-
const create = (
|
|
547
|
-
|
|
548
|
-
const { host, name } = yield* parseId(target);
|
|
549
|
-
return yield* createOn(host, name, spec);
|
|
550
|
-
}
|
|
551
|
-
const name = yield* parseName(target);
|
|
544
|
+
const create = (name, spec, options) => Effect.gen(function* () {
|
|
545
|
+
yield* parseName(name);
|
|
552
546
|
if (options?.host !== void 0) return yield* createOn(options.host, name, spec);
|
|
553
547
|
return yield* createOn(yield* place(spec.base), name, spec);
|
|
554
548
|
});
|
|
@@ -580,4 +574,4 @@ const make = (hosts, options) => Effect.gen(function* () {
|
|
|
580
574
|
};
|
|
581
575
|
});
|
|
582
576
|
//#endregion
|
|
583
|
-
export {
|
|
577
|
+
export { Conflict as A, HostId as C, parseId as D, formatId as E, Invalid as F, NotFound as I, Precondition as L, ErrorTag as M, HostErrorTag as N, parseName as O, Internal as P, Unavailable as R, version as S, Name as T, Profile as _, HostGroup as a, SshEndpoint as b, readTimeout as c, ActionRecord as d, Checkpoint as f, MachineSpec as g, Machine as h, CheckpointGroup as i, ConflictKind as j, Capacity as k, versionHeader as l, Host as m, client_exports as n, Http as o, CreateRequest as p, make as r, MachineGroup as s, Client as t, ActionName as u, Runtime as v, Id as w, release as x, Setup as y, hostErrors as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as hostErrors, C as HostError, D as NotFound, E as Invalid, O as Precondition, S as ErrorTag, T as Internal, _ as version, a as ActionName, b as Conflict, c as CreateRequest, d as MachineSpec, f as Profile, g as release, h as SshEndpoint, i as client_d_exports, k as Unavailable, l as Host, m as Setup, o as ActionRecord, p as Runtime, s as Checkpoint, u as Machine, v as Capacity, w as HostErrorTag, x as ConflictKind, y as ClankerboxError } from "./client-
|
|
1
|
+
import { A as hostErrors, C as HostError, D as NotFound, E as Invalid, O as Precondition, S as ErrorTag, T as Internal, _ as version, a as ActionName, b as Conflict, c as CreateRequest, d as MachineSpec, f as Profile, g as release, h as SshEndpoint, i as client_d_exports, k as Unavailable, l as Host, m as Setup, o as ActionRecord, p as Runtime, s as Checkpoint, u as Machine, v as Capacity, w as HostErrorTag, x as ConflictKind, y as ClankerboxError } from "./client-C6ll48AB.mjs";
|
|
2
2
|
import * as Action from "@gjermundgaraba/effect-actions/Action";
|
|
3
3
|
import * as ActionGroup from "@gjermundgaraba/effect-actions/ActionGroup";
|
|
4
4
|
import * as ActionHttp from "@gjermundgaraba/effect-actions/ActionHttp";
|
|
@@ -539,8 +539,6 @@ export interface IdParts {
|
|
|
539
539
|
}
|
|
540
540
|
/** A full `<host>_<name>` ID. */
|
|
541
541
|
export declare const Id: Schema.String;
|
|
542
|
-
/** Whether `create`'s target is a full ID rather than a bare name: a name has no `_`. */
|
|
543
|
-
export declare const isId: (target: string) => boolean;
|
|
544
542
|
/** Splits an ID at its `_` into host and name. */
|
|
545
543
|
export declare const parseId: (id: string) => Effect.Effect<IdParts, Invalid>;
|
|
546
544
|
/** Checks a name on its own, before it is joined to a host. */
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as Conflict, C as HostId, D as parseId, E as formatId, F as Invalid, I as NotFound, L as Precondition, M as ErrorTag, N as HostErrorTag, O as parseName, P as Internal, R as Unavailable, S as version, T as Name, _ as Profile, a as HostGroup, b as SshEndpoint, c as readTimeout, d as ActionRecord, f as Checkpoint, g as MachineSpec, h as Machine, i as CheckpointGroup, j as ConflictKind, k as Capacity, l as versionHeader, m as Host, n as client_exports, o as Http, p as CreateRequest, s as MachineGroup, u as ActionName, v as Runtime, w as Id, x as release, y as Setup, z as hostErrors } from "./client-DXuiPvxU.mjs";
|
|
2
2
|
import { Effect, FileSystem, Path, Predicate, Schema, Stream } from "effect";
|
|
3
3
|
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
|
4
4
|
//#region src/profile.ts
|
|
@@ -103,4 +103,4 @@ const readSetup = (path) => Effect.gen(function* () {
|
|
|
103
103
|
return yield* fs.readFileString(path);
|
|
104
104
|
}).pipe(Effect.catchTag("PlatformError", (error) => Effect.fail(new Invalid({ message: `couldn't read setup ${path}: ${error.message}` }))));
|
|
105
105
|
//#endregion
|
|
106
|
-
export { ActionName, ActionRecord, Capacity, Checkpoint, CheckpointGroup, client_exports as Client, Conflict, ConflictKind, CreateRequest, ErrorTag, Host, HostErrorTag, HostGroup, HostId, Http, Id, Internal, Invalid, Machine, MachineGroup, MachineSpec, Name, NotFound, Precondition, Profile, Runtime, Setup, SshEndpoint, Unavailable, formatId, hostErrors,
|
|
106
|
+
export { ActionName, ActionRecord, Capacity, Checkpoint, CheckpointGroup, client_exports as Client, Conflict, ConflictKind, CreateRequest, ErrorTag, Host, HostErrorTag, HostGroup, HostId, Http, Id, Internal, Invalid, Machine, MachineGroup, MachineSpec, Name, NotFound, Precondition, Profile, Runtime, Setup, SshEndpoint, Unavailable, formatId, hostErrors, loadProfile, packRecipe, parseId, parseName, readSetup, readTimeout, release, version, versionHeader };
|
package/dist/node.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Invalid, n as HostEntry, r as Options, t as Client } from "./client-
|
|
1
|
+
import { E as Invalid, n as HostEntry, r as Options, t as Client } from "./client-C6ll48AB.mjs";
|
|
2
2
|
import { Layer } from "effect";
|
|
3
3
|
//#region src/node.d.ts
|
|
4
4
|
/** Node's `http` module sets no timeout of its own: a mutation can run for hours. */
|
package/dist/node.mjs
CHANGED