@camstack/addon-export-alexa 1.2.117 → 1.2.118

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.
@@ -5387,7 +5387,7 @@ var ZodIssueCode = {
5387
5387
  var ZodFirstPartyTypeKind;
5388
5388
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5389
5389
  //#endregion
5390
- //#region ../types/dist/sleep-BDR76Ykr.mjs
5390
+ //#region ../types/dist/sleep-B1y0Fo1U.mjs
5391
5391
  /**
5392
5392
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5393
5393
  * window to float samples (D455).
@@ -29071,14 +29071,81 @@ DeviceType.Camera, method(object({ deviceId: number() }), PrivacyMaskOptionsSche
29071
29071
  kind: "mutation",
29072
29072
  auth: "admin"
29073
29073
  });
29074
+ /**
29075
+ * What a preset id DOES on this camera.
29076
+ *
29077
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
29078
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
29079
+ * (Hikvision) returns its own reserved band in the preset list, named by the
29080
+ * firmware:
29081
+ *
29082
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
29083
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
29084
+ * 95 Call OSD menu
29085
+ *
29086
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
29087
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
29088
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
29089
+ * operator as a transport failure.
29090
+ *
29091
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
29092
+ * is the single most useful thing that camera can do. Only `savePreset` and
29093
+ * `deletePreset` are gated.
29094
+ */
29095
+ var PtzPresetFunctionSchema = _enum([
29096
+ "home",
29097
+ "day-mode",
29098
+ "night-mode",
29099
+ "day-night-auto",
29100
+ "set-limits",
29101
+ "save-limits",
29102
+ "reboot",
29103
+ "osd-menu"
29104
+ ]);
29074
29105
  var PtzPresetSchema = object({
29075
29106
  id: string(),
29076
- name: string()
29107
+ name: string(),
29108
+ /**
29109
+ * The firmware function this id performs, when the provider KNOWS the id is
29110
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
29111
+ * provider does not recognise -- the two are told apart by `writable`.
29112
+ */
29113
+ fn: PtzPresetFunctionSchema.nullable(),
29114
+ /**
29115
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
29116
+ * it false only for a band it KNOWS is reserved; where the firmware is not
29117
+ * documented it stays true and a refusal comes from the camera, named.
29118
+ */
29119
+ writable: boolean()
29077
29120
  });
29121
+ /**
29122
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
29123
+ * read it.
29124
+ *
29125
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
29126
+ * position no way to say so. All four said `0`:
29127
+ *
29128
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
29129
+ * path lands upstream"
29130
+ * hikvision stub, "firmware-dependent and frequently absent"
29131
+ * amcrest stub, "no generic absolute-position read for this model family"
29132
+ * onvif throws
29133
+ *
29134
+ * So every consumer asking where a camera points was told "perfectly centred"
29135
+ * by four cameras that had never looked. That is D393 -- a measurement that
29136
+ * FAILED is `null`, never `0`, and the type says so all the way to the
29137
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
29138
+ * headroom", which evacuated a healthy disk.
29139
+ *
29140
+ * D393 also says to check for a narrower structural TWIN of the result type.
29141
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
29142
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
29143
+ * tells callers to migrate to.
29144
+ */
29078
29145
  var PtzPositionSchema = object({
29079
- pan: number(),
29080
- tilt: number(),
29081
- zoom: number()
29146
+ pan: number().nullable(),
29147
+ tilt: number().nullable(),
29148
+ zoom: number().nullable()
29082
29149
  });
29083
29150
  var PtzMoveCommandSchema = object({
29084
29151
  pan: number().optional(),
@@ -29097,7 +29164,72 @@ var PtzOptionsSchema = object({
29097
29164
  maxPresets: number().optional(),
29098
29165
  /** Whether the camera exposes a controllable autofocus toggle
29099
29166
  * (boolean `hasX` per the getOptions availability convention). */
29100
- hasAutofocus: boolean()
29167
+ hasAutofocus: boolean(),
29168
+ /**
29169
+ * How many distinct speeds this camera's NATIVE scale offers.
29170
+ *
29171
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
29172
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
29173
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
29174
+ * meaningless, because it has eight steps and three of them round to the
29175
+ * same one. A loop that tunes its own gain has to know the granularity of
29176
+ * the knob it is turning.
29177
+ *
29178
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
29179
+ * a float). Never a made-up number.
29180
+ */
29181
+ speedSteps: number().int().positive().nullable(),
29182
+ /**
29183
+ * How long ONE `move` pulse runs on this driver, ms.
29184
+ *
29185
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
29186
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
29187
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
29188
+ * did the head travel per pulse": without it a measured displacement has no
29189
+ * gain to be divided into.
29190
+ *
29191
+ * `null` = the driver cannot say.
29192
+ */
29193
+ moveImpulseMs: number().int().positive().nullable()
29194
+ });
29195
+ /**
29196
+ * Which preset `goHome` goes to, and WHO decided.
29197
+ *
29198
+ * `goHome` used to be three vendor "conventions" written in three comments --
29199
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
29200
+ * not one of the three cameras honours its own:
29201
+ *
29202
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
29203
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
29204
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
29205
+ *
29206
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
29207
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
29208
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
29209
+ * needs an answer that is true per camera and audible when it is missing.
29210
+ *
29211
+ * `source` is what makes it honest:
29212
+ * - `operator` -- picked in the UI, stored by the provider.
29213
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
29214
+ * "Back to origin"), adopted as the default with nothing to configure.
29215
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
29216
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
29217
+ * that is not a failure -- there is nothing to pick, and the UI must offer
29218
+ * no picker.
29219
+ * - `none` -- nothing is configured and the camera names nothing.
29220
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
29221
+ *
29222
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
29223
+ * native case has no preset and homes perfectly well.
29224
+ */
29225
+ var PtzHomePresetSchema = object({
29226
+ presetId: string().nullable(),
29227
+ source: _enum([
29228
+ "operator",
29229
+ "firmware",
29230
+ "native",
29231
+ "none"
29232
+ ])
29101
29233
  });
29102
29234
  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({
29103
29235
  deviceId: number(),
@@ -29115,7 +29247,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
29115
29247
  }), _void(), {
29116
29248
  kind: "mutation",
29117
29249
  auth: "admin"
29118
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
29250
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
29251
+ deviceId: number(),
29252
+ presetId: string().nullable()
29253
+ }), _void(), {
29254
+ kind: "mutation",
29255
+ auth: "admin"
29256
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
29119
29257
  deviceId: number(),
29120
29258
  enabled: boolean()
29121
29259
  }), _void(), { kind: "mutation" });
@@ -36130,6 +36268,12 @@ Object.freeze({
36130
36268
  addonId: null,
36131
36269
  access: "delete"
36132
36270
  },
36271
+ "ptz.getHomePreset": {
36272
+ capName: "ptz",
36273
+ capScope: "device",
36274
+ addonId: null,
36275
+ access: "view"
36276
+ },
36133
36277
  "ptz.getOptions": {
36134
36278
  capName: "ptz",
36135
36279
  capScope: "device",
@@ -36178,6 +36322,12 @@ Object.freeze({
36178
36322
  addonId: null,
36179
36323
  access: "create"
36180
36324
  },
36325
+ "ptz.setHomePreset": {
36326
+ capName: "ptz",
36327
+ capScope: "device",
36328
+ addonId: null,
36329
+ access: "create"
36330
+ },
36181
36331
  "ptz.stop": {
36182
36332
  capName: "ptz",
36183
36333
  capScope: "device",
@@ -39351,6 +39501,11 @@ Object.freeze({
39351
39501
  form: "single",
39352
39502
  optional: false
39353
39503
  }],
39504
+ "ptz.getHomePreset": [{
39505
+ name: "deviceId",
39506
+ form: "single",
39507
+ optional: false
39508
+ }],
39354
39509
  "ptz.getOptions": [{
39355
39510
  name: "deviceId",
39356
39511
  form: "single",
@@ -39391,6 +39546,11 @@ Object.freeze({
39391
39546
  form: "single",
39392
39547
  optional: false
39393
39548
  }],
39549
+ "ptz.setHomePreset": [{
39550
+ name: "deviceId",
39551
+ form: "single",
39552
+ optional: false
39553
+ }],
39394
39554
  "ptz.stop": [{
39395
39555
  name: "deviceId",
39396
39556
  form: "single",
@@ -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).
@@ -29044,14 +29044,81 @@ DeviceType.Camera, method(object({ deviceId: number() }), PrivacyMaskOptionsSche
29044
29044
  kind: "mutation",
29045
29045
  auth: "admin"
29046
29046
  });
29047
+ /**
29048
+ * What a preset id DOES on this camera.
29049
+ *
29050
+ * On several PTZ firmwares the preset namespace is shared: low ids are stored
29051
+ * positions, a reserved band triggers camera FUNCTIONS. The dispensa camera
29052
+ * (Hikvision) returns its own reserved band in the preset list, named by the
29053
+ * firmware:
29054
+ *
29055
+ * 34 Back to origin · 39 Day mode · 40 Night mode · 46 Day/Night Auto Mode
29056
+ * 92 Set manual limits · 93 Save manual limits · 94 Remote reboot
29057
+ * 95 Call OSD menu
29058
+ *
29059
+ * We used to hand all of these to the UI as ordinary presets. Saving over one
29060
+ * is what produced `PUT /ISAPI/PTZCtrl/channels/1/presets/34 -> HTTP 500`: the
29061
+ * camera refusing to let "Back to origin" be overwritten, surfaced to the
29062
+ * operator as a transport failure.
29063
+ *
29064
+ * A function preset stays fully usable as a DESTINATION -- `goToPreset('34')`
29065
+ * is the single most useful thing that camera can do. Only `savePreset` and
29066
+ * `deletePreset` are gated.
29067
+ */
29068
+ var PtzPresetFunctionSchema = _enum([
29069
+ "home",
29070
+ "day-mode",
29071
+ "night-mode",
29072
+ "day-night-auto",
29073
+ "set-limits",
29074
+ "save-limits",
29075
+ "reboot",
29076
+ "osd-menu"
29077
+ ]);
29047
29078
  var PtzPresetSchema = object({
29048
29079
  id: string(),
29049
- name: string()
29080
+ name: string(),
29081
+ /**
29082
+ * The firmware function this id performs, when the provider KNOWS the id is
29083
+ * reserved. `null` = an ordinary stored position, OR a reserved id this
29084
+ * provider does not recognise -- the two are told apart by `writable`.
29085
+ */
29086
+ fn: PtzPresetFunctionSchema.nullable(),
29087
+ /**
29088
+ * Whether `savePreset` / `deletePreset` may target this id. A provider sets
29089
+ * it false only for a band it KNOWS is reserved; where the firmware is not
29090
+ * documented it stays true and a refusal comes from the camera, named.
29091
+ */
29092
+ writable: boolean()
29050
29093
  });
29094
+ /**
29095
+ * Where the head is pointing -- per axis, and `null` when the driver cannot
29096
+ * read it.
29097
+ *
29098
+ * It used to be three REQUIRED numbers, which left a provider that cannot read
29099
+ * position no way to say so. All four said `0`:
29100
+ *
29101
+ * reolink `return { pan: 0, tilt: 0, zoom: 0 }` "until a position-query
29102
+ * path lands upstream"
29103
+ * hikvision stub, "firmware-dependent and frequently absent"
29104
+ * amcrest stub, "no generic absolute-position read for this model family"
29105
+ * onvif throws
29106
+ *
29107
+ * So every consumer asking where a camera points was told "perfectly centred"
29108
+ * by four cameras that had never looked. That is D393 -- a measurement that
29109
+ * FAILED is `null`, never `0`, and the type says so all the way to the
29110
+ * decision -- the same shape as the unreadable `statfs` folded into "0 bytes of
29111
+ * headroom", which evacuated a healthy disk.
29112
+ *
29113
+ * D393 also says to check for a narrower structural TWIN of the result type.
29114
+ * There is one: `PtzStatusSchema` extends this, so the lie had already
29115
+ * propagated into `getStatus`, which is the surface `getPosition`'s own comment
29116
+ * tells callers to migrate to.
29117
+ */
29051
29118
  var PtzPositionSchema = object({
29052
- pan: number(),
29053
- tilt: number(),
29054
- zoom: number()
29119
+ pan: number().nullable(),
29120
+ tilt: number().nullable(),
29121
+ zoom: number().nullable()
29055
29122
  });
29056
29123
  var PtzMoveCommandSchema = object({
29057
29124
  pan: number().optional(),
@@ -29070,7 +29137,72 @@ var PtzOptionsSchema = object({
29070
29137
  maxPresets: number().optional(),
29071
29138
  /** Whether the camera exposes a controllable autofocus toggle
29072
29139
  * (boolean `hasX` per the getOptions availability convention). */
29073
- hasAutofocus: boolean()
29140
+ hasAutofocus: boolean(),
29141
+ /**
29142
+ * How many distinct speeds this camera's NATIVE scale offers.
29143
+ *
29144
+ * The cap's `speed` is normalized 0..1 and each provider maps it down --
29145
+ * Baichuan 1..63, Dahua 1..8, ISAPI's percentage -100..100. The normalized
29146
+ * value hides how coarse that really is: asking an amcrest for `0.37` is
29147
+ * meaningless, because it has eight steps and three of them round to the
29148
+ * same one. A loop that tunes its own gain has to know the granularity of
29149
+ * the knob it is turning.
29150
+ *
29151
+ * `null` = the driver does not know, or the scale is continuous (ONVIF takes
29152
+ * a float). Never a made-up number.
29153
+ */
29154
+ speedSteps: number().int().positive().nullable(),
29155
+ /**
29156
+ * How long ONE `move` pulse runs on this driver, ms.
29157
+ *
29158
+ * `move` is a self-terminating burst everywhere, but every provider hardcoded
29159
+ * its own duration in private -- 200 reolink, 350 amcrest, 500 hikvision,
29160
+ * 1000 onvif -- so no caller could read it. It is the DENOMINATOR of "how far
29161
+ * did the head travel per pulse": without it a measured displacement has no
29162
+ * gain to be divided into.
29163
+ *
29164
+ * `null` = the driver cannot say.
29165
+ */
29166
+ moveImpulseMs: number().int().positive().nullable()
29167
+ });
29168
+ /**
29169
+ * Which preset `goHome` goes to, and WHO decided.
29170
+ *
29171
+ * `goHome` used to be three vendor "conventions" written in three comments --
29172
+ * Reolink preset 0, Hikvision preset '1', Dahua preset 1 -- and on this fleet
29173
+ * not one of the three cameras honours its own:
29174
+ *
29175
+ * 592 Videocamera camera Daniel (reolink) preset 0 holds "stanza"
29176
+ * 1438 Videocamera dispensa (hikvision) preset 1 holds "Credenza"
29177
+ * 3836 Videocamera studio (amcrest) preset 1 holds "Preset1"
29178
+ *
29179
+ * So `goHome` meant "go wherever the operator happened to save in slot 0 or 1",
29180
+ * and two of the three swallowed the failure in a bare `catch`. For autotrack
29181
+ * this is the HOTTEST path -- it runs every time a subject is released -- so it
29182
+ * needs an answer that is true per camera and audible when it is missing.
29183
+ *
29184
+ * `source` is what makes it honest:
29185
+ * - `operator` -- picked in the UI, stored by the provider.
29186
+ * - `firmware` -- the camera itself named a preset `fn: 'home'` (Hikvision's
29187
+ * "Back to origin"), adopted as the default with nothing to configure.
29188
+ * - `native` -- the driver homes WITHOUT a preset at all. ONVIF does:
29189
+ * `goHome` is `ptzAbsoluteMove({x:0, y:0, zoom:0})`. `presetId` is null and
29190
+ * that is not a failure -- there is nothing to pick, and the UI must offer
29191
+ * no picker.
29192
+ * - `none` -- nothing is configured and the camera names nothing.
29193
+ * `goHome` REFUSES rather than moving the head somewhere arbitrary.
29194
+ *
29195
+ * `source === 'none'` is the refusal condition, NOT `presetId === null`: the
29196
+ * native case has no preset and homes perfectly well.
29197
+ */
29198
+ var PtzHomePresetSchema = object({
29199
+ presetId: string().nullable(),
29200
+ source: _enum([
29201
+ "operator",
29202
+ "firmware",
29203
+ "native",
29204
+ "none"
29205
+ ])
29074
29206
  });
29075
29207
  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({
29076
29208
  deviceId: number(),
@@ -29088,7 +29220,13 @@ DeviceType.Camera, method(PtzMoveCommandSchema.extend({ deviceId: number() }), _
29088
29220
  }), _void(), {
29089
29221
  kind: "mutation",
29090
29222
  auth: "admin"
29091
- }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
29223
+ }), method(object({ deviceId: number() }), PtzOptionsSchema), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), PtzHomePresetSchema), method(object({
29224
+ deviceId: number(),
29225
+ presetId: string().nullable()
29226
+ }), _void(), {
29227
+ kind: "mutation",
29228
+ auth: "admin"
29229
+ }), method(object({ deviceId: number() }), PtzPositionSchema), method(object({
29092
29230
  deviceId: number(),
29093
29231
  enabled: boolean()
29094
29232
  }), _void(), { kind: "mutation" });
@@ -36103,6 +36241,12 @@ Object.freeze({
36103
36241
  addonId: null,
36104
36242
  access: "delete"
36105
36243
  },
36244
+ "ptz.getHomePreset": {
36245
+ capName: "ptz",
36246
+ capScope: "device",
36247
+ addonId: null,
36248
+ access: "view"
36249
+ },
36106
36250
  "ptz.getOptions": {
36107
36251
  capName: "ptz",
36108
36252
  capScope: "device",
@@ -36151,6 +36295,12 @@ Object.freeze({
36151
36295
  addonId: null,
36152
36296
  access: "create"
36153
36297
  },
36298
+ "ptz.setHomePreset": {
36299
+ capName: "ptz",
36300
+ capScope: "device",
36301
+ addonId: null,
36302
+ access: "create"
36303
+ },
36154
36304
  "ptz.stop": {
36155
36305
  capName: "ptz",
36156
36306
  capScope: "device",
@@ -39324,6 +39474,11 @@ Object.freeze({
39324
39474
  form: "single",
39325
39475
  optional: false
39326
39476
  }],
39477
+ "ptz.getHomePreset": [{
39478
+ name: "deviceId",
39479
+ form: "single",
39480
+ optional: false
39481
+ }],
39327
39482
  "ptz.getOptions": [{
39328
39483
  name: "deviceId",
39329
39484
  form: "single",
@@ -39364,6 +39519,11 @@ Object.freeze({
39364
39519
  form: "single",
39365
39520
  optional: false
39366
39521
  }],
39522
+ "ptz.setHomePreset": [{
39523
+ name: "deviceId",
39524
+ form: "single",
39525
+ optional: false
39526
+ }],
39367
39527
  "ptz.stop": [{
39368
39528
  name: "deviceId",
39369
39529
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-alexa",
3
- "version": "1.2.117",
3
+ "version": "1.2.118",
4
4
  "description": "Alexa Smart Home Skill export — hub-side OAuth provider + directive handler. The companion AWS Lambda forwards Alexa directives to this addon's /addon/export-alexa/directive endpoint.",
5
5
  "keywords": [
6
6
  "camstack",