@mx-space/cli 0.6.7 → 0.6.8

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.
package/dist/bin/mxs.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { t as run } from "../mxs-DvtFbS0U.mjs";
2
+ import { t as run } from "../mxs-CCNd5SIa.mjs";
3
3
  export { run };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-DvtFbS0U.mjs";
1
+ import { a as defaultMessageFor, c as tagToCode, i as codeForTag, l as toErrorEnvelope, n as defaultGlobalFlags, o as exitCodeForError, r as parseGlobalFlags, s as exitCodeForTag, t as run } from "./mxs-CCNd5SIa.mjs";
2
2
  export { codeForTag, defaultGlobalFlags, defaultMessageFor, exitCodeForError, exitCodeForTag, parseGlobalFlags, run, tagToCode, toErrorEnvelope };
@@ -9821,6 +9821,8 @@ const parseApiUrl = (input) => gen(function* () {
9821
9821
  baseUrl: match[1],
9822
9822
  apiVersion: Number(match[2])
9823
9823
  };
9824
+ const apiSuffix = url.match(/^(.*)\/api$/);
9825
+ if (apiSuffix) return { baseUrl: apiSuffix[1] };
9824
9826
  return { baseUrl: url };
9825
9827
  });
9826
9828
  const PROFILES_SUBDIR = "profiles";
@@ -27523,10 +27525,20 @@ const login = make$13("login", { production: production$1 }, ({ production }) =>
27523
27525
  targetProfile = flagProfile?.trim() || (yield* config.readCurrent);
27524
27526
  }
27525
27527
  yield* renderer.emitInfoBlock(({ color }) => `${arrow(`probing ${apiUrl}…`, color)}`);
27526
- const probeResult = yield* auth.probe(apiUrl).pipe(mapError((e) => new Generic({
27527
- message: e.message ?? "auth probe failed",
27528
- cause: e
27529
- })));
27528
+ const probeResult = yield* auth.probe(apiUrl).pipe(catchTags({
27529
+ NetworkTimeout: (e) => fail$2(new Generic({
27530
+ message: e.message ?? "auth probe failed",
27531
+ cause: e
27532
+ })),
27533
+ NetworkDns: (e) => fail$2(new Generic({
27534
+ message: e.message ?? "auth probe failed",
27535
+ cause: e
27536
+ })),
27537
+ NetworkRefused: (e) => fail$2(new Generic({
27538
+ message: e.message ?? "auth probe failed",
27539
+ cause: e
27540
+ }))
27541
+ }));
27530
27542
  const code = yield* auth.requestDeviceCode(probeResult.authBase, DEFAULT_CLIENT_ID);
27531
27543
  yield* renderer.emitInfoBlock(({ color }) => {
27532
27544
  const ttl = humanDuration(code.expires_in);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/cli",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "Command line interface for mx-space (mx-core) — auth, content, configuration",
5
5
  "keywords": [
6
6
  "mx-space",