@camstack/system 1.2.439 → 1.2.440
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/dist/addon-runner.js +743 -79
- package/dist/addon-runner.mjs +743 -79
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/block-settings-store.d.ts +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +77 -11
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +77 -12
- package/dist/builtins/core-blocks/index.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +181 -59
- package/dist/builtins/device-manager/device-manager.addon.mjs +180 -60
- package/dist/builtins/device-manager/device-removal-hooks.d.ts +0 -11
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +29 -11
- package/dist/builtins/keychain/index.mjs +29 -11
- package/dist/builtins/keychain/keychain-service.d.ts +8 -0
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +38 -7
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +69 -3
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +69 -3
- package/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +31 -0
- package/dist/builtins/storage-orchestrator/hub-settings-forward.d.ts +3 -3
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +4 -4
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +4 -4
- package/dist/builtins/system-config/system-config.addon.js +2 -2
- package/dist/builtins/system-config/system-config.addon.mjs +283 -283
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-BGOSCGWa.mjs → composition-sources-CS0D7imL.mjs} +1 -1
- package/dist/{composition-sources-B4jC2FC7.js → composition-sources-cBG8fBTu.js} +1 -1
- package/dist/{constants-B92BjObl.mjs → constants-CIzPjw7L.mjs} +1 -1
- package/dist/{constants-BRsjQwi-.js → constants-CRI3QzT4.js} +1 -1
- package/dist/{device-ca-46BUsWD1.mjs → device-ca-DLKXYseS.mjs} +1 -1
- package/dist/{device-ca-DHG9OW2m.js → device-ca-DNHjts4_.js} +1 -1
- package/dist/{dist-yI6kF6r6.mjs → dist-9fcsrFU3.mjs} +237 -25
- package/dist/{dist-BOWdLjoK.js → dist-BKhlcYz6.js} +254 -24
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-D7S5AJRU.js → hub-mdns-ciao-3Zc9G9MS.js} +1 -1
- package/dist/{hub-mdns-ciao-DGwVc2uh.mjs → hub-mdns-ciao-Dy2YjRqC.mjs} +1 -1
- package/dist/index.js +336 -336
- package/dist/index.mjs +337 -337
- package/dist/kernel/addon-settings-store.d.ts +43 -0
- package/dist/kernel/config-manager.d.ts +0 -19
- package/dist/kernel/device-settings-store.d.ts +74 -0
- package/dist/kernel/legacy-blob-guard.d.ts +58 -0
- package/dist/kernel/moleculer/runner-addon-settings.d.ts +34 -0
- package/dist/kernel/moleculer/runner-device-settings.d.ts +39 -0
- package/dist/kernel/prefix-walk.d.ts +39 -0
- package/dist/kernel/sections-store.d.ts +20 -0
- package/dist/kernel/settings-door-view.d.ts +2 -2
- package/dist/kernel/settings-view-types.d.ts +5 -30
- package/dist/kernel/store-settings-view.d.ts +0 -3
- package/dist/prefix-range-D_KueXbQ.js +27 -0
- package/dist/prefix-range-Dl0znowN.mjs +22 -0
- package/dist/prefix-walk-DAOBSyH1.mjs +88 -0
- package/dist/prefix-walk-Dv6MLZlM.js +99 -0
- package/dist/{restore-archive-DiGiI6Jp.js → restore-archive-49aZwkp8.js} +1 -1
- package/dist/{restore-archive-CpdUO-uS.mjs → restore-archive-DgvDecXM.mjs} +82 -82
- package/dist/{retired-settings-keys-UsVtLOT0.mjs → retired-settings-keys-Bhwe4ymb.mjs} +2 -2
- package/dist/{retired-settings-keys-CyQ7uvta.js → retired-settings-keys-D_VwZiDt.js} +10 -4
- package/dist/{wal-maintenance-xsvdT5Go.mjs → wal-maintenance-BZGmF-3U.mjs} +0 -0
- package/dist/{wal-maintenance-DEL_jeG0.js → wal-maintenance-C041zn6V.js} +0 -0
- package/package.json +5 -2
- package/dist/{custom-action-registry-Bf_YnagS.js → custom-action-registry-BKmoaqG0.js} +1 -1
- package/dist/{custom-action-registry-BQnbN0DP.mjs → custom-action-registry-CyUuhATc.mjs} +1 -1
package/dist/addon-utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_custom_action_registry = require("./custom-action-registry-
|
|
3
|
+
const require_custom_action_registry = require("./custom-action-registry-BKmoaqG0.js");
|
|
4
4
|
const require_snapshot_courtesy = require("./snapshot-courtesy-D_C5-nC0.js");
|
|
5
5
|
exports.COURTESY_DEFAULT_WIDTH = require_snapshot_courtesy.COURTESY_DEFAULT_WIDTH;
|
|
6
6
|
exports.CustomActionRegistry = require_custom_action_registry.CustomActionRegistry;
|
package/dist/addon-utils.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-
|
|
1
|
+
import { C as isModelDownloaded, S as isModelDownloadHttpError, _ as downloadFile, a as startEventLoopStallMonitor, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, p as ModelDownloadHttpError, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-CyUuhATc.mjs";
|
|
2
2
|
import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg, t as COURTESY_DEFAULT_WIDTH } from "./snapshot-courtesy-CyFs1M3I.mjs";
|
|
3
3
|
export { COURTESY_DEFAULT_WIDTH, CustomActionRegistry, ModelDownloadHttpError, ModelDownloadService, STALL_REPORT_MS, STALL_TICK_MS, adoptModelRevisions, attributeStall, collectModelFiles, contentTypeFor, courtesyCacheKey, createFileDataPlaneHandler, deleteModelFromDisk, downloadFile, ensureModel, getModelFilePath, isModelDownloadHttpError, isModelDownloaded, parseRangeHeader, renderCourtesyJpeg, renderCourtesyOverlayJpeg, resolveFormatRevision, startEventLoopStallMonitor };
|
|
@@ -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-BKhlcYz6.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ar as errMsg, Si as EventCategory, it as addonPagesCapability, jr as BaseAddon } from "../../dist-9fcsrFU3.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -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-BKhlcYz6.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ar as errMsg, Si as EventCategory, jr as BaseAddon, ot as addonWidgetsCapability } from "../../dist-9fcsrFU3.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { createHash, randomUUID } from "node:crypto";
|
|
4
4
|
import * as path$1 from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-BKhlcYz6.js");
|
|
7
7
|
//#region src/builtins/alerts/device-label.ts
|
|
8
8
|
/**
|
|
9
9
|
* Operator-facing device label for alert messages.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ar as errMsg, Si as EventCategory, i as AlertSchema, jr as BaseAddon, qr as createEvent, st as alertsCapability } from "../../dist-9fcsrFU3.mjs";
|
|
2
2
|
//#region src/builtins/alerts/device-label.ts
|
|
3
3
|
/**
|
|
4
4
|
* Operator-facing device label for alert messages.
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-BKhlcYz6.js");
|
|
7
7
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
8
8
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
9
9
|
deadZoneFraction: .5,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ar as errMsg, M as FIRST_LEVEL_MACRO_CLASSES, Pn as ptzAutotrackCapability, Si as EventCategory, jr as BaseAddon, ni as isEvent, ut as bareAddonId } from "../../dist-9fcsrFU3.mjs";
|
|
2
2
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
3
3
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
4
4
|
deadZoneFraction: .5,
|
|
@@ -3,8 +3,8 @@ 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-
|
|
7
|
-
const require_restore_archive = require("../../restore-archive-
|
|
6
|
+
const require_dist = require("../../dist-BKhlcYz6.js");
|
|
7
|
+
const require_restore_archive = require("../../restore-archive-49aZwkp8.js");
|
|
8
8
|
let node_crypto = require("node:crypto");
|
|
9
9
|
let node_fs_promises = require("node:fs/promises");
|
|
10
10
|
node_fs_promises = require_chunk.__toESM(node_fs_promises);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-
|
|
1
|
+
import { Si as EventCategory, bn as mayWriteToLocation, jr as BaseAddon, lt as backupCapability, rr as storageOccupancyCapability, si as nodePin, vi as toNodeId } from "../../dist-9fcsrFU3.mjs";
|
|
2
|
+
import { a as BackupSnapshotRefusedError, d as ENCRYPTED_BACKUP_SUFFIX, f as generateBackupKeyPair, i as BackupCancelledError, l as BackupKeyFormatError, m as parseBackupSecretKey, n as precheckRestoreKey, o as DEFAULT_BACKUP_DATABASES, p as parseBackupPublicKey, r as prepareRestoreArchive, s as SystemBackupService } from "../../restore-archive-DgvDecXM.mjs";
|
|
3
3
|
import { randomUUID } from "node:crypto";
|
|
4
4
|
import * as fsp from "node:fs/promises";
|
|
5
5
|
import * as path$1 from "node:path";
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-BKhlcYz6.js");
|
|
7
7
|
const require_settle_sources = require("../../settle-sources-Bhsy57y-.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/calendars/calendar-color.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as CalendarPreferencesSchema, gt as calendarsCapability, jr as BaseAddon } from "../../dist-9fcsrFU3.mjs";
|
|
2
2
|
import { t as settleSourcesWithTimeout } from "../../settle-sources-CDtNC8ub.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/calendars/calendar-color.ts
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-BKhlcYz6.js");
|
|
7
7
|
let zod = require("zod");
|
|
8
8
|
let _camstack_types_node = require("@camstack/types/node");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as DeclaredDevices,
|
|
1
|
+
import { A as DeclaredDevices, Ar as errMsg, Dr as DeviceFeature, H as MOTION_CLOSE_AFTER_MS, Qn as snapshotCapability, Si as EventCategory, _t as cameraGridLayoutCapability, ar as streamCatalogCapability, ei as hydrateSchema, gr as buildFfmpegArgs, jr as BaseAddon, jt as declarationOwnerNodeId, kr as DeviceType, o as BaseDevice, qr as createEvent, w as DERIVED_CAMERA_SILENCED_CAP_NAMES, wn as motionCapability, xn as memoizePinnedFfmpeg } from "../../dist-9fcsrFU3.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { FfmpegProcess } from "@camstack/types/node";
|
|
4
4
|
import { join } from "node:path";
|
|
@@ -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_composition_sources = require("../../composition-sources-
|
|
6
|
+
const require_dist = require("../../dist-BKhlcYz6.js");
|
|
7
|
+
const require_composition_sources = require("../../composition-sources-cBG8fBTu.js");
|
|
8
8
|
let zod = require("zod");
|
|
9
9
|
//#region src/builtins/shared/device-state-changed.ts
|
|
10
10
|
/** Structural narrowing helper for untrusted bus payloads. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as DeclaredDevices,
|
|
2
|
-
import { n as normalizedNativeOwner } from "../../composition-sources-
|
|
1
|
+
import { A as DeclaredDevices, Ar as errMsg, Cr as compositionSourceKey, Er as toExpressionValue, Si as EventCategory, Sr as compositionSliceKey, Tr as disarmRoseMemory, Wt as evaluateCompositionField, _r as cloneStatefulExpressionMemory, br as compositionFeatureEnabled, bt as composerCapability, f as COMPOSED_ITEM_FIXED_FIELDS, ft as buildCapabilityLookup, hr as COMPOSER_ADDON_ID, jn as planComposition, jr as BaseAddon, kr as DeviceType, o as BaseDevice, qr as createEvent, qt as expressionContainsBuiltinCall, r as ALL_CAPABILITY_DEFINITIONS, vr as composedDeviceRef, wr as createStatefulExpressionMemory, xr as compositionItemFieldPath, xt as compositionFieldKey, yr as composedDeviceStableId } from "../../dist-9fcsrFU3.mjs";
|
|
2
|
+
import { n as normalizedNativeOwner } from "../../composition-sources-CS0D7imL.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/builtins/shared/device-state-changed.ts
|
|
5
5
|
/** Structural narrowing helper for untrusted bus payloads. */
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
require("../../chunk-Cek0wNdY.js");
|
|
6
|
-
const require_dist = require("../../dist-
|
|
6
|
+
const require_dist = require("../../dist-BKhlcYz6.js");
|
|
7
7
|
const require_formatter = require("../../formatter-DqAKDlvN.js");
|
|
8
8
|
//#region src/builtins/console-logging/console-destination.ts
|
|
9
9
|
var LEVEL_RANK = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gn as logDestinationCapability, jr as BaseAddon } from "../../dist-9fcsrFU3.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
|
|
3
3
|
//#region src/builtins/console-logging/console-destination.ts
|
|
4
4
|
var LEVEL_RANK = {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* keeps any values the UI already wrote.
|
|
9
9
|
*
|
|
10
10
|
* On every patch the same values are mirrored into the block addon's
|
|
11
|
-
* `addon-settings`
|
|
11
|
+
* `addon-settings` rows so a running script reads them the same way any
|
|
12
12
|
* addon does: `ctx.settings.readAddonStore()`.
|
|
13
13
|
*/
|
|
14
14
|
import type { SettingsStoreClient } from "@camstack/types";
|
|
@@ -1,7 +1,9 @@
|
|
|
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_composition_sources = require("../../composition-sources-
|
|
3
|
+
const require_dist = require("../../dist-BKhlcYz6.js");
|
|
4
|
+
const require_composition_sources = require("../../composition-sources-cBG8fBTu.js");
|
|
5
|
+
const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
|
|
6
|
+
const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
|
|
5
7
|
let node_crypto = require("node:crypto");
|
|
6
8
|
let _camstack_types_node = require("@camstack/types/node");
|
|
7
9
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -490,6 +492,72 @@ var BlockSupervisor = class {
|
|
|
490
492
|
}
|
|
491
493
|
};
|
|
492
494
|
//#endregion
|
|
495
|
+
//#region src/kernel/addon-settings-store.ts
|
|
496
|
+
/** The collection every addon's settings share. Named nowhere else (with sections' own module). */
|
|
497
|
+
var ADDON_SETTINGS_COLLECTION = "addon-settings";
|
|
498
|
+
function createAddonSettingsStore(door, addonId) {
|
|
499
|
+
const prefix = `${addonId}.`;
|
|
500
|
+
const message = (err) => err instanceof Error ? err.message : String(err);
|
|
501
|
+
return {
|
|
502
|
+
async read() {
|
|
503
|
+
try {
|
|
504
|
+
const value = await require_prefix_walk.loadPrefixed(door, ADDON_SETTINGS_COLLECTION, prefix);
|
|
505
|
+
return Object.keys(value).length === 0 ? { kind: "absent" } : {
|
|
506
|
+
kind: "present",
|
|
507
|
+
value
|
|
508
|
+
};
|
|
509
|
+
} catch (err) {
|
|
510
|
+
return {
|
|
511
|
+
kind: "unreadable",
|
|
512
|
+
error: message(err)
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
},
|
|
516
|
+
async readKey(key) {
|
|
517
|
+
try {
|
|
518
|
+
const row = await door.get({
|
|
519
|
+
collection: ADDON_SETTINGS_COLLECTION,
|
|
520
|
+
key: `${prefix}${key}`
|
|
521
|
+
});
|
|
522
|
+
return row === void 0 || row === null ? { kind: "absent" } : {
|
|
523
|
+
kind: "present",
|
|
524
|
+
value: require_prefix_walk.unwrapStoredValue(row)
|
|
525
|
+
};
|
|
526
|
+
} catch (err) {
|
|
527
|
+
return {
|
|
528
|
+
kind: "unreadable",
|
|
529
|
+
error: message(err)
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
async merge(patch) {
|
|
534
|
+
const records = [];
|
|
535
|
+
const removed = [];
|
|
536
|
+
for (const [key, value] of Object.entries(patch)) if (value === void 0) removed.push(`${prefix}${key}`);
|
|
537
|
+
else records.push({
|
|
538
|
+
id: `${prefix}${key}`,
|
|
539
|
+
data: {
|
|
540
|
+
addonId,
|
|
541
|
+
key,
|
|
542
|
+
value
|
|
543
|
+
}
|
|
544
|
+
});
|
|
545
|
+
if (records.length === 0 && removed.length === 0) return;
|
|
546
|
+
if (require_prefix_range.prefixRange(prefix) === null) throw new Error(`addon settings: "${addonId}" cannot be expressed as an id range`);
|
|
547
|
+
await door.transact({ ops: [...removed.length > 0 ? [{
|
|
548
|
+
op: "deleteWhere",
|
|
549
|
+
collection: ADDON_SETTINGS_COLLECTION,
|
|
550
|
+
filter: { whereIn: { id: removed } }
|
|
551
|
+
}] : [], ...records.length > 0 ? [{
|
|
552
|
+
op: "upsertMany",
|
|
553
|
+
collection: ADDON_SETTINGS_COLLECTION,
|
|
554
|
+
conflict: ["id"],
|
|
555
|
+
records
|
|
556
|
+
}] : []] });
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
//#endregion
|
|
493
561
|
//#region src/builtins/core-blocks/block-settings-store.ts
|
|
494
562
|
/**
|
|
495
563
|
* @durable class=config owner=core-blocks
|
|
@@ -550,15 +618,12 @@ var BlockSettingsStore = class {
|
|
|
550
618
|
});
|
|
551
619
|
}
|
|
552
620
|
async mirrorToBlockAddon(blockId, values) {
|
|
553
|
-
const
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
value: values
|
|
560
|
-
});
|
|
561
|
-
} catch {}
|
|
621
|
+
const store = this.store;
|
|
622
|
+
await createAddonSettingsStore({
|
|
623
|
+
query: (input) => store.query.query(input),
|
|
624
|
+
get: (input) => store.get.query(input),
|
|
625
|
+
transact: (input) => store.transact.mutate(input)
|
|
626
|
+
}, require_dist.coreBlockAddonId(blockId)).merge(values);
|
|
562
627
|
}
|
|
563
628
|
};
|
|
564
629
|
//#endregion
|
|
@@ -2273,6 +2338,7 @@ exports.CoreBlocksAddon = CoreBlocksAddon;
|
|
|
2273
2338
|
exports.blockAddonId = blockAddonId;
|
|
2274
2339
|
exports.blockIdFromAddonId = blockIdFromAddonId;
|
|
2275
2340
|
exports.compileBlock = compileBlock;
|
|
2341
|
+
exports.createAddonSettingsStore = createAddonSettingsStore;
|
|
2276
2342
|
exports.extractSettingsSchema = extractSettingsSchema;
|
|
2277
2343
|
exports.loadBlockTypeDefs = loadBlockTypeDefs;
|
|
2278
2344
|
exports.materializeBlock = materializeBlock;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { A as DeclaredDevices,
|
|
2
|
-
import { t as describeCompositionSources } from "../../composition-sources-
|
|
1
|
+
import { A as DeclaredDevices, Ar as errMsg, Bn as resolveCoreBlockFiles, Cr as compositionSourceKey, Ct as coreBlockAddonId, Dt as coreBlocksCapability, Et as coreBlockSourceKind, Ft as describeComposableCaps, In as replacedFieldKeys, St as compositionSourceRefs, Tn as normalizeCoreBlockWrite, Tt as coreBlockIdFromAddonId, ei as hydrateSchema, ft as buildCapabilityLookup, h as CORE_BLOCK_ADDON_PREFIX, jn as planComposition, jr as BaseAddon, lr as validateComposition, m as CORE_BLOCKS_ADDON_ID, p as COMPOSER_RUNNER_ID, r as ALL_CAPABILITY_DEFINITIONS, v as CoreBlockSchema, vr as composedDeviceRef, wt as coreBlockComposition, zn as resolveCoreBlockEntry } from "../../dist-9fcsrFU3.mjs";
|
|
2
|
+
import { t as describeCompositionSources } from "../../composition-sources-CS0D7imL.mjs";
|
|
3
|
+
import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
|
|
4
|
+
import { n as unwrapStoredValue, t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
|
|
3
5
|
import { createRequire } from "node:module";
|
|
4
6
|
import { randomUUID } from "node:crypto";
|
|
5
7
|
import { customizationBlockName } from "@camstack/types/node";
|
|
@@ -485,6 +487,72 @@ var BlockSupervisor = class {
|
|
|
485
487
|
}
|
|
486
488
|
};
|
|
487
489
|
//#endregion
|
|
490
|
+
//#region src/kernel/addon-settings-store.ts
|
|
491
|
+
/** The collection every addon's settings share. Named nowhere else (with sections' own module). */
|
|
492
|
+
var ADDON_SETTINGS_COLLECTION = "addon-settings";
|
|
493
|
+
function createAddonSettingsStore(door, addonId) {
|
|
494
|
+
const prefix = `${addonId}.`;
|
|
495
|
+
const message = (err) => err instanceof Error ? err.message : String(err);
|
|
496
|
+
return {
|
|
497
|
+
async read() {
|
|
498
|
+
try {
|
|
499
|
+
const value = await loadPrefixed(door, ADDON_SETTINGS_COLLECTION, prefix);
|
|
500
|
+
return Object.keys(value).length === 0 ? { kind: "absent" } : {
|
|
501
|
+
kind: "present",
|
|
502
|
+
value
|
|
503
|
+
};
|
|
504
|
+
} catch (err) {
|
|
505
|
+
return {
|
|
506
|
+
kind: "unreadable",
|
|
507
|
+
error: message(err)
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
async readKey(key) {
|
|
512
|
+
try {
|
|
513
|
+
const row = await door.get({
|
|
514
|
+
collection: ADDON_SETTINGS_COLLECTION,
|
|
515
|
+
key: `${prefix}${key}`
|
|
516
|
+
});
|
|
517
|
+
return row === void 0 || row === null ? { kind: "absent" } : {
|
|
518
|
+
kind: "present",
|
|
519
|
+
value: unwrapStoredValue(row)
|
|
520
|
+
};
|
|
521
|
+
} catch (err) {
|
|
522
|
+
return {
|
|
523
|
+
kind: "unreadable",
|
|
524
|
+
error: message(err)
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
async merge(patch) {
|
|
529
|
+
const records = [];
|
|
530
|
+
const removed = [];
|
|
531
|
+
for (const [key, value] of Object.entries(patch)) if (value === void 0) removed.push(`${prefix}${key}`);
|
|
532
|
+
else records.push({
|
|
533
|
+
id: `${prefix}${key}`,
|
|
534
|
+
data: {
|
|
535
|
+
addonId,
|
|
536
|
+
key,
|
|
537
|
+
value
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
if (records.length === 0 && removed.length === 0) return;
|
|
541
|
+
if (prefixRange(prefix) === null) throw new Error(`addon settings: "${addonId}" cannot be expressed as an id range`);
|
|
542
|
+
await door.transact({ ops: [...removed.length > 0 ? [{
|
|
543
|
+
op: "deleteWhere",
|
|
544
|
+
collection: ADDON_SETTINGS_COLLECTION,
|
|
545
|
+
filter: { whereIn: { id: removed } }
|
|
546
|
+
}] : [], ...records.length > 0 ? [{
|
|
547
|
+
op: "upsertMany",
|
|
548
|
+
collection: ADDON_SETTINGS_COLLECTION,
|
|
549
|
+
conflict: ["id"],
|
|
550
|
+
records
|
|
551
|
+
}] : []] });
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
//#endregion
|
|
488
556
|
//#region src/builtins/core-blocks/block-settings-store.ts
|
|
489
557
|
/**
|
|
490
558
|
* @durable class=config owner=core-blocks
|
|
@@ -545,15 +613,12 @@ var BlockSettingsStore = class {
|
|
|
545
613
|
});
|
|
546
614
|
}
|
|
547
615
|
async mirrorToBlockAddon(blockId, values) {
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
value: values
|
|
555
|
-
});
|
|
556
|
-
} catch {}
|
|
616
|
+
const store = this.store;
|
|
617
|
+
await createAddonSettingsStore({
|
|
618
|
+
query: (input) => store.query.query(input),
|
|
619
|
+
get: (input) => store.get.query(input),
|
|
620
|
+
transact: (input) => store.transact.mutate(input)
|
|
621
|
+
}, coreBlockAddonId(blockId)).merge(values);
|
|
557
622
|
}
|
|
558
623
|
};
|
|
559
624
|
//#endregion
|
|
@@ -2258,4 +2323,4 @@ async function loadTranspiler(logger) {
|
|
|
2258
2323
|
}
|
|
2259
2324
|
}
|
|
2260
2325
|
//#endregion
|
|
2261
|
-
export { CoreBlocksAddon, loadBlockTypeDefs as a,
|
|
2326
|
+
export { CoreBlocksAddon, loadBlockTypeDefs as a, createAddonSettingsStore as c, blockAddonId as d, blockIdFromAddonId as f, compileBlock as i, BlockSupervisor as l, removeBlockPackage as m, CORE_BLOCKS_COLLECTION as n, BlockSettingsStore as o, materializeBlock as p, CoreBlockStore as r, CORE_BLOCK_SETTINGS_COLLECTION as s, extractSettingsSchema as t, BLOCK_ADDON_PREFIX as u };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CoreBlocksAddon, a as loadBlockTypeDefs,
|
|
1
|
+
import { CoreBlocksAddon, a as loadBlockTypeDefs, d as blockAddonId, f as blockIdFromAddonId, i as compileBlock, l as BlockSupervisor, m as removeBlockPackage, n as CORE_BLOCKS_COLLECTION, o as BlockSettingsStore, p as materializeBlock, r as CoreBlockStore, s as CORE_BLOCK_SETTINGS_COLLECTION, t as extractSettingsSchema, u as BLOCK_ADDON_PREFIX } from "./core-blocks.addon.mjs";
|
|
2
2
|
export { BLOCK_ADDON_PREFIX, BlockSettingsStore, BlockSupervisor, CORE_BLOCKS_COLLECTION, CORE_BLOCK_SETTINGS_COLLECTION, CoreBlockStore, CoreBlocksAddon, CoreBlocksAddon as default, blockAddonId, blockIdFromAddonId, compileBlock, extractSettingsSchema, loadBlockTypeDefs, materializeBlock, removeBlockPackage };
|