@camstack/addon-decoder-nodeav 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/index.js CHANGED
@@ -5364,7 +5364,7 @@ var ZodIssueCode = {
5364
5364
  var ZodFirstPartyTypeKind;
5365
5365
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5366
5366
  //#endregion
5367
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5367
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5368
5368
  /**
5369
5369
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5370
5370
  * window to float samples (D455).
@@ -28832,14 +28832,81 @@ DeviceType.Camera, method(object({ deviceId: number() }), PrivacyMaskOptionsSche
28832
28832
  kind: "mutation",
28833
28833
  auth: "admin"
28834
28834
  });
28835
+ /**
28836
+ * What a preset id DOES on this camera.
28837
+ *
28838
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
28839
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
28840
+ * (Hikvision) returns its own reserved band in the preset list, named by the
28841
+ * firmware:
28842
+ *
28843
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
28844
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
28845
+ * 95 Call OSD menu
28846
+ *
28847
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
28848
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
28849
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
28850
+ * operator as a transport failure.
28851
+ *
28852
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
28853
+ * is the single most useful thing that camera can do. Only `savePreset` and
28854
+ * `deletePreset` are gated.
28855
+ */
28856
+ var PtzPresetFunctionSchema = _enum([
28857
+ "home",
28858
+ "day-mode",
28859
+ "night-mode",
28860
+ "day-night-auto",
28861
+ "set-limits",
28862
+ "save-limits",
28863
+ "reboot",
28864
+ "osd-menu"
28865
+ ]);
28835
28866
  var PtzPresetSchema = object({
28836
28867
  id: string(),
28837
- name: string()
28868
+ name: string(),
28869
+ /**
28870
+ * The firmware function this id performs, when the provider KNOWS the id is
28871
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
28872
+ * provider does not recognise -- the two are told apart by `writable`.
28873
+ */
28874
+ fn: PtzPresetFunctionSchema.nullable(),
28875
+ /**
28876
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
28877
+ * it false only for a band it KNOWS is reserved; where the firmware is not
28878
+ * documented it stays true and a refusal comes from the camera, named.
28879
+ */
28880
+ writable: boolean()
28838
28881
  });
28882
+ /**
28883
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
28884
+ * read it.
28885
+ *
28886
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
28887
+ * position no way to say so. All four said `0`:
28888
+ *
28889
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
28890
+ * path lands upstream"
28891
+ * hikvision stub, "firmware-dependent and frequently absent"
28892
+ * amcrest stub, "no generic absolute-position read for this model family"
28893
+ * onvif throws
28894
+ *
28895
+ * So every consumer asking where a camera points was told "perfectly centred"
28896
+ * by four cameras that had never looked. That is D393 -- a measurement that
28897
+ * FAILED is `null`, never `0`, and the type says so all the way to the
28898
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
28899
+ * headroom", which evacuated a healthy disk.
28900
+ *
28901
+ * D393 also says to check for a narrower structural TWIN of the result type.
28902
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
28903
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
28904
+ * tells callers to migrate to.
28905
+ */
28839
28906
  var PtzPositionSchema = object({
28840
- pan: number(),
28841
- tilt: number(),
28842
- zoom: number()
28907
+ pan: number().nullable(),
28908
+ tilt: number().nullable(),
28909
+ zoom: number().nullable()
28843
28910
  });
28844
28911
  var PtzMoveCommandSchema = object({
28845
28912
  pan: number().optional(),
@@ -28858,7 +28925,72 @@ var PtzOptionsSchema = object({
28858
28925
  maxPresets: number().optional(),
28859
28926
  /** Whether the camera exposes a controllable autofocus toggle
28860
28927
  * (boolean `hasX` per the getOptions availability convention). */
28861
- hasAutofocus: boolean()
28928
+ hasAutofocus: boolean(),
28929
+ /**
28930
+ * How many distinct speeds this camera's NATIVE scale offers.
28931
+ *
28932
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
28933
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
28934
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
28935
+ * meaningless, because it has eight steps and three of them round to the
28936
+ * same one. A loop that tunes its own gain has to know the granularity of
28937
+ * the knob it is turning.
28938
+ *
28939
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
28940
+ * a float). Never a made-up number.
28941
+ */
28942
+ speedSteps: number().int().positive().nullable(),
28943
+ /**
28944
+ * How long ONE `move` pulse runs on this driver, ms.
28945
+ *
28946
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
28947
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
28948
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
28949
+ * did the head travel per pulse": without it a measured displacement has no
28950
+ * gain to be divided into.
28951
+ *
28952
+ * `null` = the driver cannot say.
28953
+ */
28954
+ moveImpulseMs: number().int().positive().nullable()
28955
+ });
28956
+ /**
28957
+ * Which preset `goHome` goes to, and WHO decided.
28958
+ *
28959
+ * `goHome` used to be three vendor "conventions" written in three comments --
28960
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
28961
+ * not one of the three cameras honours its own:
28962
+ *
28963
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
28964
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
28965
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
28966
+ *
28967
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
28968
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
28969
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
28970
+ * needs an answer that is true per camera and audible when it is missing.
28971
+ *
28972
+ * `source` is what makes it honest:
28973
+ * - `operator` -- picked in the UI, stored by the provider.
28974
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
28975
+ * "Back to origin"), adopted as the default with nothing to configure.
28976
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
28977
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
28978
+ * that is not a failure -- there is nothing to pick, and the UI must offer
28979
+ * no picker.
28980
+ * - `none` -- nothing is configured and the camera names nothing.
28981
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
28982
+ *
28983
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
28984
+ * native case has no preset and homes perfectly well.
28985
+ */
28986
+ var PtzHomePresetSchema = object({
28987
+ presetId: string().nullable(),
28988
+ source: _enum([
28989
+ "operator",
28990
+ "firmware",
28991
+ "native",
28992
+ "none"
28993
+ ])
28862
28994
  });
28863
28995
  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({
28864
28996
  deviceId: number(),
@@ -28876,7 +29008,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
28876
29008
  }), _void(), {
28877
29009
  kind: "mutation",
28878
29010
  auth: "admin"
28879
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
29011
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
29012
+ deviceId: number(),
29013
+ presetId: string().nullable()
29014
+ }), _void(), {
29015
+ kind: "mutation",
29016
+ auth: "admin"
29017
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
28880
29018
  deviceId: number(),
28881
29019
  enabled: boolean()
28882
29020
  }), _void(), { kind: "mutation" });
@@ -35891,6 +36029,12 @@ Object.freeze({
35891
36029
  addonId: null,
35892
36030
  access: "delete"
35893
36031
  },
36032
+ "ptz.getHomePreset": {
36033
+ capName: "ptz",
36034
+ capScope: "device",
36035
+ addonId: null,
36036
+ access: "view"
36037
+ },
35894
36038
  "ptz.getOptions": {
35895
36039
  capName: "ptz",
35896
36040
  capScope: "device",
@@ -35939,6 +36083,12 @@ Object.freeze({
35939
36083
  addonId: null,
35940
36084
  access: "create"
35941
36085
  },
36086
+ "ptz.setHomePreset": {
36087
+ capName: "ptz",
36088
+ capScope: "device",
36089
+ addonId: null,
36090
+ access: "create"
36091
+ },
35942
36092
  "ptz.stop": {
35943
36093
  capName: "ptz",
35944
36094
  capScope: "device",
@@ -39112,6 +39262,11 @@ Object.freeze({
39112
39262
  form: "single",
39113
39263
  optional: false
39114
39264
  }],
39265
+ "ptz.getHomePreset": [{
39266
+ name: "deviceId",
39267
+ form: "single",
39268
+ optional: false
39269
+ }],
39115
39270
  "ptz.getOptions": [{
39116
39271
  name: "deviceId",
39117
39272
  form: "single",
@@ -39152,6 +39307,11 @@ Object.freeze({
39152
39307
  form: "single",
39153
39308
  optional: false
39154
39309
  }],
39310
+ "ptz.setHomePreset": [{
39311
+ name: "deviceId",
39312
+ form: "single",
39313
+ optional: false
39314
+ }],
39155
39315
  "ptz.stop": [{
39156
39316
  name: "deviceId",
39157
39317
  form: "single",
package/dist/index.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).
@@ -28828,14 +28828,81 @@ DeviceType.Camera, method(object({ deviceId: number() }), PrivacyMaskOptionsSche
28828
28828
  kind: "mutation",
28829
28829
  auth: "admin"
28830
28830
  });
28831
+ /**
28832
+ * What a preset id DOES on this camera.
28833
+ *
28834
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
28835
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
28836
+ * (Hikvision) returns its own reserved band in the preset list, named by the
28837
+ * firmware:
28838
+ *
28839
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
28840
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
28841
+ * 95 Call OSD menu
28842
+ *
28843
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
28844
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
28845
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
28846
+ * operator as a transport failure.
28847
+ *
28848
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
28849
+ * is the single most useful thing that camera can do. Only `savePreset` and
28850
+ * `deletePreset` are gated.
28851
+ */
28852
+ var PtzPresetFunctionSchema = _enum([
28853
+ "home",
28854
+ "day-mode",
28855
+ "night-mode",
28856
+ "day-night-auto",
28857
+ "set-limits",
28858
+ "save-limits",
28859
+ "reboot",
28860
+ "osd-menu"
28861
+ ]);
28831
28862
  var PtzPresetSchema = object({
28832
28863
  id: string(),
28833
- name: string()
28864
+ name: string(),
28865
+ /**
28866
+ * The firmware function this id performs, when the provider KNOWS the id is
28867
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
28868
+ * provider does not recognise -- the two are told apart by `writable`.
28869
+ */
28870
+ fn: PtzPresetFunctionSchema.nullable(),
28871
+ /**
28872
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
28873
+ * it false only for a band it KNOWS is reserved; where the firmware is not
28874
+ * documented it stays true and a refusal comes from the camera, named.
28875
+ */
28876
+ writable: boolean()
28834
28877
  });
28878
+ /**
28879
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
28880
+ * read it.
28881
+ *
28882
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
28883
+ * position no way to say so. All four said `0`:
28884
+ *
28885
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
28886
+ * path lands upstream"
28887
+ * hikvision stub, "firmware-dependent and frequently absent"
28888
+ * amcrest stub, "no generic absolute-position read for this model family"
28889
+ * onvif throws
28890
+ *
28891
+ * So every consumer asking where a camera points was told "perfectly centred"
28892
+ * by four cameras that had never looked. That is D393 -- a measurement that
28893
+ * FAILED is `null`, never `0`, and the type says so all the way to the
28894
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
28895
+ * headroom", which evacuated a healthy disk.
28896
+ *
28897
+ * D393 also says to check for a narrower structural TWIN of the result type.
28898
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
28899
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
28900
+ * tells callers to migrate to.
28901
+ */
28835
28902
  var PtzPositionSchema = object({
28836
- pan: number(),
28837
- tilt: number(),
28838
- zoom: number()
28903
+ pan: number().nullable(),
28904
+ tilt: number().nullable(),
28905
+ zoom: number().nullable()
28839
28906
  });
28840
28907
  var PtzMoveCommandSchema = object({
28841
28908
  pan: number().optional(),
@@ -28854,7 +28921,72 @@ var PtzOptionsSchema = object({
28854
28921
  maxPresets: number().optional(),
28855
28922
  /** Whether the camera exposes a controllable autofocus toggle
28856
28923
  * (boolean `hasX` per the getOptions availability convention). */
28857
- hasAutofocus: boolean()
28924
+ hasAutofocus: boolean(),
28925
+ /**
28926
+ * How many distinct speeds this camera's NATIVE scale offers.
28927
+ *
28928
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
28929
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
28930
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
28931
+ * meaningless, because it has eight steps and three of them round to the
28932
+ * same one. A loop that tunes its own gain has to know the granularity of
28933
+ * the knob it is turning.
28934
+ *
28935
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
28936
+ * a float). Never a made-up number.
28937
+ */
28938
+ speedSteps: number().int().positive().nullable(),
28939
+ /**
28940
+ * How long ONE `move` pulse runs on this driver, ms.
28941
+ *
28942
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
28943
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
28944
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
28945
+ * did the head travel per pulse": without it a measured displacement has no
28946
+ * gain to be divided into.
28947
+ *
28948
+ * `null` = the driver cannot say.
28949
+ */
28950
+ moveImpulseMs: number().int().positive().nullable()
28951
+ });
28952
+ /**
28953
+ * Which preset `goHome` goes to, and WHO decided.
28954
+ *
28955
+ * `goHome` used to be three vendor "conventions" written in three comments --
28956
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
28957
+ * not one of the three cameras honours its own:
28958
+ *
28959
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
28960
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
28961
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
28962
+ *
28963
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
28964
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
28965
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
28966
+ * needs an answer that is true per camera and audible when it is missing.
28967
+ *
28968
+ * `source` is what makes it honest:
28969
+ * - `operator` -- picked in the UI, stored by the provider.
28970
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
28971
+ * "Back to origin"), adopted as the default with nothing to configure.
28972
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
28973
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
28974
+ * that is not a failure -- there is nothing to pick, and the UI must offer
28975
+ * no picker.
28976
+ * - `none` -- nothing is configured and the camera names nothing.
28977
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
28978
+ *
28979
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
28980
+ * native case has no preset and homes perfectly well.
28981
+ */
28982
+ var PtzHomePresetSchema = object({
28983
+ presetId: string().nullable(),
28984
+ source: _enum([
28985
+ "operator",
28986
+ "firmware",
28987
+ "native",
28988
+ "none"
28989
+ ])
28858
28990
  });
28859
28991
  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({
28860
28992
  deviceId: number(),
@@ -28872,7 +29004,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
28872
29004
  }), _void(), {
28873
29005
  kind: "mutation",
28874
29006
  auth: "admin"
28875
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
29007
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
29008
+ deviceId: number(),
29009
+ presetId: string().nullable()
29010
+ }), _void(), {
29011
+ kind: "mutation",
29012
+ auth: "admin"
29013
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
28876
29014
  deviceId: number(),
28877
29015
  enabled: boolean()
28878
29016
  }), _void(), { kind: "mutation" });
@@ -35887,6 +36025,12 @@ Object.freeze({
35887
36025
  addonId: null,
35888
36026
  access: "delete"
35889
36027
  },
36028
+ "ptz.getHomePreset": {
36029
+ capName: "ptz",
36030
+ capScope: "device",
36031
+ addonId: null,
36032
+ access: "view"
36033
+ },
35890
36034
  "ptz.getOptions": {
35891
36035
  capName: "ptz",
35892
36036
  capScope: "device",
@@ -35935,6 +36079,12 @@ Object.freeze({
35935
36079
  addonId: null,
35936
36080
  access: "create"
35937
36081
  },
36082
+ "ptz.setHomePreset": {
36083
+ capName: "ptz",
36084
+ capScope: "device",
36085
+ addonId: null,
36086
+ access: "create"
36087
+ },
35938
36088
  "ptz.stop": {
35939
36089
  capName: "ptz",
35940
36090
  capScope: "device",
@@ -39108,6 +39258,11 @@ Object.freeze({
39108
39258
  form: "single",
39109
39259
  optional: false
39110
39260
  }],
39261
+ "ptz.getHomePreset": [{
39262
+ name: "deviceId",
39263
+ form: "single",
39264
+ optional: false
39265
+ }],
39111
39266
  "ptz.getOptions": [{
39112
39267
  name: "deviceId",
39113
39268
  form: "single",
@@ -39148,6 +39303,11 @@ Object.freeze({
39148
39303
  form: "single",
39149
39304
  optional: false
39150
39305
  }],
39306
+ "ptz.setHomePreset": [{
39307
+ name: "deviceId",
39308
+ form: "single",
39309
+ optional: false
39310
+ }],
39151
39311
  "ptz.stop": [{
39152
39312
  name: "deviceId",
39153
39313
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-nodeav",
3
- "version": "1.2.110",
3
+ "version": "1.2.111",
4
4
  "description": "Standalone in-process node-av decoder addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",