@camstack/addon-provider-unifi 0.2.68 → 0.2.70

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 CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-BZL-fdNj.mjs
2
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -371,6 +371,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
371
371
  */
372
372
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
373
373
  /**
374
+ * Cap event fired by every device that registers the `network-link`
375
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
376
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
377
+ * reading that moved.
378
+ */
379
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
380
+ /**
374
381
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
375
382
  * "wake in progress" window — between the Baichuan wake-up issue and
376
383
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19389,6 +19396,33 @@ var RecentTracksQueryInput = object({
19389
19396
  */
19390
19397
  classes: array(string()).optional()
19391
19398
  });
19399
+ /**
19400
+ * A Summary (D359): the per-camera session envelope that references tracks.
19401
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19402
+ * served by the event-media plane by key), null until the first frame with a
19403
+ * member visible has been materialised.
19404
+ */
19405
+ var SummarySchema = object({
19406
+ id: string(),
19407
+ deviceId: number(),
19408
+ openedAt: number(),
19409
+ lastActiveAt: number(),
19410
+ sealedAt: number().nullable(),
19411
+ memberCount: number().int().nonnegative(),
19412
+ groupShotKey: string().nullable()
19413
+ });
19414
+ var SummariesQueryInput = object({
19415
+ deviceIds: array(number()).min(1),
19416
+ since: number().optional(),
19417
+ until: number().optional(),
19418
+ limit: number().int().min(1).max(200).default(50)
19419
+ });
19420
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19421
+ var SummaryDetailSchema = object({
19422
+ summary: SummarySchema,
19423
+ /** Member track ids, in absorption order. */
19424
+ trackIds: array(string()).readonly()
19425
+ });
19392
19426
  var RecentTracksPageSchema = object({
19393
19427
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19394
19428
  tracks: array(TrackSchema).readonly(),
@@ -19789,7 +19823,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19789
19823
  * timeline would read as a camera that saw nothing.
19790
19824
  */
19791
19825
  classes: array(string()).optional()
19792
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19826
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19793
19827
  kind: "mutation",
19794
19828
  auth: "admin"
19795
19829
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -23722,6 +23756,88 @@ onStatusChanged: { data: object({
23722
23756
  volatileStateFields: ["lastUpdated"]
23723
23757
  };
23724
23758
  /**
23759
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23760
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23761
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23762
+ * one Home Assistant projection.
23763
+ */
23764
+ var NetworkLinkStatusSchema = object({
23765
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23766
+ type: _enum([
23767
+ "wifi",
23768
+ "ethernet",
23769
+ "cellular",
23770
+ "unknown"
23771
+ ]),
23772
+ /**
23773
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23774
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23775
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23776
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23777
+ * SKIP a null rather than coerce it.
23778
+ */
23779
+ signalPercent: number().min(0).max(100).nullable(),
23780
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23781
+ rssiDbm: number().optional(),
23782
+ /** Network name of a wireless link, when the firmware reports it. */
23783
+ ssid: string().optional(),
23784
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23785
+ lastUpdated: number()
23786
+ });
23787
+ var networkLinkCapability = {
23788
+ name: "network-link",
23789
+ scope: "device",
23790
+ deviceNative: true,
23791
+ mode: "singleton",
23792
+ deviceTypes: [
23793
+ DeviceType.Camera,
23794
+ DeviceType.Sensor,
23795
+ DeviceType.Button,
23796
+ DeviceType.Switch,
23797
+ DeviceType.Light,
23798
+ DeviceType.Lock,
23799
+ DeviceType.Siren
23800
+ ],
23801
+ methods: {},
23802
+ events: {
23803
+ /**
23804
+ * Emitted whenever the cached status changes (a link switch, a signal
23805
+ * reading that moved). Mirrored on the parent chain by the
23806
+ * DeviceEventPropagator like `battery.onStatusChanged`.
23807
+ */
23808
+ onStatusChanged: { data: object({
23809
+ deviceId: number(),
23810
+ status: NetworkLinkStatusSchema
23811
+ }) } },
23812
+ status: {
23813
+ schema: NetworkLinkStatusSchema,
23814
+ kind: "push",
23815
+ empty: {
23816
+ type: "unknown",
23817
+ signalPercent: null,
23818
+ lastUpdated: 0
23819
+ }
23820
+ },
23821
+ /**
23822
+ * Runtime-state slice — every provider stores the same shape under
23823
+ * `device.runtimeState['network-link']`, read once by the badge and the
23824
+ * Home Assistant projector regardless of the driver.
23825
+ */
23826
+ runtimeState: NetworkLinkStatusSchema,
23827
+ /**
23828
+ * Runtime-state durability: **restored** — a link reading is slow to
23829
+ * change and a sleeping battery camera may not report for hours; the
23830
+ * restored slice is what the badge shows until the next read.
23831
+ *
23832
+ * See `RuntimeStateDurability`. Enforced by
23833
+ * `scripts/check-runtime-state-durability.ts`.
23834
+ */
23835
+ durability: "restored",
23836
+ /** Clock fields: written, but excluded from the compare that decides
23837
+ * whether persisting is worth a SQLite commit. */
23838
+ volatileStateFields: ["lastUpdated"]
23839
+ };
23840
+ /**
23725
23841
  * Generic boolean sensor — last-resort fallback when no domain-
23726
23842
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23727
23843
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32123,6 +32239,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32123
32239
  motionTrigger: motionTriggerCapability,
32124
32240
  motionZones: motionZonesCapability,
32125
32241
  nativeObjectDetection: nativeObjectDetectionCapability,
32242
+ networkLink: networkLinkCapability,
32126
32243
  notifier: notifierCapability,
32127
32244
  numericSensor: numericSensorCapability,
32128
32245
  petFeeder: petFeederCapability,
@@ -36540,6 +36657,12 @@ Object.freeze({
36540
36657
  addonId: null,
36541
36658
  access: "view"
36542
36659
  },
36660
+ "pipelineAnalytics.getSummary": {
36661
+ capName: "pipeline-analytics",
36662
+ capScope: "device",
36663
+ addonId: null,
36664
+ access: "view"
36665
+ },
36543
36666
  "pipelineAnalytics.getTrack": {
36544
36667
  capName: "pipeline-analytics",
36545
36668
  capScope: "device",
@@ -36618,6 +36741,12 @@ Object.freeze({
36618
36741
  addonId: null,
36619
36742
  access: "view"
36620
36743
  },
36744
+ "pipelineAnalytics.listSummaries": {
36745
+ capName: "pipeline-analytics",
36746
+ capScope: "device",
36747
+ addonId: null,
36748
+ access: "view"
36749
+ },
36621
36750
  "pipelineAnalytics.listTrackMedia": {
36622
36751
  capName: "pipeline-analytics",
36623
36752
  capScope: "device",
@@ -40313,6 +40442,11 @@ Object.freeze({
40313
40442
  form: "array",
40314
40443
  optional: true
40315
40444
  }],
40445
+ "pipelineAnalytics.listSummaries": [{
40446
+ name: "deviceIds",
40447
+ form: "array",
40448
+ optional: false
40449
+ }],
40316
40450
  "pipelineAnalytics.listTrackMedia": [{
40317
40451
  name: "deviceId",
40318
40452
  form: "single",
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-BZL-fdNj.mjs
1
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -370,6 +370,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
370
370
  */
371
371
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
372
372
  /**
373
+ * Cap event fired by every device that registers the `network-link`
374
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
375
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
376
+ * reading that moved.
377
+ */
378
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
379
+ /**
373
380
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
374
381
  * "wake in progress" window — between the Baichuan wake-up issue and
375
382
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19388,6 +19395,33 @@ var RecentTracksQueryInput = object({
19388
19395
  */
19389
19396
  classes: array(string()).optional()
19390
19397
  });
19398
+ /**
19399
+ * A Summary (D359): the per-camera session envelope that references tracks.
19400
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19401
+ * served by the event-media plane by key), null until the first frame with a
19402
+ * member visible has been materialised.
19403
+ */
19404
+ var SummarySchema = object({
19405
+ id: string(),
19406
+ deviceId: number(),
19407
+ openedAt: number(),
19408
+ lastActiveAt: number(),
19409
+ sealedAt: number().nullable(),
19410
+ memberCount: number().int().nonnegative(),
19411
+ groupShotKey: string().nullable()
19412
+ });
19413
+ var SummariesQueryInput = object({
19414
+ deviceIds: array(number()).min(1),
19415
+ since: number().optional(),
19416
+ until: number().optional(),
19417
+ limit: number().int().min(1).max(200).default(50)
19418
+ });
19419
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19420
+ var SummaryDetailSchema = object({
19421
+ summary: SummarySchema,
19422
+ /** Member track ids, in absorption order. */
19423
+ trackIds: array(string()).readonly()
19424
+ });
19391
19425
  var RecentTracksPageSchema = object({
19392
19426
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19393
19427
  tracks: array(TrackSchema).readonly(),
@@ -19788,7 +19822,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19788
19822
  * timeline would read as a camera that saw nothing.
19789
19823
  */
19790
19824
  classes: array(string()).optional()
19791
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
19825
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
19792
19826
  kind: "mutation",
19793
19827
  auth: "admin"
19794
19828
  }), method(DeviceEventQueryInput, array(MotionEventSchema).readonly()), method(ObjectEventQueryInput, array(ObjectEventSchema).readonly()), method(DeviceEventQueryInput, array(AudioEventSchema).readonly()), method(object({ deviceId: number() }), array(EventKindDescriptorSchema).readonly()), method(object({ deviceIds: array(number()).min(1).max(200) }), array(EventKindsForDeviceSchema).readonly()), method(object({
@@ -23721,6 +23755,88 @@ onStatusChanged: { data: object({
23721
23755
  volatileStateFields: ["lastUpdated"]
23722
23756
  };
23723
23757
  /**
23758
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
23759
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
23760
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
23761
+ * one Home Assistant projection.
23762
+ */
23763
+ var NetworkLinkStatusSchema = object({
23764
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
23765
+ type: _enum([
23766
+ "wifi",
23767
+ "ethernet",
23768
+ "cellular",
23769
+ "unknown"
23770
+ ]),
23771
+ /**
23772
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
23773
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
23774
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
23775
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
23776
+ * SKIP a null rather than coerce it.
23777
+ */
23778
+ signalPercent: number().min(0).max(100).nullable(),
23779
+ /** Raw received signal strength in dBm, when the firmware reports one. */
23780
+ rssiDbm: number().optional(),
23781
+ /** Network name of a wireless link, when the firmware reports it. */
23782
+ ssid: string().optional(),
23783
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
23784
+ lastUpdated: number()
23785
+ });
23786
+ var networkLinkCapability = {
23787
+ name: "network-link",
23788
+ scope: "device",
23789
+ deviceNative: true,
23790
+ mode: "singleton",
23791
+ deviceTypes: [
23792
+ DeviceType.Camera,
23793
+ DeviceType.Sensor,
23794
+ DeviceType.Button,
23795
+ DeviceType.Switch,
23796
+ DeviceType.Light,
23797
+ DeviceType.Lock,
23798
+ DeviceType.Siren
23799
+ ],
23800
+ methods: {},
23801
+ events: {
23802
+ /**
23803
+ * Emitted whenever the cached status changes (a link switch, a signal
23804
+ * reading that moved). Mirrored on the parent chain by the
23805
+ * DeviceEventPropagator like `battery.onStatusChanged`.
23806
+ */
23807
+ onStatusChanged: { data: object({
23808
+ deviceId: number(),
23809
+ status: NetworkLinkStatusSchema
23810
+ }) } },
23811
+ status: {
23812
+ schema: NetworkLinkStatusSchema,
23813
+ kind: "push",
23814
+ empty: {
23815
+ type: "unknown",
23816
+ signalPercent: null,
23817
+ lastUpdated: 0
23818
+ }
23819
+ },
23820
+ /**
23821
+ * Runtime-state slice — every provider stores the same shape under
23822
+ * `device.runtimeState['network-link']`, read once by the badge and the
23823
+ * Home Assistant projector regardless of the driver.
23824
+ */
23825
+ runtimeState: NetworkLinkStatusSchema,
23826
+ /**
23827
+ * Runtime-state durability: **restored** — a link reading is slow to
23828
+ * change and a sleeping battery camera may not report for hours; the
23829
+ * restored slice is what the badge shows until the next read.
23830
+ *
23831
+ * See `RuntimeStateDurability`. Enforced by
23832
+ * `scripts/check-runtime-state-durability.ts`.
23833
+ */
23834
+ durability: "restored",
23835
+ /** Clock fields: written, but excluded from the compare that decides
23836
+ * whether persisting is worth a SQLite commit. */
23837
+ volatileStateFields: ["lastUpdated"]
23838
+ };
23839
+ /**
23724
23840
  * Generic boolean sensor — last-resort fallback when no domain-
23725
23841
  * specific binary cap fits (Home Assistant `binary_sensor` without a
23726
23842
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32122,6 +32238,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32122
32238
  motionTrigger: motionTriggerCapability,
32123
32239
  motionZones: motionZonesCapability,
32124
32240
  nativeObjectDetection: nativeObjectDetectionCapability,
32241
+ networkLink: networkLinkCapability,
32125
32242
  notifier: notifierCapability,
32126
32243
  numericSensor: numericSensorCapability,
32127
32244
  petFeeder: petFeederCapability,
@@ -36539,6 +36656,12 @@ Object.freeze({
36539
36656
  addonId: null,
36540
36657
  access: "view"
36541
36658
  },
36659
+ "pipelineAnalytics.getSummary": {
36660
+ capName: "pipeline-analytics",
36661
+ capScope: "device",
36662
+ addonId: null,
36663
+ access: "view"
36664
+ },
36542
36665
  "pipelineAnalytics.getTrack": {
36543
36666
  capName: "pipeline-analytics",
36544
36667
  capScope: "device",
@@ -36617,6 +36740,12 @@ Object.freeze({
36617
36740
  addonId: null,
36618
36741
  access: "view"
36619
36742
  },
36743
+ "pipelineAnalytics.listSummaries": {
36744
+ capName: "pipeline-analytics",
36745
+ capScope: "device",
36746
+ addonId: null,
36747
+ access: "view"
36748
+ },
36620
36749
  "pipelineAnalytics.listTrackMedia": {
36621
36750
  capName: "pipeline-analytics",
36622
36751
  capScope: "device",
@@ -40312,6 +40441,11 @@ Object.freeze({
40312
40441
  form: "array",
40313
40442
  optional: true
40314
40443
  }],
40444
+ "pipelineAnalytics.listSummaries": [{
40445
+ name: "deviceIds",
40446
+ form: "array",
40447
+ optional: false
40448
+ }],
40315
40449
  "pipelineAnalytics.listTrackMedia": [{
40316
40450
  name: "deviceId",
40317
40451
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-unifi",
3
- "version": "0.2.68",
3
+ "version": "0.2.70",
4
4
  "description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
5
5
  "keywords": [
6
6
  "camstack",