@camstack/addon-provider-petkit 0.2.109 → 0.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
@@ -6462,7 +6462,7 @@ var ZodIssueCode = {
6462
6462
  var ZodFirstPartyTypeKind;
6463
6463
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6464
6464
  //#endregion
6465
- //#region ../types/dist/sleep-BDR76Ykr.mjs
6465
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
6466
6466
  /**
6467
6467
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6468
6468
  * window to float samples (D455).
@@ -31996,14 +31996,81 @@ var privacyMaskCapability = {
31996
31996
  * whether persisting is worth a SQLite commit. */
31997
31997
  volatileStateFields: ["lastFetchedAt"]
31998
31998
  };
31999
+ /**
32000
+ * What a preset id DOES on this camera.
32001
+ *
32002
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
32003
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
32004
+ * (Hikvision) returns its own reserved band in the preset list, named by the
32005
+ * firmware:
32006
+ *
32007
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
32008
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
32009
+ * 95 Call OSD menu
32010
+ *
32011
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
32012
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
32013
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
32014
+ * operator as a transport failure.
32015
+ *
32016
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
32017
+ * is the single most useful thing that camera can do. Only `savePreset` and
32018
+ * `deletePreset` are gated.
32019
+ */
32020
+ var PtzPresetFunctionSchema = _enum([
32021
+ "home",
32022
+ "day-mode",
32023
+ "night-mode",
32024
+ "day-night-auto",
32025
+ "set-limits",
32026
+ "save-limits",
32027
+ "reboot",
32028
+ "osd-menu"
32029
+ ]);
31999
32030
  var PtzPresetSchema = object({
32000
32031
  id: string(),
32001
- name: string()
32032
+ name: string(),
32033
+ /**
32034
+ * The firmware function this id performs, when the provider KNOWS the id is
32035
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
32036
+ * provider does not recognise -- the two are told apart by `writable`.
32037
+ */
32038
+ fn: PtzPresetFunctionSchema.nullable(),
32039
+ /**
32040
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
32041
+ * it false only for a band it KNOWS is reserved; where the firmware is not
32042
+ * documented it stays true and a refusal comes from the camera, named.
32043
+ */
32044
+ writable: boolean()
32002
32045
  });
32046
+ /**
32047
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
32048
+ * read it.
32049
+ *
32050
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
32051
+ * position no way to say so. All four said `0`:
32052
+ *
32053
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
32054
+ * path lands upstream"
32055
+ * hikvision stub, "firmware-dependent and frequently absent"
32056
+ * amcrest stub, "no generic absolute-position read for this model family"
32057
+ * onvif throws
32058
+ *
32059
+ * So every consumer asking where a camera points was told "perfectly centred"
32060
+ * by four cameras that had never looked. That is D393 -- a measurement that
32061
+ * FAILED is `null`, never `0`, and the type says so all the way to the
32062
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
32063
+ * headroom", which evacuated a healthy disk.
32064
+ *
32065
+ * D393 also says to check for a narrower structural TWIN of the result type.
32066
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
32067
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
32068
+ * tells callers to migrate to.
32069
+ */
32003
32070
  var PtzPositionSchema = object({
32004
- pan: number(),
32005
- tilt: number(),
32006
- zoom: number()
32071
+ pan: number().nullable(),
32072
+ tilt: number().nullable(),
32073
+ zoom: number().nullable()
32007
32074
  });
32008
32075
  var PtzMoveCommandSchema = object({
32009
32076
  pan: number().optional(),
@@ -32022,7 +32089,72 @@ var PtzOptionsSchema = object({
32022
32089
  maxPresets: number().optional(),
32023
32090
  /** Whether the camera exposes a controllable autofocus toggle
32024
32091
  * (boolean `hasX` per the getOptions availability convention). */
32025
- hasAutofocus: boolean()
32092
+ hasAutofocus: boolean(),
32093
+ /**
32094
+ * How many distinct speeds this camera's NATIVE scale offers.
32095
+ *
32096
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
32097
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
32098
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
32099
+ * meaningless, because it has eight steps and three of them round to the
32100
+ * same one. A loop that tunes its own gain has to know the granularity of
32101
+ * the knob it is turning.
32102
+ *
32103
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
32104
+ * a float). Never a made-up number.
32105
+ */
32106
+ speedSteps: number().int().positive().nullable(),
32107
+ /**
32108
+ * How long ONE `move` pulse runs on this driver, ms.
32109
+ *
32110
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
32111
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
32112
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
32113
+ * did the head travel per pulse": without it a measured displacement has no
32114
+ * gain to be divided into.
32115
+ *
32116
+ * `null` = the driver cannot say.
32117
+ */
32118
+ moveImpulseMs: number().int().positive().nullable()
32119
+ });
32120
+ /**
32121
+ * Which preset `goHome` goes to, and WHO decided.
32122
+ *
32123
+ * `goHome` used to be three vendor "conventions" written in three comments --
32124
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
32125
+ * not one of the three cameras honours its own:
32126
+ *
32127
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
32128
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
32129
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
32130
+ *
32131
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
32132
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
32133
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
32134
+ * needs an answer that is true per camera and audible when it is missing.
32135
+ *
32136
+ * `source` is what makes it honest:
32137
+ * - `operator` -- picked in the UI, stored by the provider.
32138
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
32139
+ * "Back to origin"), adopted as the default with nothing to configure.
32140
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
32141
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
32142
+ * that is not a failure -- there is nothing to pick, and the UI must offer
32143
+ * no picker.
32144
+ * - `none` -- nothing is configured and the camera names nothing.
32145
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
32146
+ *
32147
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
32148
+ * native case has no preset and homes perfectly well.
32149
+ */
32150
+ var PtzHomePresetSchema = object({
32151
+ presetId: string().nullable(),
32152
+ source: _enum([
32153
+ "operator",
32154
+ "firmware",
32155
+ "native",
32156
+ "none"
32157
+ ])
32026
32158
  });
32027
32159
  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({
32028
32160
  deviceId: number(),
@@ -32040,7 +32172,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
32040
32172
  }), _void(), {
32041
32173
  kind: "mutation",
32042
32174
  auth: "admin"
32043
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
32175
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
32176
+ deviceId: number(),
32177
+ presetId: string().nullable()
32178
+ }), _void(), {
32179
+ kind: "mutation",
32180
+ auth: "admin"
32181
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
32044
32182
  deviceId: number(),
32045
32183
  enabled: boolean()
32046
32184
  }), _void(), { kind: "mutation" });
@@ -41294,6 +41432,12 @@ Object.freeze({
41294
41432
  addonId: null,
41295
41433
  access: "delete"
41296
41434
  },
41435
+ "ptz.getHomePreset": {
41436
+ capName: "ptz",
41437
+ capScope: "device",
41438
+ addonId: null,
41439
+ access: "view"
41440
+ },
41297
41441
  "ptz.getOptions": {
41298
41442
  capName: "ptz",
41299
41443
  capScope: "device",
@@ -41342,6 +41486,12 @@ Object.freeze({
41342
41486
  addonId: null,
41343
41487
  access: "create"
41344
41488
  },
41489
+ "ptz.setHomePreset": {
41490
+ capName: "ptz",
41491
+ capScope: "device",
41492
+ addonId: null,
41493
+ access: "create"
41494
+ },
41345
41495
  "ptz.stop": {
41346
41496
  capName: "ptz",
41347
41497
  capScope: "device",
@@ -44515,6 +44665,11 @@ Object.freeze({
44515
44665
  form: "single",
44516
44666
  optional: false
44517
44667
  }],
44668
+ "ptz.getHomePreset": [{
44669
+ name: "deviceId",
44670
+ form: "single",
44671
+ optional: false
44672
+ }],
44518
44673
  "ptz.getOptions": [{
44519
44674
  name: "deviceId",
44520
44675
  form: "single",
@@ -44555,6 +44710,11 @@ Object.freeze({
44555
44710
  form: "single",
44556
44711
  optional: false
44557
44712
  }],
44713
+ "ptz.setHomePreset": [{
44714
+ name: "deviceId",
44715
+ form: "single",
44716
+ optional: false
44717
+ }],
44558
44718
  "ptz.stop": [{
44559
44719
  name: "deviceId",
44560
44720
  form: "single",
package/dist/addon.mjs CHANGED
@@ -6461,7 +6461,7 @@ var ZodIssueCode = {
6461
6461
  var ZodFirstPartyTypeKind;
6462
6462
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6463
6463
  //#endregion
6464
- //#region ../types/dist/sleep-BDR76Ykr.mjs
6464
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
6465
6465
  /**
6466
6466
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6467
6467
  * window to float samples (D455).
@@ -31995,14 +31995,81 @@ var privacyMaskCapability = {
31995
31995
  * whether persisting is worth a SQLite commit. */
31996
31996
  volatileStateFields: ["lastFetchedAt"]
31997
31997
  };
31998
+ /**
31999
+ * What a preset id DOES on this camera.
32000
+ *
32001
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
32002
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
32003
+ * (Hikvision) returns its own reserved band in the preset list, named by the
32004
+ * firmware:
32005
+ *
32006
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
32007
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
32008
+ * 95 Call OSD menu
32009
+ *
32010
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
32011
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
32012
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
32013
+ * operator as a transport failure.
32014
+ *
32015
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
32016
+ * is the single most useful thing that camera can do. Only `savePreset` and
32017
+ * `deletePreset` are gated.
32018
+ */
32019
+ var PtzPresetFunctionSchema = _enum([
32020
+ "home",
32021
+ "day-mode",
32022
+ "night-mode",
32023
+ "day-night-auto",
32024
+ "set-limits",
32025
+ "save-limits",
32026
+ "reboot",
32027
+ "osd-menu"
32028
+ ]);
31998
32029
  var PtzPresetSchema = object({
31999
32030
  id: string(),
32000
- name: string()
32031
+ name: string(),
32032
+ /**
32033
+ * The firmware function this id performs, when the provider KNOWS the id is
32034
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
32035
+ * provider does not recognise -- the two are told apart by `writable`.
32036
+ */
32037
+ fn: PtzPresetFunctionSchema.nullable(),
32038
+ /**
32039
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
32040
+ * it false only for a band it KNOWS is reserved; where the firmware is not
32041
+ * documented it stays true and a refusal comes from the camera, named.
32042
+ */
32043
+ writable: boolean()
32001
32044
  });
32045
+ /**
32046
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
32047
+ * read it.
32048
+ *
32049
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
32050
+ * position no way to say so. All four said `0`:
32051
+ *
32052
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
32053
+ * path lands upstream"
32054
+ * hikvision stub, "firmware-dependent and frequently absent"
32055
+ * amcrest stub, "no generic absolute-position read for this model family"
32056
+ * onvif throws
32057
+ *
32058
+ * So every consumer asking where a camera points was told "perfectly centred"
32059
+ * by four cameras that had never looked. That is D393 -- a measurement that
32060
+ * FAILED is `null`, never `0`, and the type says so all the way to the
32061
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
32062
+ * headroom", which evacuated a healthy disk.
32063
+ *
32064
+ * D393 also says to check for a narrower structural TWIN of the result type.
32065
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
32066
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
32067
+ * tells callers to migrate to.
32068
+ */
32002
32069
  var PtzPositionSchema = object({
32003
- pan: number(),
32004
- tilt: number(),
32005
- zoom: number()
32070
+ pan: number().nullable(),
32071
+ tilt: number().nullable(),
32072
+ zoom: number().nullable()
32006
32073
  });
32007
32074
  var PtzMoveCommandSchema = object({
32008
32075
  pan: number().optional(),
@@ -32021,7 +32088,72 @@ var PtzOptionsSchema = object({
32021
32088
  maxPresets: number().optional(),
32022
32089
  /** Whether the camera exposes a controllable autofocus toggle
32023
32090
  * (boolean `hasX` per the getOptions availability convention). */
32024
- hasAutofocus: boolean()
32091
+ hasAutofocus: boolean(),
32092
+ /**
32093
+ * How many distinct speeds this camera's NATIVE scale offers.
32094
+ *
32095
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
32096
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
32097
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
32098
+ * meaningless, because it has eight steps and three of them round to the
32099
+ * same one. A loop that tunes its own gain has to know the granularity of
32100
+ * the knob it is turning.
32101
+ *
32102
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
32103
+ * a float). Never a made-up number.
32104
+ */
32105
+ speedSteps: number().int().positive().nullable(),
32106
+ /**
32107
+ * How long ONE `move` pulse runs on this driver, ms.
32108
+ *
32109
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
32110
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
32111
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
32112
+ * did the head travel per pulse": without it a measured displacement has no
32113
+ * gain to be divided into.
32114
+ *
32115
+ * `null` = the driver cannot say.
32116
+ */
32117
+ moveImpulseMs: number().int().positive().nullable()
32118
+ });
32119
+ /**
32120
+ * Which preset `goHome` goes to, and WHO decided.
32121
+ *
32122
+ * `goHome` used to be three vendor "conventions" written in three comments --
32123
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
32124
+ * not one of the three cameras honours its own:
32125
+ *
32126
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
32127
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
32128
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
32129
+ *
32130
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
32131
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
32132
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
32133
+ * needs an answer that is true per camera and audible when it is missing.
32134
+ *
32135
+ * `source` is what makes it honest:
32136
+ * - `operator` -- picked in the UI, stored by the provider.
32137
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
32138
+ * "Back to origin"), adopted as the default with nothing to configure.
32139
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
32140
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
32141
+ * that is not a failure -- there is nothing to pick, and the UI must offer
32142
+ * no picker.
32143
+ * - `none` -- nothing is configured and the camera names nothing.
32144
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
32145
+ *
32146
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
32147
+ * native case has no preset and homes perfectly well.
32148
+ */
32149
+ var PtzHomePresetSchema = object({
32150
+ presetId: string().nullable(),
32151
+ source: _enum([
32152
+ "operator",
32153
+ "firmware",
32154
+ "native",
32155
+ "none"
32156
+ ])
32025
32157
  });
32026
32158
  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({
32027
32159
  deviceId: number(),
@@ -32039,7 +32171,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
32039
32171
  }), _void(), {
32040
32172
  kind: "mutation",
32041
32173
  auth: "admin"
32042
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
32174
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
32175
+ deviceId: number(),
32176
+ presetId: string().nullable()
32177
+ }), _void(), {
32178
+ kind: "mutation",
32179
+ auth: "admin"
32180
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
32043
32181
  deviceId: number(),
32044
32182
  enabled: boolean()
32045
32183
  }), _void(), { kind: "mutation" });
@@ -41293,6 +41431,12 @@ Object.freeze({
41293
41431
  addonId: null,
41294
41432
  access: "delete"
41295
41433
  },
41434
+ "ptz.getHomePreset": {
41435
+ capName: "ptz",
41436
+ capScope: "device",
41437
+ addonId: null,
41438
+ access: "view"
41439
+ },
41296
41440
  "ptz.getOptions": {
41297
41441
  capName: "ptz",
41298
41442
  capScope: "device",
@@ -41341,6 +41485,12 @@ Object.freeze({
41341
41485
  addonId: null,
41342
41486
  access: "create"
41343
41487
  },
41488
+ "ptz.setHomePreset": {
41489
+ capName: "ptz",
41490
+ capScope: "device",
41491
+ addonId: null,
41492
+ access: "create"
41493
+ },
41344
41494
  "ptz.stop": {
41345
41495
  capName: "ptz",
41346
41496
  capScope: "device",
@@ -44514,6 +44664,11 @@ Object.freeze({
44514
44664
  form: "single",
44515
44665
  optional: false
44516
44666
  }],
44667
+ "ptz.getHomePreset": [{
44668
+ name: "deviceId",
44669
+ form: "single",
44670
+ optional: false
44671
+ }],
44517
44672
  "ptz.getOptions": [{
44518
44673
  name: "deviceId",
44519
44674
  form: "single",
@@ -44554,6 +44709,11 @@ Object.freeze({
44554
44709
  form: "single",
44555
44710
  optional: false
44556
44711
  }],
44712
+ "ptz.setHomePreset": [{
44713
+ name: "deviceId",
44714
+ form: "single",
44715
+ optional: false
44716
+ }],
44557
44717
  "ptz.stop": [{
44558
44718
  name: "deviceId",
44559
44719
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-petkit",
3
- "version": "0.2.109",
3
+ "version": "0.2.111",
4
4
  "description": "PetKit smart-feeder device-provider addon for CamStack — wraps the @apocaliss92/nodepetkit PetKit cloud client",
5
5
  "keywords": [
6
6
  "camstack",