@seamapi/types 1.360.1 → 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 (40) hide show
  1. package/dist/connect.cjs +739 -583
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +2320 -1622
  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-encoder.d.ts +2 -2
  12. package/lib/seam/connect/models/acs/acs-entrance.d.ts +2 -2
  13. package/lib/seam/connect/models/acs/acs-system.d.ts +2 -2
  14. package/lib/seam/connect/models/acs/acs-user.d.ts +4 -4
  15. package/lib/seam/connect/models/action-attempts/action-attempt.d.ts +26 -26
  16. package/lib/seam/connect/models/action-attempts/encode-credential.d.ts +8 -8
  17. package/lib/seam/connect/models/action-attempts/scan-credential.d.ts +18 -18
  18. package/lib/seam/connect/models/connected-accounts/connected-account.d.ts +42 -42
  19. package/lib/seam/connect/models/devices/capability-properties/index.d.ts +18 -18
  20. package/lib/seam/connect/models/devices/capability-properties/thermostat.d.ts +18 -18
  21. package/lib/seam/connect/models/devices/device.d.ts +1760 -389
  22. package/lib/seam/connect/models/devices/device.js +82 -4
  23. package/lib/seam/connect/models/devices/device.js.map +1 -1
  24. package/lib/seam/connect/models/devices/phone.d.ts +4 -4
  25. package/lib/seam/connect/models/devices/unmanaged-device.d.ts +236 -58
  26. package/lib/seam/connect/models/events/access-codes.d.ts +68 -68
  27. package/lib/seam/connect/models/events/devices.d.ts +152 -152
  28. package/lib/seam/connect/models/events/phones.d.ts +4 -4
  29. package/lib/seam/connect/models/events/seam-event.d.ts +112 -112
  30. package/lib/seam/connect/models/thermostats/thermostat-schedule.d.ts +8 -8
  31. package/lib/seam/connect/models/user-identities/user-identity.d.ts +2 -2
  32. package/lib/seam/connect/openapi.d.ts +58 -148
  33. package/lib/seam/connect/openapi.js +563 -463
  34. package/lib/seam/connect/openapi.js.map +1 -1
  35. package/lib/seam/connect/route-types.d.ts +840 -648
  36. package/package.json +1 -1
  37. package/src/lib/seam/connect/models/access-codes/managed-access-code.ts +2 -4
  38. package/src/lib/seam/connect/models/devices/device.ts +103 -4
  39. package/src/lib/seam/connect/openapi.ts +562 -478
  40. package/src/lib/seam/connect/route-types.ts +888 -720
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.360.1",
3
+ "version": "1.361.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,7 +1,6 @@
1
1
  import { z } from 'zod'
2
2
 
3
- import { connected_account_error } from '../connected-accounts/index.js'
4
- import { device_error } from '../devices/index.js'
3
+ import { device_and_connected_account_error_options } from '../devices/index.js'
5
4
 
6
5
  const common_access_code_error = z.object({
7
6
  message: z.string(),
@@ -371,8 +370,7 @@ export const access_code = z.object({
371
370
  .array(
372
371
  z.discriminatedUnion('error_code', [
373
372
  ...access_code_error.options,
374
- ...device_error.options,
375
- ...connected_account_error.options,
373
+ ...device_and_connected_account_error_options,
376
374
  ]),
377
375
  )
378
376
  .describe(
@@ -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(