@seamapi/types 1.360.0 → 1.361.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.
Files changed (61) hide show
  1. package/dist/connect.cjs +1645 -1159
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +5946 -4573
  4. package/lib/seam/connect/models/access-codes/managed-access-code.d.ts +192 -126
  5. package/lib/seam/connect/models/access-codes/managed-access-code.js +2 -4
  6. package/lib/seam/connect/models/access-codes/managed-access-code.js.map +1 -1
  7. package/lib/seam/connect/models/access-codes/unmanaged-access-code.d.ts +193 -127
  8. package/lib/seam/connect/models/acs/acs-access-group.d.ts +4 -4
  9. package/lib/seam/connect/models/acs/acs-credential-pool.d.ts +2 -2
  10. package/lib/seam/connect/models/acs/acs-credential.d.ts +6 -6
  11. package/lib/seam/connect/models/acs/acs-credential.js +94 -51
  12. package/lib/seam/connect/models/acs/acs-credential.js.map +1 -1
  13. package/lib/seam/connect/models/acs/acs-encoder.d.ts +2 -2
  14. package/lib/seam/connect/models/acs/acs-encoder.js +12 -7
  15. package/lib/seam/connect/models/acs/acs-encoder.js.map +1 -1
  16. package/lib/seam/connect/models/acs/acs-entrance.d.ts +2 -2
  17. package/lib/seam/connect/models/acs/acs-entrance.js +37 -14
  18. package/lib/seam/connect/models/acs/acs-entrance.js.map +1 -1
  19. package/lib/seam/connect/models/acs/acs-system.d.ts +2 -2
  20. package/lib/seam/connect/models/acs/acs-system.js +48 -41
  21. package/lib/seam/connect/models/acs/acs-system.js.map +1 -1
  22. package/lib/seam/connect/models/acs/acs-user.d.ts +4 -4
  23. package/lib/seam/connect/models/acs/acs-user.js +45 -32
  24. package/lib/seam/connect/models/acs/acs-user.js.map +1 -1
  25. package/lib/seam/connect/models/action-attempts/action-attempt.d.ts +26 -26
  26. package/lib/seam/connect/models/action-attempts/encode-credential.d.ts +8 -8
  27. package/lib/seam/connect/models/action-attempts/scan-credential.d.ts +18 -18
  28. package/lib/seam/connect/models/connected-accounts/connected-account.d.ts +42 -42
  29. package/lib/seam/connect/models/devices/capability-properties/index.d.ts +18 -18
  30. package/lib/seam/connect/models/devices/capability-properties/thermostat.d.ts +18 -18
  31. package/lib/seam/connect/models/devices/device.d.ts +1760 -389
  32. package/lib/seam/connect/models/devices/device.js +82 -4
  33. package/lib/seam/connect/models/devices/device.js.map +1 -1
  34. package/lib/seam/connect/models/devices/phone.d.ts +4 -4
  35. package/lib/seam/connect/models/devices/unmanaged-device.d.ts +236 -58
  36. package/lib/seam/connect/models/events/access-codes.d.ts +68 -68
  37. package/lib/seam/connect/models/events/devices.d.ts +152 -152
  38. package/lib/seam/connect/models/events/phones.d.ts +4 -4
  39. package/lib/seam/connect/models/events/seam-event.d.ts +112 -112
  40. package/lib/seam/connect/models/thermostats/climate-preset.js +12 -10
  41. package/lib/seam/connect/models/thermostats/climate-preset.js.map +1 -1
  42. package/lib/seam/connect/models/thermostats/thermostat-schedule.d.ts +8 -8
  43. package/lib/seam/connect/models/thermostats/thermostat-schedule.js +19 -12
  44. package/lib/seam/connect/models/thermostats/thermostat-schedule.js.map +1 -1
  45. package/lib/seam/connect/models/user-identities/user-identity.d.ts +2 -2
  46. package/lib/seam/connect/openapi.d.ts +103 -171
  47. package/lib/seam/connect/openapi.js +1120 -864
  48. package/lib/seam/connect/openapi.js.map +1 -1
  49. package/lib/seam/connect/route-types.d.ts +4421 -3576
  50. package/package.json +1 -1
  51. package/src/lib/seam/connect/models/access-codes/managed-access-code.ts +2 -4
  52. package/src/lib/seam/connect/models/acs/acs-credential.ts +162 -51
  53. package/src/lib/seam/connect/models/acs/acs-encoder.ts +22 -7
  54. package/src/lib/seam/connect/models/acs/acs-entrance.ts +65 -18
  55. package/src/lib/seam/connect/models/acs/acs-system.ts +81 -52
  56. package/src/lib/seam/connect/models/acs/acs-user.ts +69 -32
  57. package/src/lib/seam/connect/models/devices/device.ts +103 -4
  58. package/src/lib/seam/connect/models/thermostats/climate-preset.ts +28 -10
  59. package/src/lib/seam/connect/models/thermostats/thermostat-schedule.ts +31 -12
  60. package/src/lib/seam/connect/openapi.ts +1259 -878
  61. package/src/lib/seam/connect/route-types.ts +4469 -3648
@@ -24,6 +24,7 @@ export type BatteryStatus = z.infer<typeof battery_status>
24
24
  const common_device_error = z.object({
25
25
  message: z.string(),
26
26
  is_device_error: z.literal(true),
27
+ created_at: z.string().datetime(),
27
28
  })
28
29
 
29
30
  const error_code_description =
@@ -55,6 +56,16 @@ const device_disconnected = common_device_error
55
56
  })
56
57
  .describe('Device is disconnected')
57
58
 
59
+ const account_disconnected = common_device_error
60
+ .extend({
61
+ error_code: z
62
+ .literal('account_disconnected')
63
+ .describe(error_code_description),
64
+ is_connected_account_error: z.literal(true),
65
+ is_device_error: z.literal(false),
66
+ })
67
+ .describe('Account is disconnected')
68
+
58
69
  const empty_backup_access_code_pool = common_device_error
59
70
  .extend({
60
71
  error_code: z
@@ -79,11 +90,13 @@ const august_lock_missing_bridge = common_device_error
79
90
  })
80
91
  .describe('Lock is not connected to the Seam Bridge.')
81
92
 
82
- const salto_site_user_limit_reached = common_device_error
93
+ const salto_ks_subscription_limit_exceeded = common_device_error
83
94
  .extend({
84
95
  error_code: z
85
- .literal('salto_site_user_limit_reached')
96
+ .literal('salto_ks_subscription_limit_exceeded')
86
97
  .describe(error_code_description),
98
+ is_connected_account_error: z.literal(true),
99
+ is_device_error: z.literal(false),
87
100
  })
88
101
  .describe('Salto site user limit reached.')
89
102
 
@@ -121,6 +134,8 @@ const subscription_required = common_device_error
121
134
 
122
135
  export const device_error = z
123
136
  .discriminatedUnion('error_code', [
137
+ account_disconnected,
138
+ salto_ks_subscription_limit_exceeded,
124
139
  device_offline,
125
140
  device_removed,
126
141
  hub_disconnected,
@@ -128,7 +143,6 @@ export const device_error = z
128
143
  empty_backup_access_code_pool,
129
144
  august_lock_not_authorized,
130
145
  august_lock_missing_bridge,
131
- salto_site_user_limit_reached,
132
146
  ttlock_lock_not_paired_to_gateway,
133
147
  missing_device_credentials,
134
148
  auxiliary_heat_running,
@@ -138,11 +152,36 @@ export const device_error = z
138
152
 
139
153
  export type DeviceError = z.infer<typeof device_error>
140
154
 
155
+ const device_error_map = z.object({
156
+ device_offline: device_offline.optional().nullable(),
157
+ device_removed: device_removed.optional().nullable(),
158
+ hub_disconnected: hub_disconnected.optional().nullable(),
159
+ device_disconnected: device_disconnected.optional().nullable(),
160
+ account_disconnected: account_disconnected.optional().nullable(),
161
+ empty_backup_access_code_pool: empty_backup_access_code_pool
162
+ .optional()
163
+ .nullable(),
164
+ august_lock_not_authorized: august_lock_not_authorized.optional().nullable(),
165
+ august_lock_missing_bridge: august_lock_missing_bridge.optional().nullable(),
166
+ salto_ks_subscription_limit_exceeded: salto_ks_subscription_limit_exceeded
167
+ .optional()
168
+ .nullable(),
169
+ ttlock_lock_not_paired_to_gateway: ttlock_lock_not_paired_to_gateway
170
+ .optional()
171
+ .nullable(),
172
+ missing_device_credentials: missing_device_credentials.optional().nullable(),
173
+ auxiliary_heat_running: auxiliary_heat_running.optional().nullable(),
174
+ subscription_required: subscription_required.optional().nullable(),
175
+ })
176
+
177
+ export type DeviceErrorMap = z.infer<typeof device_error_map>
178
+
141
179
  const warning_code_description =
142
180
  'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.'
143
181
 
144
182
  const common_device_warning = z.object({
145
183
  message: z.string(),
184
+ created_at: z.string().datetime(),
146
185
  })
147
186
 
148
187
  const partial_backup_access_code_pool = common_device_warning
@@ -297,6 +336,47 @@ const device_warning = z.discriminatedUnion('warning_code', [
297
336
 
298
337
  export type DeviceWarning = z.infer<typeof device_warning>
299
338
 
339
+ export const device_warning_map = z.object({
340
+ partial_backup_access_code_pool: partial_backup_access_code_pool
341
+ .optional()
342
+ .nullable(),
343
+ many_active_backup_codes: many_active_backup_codes.optional().nullable(),
344
+ salto_unknown_device_type: salto_unknown_device_type.optional().nullable(),
345
+ wyze_device_missing_gateway: wyze_device_missing_gateway
346
+ .optional()
347
+ .nullable(),
348
+ functional_offline_device: functional_offline_device.optional().nullable(),
349
+ third_party_integration_detected: third_party_integration_detected
350
+ .optional()
351
+ .nullable(),
352
+ nest_thermostat_in_manual_eco_mode: nest_thermostat_in_manual_eco_mode
353
+ .optional()
354
+ .nullable(),
355
+ ttlock_lock_gateway_unlocking_not_enabled:
356
+ ttlock_lock_gateway_unlocking_not_enabled.optional().nullable(),
357
+ ttlock_weak_gateway_signal: ttlock_weak_gateway_signal.optional().nullable(),
358
+ temperature_threshold_exceeded: temperature_threshold_exceeded
359
+ .optional()
360
+ .nullable(),
361
+ device_communication_degraded: device_communication_degraded
362
+ .optional()
363
+ .nullable(),
364
+ scheduled_maintenance_window: scheduled_maintenance_window
365
+ .optional()
366
+ .nullable(),
367
+ device_has_flaky_connection: device_has_flaky_connection
368
+ .extend({
369
+ _event_id: z.string().uuid().optional(),
370
+ })
371
+ .optional()
372
+ .nullable(),
373
+ salto_office_mode: salto_office_mode.optional().nullable(),
374
+ salto_privacy_mode: salto_privacy_mode.optional().nullable(),
375
+ unknown_issue_with_phone: unknown_issue_with_phone.optional().nullable(),
376
+ })
377
+
378
+ export type DeviceWarningMap = z.infer<typeof device_warning_map>
379
+
300
380
  export const common_device_properties = z.object({
301
381
  online: z.boolean().describe('Indicates whether the device is online.'),
302
382
  name: z.string().describe(`
@@ -440,6 +520,18 @@ export const common_device_properties = z.object({
440
520
  .optional(),
441
521
  })
442
522
 
523
+ export const device_and_connected_account_error_options = [
524
+ ...device_error.options,
525
+ ...connected_account_error.options.filter(
526
+ (_connected_account_error) =>
527
+ !device_error.options.some(
528
+ (_device_error) =>
529
+ _device_error.shape.error_code.value ===
530
+ _connected_account_error.shape.error_code.value,
531
+ ),
532
+ ),
533
+ ]
534
+
443
535
  export const device = z
444
536
  .object({
445
537
  device_id: z.string().uuid().describe('Unique identifier for the device.'),
@@ -495,7 +587,14 @@ export const device = z
495
587
  .array(
496
588
  z.discriminatedUnion('error_code', [
497
589
  ...device_error.options,
498
- ...connected_account_error.options,
590
+ ...connected_account_error.options.filter(
591
+ (_connected_account_error) =>
592
+ !device_error.options.some(
593
+ (_device_error) =>
594
+ _device_error.shape.error_code.value ===
595
+ _connected_account_error.shape.error_code.value,
596
+ ),
597
+ ),
499
598
  ]),
500
599
  )
501
600
  .describe(
@@ -5,24 +5,36 @@ import { fan_mode_setting, hvac_mode_setting } from './modes.js'
5
5
  export const climate_preset = z.object({
6
6
  climate_preset_key: z
7
7
  .string()
8
- .describe('Unique key to identify the climate preset.'),
8
+ .describe(
9
+ 'Unique key to identify the [climate preset](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-climate-presets).',
10
+ ),
9
11
  can_edit: z
10
12
  .boolean()
11
- .describe('Indicates whether this climate preset key can be edited.'),
13
+ .describe(
14
+ 'Indicates whether the [climate preset](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-climate-presets) key can be edited.',
15
+ ),
12
16
  can_delete: z
13
17
  .boolean()
14
- .describe('Indicates whether this climate preset key can be deleted.'),
18
+ .describe(
19
+ 'Indicates whether the [climate preset](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-climate-presets) key can be deleted.',
20
+ ),
15
21
  name: z
16
22
  .string()
17
23
  .nullable()
18
24
  .default(null)
19
25
  .optional()
20
- .describe('User-friendly name to identify the climate preset.'),
21
- display_name: z.string().describe('Display name for the climate preset.'),
26
+ .describe(
27
+ 'User-friendly name to identify the [climate preset](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-climate-presets).',
28
+ ),
29
+ display_name: z
30
+ .string()
31
+ .describe(
32
+ 'Display name for the [climate preset](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-climate-presets).',
33
+ ),
22
34
  fan_mode_setting: fan_mode_setting
23
35
  .optional()
24
36
  .describe(
25
- 'Desired fan mode setting, such as `on`, `auto`, or `circulate`.',
37
+ 'Desired [fan mode setting](https://docs.seam.co/latest/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`.',
26
38
  ),
27
39
  hvac_mode_setting: hvac_mode_setting
28
40
  .optional()
@@ -38,21 +50,27 @@ export const climate_preset = z.object({
38
50
  heating_set_point_celsius: z
39
51
  .number()
40
52
  .optional()
41
- .describe('Temperature to which the thermostat should heat (in °C).'),
53
+ .describe(
54
+ 'Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/latest/capability-guides/thermostats/understanding-thermostat-concepts/set-points).',
55
+ ),
42
56
  cooling_set_point_fahrenheit: z
43
57
  .number()
44
58
  .optional()
45
- .describe('Temperature to which the thermostat should cool (in °F).'),
59
+ .describe(
60
+ 'Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/latest/capability-guides/thermostats/understanding-thermostat-concepts/set-points).',
61
+ ),
46
62
  heating_set_point_fahrenheit: z
47
63
  .number()
48
64
  .optional()
49
- .describe('Temperature to which the thermostat should heat (in °F).'),
65
+ .describe(
66
+ 'Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/latest/capability-guides/thermostats/understanding-thermostat-concepts/set-points).',
67
+ ),
50
68
  manual_override_allowed: z.boolean().describe(
51
69
  `
52
70
  ---
53
71
  deprecated: Use 'thermostat_schedule.is_override_allowed'
54
72
  ---
55
- Indicates whether a person at the thermostat can change the thermostat's settings.`,
73
+ Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).`,
56
74
  ),
57
75
  })
58
76
 
@@ -4,29 +4,38 @@ export const thermostat_schedule = z.object({
4
4
  thermostat_schedule_id: z
5
5
  .string()
6
6
  .uuid()
7
- .describe('ID of the thermostat schedule.'),
8
- device_id: z.string().uuid().describe('ID of the desired thermostat device.'),
7
+ .describe(
8
+ 'ID of the [thermostat schedule](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules).',
9
+ ),
10
+ device_id: z
11
+ .string()
12
+ .uuid()
13
+ .describe(
14
+ 'ID of the desired [thermostat](https://docs.seam.co/latest/capability-guides/thermostats) device.',
15
+ ),
9
16
  name: z
10
17
  .string()
11
18
  .optional()
12
- .describe('User-friendly name to identify the thermostat schedule.'),
19
+ .describe(
20
+ 'User-friendly name to identify the [thermostat schedule](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules).',
21
+ ),
13
22
  climate_preset_key: z
14
23
  .string()
15
24
  .describe(
16
- 'Key of the [climate preset](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the thermostat schedule.',
25
+ 'Key of the [climate preset](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the [thermostat schedule](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules).',
17
26
  ),
18
27
  max_override_period_minutes: z
19
28
  .number()
20
29
  .int()
21
30
  .nonnegative()
22
31
  .describe(
23
- "Number of minutes for which a person at the thermostat can change the thermostat's settings after the activation of the scheduled climate preset. See also [Specifying Manual Override Permissions](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).",
32
+ "Number of minutes for which a person at the thermostat can change the thermostat's settings after the activation of the scheduled [climate preset](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-climate-presets). See also [Specifying Manual Override Permissions](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).",
24
33
  ),
25
34
  starts_at: z
26
35
  .string()
27
36
  .datetime()
28
37
  .describe(
29
- 'Date and time at which the thermostat schedule starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.',
38
+ 'Date and time at which the [thermostat schedule](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.',
30
39
  ),
31
40
  unstable_is_override_allowed: z
32
41
  .boolean()
@@ -36,27 +45,37 @@ export const thermostat_schedule = z.object({
36
45
  ---
37
46
  undocumented: Unstable
38
47
  ---
39
- Indicates whether a person at the thermostat can change the thermostat's settings.`,
48
+ Indicates whether a person at the thermostat can change the thermostat's settings after the [thermostat schedule](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts.`,
40
49
  ),
41
50
  ends_at: z
42
51
  .string()
43
52
  .datetime()
44
53
  .describe(
45
- 'Date and time at which the thermostat schedule ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.',
54
+ 'Date and time at which the [thermostat schedule](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules) ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.',
46
55
  ),
47
56
  created_at: z
48
57
  .string()
49
58
  .datetime()
50
- .describe('Date and time at which the thermostat schedule was created.'),
59
+ .describe(
60
+ 'Date and time at which the [thermostat schedule](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules) was created.',
61
+ ),
51
62
  errors: z
52
63
  .array(
53
64
  z.object({
54
- error_code: z.string(),
55
- message: z.string(),
65
+ error_code: z
66
+ .string()
67
+ .describe(
68
+ 'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
69
+ ),
70
+ message: z
71
+ .string()
72
+ .describe(
73
+ 'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
74
+ ),
56
75
  }),
57
76
  )
58
77
  .describe(
59
- 'Array of errors associated with the thermostat schedule. Each error object within the array contains two fields: `error_code` and `message`. `error_code` is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. `message` provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it.',
78
+ 'Errors associated with the [thermostat schedule](https://docs.seam.co/latest/capability-guides/thermostats/creating-and-managing-thermostat-schedules).',
60
79
  ),
61
80
  }).describe(`
62
81
  ---