@camstack/server 1.2.821 → 1.2.823
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 +12 -0
- package/dist/api/trpc/generated-cap-routers.js +20 -0
- package/package.json +9 -10
- package/system/dist/addon-runner.js +18 -13
- package/system/dist/addon-runner.mjs +19 -14
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-N6Or6UAu.mjs → agent-https-CDl7mB_F.mjs} +1 -1
- package/system/dist/{agent-https-Bp5yzi8b.js → agent-https-Df53Fvk1.js} +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 +4 -4
- 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 +5 -5
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +3 -3
- 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 +5 -5
- 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/composed-device-set.d.ts +5 -1
- package/system/dist/builtins/composer/composed-device.d.ts +4 -0
- package/system/dist/builtins/composer/composed-name.d.ts +30 -0
- package/system/dist/builtins/composer/composer.addon.js +94 -6
- package/system/dist/builtins/composer/composer.addon.mjs +94 -6
- package/system/dist/builtins/composer/composer.d.ts +13 -0
- 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/actions-service.d.ts +16 -0
- package/system/dist/builtins/core-blocks/composition-api.d.ts +6 -0
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +214 -8
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +214 -8
- package/system/dist/builtins/core-blocks/device-template-door.d.ts +25 -0
- package/system/dist/builtins/core-blocks/fan-presets-service.d.ts +5 -0
- package/system/dist/builtins/core-blocks/rename-composition-block.d.ts +16 -0
- package/system/dist/builtins/core-blocks/scheduler/scheduler-engine.d.ts +5 -0
- package/system/dist/builtins/core-blocks/step-condition-door.d.ts +19 -0
- package/system/dist/builtins/core-blocks/sync-composed-device-name.d.ts +19 -0
- 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-manager.addon.d.ts +7 -0
- package/system/dist/builtins/device-manager/device-manager.addon.js +691 -4
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +689 -3
- package/system/dist/builtins/device-manager/device-template/template-host.d.ts +60 -0
- package/system/dist/builtins/device-manager/device-template-actions.d.ts +33 -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 +5 -5
- 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 +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +9 -9
- package/system/dist/builtins/system-config/system-config.addon.mjs +287 -287
- 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-4lB0sLCf.js → capture-engine-C0Z5rwCO.js} +1 -1
- package/system/dist/{capture-engine-Cz7z5d36.mjs → capture-engine-D_GQBgrZ.mjs} +1 -1
- package/system/dist/{composition-sources-C9gEj25e.js → composition-sources-DIZx3mW3.js} +1 -1
- package/system/dist/{composition-sources-C0e2g_VP.mjs → composition-sources-mx-2yCDv.mjs} +1 -1
- package/system/dist/{constants-CZMy7dor.mjs → constants-BQlx9HDp.mjs} +1 -1
- package/system/dist/{constants-Cq3B9yzj.js → constants-CAOcKiWT.js} +1 -1
- package/system/dist/{coral-accelerators-DBlgWB8k.mjs → coral-accelerators-BW3OcrLD.mjs} +6 -6
- package/system/dist/{custom-action-registry-B9zFBNVa.mjs → custom-action-registry-N7flBDwT.mjs} +37 -37
- package/system/dist/{device-ca-BenyQXJV.js → device-ca-93LsCF_Q.js} +1 -1
- package/system/dist/{device-ca-BmQ6N-A-.mjs → device-ca-CK6GTnNh.mjs} +1 -1
- package/system/dist/device-template-worker.js +5 -7032
- package/system/dist/device-template-worker.mjs +1 -7026
- package/system/dist/{dist-DuKMbGBM.mjs → dist-BQiyo22b.mjs} +667 -50
- package/system/dist/{dist-M5VX8Hqf.js → dist-izXDzt4g.js} +714 -49
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-k3pOKWyZ.js → hub-mdns-ciao-Dt_tgvol.js} +2 -2
- package/system/dist/{hub-mdns-ciao-CXBfBwAy.mjs → hub-mdns-ciao-srpOrqIP.mjs} +2 -2
- package/system/dist/index.js +26 -21
- package/system/dist/index.mjs +238 -233
- package/system/dist/{legacy-integration-rows-door-mIpR3e6X.js → legacy-integration-rows-door-BH43eDu6.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-C13OeuW9.mjs → legacy-integration-rows-door-wu2GWY6U.mjs} +1 -1
- package/system/dist/rename-composition-block-6oLQVzft.js +112 -0
- package/system/dist/rename-composition-block-CH6ZoSJA.mjs +101 -0
- package/system/dist/{restore-archive-DDeQFJN5.mjs → restore-archive-C4rR2SYV.mjs} +154 -154
- package/system/dist/{restore-archive-CCgt7SZ8.js → restore-archive-DpZ2PbLN.js} +7 -7
- package/system/dist/template-protocol-BmMM5VBf.mjs +7033 -0
- package/system/dist/template-protocol-CTP4eAo_.js +7059 -0
- package/system/dist/{wal-maintenance-Cj7xe4wN.mjs → wal-maintenance-CNfp0HHX.mjs} +0 -0
- package/system/dist/{wal-maintenance-D5M6hl53.js → wal-maintenance-DAA2qJja.js} +0 -0
- package/system/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Qs as collectSecretMarkerRefs } from "./dist-BQiyo22b.mjs";
|
|
2
2
|
//#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
|
|
3
3
|
/**
|
|
4
4
|
* Migration-only door for the leftover integration rows (planning#416).
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
const require_dist = require("./dist-izXDzt4g.js");
|
|
2
|
+
//#region src/builtins/core-blocks/rename-composition-block.ts
|
|
3
|
+
/**
|
|
4
|
+
* An operator rename of a composed device writes the composition block's
|
|
5
|
+
* name, so the next composer apply does not put the old name back (D659).
|
|
6
|
+
* Name-only: the composition body is not touched, and a customization (which
|
|
7
|
+
* has no name of its own) is never a composed device.
|
|
8
|
+
*/
|
|
9
|
+
/** `CoreBlockSchema` / `ComposerBlockSchema` name max. A longer device name cannot be stored on the block. */
|
|
10
|
+
var BLOCK_NAME_MAX = 120;
|
|
11
|
+
/** The block id behind a composed device, or null when the row is not one. */
|
|
12
|
+
function composedBlockIdOf(addonId, stableId) {
|
|
13
|
+
if (addonId !== "composer") return null;
|
|
14
|
+
if (!stableId.startsWith("composed-")) return null;
|
|
15
|
+
const blockId = stableId.slice(require_dist.COMPOSED_DEVICE_STABLE_ID_PREFIX.length);
|
|
16
|
+
return blockId.length === 0 ? null : blockId;
|
|
17
|
+
}
|
|
18
|
+
function lookupBlockName(read, blockId) {
|
|
19
|
+
if (read.state === "not-loaded") return {
|
|
20
|
+
kind: "skip",
|
|
21
|
+
reason: "core_blocks has not loaded"
|
|
22
|
+
};
|
|
23
|
+
if (read.view === null) return {
|
|
24
|
+
kind: "skip",
|
|
25
|
+
reason: `no composition "${blockId}"`
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
kind: "ready",
|
|
29
|
+
block: {
|
|
30
|
+
name: read.view.block.name,
|
|
31
|
+
updatedAt: read.view.block.updatedAt
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async function writeBlockName(api, blockId, name) {
|
|
36
|
+
const found = lookupBlockName(await api.coreBlocks.getComposition.query({ blockId }), blockId);
|
|
37
|
+
if (found.kind === "skip" || found.block.name === name) return found;
|
|
38
|
+
await api.coreBlocks.updateComposition.mutate({
|
|
39
|
+
blockId,
|
|
40
|
+
expectedUpdatedAt: found.block.updatedAt,
|
|
41
|
+
block: { name }
|
|
42
|
+
});
|
|
43
|
+
return found;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Make the stored block name `name`. A conflict with a save that landed
|
|
47
|
+
* between the read and the write is retried once. A failure is logged and
|
|
48
|
+
* swallowed: the device rename has already landed, and the composer's next
|
|
49
|
+
* apply writes the block again.
|
|
50
|
+
*/
|
|
51
|
+
async function renameCompositionBlock(api, logger, deviceId, blockId, name) {
|
|
52
|
+
if (name.length < 1 || name.length > BLOCK_NAME_MAX) {
|
|
53
|
+
logger.warn("composed rename did not reach the block — the name is outside what a block stores", {
|
|
54
|
+
tags: { deviceId },
|
|
55
|
+
meta: {
|
|
56
|
+
blockId,
|
|
57
|
+
length: name.length
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
const found = await writeBlockName(api, blockId, name);
|
|
64
|
+
if (found.kind === "skip") logger.warn("composed rename did not reach the block — retried on the next apply", {
|
|
65
|
+
tags: { deviceId },
|
|
66
|
+
meta: {
|
|
67
|
+
blockId,
|
|
68
|
+
reason: found.reason
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
} catch (err) {
|
|
72
|
+
const message = require_dist.errMsg(err);
|
|
73
|
+
if (!message.includes("changed since you read it")) {
|
|
74
|
+
logBlockRenameFailed(logger, deviceId, blockId, message);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const found = await writeBlockName(api, blockId, name);
|
|
79
|
+
if (found.kind === "skip") logger.warn("composed rename did not reach the block — retried on the next apply", {
|
|
80
|
+
tags: { deviceId },
|
|
81
|
+
meta: {
|
|
82
|
+
blockId,
|
|
83
|
+
reason: found.reason
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
} catch (retryErr) {
|
|
87
|
+
logBlockRenameFailed(logger, deviceId, blockId, require_dist.errMsg(retryErr));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function logBlockRenameFailed(logger, deviceId, blockId, error) {
|
|
92
|
+
logger.warn("composed rename did not reach the block — retried on the next apply", {
|
|
93
|
+
tags: { deviceId },
|
|
94
|
+
meta: {
|
|
95
|
+
blockId,
|
|
96
|
+
error
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
Object.defineProperty(exports, "composedBlockIdOf", {
|
|
102
|
+
enumerable: true,
|
|
103
|
+
get: function() {
|
|
104
|
+
return composedBlockIdOf;
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
Object.defineProperty(exports, "renameCompositionBlock", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
get: function() {
|
|
110
|
+
return renameCompositionBlock;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { $c as COMPOSED_DEVICE_STABLE_ID_PREFIX, rl as errMsg } from "./dist-BQiyo22b.mjs";
|
|
2
|
+
//#region src/builtins/core-blocks/rename-composition-block.ts
|
|
3
|
+
/**
|
|
4
|
+
* An operator rename of a composed device writes the composition block's
|
|
5
|
+
* name, so the next composer apply does not put the old name back (D659).
|
|
6
|
+
* Name-only: the composition body is not touched, and a customization (which
|
|
7
|
+
* has no name of its own) is never a composed device.
|
|
8
|
+
*/
|
|
9
|
+
/** `CoreBlockSchema` / `ComposerBlockSchema` name max. A longer device name cannot be stored on the block. */
|
|
10
|
+
var BLOCK_NAME_MAX = 120;
|
|
11
|
+
/** The block id behind a composed device, or null when the row is not one. */
|
|
12
|
+
function composedBlockIdOf(addonId, stableId) {
|
|
13
|
+
if (addonId !== "composer") return null;
|
|
14
|
+
if (!stableId.startsWith("composed-")) return null;
|
|
15
|
+
const blockId = stableId.slice(COMPOSED_DEVICE_STABLE_ID_PREFIX.length);
|
|
16
|
+
return blockId.length === 0 ? null : blockId;
|
|
17
|
+
}
|
|
18
|
+
function lookupBlockName(read, blockId) {
|
|
19
|
+
if (read.state === "not-loaded") return {
|
|
20
|
+
kind: "skip",
|
|
21
|
+
reason: "core_blocks has not loaded"
|
|
22
|
+
};
|
|
23
|
+
if (read.view === null) return {
|
|
24
|
+
kind: "skip",
|
|
25
|
+
reason: `no composition "${blockId}"`
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
kind: "ready",
|
|
29
|
+
block: {
|
|
30
|
+
name: read.view.block.name,
|
|
31
|
+
updatedAt: read.view.block.updatedAt
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
async function writeBlockName(api, blockId, name) {
|
|
36
|
+
const found = lookupBlockName(await api.coreBlocks.getComposition.query({ blockId }), blockId);
|
|
37
|
+
if (found.kind === "skip" || found.block.name === name) return found;
|
|
38
|
+
await api.coreBlocks.updateComposition.mutate({
|
|
39
|
+
blockId,
|
|
40
|
+
expectedUpdatedAt: found.block.updatedAt,
|
|
41
|
+
block: { name }
|
|
42
|
+
});
|
|
43
|
+
return found;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Make the stored block name `name`. A conflict with a save that landed
|
|
47
|
+
* between the read and the write is retried once. A failure is logged and
|
|
48
|
+
* swallowed: the device rename has already landed, and the composer's next
|
|
49
|
+
* apply writes the block again.
|
|
50
|
+
*/
|
|
51
|
+
async function renameCompositionBlock(api, logger, deviceId, blockId, name) {
|
|
52
|
+
if (name.length < 1 || name.length > BLOCK_NAME_MAX) {
|
|
53
|
+
logger.warn("composed rename did not reach the block — the name is outside what a block stores", {
|
|
54
|
+
tags: { deviceId },
|
|
55
|
+
meta: {
|
|
56
|
+
blockId,
|
|
57
|
+
length: name.length
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
const found = await writeBlockName(api, blockId, name);
|
|
64
|
+
if (found.kind === "skip") logger.warn("composed rename did not reach the block — retried on the next apply", {
|
|
65
|
+
tags: { deviceId },
|
|
66
|
+
meta: {
|
|
67
|
+
blockId,
|
|
68
|
+
reason: found.reason
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
} catch (err) {
|
|
72
|
+
const message = errMsg(err);
|
|
73
|
+
if (!message.includes("changed since you read it")) {
|
|
74
|
+
logBlockRenameFailed(logger, deviceId, blockId, message);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const found = await writeBlockName(api, blockId, name);
|
|
79
|
+
if (found.kind === "skip") logger.warn("composed rename did not reach the block — retried on the next apply", {
|
|
80
|
+
tags: { deviceId },
|
|
81
|
+
meta: {
|
|
82
|
+
blockId,
|
|
83
|
+
reason: found.reason
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
} catch (retryErr) {
|
|
87
|
+
logBlockRenameFailed(logger, deviceId, blockId, errMsg(retryErr));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function logBlockRenameFailed(logger, deviceId, blockId, error) {
|
|
92
|
+
logger.warn("composed rename did not reach the block — retried on the next apply", {
|
|
93
|
+
tags: { deviceId },
|
|
94
|
+
meta: {
|
|
95
|
+
blockId,
|
|
96
|
+
error
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
//#endregion
|
|
101
|
+
export { renameCompositionBlock as n, composedBlockIdOf as t };
|