@camstack/server 1.2.822 → 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.
Files changed (99) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +8 -9
  3. package/system/dist/addon-runner.js +18 -13
  4. package/system/dist/addon-runner.mjs +19 -14
  5. package/system/dist/addon-utils.mjs +1 -1
  6. package/system/dist/{agent-https-C4yxMErF.mjs → agent-https-CDl7mB_F.mjs} +1 -1
  7. package/system/dist/{agent-https-SGBI0xP8.js → agent-https-Df53Fvk1.js} +1 -1
  8. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  9. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
  10. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  11. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
  12. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  13. package/system/dist/builtins/alerts/alerts.addon.mjs +3 -3
  14. package/system/dist/builtins/autotrack/index.js +1 -1
  15. package/system/dist/builtins/autotrack/index.mjs +1 -1
  16. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  17. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
  18. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  19. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  20. package/system/dist/builtins/camera-grid/index.js +1 -1
  21. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  22. package/system/dist/builtins/composer/composed-device-set.d.ts +5 -1
  23. package/system/dist/builtins/composer/composed-device.d.ts +4 -0
  24. package/system/dist/builtins/composer/composed-name.d.ts +30 -0
  25. package/system/dist/builtins/composer/composer.addon.js +94 -6
  26. package/system/dist/builtins/composer/composer.addon.mjs +94 -6
  27. package/system/dist/builtins/composer/composer.d.ts +13 -0
  28. package/system/dist/builtins/console-logging/index.js +1 -1
  29. package/system/dist/builtins/console-logging/index.mjs +1 -1
  30. package/system/dist/builtins/core-blocks/composition-api.d.ts +6 -0
  31. package/system/dist/builtins/core-blocks/core-blocks.addon.js +68 -4
  32. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +68 -4
  33. package/system/dist/builtins/core-blocks/rename-composition-block.d.ts +16 -0
  34. package/system/dist/builtins/core-blocks/sync-composed-device-name.d.ts +19 -0
  35. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  36. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  37. package/system/dist/builtins/device-manager/device-manager.addon.js +37 -3
  38. package/system/dist/builtins/device-manager/device-manager.addon.mjs +37 -3
  39. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  40. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  41. package/system/dist/builtins/keychain/index.js +4 -4
  42. package/system/dist/builtins/keychain/index.mjs +4 -4
  43. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  44. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  45. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  46. package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
  47. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  48. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  49. package/system/dist/builtins/loki-logging/index.js +1 -1
  50. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  51. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  52. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
  53. package/system/dist/builtins/platform-probe/index.js +1 -1
  54. package/system/dist/builtins/platform-probe/index.mjs +10 -10
  55. package/system/dist/builtins/record-entries/index.js +1 -1
  56. package/system/dist/builtins/record-entries/index.mjs +1 -1
  57. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  58. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  59. package/system/dist/builtins/snapshot/index.js +1 -1
  60. package/system/dist/builtins/snapshot/index.mjs +1 -1
  61. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  62. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  63. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  64. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  65. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  66. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  67. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  68. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  69. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  70. package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
  71. package/system/dist/builtins/winston-logging/index.js +1 -1
  72. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  73. package/system/dist/{capture-engine-6MVUyUry.js → capture-engine-C0Z5rwCO.js} +1 -1
  74. package/system/dist/{capture-engine-BSjE-CQA.mjs → capture-engine-D_GQBgrZ.mjs} +1 -1
  75. package/system/dist/{composition-sources-BBAOXZdC.js → composition-sources-DIZx3mW3.js} +1 -1
  76. package/system/dist/{composition-sources-C8T9DRbZ.mjs → composition-sources-mx-2yCDv.mjs} +1 -1
  77. package/system/dist/{constants-CReG6K4k.mjs → constants-BQlx9HDp.mjs} +1 -1
  78. package/system/dist/{constants-v0g9--wN.js → constants-CAOcKiWT.js} +1 -1
  79. package/system/dist/{coral-accelerators-DBlgWB8k.mjs → coral-accelerators-BW3OcrLD.mjs} +6 -6
  80. package/system/dist/{custom-action-registry-B9zFBNVa.mjs → custom-action-registry-N7flBDwT.mjs} +37 -37
  81. package/system/dist/{device-ca-BFcBTfff.js → device-ca-93LsCF_Q.js} +1 -1
  82. package/system/dist/{device-ca-cX8qUs2s.mjs → device-ca-CK6GTnNh.mjs} +1 -1
  83. package/system/dist/{dist-DjBZ1HhF.mjs → dist-BQiyo22b.mjs} +76 -26
  84. package/system/dist/{dist-C2czR9xK.js → dist-izXDzt4g.js} +81 -25
  85. package/system/dist/file-host-worker.js +1 -1
  86. package/system/dist/file-host-worker.mjs +1 -1
  87. package/system/dist/{hub-mdns-ciao-CpCleue0.js → hub-mdns-ciao-Dt_tgvol.js} +2 -2
  88. package/system/dist/{hub-mdns-ciao-Cnr8xiSd.mjs → hub-mdns-ciao-srpOrqIP.mjs} +2 -2
  89. package/system/dist/index.js +26 -21
  90. package/system/dist/index.mjs +238 -233
  91. package/system/dist/{legacy-integration-rows-door-DhW6mPZj.js → legacy-integration-rows-door-BH43eDu6.js} +1 -1
  92. package/system/dist/{legacy-integration-rows-door-CGajkVPh.mjs → legacy-integration-rows-door-wu2GWY6U.mjs} +1 -1
  93. package/system/dist/rename-composition-block-6oLQVzft.js +112 -0
  94. package/system/dist/rename-composition-block-CH6ZoSJA.mjs +101 -0
  95. package/system/dist/{restore-archive-eA7L58KT.mjs → restore-archive-C4rR2SYV.mjs} +94 -94
  96. package/system/dist/{restore-archive-BLab80kx.js → restore-archive-DpZ2PbLN.js} +1 -1
  97. package/system/dist/{wal-maintenance-DeBxoOFh.mjs → wal-maintenance-CNfp0HHX.mjs} +0 -0
  98. package/system/dist/{wal-maintenance-DhnSF7K-.js → wal-maintenance-DAA2qJja.js} +0 -0
  99. package/system/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-C2czR9xK.js");
1
+ const require_dist = require("./dist-izXDzt4g.js");
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).
@@ -1,4 +1,4 @@
1
- import { Qs as collectSecretMarkerRefs } from "./dist-DjBZ1HhF.mjs";
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 };