@camstack/addon-matter-broker 0.2.108 → 0.2.110

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
@@ -5374,7 +5374,7 @@ var ZodIssueCode = {
5374
5374
  var ZodFirstPartyTypeKind;
5375
5375
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5376
5376
  //#endregion
5377
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5377
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5378
5378
  /**
5379
5379
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5380
5380
  * window to float samples (D455).
@@ -30966,14 +30966,81 @@ var privacyMaskCapability = {
30966
30966
  * whether persisting is worth a SQLite commit. */
30967
30967
  volatileStateFields: ["lastFetchedAt"]
30968
30968
  };
30969
+ /**
30970
+ * What a preset id DOES on this camera.
30971
+ *
30972
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
30973
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
30974
+ * (Hikvision) returns its own reserved band in the preset list, named by the
30975
+ * firmware:
30976
+ *
30977
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
30978
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
30979
+ * 95 Call OSD menu
30980
+ *
30981
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
30982
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
30983
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
30984
+ * operator as a transport failure.
30985
+ *
30986
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
30987
+ * is the single most useful thing that camera can do. Only `savePreset` and
30988
+ * `deletePreset` are gated.
30989
+ */
30990
+ var PtzPresetFunctionSchema = _enum([
30991
+ "home",
30992
+ "day-mode",
30993
+ "night-mode",
30994
+ "day-night-auto",
30995
+ "set-limits",
30996
+ "save-limits",
30997
+ "reboot",
30998
+ "osd-menu"
30999
+ ]);
30969
31000
  var PtzPresetSchema = object({
30970
31001
  id: string$2(),
30971
- name: string$2()
31002
+ name: string$2(),
31003
+ /**
31004
+ * The firmware function this id performs, when the provider KNOWS the id is
31005
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31006
+ * provider does not recognise -- the two are told apart by `writable`.
31007
+ */
31008
+ fn: PtzPresetFunctionSchema.nullable(),
31009
+ /**
31010
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31011
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31012
+ * documented it stays true and a refusal comes from the camera, named.
31013
+ */
31014
+ writable: boolean()
30972
31015
  });
31016
+ /**
31017
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31018
+ * read it.
31019
+ *
31020
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31021
+ * position no way to say so. All four said `0`:
31022
+ *
31023
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31024
+ * path lands upstream"
31025
+ * hikvision stub, "firmware-dependent and frequently absent"
31026
+ * amcrest stub, "no generic absolute-position read for this model family"
31027
+ * onvif throws
31028
+ *
31029
+ * So every consumer asking where a camera points was told "perfectly centred"
31030
+ * by four cameras that had never looked. That is D393 -- a measurement that
31031
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31032
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31033
+ * headroom", which evacuated a healthy disk.
31034
+ *
31035
+ * D393 also says to check for a narrower structural TWIN of the result type.
31036
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31037
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31038
+ * tells callers to migrate to.
31039
+ */
30973
31040
  var PtzPositionSchema = object({
30974
- pan: number(),
30975
- tilt: number(),
30976
- zoom: number()
31041
+ pan: number().nullable(),
31042
+ tilt: number().nullable(),
31043
+ zoom: number().nullable()
30977
31044
  });
30978
31045
  var PtzMoveCommandSchema = object({
30979
31046
  pan: number().optional(),
@@ -30992,7 +31059,72 @@ var PtzOptionsSchema = object({
30992
31059
  maxPresets: number().optional(),
30993
31060
  /** Whether the camera exposes a controllable autofocus toggle
30994
31061
  * (boolean `hasX` per the getOptions availability convention). */
30995
- hasAutofocus: boolean()
31062
+ hasAutofocus: boolean(),
31063
+ /**
31064
+ * How many distinct speeds this camera's NATIVE scale offers.
31065
+ *
31066
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31067
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31068
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31069
+ * meaningless, because it has eight steps and three of them round to the
31070
+ * same one. A loop that tunes its own gain has to know the granularity of
31071
+ * the knob it is turning.
31072
+ *
31073
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31074
+ * a float). Never a made-up number.
31075
+ */
31076
+ speedSteps: number().int().positive().nullable(),
31077
+ /**
31078
+ * How long ONE `move` pulse runs on this driver, ms.
31079
+ *
31080
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31081
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31082
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31083
+ * did the head travel per pulse": without it a measured displacement has no
31084
+ * gain to be divided into.
31085
+ *
31086
+ * `null` = the driver cannot say.
31087
+ */
31088
+ moveImpulseMs: number().int().positive().nullable()
31089
+ });
31090
+ /**
31091
+ * Which preset `goHome` goes to, and WHO decided.
31092
+ *
31093
+ * `goHome` used to be three vendor "conventions" written in three comments --
31094
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31095
+ * not one of the three cameras honours its own:
31096
+ *
31097
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31098
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31099
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31100
+ *
31101
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31102
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31103
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31104
+ * needs an answer that is true per camera and audible when it is missing.
31105
+ *
31106
+ * `source` is what makes it honest:
31107
+ * - `operator` -- picked in the UI, stored by the provider.
31108
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31109
+ * "Back to origin"), adopted as the default with nothing to configure.
31110
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31111
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31112
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31113
+ * no picker.
31114
+ * - `none` -- nothing is configured and the camera names nothing.
31115
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31116
+ *
31117
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31118
+ * native case has no preset and homes perfectly well.
31119
+ */
31120
+ var PtzHomePresetSchema = object({
31121
+ presetId: string$2().nullable(),
31122
+ source: _enum([
31123
+ "operator",
31124
+ "firmware",
31125
+ "native",
31126
+ "none"
31127
+ ])
30996
31128
  });
30997
31129
  DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(PtzPresetSchema)), method(object({
30998
31130
  deviceId: number(),
@@ -31010,7 +31142,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31010
31142
  }), _void(), {
31011
31143
  kind: "mutation",
31012
31144
  auth: "admin"
31013
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31145
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31146
+ deviceId: number(),
31147
+ presetId: string$2().nullable()
31148
+ }), _void(), {
31149
+ kind: "mutation",
31150
+ auth: "admin"
31151
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31014
31152
  deviceId: number(),
31015
31153
  enabled: boolean()
31016
31154
  }), _void(), { kind: "mutation" });
@@ -40264,6 +40402,12 @@ Object.freeze({
40264
40402
  addonId: null,
40265
40403
  access: "delete"
40266
40404
  },
40405
+ "ptz.getHomePreset": {
40406
+ capName: "ptz",
40407
+ capScope: "device",
40408
+ addonId: null,
40409
+ access: "view"
40410
+ },
40267
40411
  "ptz.getOptions": {
40268
40412
  capName: "ptz",
40269
40413
  capScope: "device",
@@ -40312,6 +40456,12 @@ Object.freeze({
40312
40456
  addonId: null,
40313
40457
  access: "create"
40314
40458
  },
40459
+ "ptz.setHomePreset": {
40460
+ capName: "ptz",
40461
+ capScope: "device",
40462
+ addonId: null,
40463
+ access: "create"
40464
+ },
40315
40465
  "ptz.stop": {
40316
40466
  capName: "ptz",
40317
40467
  capScope: "device",
@@ -43485,6 +43635,11 @@ Object.freeze({
43485
43635
  form: "single",
43486
43636
  optional: false
43487
43637
  }],
43638
+ "ptz.getHomePreset": [{
43639
+ name: "deviceId",
43640
+ form: "single",
43641
+ optional: false
43642
+ }],
43488
43643
  "ptz.getOptions": [{
43489
43644
  name: "deviceId",
43490
43645
  form: "single",
@@ -43525,6 +43680,11 @@ Object.freeze({
43525
43680
  form: "single",
43526
43681
  optional: false
43527
43682
  }],
43683
+ "ptz.setHomePreset": [{
43684
+ name: "deviceId",
43685
+ form: "single",
43686
+ optional: false
43687
+ }],
43528
43688
  "ptz.stop": [{
43529
43689
  name: "deviceId",
43530
43690
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5372,7 +5372,7 @@ var ZodIssueCode = {
5372
5372
  var ZodFirstPartyTypeKind;
5373
5373
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5374
5374
  //#endregion
5375
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5375
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5376
5376
  /**
5377
5377
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5378
5378
  * window to float samples (D455).
@@ -30964,14 +30964,81 @@ var privacyMaskCapability = {
30964
30964
  * whether persisting is worth a SQLite commit. */
30965
30965
  volatileStateFields: ["lastFetchedAt"]
30966
30966
  };
30967
+ /**
30968
+ * What a preset id DOES on this camera.
30969
+ *
30970
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
30971
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
30972
+ * (Hikvision) returns its own reserved band in the preset list, named by the
30973
+ * firmware:
30974
+ *
30975
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
30976
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
30977
+ * 95 Call OSD menu
30978
+ *
30979
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
30980
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
30981
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
30982
+ * operator as a transport failure.
30983
+ *
30984
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
30985
+ * is the single most useful thing that camera can do. Only `savePreset` and
30986
+ * `deletePreset` are gated.
30987
+ */
30988
+ var PtzPresetFunctionSchema = _enum([
30989
+ "home",
30990
+ "day-mode",
30991
+ "night-mode",
30992
+ "day-night-auto",
30993
+ "set-limits",
30994
+ "save-limits",
30995
+ "reboot",
30996
+ "osd-menu"
30997
+ ]);
30967
30998
  var PtzPresetSchema = object({
30968
30999
  id: string$2(),
30969
- name: string$2()
31000
+ name: string$2(),
31001
+ /**
31002
+ * The firmware function this id performs, when the provider KNOWS the id is
31003
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31004
+ * provider does not recognise -- the two are told apart by `writable`.
31005
+ */
31006
+ fn: PtzPresetFunctionSchema.nullable(),
31007
+ /**
31008
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31009
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31010
+ * documented it stays true and a refusal comes from the camera, named.
31011
+ */
31012
+ writable: boolean()
30970
31013
  });
31014
+ /**
31015
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31016
+ * read it.
31017
+ *
31018
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31019
+ * position no way to say so. All four said `0`:
31020
+ *
31021
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31022
+ * path lands upstream"
31023
+ * hikvision stub, "firmware-dependent and frequently absent"
31024
+ * amcrest stub, "no generic absolute-position read for this model family"
31025
+ * onvif throws
31026
+ *
31027
+ * So every consumer asking where a camera points was told "perfectly centred"
31028
+ * by four cameras that had never looked. That is D393 -- a measurement that
31029
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31030
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31031
+ * headroom", which evacuated a healthy disk.
31032
+ *
31033
+ * D393 also says to check for a narrower structural TWIN of the result type.
31034
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31035
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31036
+ * tells callers to migrate to.
31037
+ */
30971
31038
  var PtzPositionSchema = object({
30972
- pan: number(),
30973
- tilt: number(),
30974
- zoom: number()
31039
+ pan: number().nullable(),
31040
+ tilt: number().nullable(),
31041
+ zoom: number().nullable()
30975
31042
  });
30976
31043
  var PtzMoveCommandSchema = object({
30977
31044
  pan: number().optional(),
@@ -30990,7 +31057,72 @@ var PtzOptionsSchema = object({
30990
31057
  maxPresets: number().optional(),
30991
31058
  /** Whether the camera exposes a controllable autofocus toggle
30992
31059
  * (boolean `hasX` per the getOptions availability convention). */
30993
- hasAutofocus: boolean()
31060
+ hasAutofocus: boolean(),
31061
+ /**
31062
+ * How many distinct speeds this camera's NATIVE scale offers.
31063
+ *
31064
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31065
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31066
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31067
+ * meaningless, because it has eight steps and three of them round to the
31068
+ * same one. A loop that tunes its own gain has to know the granularity of
31069
+ * the knob it is turning.
31070
+ *
31071
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31072
+ * a float). Never a made-up number.
31073
+ */
31074
+ speedSteps: number().int().positive().nullable(),
31075
+ /**
31076
+ * How long ONE `move` pulse runs on this driver, ms.
31077
+ *
31078
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31079
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31080
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31081
+ * did the head travel per pulse": without it a measured displacement has no
31082
+ * gain to be divided into.
31083
+ *
31084
+ * `null` = the driver cannot say.
31085
+ */
31086
+ moveImpulseMs: number().int().positive().nullable()
31087
+ });
31088
+ /**
31089
+ * Which preset `goHome` goes to, and WHO decided.
31090
+ *
31091
+ * `goHome` used to be three vendor "conventions" written in three comments --
31092
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31093
+ * not one of the three cameras honours its own:
31094
+ *
31095
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31096
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31097
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31098
+ *
31099
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31100
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31101
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31102
+ * needs an answer that is true per camera and audible when it is missing.
31103
+ *
31104
+ * `source` is what makes it honest:
31105
+ * - `operator` -- picked in the UI, stored by the provider.
31106
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31107
+ * "Back to origin"), adopted as the default with nothing to configure.
31108
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31109
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31110
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31111
+ * no picker.
31112
+ * - `none` -- nothing is configured and the camera names nothing.
31113
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31114
+ *
31115
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31116
+ * native case has no preset and homes perfectly well.
31117
+ */
31118
+ var PtzHomePresetSchema = object({
31119
+ presetId: string$2().nullable(),
31120
+ source: _enum([
31121
+ "operator",
31122
+ "firmware",
31123
+ "native",
31124
+ "none"
31125
+ ])
30994
31126
  });
30995
31127
  DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(PtzMoveCommandSchema.extend({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), array(PtzPresetSchema)), method(object({
30996
31128
  deviceId: number(),
@@ -31008,7 +31140,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31008
31140
  }), _void(), {
31009
31141
  kind: "mutation",
31010
31142
  auth: "admin"
31011
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31143
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31144
+ deviceId: number(),
31145
+ presetId: string$2().nullable()
31146
+ }), _void(), {
31147
+ kind: "mutation",
31148
+ auth: "admin"
31149
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31012
31150
  deviceId: number(),
31013
31151
  enabled: boolean()
31014
31152
  }), _void(), { kind: "mutation" });
@@ -40262,6 +40400,12 @@ Object.freeze({
40262
40400
  addonId: null,
40263
40401
  access: "delete"
40264
40402
  },
40403
+ "ptz.getHomePreset": {
40404
+ capName: "ptz",
40405
+ capScope: "device",
40406
+ addonId: null,
40407
+ access: "view"
40408
+ },
40265
40409
  "ptz.getOptions": {
40266
40410
  capName: "ptz",
40267
40411
  capScope: "device",
@@ -40310,6 +40454,12 @@ Object.freeze({
40310
40454
  addonId: null,
40311
40455
  access: "create"
40312
40456
  },
40457
+ "ptz.setHomePreset": {
40458
+ capName: "ptz",
40459
+ capScope: "device",
40460
+ addonId: null,
40461
+ access: "create"
40462
+ },
40313
40463
  "ptz.stop": {
40314
40464
  capName: "ptz",
40315
40465
  capScope: "device",
@@ -43483,6 +43633,11 @@ Object.freeze({
43483
43633
  form: "single",
43484
43634
  optional: false
43485
43635
  }],
43636
+ "ptz.getHomePreset": [{
43637
+ name: "deviceId",
43638
+ form: "single",
43639
+ optional: false
43640
+ }],
43486
43641
  "ptz.getOptions": [{
43487
43642
  name: "deviceId",
43488
43643
  form: "single",
@@ -43523,6 +43678,11 @@ Object.freeze({
43523
43678
  form: "single",
43524
43679
  optional: false
43525
43680
  }],
43681
+ "ptz.setHomePreset": [{
43682
+ name: "deviceId",
43683
+ form: "single",
43684
+ optional: false
43685
+ }],
43526
43686
  "ptz.stop": [{
43527
43687
  name: "deviceId",
43528
43688
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-matter-broker",
3
- "version": "0.2.108",
3
+ "version": "0.2.110",
4
4
  "description": "Matter broker addon for CamStack — owns a Matter fabric (commissioning + the long-lived controller) via the matter.js controller and brokers commissioned Matter nodes into CamStack",
5
5
  "keywords": [
6
6
  "camstack",