@camox/cli 0.60.2 → 0.61.0

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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as installLocalhostDns } from "./local-dns-DQIT1ucr.mjs";
2
+ import { t as installLocalhostDns } from "./local-dns-C3ccfrzD.mjs";
3
3
  import { createORPCClient } from "@orpc/client";
4
4
  import { RPCLink } from "@orpc/client/fetch";
5
5
  //#region src/lib/uuid.ts
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export { r as verifySession } from "./api-CRGaFBkN.mjs";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as installLocalhostDns } from "./local-dns-DQIT1ucr.mjs";
2
+ import { t as installLocalhostDns } from "./local-dns-C3ccfrzD.mjs";
3
3
  import path from "node:path";
4
4
  import fs from "node:fs";
5
5
  import os from "node:os";
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { t as installLocalhostDns } from "./local-dns-DQIT1ucr.mjs";
3
- import { i as UUID, n as pushCode, t as createCodeReadToken } from "./api-DU0iBFMw.mjs";
4
- import { a as removeAuthTokenForUrl, i as readAuthTokenForUrl, o as verifyOneTimeToken, s as writeAuthTokenForUrl } from "./auth-core-BpVsNVnR.mjs";
2
+ import { t as installLocalhostDns } from "./local-dns-C3ccfrzD.mjs";
3
+ import { i as UUID, n as pushCode, t as createCodeReadToken } from "./api-CRGaFBkN.mjs";
4
+ import { a as removeAuthTokenForUrl, i as readAuthTokenForUrl, o as verifyOneTimeToken, s as writeAuthTokenForUrl } from "./auth-core-BOANKWGQ.mjs";
5
5
  import { object, or } from "@optique/core/constructs";
6
6
  import { message } from "@optique/core/message";
7
7
  import { defineProgram } from "@optique/core/program";
@@ -119,7 +119,7 @@ async function authenticateUser() {
119
119
  async function getOrAuthenticate() {
120
120
  const stored = readAuthToken();
121
121
  if (stored) {
122
- const { verifySession } = await import("./api-DOHUrl0V.mjs");
122
+ const { verifySession } = await import("./api-D1v4nyZr.mjs");
123
123
  if (await verifySession(stored.token)) {
124
124
  p.log.info(`Authenticated as ${stored.name}`);
125
125
  return stored;
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export { t as createPreviewSignInUrl, n as isLoopbackUrl, r as normalizeUrl, i as readAuthTokenForUrl, a as removeAuthTokenForUrl, o as verifyOneTimeToken, s as writeAuthTokenForUrl } from "../auth-core-BpVsNVnR.mjs";
2
+ export { t as createPreviewSignInUrl, n as isLoopbackUrl, r as normalizeUrl, i as readAuthTokenForUrl, a as removeAuthTokenForUrl, o as verifyOneTimeToken, s as writeAuthTokenForUrl } from "../auth-core-BOANKWGQ.mjs";
@@ -4,18 +4,19 @@ import dns from "node:dns";
4
4
  //#region src/lib/local-dns.ts
5
5
  const selectedHosts = /* @__PURE__ */ new Set();
6
6
  let installed = false;
7
+ /** `lookup`, resolving the selected hosts to 127.0.0.1. */
8
+ const toSelectedHosts = (lookup) => new Proxy(lookup, { apply(target, receiver, args) {
9
+ if (selectedHosts.has(args[0])) args[0] = "127.0.0.1";
10
+ return target.apply(receiver, args);
11
+ } });
7
12
  /** Resolve explicitly selected local backends without depending on OS wildcard DNS. */
8
13
  function installLocalhostDns(hostname) {
9
14
  if (!hostname.endsWith(".localhost")) return;
10
15
  selectedHosts.add(hostname);
11
16
  if (installed) return;
12
17
  installed = true;
13
- const handler = { apply(target, receiver, args) {
14
- if (selectedHosts.has(args[0])) args[0] = "127.0.0.1";
15
- return Reflect.apply(target, receiver, args);
16
- } };
17
- dns.lookup = new Proxy(dns.lookup, handler);
18
- dns.promises.lookup = new Proxy(dns.promises.lookup, handler);
18
+ dns.lookup = toSelectedHosts(dns.lookup);
19
+ dns.promises.lookup = toSelectedHosts(dns.promises.lookup);
19
20
  syncBuiltinESMExports();
20
21
  }
21
22
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camox/cli",
3
- "version": "0.60.2",
3
+ "version": "0.61.0",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "camox": "./dist/index.mjs"
@@ -28,7 +28,7 @@
28
28
  "devDependencies": {
29
29
  "@types/node": "^24.12.4",
30
30
  "vite-plus": "1.3.0",
31
- "@camox/api-contract": "0.60.2"
31
+ "@camox/api-contract": "0.61.0"
32
32
  },
33
33
  "nx": {
34
34
  "tags": [
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export { r as verifySession } from "./api-DU0iBFMw.mjs";