@mx-space/cli 0.6.6 → 0.6.7

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-DUkVdHhE.mjs";
2
+ import { t as run } from "../mxs-DvtFbS0U.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-DUkVdHhE.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-DvtFbS0U.mjs";
2
2
  export { codeForTag, defaultGlobalFlags, defaultMessageFor, exitCodeForError, exitCodeForTag, parseGlobalFlags, run, tagToCode, toErrorEnvelope };
@@ -10042,7 +10042,7 @@ var Config = class Config extends Tag$2("Config")() {
10042
10042
  };
10043
10043
  //#endregion
10044
10044
  //#region src/services/Auth.ts
10045
- const SUPPORTED_API_VERSIONS = [2];
10045
+ const SUPPORTED_API_VERSIONS = [3, 2];
10046
10046
  var Auth = class Auth extends Tag$2("Auth")() {
10047
10047
  /** Build the Auth Layer; depends on `Config` and `HttpClient`. */
10048
10048
  static Default = effect(Auth, gen(function* () {
@@ -10112,13 +10112,19 @@ function makeAuthService(http, config) {
10112
10112
  version: null
10113
10113
  }];
10114
10114
  let lastTransport = null;
10115
+ const attempted = [];
10115
10116
  for (const cand of candidates) {
10116
- const result = yield* sendJson(`${apiUrl}${cand.prefix}/ok`, "GET", void 0, { accept: "application/json" }).pipe(either);
10117
+ const probeUrl = `${apiUrl}${cand.prefix}/ok`;
10118
+ const result = yield* sendJson(probeUrl, "GET", void 0, { accept: "application/json" }).pipe(either);
10117
10119
  if (result._tag === "Left") {
10118
10120
  lastTransport = result.left;
10119
10121
  continue;
10120
10122
  }
10121
10123
  const res = result.right;
10124
+ attempted.push({
10125
+ url: probeUrl,
10126
+ status: res.status
10127
+ });
10122
10128
  if (res.status >= 200 && res.status < 300) {
10123
10129
  const apiVersion = cand.version ?? SUPPORTED_API_VERSIONS[0];
10124
10130
  return {
@@ -10132,7 +10138,7 @@ function makeAuthService(http, config) {
10132
10138
  if (lastTransport && lastTransport._tag !== "Generic") return yield* fail$2(lastTransport);
10133
10139
  return yield* fail$2(new AuthProbe({
10134
10140
  message: "cannot detect auth endpoint",
10135
- hint: "verify the URL points at a running mx-core server"
10141
+ hint: `tried: ${attempted.length > 0 ? attempted.map((a) => `${a.url} → ${a.status}`).join(", ") : "no responses"}. supply the site root (e.g. https://blog.example.com), not the API path. verify the server is reachable and runs a supported API version (${SUPPORTED_API_VERSIONS.join(", ")}).`
10136
10142
  }));
10137
10143
  });
10138
10144
  const requestDeviceCode = (authBase, clientId, scope = "openid profile email") => gen(function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-space/cli",
3
- "version": "0.6.6",
3
+ "version": "0.6.7",
4
4
  "description": "Command line interface for mx-space (mx-core) — auth, content, configuration",
5
5
  "keywords": [
6
6
  "mx-space",