@camstack/types 1.2.533 → 1.2.534
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 +23 -0
- package/dist/addon/base-addon.d.ts +1 -20
- package/dist/addon/notification-targets.d.ts +34 -9
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/addon-settings.cap.d.ts +0 -41
- package/dist/capabilities/capability-definition.d.ts +26 -2
- package/dist/capabilities/integration-instances.cap.d.ts +22 -7
- package/dist/capabilities/integrations.cap.d.ts +13 -0
- package/dist/capabilities/smtp-provider.cap.d.ts +2 -10
- package/dist/client.js +0 -7
- package/dist/client.mjs +0 -7
- package/dist/generated/addon-api.d.ts +2 -17
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/system-proxy.d.ts +1 -1
- package/dist/i18n/camstack-error.d.ts +8 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.js +206 -70
- package/dist/index.mjs +201 -70
- package/dist/interfaces/addon.d.ts +0 -6
- package/dist/{sleep-CS5Xp1iQ.mjs → sleep-CkinsFFb.mjs} +66 -95
- package/dist/{sleep-ComzlWyT.js → sleep-DhZXJtPH.js} +77 -94
- package/package.json +1 -1
- package/dist/addon/integration-instance-ref.d.ts +0 -21
package/dist/index.d.ts
CHANGED
|
@@ -11,8 +11,6 @@ export { nodeIdOfScopedKey, resolveDeviceSettings, resolvedValues, SCOPED_SETTIN
|
|
|
11
11
|
export type { DeviceSettingsLayers, ResolvedSetting, ResolvedSettings, ScopedSettings, ScopedSettingsDeclaration, ScopedSettingsScope, SettingSource, } from './addon/scoped-settings.js';
|
|
12
12
|
export { compareVersions, describeUnmet, MinVersionSchema, minimumOf, PackageRequiresSchema, RequiredAddonUpdateSchema, UnmetRequirementSchema, unmetRequirements, } from './addon/package-requires.js';
|
|
13
13
|
export type { PackageRequires, RequiredAddonUpdate, RunningVersions, RunningWrapper, UnmetRequirement, WrapperRequirementKind, } from './addon/package-requires.js';
|
|
14
|
-
export { IntegrationInstanceRefSchema } from './addon/integration-instance-ref.js';
|
|
15
|
-
export type { IntegrationInstanceRef } from './addon/integration-instance-ref.js';
|
|
16
14
|
export type { AddonRouteInvokeRequest, AddonRouteReplyEnvelope, } from './addon/build-addon-route-provider.js';
|
|
17
15
|
export { buildAddonRouteProvider } from './addon/build-addon-route-provider.js';
|
|
18
16
|
export type { BuildSessionLostAlertInput, IntegrationSessionBinding, IntegrationSessionReporterOptions, IntegrationSessionSink, SessionAlertAction, SessionHealthAlertsPort, SessionHealthTrackerOptions, SessionLossReason, SessionLostInfo, } from './addon/session-health.js';
|
|
@@ -379,7 +377,7 @@ export { EVENT_KIND_LABEL_KEYS, EVENT_KIND_LABELS, eventKindLabel, isEventKindLa
|
|
|
379
377
|
export type { CatalogFile, CatalogLang, CatalogLookup, TranslationParams, } from './i18n/translation.js';
|
|
380
378
|
export { CATALOG_LANGS, CatalogFileSchema, CatalogLangSchema, DEFAULT_CATALOG_LANG, interpolate, localizeConfigTree, splitTranslationRef, } from './i18n/translation.js';
|
|
381
379
|
export type { ErrorI18nPayload } from './i18n/camstack-error.js';
|
|
382
|
-
export { CamstackError, ErrorCodeSchema, ErrorI18nPayloadSchema, readErrorI18n, userError, } from './i18n/camstack-error.js';
|
|
380
|
+
export { CamstackError, ErrorCodeSchema, ErrorI18nPayloadSchema, FORBIDDEN_MESSAGE_PREFIX, forbiddenError, readErrorI18n, userError, } from './i18n/camstack-error.js';
|
|
383
381
|
export { assertTimelapseCadences, DEFAULT_TIMELAPSE_PREVIEW_TEXT, readTimelapseGeneratedAt, TIMELAPSE_DENSE_FLOOR_SEC, TimelapseRuleInputSchema, TimelapseRulePatchSchema, TimelapseRuleSchema, TimelapseTemplateSchema, } from './notification/timelapse-rule.js';
|
|
384
382
|
export { CLUSTER_MODEL_SCOPED_STEPS, CLUSTER_MODEL_SECTION_ID, CLUSTER_STEP_SETTING_FIELDS, type ClusterModelScopedStep, type ClusterStepModels, type ClusterStepSettingField, type ClusterStepSettings, clusterModelSettingKey, clusterStepSettingFieldsFor, clusterStepSettingKey, DEFAULT_CLUSTER_STEP_MODELS, DEFAULT_CLUSTER_STEP_SETTINGS, DEFAULT_MIN_LANDMARK_FACE_SIZE_PX, type HydratedClusterSection, type HydratedClusterView, interpretStoredClusterModel, type InvalidClusterStepModelEntry, invalidClusterStepModelEntries, isClusterScopedStep, overlayClusterStepSettings, pickClusterStepModels, pickClusterStepSettings, pickInvalidClusterStepModels, readClusterStepModels, readClusterStepSettings, resolveClusterStepModelId, type StepModelScope, type StoredClusterModelInterpretation, } from './pipeline/cluster-model-scope.js';
|
|
385
383
|
export { CAMERA_SENSORS_NOT_LOADED, CAMERA_SENSORS_SETTINGS_KEY, CAMERA_TRIGGER, type CameraSensorAttachment, CameraSensorAttachmentSchema, type CameraSensorRef, CameraSensorRefSchema, cameraSensorRefKey, type CameraSensorsConfig, CameraSensorsConfigSchema, type CameraOwnMotion, CameraOwnMotionSchema, type CameraRawLevel, CameraRawLevelSchema, type CameraSensorEntry, CameraSensorEntrySchema, type CameraSensorMode, CameraSensorModeSchema, type CameraSensorsNotEnforced, CameraSensorsNotEnforcedSchema, type CameraSensorsNotForwarded, CameraSensorsNotForwardedSchema, type CameraSensorsStatus, CameraSensorsStatusSchema, DEFAULT_CAMERA_SENSOR_MODE, MAX_CAMERA_SENSORS, type MotionTriggeredBy, type MotionTriggeredByReading, MotionTriggeredBySchema, readMotionTriggeredBy, } from './pipeline/camera-sensors.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_sleep = require("./sleep-
|
|
2
|
+
const require_sleep = require("./sleep-DhZXJtPH.js");
|
|
3
3
|
const require_event_category = require("./event-category-BC4RRerT.js");
|
|
4
4
|
const require_device_type = require("./device-type-BaYa0UGS.js");
|
|
5
5
|
const require_composition = require("./composition-BjHGoicU.js");
|
|
@@ -410,27 +410,6 @@ function describeUnmet(unmet) {
|
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
412
|
//#endregion
|
|
413
|
-
//#region src/addon/integration-instance-ref.ts
|
|
414
|
-
/**
|
|
415
|
-
* Which integration instance a settings form is for. An addon that serves several instances
|
|
416
|
-
* (`instanceMode: multiple`) can show a different form per instance — an NVR integration
|
|
417
|
-
* needs its connection, the default integration needs the addon's own sections.
|
|
418
|
-
*
|
|
419
|
-
* - `integrationId` is `null` in the create wizard: nothing exists yet, the operator is
|
|
420
|
-
* setting up a NEW instance.
|
|
421
|
-
* - `mode` is the wizard mode of the integration type (`getAvailableTypes`).
|
|
422
|
-
* - `candidateStableId` is the discovery candidate a wizard was seeded from, if any.
|
|
423
|
-
*/
|
|
424
|
-
var IntegrationInstanceRefSchema = zod.z.object({
|
|
425
|
-
integrationId: zod.z.string().nullable(),
|
|
426
|
-
mode: zod.z.enum([
|
|
427
|
-
"standalone",
|
|
428
|
-
"account",
|
|
429
|
-
"broker"
|
|
430
|
-
]),
|
|
431
|
-
candidateStableId: zod.z.string().optional()
|
|
432
|
-
});
|
|
433
|
-
//#endregion
|
|
434
413
|
//#region src/addon/build-addon-route-provider.ts
|
|
435
414
|
/**
|
|
436
415
|
* Build an `IAddonRouteProvider` from a list of routes. Implements
|
|
@@ -875,8 +854,8 @@ function composeInstanceKinds(parts, base) {
|
|
|
875
854
|
instanceFormSchema: async ({ id, kind }) => {
|
|
876
855
|
return (id === null ? byKind(kind) : await holderOf(id)).provider.instanceFormSchema({ id });
|
|
877
856
|
},
|
|
878
|
-
listInstances: async () => {
|
|
879
|
-
return (await Promise.all(parts.map(async (part) => (await part.provider.listInstances()).map((instance) => tagged(part, instance))))).flat();
|
|
857
|
+
listInstances: async (input) => {
|
|
858
|
+
return (await Promise.all(parts.map(async (part) => (await part.provider.listInstances(input)).map((instance) => tagged(part, instance))))).flat();
|
|
880
859
|
},
|
|
881
860
|
getInstance: async ({ id }) => {
|
|
882
861
|
for (const part of parts) {
|
|
@@ -1678,6 +1657,105 @@ function notificationTargetParts(records, spec) {
|
|
|
1678
1657
|
}];
|
|
1679
1658
|
});
|
|
1680
1659
|
}
|
|
1660
|
+
/** The body key that names the user a PERSONAL target belongs to (the open blob, no schema change). */
|
|
1661
|
+
var TARGET_OWNER_KEY = "ownerUserId";
|
|
1662
|
+
/**
|
|
1663
|
+
* The authorisation of a target as the instance door sees it. An admin (and an in-process caller
|
|
1664
|
+
* that holds no session) keeps the admin door: every target, any change. A user sees and changes
|
|
1665
|
+
* only the targets whose `ownerUserId` is theirs, and a target with no owner (a global target the
|
|
1666
|
+
* operator made) is nobody's. Nothing a client sends moves the owner of a user's target: the
|
|
1667
|
+
* server stamps it from the caller.
|
|
1668
|
+
*/
|
|
1669
|
+
function scopeInstancesToCaller(inner, logger) {
|
|
1670
|
+
const ownerOf = (instance) => instance.formValues[TARGET_OWNER_KEY];
|
|
1671
|
+
const owned = (instance, userId) => instance !== null && ownerOf(instance) === userId;
|
|
1672
|
+
const requireOwned = async (id, userId) => {
|
|
1673
|
+
if (!owned(await inner.getInstance({ id }), userId)) throw require_sleep.forbiddenError(`target not owned: ${id}`);
|
|
1674
|
+
};
|
|
1675
|
+
/** The user's own values: whatever the client sent for the owner is dropped and re-stamped. */
|
|
1676
|
+
const stamped = (values, userId) => ({
|
|
1677
|
+
...values,
|
|
1678
|
+
[TARGET_OWNER_KEY]: userId
|
|
1679
|
+
});
|
|
1680
|
+
const userOnly = (caller) => caller !== void 0 && !caller.isAdmin ? caller : void 0;
|
|
1681
|
+
const test = inner.testInstance?.bind(inner);
|
|
1682
|
+
return {
|
|
1683
|
+
...inner,
|
|
1684
|
+
describe: async () => ({
|
|
1685
|
+
...await inner.describe(),
|
|
1686
|
+
userScoped: true
|
|
1687
|
+
}),
|
|
1688
|
+
listInstances: async (input) => {
|
|
1689
|
+
const all = await inner.listInstances(input);
|
|
1690
|
+
const user = input?.["mine"] === true ? input.caller : userOnly(input?.caller);
|
|
1691
|
+
return user === void 0 ? all : all.filter((instance) => owned(instance, user.userId));
|
|
1692
|
+
},
|
|
1693
|
+
getInstance: async (input) => {
|
|
1694
|
+
const found = await inner.getInstance(input);
|
|
1695
|
+
const user = userOnly(input.caller);
|
|
1696
|
+
return user === void 0 || owned(found, user.userId) ? found : null;
|
|
1697
|
+
},
|
|
1698
|
+
createInstance: async (input) => {
|
|
1699
|
+
const user = userOnly(input.caller);
|
|
1700
|
+
if (user === void 0) return inner.createInstance(input);
|
|
1701
|
+
const { id: _id, seed: _seed, ...rest } = input;
|
|
1702
|
+
const created = await inner.createInstance({
|
|
1703
|
+
...rest,
|
|
1704
|
+
values: stamped(input.values, user.userId)
|
|
1705
|
+
});
|
|
1706
|
+
logger.info("notification target created", { meta: {
|
|
1707
|
+
targetId: created.id,
|
|
1708
|
+
owner: user.userId
|
|
1709
|
+
} });
|
|
1710
|
+
return created;
|
|
1711
|
+
},
|
|
1712
|
+
updateInstance: async (input) => {
|
|
1713
|
+
const user = userOnly(input.caller);
|
|
1714
|
+
if (user === void 0) return inner.updateInstance(input);
|
|
1715
|
+
await requireOwned(input.id, user.userId);
|
|
1716
|
+
const updated = await inner.updateInstance({
|
|
1717
|
+
...input,
|
|
1718
|
+
values: stamped(input.values, user.userId)
|
|
1719
|
+
});
|
|
1720
|
+
logger.info("notification target updated", { meta: {
|
|
1721
|
+
targetId: input.id,
|
|
1722
|
+
owner: user.userId
|
|
1723
|
+
} });
|
|
1724
|
+
return updated;
|
|
1725
|
+
},
|
|
1726
|
+
setInstanceEnabled: async (input) => {
|
|
1727
|
+
const user = userOnly(input.caller);
|
|
1728
|
+
if (user === void 0) return inner.setInstanceEnabled(input);
|
|
1729
|
+
await requireOwned(input.id, user.userId);
|
|
1730
|
+
const switched = await inner.setInstanceEnabled(input);
|
|
1731
|
+
logger.info("notification target switched", { meta: {
|
|
1732
|
+
targetId: input.id,
|
|
1733
|
+
owner: user.userId,
|
|
1734
|
+
enabled: input.enabled
|
|
1735
|
+
} });
|
|
1736
|
+
return switched;
|
|
1737
|
+
},
|
|
1738
|
+
deleteInstance: async (input) => {
|
|
1739
|
+
const user = userOnly(input.caller);
|
|
1740
|
+
if (user === void 0) return inner.deleteInstance(input);
|
|
1741
|
+
await requireOwned(input.id, user.userId);
|
|
1742
|
+
const deleted = await inner.deleteInstance(input);
|
|
1743
|
+
logger.info("notification target deleted", { meta: {
|
|
1744
|
+
targetId: input.id,
|
|
1745
|
+
owner: user.userId
|
|
1746
|
+
} });
|
|
1747
|
+
return deleted;
|
|
1748
|
+
},
|
|
1749
|
+
...test === void 0 ? {} : { testInstance: async (input) => {
|
|
1750
|
+
const user = userOnly(input.caller);
|
|
1751
|
+
if (user !== void 0) {
|
|
1752
|
+
if (input.id === null) throw require_sleep.forbiddenError("a draft target is tested by an admin");
|
|
1753
|
+
await requireOwned(input.id, user.userId);
|
|
1754
|
+
}
|
|
1755
|
+
return test(input);
|
|
1756
|
+
} }
|
|
1757
|
+
};
|
|
1758
|
+
}
|
|
1681
1759
|
/** The `integration-instances` provider of a notification provider: one kind per target kind. */
|
|
1682
1760
|
function buildNotificationTargetInstances(records, spec) {
|
|
1683
1761
|
const parts = notificationTargetParts(records, spec);
|
|
@@ -1689,6 +1767,13 @@ function buildNotificationTargetInstances(records, spec) {
|
|
|
1689
1767
|
mintsId: true
|
|
1690
1768
|
});
|
|
1691
1769
|
}
|
|
1770
|
+
/**
|
|
1771
|
+
* The same provider, for a notification provider whose targets belong to users (the notifiers
|
|
1772
|
+
* addon): `describe().userScoped`, and every row filtered on the caller.
|
|
1773
|
+
*/
|
|
1774
|
+
function buildUserScopedNotificationTargetInstances(records, spec, logger) {
|
|
1775
|
+
return scopeInstancesToCaller(buildNotificationTargetInstances(records, spec), logger);
|
|
1776
|
+
}
|
|
1692
1777
|
/** The secret keys of a kind's body: the descriptor's `password` fields (top level). */
|
|
1693
1778
|
function secretKeysOf(descriptor) {
|
|
1694
1779
|
const { shape } = fieldsOf$1(descriptor);
|
|
@@ -1700,11 +1785,14 @@ function secretKeysOf(descriptor) {
|
|
|
1700
1785
|
/**
|
|
1701
1786
|
* Move every old row to the record of its kind under the SAME id: the config flat beside the name and
|
|
1702
1787
|
* the switch, each secret written to the keychain by the door and READ BACK before the old row goes.
|
|
1703
|
-
* One bad row never aborts the others: a row whose write or read-back fails (or disagrees) is undone
|
|
1704
|
-
*
|
|
1705
|
-
*
|
|
1706
|
-
*
|
|
1707
|
-
*
|
|
1788
|
+
* One bad row never aborts the others: a row whose write or read-back fails (or disagrees) is undone
|
|
1789
|
+
* and its old row stays where it was, still served by the store through its legacy source. A row of a
|
|
1790
|
+
* kind this provider does not serve is left alone the same way (`skipped`, nothing to retry).
|
|
1791
|
+
* Idempotent: a row the new kind already holds equal is only dropped from the old kind.
|
|
1792
|
+
*
|
|
1793
|
+
* A row that FAILED makes the run throw, after every other row was tried: the ledger then records
|
|
1794
|
+
* `failed`, not `applied`, and the migration runs again on the next boot until each row has moved.
|
|
1795
|
+
* Reporting `done` over a row that merely failed once would leave it in the retired kind for good.
|
|
1708
1796
|
*/
|
|
1709
1797
|
async function moveTargetRows(ports, secretKeysByKind) {
|
|
1710
1798
|
const rows = await ports.listOld();
|
|
@@ -1714,6 +1802,7 @@ async function moveTargetRows(ports, secretKeysByKind) {
|
|
|
1714
1802
|
};
|
|
1715
1803
|
let converted = 0;
|
|
1716
1804
|
let skipped = 0;
|
|
1805
|
+
const failed = [];
|
|
1717
1806
|
for (const row of rows) {
|
|
1718
1807
|
if (!ports.hasKind(row.kind)) {
|
|
1719
1808
|
skipped += 1;
|
|
@@ -1727,7 +1816,7 @@ async function moveTargetRows(ports, secretKeysByKind) {
|
|
|
1727
1816
|
const reason = await moveOne(ports, row, secretKeysByKind(row.kind));
|
|
1728
1817
|
if (reason === null) converted += 1;
|
|
1729
1818
|
else {
|
|
1730
|
-
|
|
1819
|
+
failed.push(`${row.id} (${reason})`);
|
|
1731
1820
|
ports.skipped({
|
|
1732
1821
|
id: row.id,
|
|
1733
1822
|
kind: row.kind,
|
|
@@ -1735,6 +1824,7 @@ async function moveTargetRows(ports, secretKeysByKind) {
|
|
|
1735
1824
|
});
|
|
1736
1825
|
}
|
|
1737
1826
|
}
|
|
1827
|
+
if (failed.length > 0) throw new Error(`${failed.length} notification target(s) did not move and stay served from the retired kind; the migration runs again: ${failed.join(", ")}`);
|
|
1738
1828
|
return {
|
|
1739
1829
|
outcome: converted > 0 ? "done" : "already-done",
|
|
1740
1830
|
summary: {
|
|
@@ -1790,6 +1880,25 @@ function legacyTargetsOver(oldKind, logger) {
|
|
|
1790
1880
|
}
|
|
1791
1881
|
};
|
|
1792
1882
|
}
|
|
1883
|
+
/**
|
|
1884
|
+
* The retired kind as a lazy legacy source: it is declared on the store's first list (or delete),
|
|
1885
|
+
* on every boot, not only while the migration runs, so a row the migration could not move stays
|
|
1886
|
+
* visible through `legacy` and readable.
|
|
1887
|
+
*/
|
|
1888
|
+
function retiredTargetsOver(records, retired, logger) {
|
|
1889
|
+
let source = null;
|
|
1890
|
+
const open = async () => {
|
|
1891
|
+
if (source === null) {
|
|
1892
|
+
await records.declare({ [retired.name]: retired });
|
|
1893
|
+
source = legacyTargetsOver(records.kind(retired), logger);
|
|
1894
|
+
}
|
|
1895
|
+
return source;
|
|
1896
|
+
};
|
|
1897
|
+
return {
|
|
1898
|
+
list: async () => (await open()).list(),
|
|
1899
|
+
delete: async (id) => (await open()).delete(id)
|
|
1900
|
+
};
|
|
1901
|
+
}
|
|
1793
1902
|
/** The ports over the records: the retired kind in, the per-kind records out. */
|
|
1794
1903
|
function targetRowPortsOver(deps) {
|
|
1795
1904
|
const handles = deps.store.handlesByKind();
|
|
@@ -1808,7 +1917,7 @@ function targetRowPortsOver(deps) {
|
|
|
1808
1917
|
},
|
|
1809
1918
|
dropOld: (id) => deps.legacy.delete(id),
|
|
1810
1919
|
skipped: (row) => {
|
|
1811
|
-
deps.logger.warn("notification target left in its
|
|
1920
|
+
deps.logger.warn("notification target left in its retired kind", { meta: {
|
|
1812
1921
|
targetId: row.id,
|
|
1813
1922
|
kind: row.kind,
|
|
1814
1923
|
reason: row.reason
|
|
@@ -36724,11 +36833,6 @@ var addonSettingsCapability = {
|
|
|
36724
36833
|
scope: ScopedSettingsScopeSchema,
|
|
36725
36834
|
nodeId: zod.z.string().optional()
|
|
36726
36835
|
}), zod.z.record(zod.z.string(), zod.z.unknown()).nullable()),
|
|
36727
|
-
getIntegrationFormSchema: require_sleep.method(zod.z.object({
|
|
36728
|
-
addonId: zod.z.string(),
|
|
36729
|
-
nodeId: zod.z.string().optional(),
|
|
36730
|
-
instance: IntegrationInstanceRefSchema
|
|
36731
|
-
}), SettingsSchemaWithValuesSchema.nullable()),
|
|
36732
36836
|
getDeclaredSettingsKeys: require_sleep.method(zod.z.object({
|
|
36733
36837
|
addonId: zod.z.string(),
|
|
36734
36838
|
nodeId: zod.z.string().optional()
|
|
@@ -56064,6 +56168,12 @@ var IntegrationWithStateSchema = zod.z.object({
|
|
|
56064
56168
|
name: zod.z.string(),
|
|
56065
56169
|
/** A projection of the instance body's switch (`setInstanceEnabled` is the only writer). */
|
|
56066
56170
|
enabled: zod.z.boolean(),
|
|
56171
|
+
/**
|
|
56172
|
+
* True when the addon that holds the switch did not answer (down, failed, or keeps no record for
|
|
56173
|
+
* this row): `enabled` is then the stored registry flag, a stale value, not the state. A reader
|
|
56174
|
+
* must not draw it as on or off (D315).
|
|
56175
|
+
*/
|
|
56176
|
+
switchUnknown: zod.z.literal(true).optional(),
|
|
56067
56177
|
info: zod.z.record(zod.z.string(), zod.z.unknown()).readonly(),
|
|
56068
56178
|
/** The discovery candidate this integration was set up from (D984). */
|
|
56069
56179
|
originStableId: zod.z.string().optional(),
|
|
@@ -56077,6 +56187,12 @@ var IntegrationLiteSchema = zod.z.object({
|
|
|
56077
56187
|
name: zod.z.string(),
|
|
56078
56188
|
/** A projection of the instance body's switch (`setInstanceEnabled` is the only writer). */
|
|
56079
56189
|
enabled: zod.z.boolean(),
|
|
56190
|
+
/**
|
|
56191
|
+
* True when the addon that holds the switch did not answer (down, failed, or keeps no record for
|
|
56192
|
+
* this row): `enabled` is then the stored registry flag, a stale value, not the state. A reader
|
|
56193
|
+
* must not draw it as on or off (D315).
|
|
56194
|
+
*/
|
|
56195
|
+
switchUnknown: zod.z.literal(true).optional(),
|
|
56080
56196
|
info: zod.z.record(zod.z.string(), zod.z.unknown()).readonly(),
|
|
56081
56197
|
/** The discovery candidate this integration was set up from (D984). */
|
|
56082
56198
|
originStableId: zod.z.string().optional(),
|
|
@@ -56175,9 +56291,9 @@ var UpdateIntegrationInputSchema = zod.z.object({
|
|
|
56175
56291
|
id: zod.z.string(),
|
|
56176
56292
|
name: zod.z.string().optional(),
|
|
56177
56293
|
/**
|
|
56178
|
-
*
|
|
56179
|
-
*
|
|
56180
|
-
*
|
|
56294
|
+
* Honoured ONLY for a fixed builtin (`info.fixed`), whose switch is the hub's own registry flag
|
|
56295
|
+
* and works while its addon is down. Any other row is refused (a typed `BAD_REQUEST`): its
|
|
56296
|
+
* switch is `integration-instances.setInstanceEnabled`.
|
|
56181
56297
|
*/
|
|
56182
56298
|
enabled: zod.z.boolean().optional(),
|
|
56183
56299
|
info: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
@@ -56198,6 +56314,13 @@ var integrationsCapability = {
|
|
|
56198
56314
|
kind: "mutation",
|
|
56199
56315
|
auth: "admin"
|
|
56200
56316
|
}),
|
|
56317
|
+
/**
|
|
56318
|
+
* Delete an integration from the hub side: its devices, its registry row and its record, and
|
|
56319
|
+
* announce it. It works while the addon that owns the instance is down (installed but
|
|
56320
|
+
* crashed), where `integration-instances.deleteInstance` has no provider to route to; with the
|
|
56321
|
+
* provider up the record is removed through it as well. A fixed builtin and an instance a link
|
|
56322
|
+
* names are refused first.
|
|
56323
|
+
*/
|
|
56201
56324
|
delete: require_sleep.method(zod.z.object({ id: zod.z.string() }), DeleteIntegrationResultSchema, {
|
|
56202
56325
|
kind: "mutation",
|
|
56203
56326
|
auth: "admin"
|
|
@@ -56227,6 +56350,12 @@ var integrationsCapability = {
|
|
|
56227
56350
|
* the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
|
|
56228
56351
|
* or the redaction token KEEPS the stored secret; `{ $secretClear: true }`
|
|
56229
56352
|
* clears it.
|
|
56353
|
+
*
|
|
56354
|
+
* Who may call (epic #440): every method but `describe` and `instanceFormSchema` is open to any
|
|
56355
|
+
* session (`caller: 'scoped'`) and default-denies. An admin passes everywhere. A non-admin passes
|
|
56356
|
+
* only on a call pinned to one addon whose `describe().userScoped` is true, and that provider
|
|
56357
|
+
* filters every row on the `caller` the router injected (a notification target is somebody's
|
|
56358
|
+
* phone: a user sees and changes only their own). An addon that says nothing keeps the admin door.
|
|
56230
56359
|
*/
|
|
56231
56360
|
var ConfigSchemaPassthrough$2 = zod.z.custom();
|
|
56232
56361
|
var IntegrationInstanceIdSchema = zod.z.string().min(1);
|
|
@@ -56340,7 +56469,15 @@ var IntegrationInstanceDescriptionSchema = zod.z.object({
|
|
|
56340
56469
|
*/
|
|
56341
56470
|
mintsId: zod.z.boolean().optional(),
|
|
56342
56471
|
/** The links to other instances the provider's kinds declare; absent means none. */
|
|
56343
|
-
links: zod.z.array(IntegrationInstanceLinkSchema).optional()
|
|
56472
|
+
links: zod.z.array(IntegrationInstanceLinkSchema).optional(),
|
|
56473
|
+
/**
|
|
56474
|
+
* The rows belong to individual users (a notification target is somebody's phone). The router
|
|
56475
|
+
* then opens `listInstances`, `getInstance`, `createInstance`, `updateInstance`,
|
|
56476
|
+
* `setInstanceEnabled`, `deleteInstance` and `testInstance` to a NON-admin session on a call
|
|
56477
|
+
* pinned to this addon, and hands the provider the `caller` so it keeps a user to their own rows.
|
|
56478
|
+
* Absent means admin only, as it always was.
|
|
56479
|
+
*/
|
|
56480
|
+
userScoped: zod.z.boolean().optional()
|
|
56344
56481
|
});
|
|
56345
56482
|
var IntegrationInstanceStatusSchema = zod.z.object({
|
|
56346
56483
|
state: zod.z.enum([
|
|
@@ -56398,8 +56535,14 @@ var integrationInstancesCapability = {
|
|
|
56398
56535
|
/** The discovery candidate the wizard was seeded from (`stableId`), if any. */
|
|
56399
56536
|
candidateStableId: zod.z.string().min(1).optional()
|
|
56400
56537
|
}), ConfigSchemaPassthrough$2, { auth: "admin" }),
|
|
56401
|
-
listInstances: require_sleep.method(zod.z.
|
|
56402
|
-
|
|
56538
|
+
listInstances: require_sleep.method(zod.z.looseObject({}), zod.z.array(IntegrationInstanceSchema).readonly(), {
|
|
56539
|
+
auth: "protected",
|
|
56540
|
+
caller: "scoped"
|
|
56541
|
+
}),
|
|
56542
|
+
getInstance: require_sleep.method(zod.z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), {
|
|
56543
|
+
auth: "protected",
|
|
56544
|
+
caller: "scoped"
|
|
56545
|
+
}),
|
|
56403
56546
|
/**
|
|
56404
56547
|
* Insert the typed record. With `id` it is stored under that id (a duplicate id is refused);
|
|
56405
56548
|
* without one the PROVIDER mints it and answers it. `kind` picks one of `describe().kinds`.
|
|
@@ -56432,11 +56575,13 @@ var integrationInstancesCapability = {
|
|
|
56432
56575
|
seed: zod.z.object({ info: zod.z.record(zod.z.string(), zod.z.unknown()) }).optional()
|
|
56433
56576
|
}), zod.z.object({ id: zod.z.string() }), {
|
|
56434
56577
|
kind: "mutation",
|
|
56435
|
-
auth: "
|
|
56578
|
+
auth: "protected",
|
|
56579
|
+
caller: "scoped"
|
|
56436
56580
|
}),
|
|
56437
56581
|
updateInstance: require_sleep.method(IntegrationInstancePatchSchema, zod.z.object({ ok: zod.z.literal(true) }), {
|
|
56438
56582
|
kind: "mutation",
|
|
56439
|
-
auth: "
|
|
56583
|
+
auth: "protected",
|
|
56584
|
+
caller: "scoped"
|
|
56440
56585
|
}),
|
|
56441
56586
|
/**
|
|
56442
56587
|
* Switch ONE instance on or off, for every role; a missing record is created from the addon's
|
|
@@ -56448,7 +56593,8 @@ var integrationInstancesCapability = {
|
|
|
56448
56593
|
enabled: zod.z.boolean()
|
|
56449
56594
|
}), zod.z.object({ ok: zod.z.literal(true) }), {
|
|
56450
56595
|
kind: "mutation",
|
|
56451
|
-
auth: "
|
|
56596
|
+
auth: "protected",
|
|
56597
|
+
caller: "scoped"
|
|
56452
56598
|
}),
|
|
56453
56599
|
/**
|
|
56454
56600
|
* Delete the record and its keychain refs together. For an instance that brings devices the hub
|
|
@@ -56457,7 +56603,8 @@ var integrationInstancesCapability = {
|
|
|
56457
56603
|
*/
|
|
56458
56604
|
deleteInstance: require_sleep.method(zod.z.object({ id: IntegrationInstanceIdSchema }), zod.z.object({ ok: zod.z.literal(true) }), {
|
|
56459
56605
|
kind: "mutation",
|
|
56460
|
-
auth: "
|
|
56606
|
+
auth: "protected",
|
|
56607
|
+
caller: "scoped"
|
|
56461
56608
|
}),
|
|
56462
56609
|
testInstance: require_sleep.optionalMethod(zod.z.object({
|
|
56463
56610
|
id: IntegrationInstanceIdSchema.nullable(),
|
|
@@ -56466,7 +56613,8 @@ var integrationInstancesCapability = {
|
|
|
56466
56613
|
kind: zod.z.string().min(1).optional()
|
|
56467
56614
|
}), TestConnectionResultSchema, {
|
|
56468
56615
|
kind: "mutation",
|
|
56469
|
-
auth: "
|
|
56616
|
+
auth: "protected",
|
|
56617
|
+
caller: "scoped"
|
|
56470
56618
|
})
|
|
56471
56619
|
}
|
|
56472
56620
|
};
|
|
@@ -83829,6 +83977,11 @@ var SendEmailResultSchema = zod.z.object({
|
|
|
83829
83977
|
var SmtpStatusSchema = zod.z.object({
|
|
83830
83978
|
/** True iff the addon has successfully verified the relay. */
|
|
83831
83979
|
ready: zod.z.boolean(),
|
|
83980
|
+
/**
|
|
83981
|
+
* The tri-state behind `ready` (D315): true when the last send worked, false when it failed,
|
|
83982
|
+
* ABSENT when the relay has not sent yet (unknown, never "not verified").
|
|
83983
|
+
*/
|
|
83984
|
+
verified: zod.z.boolean().optional(),
|
|
83832
83985
|
/** Operator-visible host string (no credentials). */
|
|
83833
83986
|
host: zod.z.string(),
|
|
83834
83987
|
/** Last error message reported by the relay, when not ready. */
|
|
@@ -83848,13 +84001,6 @@ var smtpProviderCapability = {
|
|
|
83848
84001
|
auth: "admin",
|
|
83849
84002
|
access: "create"
|
|
83850
84003
|
}),
|
|
83851
|
-
/** Round-trip ping against the SMTP relay (EHLO + AUTH if configured).
|
|
83852
|
-
* Used by the operator's "Test connection" button. */
|
|
83853
|
-
verify: require_sleep.method(RelayPinSchema, SmtpStatusSchema, {
|
|
83854
|
-
kind: "mutation",
|
|
83855
|
-
auth: "admin",
|
|
83856
|
-
access: "view"
|
|
83857
|
-
}),
|
|
83858
84004
|
getStatus: require_sleep.method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" })
|
|
83859
84005
|
}
|
|
83860
84006
|
};
|
|
@@ -104117,13 +104263,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
104117
104263
|
access: "view",
|
|
104118
104264
|
role: "admin"
|
|
104119
104265
|
},
|
|
104120
|
-
"addonSettings.getIntegrationFormSchema": {
|
|
104121
|
-
capName: "addon-settings",
|
|
104122
|
-
capScope: "system",
|
|
104123
|
-
addonId: null,
|
|
104124
|
-
access: "view",
|
|
104125
|
-
role: "admin"
|
|
104126
|
-
},
|
|
104127
104266
|
"addonSettings.getScopedSettings": {
|
|
104128
104267
|
capName: "addon-settings",
|
|
104129
104268
|
capScope: "system",
|
|
@@ -112146,13 +112285,6 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
112146
112285
|
access: "create",
|
|
112147
112286
|
role: "admin"
|
|
112148
112287
|
},
|
|
112149
|
-
"smtpProvider.verify": {
|
|
112150
|
-
capName: "smtp-provider",
|
|
112151
|
-
capScope: "system",
|
|
112152
|
-
addonId: null,
|
|
112153
|
-
access: "view",
|
|
112154
|
-
role: "admin"
|
|
112155
|
-
},
|
|
112156
112288
|
"snapshot.applyDeviceSettingsPatch": {
|
|
112157
112289
|
capName: "snapshot",
|
|
112158
112290
|
capScope: "device",
|
|
@@ -120658,7 +120790,6 @@ function createSystemProxy(api) {
|
|
|
120658
120790
|
listScopedSettings: (input) => dispatch("addonSettings", "listScopedSettings", "query", input),
|
|
120659
120791
|
updateScopedSettings: (input) => dispatch("addonSettings", "updateScopedSettings", "mutation", input),
|
|
120660
120792
|
readScopedValues: (input) => dispatch("addonSettings", "readScopedValues", "query", input),
|
|
120661
|
-
getIntegrationFormSchema: (input) => dispatch("addonSettings", "getIntegrationFormSchema", "query", input),
|
|
120662
120793
|
getDeclaredSettingsKeys: (input) => dispatch("addonSettings", "getDeclaredSettingsKeys", "query", input),
|
|
120663
120794
|
unsetStoredSettingsKeys: (input) => dispatch("addonSettings", "unsetStoredSettingsKeys", "mutation", input)
|
|
120664
120795
|
},
|
|
@@ -133914,6 +134045,7 @@ exports.FEEDER_EXAMPLE_HA_DEVICE_ID = FEEDER_EXAMPLE_HA_DEVICE_ID;
|
|
|
133914
134045
|
exports.FEW_SHOT_COUNT = FEW_SHOT_COUNT;
|
|
133915
134046
|
exports.FFMPEG_PATH_ENV = require_composition.FFMPEG_PATH_ENV;
|
|
133916
134047
|
exports.FIRST_LEVEL_MACRO_CLASSES = FIRST_LEVEL_MACRO_CLASSES;
|
|
134048
|
+
exports.FORBIDDEN_MESSAGE_PREFIX = require_sleep.FORBIDDEN_MESSAGE_PREFIX;
|
|
133917
134049
|
exports.FORWARD_INPUT_KEY = require_composition.FORWARD_INPUT_KEY;
|
|
133918
134050
|
exports.FULL_IMAGE_BBOX = FULL_IMAGE_BBOX;
|
|
133919
134051
|
exports.FailureContributionSchema = FailureContributionSchema;
|
|
@@ -134054,7 +134186,6 @@ exports.IntegrationInstanceKindSchema = IntegrationInstanceKindSchema;
|
|
|
134054
134186
|
exports.IntegrationInstanceLinkSchema = IntegrationInstanceLinkSchema;
|
|
134055
134187
|
exports.IntegrationInstanceModeSchema = IntegrationInstanceModeSchema;
|
|
134056
134188
|
exports.IntegrationInstancePatchSchema = IntegrationInstancePatchSchema;
|
|
134057
|
-
exports.IntegrationInstanceRefSchema = IntegrationInstanceRefSchema;
|
|
134058
134189
|
exports.IntegrationInstanceRoleSchema = IntegrationInstanceRoleSchema;
|
|
134059
134190
|
exports.IntegrationInstanceSchema = IntegrationInstanceSchema;
|
|
134060
134191
|
exports.IntegrationInstanceStatusSchema = IntegrationInstanceStatusSchema;
|
|
@@ -135313,6 +135444,7 @@ exports.SwitchStatusSchema = SwitchStatusSchema;
|
|
|
135313
135444
|
exports.SystemHeldSecretNameSchema = SystemHeldSecretNameSchema;
|
|
135314
135445
|
exports.SystemMetricsSchema = SystemMetricsSchema;
|
|
135315
135446
|
exports.SystemMirror = SystemMirror;
|
|
135447
|
+
exports.TARGET_OWNER_KEY = TARGET_OWNER_KEY;
|
|
135316
135448
|
exports.TEMPLATE_KINDS = TEMPLATE_KINDS;
|
|
135317
135449
|
exports.TEMPLATE_PAYLOAD_SCHEMAS = TEMPLATE_PAYLOAD_SCHEMAS;
|
|
135318
135450
|
exports.TEMPLATE_WRITE_REFUSALS = TEMPLATE_WRITE_REFUSALS;
|
|
@@ -135659,6 +135791,7 @@ exports.buildStepArgsTrace = buildStepArgsTrace;
|
|
|
135659
135791
|
exports.buildStreamParamsConfigSchema = buildStreamParamsConfigSchema;
|
|
135660
135792
|
exports.buildSubjectPath = buildSubjectPath;
|
|
135661
135793
|
exports.buildTriggerTrace = buildTriggerTrace;
|
|
135794
|
+
exports.buildUserScopedNotificationTargetInstances = buildUserScopedNotificationTargetInstances;
|
|
135662
135795
|
exports.buildVideoArgs = require_composition.buildVideoArgs;
|
|
135663
135796
|
exports.buildViewerLink = buildViewerLink;
|
|
135664
135797
|
exports.buildVocabularySlice = buildVocabularySlice;
|
|
@@ -136010,6 +136143,7 @@ exports.floodCapability = floodCapability;
|
|
|
136010
136143
|
exports.foldSnapshotByFunction = foldSnapshotByFunction;
|
|
136011
136144
|
exports.followSwitchRunningFeature = followSwitchRunningFeature;
|
|
136012
136145
|
exports.forEachLeaf = forEachLeaf;
|
|
136146
|
+
exports.forbiddenError = require_sleep.forbiddenError;
|
|
136013
136147
|
exports.foreignCapacityCells = foreignCapacityCells;
|
|
136014
136148
|
exports.forgetKnownSecret = require_sleep.forgetKnownSecret;
|
|
136015
136149
|
exports.formatDeviceRevoker = formatDeviceRevoker;
|
|
@@ -136599,6 +136733,7 @@ exports.resolveViewableDeviceIds = resolveViewableDeviceIds;
|
|
|
136599
136733
|
exports.resolvedValues = require_sleep.resolvedValues;
|
|
136600
136734
|
exports.resultCellKey = resultCellKey;
|
|
136601
136735
|
exports.resultStandings = resultStandings;
|
|
136736
|
+
exports.retiredTargetsOver = retiredTargetsOver;
|
|
136602
136737
|
exports.retrainBoxIou = retrainBoxIou;
|
|
136603
136738
|
exports.retrainRevisionConflictMessage = retrainRevisionConflictMessage;
|
|
136604
136739
|
exports.rewriteLoginProxyBody = rewriteBody;
|
|
@@ -136651,6 +136786,7 @@ exports.scheduleForSendTimes = scheduleForSendTimes;
|
|
|
136651
136786
|
exports.schedulersCapability = schedulersCapability;
|
|
136652
136787
|
exports.schemaDeclaresAnyField = require_sleep.schemaDeclaresAnyField;
|
|
136653
136788
|
exports.scopeInherits = scopeInherits;
|
|
136789
|
+
exports.scopeInstancesToCaller = scopeInstancesToCaller;
|
|
136654
136790
|
exports.scopeKey = require_sleep.scopeKey;
|
|
136655
136791
|
exports.scopesAllowAddon = scopesAllowAddon;
|
|
136656
136792
|
exports.scopesAllowAddonRoutes = scopesAllowAddonRoutes;
|