@camstack/server 1.2.176 → 1.2.178
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/agent/agent-addon-updates.js +181 -0
- package/dist/agent/agent-http.js +5 -0
- package/dist/agent/agent-update-routes.js +101 -0
- package/dist/agent/main.js +26 -0
- package/dist/api/core/cap-providers.js +9 -2
- package/dist/api/core/logging-settings.js +332 -36
- package/dist/api/core/request-census-settings.js +11 -6
- package/dist/api/trpc/core-cap-bridge.js +64 -3
- package/dist/api/trpc/device-config-secret-redaction.js +19 -0
- package/dist/api/trpc/generated-cap-mounts.js +17 -1
- package/dist/api/trpc/generated-cap-routers.js +1103 -1054
- package/dist/api/trpc/http-request-census.js +201 -38
- package/dist/api/trpc/ws-request-census.js +300 -0
- package/dist/core/addon/addon-registry.service.js +33 -109
- package/dist/core/addon/device-meta-mirror.js +239 -0
- package/dist/core/addon/single-flight-refresh.js +29 -16
- package/dist/main.js +19 -7
- package/package.json +1 -1
|
@@ -43,6 +43,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
43
43
|
exports.NON_ADMIN_CONFIG_REDACTED_METHODS = exports.REDACTED_SECRET = void 0;
|
|
44
44
|
exports.isSecretConfigKey = isSecretConfigKey;
|
|
45
45
|
exports.redactDeviceInfoSecrets = redactDeviceInfoSecrets;
|
|
46
|
+
exports.redactDeviceInfoRecordSecrets = redactDeviceInfoRecordSecrets;
|
|
46
47
|
exports.redactSettingsSections = redactSettingsSections;
|
|
47
48
|
exports.redactSettingsAggregate = redactSettingsAggregate;
|
|
48
49
|
exports.redactConfigEntries = redactConfigEntries;
|
|
@@ -113,6 +114,23 @@ function redactDeviceInfoSecrets(data) {
|
|
|
113
114
|
return data;
|
|
114
115
|
return { ...data, config: redactRecord(config) };
|
|
115
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Project a `Record<parentId, DeviceInfo[]>` — the shape `getChildrenBatch`
|
|
119
|
+
* answers with.
|
|
120
|
+
*
|
|
121
|
+
* {@link redactDeviceInfoSecrets} would pass this through UNTOUCHED: the batch
|
|
122
|
+
* answer IS a record, so `isRecord` accepts it, and it carries no `config` of
|
|
123
|
+
* its own, so the function returns early having redacted nothing. A batch of a
|
|
124
|
+
* single-device read must never be the ungated way to ask the same question.
|
|
125
|
+
*/
|
|
126
|
+
function redactDeviceInfoRecordSecrets(data) {
|
|
127
|
+
if (!isRecord(data))
|
|
128
|
+
return data;
|
|
129
|
+
const out = {};
|
|
130
|
+
for (const [key, value] of Object.entries(data))
|
|
131
|
+
out[key] = redactDeviceInfoSecrets(value);
|
|
132
|
+
return out;
|
|
133
|
+
}
|
|
116
134
|
/** One settings field as the aggregate emits it: `{ key, value, … }`. */
|
|
117
135
|
function redactField(field) {
|
|
118
136
|
if (!isRecord(field))
|
|
@@ -222,6 +240,7 @@ exports.NON_ADMIN_CONFIG_REDACTED_METHODS = new Map([
|
|
|
222
240
|
['deviceManager.getDevice', redactDeviceInfoSecrets],
|
|
223
241
|
['deviceManager.listAll', redactDeviceInfoSecrets],
|
|
224
242
|
['deviceManager.getChildren', redactDeviceInfoSecrets],
|
|
243
|
+
['deviceManager.getChildrenBatch', redactDeviceInfoRecordSecrets],
|
|
225
244
|
['deviceManager.getDeviceSettingsAggregate', redactSettingsSections],
|
|
226
245
|
['deviceManager.getSettingsSchema', redactSettingsSections],
|
|
227
246
|
['deviceManager.getDeviceAggregate', redactSettingsAggregate],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// AUTO-GENERATED by scripts/generate-cap-mounts.ts — DO NOT EDIT
|
|
3
3
|
// Re-run: npx tsx scripts/generate-cap-mounts.ts
|
|
4
4
|
//
|
|
5
|
-
// Mounted:
|
|
5
|
+
// Mounted: 147 Skipped (legacy): 3
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.LEGACY_SHAPE_SKIP = void 0;
|
|
8
8
|
exports.mountAllCaps = mountAllCaps;
|
|
@@ -256,6 +256,22 @@ function mountAllCaps(services) {
|
|
|
256
256
|
llmRuntime: (0, generated_cap_routers_js_1.createCapRouter_llmRuntime)((_ctx) => reg?.getSingleton('llm-runtime') ?? null, remoteCapProxy),
|
|
257
257
|
localNetwork: (0, generated_cap_routers_js_1.createCapRouter_localNetwork)((_ctx) => reg?.getSingleton('local-network') ?? null, remoteCapProxy),
|
|
258
258
|
lockControl: (0, generated_cap_routers_js_1.createCapRouter_lockControl)((_ctx) => (0, cap_mount_helpers_js_1.requireDeviceScoped)(reg, 'lock-control'), remoteCapProxy),
|
|
259
|
+
logChannels: (0, generated_cap_routers_js_1.createCapRouter_logChannels)((_ctx, addonId) => {
|
|
260
|
+
if (!reg)
|
|
261
|
+
return null;
|
|
262
|
+
if (addonId !== undefined) {
|
|
263
|
+
return reg.getProviderByAddonId('log-channels', addonId);
|
|
264
|
+
}
|
|
265
|
+
const entries = reg.getCollectionEntries('log-channels');
|
|
266
|
+
if (entries.length === 0)
|
|
267
|
+
return null;
|
|
268
|
+
const providers = entries.map(([, p]) => p);
|
|
269
|
+
const first = providers[0];
|
|
270
|
+
return {
|
|
271
|
+
...first,
|
|
272
|
+
list: (0, cap_mount_helpers_js_1.concatCollection)(providers, 'list'),
|
|
273
|
+
};
|
|
274
|
+
}, remoteCapProxy),
|
|
259
275
|
loginMethod: (0, generated_cap_routers_js_1.createCapRouter_loginMethod)((_ctx, addonId) => {
|
|
260
276
|
if (!reg)
|
|
261
277
|
return null;
|