@gjermundgaraba/clankerbox-sdk 0.12.1 → 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, normally a profile's `host`. A full ID in `target` wins over it. */
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. `target` is a full ID, which names its host, or a name: then the
268
- * options' host, or else the first host in the list that offers the spec's base.
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: (target: string, spec: MachineSpec, options?: CreateOptions) => Effect.Effect<Machine, ClankerboxError>;
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.1";
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 = (target, spec, options) => Effect.gen(function* () {
547
- if (isId(target)) {
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 { Capacity as A, hostErrors as B, HostId as C, isId as D, formatId as E, Internal as F, Invalid as I, NotFound as L, ConflictKind as M, ErrorTag as N, parseId as O, HostErrorTag as P, Precondition 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, Conflict as j, parseName 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, Unavailable as z };
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-BVzrg2pq.mjs";
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 Capacity, B as hostErrors, C as HostId, D as isId, E as formatId, F as Internal, I as Invalid, L as NotFound, M as ConflictKind, N as ErrorTag, O as parseId, P as HostErrorTag, R as Precondition, 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 Conflict, k as parseName, 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 Unavailable } from "./client-CbgD_J1o.mjs";
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, isId, loadProfile, packRecipe, parseId, parseName, readSetup, readTimeout, release, version, versionHeader };
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-BVzrg2pq.mjs";
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
@@ -1,4 +1,4 @@
1
- import { r as make, t as Client } from "./client-CbgD_J1o.mjs";
1
+ import { r as make, t as Client } from "./client-DXuiPvxU.mjs";
2
2
  import { Layer } from "effect";
3
3
  import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient";
4
4
  //#region src/node.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjermundgaraba/clankerbox-sdk",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "clankerbox's API contract and client library, for Effect",
5
5
  "license": "MIT",
6
6
  "repository": {