@camstack/types 1.2.65 → 1.2.66
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/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/capabilities/air-quality-sensor.cap.d.ts +10 -0
- package/dist/capabilities/alarm-panel.cap.d.ts +10 -0
- package/dist/capabilities/ambient-light-sensor.cap.d.ts +10 -0
- package/dist/capabilities/audio-metrics.cap.d.ts +7 -0
- package/dist/capabilities/automation-control.cap.d.ts +7 -0
- package/dist/capabilities/battery.cap.d.ts +10 -0
- package/dist/capabilities/binary.cap.d.ts +10 -0
- package/dist/capabilities/brightness.cap.d.ts +7 -0
- package/dist/capabilities/camera-streams.cap.d.ts +7 -0
- package/dist/capabilities/capability-definition.d.ts +58 -0
- package/dist/capabilities/carbon-monoxide.cap.d.ts +10 -0
- package/dist/capabilities/climate-control.cap.d.ts +7 -0
- package/dist/capabilities/color.cap.d.ts +7 -0
- package/dist/capabilities/connectivity.cap.d.ts +10 -0
- package/dist/capabilities/consumables.cap.d.ts +7 -0
- package/dist/capabilities/contact.cap.d.ts +10 -0
- package/dist/capabilities/control.cap.d.ts +7 -0
- package/dist/capabilities/cover.cap.d.ts +10 -0
- package/dist/capabilities/day-night.cap.d.ts +10 -0
- package/dist/capabilities/device-discovery.cap.d.ts +7 -0
- package/dist/capabilities/device-status.cap.d.ts +10 -0
- package/dist/capabilities/doorbell.cap.d.ts +7 -0
- package/dist/capabilities/enum-sensor.cap.d.ts +10 -0
- package/dist/capabilities/event-emitter.cap.d.ts +7 -0
- package/dist/capabilities/fan-control.cap.d.ts +7 -0
- package/dist/capabilities/feature-probe.cap.d.ts +7 -0
- package/dist/capabilities/flood.cap.d.ts +10 -0
- package/dist/capabilities/gas.cap.d.ts +10 -0
- package/dist/capabilities/humidifier.cap.d.ts +7 -0
- package/dist/capabilities/humidity-sensor.cap.d.ts +10 -0
- package/dist/capabilities/image-settings.cap.d.ts +10 -0
- package/dist/capabilities/image.cap.d.ts +7 -0
- package/dist/capabilities/index.d.ts +3 -3
- package/dist/capabilities/lawn-mower-control.cap.d.ts +7 -0
- package/dist/capabilities/lock-control.cap.d.ts +10 -0
- package/dist/capabilities/media-player.cap.d.ts +7 -0
- package/dist/capabilities/motion-trigger.cap.d.ts +7 -0
- package/dist/capabilities/motion-zones.cap.d.ts +10 -0
- package/dist/capabilities/motion.cap.d.ts +7 -0
- package/dist/capabilities/native-object-detection.cap.d.ts +10 -0
- package/dist/capabilities/notification-output.cap.d.ts +16 -0
- package/dist/capabilities/notification-rules.cap.d.ts +35 -3
- package/dist/capabilities/notifier.cap.d.ts +7 -0
- package/dist/capabilities/numeric-sensor.cap.d.ts +10 -0
- package/dist/capabilities/osd-manager.cap.d.ts +2 -0
- package/dist/capabilities/pet-feeder.cap.d.ts +7 -0
- package/dist/capabilities/power-meter.cap.d.ts +10 -0
- package/dist/capabilities/presence.cap.d.ts +10 -0
- package/dist/capabilities/pressure-sensor.cap.d.ts +10 -0
- package/dist/capabilities/privacy-mask.cap.d.ts +10 -0
- package/dist/capabilities/ptz-autotrack.cap.d.ts +7 -0
- package/dist/capabilities/scene-monitor.cap.d.ts +7 -0
- package/dist/capabilities/script-runner.cap.d.ts +7 -0
- package/dist/capabilities/smoke.cap.d.ts +10 -0
- package/dist/capabilities/stream-params.cap.d.ts +10 -0
- package/dist/capabilities/switch.cap.d.ts +10 -0
- package/dist/capabilities/tamper.cap.d.ts +10 -0
- package/dist/capabilities/temperature-sensor.cap.d.ts +10 -0
- package/dist/capabilities/update.cap.d.ts +7 -0
- package/dist/capabilities/vacuum-control.cap.d.ts +7 -0
- package/dist/capabilities/valve.cap.d.ts +7 -0
- package/dist/capabilities/vibration.cap.d.ts +10 -0
- package/dist/capabilities/water-heater.cap.d.ts +7 -0
- package/dist/capabilities/weather.cap.d.ts +7 -0
- package/dist/capabilities/zone-analytics.cap.d.ts +7 -0
- package/dist/capabilities/zone-rules.cap.d.ts +7 -0
- package/dist/capabilities/zones.cap.d.ts +7 -0
- package/dist/generated/runtime-state-durability.d.ts +31 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1189 -72
- package/dist/index.mjs +1168 -73
- package/dist/notification/audio-condition.d.ts +118 -0
- package/dist/{sleep-BxjBLp3L.mjs → sleep-CSgK0rNX.mjs} +3 -1
- package/dist/{sleep-BszXLEvP.js → sleep-Dh1EJSqF.js} +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* audio-condition — the authoring logic behind the sustained-sound condition
|
|
3
|
+
* (`NcConditions.audio`), pure and UI-framework-free.
|
|
4
|
+
*
|
|
5
|
+
* WHY IT LIVES HERE
|
|
6
|
+
* ─────────────────
|
|
7
|
+
* Same reason as `condition-taxonomy.ts` next door: two editors author this
|
|
8
|
+
* condition (the admin UI and the viewer), the vocabulary it offers is already
|
|
9
|
+
* in this package (`AUDIO_MACRO_LABELS`), and a second copy of "what a cleared
|
|
10
|
+
* threshold writes" is a mirror free to drift. The viewer keeps its own copy
|
|
11
|
+
* because it is a separate app with its own toolchain; every surface that CAN
|
|
12
|
+
* import `@camstack/types` uses this one.
|
|
13
|
+
*
|
|
14
|
+
* Four behaviours here are not cosmetic:
|
|
15
|
+
*
|
|
16
|
+
* 1. **dBFS is negative-going.** `0` is full scale; digital silence reads
|
|
17
|
+
* {@link NC_AUDIO_DBFS_FLOOR}. A control that let an operator author `60`
|
|
18
|
+
* meaning "loud" would write a threshold no sample can reach, and the rule
|
|
19
|
+
* would look broken rather than mis-configured. Every write is clamped.
|
|
20
|
+
* 2. **Neither filter given = the engine REFUSES.** With no level floor and no
|
|
21
|
+
* labels every sample is trivially a hit, so the window would fire on
|
|
22
|
+
* silence. {@link audioIsFailClosed} is how an editor says that BEFORE the
|
|
23
|
+
* save instead of shipping a rule that never notifies and never says why.
|
|
24
|
+
* 3. **Both label spellings are the same label.** The hub's taxonomy serves
|
|
25
|
+
* `audio-dog`; the macro catalog and an operator both say `dog`, and the
|
|
26
|
+
* matcher normalizes the prefix away on both sides. Selection therefore
|
|
27
|
+
* compares NORMALIZED ids — a rule authored in the admin UI must not read
|
|
28
|
+
* as "nothing selected" on the phone.
|
|
29
|
+
* 4. **A stored label the build does not know stays visible.** It is offered
|
|
30
|
+
* as an explicitly-unknown, removable choice, never silently dropped:
|
|
31
|
+
* rewriting the rule the operator is looking at is worse than showing a
|
|
32
|
+
* stale id.
|
|
33
|
+
*/
|
|
34
|
+
import { type NcAudioCondition } from '../capabilities/notification-rules.cap.js';
|
|
35
|
+
import type { NcTaxonomy } from '../catalogs/nc-taxonomy.js';
|
|
36
|
+
/** Strip the taxonomy's `audio-` namespace: `audio-dog` and `dog` are one label. */
|
|
37
|
+
export declare function normalizeAudioLabel(value: string): string;
|
|
38
|
+
/** Level bounds, in dBFS. Negative-going: the ceiling is full scale. */
|
|
39
|
+
export declare const NC_AUDIO_DB_MIN = -96;
|
|
40
|
+
export declare const NC_AUDIO_DB_MAX = 0;
|
|
41
|
+
/** Step of the level control — 3 dB is one perceptual notch, not one unit. */
|
|
42
|
+
export declare const NC_AUDIO_DB_STEP = 3;
|
|
43
|
+
/**
|
|
44
|
+
* Offered when the operator turns the level filter ON. NOT a schema default:
|
|
45
|
+
* an absent `dbThreshold` means "any level" and stays absent until asked for,
|
|
46
|
+
* and a stepper seeded at the -96 floor would need thirty taps to reach a
|
|
47
|
+
* threshold that can actually fire.
|
|
48
|
+
*/
|
|
49
|
+
export declare const NC_AUDIO_DB_OFFERED = -30;
|
|
50
|
+
export declare const NC_AUDIO_HIT_PERCENT_MIN = 1;
|
|
51
|
+
export declare const NC_AUDIO_HIT_PERCENT_MAX = 100;
|
|
52
|
+
export declare const NC_AUDIO_SAMPLING_MIN_SEC = 1;
|
|
53
|
+
export declare const NC_AUDIO_SAMPLING_MAX_SEC = 300;
|
|
54
|
+
/** Schema defaults — an untouched sub-field must author exactly these. */
|
|
55
|
+
export declare const NC_AUDIO_DEFAULTS: NcAudioCondition;
|
|
56
|
+
/** What an editor SHOWS for an unset condition — without authoring it. */
|
|
57
|
+
export declare function audioOrDefaults(value: NcAudioCondition | undefined): NcAudioCondition;
|
|
58
|
+
/**
|
|
59
|
+
* True when the condition names NEITHER a level floor NOR any label. The engine
|
|
60
|
+
* refuses such a rule (every sample is a hit, so the window fires on silence) —
|
|
61
|
+
* an editor warns instead of letting the operator ship a rule that never
|
|
62
|
+
* notifies and says nothing about why.
|
|
63
|
+
*
|
|
64
|
+
* An ABSENT condition is not flagged: a rule with no `audio` key is not an
|
|
65
|
+
* audio rule at all.
|
|
66
|
+
*/
|
|
67
|
+
export declare function audioIsFailClosed(value: NcAudioCondition | undefined): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* A patch over the composite condition. A key present with `undefined` CLEARS
|
|
70
|
+
* the (optional) filter; an absent key leaves it alone.
|
|
71
|
+
*/
|
|
72
|
+
export interface NcAudioPatch {
|
|
73
|
+
readonly labels?: readonly string[] | undefined;
|
|
74
|
+
readonly dbThreshold?: number | undefined;
|
|
75
|
+
readonly hitPercent?: number;
|
|
76
|
+
readonly samplingSeconds?: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Apply a sub-field edit, seeding from the defaults when nothing is stored yet.
|
|
80
|
+
* The result is always in-bounds for `NcAudioConditionSchema`, and a cleared
|
|
81
|
+
* filter is OMITTED rather than written as an explicit `undefined` (which
|
|
82
|
+
* survives a merge patch as a deliberate erase and reads as authored).
|
|
83
|
+
*/
|
|
84
|
+
export declare function patchAudio(current: NcAudioCondition | undefined, patch: NcAudioPatch): NcAudioCondition;
|
|
85
|
+
/**
|
|
86
|
+
* One offered label. `unknown` = stored by the rule, offered by neither the hub
|
|
87
|
+
* nor the local catalog — kept so the operator can SEE it and drop it.
|
|
88
|
+
*/
|
|
89
|
+
export interface NcAudioLabelChoice {
|
|
90
|
+
readonly value: string;
|
|
91
|
+
readonly label: string;
|
|
92
|
+
readonly icon: string;
|
|
93
|
+
readonly unknown: boolean;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The label choices: the hub's `audioKinds` when it serves them (its WORDS, the
|
|
97
|
+
* local EMOJI, keyed by the normalized id), else the local macro catalog — plus
|
|
98
|
+
* any stored label neither side knows, marked unknown.
|
|
99
|
+
*
|
|
100
|
+
* The hub's list wins on membership because it knows which macros this cluster
|
|
101
|
+
* actually classifies; the icons stay local because the taxonomy carries none.
|
|
102
|
+
*/
|
|
103
|
+
export declare function audioLabelChoices(taxonomy: NcTaxonomy | undefined, selected: readonly string[] | undefined): {
|
|
104
|
+
readonly choices: readonly NcAudioLabelChoice[];
|
|
105
|
+
readonly unknownLabels: readonly string[];
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Is this macro id selected? Compares NORMALIZED ids, so a rule authored with
|
|
109
|
+
* the taxonomy spelling (`audio-dog`) reads as selected here.
|
|
110
|
+
*/
|
|
111
|
+
export declare function isAudioLabelSelected(labels: readonly string[] | undefined, id: string): boolean;
|
|
112
|
+
/**
|
|
113
|
+
* Toggle one macro id. Removing drops EVERY stored spelling of it; adding
|
|
114
|
+
* appends the bare macro id. Returns `undefined` when the last label goes — the
|
|
115
|
+
* field is optional and absent means "any sound", never an empty array (which
|
|
116
|
+
* `NcAudioConditionSchema` rejects outright).
|
|
117
|
+
*/
|
|
118
|
+
export declare function toggleAudioLabel(labels: readonly string[] | undefined, id: string): readonly string[] | undefined;
|
|
@@ -2004,6 +2004,8 @@ function readNodePin(context) {
|
|
|
2004
2004
|
* 4. Addon implements IProvider
|
|
2005
2005
|
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
2006
2006
|
*/
|
|
2007
|
+
/** The default applied to a `runtimeState` cap that declares no `durability`. */
|
|
2008
|
+
var DEFAULT_RUNTIME_STATE_DURABILITY = "session";
|
|
2007
2009
|
/**
|
|
2008
2010
|
* Resolve the EFFECTIVE mount hint for a cap — the explicit `mount` when
|
|
2009
2011
|
* present, else the scope/mode/deviceNative-derived default. Single source
|
|
@@ -3735,4 +3737,4 @@ function sleepCancellable(ms, signal) {
|
|
|
3735
3737
|
});
|
|
3736
3738
|
}
|
|
3737
3739
|
//#endregion
|
|
3738
|
-
export {
|
|
3740
|
+
export { FrameHandleFormatSchema as $, isDeviceConfigCap as A, emitDownForOwnedCaps as B, DeviceType as C, WELL_KNOWN_TAB_MAP as Ct, DEVICE_STATUS_METHOD as D, resolveHydratedFieldValue as Dt, DEVICE_SETTINGS_CONTRIBUTION_METHODS as E, hydrateSchema as Et, nodePin as F, CAM_PROFILE_ORDER as G, scopeKey as H, readNodePin as I, CamStreamResolutionSchema as J, CamProfileSchema as K, toNodeId as L, resolveCapMount as M, systemMethod as N, event as O, CAP_NODE_PIN_CONTEXT_KEY as P, EncodedPacketSchema as Q, ReadinessRegistry as R, DeviceRole as S, WELL_KNOWN_TABS as St, DEFAULT_RUNTIME_STATE_DURABILITY as T, collectHydratedFieldValues as Tt, BrokerStatsSchema as U, readinessKey as V, BrokerStatusSchema as W, DecodedAudioChunkSchema as X, CameraStreamSchema as Y, DecodedFrameSchema as Z, RawStateResultSchema as _, normalizeAddonInitResult as _t, asJsonObject as a, StreamSourceSchema as at, ChargingStatus as b, emitReadiness as bt, parseJsonArray as c, SubscribeFramesInputSchema as ct, DEVICE_SCOPED_CAPS as d, makeSourceBrokerId as dt, FrameHandleSchema as et, isDeviceScopedCap as f, parseProfileBrokerId as ft, createSliceHandle as g, BaseAddon as gt, createMirrorSource as h, DisposerChain as ht, asJsonArray as i, StreamSourceEntrySchema$1 as it, method as j, expandCapMethods as k, parseJsonObject as l, SubscribeFramesResultSchema as lt, createLazyTrpcSource as m, DATAPLANE_SECRET_HEADER as mt, sleepCancellable as n, ProfileSlotSchema as nt, asNumber as o, SubscribeAudioChunksInputSchema as ot, createDeviceProxy as p, selectAssignedProfileSlots as pt, CamStreamKindSchema as q, asBoolean as r, ProfileSlotStatusSchema as rt, asString as s, SubscribeAudioChunksResultSchema as st, sleep as t, ProfileRtspEntrySchema as tt, parseJsonUnknown as u, makeProfileBrokerId as ut, deviceOpsCapability as v, createDurableState as vt, adminUiCapability as w, collectHydratedFieldEntries as wt, DeviceFeature as x, isEvent as xt, viewerUiCapability as y, createEvent as yt, ReadinessTimeoutError as z };
|
|
@@ -2004,6 +2004,8 @@ function readNodePin(context) {
|
|
|
2004
2004
|
* 4. Addon implements IProvider
|
|
2005
2005
|
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
2006
2006
|
*/
|
|
2007
|
+
/** The default applied to a `runtimeState` cap that declares no `durability`. */
|
|
2008
|
+
var DEFAULT_RUNTIME_STATE_DURABILITY = "session";
|
|
2007
2009
|
/**
|
|
2008
2010
|
* Resolve the EFFECTIVE mount hint for a cap — the explicit `mount` when
|
|
2009
2011
|
* present, else the scope/mode/deviceNative-derived default. Single source
|
|
@@ -3801,6 +3803,12 @@ Object.defineProperty(exports, "DATAPLANE_SECRET_HEADER", {
|
|
|
3801
3803
|
return DATAPLANE_SECRET_HEADER;
|
|
3802
3804
|
}
|
|
3803
3805
|
});
|
|
3806
|
+
Object.defineProperty(exports, "DEFAULT_RUNTIME_STATE_DURABILITY", {
|
|
3807
|
+
enumerable: true,
|
|
3808
|
+
get: function() {
|
|
3809
|
+
return DEFAULT_RUNTIME_STATE_DURABILITY;
|
|
3810
|
+
}
|
|
3811
|
+
});
|
|
3804
3812
|
Object.defineProperty(exports, "DEVICE_SCOPED_CAPS", {
|
|
3805
3813
|
enumerable: true,
|
|
3806
3814
|
get: function() {
|