@seamapi/types 1.1042.0 → 1.1043.0

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.
@@ -50085,10 +50085,13 @@ export type Routes = {
50085
50085
  [x: string]: string | boolean;
50086
50086
  } | undefined;
50087
50087
  event_type: 'device.low_battery';
50088
- /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */
50088
+ /** Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.
50089
+ * @deprecated Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.*/
50089
50090
  battery_level: number;
50090
- /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */
50091
- battery_source?: ('lock' | 'accessory_keypad') | undefined;
50091
+ /** Number in the range 0 to 1.0 indicating the affected device's own battery level, when known. */
50092
+ device_battery_level?: number | undefined;
50093
+ /** Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known. */
50094
+ accessory_keypad_battery_level?: number | undefined;
50092
50095
  } | {
50093
50096
  /** ID of the event. */
50094
50097
  event_id: string;
@@ -53713,10 +53716,13 @@ export type Routes = {
53713
53716
  [x: string]: string | boolean;
53714
53717
  } | undefined;
53715
53718
  event_type: 'device.low_battery';
53716
- /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */
53719
+ /** Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.
53720
+ * @deprecated Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.*/
53717
53721
  battery_level: number;
53718
- /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */
53719
- battery_source?: ('lock' | 'accessory_keypad') | undefined;
53722
+ /** Number in the range 0 to 1.0 indicating the affected device's own battery level, when known. */
53723
+ device_battery_level?: number | undefined;
53724
+ /** Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known. */
53725
+ accessory_keypad_battery_level?: number | undefined;
53720
53726
  } | {
53721
53727
  /** ID of the event. */
53722
53728
  event_id: string;
@@ -85409,10 +85415,13 @@ export type Routes = {
85409
85415
  [x: string]: string | boolean;
85410
85416
  } | undefined;
85411
85417
  event_type: 'device.low_battery';
85412
- /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */
85418
+ /** Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.
85419
+ * @deprecated Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.*/
85413
85420
  battery_level: number;
85414
- /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */
85415
- battery_source?: ('lock' | 'accessory_keypad') | undefined;
85421
+ /** Number in the range 0 to 1.0 indicating the affected device's own battery level, when known. */
85422
+ device_battery_level?: number | undefined;
85423
+ /** Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known. */
85424
+ accessory_keypad_battery_level?: number | undefined;
85416
85425
  } | {
85417
85426
  /** ID of the event. */
85418
85427
  event_id: string;
@@ -125447,10 +125456,13 @@ export type Routes = {
125447
125456
  [x: string]: string | boolean;
125448
125457
  } | undefined;
125449
125458
  event_type: 'device.low_battery';
125450
- /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */
125459
+ /** Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.
125460
+ * @deprecated Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.*/
125451
125461
  battery_level: number;
125452
- /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */
125453
- battery_source?: ('lock' | 'accessory_keypad') | undefined;
125462
+ /** Number in the range 0 to 1.0 indicating the affected device's own battery level, when known. */
125463
+ device_battery_level?: number | undefined;
125464
+ /** Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known. */
125465
+ accessory_keypad_battery_level?: number | undefined;
125454
125466
  } | {
125455
125467
  /** ID of the event. */
125456
125468
  event_id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.1042.0",
3
+ "version": "1.1043.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -45,10 +45,20 @@ const device_battery_status = z
45
45
  'Battery status of the affected device, calculated from the numeric `battery_level` value.',
46
46
  )
47
47
 
48
- const battery_source = z
49
- .enum(['lock', 'accessory_keypad'])
48
+ const device_battery_level = z
49
+ .number()
50
+ .min(0)
51
+ .max(1)
52
+ .describe(
53
+ "Number in the range 0 to 1.0 indicating the affected device's own battery level, when known.",
54
+ )
55
+
56
+ const accessory_keypad_battery_level = z
57
+ .number()
58
+ .min(0)
59
+ .max(1)
50
60
  .describe(
51
- "Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery.",
61
+ "Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known.",
52
62
  )
53
63
 
54
64
  const disconnection_error_code = z
@@ -181,8 +191,14 @@ export type DeviceTamperedEvent = z.infer<typeof device_tampered_event>
181
191
 
182
192
  export const device_low_battery_event = device_event.extend({
183
193
  event_type: z.literal('device.low_battery'),
184
- battery_level,
185
- battery_source: battery_source.optional(),
194
+ battery_level: battery_level.describe(`
195
+ ---
196
+ deprecated: Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.
197
+ ---
198
+ Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.
199
+ `),
200
+ device_battery_level: device_battery_level.optional(),
201
+ accessory_keypad_battery_level: accessory_keypad_battery_level.optional(),
186
202
  }).describe(`
187
203
  ---
188
204
  route_path: /devices
@@ -25989,19 +25989,24 @@ const openapi: OpenAPISpec = {
25989
25989
  description:
25990
25990
  'A device battery level dropped below the low threshold.',
25991
25991
  properties: {
25992
- battery_level: {
25992
+ accessory_keypad_battery_level: {
25993
25993
  description:
25994
- 'Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device.',
25994
+ "Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known.",
25995
25995
  format: 'float',
25996
25996
  maximum: 1,
25997
25997
  minimum: 0,
25998
25998
  type: 'number',
25999
25999
  },
26000
- battery_source: {
26000
+ battery_level: {
26001
+ deprecated: true,
26001
26002
  description:
26002
- "Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery.",
26003
- enum: ['lock', 'accessory_keypad'],
26004
- type: 'string',
26003
+ 'Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.',
26004
+ format: 'float',
26005
+ maximum: 1,
26006
+ minimum: 0,
26007
+ type: 'number',
26008
+ 'x-deprecated':
26009
+ "Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.",
26005
26010
  },
26006
26011
  connected_account_custom_metadata: {
26007
26012
  additionalProperties: {
@@ -26027,6 +26032,14 @@ const openapi: OpenAPISpec = {
26027
26032
  'The customer key associated with the device, if any.',
26028
26033
  type: 'string',
26029
26034
  },
26035
+ device_battery_level: {
26036
+ description:
26037
+ "Number in the range 0 to 1.0 indicating the affected device's own battery level, when known.",
26038
+ format: 'float',
26039
+ maximum: 1,
26040
+ minimum: 0,
26041
+ type: 'number',
26042
+ },
26030
26043
  device_custom_metadata: {
26031
26044
  additionalProperties: {
26032
26045
  oneOf: [{ type: 'string' }, { type: 'boolean' }],
@@ -60500,10 +60500,13 @@ export type Routes = {
60500
60500
  }
60501
60501
  | undefined
60502
60502
  event_type: 'device.low_battery'
60503
- /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */
60503
+ /** Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.
60504
+ * @deprecated Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.*/
60504
60505
  battery_level: number
60505
- /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */
60506
- battery_source?: ('lock' | 'accessory_keypad') | undefined
60506
+ /** Number in the range 0 to 1.0 indicating the affected device's own battery level, when known. */
60507
+ device_battery_level?: number | undefined
60508
+ /** Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known. */
60509
+ accessory_keypad_battery_level?: number | undefined
60507
60510
  }
60508
60511
  | {
60509
60512
  /** ID of the event. */
@@ -64791,10 +64794,13 @@ export type Routes = {
64791
64794
  }
64792
64795
  | undefined
64793
64796
  event_type: 'device.low_battery'
64794
- /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */
64797
+ /** Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.
64798
+ * @deprecated Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.*/
64795
64799
  battery_level: number
64796
- /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */
64797
- battery_source?: ('lock' | 'accessory_keypad') | undefined
64800
+ /** Number in the range 0 to 1.0 indicating the affected device's own battery level, when known. */
64801
+ device_battery_level?: number | undefined
64802
+ /** Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known. */
64803
+ accessory_keypad_battery_level?: number | undefined
64798
64804
  }
64799
64805
  | {
64800
64806
  /** ID of the event. */
@@ -102513,10 +102519,13 @@ export type Routes = {
102513
102519
  }
102514
102520
  | undefined
102515
102521
  event_type: 'device.low_battery'
102516
- /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */
102522
+ /** Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.
102523
+ * @deprecated Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.*/
102517
102524
  battery_level: number
102518
- /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */
102519
- battery_source?: ('lock' | 'accessory_keypad') | undefined
102525
+ /** Number in the range 0 to 1.0 indicating the affected device's own battery level, when known. */
102526
+ device_battery_level?: number | undefined
102527
+ /** Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known. */
102528
+ accessory_keypad_battery_level?: number | undefined
102520
102529
  }
102521
102530
  | {
102522
102531
  /** ID of the event. */
@@ -150041,10 +150050,13 @@ export type Routes = {
150041
150050
  }
150042
150051
  | undefined
150043
150052
  event_type: 'device.low_battery'
150044
- /** Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. */
150053
+ /** Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event.
150054
+ * @deprecated Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery.*/
150045
150055
  battery_level: number
150046
- /** Battery that dropped below the low threshold. `lock`: the lock's own battery. `accessory_keypad`: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. */
150047
- battery_source?: ('lock' | 'accessory_keypad') | undefined
150056
+ /** Number in the range 0 to 1.0 indicating the affected device's own battery level, when known. */
150057
+ device_battery_level?: number | undefined
150058
+ /** Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known. */
150059
+ accessory_keypad_battery_level?: number | undefined
150048
150060
  }
150049
150061
  | {
150050
150062
  /** ID of the event. */