@camstack/server 1.2.779 → 1.2.781
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/CHANGELOG.md +22 -0
- package/dist/agent/main.js +5 -1
- package/dist/agent/stale-addon-gate.js +52 -15
- package/dist/api/addon-upload.js +41 -0
- package/dist/api/core/cap-providers.js +19 -29
- package/dist/api/core/integration-role.js +15 -2
- package/dist/api/tarball-manifest.js +10 -1
- package/dist/api/trpc/cap-router-runtime.js +18 -9
- package/dist/api/trpc/generated-cap-mounts.js +1 -9
- package/dist/api/trpc/generated-cap-routers.js +9 -88
- package/dist/core/addon/addon-package.service.js +24 -8
- package/dist/core/addon/addon-registry.service.js +61 -10
- package/dist/core/addon/hub-spawn-gate.js +92 -0
- package/dist/core/addon/integration-instances-provider.js +22 -0
- package/dist/core/agent/agent-registry.service.js +6 -2
- package/dist/core/agent/delivery-requirements.js +22 -6
- package/dist/core/updates/required-addon-update.js +188 -0
- package/dist/launcher.js +4 -0
- package/dist/manual-boot.js +27 -0
- package/dist/server-root/index.js +74 -3
- package/package.json +7 -11
- package/system/dist/addon-runner.js +188 -5
- package/system/dist/addon-runner.mjs +189 -6
- package/system/dist/{agent-https-swBZI1iJ.js → agent-https-A9wsxVGn.js} +1 -1
- package/system/dist/{agent-https-BrINLeNj.mjs → agent-https-DuxDC67S.mjs} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/migrations/migrations-provider.d.ts +5 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +12 -4
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +12 -4
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{capture-engine-D_ImDrdj.mjs → capture-engine-CEChNpAD.mjs} +1 -1
- package/system/dist/{capture-engine-BXV6UiHl.js → capture-engine-D6mXfLFQ.js} +1 -1
- package/system/dist/{composition-sources-BjktkDte.mjs → composition-sources-6XYW86Kw.mjs} +1 -1
- package/system/dist/{composition-sources-DjTxqryW.js → composition-sources-cVWKVph4.js} +1 -1
- package/system/dist/{constants-CGXiM2LV.js → constants-B5Yg02ii.js} +1 -1
- package/system/dist/{constants-C68806R6.mjs → constants-DqwDEYfb.mjs} +1 -1
- package/system/dist/{device-ca-D_q1MiQ3.js → device-ca-BVz14dRd.js} +1 -1
- package/system/dist/{device-ca-CFRagVlE.mjs → device-ca-oY4Xqd7s.mjs} +1 -1
- package/system/dist/{dist-C9Ms2Ul9.js → dist-B4wrqheM.js} +833 -631
- package/system/dist/{dist-BzpjKSec.mjs → dist-BX8nZeXV.mjs} +804 -632
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-CFsSp0tc.mjs → hub-mdns-ciao-BDPMfOgq.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-C87S9O_n.js → hub-mdns-ciao-CiMMA0rT.js} +2 -2
- package/system/dist/index.js +441 -31
- package/system/dist/index.mjs +436 -33
- package/system/dist/kernel/addon-installer.d.ts +44 -1
- package/system/dist/kernel/held-installs.d.ts +21 -0
- package/system/dist/kernel/index.d.ts +6 -0
- package/system/dist/kernel/moleculer/migration-api-facade.d.ts +73 -0
- package/system/dist/kernel/moleculer/trpc-links.d.ts +8 -0
- package/system/dist/kernel/requires-registry.d.ts +31 -0
- package/system/dist/{legacy-integration-rows-door-CI-AaB-M.mjs → legacy-integration-rows-door-DDA3YOxL.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-C_aaT1DH.js → legacy-integration-rows-door-YuWqHZW4.js} +1 -1
- package/system/dist/migrations/hub/__fixtures__/seed.d.ts +23 -0
- package/system/dist/{restore-archive-D3K33hws.mjs → restore-archive-BrtpgNCt.mjs} +82 -82
- package/system/dist/{restore-archive-BC8OECG8.js → restore-archive-Cn9OShm4.js} +1 -1
- package/system/dist/{wal-maintenance-Bf9m0JZr.js → wal-maintenance-BTzu3s-6.js} +0 -0
- package/system/dist/{wal-maintenance-CMjTxyAC.mjs → wal-maintenance-jgyV9NbL.mjs} +0 -0
- package/system/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
2
|
+
const require_wal_maintenance = require("./wal-maintenance-BTzu3s-6.js");
|
|
3
3
|
let node_worker_threads = require("node:worker_threads");
|
|
4
4
|
//#region src/builtins/sqlite-storage/file-host-worker.ts
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-
|
|
1
|
+
import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-jgyV9NbL.mjs";
|
|
2
2
|
import { parentPort, threadId, workerData } from "node:worker_threads";
|
|
3
3
|
//#region src/builtins/sqlite-storage/file-host-worker.ts
|
|
4
4
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { dc as userError } from "./dist-BX8nZeXV.mjs";
|
|
3
3
|
import { f as X509Certificate$1 } from "./x509.es-BRiJgOvu.mjs";
|
|
4
|
-
import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-
|
|
4
|
+
import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-DuxDC67S.mjs";
|
|
5
5
|
import { X509Certificate, createPrivateKey } from "node:crypto";
|
|
6
6
|
import { writeOwnerOnlyFileSync } from "@camstack/types/node";
|
|
7
7
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-B4wrqheM.js");
|
|
3
3
|
const require_x509_es = require("./x509.es-WtnRNyYS.js");
|
|
4
|
-
const require_agent_https = require("./agent-https-
|
|
4
|
+
const require_agent_https = require("./agent-https-A9wsxVGn.js");
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
6
6
|
let _camstack_types_node = require("@camstack/types/node");
|
|
7
7
|
let node_fs_promises = require("node:fs/promises");
|
package/system/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
4
|
-
const require_device_ca = require("./device-ca-
|
|
3
|
+
const require_dist = require("./dist-B4wrqheM.js");
|
|
4
|
+
const require_device_ca = require("./device-ca-BVz14dRd.js");
|
|
5
5
|
const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
|
|
6
6
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
7
7
|
require("./builtins/alerts/index.js");
|
|
@@ -26,22 +26,22 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
|
|
|
26
26
|
const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
|
|
27
27
|
const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
|
|
28
28
|
const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
|
|
29
|
-
const require_wal_maintenance = require("./wal-maintenance-
|
|
30
|
-
const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-
|
|
29
|
+
const require_wal_maintenance = require("./wal-maintenance-BTzu3s-6.js");
|
|
30
|
+
const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-YuWqHZW4.js");
|
|
31
31
|
const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
|
|
32
32
|
const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
|
|
33
33
|
const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
|
|
34
34
|
require("./builtins/storage-orchestrator/index.js");
|
|
35
|
-
const require_agent_https = require("./agent-https-
|
|
36
|
-
const require_constants = require("./constants-
|
|
35
|
+
const require_agent_https = require("./agent-https-A9wsxVGn.js");
|
|
36
|
+
const require_constants = require("./constants-B5Yg02ii.js");
|
|
37
37
|
const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
|
|
38
38
|
require("./builtins/system-config/index.js");
|
|
39
39
|
const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
|
|
40
40
|
const require_custom_action_registry = require("./custom-action-registry-JuMHGKEc.js");
|
|
41
|
-
const require_hub_mdns_ciao = require("./hub-mdns-ciao-
|
|
41
|
+
const require_hub_mdns_ciao = require("./hub-mdns-ciao-CiMMA0rT.js");
|
|
42
42
|
const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
|
|
43
43
|
const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
|
|
44
|
-
const require_restore_archive = require("./restore-archive-
|
|
44
|
+
const require_restore_archive = require("./restore-archive-Cn9OShm4.js");
|
|
45
45
|
const require_coral_accelerators = require("./coral-accelerators-BSVsBVzt.js");
|
|
46
46
|
let zod = require("zod");
|
|
47
47
|
let node_crypto = require("node:crypto");
|
|
@@ -6382,7 +6382,7 @@ async function ensureAddonNativePrebuilds(addonDir, options) {
|
|
|
6382
6382
|
* if dependencies were installed when they were not.
|
|
6383
6383
|
*/
|
|
6384
6384
|
var execFileAsync$5 = (0, node_util.promisify)(node_child_process.execFile);
|
|
6385
|
-
var DEFAULT_REGISTRY = "https://registry.npmjs.org";
|
|
6385
|
+
var DEFAULT_REGISTRY$1 = "https://registry.npmjs.org";
|
|
6386
6386
|
/** Where the bootstrap lands inside `cacheDir` (npm tgz carries a `package/` prefix). */
|
|
6387
6387
|
function bootstrappedCliPath(cacheDir) {
|
|
6388
6388
|
return node_path.join(cacheDir, "package", "bin", "npm-cli.js");
|
|
@@ -6499,7 +6499,7 @@ async function resolveUncached(options) {
|
|
|
6499
6499
|
}
|
|
6500
6500
|
options.logger.warn("system npm unavailable — bootstrapping npm from the registry", { meta: { cacheDir: options.cacheDir } });
|
|
6501
6501
|
try {
|
|
6502
|
-
const registry = (options.registry ?? DEFAULT_REGISTRY).replace(/\/+$/, "");
|
|
6502
|
+
const registry = (options.registry ?? DEFAULT_REGISTRY$1).replace(/\/+$/, "");
|
|
6503
6503
|
const tarballUrl = tarballUrlOf(await (options.fetchJson ?? defaultFetchJson)(`${registry}/npm/latest`));
|
|
6504
6504
|
if (!tarballUrl) throw new Error(`registry metadata for 'npm' carries no dist.tarball (${registry})`);
|
|
6505
6505
|
await node_fs.promises.mkdir(options.cacheDir, { recursive: true });
|
|
@@ -8234,6 +8234,110 @@ async function rebuildNativeDeps(addonDir, packageNames, logger, npmCacheDir, re
|
|
|
8234
8234
|
}
|
|
8235
8235
|
}
|
|
8236
8236
|
//#endregion
|
|
8237
|
+
//#region src/kernel/held-installs.ts
|
|
8238
|
+
var held = /* @__PURE__ */ new Map();
|
|
8239
|
+
function recordHeldInstall(entry) {
|
|
8240
|
+
held.set(entry.packageName, entry);
|
|
8241
|
+
}
|
|
8242
|
+
function clearHeldInstall(packageName) {
|
|
8243
|
+
held.delete(packageName);
|
|
8244
|
+
}
|
|
8245
|
+
function listHeldInstalls() {
|
|
8246
|
+
return [...held.values()];
|
|
8247
|
+
}
|
|
8248
|
+
//#endregion
|
|
8249
|
+
//#region src/kernel/requires-registry.ts
|
|
8250
|
+
/**
|
|
8251
|
+
* Reading `camstack.requires` and the version list of a package from the npm
|
|
8252
|
+
* registry, through the SAME doors the install uses (planning#447, D989).
|
|
8253
|
+
*
|
|
8254
|
+
* The install fetches the registry document over plain HTTP and falls back to
|
|
8255
|
+
* `npm` (which carries the user's npmrc: private registries, tokens). The
|
|
8256
|
+
* requirement read does the same, in the same order. A refusal from the HTTP
|
|
8257
|
+
* door for lack of auth is therefore never read as "the requirement is unmet":
|
|
8258
|
+
* it falls through to npm, and when npm cannot read either the read FAILS with
|
|
8259
|
+
* a typed {@link RegistryReadError} the caller reports as such.
|
|
8260
|
+
*/
|
|
8261
|
+
var RegistryReadError = class extends Error {
|
|
8262
|
+
kind;
|
|
8263
|
+
constructor(kind, message) {
|
|
8264
|
+
super(message);
|
|
8265
|
+
this.name = "RegistryReadError";
|
|
8266
|
+
this.kind = kind;
|
|
8267
|
+
}
|
|
8268
|
+
};
|
|
8269
|
+
var DEFAULT_REGISTRY = "https://registry.npmjs.org";
|
|
8270
|
+
function isStable(version) {
|
|
8271
|
+
return !version.includes("-");
|
|
8272
|
+
}
|
|
8273
|
+
function parseRequires(value) {
|
|
8274
|
+
if (value === void 0 || value === null) return void 0;
|
|
8275
|
+
const parsed = require_dist.PackageRequiresSchema.safeParse(value);
|
|
8276
|
+
if (!parsed.success) throw new RegistryReadError("unavailable", "the registry document carries a malformed requires");
|
|
8277
|
+
return parsed.data;
|
|
8278
|
+
}
|
|
8279
|
+
function failureOf(err) {
|
|
8280
|
+
const text = err instanceof Error ? err.message : String(err);
|
|
8281
|
+
return /\b(E401|E403|401|403|unauthori[sz]ed|forbidden)\b/i.test(text) ? "auth" : "unavailable";
|
|
8282
|
+
}
|
|
8283
|
+
function createRequiresRegistry(deps) {
|
|
8284
|
+
const base = (deps.registry ?? DEFAULT_REGISTRY).replace(/\/+$/, "");
|
|
8285
|
+
const urlOf = (packageName) => `${base}/${encodeURIComponent(packageName).replace(/^%40/, "@")}`;
|
|
8286
|
+
const viaNpm = async (args) => {
|
|
8287
|
+
let stdout;
|
|
8288
|
+
try {
|
|
8289
|
+
stdout = await deps.npmView(args);
|
|
8290
|
+
} catch (err) {
|
|
8291
|
+
throw new RegistryReadError(failureOf(err), err instanceof Error ? err.message : String(err));
|
|
8292
|
+
}
|
|
8293
|
+
const trimmed = stdout.trim();
|
|
8294
|
+
return trimmed.length === 0 ? void 0 : JSON.parse(trimmed);
|
|
8295
|
+
};
|
|
8296
|
+
return {
|
|
8297
|
+
async requiresOf(packageName, spec) {
|
|
8298
|
+
try {
|
|
8299
|
+
const res = await deps.fetchJson(`${urlOf(packageName)}/${encodeURIComponent(spec)}`);
|
|
8300
|
+
if (res.ok) {
|
|
8301
|
+
const doc = await res.json();
|
|
8302
|
+
if (typeof doc === "object" && doc !== null) {
|
|
8303
|
+
const camstack = Reflect.get(doc, "camstack");
|
|
8304
|
+
return parseRequires(typeof camstack === "object" && camstack !== null ? Reflect.get(camstack, "requires") : void 0);
|
|
8305
|
+
}
|
|
8306
|
+
}
|
|
8307
|
+
} catch (err) {
|
|
8308
|
+
if (err instanceof RegistryReadError) throw err;
|
|
8309
|
+
}
|
|
8310
|
+
return parseRequires(await viaNpm([
|
|
8311
|
+
"view",
|
|
8312
|
+
`${packageName}@${spec}`,
|
|
8313
|
+
"camstack.requires",
|
|
8314
|
+
"--json"
|
|
8315
|
+
]));
|
|
8316
|
+
},
|
|
8317
|
+
async versions(packageName) {
|
|
8318
|
+
let names = null;
|
|
8319
|
+
try {
|
|
8320
|
+
const res = await deps.fetchJson(urlOf(packageName));
|
|
8321
|
+
if (res.ok) {
|
|
8322
|
+
const doc = await res.json();
|
|
8323
|
+
const versions = typeof doc === "object" && doc !== null ? Reflect.get(doc, "versions") : void 0;
|
|
8324
|
+
if (typeof versions === "object" && versions !== null) names = Object.keys(versions);
|
|
8325
|
+
}
|
|
8326
|
+
} catch {}
|
|
8327
|
+
if (names === null) {
|
|
8328
|
+
const listed = await viaNpm([
|
|
8329
|
+
"view",
|
|
8330
|
+
packageName,
|
|
8331
|
+
"versions",
|
|
8332
|
+
"--json"
|
|
8333
|
+
]);
|
|
8334
|
+
names = Array.isArray(listed) ? listed.filter((v) => typeof v === "string") : typeof listed === "string" ? [listed] : [];
|
|
8335
|
+
}
|
|
8336
|
+
return names.filter(isStable).sort((a, b) => require_dist.compareVersions(b, a));
|
|
8337
|
+
}
|
|
8338
|
+
};
|
|
8339
|
+
}
|
|
8340
|
+
//#endregion
|
|
8237
8341
|
//#region src/kernel/addon-installer.ts
|
|
8238
8342
|
var execFileAsync$2 = (0, node_util.promisify)(node_child_process.execFile);
|
|
8239
8343
|
/**
|
|
@@ -8300,6 +8404,8 @@ function shouldSkipClosureProvidedSeed(packageName, isResolvable) {
|
|
|
8300
8404
|
}
|
|
8301
8405
|
/** How long a boot-time `dist-tags.latest` read may take before it is "unreadable". */
|
|
8302
8406
|
var REGISTRY_LATEST_TIMEOUT_MS = 15e3;
|
|
8407
|
+
/** How many of the newest registry versions are probed for one this server can host. */
|
|
8408
|
+
var FALLBACK_VERSION_PROBES = 25;
|
|
8303
8409
|
function readInstalledPackageVersion(addonDir) {
|
|
8304
8410
|
try {
|
|
8305
8411
|
const raw = JSON.parse(node_fs.readFileSync(node_path.join(addonDir, "package.json"), "utf-8"));
|
|
@@ -8367,6 +8473,10 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8367
8473
|
/** Test seam — production resolves via `CAMSTACK_FRAMEWORK_DIR`. */
|
|
8368
8474
|
closureNodeModulesDir;
|
|
8369
8475
|
resolveLatestVersionOverride;
|
|
8476
|
+
serverVersion;
|
|
8477
|
+
resolveRequiresOverride;
|
|
8478
|
+
listVersionsOverride;
|
|
8479
|
+
requiresRegistryCache = null;
|
|
8370
8480
|
/**
|
|
8371
8481
|
* Central manifest of installed addons. Tracks version + source +
|
|
8372
8482
|
* timestamps + last-backup pointer per package, written atomically
|
|
@@ -8390,6 +8500,9 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8390
8500
|
this.isPackageResolvable = config.isPackageResolvable;
|
|
8391
8501
|
this.closureNodeModulesDir = config.closureNodeModulesDir;
|
|
8392
8502
|
this.resolveLatestVersionOverride = config.resolveLatestVersion;
|
|
8503
|
+
this.serverVersion = config.serverVersion;
|
|
8504
|
+
this.resolveRequiresOverride = config.resolveRequires;
|
|
8505
|
+
this.listVersionsOverride = config.listVersions;
|
|
8393
8506
|
}
|
|
8394
8507
|
/**
|
|
8395
8508
|
* Where a bootstrapped npm lives when the host has none on PATH (packaged
|
|
@@ -8544,6 +8657,23 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8544
8657
|
}
|
|
8545
8658
|
this.logger.info(`${packageName} — not found locally, trying npm`);
|
|
8546
8659
|
}
|
|
8660
|
+
const verdict = await this.judgeRequirements(packageName, "latest");
|
|
8661
|
+
if (verdict.kind === "hold") {
|
|
8662
|
+
this.logger.warn(`${packageName} — not installed at boot: ${verdict.reason}`, { meta: {
|
|
8663
|
+
spec: "latest",
|
|
8664
|
+
code: verdict.code,
|
|
8665
|
+
reason: verdict.reason
|
|
8666
|
+
} });
|
|
8667
|
+
continue;
|
|
8668
|
+
}
|
|
8669
|
+
if (verdict.kind === "older") {
|
|
8670
|
+
this.logger.warn(`${packageName} — latest needs a newer server than ${this.serverVersion ?? "unknown"}; installing ${verdict.version}, the newest this server can host`, { meta: {
|
|
8671
|
+
spec: "latest",
|
|
8672
|
+
version: verdict.version
|
|
8673
|
+
} });
|
|
8674
|
+
await this.installFromNpm(packageName, verdict.version);
|
|
8675
|
+
continue;
|
|
8676
|
+
}
|
|
8547
8677
|
await this.installFromNpm(packageName);
|
|
8548
8678
|
} catch (err) {
|
|
8549
8679
|
const msg = require_dist.errMsg(err);
|
|
@@ -8565,6 +8695,15 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8565
8695
|
this.logger.debug(`${packageName} — installed copy matches registry latest, or the registry could not be read`);
|
|
8566
8696
|
return;
|
|
8567
8697
|
}
|
|
8698
|
+
const verdict = await this.judgeRequirements(packageName, decision.to);
|
|
8699
|
+
if (verdict.kind === "hold") {
|
|
8700
|
+
this.logger.warn(`${packageName} — not moved ${decision.from} → ${decision.to}: ${verdict.reason}`, { meta: {
|
|
8701
|
+
from: decision.from,
|
|
8702
|
+
to: decision.to,
|
|
8703
|
+
reason: verdict.reason
|
|
8704
|
+
} });
|
|
8705
|
+
return;
|
|
8706
|
+
}
|
|
8568
8707
|
this.logger.info(`${packageName} — moving ${decision.from} → ${decision.to}: ${decision.reason}`, { meta: {
|
|
8569
8708
|
from: decision.from,
|
|
8570
8709
|
to: decision.to,
|
|
@@ -8576,6 +8715,87 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8576
8715
|
});
|
|
8577
8716
|
await this.applyUpdate(packageName, decision.to);
|
|
8578
8717
|
}
|
|
8718
|
+
/**
|
|
8719
|
+
* Whether `packageName@spec` may be installed on this server (no gate when no
|
|
8720
|
+
* server version was configured). Judges only the server minimum;
|
|
8721
|
+
* `requires.addons` binds the server's own update, not an addon's.
|
|
8722
|
+
*
|
|
8723
|
+
* - `ok` — install it as asked.
|
|
8724
|
+
* - `older` — `spec` is `latest` and needs a newer server; `version` is the newest
|
|
8725
|
+
* registry version whose `requires` this server meets.
|
|
8726
|
+
* - `hold` — do not install; `code` says whether the minimum is unmet and nothing
|
|
8727
|
+
* older fits, or the registry could not be read (an auth failure of our
|
|
8728
|
+
* own is a failed read, never an unmet minimum). Recorded for the alert.
|
|
8729
|
+
*/
|
|
8730
|
+
async judgeRequirements(packageName, spec) {
|
|
8731
|
+
if (this.serverVersion === void 0) return { kind: "ok" };
|
|
8732
|
+
const serverVersion = this.serverVersion;
|
|
8733
|
+
const unmetOf = (requires) => {
|
|
8734
|
+
const unmet = require_dist.unmetRequirements(requires, {
|
|
8735
|
+
server: serverVersion,
|
|
8736
|
+
addons: {},
|
|
8737
|
+
wrapper: null
|
|
8738
|
+
}).filter((u) => u.kind === "server-too-old");
|
|
8739
|
+
return unmet.length === 0 ? null : unmet.map(require_dist.describeUnmet).join("; ");
|
|
8740
|
+
};
|
|
8741
|
+
const hold = (code, reason) => {
|
|
8742
|
+
recordHeldInstall({
|
|
8743
|
+
packageName,
|
|
8744
|
+
spec,
|
|
8745
|
+
code,
|
|
8746
|
+
reason,
|
|
8747
|
+
serverVersion
|
|
8748
|
+
});
|
|
8749
|
+
return {
|
|
8750
|
+
kind: "hold",
|
|
8751
|
+
code,
|
|
8752
|
+
reason
|
|
8753
|
+
};
|
|
8754
|
+
};
|
|
8755
|
+
let unmet;
|
|
8756
|
+
try {
|
|
8757
|
+
unmet = unmetOf(await this.readRequires(packageName, spec));
|
|
8758
|
+
} catch (err) {
|
|
8759
|
+
return hold("registry-unreadable", this.unreadableReason(err));
|
|
8760
|
+
}
|
|
8761
|
+
if (unmet === null) {
|
|
8762
|
+
clearHeldInstall(packageName);
|
|
8763
|
+
return { kind: "ok" };
|
|
8764
|
+
}
|
|
8765
|
+
if (spec !== "latest") return hold("requirements-unmet", unmet);
|
|
8766
|
+
try {
|
|
8767
|
+
const versions = (await this.listVersions(packageName)).slice(0, FALLBACK_VERSION_PROBES);
|
|
8768
|
+
for (const version of versions) if (unmetOf(await this.readRequires(packageName, version)) === null) {
|
|
8769
|
+
clearHeldInstall(packageName);
|
|
8770
|
+
return {
|
|
8771
|
+
kind: "older",
|
|
8772
|
+
version
|
|
8773
|
+
};
|
|
8774
|
+
}
|
|
8775
|
+
} catch (err) {
|
|
8776
|
+
return hold("registry-unreadable", this.unreadableReason(err));
|
|
8777
|
+
}
|
|
8778
|
+
return hold("no-compatible-version", `latest ${unmet}, and no registry version of ${packageName} fits server ${serverVersion ?? "unknown (its version could not be read; a failed read is not a pass)"}`);
|
|
8779
|
+
}
|
|
8780
|
+
unreadableReason(err) {
|
|
8781
|
+
return `its requirements could not be read (${err instanceof RegistryReadError ? `${err.kind}: ${err.message}` : require_dist.errMsg(err)}); a failed read is not a pass`;
|
|
8782
|
+
}
|
|
8783
|
+
requiresRegistry() {
|
|
8784
|
+
this.requiresRegistryCache ??= createRequiresRegistry({
|
|
8785
|
+
registry: this.registry,
|
|
8786
|
+
fetchJson: (url) => fetch(url, { signal: AbortSignal.timeout(REGISTRY_LATEST_TIMEOUT_MS) }),
|
|
8787
|
+
npmView: async (args) => (await runNpm([...args, ...this.registry ? ["--registry", this.registry] : []], this.npmRunOptions(node_os.tmpdir(), 6e4))).stdout
|
|
8788
|
+
});
|
|
8789
|
+
return this.requiresRegistryCache;
|
|
8790
|
+
}
|
|
8791
|
+
readRequires(packageName, spec) {
|
|
8792
|
+
if (this.resolveRequiresOverride) return this.resolveRequiresOverride(packageName, spec);
|
|
8793
|
+
return this.requiresRegistry().requiresOf(packageName, spec);
|
|
8794
|
+
}
|
|
8795
|
+
listVersions(packageName) {
|
|
8796
|
+
if (this.listVersionsOverride) return this.listVersionsOverride(packageName);
|
|
8797
|
+
return this.requiresRegistry().versions(packageName);
|
|
8798
|
+
}
|
|
8579
8799
|
/** `dist-tags.latest`, or `null` when the registry cannot be read. */
|
|
8580
8800
|
async readRegistryLatest(packageName) {
|
|
8581
8801
|
if (this.resolveLatestVersionOverride) try {
|
|
@@ -15847,6 +16067,172 @@ function asName(value) {
|
|
|
15847
16067
|
return typeof value === "string" && value.length > 0 ? value : null;
|
|
15848
16068
|
}
|
|
15849
16069
|
//#endregion
|
|
16070
|
+
//#region src/kernel/moleculer/migration-api-facade.ts
|
|
16071
|
+
var DEFAULT_QUERY_LIMIT = 100;
|
|
16072
|
+
function recordsKind(records, definition) {
|
|
16073
|
+
if (records === void 0) throw new Error("migration api: records are not available");
|
|
16074
|
+
const handle = records.kind(definition);
|
|
16075
|
+
return {
|
|
16076
|
+
get: ({ id }) => handle.get(id),
|
|
16077
|
+
getResolved: ({ id }) => handle.getResolved(id),
|
|
16078
|
+
put: ({ ifRev, ...row }) => handle.put(row, ifRev === void 0 ? void 0 : { ifRev }),
|
|
16079
|
+
putMany: ({ records: rows }) => handle.putMany(rows),
|
|
16080
|
+
patch: ({ id, partial, ifRev }) => handle.patch(id, partial, ifRev === void 0 ? void 0 : { ifRev }),
|
|
16081
|
+
delete: async ({ id }) => ({ deleted: await handle.delete(id) }),
|
|
16082
|
+
query: ({ limit, resolveSecrets, ...rest }) => handle.query({
|
|
16083
|
+
...rest,
|
|
16084
|
+
limit: limit ?? DEFAULT_QUERY_LIMIT
|
|
16085
|
+
}, resolveSecrets === void 0 ? void 0 : { resolveSecrets }),
|
|
16086
|
+
deleteWhere: async (input) => ({ count: await handle.deleteWhere(input) })
|
|
16087
|
+
};
|
|
16088
|
+
}
|
|
16089
|
+
function requireSecrets(secrets) {
|
|
16090
|
+
if (secrets === void 0) throw new Error("migration api: the keychain is not available");
|
|
16091
|
+
return secrets;
|
|
16092
|
+
}
|
|
16093
|
+
function requireSettings(settings) {
|
|
16094
|
+
if (settings === void 0) throw new Error("migration api: settings are not available");
|
|
16095
|
+
return settings;
|
|
16096
|
+
}
|
|
16097
|
+
function createMigrationApi(backing) {
|
|
16098
|
+
const { legacy, ledger, logger } = backing;
|
|
16099
|
+
return {
|
|
16100
|
+
version: _camstack_types_addon.MIGRATION_API_VERSION,
|
|
16101
|
+
ledger: {
|
|
16102
|
+
declare: (input) => ledger.declareOwner(input),
|
|
16103
|
+
start: (input) => ledger.startMigration(input),
|
|
16104
|
+
finish: (input) => ledger.finishMigration(input)
|
|
16105
|
+
},
|
|
16106
|
+
legacyRows: {
|
|
16107
|
+
read: (input) => legacy.read(input),
|
|
16108
|
+
clear: (input) => legacy.clear(input),
|
|
16109
|
+
patch: (input) => legacy.patch(input),
|
|
16110
|
+
deleteKeys: (input) => legacy.deleteKeys({
|
|
16111
|
+
...input,
|
|
16112
|
+
keys: [...input.keys]
|
|
16113
|
+
})
|
|
16114
|
+
},
|
|
16115
|
+
records: { kind: (definition) => recordsKind(backing.records, definition) },
|
|
16116
|
+
settings: {
|
|
16117
|
+
read: async () => ({ store: await requireSettings(backing.settings).readAddonStore() }),
|
|
16118
|
+
write: async ({ patch }) => {
|
|
16119
|
+
await requireSettings(backing.settings).writeAddonStore(patch);
|
|
16120
|
+
return {};
|
|
16121
|
+
},
|
|
16122
|
+
deleteKeys: async ({ keys }) => {
|
|
16123
|
+
const settings = requireSettings(backing.settings);
|
|
16124
|
+
const stored = await settings.readAddonStore();
|
|
16125
|
+
const removed = keys.filter((key) => key in stored);
|
|
16126
|
+
if (removed.length > 0) await settings.writeAddonStore(Object.fromEntries(removed.map((k) => [k, void 0])));
|
|
16127
|
+
return { removed };
|
|
16128
|
+
}
|
|
16129
|
+
},
|
|
16130
|
+
secrets: {
|
|
16131
|
+
resolve: async ({ refs }) => {
|
|
16132
|
+
const answers = await requireSecrets(backing.secrets).resolve(refs);
|
|
16133
|
+
const values = {};
|
|
16134
|
+
for (const ref of refs) {
|
|
16135
|
+
const answer = answers[ref];
|
|
16136
|
+
if (answer === void 0 || answer.kind === "missing") values[ref] = null;
|
|
16137
|
+
else if (answer.kind === "value") values[ref] = answer.value;
|
|
16138
|
+
else throw new Error(`migration api: a secret cannot be read (${answer.kind === "unavailable" ? answer.reason : answer.kind})`);
|
|
16139
|
+
}
|
|
16140
|
+
return { values };
|
|
16141
|
+
},
|
|
16142
|
+
put: async ({ ref, value }) => {
|
|
16143
|
+
await requireSecrets(backing.secrets).put(ref, value);
|
|
16144
|
+
return {};
|
|
16145
|
+
},
|
|
16146
|
+
delete: async ({ refs }) => ({ deleted: await requireSecrets(backing.secrets).delete(refs) })
|
|
16147
|
+
},
|
|
16148
|
+
integrations: {
|
|
16149
|
+
list: async () => ({ integrations: (await backing.listIntegrations()).map(toIntegration) }),
|
|
16150
|
+
get: async ({ id }) => {
|
|
16151
|
+
const found = (await backing.listIntegrations()).find((row) => row.id === id);
|
|
16152
|
+
return found === void 0 ? null : toIntegration(found);
|
|
16153
|
+
}
|
|
16154
|
+
},
|
|
16155
|
+
devices: {
|
|
16156
|
+
list: async ({ addonId, integrationId }) => ({ devices: (await backing.devices.list(addonId)).filter((d) => integrationId === void 0 || d.integrationId === integrationId).map((d) => ({ ...d })) }),
|
|
16157
|
+
get: async ({ deviceId }) => {
|
|
16158
|
+
const found = await backing.devices.get(deviceId);
|
|
16159
|
+
if (found === null) return null;
|
|
16160
|
+
return {
|
|
16161
|
+
id: deviceId,
|
|
16162
|
+
integrationId: found.integrationId ?? null,
|
|
16163
|
+
hasConfig: Object.keys(found.config ?? {}).length > 0
|
|
16164
|
+
};
|
|
16165
|
+
},
|
|
16166
|
+
setIntegrationId: async ({ deviceId, integrationId }) => {
|
|
16167
|
+
await backing.devices.setIntegrationId(deviceId, integrationId);
|
|
16168
|
+
return {};
|
|
16169
|
+
}
|
|
16170
|
+
},
|
|
16171
|
+
node: { localNodeId: async () => ({ nodeId: backing.nodeId }) },
|
|
16172
|
+
log: {
|
|
16173
|
+
info: async ({ message, meta, tags }) => {
|
|
16174
|
+
logger.info(message, {
|
|
16175
|
+
...meta === void 0 ? {} : { meta },
|
|
16176
|
+
...tags === void 0 ? {} : { tags }
|
|
16177
|
+
});
|
|
16178
|
+
return {};
|
|
16179
|
+
},
|
|
16180
|
+
warn: async ({ message, meta, tags }) => {
|
|
16181
|
+
logger.warn(message, {
|
|
16182
|
+
...meta === void 0 ? {} : { meta },
|
|
16183
|
+
...tags === void 0 ? {} : { tags }
|
|
16184
|
+
});
|
|
16185
|
+
return {};
|
|
16186
|
+
}
|
|
16187
|
+
}
|
|
16188
|
+
};
|
|
16189
|
+
}
|
|
16190
|
+
function toIntegration(row) {
|
|
16191
|
+
return {
|
|
16192
|
+
id: row.id,
|
|
16193
|
+
addonId: row.addonId,
|
|
16194
|
+
name: row.name,
|
|
16195
|
+
info: { ...row.info },
|
|
16196
|
+
...row.originStableId === void 0 ? {} : { originStableId: row.originStableId }
|
|
16197
|
+
};
|
|
16198
|
+
}
|
|
16199
|
+
/** The facade over a context's `api` (the caller is stamped by the transport, never claimed here). */
|
|
16200
|
+
function createMigrationApiOverContext(deps) {
|
|
16201
|
+
const migrations = () => deps.api().migrations;
|
|
16202
|
+
return createMigrationApi({
|
|
16203
|
+
nodeId: deps.nodeId,
|
|
16204
|
+
logger: deps.logger,
|
|
16205
|
+
ledger: {
|
|
16206
|
+
declareOwner: (input) => migrations().declareOwner.mutate(input),
|
|
16207
|
+
startMigration: (input) => migrations().startMigration.mutate(input),
|
|
16208
|
+
finishMigration: (input) => migrations().finishMigration.mutate(input)
|
|
16209
|
+
},
|
|
16210
|
+
legacy: {
|
|
16211
|
+
read: (input) => migrations().readLegacyIntegrationRows.query(input),
|
|
16212
|
+
clear: (input) => migrations().clearLegacyIntegrationRows.mutate(input),
|
|
16213
|
+
patch: (input) => migrations().patchLegacyIntegrationRows.mutate(input),
|
|
16214
|
+
deleteKeys: (input) => migrations().deleteLegacyIntegrationRowKeys.mutate(input)
|
|
16215
|
+
},
|
|
16216
|
+
listIntegrations: () => deps.api().integrations.list.query(),
|
|
16217
|
+
devices: {
|
|
16218
|
+
list: (addonId) => deps.api().deviceManager.listAll.query({
|
|
16219
|
+
addonId,
|
|
16220
|
+
projection: "slim"
|
|
16221
|
+
}),
|
|
16222
|
+
get: (deviceId) => deps.api().deviceManager.getDevice.query({ deviceId }),
|
|
16223
|
+
setIntegrationId: async (deviceId, integrationId) => {
|
|
16224
|
+
await deps.api().deviceManager.setIntegrationId.mutate({
|
|
16225
|
+
deviceId,
|
|
16226
|
+
integrationId
|
|
16227
|
+
});
|
|
16228
|
+
}
|
|
16229
|
+
},
|
|
16230
|
+
records: deps.records,
|
|
16231
|
+
secrets: deps.secrets,
|
|
16232
|
+
settings: deps.settings
|
|
16233
|
+
});
|
|
16234
|
+
}
|
|
16235
|
+
//#endregion
|
|
15850
16236
|
//#region src/kernel/moleculer/records-api-transport.ts
|
|
15851
16237
|
function recordsTransportOf(api) {
|
|
15852
16238
|
const r = api.records;
|
|
@@ -17185,6 +17571,22 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
17185
17571
|
return deviceApi;
|
|
17186
17572
|
}
|
|
17187
17573
|
//#endregion
|
|
17574
|
+
//#region src/kernel/transport/cap-routing-hints.ts
|
|
17575
|
+
/** Lift {@link CapRoutingHints} from a call's args. Never throws. */
|
|
17576
|
+
function liftRoutingHints(args) {
|
|
17577
|
+
if (args === null || typeof args !== "object" || Array.isArray(args)) return {};
|
|
17578
|
+
const nodeId = Reflect.get(args, "nodeId");
|
|
17579
|
+
const addonId = Reflect.get(args, "addonId");
|
|
17580
|
+
const provider = Reflect.get(args, "provider");
|
|
17581
|
+
const deviceId = Reflect.get(args, "deviceId");
|
|
17582
|
+
return {
|
|
17583
|
+
...typeof nodeId === "string" && nodeId.length > 0 ? { nodeId } : {},
|
|
17584
|
+
...typeof addonId === "string" && addonId.length > 0 ? { addonId } : {},
|
|
17585
|
+
...typeof provider === "string" && provider.length > 0 ? { provider } : {},
|
|
17586
|
+
...typeof deviceId === "number" && Number.isFinite(deviceId) ? { deviceId } : {}
|
|
17587
|
+
};
|
|
17588
|
+
}
|
|
17589
|
+
//#endregion
|
|
17188
17590
|
//#region src/kernel/moleculer/resilient-cap-call.ts
|
|
17189
17591
|
/** Moleculer error `type` values meaning "the service is not (yet) routable". */
|
|
17190
17592
|
var DISCOVERY_ERROR_TYPES = new Set(["SERVICE_NOT_FOUND", "SERVICE_NOT_AVAILABLE"]);
|
|
@@ -20220,22 +20622,6 @@ function buildCapChildIndex(entries) {
|
|
|
20220
20622
|
return new MapCapChildIndex(deviceOwners, singletons);
|
|
20221
20623
|
}
|
|
20222
20624
|
//#endregion
|
|
20223
|
-
//#region src/kernel/transport/cap-routing-hints.ts
|
|
20224
|
-
/** Lift {@link CapRoutingHints} from a call's args. Never throws. */
|
|
20225
|
-
function liftRoutingHints(args) {
|
|
20226
|
-
if (args === null || typeof args !== "object" || Array.isArray(args)) return {};
|
|
20227
|
-
const nodeId = Reflect.get(args, "nodeId");
|
|
20228
|
-
const addonId = Reflect.get(args, "addonId");
|
|
20229
|
-
const provider = Reflect.get(args, "provider");
|
|
20230
|
-
const deviceId = Reflect.get(args, "deviceId");
|
|
20231
|
-
return {
|
|
20232
|
-
...typeof nodeId === "string" && nodeId.length > 0 ? { nodeId } : {},
|
|
20233
|
-
...typeof addonId === "string" && addonId.length > 0 ? { addonId } : {},
|
|
20234
|
-
...typeof provider === "string" && provider.length > 0 ? { provider } : {},
|
|
20235
|
-
...typeof deviceId === "number" && Number.isFinite(deviceId) ? { deviceId } : {}
|
|
20236
|
-
};
|
|
20237
|
-
}
|
|
20238
|
-
//#endregion
|
|
20239
20625
|
//#region src/kernel/transport/claimed-get-status.ts
|
|
20240
20626
|
var GET_STATUS_METHOD = "getStatus";
|
|
20241
20627
|
/** The device a `getStatus` is about, or `undefined` when the call is not one. */
|
|
@@ -21962,7 +22348,12 @@ function localProviderLink(resolver, observerOpts) {
|
|
|
21962
22348
|
const pinnedNodeId = (0, _camstack_types_addon.readNodePin)(op.context);
|
|
21963
22349
|
if (pinnedNodeId !== void 0 && pinnedNodeId !== localBase) return next(opWithDefaults);
|
|
21964
22350
|
}
|
|
21965
|
-
|
|
22351
|
+
let provider;
|
|
22352
|
+
const pinnedAddonId = liftRoutingHints(op.input).addonId;
|
|
22353
|
+
if (pinnedAddonId !== void 0 && resolver.getByAddonId !== void 0 && Object.hasOwn(_camstack_types_addon.COLLECTION_ARRAY_METHODS, parsed.capName)) {
|
|
22354
|
+
provider = resolver.getByAddonId(parsed.capName, pinnedAddonId);
|
|
22355
|
+
if (!provider) return next(opWithDefaults);
|
|
22356
|
+
} else provider = resolver.getByName(parsed.capName);
|
|
21966
22357
|
if (!provider || typeof provider !== "object") return next(opWithDefaults);
|
|
21967
22358
|
const fn = Reflect.get(provider, parsed.method);
|
|
21968
22359
|
if (typeof fn !== "function") return next(opWithDefaults);
|
|
@@ -23942,6 +24333,9 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
23942
24333
|
const regs = getRegistries(nodeId);
|
|
23943
24334
|
const workerResolver = {
|
|
23944
24335
|
localNodeId: nodeId,
|
|
24336
|
+
getByAddonId(capabilityName, pinnedAddonId) {
|
|
24337
|
+
return regs.byAddonId.get(capabilityName)?.get(pinnedAddonId) ?? null;
|
|
24338
|
+
},
|
|
23945
24339
|
getByName(capabilityName) {
|
|
23946
24340
|
const preferred = regs.preferred.get(capabilityName);
|
|
23947
24341
|
if (preferred) {
|
|
@@ -24140,6 +24534,12 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
24140
24534
|
},
|
|
24141
24535
|
eventBus: scopedEventBus
|
|
24142
24536
|
});
|
|
24537
|
+
const records = (0, _camstack_types_addon.createRecordsAccess)({
|
|
24538
|
+
owner: addonId,
|
|
24539
|
+
transport: recordsTransportOf(api),
|
|
24540
|
+
secrets,
|
|
24541
|
+
logger: scopedLogger
|
|
24542
|
+
});
|
|
24143
24543
|
return {
|
|
24144
24544
|
id: addonId,
|
|
24145
24545
|
logger: scopedLogger,
|
|
@@ -24154,11 +24554,14 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
24154
24554
|
deps: new AddonDepsManager(addonDataDir, scopedLogger),
|
|
24155
24555
|
settings: settingsView,
|
|
24156
24556
|
secrets,
|
|
24157
|
-
records
|
|
24158
|
-
|
|
24159
|
-
|
|
24557
|
+
records,
|
|
24558
|
+
migrationApi: createMigrationApiOverContext({
|
|
24559
|
+
nodeId,
|
|
24560
|
+
logger: scopedLogger,
|
|
24561
|
+
api: () => api,
|
|
24562
|
+
records,
|
|
24160
24563
|
secrets,
|
|
24161
|
-
|
|
24564
|
+
settings: settingsView
|
|
24162
24565
|
}),
|
|
24163
24566
|
kernel: (() => {
|
|
24164
24567
|
const streamProbe = runtime.mode === "broker" ? {
|
|
@@ -28232,6 +28635,7 @@ exports.RUNTIME_DEFAULTS = require_dist.RUNTIME_DEFAULTS;
|
|
|
28232
28635
|
exports.ReadinessRegistry = require_dist.ReadinessRegistry;
|
|
28233
28636
|
exports.ReadinessTimeoutError = require_dist.ReadinessTimeoutError;
|
|
28234
28637
|
exports.RecordsEngine = require_wal_maintenance.RecordsEngine;
|
|
28638
|
+
exports.RegistryReadError = RegistryReadError;
|
|
28235
28639
|
exports.ReplEngine = ReplEngine;
|
|
28236
28640
|
exports.RingBuffer = RingBuffer;
|
|
28237
28641
|
exports.RunnerOfAddon = RunnerOfAddon;
|
|
@@ -28328,6 +28732,7 @@ exports.chainsToPublicRoot = require_hub_mdns_ciao.chainsToPublicRoot;
|
|
|
28328
28732
|
exports.checkUploadedCa = require_hub_mdns_ciao.checkUploadedCa;
|
|
28329
28733
|
exports.classifyAddonDir = classifyAddonDir;
|
|
28330
28734
|
exports.classifyCapRoute = classifyCapRoute;
|
|
28735
|
+
exports.clearHeldInstall = clearHeldInstall;
|
|
28331
28736
|
exports.clearHttpsListener = require_hub_mdns_ciao.clearHttpsListener;
|
|
28332
28737
|
exports.clearIntegrationRows = clearIntegrationRows;
|
|
28333
28738
|
exports.clearNodeSettings = require_builtins_core_blocks_core_blocks_addon.clearNodeSettings;
|
|
@@ -28379,11 +28784,14 @@ exports.createLoopDelayMeter = createLoopDelayMeter;
|
|
|
28379
28784
|
exports.createMeshAccessMiddleware = createMeshAccessMiddleware;
|
|
28380
28785
|
exports.createMeshCsrPem = require_builtins_system_config_system_config_addon.createMeshCsrPem;
|
|
28381
28786
|
exports.createMeshQueueReader = createMeshQueueReader;
|
|
28787
|
+
exports.createMigrationApi = createMigrationApi;
|
|
28788
|
+
exports.createMigrationApiOverContext = createMigrationApiOverContext;
|
|
28382
28789
|
exports.createOutboundQueueGate = createOutboundQueueGate;
|
|
28383
28790
|
exports.createParentUnownedCallHandler = createParentUnownedCallHandler;
|
|
28384
28791
|
exports.createProcessService = createProcessService;
|
|
28385
28792
|
exports.createReadinessService = createReadinessService;
|
|
28386
28793
|
exports.createReadinessServiceForRegistry = createReadinessServiceForRegistry;
|
|
28794
|
+
exports.createRequiresRegistry = createRequiresRegistry;
|
|
28387
28795
|
exports.createScopedProcessManager = createScopedProcessManager;
|
|
28388
28796
|
exports.createSocketDirectionCounters = createSocketDirectionCounters;
|
|
28389
28797
|
exports.createSocketPlaneMeter = createSocketPlaneMeter;
|
|
@@ -28567,6 +28975,7 @@ exports.leafFingerprintOf = require_hub_mdns_ciao.leafFingerprintOf;
|
|
|
28567
28975
|
exports.levelRank = require_log_read_filter.levelRank;
|
|
28568
28976
|
exports.lineContainsText = require_log_read_filter.lineContainsText;
|
|
28569
28977
|
exports.lineMatches = require_log_read_filter.lineMatches;
|
|
28978
|
+
exports.listHeldInstalls = listHeldInstalls;
|
|
28570
28979
|
exports.loadAgentHttps = require_agent_https.loadAgentHttps;
|
|
28571
28980
|
exports.loadBootstrapConfig = loadBootstrapConfig;
|
|
28572
28981
|
exports.loadDeviceCa = require_device_ca.loadDeviceCa;
|
|
@@ -28630,6 +29039,7 @@ exports.readTlsEnabled = require_hub_mdns_ciao.readTlsEnabled;
|
|
|
28630
29039
|
exports.readTlsMode = require_hub_mdns_ciao.readTlsMode;
|
|
28631
29040
|
exports.readinessKey = require_dist.readinessKey;
|
|
28632
29041
|
exports.reclaimIntervalMs = reclaimIntervalMs;
|
|
29042
|
+
exports.recordHeldInstall = recordHeldInstall;
|
|
28633
29043
|
exports.recordSocketFrame = recordSocketFrame;
|
|
28634
29044
|
exports.redactLogEntry = redactLogEntry;
|
|
28635
29045
|
exports.redactLogMeta = redactLogMeta;
|