@camstack/server 1.2.804 → 1.2.806
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 +13 -0
- package/dist/agent/main.js +1 -1
- package/dist/api/core/addon-settings.router.js +2 -2
- package/dist/api/trpc/device-config-secret-redaction.js +3 -5
- package/dist/api/trpc/generated-cap-routers.js +10 -24
- package/dist/api/trpc/localized-schema-paths.js +0 -2
- package/dist/core/addon/addon-registry.service.js +4 -4
- package/dist/core/addon/addon-settings-provider.js +2 -49
- package/package.json +13 -15
- package/system/dist/addon-runner.js +2 -9
- package/system/dist/addon-runner.mjs +2 -9
- package/system/dist/{agent-https-BFvIRgIa.js → agent-https-CuChFRA2.js} +1 -1
- package/system/dist/{agent-https-Bp70et-W.mjs → agent-https-DS4b0ucn.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 +4 -5
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +4 -5
- 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-alias-actions.d.ts +45 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +961 -768
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +961 -768
- package/system/dist/builtins/device-manager/device-meta-types.d.ts +3 -0
- package/system/dist/builtins/device-manager/device-row-store.d.ts +8 -0
- package/system/dist/builtins/device-manager/device-template/mirror-resolver.d.ts +19 -0
- package/system/dist/builtins/device-manager/device-template/nunjucks-internals.d.ts +53 -0
- package/system/dist/builtins/device-manager/device-template/template-filters.d.ts +28 -0
- package/system/dist/builtins/device-manager/device-template/template-grammar.d.ts +43 -0
- package/system/dist/builtins/device-manager/device-template/template-protocol.d.ts +33 -0
- package/system/dist/builtins/device-manager/device-template/template-renderer.d.ts +54 -0
- package/system/dist/builtins/device-manager/device-template/template-worker.d.ts +1 -0
- 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 +2 -2
- package/system/dist/builtins/snapshot/index.mjs +2 -2
- package/system/dist/builtins/snapshot/snapshot.addon.d.ts +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/bootstrap-form-actions.d.ts +4 -4
- package/system/dist/builtins/system-config/system-config.addon.js +7 -7
- 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-Sh4zAKR0.js → capture-engine-Byc5Fkp0.js} +1 -1
- package/system/dist/{capture-engine-CQBSd3V1.mjs → capture-engine-CnVIcnyN.mjs} +1 -1
- package/system/dist/{composition-sources-BxSmsp0_.mjs → composition-sources-BhM6G9QT.mjs} +1 -1
- package/system/dist/{composition-sources-rAsv2tZD.js → composition-sources-BxK6ttP9.js} +1 -1
- package/system/dist/{constants-BCQCUHl9.js → constants--xo6Q-KA.js} +1 -1
- package/system/dist/{constants-BfgfqUFH.mjs → constants-Bf1PEHRU.mjs} +1 -1
- package/system/dist/{device-ca-D7JZLEAn.mjs → device-ca-Do0-HV_h.mjs} +1 -1
- package/system/dist/{device-ca-BgCwLzMX.js → device-ca-Uq5KGFSq.js} +1 -1
- package/system/dist/device-template-worker.js +7289 -0
- package/system/dist/device-template-worker.mjs +7287 -0
- package/system/dist/{dist-BpIvMLVc.js → dist-2SHQaxaS.js} +607 -616
- package/system/dist/{dist-Bvw9utDk.mjs → dist-CogtCQxu.mjs} +590 -617
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-DZwGhLx-.js → hub-mdns-ciao-DqPrLiYH.js} +2 -2
- package/system/dist/{hub-mdns-ciao-qefBaLZn.mjs → hub-mdns-ciao-aFHCKrif.mjs} +2 -2
- package/system/dist/index.js +28 -48
- package/system/dist/index.mjs +28 -48
- package/system/dist/kernel/moleculer/addon-service-factory.d.ts +2 -3
- package/system/dist/kernel/transport/child-cap-protocol.d.ts +2 -2
- package/system/dist/kernel/transport/parent-unowned-call.d.ts +1 -1
- package/system/dist/{legacy-integration-rows-door-gqcsQX0L.js → legacy-integration-rows-door-Bz8rivxI.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-DCfOpaG3.mjs → legacy-integration-rows-door-CiuxDLoc.mjs} +1 -1
- package/system/dist/{restore-archive-BS6gi0i-.mjs → restore-archive-BcsSlHR8.mjs} +78 -78
- package/system/dist/{restore-archive-BtgtMV29.js → restore-archive-D-3wmHDq.js} +1 -1
- package/system/dist/{wal-maintenance-CyyJs8fh.js → wal-maintenance-BTR55y--.js} +0 -0
- package/system/dist/{wal-maintenance-DBCFpkyy.mjs → wal-maintenance-jrhYTCn2.mjs} +0 -0
- package/system/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as EMPTY_AUTOMATION_STATE, $
|
|
1
|
+
import { $ as EMPTY_AUTOMATION_STATE, $i as proposeRunningThreshold, $n as coreBlockSourceKind, $r as isInternalActionId, A as ControlStatusSchema, Ai as normalizeActionUnits, Bn as checkTemplatePayload, C as CORE_BLOCKS_ADDON_ID, Cc as secretTreeFromSchema, Co as composedDeviceRef, Er as evaluateWhenTree, Et as MediaPlayerStatusSchema, Fa as stableIdMapOf, Fs as collectSecretMarkerRefs, Ft as PowerSourceInfoSchema, Gi as planComposition, Gn as compileScalarOverride, Gt as RemoteConfigSchema, Hn as collectWhenMirrorSources, Hs as defineRecordKinds, Ic as EventCategory$1, In as capUnitResolver, J as DeclaredDevices, Ja as timedRunLimitOf, Ji as powerSourceLinkOfComposition, Jn as compositionSourceRefs, Ka as templateCapability, Ko as BaseAddon, Kt as RunningStateStatusSchema, Li as occurrenceOn, Mi as normalizeCoreBlockWrite, Nc as DeviceType$1, Ni as normalizeStepTargets, No as helperMembers, Nr as fanPresetsCapability, O as ConditionMirror, Oc as transformSecretWrite, On as buildActionSteps, Oo as compositionSourceKey, Pc as errMsg$1, Po as historyRetentionFromSettings, Qn as coreBlockIdFromAddonId, R as DEFAULT_HOLD_OVERRIDE, S as COMPOSER_RUNNER_ID, Sa as schedulersCapability, Vt as REMOTE_MEDIA_COMMANDS, Wr as internalActionId, Wt as RemoteAssumedStateSchema, Xa as timedRunQuickRun, Xi as problemsBlockSave, Xn as coreBlockAddonId, Xs as hydrateSchema, Xt as SchedulerError, Ya as timedRunMaxIn, Za as timedRunSeconds, Zn as coreBlockComposition, Zt as SchedulerSchema, aa as remoteLayoutComponentsCapability, ac as isSecretMarker, an as SwitchStatusSchema, ba as runSteps, bc as resolveSecretMarkers, c as ActionError, co as weekdayOfLocalDate, d as ActionVariableSchema, da as resolveCoreBlockFiles, dn as actionSourceCapability, do as zoneOnlySite, eo as validateComposition, er as coreBlocksCapability, et as EMPTY_REMOTE_ASSUMED_STATE, fn as actionWaitTotalMs, fr as describeComposableCaps, gt as INTERNAL_ACTION_PREFIX, ht as IDLE_ACTION_STATUS, ia as remoteCapability, ii as kebabToCamel, ir as customRole, it as FanControlStatusSchema, j as CoreBlockSchema, ja as siteFor, ji as normalizeCapStep, ki as nextOccurrence, kn as buildCapabilityLookup, l as ActionStepSchema, m as BUILTIN_REMOTE_COMPONENTS, mi as lockDoorLinkOfComposition, mn as addonIdOfActionId, mo as DAY_MS, n as ACTION_TARGET_INVALIDATION_EVENTS, no as validateSchedulerInput, nt as FAN_CAPTURE_FIELDS, oa as replacedFieldKeys, on as TemplateKindSchema, ot as FanPresetSchema, p as AutomationStateDocSchema, pn as actionsCapability, po as CompositionSchema, qa as timedRunCapability, qi as powerSourceCapability, rr as customKeyOfRole, s as ALL_CAPABILITY_DEFINITIONS, sa as resolveActionVariables, sc as isSecretRefOwnedBy, so as vocabActionIdFor, tt as EMPTY_REMOTE_CONFIG, u as ActionTargetResolver, ua as resolveCoreBlockEntry, ui as localDateOf, un as actionEffect, va as resolveStepArgs, w as CORE_BLOCK_ADDON_PREFIX, xn as appendTrace, yo as HelperMemberSchema, zs as defineAddonMigrations, zt as QuantityUnitError } from "../../dist-CogtCQxu.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
|
-
import { i as parseDeviceStateChanged, t as describeCompositionSources } from "../../composition-sources-
|
|
4
|
-
import { i as capSeriesKey } from "../../capture-engine-
|
|
3
|
+
import { i as parseDeviceStateChanged, t as describeCompositionSources } from "../../composition-sources-BhM6G9QT.mjs";
|
|
4
|
+
import { i as capSeriesKey } from "../../capture-engine-CnVIcnyN.mjs";
|
|
5
5
|
import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
|
|
6
6
|
import { n as unwrapStoredValue, t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
|
|
7
7
|
import { createRequire } from "node:module";
|
|
@@ -5348,8 +5348,7 @@ function hostOver(api) {
|
|
|
5348
5348
|
capName: cap
|
|
5349
5349
|
}),
|
|
5350
5350
|
fetchStableIds: async () => {
|
|
5351
|
-
|
|
5352
|
-
return new Map(all.flatMap((d) => d.stableId === void 0 ? [] : [[d.stableId, d.id]]));
|
|
5351
|
+
return stableIdMapOf(await need().deviceManager.listAll.query({ projection: "slim" }));
|
|
5353
5352
|
},
|
|
5354
5353
|
invokeCap: invokeCapOver(api)
|
|
5355
5354
|
};
|
|
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
7
|
-
const require_capture_engine = require("../../capture-engine-
|
|
6
|
+
const require_dist = require("../../dist-2SHQaxaS.js");
|
|
7
|
+
const require_capture_engine = require("../../capture-engine-Byc5Fkp0.js");
|
|
8
8
|
const require_retention = require("../../retention-BNONb5X_.js");
|
|
9
9
|
let node_crypto = require("node:crypto");
|
|
10
10
|
//#region src/builtins/device-history/capture/point-writer.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-
|
|
1
|
+
import { Go as wattMillisecondsToKwh, Hs as defineRecordKinds, Ic as EventCategory, Ko as BaseAddon, Nc as DeviceType, Sn as armRemovalReconcile, V as DEVICE_HISTORY_ENERGY_KEY, Ws as emitReadiness, Y as DeviceRunSchema, Ys as historyUnitFor, dt as HISTORY_ITEM_CATALOG, gr as deviceHistoryCapability, nc as isReadingQuantity, ut as HISTORY_CATALOG, vr as deviceRemovalHookCapability, yr as deviceRunsCapability } from "../../dist-CogtCQxu.mjs";
|
|
2
|
+
import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-CnVIcnyN.mjs";
|
|
3
3
|
import { a as FIVE_MINUTES_MS, c as bucketEndOf, i as DAY_MS, l as bucketStartOf, n as RetentionJob, o as HOUR_MS, r as DepartureTracker, s as ROLLUP_GRACE_MS, t as DEFAULT_RETENTION, u as floorTo } from "../../retention-B9l9TnGE.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
//#region src/builtins/device-history/capture/point-writer.ts
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { deviceManagerCapability, type InferProvider } from "@camstack/types";
|
|
2
|
+
import type { ProviderContext } from "./device-provider-context.js";
|
|
3
|
+
import type { DeviceRowStore } from "./device-row-store.js";
|
|
4
|
+
type IDeviceManagerProvider = InferProvider<typeof deviceManagerCapability>;
|
|
5
|
+
export declare const DEVICE_ALIAS_BACKFILL_MARKER_KEY = "_deviceAliasBackfillVersion";
|
|
6
|
+
export declare const DEVICE_ALIAS_BACKFILL_VERSION = 1;
|
|
7
|
+
/**
|
|
8
|
+
* Addon-store key holding `{ [alias]: deviceId }` of REMOVED devices. A removed
|
|
9
|
+
* device's alias stays reserved so a template that still names it never silently
|
|
10
|
+
* starts reading a different device; only an explicit `setAlias` reclaims it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const RESERVED_ALIASES_KEY = "_reservedAliases";
|
|
13
|
+
export type ReservedAliases = Readonly<Record<string, number>>;
|
|
14
|
+
export declare function readReservedAliases(pctx: ProviderContext): Promise<ReservedAliases>;
|
|
15
|
+
/** Keep the alias of a device that is being removed. Caller holds the meta write lock. */
|
|
16
|
+
export declare function reserveAliasOfRemovedDevice(pctx: ProviderContext, alias: string, deviceId: number): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* The first free alias for `name`, against the persisted fleet. Caller holds the
|
|
19
|
+
* meta write lock. `selfId` is the device the alias is for: finding itself is not
|
|
20
|
+
* a collision.
|
|
21
|
+
*/
|
|
22
|
+
export declare function freeAliasFor(rows: DeviceRowStore, name: string, selfId: number, reserved: ReservedAliases): Promise<string>;
|
|
23
|
+
export declare function setAlias(pctx: ProviderContext, input: Parameters<IDeviceManagerProvider["setAlias"]>[0]): ReturnType<IDeviceManagerProvider["setAlias"]>;
|
|
24
|
+
export interface AliasBackfillRow {
|
|
25
|
+
readonly id: number;
|
|
26
|
+
readonly name: string;
|
|
27
|
+
readonly alias?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface AliasBackfillAssignment {
|
|
30
|
+
readonly id: number;
|
|
31
|
+
readonly alias: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Who gets which alias. Rows are taken in id order, so the same fleet always
|
|
35
|
+
* yields the same names; an alias a row already carries is kept and reserved.
|
|
36
|
+
*/
|
|
37
|
+
export declare function planAliasBackfill(rows: readonly AliasBackfillRow[], reserved?: ReservedAliases): readonly AliasBackfillAssignment[];
|
|
38
|
+
/**
|
|
39
|
+
* One-shot, under a version marker in the addon store (same posture as the
|
|
40
|
+
* location and linked-devices backfills it sits beside): every device that has
|
|
41
|
+
* no alias gets the slug of its current name, deduped. Registration also stamps
|
|
42
|
+
* an alias-less row, so a device the boot missed heals the first time it registers.
|
|
43
|
+
*/
|
|
44
|
+
export declare function runDeviceAliasBackfillAtBoot(pctx: ProviderContext): Promise<void>;
|
|
45
|
+
export {};
|