@quatronic/qore 0.2.0-rc.5 → 0.2.0-rc.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/README.md CHANGED
@@ -35,8 +35,8 @@ qore logs --env stag --level error # error logs
35
35
 
36
36
  ### Portals
37
37
 
38
- `qore` talks to `prod` by default. Pass `--portal staging` to use the
39
- staging portal, or `--portal https://your-portal.example` for anything
38
+ `qore` talks to `prod` by default. Pass `--portal staging` or
39
+ `--portal testing` to use those portals, or `--portal https://your-portal.example` for anything
40
40
  else (only accepted on `qore login`, which then pins the identity provider
41
41
  it reports).
42
42
 
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="543a2472-7f79-5212-8151-659476b9d745")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4be6a705-edee-51df-8b0e-e26c3410dcc4")}catch(e){}}();
4
4
  import { createRequire as __qoreCreateRequire } from "node:module"; const require = __qoreCreateRequire(import.meta.url);
5
5
  import {
6
6
  addSecretValues,
@@ -450,7 +450,7 @@ async function withProxyHint(deps2, e) {
450
450
  return proxy ? withSystemProxy(e, proxy, deps2.platform) : e;
451
451
  }
452
452
  function buildProgram(deps2, io2, signal, register, setExitCode) {
453
- const program = new Command("qore").description("Qore developer CLI").option("--portal <name|url>", "prod, staging, or a portal URL (default: the portal you last logged in to, else prod)").option("--json", "print exactly one JSON document on stdout").option("--no-input", "never prompt").option("--verbose", "log request lines (never secrets)").option("--no-color", "disable colours").exitOverride().configureOutput({ writeOut: (s) => io2.out(s.trimEnd()), writeErr: (s) => io2.err(s.trimEnd()) });
453
+ const program = new Command("qore").description("Qore developer CLI").option("--portal <name|url>", "prod, staging, testing, or a portal URL (default: the portal you last logged in to, else prod)").option("--json", "print exactly one JSON document on stdout").option("--no-input", "never prompt").option("--verbose", "log request lines (never secrets)").option("--no-color", "disable colours").exitOverride().configureOutput({ writeOut: (s) => io2.out(s.trimEnd()), writeErr: (s) => io2.err(s.trimEnd()) });
454
454
  const ctx = { deps: deps2, io: io2, signal, opts: () => program.opts(), setExitCode };
455
455
  for (const r of register) r(program, ctx);
456
456
  return program;
@@ -609,6 +609,10 @@ var BUILTIN_PORTALS = {
609
609
  staging: {
610
610
  apiOrigin: "https://p01--portal-api-staging--hcywmtb2vksv.code.run",
611
611
  pinnedIssuer: "https://auth-staging.quatronic.app/realms/platform-staging"
612
+ },
613
+ testing: {
614
+ apiOrigin: "https://api.qore-testing.quatronic.app",
615
+ pinnedIssuer: "https://auth-testing.quatronic.app/realms/platform-testing"
612
616
  }
613
617
  };
614
618
  function builtinFor(origin) {
@@ -623,7 +627,7 @@ function toOrigin(raw) {
623
627
  url = new URL(raw);
624
628
  } catch {
625
629
  throw new QoreError("QORE_CONTEXT_INVALID", `Not a portal name or URL: ${raw}`, {
626
- hint: "Use --portal prod, --portal staging or --portal https://\u2026"
630
+ hint: "Use --portal prod, --portal staging, --portal testing or --portal https://\u2026"
627
631
  });
628
632
  }
629
633
  const loopback = url.hostname === "localhost" || url.hostname === "127.0.0.1";
@@ -636,6 +640,7 @@ function resolvePortal(arg, defaultProfile) {
636
640
  const chosen = arg ?? defaultProfile;
637
641
  if (chosen === void 0 || chosen === "prod") return { ...BUILTIN_PORTALS.prod, builtin: "prod" };
638
642
  if (chosen === "staging") return { ...BUILTIN_PORTALS.staging, builtin: "staging" };
643
+ if (chosen === "testing") return { ...BUILTIN_PORTALS.testing, builtin: "testing" };
639
644
  const origin = toOrigin(chosen);
640
645
  return builtinFor(origin) ?? { apiOrigin: origin, pinnedIssuer: null, builtin: null };
641
646
  }
@@ -1990,7 +1995,7 @@ async function workspaceRoot(deps2) {
1990
1995
  }
1991
1996
  function profileOrder(cfg, cachedOrigins, portalArg, wsPortal) {
1992
1997
  if (portalArg) return [resolvePortal(portalArg, cfg.defaultProfile)];
1993
- const rank = (o) => o === BUILTIN_PORTALS.prod.apiOrigin ? 0 : o === BUILTIN_PORTALS.staging.apiOrigin ? 1 : 2;
1998
+ const rank = (o) => o === BUILTIN_PORTALS.prod.apiOrigin ? 0 : o === BUILTIN_PORTALS.staging.apiOrigin ? 1 : o === BUILTIN_PORTALS.testing.apiOrigin ? 2 : 3;
1994
1999
  const rest = Object.keys(cfg.profiles).sort((a, b) => rank(a) - rank(b) || a.localeCompare(b));
1995
2000
  const cached2 = cachedOrigins.filter((c) => cfg.profiles[c]);
1996
2001
  const origins = [...wsPortal ? [wsPortal.apiOrigin] : [], ...cached2, resolvePortal(void 0, cfg.defaultProfile).apiOrigin, ...rest];
@@ -5554,7 +5559,7 @@ async function checkRepoNode(deps2, m, recipe, pkg, signal, ms2) {
5554
5559
  return ok(`Node ${found ?? "?"} (engines ${pkg.engines.node})`);
5555
5560
  }
5556
5561
  async function loggedInPortals(deps2, profiles) {
5557
- const rank = (o) => o === BUILTIN_PORTALS.prod.apiOrigin ? 0 : o === BUILTIN_PORTALS.staging.apiOrigin ? 1 : 2;
5562
+ const rank = (o) => o === BUILTIN_PORTALS.prod.apiOrigin ? 0 : o === BUILTIN_PORTALS.staging.apiOrigin ? 1 : o === BUILTIN_PORTALS.testing.apiOrigin ? 2 : 3;
5558
5563
  const out = [];
5559
5564
  for (const origin of Object.keys(profiles).sort((a, b) => rank(a) - rank(b) || a.localeCompare(b))) {
5560
5565
  const p = profiles[origin];
@@ -7957,7 +7962,12 @@ async function connectPostgres(url, o) {
7957
7962
 
7958
7963
  // src/buildInfo.ts
7959
7964
  var SENTRY_DSN = true ? "https://50b592efb53dbc1a31cb10d3945c6d52@o4512129906049024.ingest.de.sentry.io/4512174341750864" : "";
7960
- var SENTRY_ENVIRONMENT = false ? "production" : "development";
7965
+ function sentryEnvironment(version) {
7966
+ if (version === "0.0.0-dev") return "development";
7967
+ if (version.includes("-rc.")) return "next";
7968
+ if (version.includes("-test.")) return "test";
7969
+ return "production";
7970
+ }
7961
7971
 
7962
7972
  // src/platform/proxy.ts
7963
7973
  import { execFile as execFile3 } from "child_process";
@@ -8021,7 +8031,16 @@ function systemProxy(platform = process.platform) {
8021
8031
  }
8022
8032
 
8023
8033
  // src/version.ts
8024
- var VERSION = true ? "0.2.0-rc.5" : "0.0.0-dev";
8034
+ import { readFileSync } from "fs";
8035
+ function readVersion() {
8036
+ try {
8037
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
8038
+ return typeof pkg.version === "string" ? pkg.version : "0.0.0-dev";
8039
+ } catch {
8040
+ return "0.0.0-dev";
8041
+ }
8042
+ }
8043
+ var VERSION = readVersion();
8025
8044
 
8026
8045
  // src/cli.ts
8027
8046
  if (process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY) setGlobalDispatcher(new EnvHttpProxyAgent());
@@ -8068,7 +8087,7 @@ var deps = {
8068
8087
  telemetry.registerSecrets(values);
8069
8088
  },
8070
8089
  sentryDsn: SENTRY_DSN,
8071
- sentryEnvironment: SENTRY_ENVIRONMENT,
8090
+ sentryEnvironment: sentryEnvironment(VERSION),
8072
8091
  systemProxy: () => systemProxy(process.platform),
8073
8092
  viewerDir: fileURLToPath(new URL("../viewer/dist/", import.meta.url)),
8074
8093
  postgres: connectPostgres
@@ -8101,4 +8120,4 @@ if (!drained) {
8101
8120
  process.exit();
8102
8121
  }
8103
8122
  //# sourceMappingURL=cli.js.map
8104
- //# debugId=543a2472-7f79-5212-8151-659476b9d745
8123
+ //# debugId=4be6a705-edee-51df-8b0e-e26c3410dcc4
@@ -0,0 +1,11 @@
1
+ {
2
+ "capabilities": [
3
+ "app.modules",
4
+ "module.local-env",
5
+ "module.local-roles",
6
+ "module.local-roles-announce",
7
+ "module.observability",
8
+ "module.status",
9
+ "repo.resolve"
10
+ ]
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatronic/qore",
3
- "version": "0.2.0-rc.5",
3
+ "version": "0.2.0-rc.7",
4
4
  "description": "Qore developer CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,6 +8,7 @@
8
8
  },
9
9
  "files": [
10
10
  "dist/**/*.js",
11
+ "dist/qore-capabilities.json",
11
12
  "schema",
12
13
  "viewer/dist",
13
14
  "README.md"
@@ -25,7 +26,7 @@
25
26
  "url": "git+https://github.com/Quatronic-IT/qore-cli.git"
26
27
  },
27
28
  "scripts": {
28
- "build": "tsup && vite build --config viewer/vite.config.ts",
29
+ "build": "tsup && vite build --config viewer/vite.config.ts && node scripts/capabilities.mjs > dist/qore-capabilities.json",
29
30
  "build:viewer": "vite build --config viewer/vite.config.ts",
30
31
  "test": "vitest run",
31
32
  "test:watch": "vitest",