@seamapi/types 1.324.0 → 1.325.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.324.0",
3
+ "version": "1.325.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -26,13 +26,128 @@ const common_device_error = z.object({
26
26
  is_device_error: z.literal(true),
27
27
  })
28
28
 
29
+ const error_code_description =
30
+ 'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.'
31
+
29
32
  const common_device_warning = z.object({
30
33
  message: z.string(),
31
34
  })
32
35
 
33
- export const device_error = common_device_error.extend({
34
- error_code: z.string(),
35
- })
36
+ const device_offline = common_device_error
37
+ .extend({
38
+ error_code: z.literal('device_offline').describe(error_code_description),
39
+ })
40
+ .describe('Device is offline')
41
+
42
+ const device_removed = common_device_error
43
+ .extend({
44
+ error_code: z.literal('device_removed').describe(error_code_description),
45
+ })
46
+ .describe('Device has been removed')
47
+
48
+ const account_disconnected = common_device_error
49
+ .extend({
50
+ error_code: z
51
+ .literal('account_disconnected')
52
+ .describe(error_code_description),
53
+ })
54
+ .describe('Account is disconnected')
55
+
56
+ const hub_disconnected = common_device_error
57
+ .extend({
58
+ error_code: z.literal('hub_disconnected').describe(error_code_description),
59
+ })
60
+ .describe('Hub is disconnected')
61
+
62
+ const device_disconnected = common_device_error
63
+ .extend({
64
+ error_code: z
65
+ .literal('device_disconnected')
66
+ .describe(error_code_description),
67
+ })
68
+ .describe('Device is disconnected')
69
+
70
+ const empty_backup_access_code_pool = common_device_error
71
+ .extend({
72
+ error_code: z
73
+ .literal('empty_backup_access_code_pool')
74
+ .describe(error_code_description),
75
+ })
76
+ .describe('The backup access code pool is empty.')
77
+
78
+ const august_lock_not_authorized = common_device_error
79
+ .extend({
80
+ error_code: z
81
+ .literal('august_lock_not_authorized')
82
+ .describe(error_code_description),
83
+ })
84
+ .describe('User is not authorized to use the August Lock.')
85
+
86
+ const august_lock_missing_bridge = common_device_error
87
+ .extend({
88
+ error_code: z
89
+ .literal('august_lock_missing_bridge')
90
+ .describe(error_code_description),
91
+ })
92
+ .describe('Lock is not connected to the Seam Bridge.')
93
+
94
+ const salto_site_user_limit_reached = common_device_error
95
+ .extend({
96
+ error_code: z
97
+ .literal('salto_site_user_limit_reached')
98
+ .describe(error_code_description),
99
+ })
100
+ .describe('Salto site user limit reached.')
101
+
102
+ const ttlock_lock_not_paired_to_gateway = common_device_error
103
+ .extend({
104
+ error_code: z
105
+ .literal('ttlock_lock_not_paired_to_gateway')
106
+ .describe(error_code_description),
107
+ })
108
+ .describe('Lock is not paired with a Gateway.')
109
+
110
+ const missing_device_credentials = common_device_error
111
+ .extend({
112
+ error_code: z
113
+ .literal('missing_device_credentials')
114
+ .describe(error_code_description),
115
+ })
116
+ .describe('Missing device credentials.')
117
+
118
+ const auxiliary_heat_running = common_device_error
119
+ .extend({
120
+ error_code: z
121
+ .literal('auxiliary_heat_running')
122
+ .describe(error_code_description),
123
+ })
124
+ .describe('The auxiliary heat is running.')
125
+
126
+ const subscription_required = common_device_error
127
+ .extend({
128
+ error_code: z
129
+ .literal('subscription_required')
130
+ .describe(error_code_description),
131
+ })
132
+ .describe('Subscription required to connect.')
133
+
134
+ export const device_error = z
135
+ .union([
136
+ device_offline,
137
+ device_removed,
138
+ account_disconnected,
139
+ hub_disconnected,
140
+ device_disconnected,
141
+ empty_backup_access_code_pool,
142
+ august_lock_not_authorized,
143
+ august_lock_missing_bridge,
144
+ salto_site_user_limit_reached,
145
+ ttlock_lock_not_paired_to_gateway,
146
+ missing_device_credentials,
147
+ auxiliary_heat_running,
148
+ subscription_required,
149
+ ])
150
+ .describe('Error associated with the `device`.')
36
151
 
37
152
  export type DeviceError = z.infer<typeof device_error>
38
153