@camstack/server 1.2.840 → 1.2.841
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 +6 -0
- package/dist/api/trpc/generated-cap-routers.js +16 -0
- package/package.json +17 -7
- package/system/dist/addon-runner.js +4 -2
- package/system/dist/addon-runner.mjs +4 -2
- 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 +5 -5
- package/system/dist/builtins/composer/composer.addon.mjs +5 -5
- 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/composition-api.d.ts +2 -2
- package/system/dist/builtins/core-blocks/composition-sources.d.ts +9 -2
- package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +2 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +598 -395
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +598 -395
- package/system/dist/builtins/core-blocks/fan-link-forward.d.ts +42 -0
- package/system/dist/builtins/core-blocks/fan-presets-service.d.ts +25 -39
- package/system/dist/builtins/core-blocks/fan-presets-wiring.d.ts +5 -3
- package/system/dist/builtins/core-blocks/migrations/helper-to-customize.d.ts +3 -1
- package/system/dist/builtins/core-blocks/power-source-service.d.ts +2 -0
- package/system/dist/builtins/core-blocks/timed-run/timed-run-service.d.ts +8 -2
- 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-bindings-store.d.ts +8 -5
- package/system/dist/builtins/device-manager/device-manager.addon.js +116 -22
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +116 -22
- package/system/dist/builtins/device-manager/device-row-store.d.ts +0 -52
- 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 +3 -3
- package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
- 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/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- 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 +3 -3
- 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-7E2O4-UN.js → capture-engine-CGU4rnN-.js} +1 -1
- package/system/dist/{capture-engine-B5IBWIRT.mjs → capture-engine-CLrh3FG0.mjs} +1 -1
- package/system/dist/{composition-sources-Cfqn4cly.mjs → composition-sources-CoLbBru1.mjs} +32 -5
- package/system/dist/{composition-sources-DLtc8lSL.js → composition-sources-bhWIz4Rp.js} +32 -5
- package/system/dist/{constants-DjsgCnZk.mjs → constants-CfAS4Qm6.mjs} +1 -1
- package/system/dist/{constants-Cc70YreG.js → constants-DZwpZY5J.js} +1 -1
- package/system/dist/{device-ca-CVP5h3u1.mjs → device-ca-CAbEBLyf.mjs} +1 -1
- package/system/dist/{device-ca-C6JqeFfK.js → device-ca-ksS811fC.js} +1 -1
- package/system/dist/{dist-OmrC_RZs.mjs → dist-ByiDJLen.mjs} +1081 -327
- package/system/dist/{dist-CLnTYKFn.js → dist-DlRUArVs.js} +1128 -338
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-identity-CKQVXf4o.mjs → hub-identity-Bh28ooQx.mjs} +1 -1
- package/system/dist/{hub-identity-TrZcnJkB.js → hub-identity-C-1NeWlr.js} +1 -1
- package/system/dist/{hub-mdns-ciao-ocg6suyX.js → hub-mdns-ciao-CL-Z9yMs.js} +2 -2
- package/system/dist/{hub-mdns-ciao-C8G0K1Z1.mjs → hub-mdns-ciao-OWO6Bw-X.mjs} +2 -2
- package/system/dist/index.js +16 -12
- package/system/dist/index.mjs +16 -12
- package/system/dist/{legacy-integration-rows-door-BPkJUGaX.mjs → legacy-integration-rows-door-Be_QKUlY.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-b6CUxtXX.js → legacy-integration-rows-door-CDPH26e8.js} +1 -1
- package/system/dist/{rename-composition-block-N7lslQJK.js → rename-composition-block-Bs5KT3Gn.js} +1 -1
- package/system/dist/{rename-composition-block-DPlsP1xF.mjs → rename-composition-block-CncvFIHl.mjs} +1 -1
- package/system/dist/{restore-archive-CcuEoEtj.js → restore-archive-CHUKcl3T.js} +1 -1
- package/system/dist/{restore-archive-Btc3H-Fg.mjs → restore-archive-DX7kK3LQ.mjs} +1 -1
- package/system/dist/{wal-maintenance-g7yvxLMj.mjs → wal-maintenance-Fibm7rsM.mjs} +0 -0
- package/system/dist/{wal-maintenance-B2_uCEi5.js → wal-maintenance-GNE9Oqdu.js} +0 -0
- package/system/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $s as TransactRefusedError, An as bareAddonId, Ca as recordsCapability, Ds as DeclarationRefusedError, F as DATABASE_SNAPSHOT_TIMEOUT_MS, Fo as vectorStoreCapability, Gn as catalogueIssues, Hs as RUNTIME_DEFAULTS, I as DATA_STORE_DATABASES, Ks as RecordKindDeclarationSchema, Ms as InvalidRecordError, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, Ns as NoCallerError, P as DATABASE_SNAPSHOT_SUFFIX, Pt as MigrationMetaSchema, Va as resolveRunnerId, Vi as migrationsCapability, Yc as normalizeSecretOwner, bc as defineCustomActions, hr as databaseSnapshotCapability, kt as MIGRATION_API_V1_METHODS, mr as dataStoreProviderCapability, pc as collectSecretMarkerRefs, ta as orderMigrations, tc as UnknownRecordKindError, uo as storageAdminCapability, vc as customAction, xl as EventCategory, xs as BaseAddon, yl as errMsg$1, zs as RECORD_SWEEP_INTERVAL_MS } from "../../dist-ByiDJLen.mjs";
|
|
2
2
|
import { r as retiredKeyStoreOf, t as purgeRetiredSettingsKeys } from "../../retired-settings-keys-u6xQA6r7.mjs";
|
|
3
|
-
import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-
|
|
3
|
+
import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-Fibm7rsM.mjs";
|
|
4
4
|
import { r as isSnapshotWorkerMessage } from "../../sqlite-snapshot-protocol-2QaTouWV.mjs";
|
|
5
5
|
import { a as isWorkerMessage, t as WAL_CHECKPOINT_LARGE_PASS_FRAMES } from "../../wal-checkpoint-policy-BahrTtyD.mjs";
|
|
6
|
-
import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-
|
|
6
|
+
import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-Be_QKUlY.mjs";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DlRUArVs.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $
|
|
1
|
+
import { $a as settingsStoreCapability, Bc as isSecretFieldView, Bs as REDACTED_SECRET, Fi as mayWriteToLocation, Hi as modeForSwitch, Ia as resolveLocationMode, Jc as normalizeNodeId, Pi as mayReadLocation, Qc as parseSecretRef, Qr as gbToBytes, Ro as withLocationMode, Rr as evictionPolicyOfLocation, Sc as defineRecordKinds, Ui as modeMayWrite, Vc as isSecretMarker, Wc as makeSecretMarker, bc as defineCustomActions, cn as StorageCleanupJobSchema, dc as collectSecretConfigKeys, dn as StorageMigrationJobSchema, do as storageCapability, el as recordSecretRef, en as STORAGE_LOCATION_MODES, fo as storageMigrationCapability, gi as isLocationEnabled, ii as integrationInstancesCapability, ln as StorageLocationModeSchema, nl as resolveSecretMarkers, uc as buildSecretRef, ul as toSecretFieldView, un as StorageLocationTypeSchema, vc as customAction, xl as EventCategory, xs as BaseAddon, yc as defineAddonMigrations, yo as switchStateOfMode, zc as isSecretClear } from "../../dist-ByiDJLen.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DlRUArVs.js");
|
|
7
7
|
const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
|
|
8
8
|
const require_x509_es = require("../../x509.es-WtnRNyYS.js");
|
|
9
|
-
const require_hub_identity = require("../../hub-identity-
|
|
10
|
-
const require_constants$8 = require("../../constants-
|
|
9
|
+
const require_hub_identity = require("../../hub-identity-C-1NeWlr.js");
|
|
10
|
+
const require_constants$8 = require("../../constants-DZwpZY5J.js");
|
|
11
11
|
const require_src$1 = require("../../src-CnAqG6EF.js");
|
|
12
12
|
let zod = require("zod");
|
|
13
13
|
let node_crypto = require("node:crypto");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { an as ServerNameSchema, bc as defineCustomActions, io as shortHostname, jc as hydrateSchema, vc as customAction, xs as BaseAddon, yl as errMsg } from "../../dist-ByiDJLen.mjs";
|
|
3
3
|
import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
|
|
4
4
|
import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension } from "../../x509.es-BRiJgOvu.mjs";
|
|
5
|
-
import { B as AGENT_HTTPS_NAMES_COLLECTION, G as systemConfigRecordKinds, H as AgentHttpsNames, I as isLocalOnlyHostname, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, m as isPrivateAddress, r as isAnnouncedHubId } from "../../hub-identity-
|
|
6
|
-
import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-
|
|
5
|
+
import { B as AGENT_HTTPS_NAMES_COLLECTION, G as systemConfigRecordKinds, H as AgentHttpsNames, I as isLocalOnlyHostname, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, m as isPrivateAddress, r as isAnnouncedHubId } from "../../hub-identity-Bh28ooQx.mjs";
|
|
6
|
+
import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-CfAS4Qm6.mjs";
|
|
7
7
|
import { t as require_src } from "../../src-hG4grMU4.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { X509Certificate, createHash, createPrivateKey, randomBytes, randomInt, sign, timingSafeEqual, verify, webcrypto } from "node:crypto";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
const require_chunk = require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-DlRUArVs.js");
|
|
7
7
|
const require_formatter = require("../../formatter-xbxeV4GD.js");
|
|
8
8
|
const require_log_file_read_protocol = require("../../log-file-read-protocol-DSV_vQRb.js");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ji as logDestinationCapability, pa as preconditionOf, xs as BaseAddon, yc as defineAddonMigrations } from "../../dist-ByiDJLen.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
|
|
3
3
|
import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-hTaAsYlX.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_dist = require("./dist-
|
|
1
|
+
const require_dist = require("./dist-DlRUArVs.js");
|
|
2
2
|
//#region src/builtins/device-history/store/series-registry.ts
|
|
3
3
|
function subjectIdOf(subject) {
|
|
4
4
|
return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { js as HISTORY_DEFAULT_MIN_INTERVAL_MS, kc as historyItemFieldPath, vl as DeviceType } from "./dist-ByiDJLen.mjs";
|
|
2
2
|
//#region src/builtins/device-history/store/series-registry.ts
|
|
3
3
|
function subjectIdOf(subject) {
|
|
4
4
|
return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ns as compositionSourceKey, yl as errMsg } from "./dist-ByiDJLen.mjs";
|
|
2
2
|
//#region src/builtins/shared/device-state-changed.ts
|
|
3
3
|
/** Structural narrowing helper for untrusted bus payloads. */
|
|
4
4
|
function isRecord(value) {
|
|
@@ -76,7 +76,27 @@ async function readBindings(ports, deviceIds) {
|
|
|
76
76
|
}));
|
|
77
77
|
return new Map(read);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function scalarKindOf(value) {
|
|
80
|
+
if (typeof value === "number") return "number";
|
|
81
|
+
if (typeof value === "string") return "string";
|
|
82
|
+
if (typeof value === "boolean") return "boolean";
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
/** The live kind of each union field read from `deviceId`, keyed `<cap>.<fieldPath>`. */
|
|
86
|
+
async function readLiveKinds(ports, deviceId, reads) {
|
|
87
|
+
const readField = ports.readField;
|
|
88
|
+
if (readField === void 0 || reads.length === 0) return /* @__PURE__ */ new Map();
|
|
89
|
+
const kinds = await Promise.all(reads.map(async (read) => {
|
|
90
|
+
try {
|
|
91
|
+
const kind = scalarKindOf(await readField(deviceId, read.cap, read.fieldPath));
|
|
92
|
+
return kind === null ? null : [`${read.cap}.${read.fieldPath}`, kind];
|
|
93
|
+
} catch {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}));
|
|
97
|
+
return new Map(kinds.flatMap((entry) => entry === null ? [] : [entry]));
|
|
98
|
+
}
|
|
99
|
+
function describeSource(lookup, bindings, liveKinds) {
|
|
80
100
|
if (lookup.kind !== "row") return lookup;
|
|
81
101
|
const bound = bindings.get(lookup.row.id);
|
|
82
102
|
if (bound === void 0) return {
|
|
@@ -87,12 +107,14 @@ function describeSource(lookup, bindings) {
|
|
|
87
107
|
kind: "unreadable",
|
|
88
108
|
error: bound.error
|
|
89
109
|
};
|
|
110
|
+
const live = liveKinds.get(lookup.row.id);
|
|
90
111
|
return {
|
|
91
112
|
kind: "found",
|
|
92
113
|
deviceId: lookup.row.id,
|
|
93
114
|
caps: new Set(bound.map((b) => b.capName)),
|
|
94
115
|
deviceType: lookup.row.type,
|
|
95
|
-
...lookup.row.quantity === void 0 ? {} : { quantity: lookup.row.quantity }
|
|
116
|
+
...lookup.row.quantity === void 0 ? {} : { quantity: lookup.row.quantity },
|
|
117
|
+
...live === void 0 || live.size === 0 ? {} : { liveKinds: live }
|
|
96
118
|
};
|
|
97
119
|
}
|
|
98
120
|
function describeTarget(lookup, bindings) {
|
|
@@ -117,14 +139,19 @@ function describeTarget(lookup, bindings) {
|
|
|
117
139
|
}))
|
|
118
140
|
};
|
|
119
141
|
}
|
|
120
|
-
async function describeCompositionSources(ports, sources, targets = []) {
|
|
142
|
+
async function describeCompositionSources(ports, sources, targets = [], unionReads = []) {
|
|
121
143
|
const owners = await listOwners(ports, [...sources, ...targets]);
|
|
122
144
|
const lookup = (ref) => [compositionSourceKey(ref), rowOf(ref, owners.get(ref.addonId))];
|
|
123
145
|
const sourceRows = sources.map(lookup);
|
|
124
146
|
const targetRows = targets.map(lookup);
|
|
125
147
|
const bindings = await readBindings(ports, [...sourceRows, ...targetRows].flatMap(([, l]) => l.kind === "row" ? [l.row.id] : []));
|
|
148
|
+
const live = new Map(await Promise.all(sourceRows.flatMap(([key, l]) => {
|
|
149
|
+
if (l.kind !== "row") return [];
|
|
150
|
+
const reads = unionReads.filter((r) => compositionSourceKey(r.source) === key);
|
|
151
|
+
return reads.length === 0 ? [] : [readLiveKinds(ports, l.row.id, reads).then((kinds) => [l.row.id, kinds])];
|
|
152
|
+
})));
|
|
126
153
|
return {
|
|
127
|
-
sources: new Map(sourceRows.map(([key, l]) => [key, describeSource(l, bindings)])),
|
|
154
|
+
sources: new Map(sourceRows.map(([key, l]) => [key, describeSource(l, bindings, live)])),
|
|
128
155
|
targets: new Map(targetRows.map(([key, l]) => [key, describeTarget(l, bindings)]))
|
|
129
156
|
};
|
|
130
157
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_dist = require("./dist-
|
|
1
|
+
const require_dist = require("./dist-DlRUArVs.js");
|
|
2
2
|
//#region src/builtins/shared/device-state-changed.ts
|
|
3
3
|
/** Structural narrowing helper for untrusted bus payloads. */
|
|
4
4
|
function isRecord(value) {
|
|
@@ -76,7 +76,27 @@ async function readBindings(ports, deviceIds) {
|
|
|
76
76
|
}));
|
|
77
77
|
return new Map(read);
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function scalarKindOf(value) {
|
|
80
|
+
if (typeof value === "number") return "number";
|
|
81
|
+
if (typeof value === "string") return "string";
|
|
82
|
+
if (typeof value === "boolean") return "boolean";
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
/** The live kind of each union field read from `deviceId`, keyed `<cap>.<fieldPath>`. */
|
|
86
|
+
async function readLiveKinds(ports, deviceId, reads) {
|
|
87
|
+
const readField = ports.readField;
|
|
88
|
+
if (readField === void 0 || reads.length === 0) return /* @__PURE__ */ new Map();
|
|
89
|
+
const kinds = await Promise.all(reads.map(async (read) => {
|
|
90
|
+
try {
|
|
91
|
+
const kind = scalarKindOf(await readField(deviceId, read.cap, read.fieldPath));
|
|
92
|
+
return kind === null ? null : [`${read.cap}.${read.fieldPath}`, kind];
|
|
93
|
+
} catch {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}));
|
|
97
|
+
return new Map(kinds.flatMap((entry) => entry === null ? [] : [entry]));
|
|
98
|
+
}
|
|
99
|
+
function describeSource(lookup, bindings, liveKinds) {
|
|
80
100
|
if (lookup.kind !== "row") return lookup;
|
|
81
101
|
const bound = bindings.get(lookup.row.id);
|
|
82
102
|
if (bound === void 0) return {
|
|
@@ -87,12 +107,14 @@ function describeSource(lookup, bindings) {
|
|
|
87
107
|
kind: "unreadable",
|
|
88
108
|
error: bound.error
|
|
89
109
|
};
|
|
110
|
+
const live = liveKinds.get(lookup.row.id);
|
|
90
111
|
return {
|
|
91
112
|
kind: "found",
|
|
92
113
|
deviceId: lookup.row.id,
|
|
93
114
|
caps: new Set(bound.map((b) => b.capName)),
|
|
94
115
|
deviceType: lookup.row.type,
|
|
95
|
-
...lookup.row.quantity === void 0 ? {} : { quantity: lookup.row.quantity }
|
|
116
|
+
...lookup.row.quantity === void 0 ? {} : { quantity: lookup.row.quantity },
|
|
117
|
+
...live === void 0 || live.size === 0 ? {} : { liveKinds: live }
|
|
96
118
|
};
|
|
97
119
|
}
|
|
98
120
|
function describeTarget(lookup, bindings) {
|
|
@@ -117,14 +139,19 @@ function describeTarget(lookup, bindings) {
|
|
|
117
139
|
}))
|
|
118
140
|
};
|
|
119
141
|
}
|
|
120
|
-
async function describeCompositionSources(ports, sources, targets = []) {
|
|
142
|
+
async function describeCompositionSources(ports, sources, targets = [], unionReads = []) {
|
|
121
143
|
const owners = await listOwners(ports, [...sources, ...targets]);
|
|
122
144
|
const lookup = (ref) => [require_dist.compositionSourceKey(ref), rowOf(ref, owners.get(ref.addonId))];
|
|
123
145
|
const sourceRows = sources.map(lookup);
|
|
124
146
|
const targetRows = targets.map(lookup);
|
|
125
147
|
const bindings = await readBindings(ports, [...sourceRows, ...targetRows].flatMap(([, l]) => l.kind === "row" ? [l.row.id] : []));
|
|
148
|
+
const live = new Map(await Promise.all(sourceRows.flatMap(([key, l]) => {
|
|
149
|
+
if (l.kind !== "row") return [];
|
|
150
|
+
const reads = unionReads.filter((r) => require_dist.compositionSourceKey(r.source) === key);
|
|
151
|
+
return reads.length === 0 ? [] : [readLiveKinds(ports, l.row.id, reads).then((kinds) => [l.row.id, kinds])];
|
|
152
|
+
})));
|
|
126
153
|
return {
|
|
127
|
-
sources: new Map(sourceRows.map(([key, l]) => [key, describeSource(l, bindings)])),
|
|
154
|
+
sources: new Map(sourceRows.map(([key, l]) => [key, describeSource(l, bindings, live)])),
|
|
128
155
|
targets: new Map(targetRows.map(([key, l]) => [key, describeTarget(l, bindings)]))
|
|
129
156
|
};
|
|
130
157
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
|
|
2
|
-
var MESH_CA_KEY_REF = require("./dist-
|
|
2
|
+
var MESH_CA_KEY_REF = require("./dist-DlRUArVs.js").buildSecretRef({
|
|
3
3
|
owner: "system",
|
|
4
4
|
scope: { kind: "global" },
|
|
5
5
|
fieldPath: "meshCaKey"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as
|
|
1
|
+
import { G as DEVICE_SAN_USER_PREFIX, W as DEVICE_SAN_CREDENTIAL_PREFIX, uc as buildSecretRef } from "./dist-ByiDJLen.mjs";
|
|
2
2
|
import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
|
|
3
3
|
import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/auth/jwt-signing-key.ts
|