@camstack/system 1.2.461 → 1.2.462
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 +21 -276
- package/dist/addon-runner.mjs +21 -276
- package/dist/{agent-https-Dnr_nIVx.js → agent-https-C6M6apPV.js} +1 -1
- package/dist/{agent-https-Iw3RSQup.mjs → agent-https-CC7jpktS.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.d.ts +1 -3
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +51 -502
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +51 -502
- package/dist/builtins/backup-orchestrator/destination-policy.d.ts +5 -21
- package/dist/builtins/backup-orchestrator/record-kinds.d.ts +0 -2
- package/dist/builtins/backup-orchestrator/schedule-store.d.ts +5 -13
- package/dist/builtins/backup-orchestrator/seed-marker-store.d.ts +9 -19
- 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/cluster-agent/record-kinds.d.ts +0 -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/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- 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/auth-schema.d.ts +2 -12
- package/dist/builtins/local-auth/local-auth.addon.js +52 -191
- package/dist/builtins/local-auth/local-auth.addon.mjs +52 -191
- package/dist/builtins/local-auth/oauth-session-manager.d.ts +13 -4
- package/dist/builtins/local-auth/record-kinds.d.ts +1 -1
- 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/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/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/file-host-protocol.d.ts +0 -9
- 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/owned-sqlite-file.d.ts +0 -8
- package/dist/builtins/sqlite-storage/records/records-sql.d.ts +0 -2
- package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +0 -28
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +1 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +6 -170
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +6 -170
- package/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +3 -17
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +280 -280
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-b0e_2I-D.js → composition-sources-BPnpB9XG.js} +1 -1
- package/dist/{composition-sources-DNRZWR1j.mjs → composition-sources-BlcYzFwY.mjs} +1 -1
- package/dist/{constants-6OeJiZgi.js → constants-7ZMxWr8Z.js} +1 -1
- package/dist/{constants-BnkOdj9Q.mjs → constants-CH5UXe_G.mjs} +1 -1
- package/dist/{device-ca-Bnkw8GyU.mjs → device-ca-BU_gnd-q.mjs} +1 -1
- package/dist/{device-ca-CPTDs--d.js → device-ca-CUEx7sti.js} +1 -1
- package/dist/{dist-Wy8cTxg6.mjs → dist-8tWIDoWp.mjs} +15 -55
- package/dist/{dist-Bn-RNanh.js → dist-Ct-4tTeX.js} +14 -66
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-CJu0nhla.mjs → hub-mdns-ciao-Cuy7LUdz.mjs} +2 -2
- package/dist/{hub-mdns-ciao-CTBTlia4.js → hub-mdns-ciao-DJ-Amqd7.js} +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +88 -240
- package/dist/index.mjs +89 -236
- package/dist/kernel/index.d.ts +0 -1
- package/dist/kernel/moleculer/runner-addon-settings.d.ts +1 -6
- package/dist/kernel/moleculer/runner-device-settings.d.ts +2 -2
- package/dist/{restore-archive-CM23Pq9B.mjs → restore-archive-BDua3jO6.mjs} +78 -78
- package/dist/{restore-archive-DM1OBYq4.js → restore-archive-HwOA83v3.js} +1 -1
- package/dist/{retired-settings-keys-D_VwZiDt.js → retired-settings-keys-CGUqX-Oz.js} +0 -6
- package/dist/{retired-settings-keys-Bhwe4ymb.mjs → retired-settings-keys-C_Kjp-Bj.mjs} +1 -1
- package/dist/{wal-maintenance-Bj_MmDkr.mjs → wal-maintenance-BvzVehem.mjs} +0 -0
- package/dist/{wal-maintenance-CaJjuLHq.js → wal-maintenance-DBvuVU9s.js} +0 -0
- package/package.json +1 -1
- package/dist/builtins/sqlite-storage/retired-collections.d.ts +0 -146
- package/dist/kernel/legacy-blob-guard.d.ts +0 -63
package/dist/addon-runner.mjs
CHANGED
|
@@ -80,7 +80,7 @@ function refusalReportOf(addonId, err) {
|
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/kernel/addon-class-resolver.ts
|
|
83
|
-
function isRecord$
|
|
83
|
+
function isRecord$4(value) {
|
|
84
84
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
85
85
|
}
|
|
86
86
|
/**
|
|
@@ -104,14 +104,14 @@ function isRecord$5(value) {
|
|
|
104
104
|
function isAddonConstructor(fn) {
|
|
105
105
|
if (typeof fn !== "function") return false;
|
|
106
106
|
const proto = fn.prototype;
|
|
107
|
-
if (!isRecord$
|
|
107
|
+
if (!isRecord$4(proto)) return false;
|
|
108
108
|
return typeof proto["initialize"] === "function";
|
|
109
109
|
}
|
|
110
110
|
function resolveAddonClass(mod) {
|
|
111
111
|
let candidate = mod["default"];
|
|
112
|
-
if (isRecord$
|
|
112
|
+
if (isRecord$4(candidate) && "default" in candidate) candidate = candidate["default"];
|
|
113
113
|
if (isAddonConstructor(candidate)) return candidate;
|
|
114
|
-
if (isRecord$
|
|
114
|
+
if (isRecord$4(candidate)) {
|
|
115
115
|
const fn = Object.values(candidate).find(isAddonConstructor);
|
|
116
116
|
if (fn) return fn;
|
|
117
117
|
}
|
|
@@ -5514,7 +5514,7 @@ var RuntimeStateLoadError = class extends Error {
|
|
|
5514
5514
|
this.name = "RuntimeStateLoadError";
|
|
5515
5515
|
}
|
|
5516
5516
|
};
|
|
5517
|
-
function isRecord$
|
|
5517
|
+
function isRecord$3(value) {
|
|
5518
5518
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
5519
5519
|
}
|
|
5520
5520
|
function errorMessage(err) {
|
|
@@ -5545,7 +5545,7 @@ async function loadRuntimeStateOrRefuse(load, logger, target) {
|
|
|
5545
5545
|
} catch (err) {
|
|
5546
5546
|
return refuse(errorMessage(err), err);
|
|
5547
5547
|
}
|
|
5548
|
-
if (!isRecord$
|
|
5548
|
+
if (!isRecord$3(answer)) return refuse(`answered ${answer === null ? "null" : typeof answer}`);
|
|
5549
5549
|
return answer;
|
|
5550
5550
|
}
|
|
5551
5551
|
//#endregion
|
|
@@ -9668,11 +9668,11 @@ function prefixRange(prefix) {
|
|
|
9668
9668
|
}
|
|
9669
9669
|
//#endregion
|
|
9670
9670
|
//#region src/kernel/prefix-walk.ts
|
|
9671
|
-
function isRecord$
|
|
9671
|
+
function isRecord$2(value) {
|
|
9672
9672
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
9673
9673
|
}
|
|
9674
9674
|
function unwrapStoredValue(parsed) {
|
|
9675
|
-
if (!isRecord$
|
|
9675
|
+
if (!isRecord$2(parsed) || !("value" in parsed)) return parsed;
|
|
9676
9676
|
return parsed.value;
|
|
9677
9677
|
}
|
|
9678
9678
|
/**
|
|
@@ -10017,7 +10017,7 @@ function createSectionsStore(door) {
|
|
|
10017
10017
|
//#endregion
|
|
10018
10018
|
//#region src/kernel/moleculer/runner-addon-settings.ts
|
|
10019
10019
|
/** @param client the hub's `settingsStore` client; `undefined` makes every call THROW. */
|
|
10020
|
-
function createRunnerAddonSettings(client, addonId
|
|
10020
|
+
function createRunnerAddonSettings(client, addonId) {
|
|
10021
10021
|
if (client === void 0) {
|
|
10022
10022
|
const refuse = async () => {
|
|
10023
10023
|
throw new Error(`settings of "${addonId}": settings store not wired`);
|
|
@@ -10039,22 +10039,10 @@ function createRunnerAddonSettings(client, addonId, before = async () => {}) {
|
|
|
10039
10039
|
};
|
|
10040
10040
|
}
|
|
10041
10041
|
const door = {
|
|
10042
|
-
query:
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
get: async (input) => {
|
|
10047
|
-
await before();
|
|
10048
|
-
return client.get.query(input);
|
|
10049
|
-
},
|
|
10050
|
-
set: async (input) => {
|
|
10051
|
-
await before();
|
|
10052
|
-
return client.set.mutate(input);
|
|
10053
|
-
},
|
|
10054
|
-
transact: async (input) => {
|
|
10055
|
-
await before();
|
|
10056
|
-
return client.transact.mutate(input);
|
|
10057
|
-
}
|
|
10042
|
+
query: (input) => client.query.query(input),
|
|
10043
|
+
get: (input) => client.get.query(input),
|
|
10044
|
+
set: (input) => client.set.mutate(input),
|
|
10045
|
+
transact: (input) => client.transact.mutate(input)
|
|
10058
10046
|
};
|
|
10059
10047
|
const store = createAddonSettingsStore(door, addonId);
|
|
10060
10048
|
const sections = createSectionsStore(door);
|
|
@@ -10095,226 +10083,6 @@ function createRunnerAddonSettings(client, addonId, before = async () => {}) {
|
|
|
10095
10083
|
};
|
|
10096
10084
|
}
|
|
10097
10085
|
//#endregion
|
|
10098
|
-
//#region src/builtins/sqlite-storage/retired-settings-keys.ts
|
|
10099
|
-
/**
|
|
10100
|
-
* The dead keys, per row.
|
|
10101
|
-
*
|
|
10102
|
-
* ## Addressing these rows
|
|
10103
|
-
*
|
|
10104
|
-
* Every namespace below is a FORKED addon, whose `ctx.settings` comes from
|
|
10105
|
-
* `addon-context-factory` and writes `<addonId>:addon-settings` row `root`. The
|
|
10106
|
-
* scoped table is therefore the right target — unlike the hub builtin whose
|
|
10107
|
-
* mis-addressed spec is dissected at {@link RetiredRowSpec}. Confirmed per
|
|
10108
|
-
* namespace against `packages/<pkg>/package.json`'s manifest `id`.
|
|
10109
|
-
*
|
|
10110
|
-
* ## `keys` vs `perNodeKeys` is a data-loss decision, not a style choice
|
|
10111
|
-
*
|
|
10112
|
-
* `perNodeKeys` matches `<key>` AND `<key>@<nodeId>`. That is right for a key
|
|
10113
|
-
* whose per-node copies are all dead (the engine cascade, the decoder
|
|
10114
|
-
* `backend`). It is WRONG for `probedBestHwaccel` / `probedBestAudioBackend`,
|
|
10115
|
-
* where the bare key is unreachable residue but every `@<nodeId>` copy is the
|
|
10116
|
-
* node's live probe result — those go under `keys`, which is exact-match.
|
|
10117
|
-
*
|
|
10118
|
-
* `detection-pipeline` / `addon-settings` / `root` — every key in this row is
|
|
10119
|
-
* dead; the row itself is kept because the addon writes a live key into it
|
|
10120
|
-
* (`videoPipelineSteps`). `pipelineTemplates` is no longer read or written
|
|
10121
|
-
* (templates were removed, D759) and is deliberately NOT listed here: stored
|
|
10122
|
-
* template rows are left exactly as they are.
|
|
10123
|
-
*
|
|
10124
|
-
* - `pipelineSteps` / `pipelineEngine`: the persisted GLOBAL step + engine
|
|
10125
|
-
* seed. Removed with `getGlobalSteps` becoming pure — dispatch builds steps
|
|
10126
|
-
* from the orchestrator's `agentSettings` plus per-camera overrides, and
|
|
10127
|
-
* never consulted the seed. See `addon-pipeline/src/detection-pipeline/provider.ts`.
|
|
10128
|
-
* - `engineRuntime` / `engineBackend` / `engineDevice` / `probedBestEngine`:
|
|
10129
|
-
* the per-node engine CASCADE, removed with the operator-facing engine
|
|
10130
|
-
* election. Each node now runs a device-array of inference pools balanced
|
|
10131
|
-
* per session, and the node-default pool derives live from the node's own
|
|
10132
|
-
* hardware (`resolveAutoEngine`). See
|
|
10133
|
-
* `addon-pipeline/src/detection-pipeline/engine-store-keys.ts`.
|
|
10134
|
-
*/
|
|
10135
|
-
var RETIRED_SETTINGS_KEYS = [
|
|
10136
|
-
{
|
|
10137
|
-
namespace: "detection-pipeline",
|
|
10138
|
-
collection: "addon-settings",
|
|
10139
|
-
row: "root",
|
|
10140
|
-
keys: ["pipelineSteps", "pipelineEngine"],
|
|
10141
|
-
perNodeKeys: [
|
|
10142
|
-
"engineRuntime",
|
|
10143
|
-
"engineBackend",
|
|
10144
|
-
"engineDevice",
|
|
10145
|
-
"probedBestEngine"
|
|
10146
|
-
],
|
|
10147
|
-
reason: "global step/engine seed and the per-node engine cascade — both removed; the live per-camera dispatch path never read either"
|
|
10148
|
-
},
|
|
10149
|
-
{
|
|
10150
|
-
namespace: "pipeline-orchestrator",
|
|
10151
|
-
collection: "addon-settings",
|
|
10152
|
-
row: "root",
|
|
10153
|
-
keys: [
|
|
10154
|
-
"enabledNodes",
|
|
10155
|
-
"enabledDecoderNodes",
|
|
10156
|
-
"enabledAudioNodes",
|
|
10157
|
-
"remoteSourcingNodes",
|
|
10158
|
-
"nativeLeaseTtlMs"
|
|
10159
|
-
],
|
|
10160
|
-
perNodeKeys: ["backend"],
|
|
10161
|
-
reason: "the pre-singleton \"enabled nodes\" role model (node capability now lives per node in agent-settings and is derived by NodeTopology.refresh, never read from this row), `nativeLeaseTtlMs` superseded by `nativeLeaseActivityMs`, and the decoder `backend` selector whose resolver returns DEFAULT_DECODER_BACKEND unconditionally (decoder-backend.ts)"
|
|
10162
|
-
},
|
|
10163
|
-
{
|
|
10164
|
-
namespace: "stream-broker",
|
|
10165
|
-
collection: "addon-settings",
|
|
10166
|
-
row: "root",
|
|
10167
|
-
keys: [
|
|
10168
|
-
"maxDecodeFps",
|
|
10169
|
-
"initialReconnectDelayMs",
|
|
10170
|
-
"maxReconnectDelayMs"
|
|
10171
|
-
],
|
|
10172
|
-
perNodeKeys: [],
|
|
10173
|
-
reason: "three form knobs deleted 2026-08-28 (D272): nothing capped decode fps, and the reconnect ladder has always run on the INITIAL/MAX_RECONNECT_DELAY_MS constants"
|
|
10174
|
-
},
|
|
10175
|
-
{
|
|
10176
|
-
namespace: "embedding-encoder",
|
|
10177
|
-
collection: "addon-settings",
|
|
10178
|
-
row: "root",
|
|
10179
|
-
keys: ["runtime", "backend"],
|
|
10180
|
-
perNodeKeys: [],
|
|
10181
|
-
reason: "two selects deleted 2026-08-28 (D272); their only reference was a withTags log field, and the CUDA/CoreML options named acceleration that has never existed — embedding inference is always ONNX in the embedded Python"
|
|
10182
|
-
},
|
|
10183
|
-
{
|
|
10184
|
-
namespace: "audio-analyzer",
|
|
10185
|
-
collection: "addon-settings",
|
|
10186
|
-
row: "root",
|
|
10187
|
-
keys: ["selectedAudioModel", "probedBestAudioBackend"],
|
|
10188
|
-
perNodeKeys: [],
|
|
10189
|
-
reason: "`selectedAudioModel` deleted 2026-08-28 (D272) — createAudioPipeline takes a backend and no model id, so it never reached inference; the BARE `probedBestAudioBackend` is pre-perNode residue that projectStore already drops (no bare fallback), so no node can ever read it"
|
|
10190
|
-
},
|
|
10191
|
-
{
|
|
10192
|
-
namespace: "decoder-nodeav",
|
|
10193
|
-
collection: "addon-settings",
|
|
10194
|
-
row: "root",
|
|
10195
|
-
keys: ["probedBestHwaccel"],
|
|
10196
|
-
perNodeKeys: [],
|
|
10197
|
-
reason: "bare pre-perNode residue — the live probe result is `probedBestHwaccel@<nodeId>` and `projectStore` deliberately drops the bare key, so nothing can read it"
|
|
10198
|
-
},
|
|
10199
|
-
{
|
|
10200
|
-
namespace: "pipeline-analytics",
|
|
10201
|
-
collection: "addon-settings",
|
|
10202
|
-
row: "root",
|
|
10203
|
-
keys: ["mediaAttachPolicy"],
|
|
10204
|
-
perNodeKeys: [],
|
|
10205
|
-
reason: "deleted 2026-08-28 (D272) — absent from MediaSettingsSchema, so the value was never even resolved, let alone read"
|
|
10206
|
-
}
|
|
10207
|
-
];
|
|
10208
|
-
//#endregion
|
|
10209
|
-
//#region src/kernel/legacy-blob-guard.ts
|
|
10210
|
-
/** Root keys retired long before D870: they never count as "settings still to migrate". */
|
|
10211
|
-
var OWN_RETIRED_ROOT_KEYS = new Set([
|
|
10212
|
-
"recordingConfigs",
|
|
10213
|
-
"recordingExports",
|
|
10214
|
-
"recordingOpsLog",
|
|
10215
|
-
"probeSnapshots",
|
|
10216
|
-
"rtspTokens",
|
|
10217
|
-
"profileMap"
|
|
10218
|
-
]);
|
|
10219
|
-
/** Is `key` of `addonId` a root key that was retired (and must not be migrated)? */
|
|
10220
|
-
function isRetiredRootKey(addonId, key) {
|
|
10221
|
-
if (OWN_RETIRED_ROOT_KEYS.has(key)) return true;
|
|
10222
|
-
return RETIRED_SETTINGS_KEYS.some((spec) => spec.namespace === addonId && (spec.keys.includes(key) || spec.perNodeKeys.some((k) => key === k || key.startsWith(`${k}@`))));
|
|
10223
|
-
}
|
|
10224
|
-
/** Stable `code` of the D870 refusal. */
|
|
10225
|
-
var UNMIGRATED_SETTINGS_CODE = "unmigrated-settings";
|
|
10226
|
-
/** The remedy the refusal (and the update pre-flight) names. */
|
|
10227
|
-
var UNMIGRATED_SETTINGS_REMEDY = "Run scripts/hub/migrate-device-store.ts --copy --apply (D870), then restart the addon.";
|
|
10228
|
-
var UnmigratedSettingsError = class extends AddonRefusedError {
|
|
10229
|
-
constructor(addonId, what) {
|
|
10230
|
-
super(UNMIGRATED_SETTINGS_CODE, `addon "${addonId}" refuses to start: ${what} - the settings it had are still in the per-addon tables and the standard store holds none. Run scripts/hub/migrate-device-store.ts --copy --apply (D870) before starting it.`, UNMIGRATED_SETTINGS_REMEDY);
|
|
10231
|
-
this.name = "UnmigratedSettingsError";
|
|
10232
|
-
}
|
|
10233
|
-
};
|
|
10234
|
-
async function countOf(client, input) {
|
|
10235
|
-
const n = await client.count.query(input);
|
|
10236
|
-
if (typeof n !== "number") throw new Error("settings store answered a non-number to a count");
|
|
10237
|
-
return n;
|
|
10238
|
-
}
|
|
10239
|
-
var LEGACY_PAGE = 500;
|
|
10240
|
-
var LEGACY_PAGE_BUDGET = 200;
|
|
10241
|
-
var ID_TAIL = "";
|
|
10242
|
-
function isRecord$2(value) {
|
|
10243
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10244
|
-
}
|
|
10245
|
-
/**
|
|
10246
|
-
* Does the addon's per-device blob table hold a row the copy would actually
|
|
10247
|
-
* migrate - a positive numeric id with a non-empty record? An addon whose rows
|
|
10248
|
-
* the copy skips anyway must not be refused for them.
|
|
10249
|
-
*/
|
|
10250
|
-
async function hasMigratableDeviceRow(client, addonId) {
|
|
10251
|
-
let cursor = "";
|
|
10252
|
-
for (let page = 0; page < LEGACY_PAGE_BUDGET; page++) {
|
|
10253
|
-
const rows = await client.query.query({
|
|
10254
|
-
namespace: addonId,
|
|
10255
|
-
collection: "addon-devices",
|
|
10256
|
-
filter: {
|
|
10257
|
-
whereBetween: { id: [cursor, ID_TAIL] },
|
|
10258
|
-
orderBy: {
|
|
10259
|
-
field: "id",
|
|
10260
|
-
direction: "asc"
|
|
10261
|
-
},
|
|
10262
|
-
limit: LEGACY_PAGE
|
|
10263
|
-
}
|
|
10264
|
-
});
|
|
10265
|
-
if (!Array.isArray(rows)) throw new Error("settings store answered a non-list to a query");
|
|
10266
|
-
let lastId = cursor;
|
|
10267
|
-
for (const row of rows) {
|
|
10268
|
-
if (!isRecord$2(row) || typeof row["id"] !== "string") continue;
|
|
10269
|
-
lastId = row["id"];
|
|
10270
|
-
const id = Number(row["id"]);
|
|
10271
|
-
const data = row["data"];
|
|
10272
|
-
if (Number.isInteger(id) && id > 0 && isRecord$2(data) && Object.keys(data).length > 0) return true;
|
|
10273
|
-
}
|
|
10274
|
-
if (rows.length < LEGACY_PAGE || lastId === cursor) return false;
|
|
10275
|
-
cursor = lastId;
|
|
10276
|
-
}
|
|
10277
|
-
throw new Error(`addon "${addonId}": more legacy blob pages than the guard will read`);
|
|
10278
|
-
}
|
|
10279
|
-
/**
|
|
10280
|
-
* THROWS when the addon has blob settings and the standard store has none of
|
|
10281
|
-
* its own. A store that cannot be asked also throws: it is not "no blobs".
|
|
10282
|
-
*/
|
|
10283
|
-
async function assertLegacyBlobsMigrated(client, addonId, logger) {
|
|
10284
|
-
const legacyDevices = await hasMigratableDeviceRow(client, addonId);
|
|
10285
|
-
const root = await client.get.query({
|
|
10286
|
-
namespace: addonId,
|
|
10287
|
-
collection: "addon-settings",
|
|
10288
|
-
key: "root"
|
|
10289
|
-
});
|
|
10290
|
-
const legacySettings = isRecord$2(root) && Object.keys(root).some((key) => !isRetiredRootKey(addonId, key));
|
|
10291
|
-
if (!legacyDevices && !legacySettings) return;
|
|
10292
|
-
const rangeOf = (prefix) => {
|
|
10293
|
-
const range = prefixRange(prefix);
|
|
10294
|
-
if (range === null) throw new Error(`no id range for addon "${addonId}"`);
|
|
10295
|
-
return { whereBetween: { id: [range.lo, range.hi] } };
|
|
10296
|
-
};
|
|
10297
|
-
const newDevices = await countOf(client, {
|
|
10298
|
-
collection: "addon-device-settings",
|
|
10299
|
-
filter: rangeOf(`${addonId}:`)
|
|
10300
|
-
});
|
|
10301
|
-
const newSettings = await countOf(client, {
|
|
10302
|
-
collection: "addon-settings",
|
|
10303
|
-
filter: rangeOf(`${addonId}.`)
|
|
10304
|
-
});
|
|
10305
|
-
const problems = [];
|
|
10306
|
-
if (legacyDevices && newDevices === 0) problems.push("per-device blobs");
|
|
10307
|
-
if (legacySettings && newSettings === 0) problems.push("an addon settings blob");
|
|
10308
|
-
if (problems.length === 0) return;
|
|
10309
|
-
const error = new UnmigratedSettingsError(addonId, problems.join(" and "));
|
|
10310
|
-
logger.error(error.message, { meta: {
|
|
10311
|
-
addonId,
|
|
10312
|
-
newDevices,
|
|
10313
|
-
newSettings
|
|
10314
|
-
} });
|
|
10315
|
-
throw error;
|
|
10316
|
-
}
|
|
10317
|
-
//#endregion
|
|
10318
10086
|
//#region src/kernel/moleculer/runner-device-settings.ts
|
|
10319
10087
|
/**
|
|
10320
10088
|
* The forked runner's `ctx.settings` device methods (D870).
|
|
@@ -10327,20 +10095,11 @@ async function assertLegacyBlobsMigrated(client, addonId, logger) {
|
|
|
10327
10095
|
* blob per device; a hub-side write to the rows was invisible to it.
|
|
10328
10096
|
*/
|
|
10329
10097
|
/** The door slice the per-device store needs, over a tRPC client. */
|
|
10330
|
-
function doorOverClient(client
|
|
10098
|
+
function doorOverClient(client) {
|
|
10331
10099
|
return {
|
|
10332
|
-
query:
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
},
|
|
10336
|
-
transact: async (input) => {
|
|
10337
|
-
await before();
|
|
10338
|
-
return client.transact.mutate(input);
|
|
10339
|
-
},
|
|
10340
|
-
deleteWhere: async (input) => {
|
|
10341
|
-
await before();
|
|
10342
|
-
return client.deleteWhere.mutate(input);
|
|
10343
|
-
}
|
|
10100
|
+
query: (input) => client.query.query(input),
|
|
10101
|
+
transact: (input) => client.transact.mutate(input),
|
|
10102
|
+
deleteWhere: (input) => client.deleteWhere.mutate(input)
|
|
10344
10103
|
};
|
|
10345
10104
|
}
|
|
10346
10105
|
/**
|
|
@@ -10348,7 +10107,7 @@ function doorOverClient(client, before = async () => {}) {
|
|
|
10348
10107
|
* runner has none — every call then THROWS: a store that could not be asked
|
|
10349
10108
|
* is not an empty one.
|
|
10350
10109
|
*/
|
|
10351
|
-
function createRunnerDeviceSettings(client, addonId
|
|
10110
|
+
function createRunnerDeviceSettings(client, addonId) {
|
|
10352
10111
|
if (client === void 0) {
|
|
10353
10112
|
const refuse = () => {
|
|
10354
10113
|
throw new Error(`device settings of "${addonId}": settings store not wired`);
|
|
@@ -10361,7 +10120,7 @@ function createRunnerDeviceSettings(client, addonId, before = async () => {}) {
|
|
|
10361
10120
|
clearDeviceStore: async () => refuse()
|
|
10362
10121
|
};
|
|
10363
10122
|
}
|
|
10364
|
-
const store = createDeviceSettingsStore(doorOverClient(client
|
|
10123
|
+
const store = createDeviceSettingsStore(doorOverClient(client), addonId);
|
|
10365
10124
|
return {
|
|
10366
10125
|
readDeviceStore: (deviceId) => readDeviceOrThrow(store, deviceId),
|
|
10367
10126
|
readDeviceStoreBatch: (ids) => store.readBatch(ids),
|
|
@@ -10638,23 +10397,9 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
10638
10397
|
}
|
|
10639
10398
|
};
|
|
10640
10399
|
const deviceSettingsClient = Reflect.get(api, "settingsStore");
|
|
10641
|
-
let blobsChecked = null;
|
|
10642
|
-
const bootGuard = () => {
|
|
10643
|
-
const client = deviceSettingsClient;
|
|
10644
|
-
if (client === void 0) return Promise.resolve();
|
|
10645
|
-
blobsChecked ??= assertLegacyBlobsMigrated({
|
|
10646
|
-
get: { query: (input) => client.get.query(input) },
|
|
10647
|
-
query: { query: (input) => client.query.query(input) },
|
|
10648
|
-
count: { query: (input) => client.count.query(input) }
|
|
10649
|
-
}, addonId, scopedLogger).catch((err) => {
|
|
10650
|
-
blobsChecked = null;
|
|
10651
|
-
throw err;
|
|
10652
|
-
});
|
|
10653
|
-
return blobsChecked;
|
|
10654
|
-
};
|
|
10655
10400
|
const settingsView = {
|
|
10656
|
-
...createRunnerAddonSettings(deviceSettingsClient, addonId
|
|
10657
|
-
...createRunnerDeviceSettings(deviceSettingsClient, addonId
|
|
10401
|
+
...createRunnerAddonSettings(deviceSettingsClient, addonId),
|
|
10402
|
+
...createRunnerDeviceSettings(deviceSettingsClient, addonId),
|
|
10658
10403
|
async readDeviceRuntimeState(deviceId) {
|
|
10659
10404
|
return readBlob("device-runtime-state", String(deviceId));
|
|
10660
10405
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-Ct-4tTeX.js");
|
|
3
3
|
const require_x509_es = require("./x509.es-C4cOo48M.js");
|
|
4
4
|
let zod = require("zod");
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ui as defineRecordKinds } from "./dist-8tWIDoWp.mjs";
|
|
2
2
|
import { S as backdatedNotBefore, _ as NameConstraints, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, g as GeneralSubtrees, h as GeneralSubtree, i as Extension, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension, v as GeneralName, x as AsnConvert } from "./x509.es-DK__ETIe.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { X509Certificate, createHash, createPrivateKey, randomBytes, 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-Ct-4tTeX.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 { $r as errMsg, Ca as EventCategory, _t as addonPagesCapability, ei as BaseAddon } from "../../dist-8tWIDoWp.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-Ct-4tTeX.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 { $r as errMsg, Ca as EventCategory, ei as BaseAddon, yt as addonWidgetsCapability } from "../../dist-8tWIDoWp.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-Ct-4tTeX.js");
|
|
7
7
|
const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
|
|
8
8
|
//#region src/builtins/alerts/alert-episode-policy.ts
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { $r as errMsg, Bi as createEvent, Ca as EventCategory, St as alertsCapability, Ui as defineRecordKinds, bn as isAlertEpisodeSeverity, bt as alertEpisodeId, ei as BaseAddon, i as AlertSchema, xt as alertEpisodePayload, yn as isAlertEpisodeOpen } from "../../dist-8tWIDoWp.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
//#region src/builtins/alerts/alert-episode-policy.ts
|
|
4
4
|
/**
|
|
@@ -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-Ct-4tTeX.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 { $r as errMsg, Ca as EventCategory, Et as bareAddonId, L as FIRST_LEVEL_MACRO_CLASSES, Xi as isEvent, ei as BaseAddon, tr as ptzAutotrackCapability } from "../../dist-8tWIDoWp.mjs";
|
|
2
2
|
//#region src/builtins/autotrack/autotrack-config.ts
|
|
3
3
|
var DEFAULT_AUTOTRACK_LOOP_CONFIG = {
|
|
4
4
|
deadZoneFraction: .5,
|
|
@@ -64,7 +64,7 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
|
|
|
64
64
|
* lazily seeding a default for any `locationId` we haven't seen
|
|
65
65
|
* before. Idempotent — `ensureDefault` no-ops on already-persisted
|
|
66
66
|
* rows. Falls back to the in-memory default policy when the policy
|
|
67
|
-
* service isn't wired (no
|
|
67
|
+
* service isn't wired (no `ctx.records`).
|
|
68
68
|
*/
|
|
69
69
|
private loadPoliciesIndexed;
|
|
70
70
|
private fallbackPolicy;
|
|
@@ -281,8 +281,6 @@ export declare class BackupOrchestratorAddon extends BaseAddon<Record<string, ne
|
|
|
281
281
|
private listSchedules;
|
|
282
282
|
private upsertSchedule;
|
|
283
283
|
private deleteSchedule;
|
|
284
|
-
private resolveScheduleService;
|
|
285
|
-
private resolvePolicyService;
|
|
286
284
|
/**
|
|
287
285
|
* Narrow `ctx.api.storage` to the subset the manifest helpers need.
|
|
288
286
|
* Lets the helpers be unit-tested with a Map-backed fake without
|