@camstack/server 1.2.818 → 1.2.820
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 +28 -0
- package/dist/api/core/cap-providers.js +32 -40
- package/dist/api/trpc/cap-route-error-formatter.js +19 -1
- package/dist/api/trpc/cap-router-runtime.js +23 -0
- package/dist/api/trpc/device-config-secret-redaction.js +1 -2
- package/dist/api/trpc/generated-cap-routers.js +13 -27
- package/dist/api/trpc/localized-schema-paths.js +1 -1
- package/dist/api/trpc/trpc.router.js +1 -1
- package/dist/core/addon/addon-registry.service.js +2 -2
- package/dist/core/addon/addon-settings-provider.js +0 -23
- package/dist/core/addon/instance-lifecycle.js +44 -7
- package/package.json +27 -14
- package/system/dist/addon-runner.js +0 -1
- package/system/dist/addon-runner.mjs +0 -1
- package/system/dist/{agent-https-ChriyNA8.js → agent-https-CbysxRlV.js} +1 -1
- package/system/dist/{agent-https-rhOY61af.mjs → agent-https-XHjvcSEq.mjs} +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 +1 -1
- 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 +1 -1
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- 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 +2 -2
- 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/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- 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/blocks-instances.d.ts +2 -2
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +5 -5
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- 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.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- 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 +2 -2
- 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 +1 -1
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +1 -1
- 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 +1 -1
- 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 +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
- 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-Cgt1r0h5.js → capture-engine-CKtkENOg.js} +1 -1
- package/system/dist/{capture-engine-CoK1n1F1.mjs → capture-engine-WSpdP-gE.mjs} +1 -1
- package/system/dist/{composition-sources-TkHq8DdF.js → composition-sources-6Qx72gmK.js} +1 -1
- package/system/dist/{composition-sources-DSU28FFP.mjs → composition-sources-Dr6uwBGw.mjs} +1 -1
- package/system/dist/{constants-D3mNibfv.js → constants-BchSDmTD.js} +1 -1
- package/system/dist/{constants-CCezBXPq.mjs → constants-URzk8siY.mjs} +1 -1
- package/system/dist/{device-ca-CjX1tQP7.mjs → device-ca-Bu1E5Vgr.mjs} +1 -1
- package/system/dist/{device-ca-CEzeY_zI.js → device-ca-kANxsBE5.js} +1 -1
- package/system/dist/{dist-BNBgsEk0.mjs → dist-C0Df8iJl.mjs} +91 -126
- package/system/dist/{dist-DX1gyM8o.js → dist-R_mOSFtH.js} +91 -126
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-DBHvpWvv.js → hub-mdns-ciao-2AZ3ucDO.js} +2 -2
- package/system/dist/{hub-mdns-ciao-BCfG7mv3.mjs → hub-mdns-ciao-pxgLcmqO.mjs} +2 -2
- package/system/dist/index.js +40 -11
- package/system/dist/index.mjs +40 -11
- package/system/dist/kernel/cap-router-builder.d.ts +9 -0
- package/system/dist/kernel/transport/child-cap-protocol.d.ts +1 -1
- package/system/dist/{legacy-integration-rows-door-C0X4Ijcr.mjs → legacy-integration-rows-door-Cj58BS60.mjs} +1 -1
- package/system/dist/{legacy-integration-rows-door-7K4_MoAP.js → legacy-integration-rows-door-g4CeLJ9g.js} +1 -1
- package/system/dist/{restore-archive-WBDJlios.mjs → restore-archive-Bd7fgVo8.mjs} +1 -1
- package/system/dist/{restore-archive-DXlN0NYx.js → restore-archive-CAh7u-rY.js} +1 -1
- package/system/dist/{wal-maintenance-BPmo2JzY.js → wal-maintenance--0liHBxL.js} +0 -0
- package/system/dist/{wal-maintenance-BJ0vDek1.mjs → wal-maintenance-DMf2oEQ-.mjs} +0 -0
- package/system/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $o as BaseAddon, Ac as parseSecretRef, Di as modeForSwitch, Ec as normalizeNodeId, Er as evictionPolicyOfLocation, Ga as storageMigrationCapability, Hs as buildSecretRef, Mc as recordSecretRef, Na as settingsStoreCapability, Oi as modeMayWrite, Pc as resolveSecretMarkers, Qa as switchStateOfMode, Qs as defineCustomActions, Sc as makeSecretMarker, Us as collectSecretConfigKeys, Vc as toSecretFieldView, Wa as storageCapability, Wr as integrationInstancesCapability, Xs as customAction, Zc as EventCategory, Zs as defineAddonMigrations, _c as isSecretClear, _o as withLocationMode, bi as mayWriteToLocation, ec as defineRecordKinds, en as StorageCleanupJobSchema, nn as StorageLocationTypeSchema, qt as STORAGE_LOCATION_MODES, rn as StorageMigrationJobSchema, ti as isLocationEnabled, tn as StorageLocationModeSchema, va as resolveLocationMode, vc as isSecretFieldView, vs as REDACTED_SECRET, yc as isSecretMarker, yi as mayReadLocation, zr as gbToBytes } from "../../dist-
|
|
1
|
+
import { $o as BaseAddon, Ac as parseSecretRef, Di as modeForSwitch, Ec as normalizeNodeId, Er as evictionPolicyOfLocation, Ga as storageMigrationCapability, Hs as buildSecretRef, Mc as recordSecretRef, Na as settingsStoreCapability, Oi as modeMayWrite, Pc as resolveSecretMarkers, Qa as switchStateOfMode, Qs as defineCustomActions, Sc as makeSecretMarker, Us as collectSecretConfigKeys, Vc as toSecretFieldView, Wa as storageCapability, Wr as integrationInstancesCapability, Xs as customAction, Zc as EventCategory, Zs as defineAddonMigrations, _c as isSecretClear, _o as withLocationMode, bi as mayWriteToLocation, ec as defineRecordKinds, en as StorageCleanupJobSchema, nn as StorageLocationTypeSchema, qt as STORAGE_LOCATION_MODES, rn as StorageMigrationJobSchema, ti as isLocationEnabled, tn as StorageLocationModeSchema, va as resolveLocationMode, vc as isSecretFieldView, vs as REDACTED_SECRET, yc as isSecretMarker, yi as mayReadLocation, zr as gbToBytes } from "../../dist-C0Df8iJl.mjs";
|
|
2
2
|
import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -3,11 +3,11 @@ 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-R_mOSFtH.js");
|
|
7
7
|
const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
|
|
8
8
|
const require_x509_es = require("../../x509.es-WtnRNyYS.js");
|
|
9
|
-
const require_agent_https = require("../../agent-https-
|
|
10
|
-
const require_constants$8 = require("../../constants-
|
|
9
|
+
const require_agent_https = require("../../agent-https-CbysxRlV.js");
|
|
10
|
+
const require_constants$8 = require("../../constants-BchSDmTD.js");
|
|
11
11
|
const require_src$1 = require("../../src-CnAqG6EF.js");
|
|
12
12
|
let zod = require("zod");
|
|
13
13
|
let node_crypto = require("node:crypto");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $o as BaseAddon, La as shortHostname, Qs as defineCustomActions, Qt as ServerNameSchema, Xs as customAction, Yc as errMsg, lc as hydrateSchema } from "../../dist-
|
|
2
|
+
import { $o as BaseAddon, La as shortHostname, Qs as defineCustomActions, Qt as ServerNameSchema, Xs as customAction, Yc as errMsg, lc as hydrateSchema } from "../../dist-C0Df8iJl.mjs";
|
|
3
3
|
import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
|
|
4
4
|
import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension } from "../../x509.es-BRiJgOvu.mjs";
|
|
5
|
-
import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-
|
|
6
|
-
import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-
|
|
5
|
+
import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-XHjvcSEq.mjs";
|
|
6
|
+
import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-URzk8siY.mjs";
|
|
7
7
|
import { t as require_src } from "../../src-hG4grMU4.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { X509Certificate, createHash, createPrivateKey, randomBytes, randomInt, sign, timingSafeEqual, verify, 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-R_mOSFtH.js");
|
|
7
7
|
const require_formatter = require("../../formatter-xbxeV4GD.js");
|
|
8
8
|
const require_log_file_read_protocol = require("../../log-file-read-protocol-DSV_vQRb.js");
|
|
9
9
|
let node_path = require("node:path");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $o as BaseAddon, Xi as preconditionOf, Zs as defineAddonMigrations, gi as logDestinationCapability } from "../../dist-
|
|
1
|
+
import { $o as BaseAddon, Xi as preconditionOf, Zs as defineAddonMigrations, gi as logDestinationCapability } from "../../dist-C0Df8iJl.mjs";
|
|
2
2
|
import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
|
|
3
3
|
import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-hTaAsYlX.mjs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_dist = require("./dist-
|
|
1
|
+
const require_dist = require("./dist-R_mOSFtH.js");
|
|
2
2
|
//#region src/builtins/device-history/store/series-registry.ts
|
|
3
3
|
function subjectIdOf(subject) {
|
|
4
4
|
return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Jc as DeviceType, ls as HISTORY_DEFAULT_MIN_INTERVAL_MS, sc as historyItemFieldPath } from "./dist-
|
|
1
|
+
import { Jc as DeviceType, ls as HISTORY_DEFAULT_MIN_INTERVAL_MS, sc as historyItemFieldPath } from "./dist-C0Df8iJl.mjs";
|
|
2
2
|
//#region src/builtins/device-history/store/series-registry.ts
|
|
3
3
|
function subjectIdOf(subject) {
|
|
4
4
|
return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Fo as compositionSourceKey, Yc as errMsg } from "./dist-
|
|
1
|
+
import { Fo as compositionSourceKey, Yc as errMsg } from "./dist-C0Df8iJl.mjs";
|
|
2
2
|
//#region src/builtins/shared/device-state-changed.ts
|
|
3
3
|
/** Structural narrowing helper for untrusted bus payloads. */
|
|
4
4
|
function isRecord(value) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
|
|
2
|
-
var MESH_CA_KEY_REF = require("./dist-
|
|
2
|
+
var MESH_CA_KEY_REF = require("./dist-R_mOSFtH.js").buildSecretRef({
|
|
3
3
|
owner: "system",
|
|
4
4
|
scope: { kind: "global" },
|
|
5
5
|
fieldPath: "meshCaKey"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as DEVICE_SAN_USER_PREFIX, Hs as buildSecretRef, W as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-
|
|
1
|
+
import { G as DEVICE_SAN_USER_PREFIX, Hs as buildSecretRef, W as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-C0Df8iJl.mjs";
|
|
2
2
|
import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
|
|
3
3
|
import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
|
|
4
4
|
//#region src/auth/jwt-signing-key.ts
|
|
@@ -1211,7 +1211,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
|
1211
1211
|
return DeviceRole;
|
|
1212
1212
|
}({});
|
|
1213
1213
|
//#endregion
|
|
1214
|
-
//#region ../types/dist/sleep-
|
|
1214
|
+
//#region ../types/dist/sleep-CkinsFFb.mjs
|
|
1215
1215
|
/**
|
|
1216
1216
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
1217
1217
|
* window to float samples (D455).
|
|
@@ -4080,16 +4080,6 @@ var BaseAddon = class {
|
|
|
4080
4080
|
return null;
|
|
4081
4081
|
}
|
|
4082
4082
|
/**
|
|
4083
|
-
* The form schema of ONE integration instance, or `null` to use the scoped form.
|
|
4084
|
-
*
|
|
4085
|
-
* Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
|
|
4086
|
-
* needs its connection fields, the default integration the addon's own sections. It is the
|
|
4087
|
-
* SHAPE of the form only — the values live on the instance record.
|
|
4088
|
-
*/
|
|
4089
|
-
async integrationFormSchema(_instance) {
|
|
4090
|
-
return null;
|
|
4091
|
-
}
|
|
4092
|
-
/**
|
|
4093
4083
|
* D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
|
|
4094
4084
|
* provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
|
|
4095
4085
|
* declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
|
|
@@ -4117,8 +4107,7 @@ var BaseAddon = class {
|
|
|
4117
4107
|
}
|
|
4118
4108
|
/**
|
|
4119
4109
|
* The host's read of the scoped declarations: the schema one capability declares for `scope`,
|
|
4120
|
-
* or `null`.
|
|
4121
|
-
* host asks this method.
|
|
4110
|
+
* or `null`. The hook is protected, the host asks this method.
|
|
4122
4111
|
*/
|
|
4123
4112
|
async getScopedSettingsSchema(scope, cap) {
|
|
4124
4113
|
switch (scope) {
|
|
@@ -4286,22 +4275,6 @@ var BaseAddon = class {
|
|
|
4286
4275
|
return Object.fromEntries([...collectHydratedFieldValues(form)].filter(([, value]) => value !== void 0));
|
|
4287
4276
|
}
|
|
4288
4277
|
/**
|
|
4289
|
-
* What the create wizard and the integration edit page render for one instance: the addon's
|
|
4290
|
-
* per-instance schema when it declares one, else its global schema (what they always showed).
|
|
4291
|
-
*/
|
|
4292
|
-
async getIntegrationFormSchema(instance, nodeId) {
|
|
4293
|
-
const scoped = await this.integrationFormSchema(instance);
|
|
4294
|
-
if (scoped === null) return this.scopedForm(nodeId);
|
|
4295
|
-
return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
|
|
4296
|
-
}
|
|
4297
|
-
/** The form of the scoped schemas this addon declared, hydrated from its store. */
|
|
4298
|
-
async scopedForm(nodeId) {
|
|
4299
|
-
await this.loadScopedSchemas();
|
|
4300
|
-
const schema = this.scopedFormSchema();
|
|
4301
|
-
if (!schema) return { sections: [] };
|
|
4302
|
-
return hydrateSchema(schema, await this.readRawProjectedStore(nodeId), { inlineSecretsAsViews: true });
|
|
4303
|
-
}
|
|
4304
|
-
/**
|
|
4305
4278
|
* The raw addon store PROJECTED onto the target node's bare per-node keys:
|
|
4306
4279
|
* every `perNode: true` field carries THAT node's scoped value on its bare
|
|
4307
4280
|
* key (absent scoped key ⇒ key absent, so the schema `default` wins — no
|
|
@@ -4488,12 +4461,6 @@ var BaseAddon = class {
|
|
|
4488
4461
|
this._nodeKeysByCap = /* @__PURE__ */ new Map();
|
|
4489
4462
|
this._addonSecretTree = null;
|
|
4490
4463
|
}
|
|
4491
|
-
/** The form of an addon's scoped schemas: their sections, each shown once. */
|
|
4492
|
-
scopedFormSchema(cap) {
|
|
4493
|
-
const byId = /* @__PURE__ */ new Map();
|
|
4494
|
-
for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
|
|
4495
|
-
return byId.size === 0 ? null : { sections: [...byId.values()] };
|
|
4496
|
-
}
|
|
4497
4464
|
/** Every loaded scoped schema of `cap`, or of every loaded capability. */
|
|
4498
4465
|
loadedScopedSchemas(cap) {
|
|
4499
4466
|
if (cap !== void 0) return this._scopedByCap.get(cap) ?? [];
|
|
@@ -5083,6 +5050,35 @@ function normalizeAddonInitResult(result) {
|
|
|
5083
5050
|
if (Array.isArray(result)) return { providers: result };
|
|
5084
5051
|
return result;
|
|
5085
5052
|
}
|
|
5053
|
+
/**
|
|
5054
|
+
* A user-facing error with a STABLE code (D863).
|
|
5055
|
+
*
|
|
5056
|
+
* `message` is always the English text, so every consumer that knows nothing
|
|
5057
|
+
* of codes (old clients, logs, the mesh) behaves exactly as before. The hub's
|
|
5058
|
+
* tRPC error formatter reads `code` + `params` and, when the request language
|
|
5059
|
+
* has a text for `server:<code>`, replaces the response `message`; the code
|
|
5060
|
+
* stays in the payload (`data.i18n`).
|
|
5061
|
+
*/
|
|
5062
|
+
/** Dotted lower-case code, e.g. `auth.invalid-credentials`. It is the key in the `server` catalog. */
|
|
5063
|
+
var ErrorCodeSchema = z.string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/);
|
|
5064
|
+
z.object({
|
|
5065
|
+
code: ErrorCodeSchema,
|
|
5066
|
+
params: z.record(z.string(), z.union([z.string(), z.number()])).optional()
|
|
5067
|
+
});
|
|
5068
|
+
var CamstackError = class extends Error {
|
|
5069
|
+
i18nCode;
|
|
5070
|
+
i18nParams;
|
|
5071
|
+
constructor(code, params, englishMessage) {
|
|
5072
|
+
super(englishMessage);
|
|
5073
|
+
this.name = "CamstackError";
|
|
5074
|
+
this.i18nCode = code;
|
|
5075
|
+
this.i18nParams = params;
|
|
5076
|
+
}
|
|
5077
|
+
};
|
|
5078
|
+
/** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
|
|
5079
|
+
function userError(code, params, englishFallback) {
|
|
5080
|
+
return new CamstackError(code, params, englishFallback);
|
|
5081
|
+
}
|
|
5086
5082
|
z.object({
|
|
5087
5083
|
field: z.string().min(1),
|
|
5088
5084
|
on: z.literal("advance")
|
|
@@ -5236,12 +5232,6 @@ function systemMethod(input, output, options) {
|
|
|
5236
5232
|
systemOnly: true
|
|
5237
5233
|
};
|
|
5238
5234
|
}
|
|
5239
|
-
/**
|
|
5240
|
-
* A method a SOURCE of a collection cap may legitimately not serve — OPTIONAL
|
|
5241
|
-
* on `InferProvider`. The `providerOptional: true` literal is what
|
|
5242
|
-
* `InferProvider` keys on; see {@link CapabilityMethodSchema.providerOptional}
|
|
5243
|
-
* for when this is the honest answer and when it is a soft stub.
|
|
5244
|
-
*/
|
|
5245
5235
|
function optionalMethod(input, output, options) {
|
|
5246
5236
|
return {
|
|
5247
5237
|
...method(input, output, options),
|
|
@@ -13574,35 +13564,6 @@ function auditedFields(cap) {
|
|
|
13574
13564
|
return fieldsByCap.get(cap) ?? NO_FIELDS;
|
|
13575
13565
|
}
|
|
13576
13566
|
/**
|
|
13577
|
-
* A user-facing error with a STABLE code (D863).
|
|
13578
|
-
*
|
|
13579
|
-
* `message` is always the English text, so every consumer that knows nothing
|
|
13580
|
-
* of codes (old clients, logs, the mesh) behaves exactly as before. The hub's
|
|
13581
|
-
* tRPC error formatter reads `code` + `params` and, when the request language
|
|
13582
|
-
* has a text for `server:<code>`, replaces the response `message`; the code
|
|
13583
|
-
* stays in the payload (`data.i18n`).
|
|
13584
|
-
*/
|
|
13585
|
-
/** Dotted lower-case code, e.g. `auth.invalid-credentials`. It is the key in the `server` catalog. */
|
|
13586
|
-
var ErrorCodeSchema = z.string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/);
|
|
13587
|
-
z.object({
|
|
13588
|
-
code: ErrorCodeSchema,
|
|
13589
|
-
params: z.record(z.string(), z.union([z.string(), z.number()])).optional()
|
|
13590
|
-
});
|
|
13591
|
-
var CamstackError = class extends Error {
|
|
13592
|
-
i18nCode;
|
|
13593
|
-
i18nParams;
|
|
13594
|
-
constructor(code, params, englishMessage) {
|
|
13595
|
-
super(englishMessage);
|
|
13596
|
-
this.name = "CamstackError";
|
|
13597
|
-
this.i18nCode = code;
|
|
13598
|
-
this.i18nParams = params;
|
|
13599
|
-
}
|
|
13600
|
-
};
|
|
13601
|
-
/** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
|
|
13602
|
-
function userError(code, params, englishFallback) {
|
|
13603
|
-
return new CamstackError(code, params, englishFallback);
|
|
13604
|
-
}
|
|
13605
|
-
/**
|
|
13606
13567
|
* Type-safe JSON parsing helpers.
|
|
13607
13568
|
*
|
|
13608
13569
|
* `JSON.parse` is typed as `any` in lib.es5.d.ts, which triggers
|
|
@@ -17011,25 +16972,6 @@ function describeUnmet(unmet) {
|
|
|
17011
16972
|
}
|
|
17012
16973
|
}
|
|
17013
16974
|
/**
|
|
17014
|
-
* Which integration instance a settings form is for. An addon that serves several instances
|
|
17015
|
-
* (`instanceMode: multiple`) can show a different form per instance — an NVR integration
|
|
17016
|
-
* needs its connection, the default integration needs the addon's own sections.
|
|
17017
|
-
*
|
|
17018
|
-
* - `integrationId` is `null` in the create wizard: nothing exists yet, the operator is
|
|
17019
|
-
* setting up a NEW instance.
|
|
17020
|
-
* - `mode` is the wizard mode of the integration type (`getAvailableTypes`).
|
|
17021
|
-
* - `candidateStableId` is the discovery candidate a wizard was seeded from, if any.
|
|
17022
|
-
*/
|
|
17023
|
-
var IntegrationInstanceRefSchema = z.object({
|
|
17024
|
-
integrationId: z.string().nullable(),
|
|
17025
|
-
mode: z.enum([
|
|
17026
|
-
"standalone",
|
|
17027
|
-
"account",
|
|
17028
|
-
"broker"
|
|
17029
|
-
]),
|
|
17030
|
-
candidateStableId: z.string().optional()
|
|
17031
|
-
});
|
|
17032
|
-
/**
|
|
17033
16975
|
* notification-output — canonical, capability-gated notification delivery.
|
|
17034
16976
|
*
|
|
17035
16977
|
* Apprise-derived model (see
|
|
@@ -45919,11 +45861,6 @@ var addonSettingsCapability = {
|
|
|
45919
45861
|
scope: ScopedSettingsScopeSchema,
|
|
45920
45862
|
nodeId: z.string().optional()
|
|
45921
45863
|
}), z.record(z.string(), z.unknown()).nullable()),
|
|
45922
|
-
getIntegrationFormSchema: method(z.object({
|
|
45923
|
-
addonId: z.string(),
|
|
45924
|
-
nodeId: z.string().optional(),
|
|
45925
|
-
instance: IntegrationInstanceRefSchema
|
|
45926
|
-
}), SettingsSchemaWithValuesSchema.nullable()),
|
|
45927
45864
|
getDeclaredSettingsKeys: method(z.object({
|
|
45928
45865
|
addonId: z.string(),
|
|
45929
45866
|
nodeId: z.string().optional()
|
|
@@ -64092,6 +64029,12 @@ var IntegrationWithStateSchema = z.object({
|
|
|
64092
64029
|
name: z.string(),
|
|
64093
64030
|
/** A projection of the instance body's switch (`setInstanceEnabled` is the only writer). */
|
|
64094
64031
|
enabled: z.boolean(),
|
|
64032
|
+
/**
|
|
64033
|
+
* True when the addon that holds the switch did not answer (down, failed, or keeps no record for
|
|
64034
|
+
* this row): `enabled` is then the stored registry flag, a stale value, not the state. A reader
|
|
64035
|
+
* must not draw it as on or off (D315).
|
|
64036
|
+
*/
|
|
64037
|
+
switchUnknown: z.literal(true).optional(),
|
|
64095
64038
|
info: z.record(z.string(), z.unknown()).readonly(),
|
|
64096
64039
|
/** The discovery candidate this integration was set up from (D984). */
|
|
64097
64040
|
originStableId: z.string().optional(),
|
|
@@ -64105,6 +64048,12 @@ var IntegrationLiteSchema = z.object({
|
|
|
64105
64048
|
name: z.string(),
|
|
64106
64049
|
/** A projection of the instance body's switch (`setInstanceEnabled` is the only writer). */
|
|
64107
64050
|
enabled: z.boolean(),
|
|
64051
|
+
/**
|
|
64052
|
+
* True when the addon that holds the switch did not answer (down, failed, or keeps no record for
|
|
64053
|
+
* this row): `enabled` is then the stored registry flag, a stale value, not the state. A reader
|
|
64054
|
+
* must not draw it as on or off (D315).
|
|
64055
|
+
*/
|
|
64056
|
+
switchUnknown: z.literal(true).optional(),
|
|
64108
64057
|
info: z.record(z.string(), z.unknown()).readonly(),
|
|
64109
64058
|
/** The discovery candidate this integration was set up from (D984). */
|
|
64110
64059
|
originStableId: z.string().optional(),
|
|
@@ -64203,9 +64152,9 @@ var UpdateIntegrationInputSchema = z.object({
|
|
|
64203
64152
|
id: z.string(),
|
|
64204
64153
|
name: z.string().optional(),
|
|
64205
64154
|
/**
|
|
64206
|
-
*
|
|
64207
|
-
*
|
|
64208
|
-
*
|
|
64155
|
+
* Honoured ONLY for a fixed builtin (`info.fixed`), whose switch is the hub's own registry flag
|
|
64156
|
+
* and works while its addon is down. Any other row is refused (a typed `BAD_REQUEST`): its
|
|
64157
|
+
* switch is `integration-instances.setInstanceEnabled`.
|
|
64209
64158
|
*/
|
|
64210
64159
|
enabled: z.boolean().optional(),
|
|
64211
64160
|
info: z.record(z.string(), z.unknown()).optional()
|
|
@@ -64226,6 +64175,13 @@ var integrationsCapability = {
|
|
|
64226
64175
|
kind: "mutation",
|
|
64227
64176
|
auth: "admin"
|
|
64228
64177
|
}),
|
|
64178
|
+
/**
|
|
64179
|
+
* Delete an integration from the hub side: its devices, its registry row and its record, and
|
|
64180
|
+
* announce it. It works while the addon that owns the instance is down (installed but
|
|
64181
|
+
* crashed), where `integration-instances.deleteInstance` has no provider to route to; with the
|
|
64182
|
+
* provider up the record is removed through it as well. A fixed builtin and an instance a link
|
|
64183
|
+
* names are refused first.
|
|
64184
|
+
*/
|
|
64229
64185
|
delete: method(z.object({ id: z.string() }), DeleteIntegrationResultSchema, {
|
|
64230
64186
|
kind: "mutation",
|
|
64231
64187
|
auth: "admin"
|
|
@@ -64253,6 +64209,12 @@ var integrationsCapability = {
|
|
|
64253
64209
|
* the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
|
|
64254
64210
|
* or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
|
|
64255
64211
|
* clears it.
|
|
64212
|
+
*
|
|
64213
|
+
* Who may call (epic #440): every method but `describe` and `instanceFormSchema` is open to any
|
|
64214
|
+
* session (`caller: 'scoped'`) and default-denies. An admin passes everywhere. A non-admin passes
|
|
64215
|
+
* only on a call pinned to one addon whose `describe().userScoped` is true, and that provider
|
|
64216
|
+
* filters every row on the `caller` the router injected (a notification target is somebody's
|
|
64217
|
+
* phone: a user sees and changes only their own). An addon that says nothing keeps the admin door.
|
|
64256
64218
|
*/
|
|
64257
64219
|
var ConfigSchemaPassthrough$2 = z.custom();
|
|
64258
64220
|
var IntegrationInstanceIdSchema = z.string().min(1);
|
|
@@ -64366,7 +64328,15 @@ var IntegrationInstanceDescriptionSchema = z.object({
|
|
|
64366
64328
|
*/
|
|
64367
64329
|
mintsId: z.boolean().optional(),
|
|
64368
64330
|
/** The links to other instances the provider's kinds declare; absent means none. */
|
|
64369
|
-
links: z.array(IntegrationInstanceLinkSchema).optional()
|
|
64331
|
+
links: z.array(IntegrationInstanceLinkSchema).optional(),
|
|
64332
|
+
/**
|
|
64333
|
+
* The rows belong to individual users (a notification target is somebody's phone). The router
|
|
64334
|
+
* then opens `listInstances`, `getInstance`, `createInstance`, `updateInstance`,
|
|
64335
|
+
* `setInstanceEnabled`, `deleteInstance` and `testInstance` to a NON-admin session on a call
|
|
64336
|
+
* pinned to this addon, and hands the provider the `caller` so it keeps a user to their own rows.
|
|
64337
|
+
* Absent means admin only, as it always was.
|
|
64338
|
+
*/
|
|
64339
|
+
userScoped: z.boolean().optional()
|
|
64370
64340
|
});
|
|
64371
64341
|
var IntegrationInstanceStatusSchema = z.object({
|
|
64372
64342
|
state: z.enum([
|
|
@@ -64424,8 +64394,14 @@ var integrationInstancesCapability = {
|
|
|
64424
64394
|
/** The discovery candidate the wizard was seeded from (`stableId`), if any. */
|
|
64425
64395
|
candidateStableId: z.string().min(1).optional()
|
|
64426
64396
|
}), ConfigSchemaPassthrough$2, { auth: "admin" }),
|
|
64427
|
-
listInstances: method(z.
|
|
64428
|
-
|
|
64397
|
+
listInstances: method(z.looseObject({}), z.array(IntegrationInstanceSchema).readonly(), {
|
|
64398
|
+
auth: "protected",
|
|
64399
|
+
caller: "scoped"
|
|
64400
|
+
}),
|
|
64401
|
+
getInstance: method(z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), {
|
|
64402
|
+
auth: "protected",
|
|
64403
|
+
caller: "scoped"
|
|
64404
|
+
}),
|
|
64429
64405
|
/**
|
|
64430
64406
|
* Insert the typed record. With `id` it is stored under that id (a duplicate id is refused);
|
|
64431
64407
|
* without one the PROVIDER mints it and answers it. `kind` picks one of `describe().kinds`.
|
|
@@ -64458,11 +64434,13 @@ var integrationInstancesCapability = {
|
|
|
64458
64434
|
seed: z.object({ info: z.record(z.string(), z.unknown()) }).optional()
|
|
64459
64435
|
}), z.object({ id: z.string() }), {
|
|
64460
64436
|
kind: "mutation",
|
|
64461
|
-
auth: "
|
|
64437
|
+
auth: "protected",
|
|
64438
|
+
caller: "scoped"
|
|
64462
64439
|
}),
|
|
64463
64440
|
updateInstance: method(IntegrationInstancePatchSchema, z.object({ ok: z.literal(true) }), {
|
|
64464
64441
|
kind: "mutation",
|
|
64465
|
-
auth: "
|
|
64442
|
+
auth: "protected",
|
|
64443
|
+
caller: "scoped"
|
|
64466
64444
|
}),
|
|
64467
64445
|
/**
|
|
64468
64446
|
* Switch ONE instance on or off, for every role; a missing record is created from the addon's
|
|
@@ -64474,7 +64452,8 @@ var integrationInstancesCapability = {
|
|
|
64474
64452
|
enabled: z.boolean()
|
|
64475
64453
|
}), z.object({ ok: z.literal(true) }), {
|
|
64476
64454
|
kind: "mutation",
|
|
64477
|
-
auth: "
|
|
64455
|
+
auth: "protected",
|
|
64456
|
+
caller: "scoped"
|
|
64478
64457
|
}),
|
|
64479
64458
|
/**
|
|
64480
64459
|
* Delete the record and its keychain refs together. For an instance that brings devices the hub
|
|
@@ -64483,7 +64462,8 @@ var integrationInstancesCapability = {
|
|
|
64483
64462
|
*/
|
|
64484
64463
|
deleteInstance: method(z.object({ id: IntegrationInstanceIdSchema }), z.object({ ok: z.literal(true) }), {
|
|
64485
64464
|
kind: "mutation",
|
|
64486
|
-
auth: "
|
|
64465
|
+
auth: "protected",
|
|
64466
|
+
caller: "scoped"
|
|
64487
64467
|
}),
|
|
64488
64468
|
testInstance: optionalMethod(z.object({
|
|
64489
64469
|
id: IntegrationInstanceIdSchema.nullable(),
|
|
@@ -64492,7 +64472,8 @@ var integrationInstancesCapability = {
|
|
|
64492
64472
|
kind: z.string().min(1).optional()
|
|
64493
64473
|
}), TestConnectionResultSchema, {
|
|
64494
64474
|
kind: "mutation",
|
|
64495
|
-
auth: "
|
|
64475
|
+
auth: "protected",
|
|
64476
|
+
caller: "scoped"
|
|
64496
64477
|
})
|
|
64497
64478
|
}
|
|
64498
64479
|
};
|
|
@@ -88484,6 +88465,11 @@ var SendEmailResultSchema = z.object({
|
|
|
88484
88465
|
var SmtpStatusSchema = z.object({
|
|
88485
88466
|
/** True iff the addon has successfully verified the relay. */
|
|
88486
88467
|
ready: z.boolean(),
|
|
88468
|
+
/**
|
|
88469
|
+
* The tri-state behind `ready` (D315): true when the last send worked, false when it failed,
|
|
88470
|
+
* ABSENT when the relay has not sent yet (unknown, never "not verified").
|
|
88471
|
+
*/
|
|
88472
|
+
verified: z.boolean().optional(),
|
|
88487
88473
|
/** Operator-visible host string (no credentials). */
|
|
88488
88474
|
host: z.string(),
|
|
88489
88475
|
/** Last error message reported by the relay, when not ready. */
|
|
@@ -88503,13 +88489,6 @@ var smtpProviderCapability = {
|
|
|
88503
88489
|
auth: "admin",
|
|
88504
88490
|
access: "create"
|
|
88505
88491
|
}),
|
|
88506
|
-
/** Round-trip ping against the SMTP relay (EHLO + AUTH if configured).
|
|
88507
|
-
* Used by the operator's "Test connection" button. */
|
|
88508
|
-
verify: method(RelayPinSchema, SmtpStatusSchema, {
|
|
88509
|
-
kind: "mutation",
|
|
88510
|
-
auth: "admin",
|
|
88511
|
-
access: "view"
|
|
88512
|
-
}),
|
|
88513
88492
|
getStatus: method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" })
|
|
88514
88493
|
}
|
|
88515
88494
|
};
|
|
@@ -101334,13 +101313,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
101334
101313
|
access: "view",
|
|
101335
101314
|
role: "admin"
|
|
101336
101315
|
},
|
|
101337
|
-
"addonSettings.getIntegrationFormSchema": {
|
|
101338
|
-
capName: "addon-settings",
|
|
101339
|
-
capScope: "system",
|
|
101340
|
-
addonId: null,
|
|
101341
|
-
access: "view",
|
|
101342
|
-
role: "admin"
|
|
101343
|
-
},
|
|
101344
101316
|
"addonSettings.getScopedSettings": {
|
|
101345
101317
|
capName: "addon-settings",
|
|
101346
101318
|
capScope: "system",
|
|
@@ -109363,13 +109335,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
109363
109335
|
access: "create",
|
|
109364
109336
|
role: "admin"
|
|
109365
109337
|
},
|
|
109366
|
-
"smtpProvider.verify": {
|
|
109367
|
-
capName: "smtp-provider",
|
|
109368
|
-
capScope: "system",
|
|
109369
|
-
addonId: null,
|
|
109370
|
-
access: "view",
|
|
109371
|
-
role: "admin"
|
|
109372
|
-
},
|
|
109373
109338
|
"snapshot.applyDeviceSettingsPatch": {
|
|
109374
109339
|
capName: "snapshot",
|
|
109375
109340
|
capScope: "device",
|