@camstack/system 1.2.68 → 1.2.70
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 +6 -6
- package/dist/addon-runner.mjs +3 -3
- package/dist/addon-utils.js +11 -11
- package/dist/addon-utils.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +3 -3
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +2 -2
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +3 -3
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +2 -2
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +8 -8
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +6 -6
- 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 +3 -3
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/adoption-job-engine.d.ts +89 -0
- package/dist/builtins/device-manager/device-manager.addon.d.ts +8 -0
- package/dist/builtins/device-manager/device-manager.addon.js +330 -3
- package/dist/builtins/device-manager/device-manager.addon.mjs +330 -3
- package/dist/builtins/device-manager/device-provider-context.d.ts +3 -0
- package/dist/builtins/device-manager/device-queries.d.ts +3 -0
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- 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/index.d.ts +0 -1
- package/dist/builtins/local-auth/index.js +0 -1
- package/dist/builtins/local-auth/index.mjs +2 -2
- package/dist/builtins/local-auth/local-auth.addon.js +129 -173
- package/dist/builtins/local-auth/local-auth.addon.mjs +130 -173
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- 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 +5 -5
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +4 -4
- package/dist/builtins/platform-probe/index.js +4 -4
- package/dist/builtins/platform-probe/index.mjs +3 -3
- 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 +2 -2
- package/dist/builtins/snapshot/index.mjs +2 -2
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +4 -4
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +3 -3
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +3 -3
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +2 -2
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-D2J8RJ7m.mjs → dist-CnQXXnK1.mjs} +296 -2
- package/dist/{dist-Dhpte164.js → dist-DCLoJf2T.js} +295 -7
- package/dist/{model-download-service-CTBHzORJ.mjs → file-data-plane-CuE_hBli.mjs} +848 -848
- package/dist/index.d.ts +73 -81
- package/dist/index.js +1379 -1346
- package/dist/index.mjs +1362 -1328
- package/dist/kernel/capability-registry.d.ts +26 -0
- package/dist/kernel/config-schema.d.ts +1 -1
- package/dist/{manifest-python-deps-Dz1ryHIN.mjs → manifest-python-deps-DKrHcUZj.mjs} +47 -47
- package/package.json +1 -4
- package/dist/builtins/local-auth/homeassistant-integration.d.ts +0 -7
- package/dist/{model-download-service-Caj1kaSi.js → file-data-plane-DUHPHa-Y.js} +847 -847
- package/dist/{manifest-python-deps-BE6l8Y4W.js → manifest-python-deps-DafB-1hp.js} +47 -47
- package/dist/{resource-monitor-BkP504Vq.mjs → resource-monitor-BWmQ5i-o.mjs} +1 -1
- package/dist/{resource-monitor-DNNomR-i.js → resource-monitor-CdnzxBLP.js} +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
let _camstack_types_node = require("@camstack/types/node");
|
|
3
2
|
let node_crypto = require("node:crypto");
|
|
4
3
|
node_crypto = require_chunk.__toESM(node_crypto);
|
|
5
|
-
let
|
|
6
|
-
let
|
|
7
|
-
node_fs = require_chunk.__toESM(node_fs);
|
|
4
|
+
let _camstack_types_node = require("@camstack/types/node");
|
|
5
|
+
let node_fs_promises = require("node:fs/promises");
|
|
8
6
|
let node_path = require("node:path");
|
|
9
7
|
node_path = require_chunk.__toESM(node_path);
|
|
10
|
-
let node_util = require("node:util");
|
|
11
|
-
let _camstack_types_addon = require("@camstack/types/addon");
|
|
12
8
|
let node_child_process = require("node:child_process");
|
|
9
|
+
let node_util = require("node:util");
|
|
13
10
|
let node_os = require("node:os");
|
|
14
11
|
node_os = require_chunk.__toESM(node_os);
|
|
15
|
-
let
|
|
12
|
+
let node_fs = require("node:fs");
|
|
13
|
+
node_fs = require_chunk.__toESM(node_fs);
|
|
14
|
+
let node_http = require("node:http");
|
|
15
|
+
let _camstack_types_addon = require("@camstack/types/addon");
|
|
16
16
|
let _trpc_client = require("@trpc/client");
|
|
17
17
|
let node_net = require("node:net");
|
|
18
18
|
//#region src/kernel/moleculer/addon-data-plane-facility.ts
|
|
@@ -131,46 +131,6 @@ function createAddonDataPlaneFacility(args) {
|
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
133
|
//#endregion
|
|
134
|
-
//#region src/kernel/addon-class-resolver.ts
|
|
135
|
-
function isRecord(value) {
|
|
136
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Resolve the addon class from a dynamically imported module.
|
|
140
|
-
*
|
|
141
|
-
* Two compilation patterns to handle:
|
|
142
|
-
* 1. ESM with explicit `export default class …` — `mod.default` is the class.
|
|
143
|
-
* 2. CJS via tsup that emits only named exports (no `module.exports = …`)
|
|
144
|
-
* — `mod.default` is undefined; we must pick the right named export.
|
|
145
|
-
*
|
|
146
|
-
* The CJS path is the trap: an addon bundle can also re-export device
|
|
147
|
-
* classes (e.g. `ReolinkCamera` extends `BaseDevice`) and helper
|
|
148
|
-
* functions. Picking `Object.keys(mod)[0]` is bundler-order-dependent —
|
|
149
|
-
* the first named export today is `ReolinkCamera`, whose `new` requires
|
|
150
|
-
* a `DeviceContext` and crashes on `new MyClass()`.
|
|
151
|
-
*
|
|
152
|
-
* The contract is: the addon class extends `BaseAddon`, which has an
|
|
153
|
-
* `initialize` method on its prototype. Device classes (`BaseDevice`)
|
|
154
|
-
* do not. We probe for that method to disambiguate.
|
|
155
|
-
*/
|
|
156
|
-
function isAddonConstructor(fn) {
|
|
157
|
-
if (typeof fn !== "function") return false;
|
|
158
|
-
const proto = fn.prototype;
|
|
159
|
-
if (!isRecord(proto)) return false;
|
|
160
|
-
return typeof proto["initialize"] === "function";
|
|
161
|
-
}
|
|
162
|
-
function resolveAddonClass(mod) {
|
|
163
|
-
let candidate = mod["default"];
|
|
164
|
-
if (isRecord(candidate) && "default" in candidate) candidate = candidate["default"];
|
|
165
|
-
if (isAddonConstructor(candidate)) return candidate;
|
|
166
|
-
if (isRecord(candidate)) {
|
|
167
|
-
const fn = Object.values(candidate).find(isAddonConstructor);
|
|
168
|
-
if (fn) return fn;
|
|
169
|
-
}
|
|
170
|
-
const namedAddon = Object.values(mod).find(isAddonConstructor);
|
|
171
|
-
if (namedAddon) return namedAddon;
|
|
172
|
-
}
|
|
173
|
-
//#endregion
|
|
174
134
|
//#region src/kernel/deps/npm-command.ts
|
|
175
135
|
/**
|
|
176
136
|
* npm invocation resolver — makes "is npm available?" a solved problem for
|
|
@@ -300,6 +260,46 @@ async function resolveUncached(options) {
|
|
|
300
260
|
}
|
|
301
261
|
}
|
|
302
262
|
//#endregion
|
|
263
|
+
//#region src/kernel/addon-class-resolver.ts
|
|
264
|
+
function isRecord(value) {
|
|
265
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Resolve the addon class from a dynamically imported module.
|
|
269
|
+
*
|
|
270
|
+
* Two compilation patterns to handle:
|
|
271
|
+
* 1. ESM with explicit `export default class …` — `mod.default` is the class.
|
|
272
|
+
* 2. CJS via tsup that emits only named exports (no `module.exports = …`)
|
|
273
|
+
* — `mod.default` is undefined; we must pick the right named export.
|
|
274
|
+
*
|
|
275
|
+
* The CJS path is the trap: an addon bundle can also re-export device
|
|
276
|
+
* classes (e.g. `ReolinkCamera` extends `BaseDevice`) and helper
|
|
277
|
+
* functions. Picking `Object.keys(mod)[0]` is bundler-order-dependent —
|
|
278
|
+
* the first named export today is `ReolinkCamera`, whose `new` requires
|
|
279
|
+
* a `DeviceContext` and crashes on `new MyClass()`.
|
|
280
|
+
*
|
|
281
|
+
* The contract is: the addon class extends `BaseAddon`, which has an
|
|
282
|
+
* `initialize` method on its prototype. Device classes (`BaseDevice`)
|
|
283
|
+
* do not. We probe for that method to disambiguate.
|
|
284
|
+
*/
|
|
285
|
+
function isAddonConstructor(fn) {
|
|
286
|
+
if (typeof fn !== "function") return false;
|
|
287
|
+
const proto = fn.prototype;
|
|
288
|
+
if (!isRecord(proto)) return false;
|
|
289
|
+
return typeof proto["initialize"] === "function";
|
|
290
|
+
}
|
|
291
|
+
function resolveAddonClass(mod) {
|
|
292
|
+
let candidate = mod["default"];
|
|
293
|
+
if (isRecord(candidate) && "default" in candidate) candidate = candidate["default"];
|
|
294
|
+
if (isAddonConstructor(candidate)) return candidate;
|
|
295
|
+
if (isRecord(candidate)) {
|
|
296
|
+
const fn = Object.values(candidate).find(isAddonConstructor);
|
|
297
|
+
if (fn) return fn;
|
|
298
|
+
}
|
|
299
|
+
const namedAddon = Object.values(mod).find(isAddonConstructor);
|
|
300
|
+
if (namedAddon) return namedAddon;
|
|
301
|
+
}
|
|
302
|
+
//#endregion
|
|
303
303
|
//#region src/kernel/deps/manifest-native-deps.ts
|
|
304
304
|
var execFileAsync = (0, node_util.promisify)(node_child_process.execFile);
|
|
305
305
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as __exportAll } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import * as fs from "node:fs";
|
|
3
2
|
import { execFile } from "node:child_process";
|
|
3
|
+
import * as fs from "node:fs";
|
|
4
4
|
//#region src/process/resource-monitor.ts
|
|
5
5
|
var resource_monitor_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
getPidStats: () => getPidStats,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
+
let node_child_process = require("node:child_process");
|
|
2
3
|
let node_fs = require("node:fs");
|
|
3
4
|
node_fs = require_chunk.__toESM(node_fs);
|
|
4
|
-
let node_child_process = require("node:child_process");
|
|
5
5
|
//#region src/process/resource-monitor.ts
|
|
6
6
|
var resource_monitor_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
7
7
|
getPidStats: () => getPidStats,
|