@camstack/addon-provider-rtsp 1.2.110 → 1.2.111

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
@@ -5384,7 +5384,7 @@ var ZodIssueCode = {
5384
5384
  var ZodFirstPartyTypeKind;
5385
5385
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5386
5386
  //#endregion
5387
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5387
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5388
5388
  /**
5389
5389
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5390
5390
  * window to float samples (D455).
@@ -31037,14 +31037,81 @@ var privacyMaskCapability = {
31037
31037
  * whether persisting is worth a SQLite commit. */
31038
31038
  volatileStateFields: ["lastFetchedAt"]
31039
31039
  };
31040
+ /**
31041
+ * What a preset id DOES on this camera.
31042
+ *
31043
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
31044
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
31045
+ * (Hikvision) returns its own reserved band in the preset list, named by the
31046
+ * firmware:
31047
+ *
31048
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
31049
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
31050
+ * 95 Call OSD menu
31051
+ *
31052
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
31053
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
31054
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
31055
+ * operator as a transport failure.
31056
+ *
31057
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
31058
+ * is the single most useful thing that camera can do. Only `savePreset` and
31059
+ * `deletePreset` are gated.
31060
+ */
31061
+ var PtzPresetFunctionSchema = _enum([
31062
+ "home",
31063
+ "day-mode",
31064
+ "night-mode",
31065
+ "day-night-auto",
31066
+ "set-limits",
31067
+ "save-limits",
31068
+ "reboot",
31069
+ "osd-menu"
31070
+ ]);
31040
31071
  var PtzPresetSchema = object({
31041
31072
  id: string(),
31042
- name: string()
31073
+ name: string(),
31074
+ /**
31075
+ * The firmware function this id performs, when the provider KNOWS the id is
31076
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31077
+ * provider does not recognise -- the two are told apart by `writable`.
31078
+ */
31079
+ fn: PtzPresetFunctionSchema.nullable(),
31080
+ /**
31081
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31082
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31083
+ * documented it stays true and a refusal comes from the camera, named.
31084
+ */
31085
+ writable: boolean()
31043
31086
  });
31087
+ /**
31088
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31089
+ * read it.
31090
+ *
31091
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31092
+ * position no way to say so. All four said `0`:
31093
+ *
31094
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31095
+ * path lands upstream"
31096
+ * hikvision stub, "firmware-dependent and frequently absent"
31097
+ * amcrest stub, "no generic absolute-position read for this model family"
31098
+ * onvif throws
31099
+ *
31100
+ * So every consumer asking where a camera points was told "perfectly centred"
31101
+ * by four cameras that had never looked. That is D393 -- a measurement that
31102
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31103
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31104
+ * headroom", which evacuated a healthy disk.
31105
+ *
31106
+ * D393 also says to check for a narrower structural TWIN of the result type.
31107
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31108
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31109
+ * tells callers to migrate to.
31110
+ */
31044
31111
  var PtzPositionSchema = object({
31045
- pan: number(),
31046
- tilt: number(),
31047
- zoom: number()
31112
+ pan: number().nullable(),
31113
+ tilt: number().nullable(),
31114
+ zoom: number().nullable()
31048
31115
  });
31049
31116
  var PtzMoveCommandSchema = object({
31050
31117
  pan: number().optional(),
@@ -31063,7 +31130,72 @@ var PtzOptionsSchema = object({
31063
31130
  maxPresets: number().optional(),
31064
31131
  /** Whether the camera exposes a controllable autofocus toggle
31065
31132
  * (boolean `hasX` per the getOptions availability convention). */
31066
- hasAutofocus: boolean()
31133
+ hasAutofocus: boolean(),
31134
+ /**
31135
+ * How many distinct speeds this camera's NATIVE scale offers.
31136
+ *
31137
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31138
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31139
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31140
+ * meaningless, because it has eight steps and three of them round to the
31141
+ * same one. A loop that tunes its own gain has to know the granularity of
31142
+ * the knob it is turning.
31143
+ *
31144
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31145
+ * a float). Never a made-up number.
31146
+ */
31147
+ speedSteps: number().int().positive().nullable(),
31148
+ /**
31149
+ * How long ONE `move` pulse runs on this driver, ms.
31150
+ *
31151
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31152
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31153
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31154
+ * did the head travel per pulse": without it a measured displacement has no
31155
+ * gain to be divided into.
31156
+ *
31157
+ * `null` = the driver cannot say.
31158
+ */
31159
+ moveImpulseMs: number().int().positive().nullable()
31160
+ });
31161
+ /**
31162
+ * Which preset `goHome` goes to, and WHO decided.
31163
+ *
31164
+ * `goHome` used to be three vendor "conventions" written in three comments --
31165
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31166
+ * not one of the three cameras honours its own:
31167
+ *
31168
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31169
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31170
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31171
+ *
31172
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31173
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31174
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31175
+ * needs an answer that is true per camera and audible when it is missing.
31176
+ *
31177
+ * `source` is what makes it honest:
31178
+ * - `operator` -- picked in the UI, stored by the provider.
31179
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31180
+ * "Back to origin"), adopted as the default with nothing to configure.
31181
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31182
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31183
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31184
+ * no picker.
31185
+ * - `none` -- nothing is configured and the camera names nothing.
31186
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31187
+ *
31188
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31189
+ * native case has no preset and homes perfectly well.
31190
+ */
31191
+ var PtzHomePresetSchema = object({
31192
+ presetId: string().nullable(),
31193
+ source: _enum([
31194
+ "operator",
31195
+ "firmware",
31196
+ "native",
31197
+ "none"
31198
+ ])
31067
31199
  });
31068
31200
  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({
31069
31201
  deviceId: number(),
@@ -31081,7 +31213,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31081
31213
  }), _void(), {
31082
31214
  kind: "mutation",
31083
31215
  auth: "admin"
31084
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31216
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31217
+ deviceId: number(),
31218
+ presetId: string().nullable()
31219
+ }), _void(), {
31220
+ kind: "mutation",
31221
+ auth: "admin"
31222
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31085
31223
  deviceId: number(),
31086
31224
  enabled: boolean()
31087
31225
  }), _void(), { kind: "mutation" });
@@ -40401,6 +40539,12 @@ Object.freeze({
40401
40539
  addonId: null,
40402
40540
  access: "delete"
40403
40541
  },
40542
+ "ptz.getHomePreset": {
40543
+ capName: "ptz",
40544
+ capScope: "device",
40545
+ addonId: null,
40546
+ access: "view"
40547
+ },
40404
40548
  "ptz.getOptions": {
40405
40549
  capName: "ptz",
40406
40550
  capScope: "device",
@@ -40449,6 +40593,12 @@ Object.freeze({
40449
40593
  addonId: null,
40450
40594
  access: "create"
40451
40595
  },
40596
+ "ptz.setHomePreset": {
40597
+ capName: "ptz",
40598
+ capScope: "device",
40599
+ addonId: null,
40600
+ access: "create"
40601
+ },
40452
40602
  "ptz.stop": {
40453
40603
  capName: "ptz",
40454
40604
  capScope: "device",
@@ -43622,6 +43772,11 @@ Object.freeze({
43622
43772
  form: "single",
43623
43773
  optional: false
43624
43774
  }],
43775
+ "ptz.getHomePreset": [{
43776
+ name: "deviceId",
43777
+ form: "single",
43778
+ optional: false
43779
+ }],
43625
43780
  "ptz.getOptions": [{
43626
43781
  name: "deviceId",
43627
43782
  form: "single",
@@ -43662,6 +43817,11 @@ Object.freeze({
43662
43817
  form: "single",
43663
43818
  optional: false
43664
43819
  }],
43820
+ "ptz.setHomePreset": [{
43821
+ name: "deviceId",
43822
+ form: "single",
43823
+ optional: false
43824
+ }],
43665
43825
  "ptz.stop": [{
43666
43826
  name: "deviceId",
43667
43827
  form: "single",
package/dist/addon.mjs CHANGED
@@ -5360,7 +5360,7 @@ var ZodIssueCode = {
5360
5360
  var ZodFirstPartyTypeKind;
5361
5361
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5362
5362
  //#endregion
5363
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5363
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5364
5364
  /**
5365
5365
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5366
5366
  * window to float samples (D455).
@@ -31013,14 +31013,81 @@ var privacyMaskCapability = {
31013
31013
  * whether persisting is worth a SQLite commit. */
31014
31014
  volatileStateFields: ["lastFetchedAt"]
31015
31015
  };
31016
+ /**
31017
+ * What a preset id DOES on this camera.
31018
+ *
31019
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
31020
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
31021
+ * (Hikvision) returns its own reserved band in the preset list, named by the
31022
+ * firmware:
31023
+ *
31024
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
31025
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
31026
+ * 95 Call OSD menu
31027
+ *
31028
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
31029
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
31030
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
31031
+ * operator as a transport failure.
31032
+ *
31033
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
31034
+ * is the single most useful thing that camera can do. Only `savePreset` and
31035
+ * `deletePreset` are gated.
31036
+ */
31037
+ var PtzPresetFunctionSchema = _enum([
31038
+ "home",
31039
+ "day-mode",
31040
+ "night-mode",
31041
+ "day-night-auto",
31042
+ "set-limits",
31043
+ "save-limits",
31044
+ "reboot",
31045
+ "osd-menu"
31046
+ ]);
31016
31047
  var PtzPresetSchema = object({
31017
31048
  id: string(),
31018
- name: string()
31049
+ name: string(),
31050
+ /**
31051
+ * The firmware function this id performs, when the provider KNOWS the id is
31052
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
31053
+ * provider does not recognise -- the two are told apart by `writable`.
31054
+ */
31055
+ fn: PtzPresetFunctionSchema.nullable(),
31056
+ /**
31057
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
31058
+ * it false only for a band it KNOWS is reserved; where the firmware is not
31059
+ * documented it stays true and a refusal comes from the camera, named.
31060
+ */
31061
+ writable: boolean()
31019
31062
  });
31063
+ /**
31064
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
31065
+ * read it.
31066
+ *
31067
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
31068
+ * position no way to say so. All four said `0`:
31069
+ *
31070
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
31071
+ * path lands upstream"
31072
+ * hikvision stub, "firmware-dependent and frequently absent"
31073
+ * amcrest stub, "no generic absolute-position read for this model family"
31074
+ * onvif throws
31075
+ *
31076
+ * So every consumer asking where a camera points was told "perfectly centred"
31077
+ * by four cameras that had never looked. That is D393 -- a measurement that
31078
+ * FAILED is `null`, never `0`, and the type says so all the way to the
31079
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
31080
+ * headroom", which evacuated a healthy disk.
31081
+ *
31082
+ * D393 also says to check for a narrower structural TWIN of the result type.
31083
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
31084
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
31085
+ * tells callers to migrate to.
31086
+ */
31020
31087
  var PtzPositionSchema = object({
31021
- pan: number(),
31022
- tilt: number(),
31023
- zoom: number()
31088
+ pan: number().nullable(),
31089
+ tilt: number().nullable(),
31090
+ zoom: number().nullable()
31024
31091
  });
31025
31092
  var PtzMoveCommandSchema = object({
31026
31093
  pan: number().optional(),
@@ -31039,7 +31106,72 @@ var PtzOptionsSchema = object({
31039
31106
  maxPresets: number().optional(),
31040
31107
  /** Whether the camera exposes a controllable autofocus toggle
31041
31108
  * (boolean `hasX` per the getOptions availability convention). */
31042
- hasAutofocus: boolean()
31109
+ hasAutofocus: boolean(),
31110
+ /**
31111
+ * How many distinct speeds this camera's NATIVE scale offers.
31112
+ *
31113
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
31114
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
31115
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
31116
+ * meaningless, because it has eight steps and three of them round to the
31117
+ * same one. A loop that tunes its own gain has to know the granularity of
31118
+ * the knob it is turning.
31119
+ *
31120
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
31121
+ * a float). Never a made-up number.
31122
+ */
31123
+ speedSteps: number().int().positive().nullable(),
31124
+ /**
31125
+ * How long ONE `move` pulse runs on this driver, ms.
31126
+ *
31127
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
31128
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
31129
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
31130
+ * did the head travel per pulse": without it a measured displacement has no
31131
+ * gain to be divided into.
31132
+ *
31133
+ * `null` = the driver cannot say.
31134
+ */
31135
+ moveImpulseMs: number().int().positive().nullable()
31136
+ });
31137
+ /**
31138
+ * Which preset `goHome` goes to, and WHO decided.
31139
+ *
31140
+ * `goHome` used to be three vendor "conventions" written in three comments --
31141
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
31142
+ * not one of the three cameras honours its own:
31143
+ *
31144
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
31145
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
31146
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
31147
+ *
31148
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
31149
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
31150
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
31151
+ * needs an answer that is true per camera and audible when it is missing.
31152
+ *
31153
+ * `source` is what makes it honest:
31154
+ * - `operator` -- picked in the UI, stored by the provider.
31155
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
31156
+ * "Back to origin"), adopted as the default with nothing to configure.
31157
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
31158
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
31159
+ * that is not a failure -- there is nothing to pick, and the UI must offer
31160
+ * no picker.
31161
+ * - `none` -- nothing is configured and the camera names nothing.
31162
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
31163
+ *
31164
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
31165
+ * native case has no preset and homes perfectly well.
31166
+ */
31167
+ var PtzHomePresetSchema = object({
31168
+ presetId: string().nullable(),
31169
+ source: _enum([
31170
+ "operator",
31171
+ "firmware",
31172
+ "native",
31173
+ "none"
31174
+ ])
31043
31175
  });
31044
31176
  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({
31045
31177
  deviceId: number(),
@@ -31057,7 +31189,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
31057
31189
  }), _void(), {
31058
31190
  kind: "mutation",
31059
31191
  auth: "admin"
31060
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31192
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
31193
+ deviceId: number(),
31194
+ presetId: string().nullable()
31195
+ }), _void(), {
31196
+ kind: "mutation",
31197
+ auth: "admin"
31198
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
31061
31199
  deviceId: number(),
31062
31200
  enabled: boolean()
31063
31201
  }), _void(), { kind: "mutation" });
@@ -40377,6 +40515,12 @@ Object.freeze({
40377
40515
  addonId: null,
40378
40516
  access: "delete"
40379
40517
  },
40518
+ "ptz.getHomePreset": {
40519
+ capName: "ptz",
40520
+ capScope: "device",
40521
+ addonId: null,
40522
+ access: "view"
40523
+ },
40380
40524
  "ptz.getOptions": {
40381
40525
  capName: "ptz",
40382
40526
  capScope: "device",
@@ -40425,6 +40569,12 @@ Object.freeze({
40425
40569
  addonId: null,
40426
40570
  access: "create"
40427
40571
  },
40572
+ "ptz.setHomePreset": {
40573
+ capName: "ptz",
40574
+ capScope: "device",
40575
+ addonId: null,
40576
+ access: "create"
40577
+ },
40428
40578
  "ptz.stop": {
40429
40579
  capName: "ptz",
40430
40580
  capScope: "device",
@@ -43598,6 +43748,11 @@ Object.freeze({
43598
43748
  form: "single",
43599
43749
  optional: false
43600
43750
  }],
43751
+ "ptz.getHomePreset": [{
43752
+ name: "deviceId",
43753
+ form: "single",
43754
+ optional: false
43755
+ }],
43601
43756
  "ptz.getOptions": [{
43602
43757
  name: "deviceId",
43603
43758
  form: "single",
@@ -43638,6 +43793,11 @@ Object.freeze({
43638
43793
  form: "single",
43639
43794
  optional: false
43640
43795
  }],
43796
+ "ptz.setHomePreset": [{
43797
+ name: "deviceId",
43798
+ form: "single",
43799
+ optional: false
43800
+ }],
43641
43801
  "ptz.stop": [{
43642
43802
  name: "deviceId",
43643
43803
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-rtsp",
3
- "version": "1.2.110",
3
+ "version": "1.2.111",
4
4
  "description": "Generic RTSP camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",