@camstack/addon-provider-hikvision 1.2.76 → 1.2.78

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
@@ -6,7 +6,7 @@ let node_crypto = require("node:crypto");
6
6
  let node_http = require("node:http");
7
7
  let node_https = require("node:https");
8
8
  let node_os = require("node:os");
9
- //#region ../types/dist/event-category-BZL-fdNj.mjs
9
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
10
10
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
11
11
  EventCategory["SystemBoot"] = "system.boot";
12
12
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -378,6 +378,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
378
378
  */
379
379
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
380
380
  /**
381
+ * Cap event fired by every device that registers the `network-link`
382
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
383
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
384
+ * reading that moved.
385
+ */
386
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
387
+ /**
381
388
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
382
389
  * "wake in progress" window — between the Baichuan wake-up issue and
383
390
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19696,6 +19703,33 @@ var RecentTracksQueryInput = object({
19696
19703
  */
19697
19704
  classes: array(string()).optional()
19698
19705
  });
19706
+ /**
19707
+ * A Summary (D359): the per-camera session envelope that references tracks.
19708
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19709
+ * served by the event-media plane by key), null until the first frame with a
19710
+ * member visible has been materialised.
19711
+ */
19712
+ var SummarySchema = object({
19713
+ id: string(),
19714
+ deviceId: number(),
19715
+ openedAt: number(),
19716
+ lastActiveAt: number(),
19717
+ sealedAt: number().nullable(),
19718
+ memberCount: number().int().nonnegative(),
19719
+ groupShotKey: string().nullable()
19720
+ });
19721
+ var SummariesQueryInput = object({
19722
+ deviceIds: array(number()).min(1),
19723
+ since: number().optional(),
19724
+ until: number().optional(),
19725
+ limit: number().int().min(1).max(200).default(50)
19726
+ });
19727
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19728
+ var SummaryDetailSchema = object({
19729
+ summary: SummarySchema,
19730
+ /** Member track ids, in absorption order. */
19731
+ trackIds: array(string()).readonly()
19732
+ });
19699
19733
  var RecentTracksPageSchema = object({
19700
19734
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19701
19735
  tracks: array(TrackSchema).readonly(),
@@ -20096,7 +20130,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20096
20130
  * timeline would read as a camera that saw nothing.
20097
20131
  */
20098
20132
  classes: array(string()).optional()
20099
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
20133
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
20100
20134
  kind: "mutation",
20101
20135
  auth: "admin"
20102
20136
  }), 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({
@@ -24133,6 +24167,88 @@ onStatusChanged: { data: object({
24133
24167
  volatileStateFields: ["lastUpdated"]
24134
24168
  };
24135
24169
  /**
24170
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24171
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24172
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24173
+ * one Home Assistant projection.
24174
+ */
24175
+ var NetworkLinkStatusSchema = object({
24176
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24177
+ type: _enum([
24178
+ "wifi",
24179
+ "ethernet",
24180
+ "cellular",
24181
+ "unknown"
24182
+ ]),
24183
+ /**
24184
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24185
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24186
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24187
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24188
+ * SKIP a null rather than coerce it.
24189
+ */
24190
+ signalPercent: number().min(0).max(100).nullable(),
24191
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24192
+ rssiDbm: number().optional(),
24193
+ /** Network name of a wireless link, when the firmware reports it. */
24194
+ ssid: string().optional(),
24195
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24196
+ lastUpdated: number()
24197
+ });
24198
+ var networkLinkCapability = {
24199
+ name: "network-link",
24200
+ scope: "device",
24201
+ deviceNative: true,
24202
+ mode: "singleton",
24203
+ deviceTypes: [
24204
+ DeviceType.Camera,
24205
+ DeviceType.Sensor,
24206
+ DeviceType.Button,
24207
+ DeviceType.Switch,
24208
+ DeviceType.Light,
24209
+ DeviceType.Lock,
24210
+ DeviceType.Siren
24211
+ ],
24212
+ methods: {},
24213
+ events: {
24214
+ /**
24215
+ * Emitted whenever the cached status changes (a link switch, a signal
24216
+ * reading that moved). Mirrored on the parent chain by the
24217
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24218
+ */
24219
+ onStatusChanged: { data: object({
24220
+ deviceId: number(),
24221
+ status: NetworkLinkStatusSchema
24222
+ }) } },
24223
+ status: {
24224
+ schema: NetworkLinkStatusSchema,
24225
+ kind: "push",
24226
+ empty: {
24227
+ type: "unknown",
24228
+ signalPercent: null,
24229
+ lastUpdated: 0
24230
+ }
24231
+ },
24232
+ /**
24233
+ * Runtime-state slice — every provider stores the same shape under
24234
+ * `device.runtimeState['network-link']`, read once by the badge and the
24235
+ * Home Assistant projector regardless of the driver.
24236
+ */
24237
+ runtimeState: NetworkLinkStatusSchema,
24238
+ /**
24239
+ * Runtime-state durability: **restored** — a link reading is slow to
24240
+ * change and a sleeping battery camera may not report for hours; the
24241
+ * restored slice is what the badge shows until the next read.
24242
+ *
24243
+ * See `RuntimeStateDurability`. Enforced by
24244
+ * `scripts/check-runtime-state-durability.ts`.
24245
+ */
24246
+ durability: "restored",
24247
+ /** Clock fields: written, but excluded from the compare that decides
24248
+ * whether persisting is worth a SQLite commit. */
24249
+ volatileStateFields: ["lastUpdated"]
24250
+ };
24251
+ /**
24136
24252
  * Generic boolean sensor — last-resort fallback when no domain-
24137
24253
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24138
24254
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32863,6 +32979,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32863
32979
  motionTrigger: motionTriggerCapability,
32864
32980
  motionZones: motionZonesCapability,
32865
32981
  nativeObjectDetection: nativeObjectDetectionCapability,
32982
+ networkLink: networkLinkCapability,
32866
32983
  notifier: notifierCapability,
32867
32984
  numericSensor: numericSensorCapability,
32868
32985
  petFeeder: petFeederCapability,
@@ -37498,6 +37615,12 @@ Object.freeze({
37498
37615
  addonId: null,
37499
37616
  access: "view"
37500
37617
  },
37618
+ "pipelineAnalytics.getSummary": {
37619
+ capName: "pipeline-analytics",
37620
+ capScope: "device",
37621
+ addonId: null,
37622
+ access: "view"
37623
+ },
37501
37624
  "pipelineAnalytics.getTrack": {
37502
37625
  capName: "pipeline-analytics",
37503
37626
  capScope: "device",
@@ -37576,6 +37699,12 @@ Object.freeze({
37576
37699
  addonId: null,
37577
37700
  access: "view"
37578
37701
  },
37702
+ "pipelineAnalytics.listSummaries": {
37703
+ capName: "pipeline-analytics",
37704
+ capScope: "device",
37705
+ addonId: null,
37706
+ access: "view"
37707
+ },
37579
37708
  "pipelineAnalytics.listTrackMedia": {
37580
37709
  capName: "pipeline-analytics",
37581
37710
  capScope: "device",
@@ -41271,6 +41400,11 @@ Object.freeze({
41271
41400
  form: "array",
41272
41401
  optional: true
41273
41402
  }],
41403
+ "pipelineAnalytics.listSummaries": [{
41404
+ name: "deviceIds",
41405
+ form: "array",
41406
+ optional: false
41407
+ }],
41274
41408
  "pipelineAnalytics.listTrackMedia": [{
41275
41409
  name: "deviceId",
41276
41410
  form: "single",
package/dist/addon.mjs CHANGED
@@ -7,7 +7,7 @@ import { networkInterfaces } from "node:os";
7
7
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
8
8
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
9
9
  //#endregion
10
- //#region ../types/dist/event-category-BZL-fdNj.mjs
10
+ //#region ../types/dist/event-category-zAv7pMUz.mjs
11
11
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
12
12
  EventCategory["SystemBoot"] = "system.boot";
13
13
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -379,6 +379,13 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
379
379
  */
380
380
  EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
381
381
  /**
382
+ * Cap event fired by every device that registers the `network-link`
383
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
384
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
385
+ * reading that moved.
386
+ */
387
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
388
+ /**
382
389
  * Emitted by the battery cap provider WHEN `wakeForStream` enters the
383
390
  * "wake in progress" window — between the Baichuan wake-up issue and
384
391
  * the camera's first dialed-back RTP packet. The stream-broker
@@ -19697,6 +19704,33 @@ var RecentTracksQueryInput = object({
19697
19704
  */
19698
19705
  classes: array(string()).optional()
19699
19706
  });
19707
+ /**
19708
+ * A Summary (D359): the per-camera session envelope that references tracks.
19709
+ * `groupShotKey` is the media key of its group shot (`ownerKind: 'summary'`,
19710
+ * served by the event-media plane by key), null until the first frame with a
19711
+ * member visible has been materialised.
19712
+ */
19713
+ var SummarySchema = object({
19714
+ id: string(),
19715
+ deviceId: number(),
19716
+ openedAt: number(),
19717
+ lastActiveAt: number(),
19718
+ sealedAt: number().nullable(),
19719
+ memberCount: number().int().nonnegative(),
19720
+ groupShotKey: string().nullable()
19721
+ });
19722
+ var SummariesQueryInput = object({
19723
+ deviceIds: array(number()).min(1),
19724
+ since: number().optional(),
19725
+ until: number().optional(),
19726
+ limit: number().int().min(1).max(200).default(50)
19727
+ });
19728
+ var SummariesPageSchema = object({ summaries: array(SummarySchema).readonly() });
19729
+ var SummaryDetailSchema = object({
19730
+ summary: SummarySchema,
19731
+ /** Member track ids, in absorption order. */
19732
+ trackIds: array(string()).readonly()
19733
+ });
19700
19734
  var RecentTracksPageSchema = object({
19701
19735
  /** Merged page, ordered by (`lastSeen` DESC, `trackId` DESC). */
19702
19736
  tracks: array(TrackSchema).readonly(),
@@ -20097,7 +20131,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20097
20131
  * timeline would read as a camera that saw nothing.
20098
20132
  */
20099
20133
  classes: array(string()).optional()
20100
- }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(object({ deviceId: number() }), _void(), {
20134
+ }), array(TrackSchema).readonly()), method(RecentTracksQueryInput, RecentTracksPageSchema), method(SummariesQueryInput, SummariesPageSchema), method(object({ id: string() }), SummaryDetailSchema.nullable()), method(object({ deviceId: number() }), _void(), {
20101
20135
  kind: "mutation",
20102
20136
  auth: "admin"
20103
20137
  }), 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({
@@ -24134,6 +24168,88 @@ onStatusChanged: { data: object({
24134
24168
  volatileStateFields: ["lastUpdated"]
24135
24169
  };
24136
24170
  /**
24171
+ * Network-link snapshot. Same shape for every provider (a Reolink wifi
24172
+ * camera, a Home Assistant device with a signal-strength sensor, a Tapo
24173
+ * plug): one slice under `device.runtimeState['network-link']`, one badge,
24174
+ * one Home Assistant projection.
24175
+ */
24176
+ var NetworkLinkStatusSchema = object({
24177
+ /** The link the device is on. `'unknown'` = not read yet, not "no link". */
24178
+ type: _enum([
24179
+ "wifi",
24180
+ "ethernet",
24181
+ "cellular",
24182
+ "unknown"
24183
+ ]),
24184
+ /**
24185
+ * Link quality, 0..100 inclusive, normalised by the provider from whatever
24186
+ * the firmware reports (bars, RSSI, a vendor scale). **`null` means NOT
24187
+ * KNOWN or NOT APPLICABLE** — a wired link has no signal, and a wireless
24188
+ * one whose reading has not landed must not be drawn at 0 %. Consumers
24189
+ * SKIP a null rather than coerce it.
24190
+ */
24191
+ signalPercent: number().min(0).max(100).nullable(),
24192
+ /** Raw received signal strength in dBm, when the firmware reports one. */
24193
+ rssiDbm: number().optional(),
24194
+ /** Network name of a wireless link, when the firmware reports it. */
24195
+ ssid: string().optional(),
24196
+ /** Ms epoch of the last observation. Lets consumers reason about freshness. */
24197
+ lastUpdated: number()
24198
+ });
24199
+ var networkLinkCapability = {
24200
+ name: "network-link",
24201
+ scope: "device",
24202
+ deviceNative: true,
24203
+ mode: "singleton",
24204
+ deviceTypes: [
24205
+ DeviceType.Camera,
24206
+ DeviceType.Sensor,
24207
+ DeviceType.Button,
24208
+ DeviceType.Switch,
24209
+ DeviceType.Light,
24210
+ DeviceType.Lock,
24211
+ DeviceType.Siren
24212
+ ],
24213
+ methods: {},
24214
+ events: {
24215
+ /**
24216
+ * Emitted whenever the cached status changes (a link switch, a signal
24217
+ * reading that moved). Mirrored on the parent chain by the
24218
+ * DeviceEventPropagator like `battery.onStatusChanged`.
24219
+ */
24220
+ onStatusChanged: { data: object({
24221
+ deviceId: number(),
24222
+ status: NetworkLinkStatusSchema
24223
+ }) } },
24224
+ status: {
24225
+ schema: NetworkLinkStatusSchema,
24226
+ kind: "push",
24227
+ empty: {
24228
+ type: "unknown",
24229
+ signalPercent: null,
24230
+ lastUpdated: 0
24231
+ }
24232
+ },
24233
+ /**
24234
+ * Runtime-state slice — every provider stores the same shape under
24235
+ * `device.runtimeState['network-link']`, read once by the badge and the
24236
+ * Home Assistant projector regardless of the driver.
24237
+ */
24238
+ runtimeState: NetworkLinkStatusSchema,
24239
+ /**
24240
+ * Runtime-state durability: **restored** — a link reading is slow to
24241
+ * change and a sleeping battery camera may not report for hours; the
24242
+ * restored slice is what the badge shows until the next read.
24243
+ *
24244
+ * See `RuntimeStateDurability`. Enforced by
24245
+ * `scripts/check-runtime-state-durability.ts`.
24246
+ */
24247
+ durability: "restored",
24248
+ /** Clock fields: written, but excluded from the compare that decides
24249
+ * whether persisting is worth a SQLite commit. */
24250
+ volatileStateFields: ["lastUpdated"]
24251
+ };
24252
+ /**
24137
24253
  * Generic boolean sensor — last-resort fallback when no domain-
24138
24254
  * specific binary cap fits (Home Assistant `binary_sensor` without a
24139
24255
  * known `device_class`, or a domain we haven't typed yet). Pure
@@ -32864,6 +32980,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
32864
32980
  motionTrigger: motionTriggerCapability,
32865
32981
  motionZones: motionZonesCapability,
32866
32982
  nativeObjectDetection: nativeObjectDetectionCapability,
32983
+ networkLink: networkLinkCapability,
32867
32984
  notifier: notifierCapability,
32868
32985
  numericSensor: numericSensorCapability,
32869
32986
  petFeeder: petFeederCapability,
@@ -37499,6 +37616,12 @@ Object.freeze({
37499
37616
  addonId: null,
37500
37617
  access: "view"
37501
37618
  },
37619
+ "pipelineAnalytics.getSummary": {
37620
+ capName: "pipeline-analytics",
37621
+ capScope: "device",
37622
+ addonId: null,
37623
+ access: "view"
37624
+ },
37502
37625
  "pipelineAnalytics.getTrack": {
37503
37626
  capName: "pipeline-analytics",
37504
37627
  capScope: "device",
@@ -37577,6 +37700,12 @@ Object.freeze({
37577
37700
  addonId: null,
37578
37701
  access: "view"
37579
37702
  },
37703
+ "pipelineAnalytics.listSummaries": {
37704
+ capName: "pipeline-analytics",
37705
+ capScope: "device",
37706
+ addonId: null,
37707
+ access: "view"
37708
+ },
37580
37709
  "pipelineAnalytics.listTrackMedia": {
37581
37710
  capName: "pipeline-analytics",
37582
37711
  capScope: "device",
@@ -41272,6 +41401,11 @@ Object.freeze({
41272
41401
  form: "array",
41273
41402
  optional: true
41274
41403
  }],
41404
+ "pipelineAnalytics.listSummaries": [{
41405
+ name: "deviceIds",
41406
+ form: "array",
41407
+ optional: false
41408
+ }],
41275
41409
  "pipelineAnalytics.listTrackMedia": [{
41276
41410
  name: "deviceId",
41277
41411
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-hikvision",
3
- "version": "1.2.76",
3
+ "version": "1.2.78",
4
4
  "description": "Hikvision camera device provider addon for CamStack — ISAPI over HTTP(S) with digest auth (snapshot, alarm stream, RTSP discovery)",
5
5
  "keywords": [
6
6
  "camstack",