@seamapi/types 1.332.0 → 1.333.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 (36) hide show
  1. package/dist/connect.cjs +1578 -318
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +3297 -472
  4. package/lib/seam/connect/models/access-codes/managed-access-code.d.ts +902 -35
  5. package/lib/seam/connect/models/access-codes/managed-access-code.js +238 -6
  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 +568 -25
  8. package/lib/seam/connect/models/connected-accounts/connected-account.d.ts +85 -23
  9. package/lib/seam/connect/models/connected-accounts/connected-account.js +27 -9
  10. package/lib/seam/connect/models/connected-accounts/connected-account.js.map +1 -1
  11. package/lib/seam/connect/models/devices/device.d.ts +28 -7
  12. package/lib/seam/connect/models/devices/phone.d.ts +28 -7
  13. package/lib/seam/connect/models/devices/unmanaged-device.d.ts +28 -7
  14. package/lib/seam/connect/models/events/acs/{access_groups.js → access-groups.js} +1 -1
  15. package/lib/seam/connect/models/events/acs/{access_groups.js.map → access-groups.js.map} +1 -1
  16. package/lib/seam/connect/models/events/acs/index.js +1 -1
  17. package/lib/seam/connect/models/events/index.d.ts +1 -0
  18. package/lib/seam/connect/models/events/index.js +1 -0
  19. package/lib/seam/connect/models/events/index.js.map +1 -1
  20. package/lib/seam/connect/models/events/seam-event.d.ts +1 -0
  21. package/lib/seam/connect/models/events/seam-event.js +2 -0
  22. package/lib/seam/connect/models/events/seam-event.js.map +1 -1
  23. package/lib/seam/connect/openapi.d.ts +174 -164
  24. package/lib/seam/connect/openapi.js +1331 -205
  25. package/lib/seam/connect/openapi.js.map +1 -1
  26. package/lib/seam/connect/route-types.d.ts +1539 -210
  27. package/package.json +1 -1
  28. package/src/lib/seam/connect/models/access-codes/managed-access-code.ts +282 -7
  29. package/src/lib/seam/connect/models/connected-accounts/connected-account.ts +32 -9
  30. package/src/lib/seam/connect/models/events/acs/index.ts +1 -1
  31. package/src/lib/seam/connect/models/events/index.ts +1 -0
  32. package/src/lib/seam/connect/models/events/seam-event.ts +10 -0
  33. package/src/lib/seam/connect/openapi.ts +1452 -229
  34. package/src/lib/seam/connect/route-types.ts +2349 -654
  35. /package/lib/seam/connect/models/events/acs/{access_groups.d.ts → access-groups.d.ts} +0 -0
  36. /package/src/lib/seam/connect/models/events/acs/{access_groups.ts → access-groups.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.332.0",
3
+ "version": "1.333.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -8,19 +8,294 @@ const common_access_code_error = z.object({
8
8
  is_access_code_error: z.literal(true),
9
9
  })
10
10
 
11
+ const error_code_description =
12
+ 'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.'
13
+
14
+ const smartthings_failed_to_set_access_code_error = common_access_code_error
15
+ .extend({
16
+ error_code: z
17
+ .literal('smartthings_failed_to_set_access_code')
18
+ .describe(error_code_description),
19
+ })
20
+ .describe('Failed to set code on Smart Things device.')
21
+
22
+ const smartthings_failed_to_set_after_multiple_retries =
23
+ common_access_code_error
24
+ .extend({
25
+ error_code: z
26
+ .literal('smartthings_failed_to_set_after_multiple_retries')
27
+ .describe(error_code_description),
28
+ })
29
+ .describe('Failed to set code after multiple retries.')
30
+
31
+ const code_modified_external_to_seam_error = common_access_code_error
32
+ .extend({
33
+ error_code: z
34
+ .literal('code_modified_external_to_seam')
35
+ .describe(error_code_description),
36
+ })
37
+ .describe(
38
+ 'Code was modified or removed externally after Seam successfully set it on the device.',
39
+ )
40
+
41
+ const failed_to_set_on_device = common_access_code_error
42
+ .extend({
43
+ error_code: z
44
+ .literal('failed_to_set_on_device')
45
+ .describe(error_code_description),
46
+ })
47
+ .describe('Failed to set code on device.')
48
+
49
+ const failed_to_remove_from_device = common_access_code_error
50
+ .extend({
51
+ error_code: z
52
+ .literal('failed_to_remove_from_device')
53
+ .describe(error_code_description),
54
+ })
55
+ .describe('Failed to remove code from device.')
56
+
57
+ const duplicate_code_on_device = common_access_code_error
58
+ .extend({
59
+ error_code: z
60
+ .literal('duplicate_code_on_device')
61
+ .describe(error_code_description),
62
+ })
63
+ .describe('Duplicate access code detected on device.')
64
+
65
+ const duplicate_code_attempt_prevented = common_access_code_error
66
+ .extend({
67
+ error_code: z
68
+ .literal('duplicate_code_attempt_prevented')
69
+ .describe(error_code_description),
70
+ })
71
+ .describe('An attempt to modify this access code was prevented.')
72
+
73
+ const igloohome_bridge_too_many_pending_jobs = common_access_code_error
74
+ .extend({
75
+ error_code: z
76
+ .literal('igloohome_bridge_too_many_pending_jobs')
77
+ .describe(error_code_description),
78
+ })
79
+ .describe('Igloohome bridge has too many pending jobs in the queue.')
80
+
81
+ const igloohome_bridge_offline = common_access_code_error
82
+ .extend({
83
+ error_code: z
84
+ .literal('igloohome_bridge_offline')
85
+ .describe(error_code_description),
86
+ })
87
+ .describe('Igloohome bridge is offline.')
88
+
89
+ const kwikset_unable_to_confirm_code = common_access_code_error
90
+ .extend({
91
+ error_code: z
92
+ .literal('kwikset_unable_to_confirm_code')
93
+ .describe(error_code_description),
94
+ })
95
+ .describe('Unable to confirm the access code is set on Kwikset device.')
96
+
97
+ const kwikset_unable_to_confirm_deletion = common_access_code_error
98
+ .extend({
99
+ error_code: z
100
+ .literal('kwikset_unable_to_confirm_deletion')
101
+ .describe(error_code_description),
102
+ })
103
+ .describe(
104
+ 'Unable to confirm the deletion of the access code on Kwikset device.',
105
+ )
106
+
107
+ const igloohome_offline_access_code_no_variance_available =
108
+ common_access_code_error
109
+ .extend({
110
+ error_code: z
111
+ .literal('igloohome_offline_access_code_no_variance_available')
112
+ .describe(error_code_description),
113
+ })
114
+ .describe('Lock as reached max amount of codes.')
115
+
116
+ const august_lock_invalid_code_length = common_access_code_error
117
+ .extend({
118
+ error_code: z
119
+ .literal('august_lock_invalid_code_length')
120
+ .describe(error_code_description),
121
+ })
122
+ .describe('Invalid code length for August lock.')
123
+
124
+ const august_device_programming_delay_error = common_access_code_error
125
+ .extend({
126
+ error_code: z
127
+ .literal('august_device_programming_delay')
128
+ .describe(error_code_description),
129
+ })
130
+ .describe('Access code has not yet been fully moved to the device.')
131
+
132
+ const august_device_slots_full = common_access_code_error
133
+ .extend({
134
+ error_code: z
135
+ .literal('august_device_slots_full')
136
+ .describe(error_code_description),
137
+ })
138
+ .describe('All access code slots on the device are full.')
139
+
140
+ const august_lock_missing_keypad = common_access_code_error
141
+ .extend({
142
+ error_code: z
143
+ .literal('august_lock_missing_keypad')
144
+ .describe(error_code_description),
145
+ })
146
+ .describe('August lock is missing a keypad.')
147
+
148
+ const salto_site_user_not_subscribed = common_access_code_error
149
+ .extend({
150
+ error_code: z
151
+ .literal('salto_site_user_not_subscribed')
152
+ .describe(error_code_description),
153
+ })
154
+ .describe('Salto site user is not subscribed.')
155
+
156
+ const hubitat_device_programming_delay = common_access_code_error
157
+ .extend({
158
+ error_code: z
159
+ .literal('hubitat_device_programming_delay')
160
+ .describe(error_code_description),
161
+ })
162
+ .describe('Access code has not yet been fully moved to the device.')
163
+
164
+ const hubitat_no_free_positions_available = common_access_code_error
165
+ .extend({
166
+ error_code: z
167
+ .literal('hubitat_no_free_positions_available')
168
+ .describe(error_code_description),
169
+ })
170
+ .describe('No free positions available on the device.')
171
+
172
+ const access_code_error = z.union([
173
+ smartthings_failed_to_set_access_code_error,
174
+ smartthings_failed_to_set_after_multiple_retries,
175
+ failed_to_set_on_device,
176
+ failed_to_remove_from_device,
177
+ duplicate_code_on_device,
178
+ duplicate_code_attempt_prevented,
179
+ igloohome_bridge_too_many_pending_jobs,
180
+ igloohome_bridge_offline,
181
+ igloohome_offline_access_code_no_variance_available,
182
+ kwikset_unable_to_confirm_code,
183
+ kwikset_unable_to_confirm_deletion,
184
+ code_modified_external_to_seam_error,
185
+ august_lock_invalid_code_length,
186
+ august_device_programming_delay_error,
187
+ august_device_slots_full,
188
+ august_lock_missing_keypad,
189
+ salto_site_user_not_subscribed,
190
+ hubitat_device_programming_delay,
191
+ hubitat_no_free_positions_available,
192
+ ])
193
+
194
+ export type AccessCodeError = z.infer<typeof access_code_error>
195
+
11
196
  const common_access_code_warning = z.object({
12
197
  message: z.string(),
13
198
  })
14
199
 
15
- const access_code_error = common_access_code_error.extend({
16
- error_code: z.string(),
17
- })
200
+ const warning_code_description =
201
+ 'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.'
18
202
 
19
- export type AccessCodeError = z.infer<typeof access_code_error>
203
+ const smartthings_failed_to_set_access_code_warning = common_access_code_warning
204
+ .extend({
205
+ warning_code: z
206
+ .literal('smartthings_failed_to_set_access_code')
207
+ .describe(warning_code_description),
208
+ })
209
+ .describe('Failed to set code on Smart Things device.')
20
210
 
21
- const access_code_warning = common_access_code_warning.extend({
22
- warning_code: z.string(),
23
- })
211
+ const august_device_programming_delay_warning = common_access_code_warning
212
+ .extend({
213
+ warning_code: z
214
+ .literal('august_device_programming_delay')
215
+ .describe(warning_code_description),
216
+ })
217
+ .describe('Access code has not yet been fully moved to the device.')
218
+
219
+ const code_modified_external_to_seam_warning = common_access_code_warning
220
+ .extend({
221
+ warning_code: z
222
+ .literal('code_modified_external_to_seam')
223
+ .describe(warning_code_description),
224
+ })
225
+ .describe(
226
+ 'Code was modified or removed externally after Seam successfully set it on the device.',
227
+ )
228
+
229
+ const schlage_detected_duplicate = common_access_code_warning
230
+ .extend({
231
+ warning_code: z
232
+ .literal('schlage_detected_duplicate')
233
+ .describe(warning_code_description),
234
+ })
235
+ .describe('Duplicate access code detected.')
236
+
237
+ const schlage_creation_outage = common_access_code_warning
238
+ .extend({
239
+ warning_code: z
240
+ .literal('schlage_creation_outage')
241
+ .describe(warning_code_description),
242
+ })
243
+ .describe('Received an error when attempting to create this code.')
244
+
245
+ const delay_in_setting_on_device = common_access_code_warning
246
+ .extend({
247
+ warning_code: z
248
+ .literal('delay_in_setting_on_device')
249
+ .describe(warning_code_description),
250
+ })
251
+ .describe('Delay in setting code on device.')
252
+
253
+ const delay_in_removing_from_device = common_access_code_warning
254
+ .extend({
255
+ warning_code: z
256
+ .literal('delay_in_removing_from_device')
257
+ .describe(warning_code_description),
258
+ })
259
+ .describe('Delay in removing code from device.')
260
+
261
+ const third_party_integration_detected = common_access_code_warning
262
+ .extend({
263
+ warning_code: z
264
+ .literal('third_party_integration_detected')
265
+ .describe(warning_code_description),
266
+ })
267
+ .describe(
268
+ 'Third party integration detected that may cause access codes to fail.',
269
+ )
270
+
271
+ const igloo_algopin_must_be_used_within_24_hours = common_access_code_warning
272
+ .extend({
273
+ warning_code: z
274
+ .literal('igloo_algopin_must_be_used_within_24_hours')
275
+ .describe(warning_code_description),
276
+ })
277
+ .describe('Algopins must be used within 24 hours.')
278
+
279
+ const management_transferred = common_access_code_warning
280
+ .extend({
281
+ warning_code: z
282
+ .literal('management_transferred')
283
+ .describe(warning_code_description),
284
+ })
285
+ .describe('Management was transferred to another workspace.')
286
+
287
+ const access_code_warning = z.union([
288
+ smartthings_failed_to_set_access_code_warning,
289
+ schlage_detected_duplicate,
290
+ schlage_creation_outage,
291
+ code_modified_external_to_seam_warning,
292
+ delay_in_setting_on_device,
293
+ delay_in_removing_from_device,
294
+ third_party_integration_detected,
295
+ august_device_programming_delay_warning,
296
+ igloo_algopin_must_be_used_within_24_hours,
297
+ management_transferred,
298
+ ])
24
299
 
25
300
  export type AccessCodeWarning = z.infer<typeof access_code_warning>
26
301
 
@@ -7,6 +7,9 @@ const common_connected_account_error = z.object({
7
7
  is_connected_account_error: z.literal(true),
8
8
  })
9
9
 
10
+ const error_code_description =
11
+ 'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.'
12
+
10
13
  const warning_code_description =
11
14
  'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.'
12
15
 
@@ -14,9 +17,26 @@ const common_connected_account_warning = z.object({
14
17
  message: z.string(),
15
18
  })
16
19
 
17
- export const connected_account_error = common_connected_account_error.extend({
18
- error_code: z.string(),
19
- })
20
+ export const account_disconnected = common_connected_account_error
21
+ .extend({
22
+ error_code: z
23
+ .literal('account_disconnected')
24
+ .describe(error_code_description),
25
+ })
26
+ .describe('Account is disconnected.')
27
+
28
+ export const invalid_credentials = common_connected_account_error
29
+ .extend({
30
+ error_code: z
31
+ .literal('invalid_credentials')
32
+ .describe(error_code_description),
33
+ })
34
+ .describe('Credentials provided were invalid.')
35
+
36
+ export const connected_account_error = z.union([
37
+ account_disconnected,
38
+ invalid_credentials,
39
+ ])
20
40
 
21
41
  export type ConnectedAccountError = z.infer<typeof connected_account_error>
22
42
 
@@ -32,13 +52,16 @@ export const unknown_issue_with_connected_account =
32
52
  'This issue may affect the proper functioning of one or more resources in this account.',
33
53
  )
34
54
 
55
+ const scheduled_maintenance_window = common_connected_account_warning
56
+ .extend({
57
+ warning_code: z
58
+ .literal('scheduled_maintenance_window')
59
+ .describe(warning_code_description),
60
+ })
61
+ .describe('Scheduled downtime for account planned.')
62
+
35
63
  const connected_account_warning = z
36
- .union([
37
- common_connected_account_warning.extend({
38
- warning_code: z.string(),
39
- }),
40
- unknown_issue_with_connected_account,
41
- ])
64
+ .union([scheduled_maintenance_window, unknown_issue_with_connected_account])
42
65
  .describe('Warning associated with the `connected_account`.')
43
66
 
44
67
  export type ConnectedAccountWarning = z.infer<typeof connected_account_warning>
@@ -1,4 +1,4 @@
1
- import { acs_access_group_events } from './access_groups.js'
1
+ import { acs_access_group_events } from './access-groups.js'
2
2
  import { acs_credential_events } from './credentials.js'
3
3
  import { acs_encoder_events } from './encoders.js'
4
4
  import { acs_system_events } from './systems.js'
@@ -2,6 +2,7 @@ export type * from './access-codes.js'
2
2
  export type * from './acs/index.js'
3
3
  export type * from './action-attempts.js'
4
4
  export type * from './client-sessions.js'
5
+ export * from './common.js'
5
6
  export type * from './connected-accounts.js'
6
7
  export type * from './devices.js'
7
8
  export type * from './enrollment-automations.js'
@@ -28,4 +28,14 @@ export const seam_event = z.discriminatedUnion('event_type', [
28
28
 
29
29
  export type SeamEvent = z.infer<typeof seam_event>
30
30
 
31
+ const event_types = seam_event.options.map(
32
+ (schema) => schema.shape.event_type.value,
33
+ )
34
+
35
+ type HasAtLeastOneElement<T> = T extends Array<infer E> ? [E, ...E[]] : never
36
+
37
+ export const seam_event_type = z.enum(
38
+ event_types as HasAtLeastOneElement<typeof event_types>,
39
+ )
40
+
31
41
  export type SeamEventType = SeamEvent['event_type']