@seamapi/types 1.196.0 → 1.197.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 (58) hide show
  1. package/dist/connect.cjs +1723 -1502
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +1871 -1101
  4. package/dist/devicedb.d.cts +40 -40
  5. package/lib/seam/connect/model-types.d.ts +1 -1
  6. package/lib/seam/connect/models/access-codes/managed-access-code.d.ts +113 -12
  7. package/lib/seam/connect/models/access-codes/managed-access-code.js +17 -2
  8. package/lib/seam/connect/models/access-codes/managed-access-code.js.map +1 -1
  9. package/lib/seam/connect/models/access-codes/unmanaged-access-code.d.ts +87 -12
  10. package/lib/seam/connect/models/acs/acs-access-group.d.ts +4 -4
  11. package/lib/seam/connect/models/acs/acs-credential-pool.d.ts +4 -4
  12. package/lib/seam/connect/models/acs/acs-credential.d.ts +4 -4
  13. package/lib/seam/connect/models/acs/acs-entrance.d.ts +10 -10
  14. package/lib/seam/connect/models/acs/acs-system.d.ts +29 -29
  15. package/lib/seam/connect/models/acs/acs-user.d.ts +6 -6
  16. package/lib/seam/connect/models/acs/metadata/latch.d.ts +4 -4
  17. package/lib/seam/connect/models/connect-webviews/connect-webview.d.ts +6 -6
  18. package/lib/seam/connect/models/connected-accounts/connected-account.d.ts +69 -8
  19. package/lib/seam/connect/models/connected-accounts/connected-account.js +15 -2
  20. package/lib/seam/connect/models/connected-accounts/connected-account.js.map +1 -1
  21. package/lib/seam/connect/models/devices/capability-properties/index.d.ts +15 -15
  22. package/lib/seam/connect/models/devices/capability-properties/thermostat.d.ts +30 -30
  23. package/lib/seam/connect/models/devices/device-metadata.d.ts +8 -8
  24. package/lib/seam/connect/models/devices/device-provider.d.ts +2 -2
  25. package/lib/seam/connect/models/devices/device.d.ts +116 -65
  26. package/lib/seam/connect/models/devices/device.js +16 -8
  27. package/lib/seam/connect/models/devices/device.js.map +1 -1
  28. package/lib/seam/connect/models/devices/phone.d.ts +44 -19
  29. package/lib/seam/connect/models/devices/unmanaged-device.d.ts +53 -28
  30. package/lib/seam/connect/models/events/access-codes.d.ts +306 -306
  31. package/lib/seam/connect/models/events/acs/common.d.ts +4 -4
  32. package/lib/seam/connect/models/events/acs/credentials.d.ts +12 -12
  33. package/lib/seam/connect/models/events/acs/index.d.ts +18 -18
  34. package/lib/seam/connect/models/events/acs/systems.d.ts +12 -12
  35. package/lib/seam/connect/models/events/acs/users.d.ts +12 -12
  36. package/lib/seam/connect/models/events/connected-accounts.d.ts +42 -42
  37. package/lib/seam/connect/models/events/devices.d.ts +340 -316
  38. package/lib/seam/connect/models/events/devices.js +5 -1
  39. package/lib/seam/connect/models/events/devices.js.map +1 -1
  40. package/lib/seam/connect/models/events/phones.d.ts +6 -6
  41. package/lib/seam/connect/models/events/seam-event.d.ts +365 -353
  42. package/lib/seam/connect/models/thermostats/climate-setting-schedule.d.ts +3 -3
  43. package/lib/seam/connect/models/user-identities/user-identity.d.ts +2 -2
  44. package/lib/seam/connect/openapi.d.ts +263 -26
  45. package/lib/seam/connect/openapi.js +209 -23
  46. package/lib/seam/connect/openapi.js.map +1 -1
  47. package/lib/seam/connect/route-types.d.ts +247 -36
  48. package/lib/seam/devicedb/models/device-model.d.ts +8 -8
  49. package/lib/seam/devicedb/models/manufacturer.d.ts +2 -2
  50. package/lib/seam/devicedb/route-specs.d.ts +30 -30
  51. package/package.json +1 -1
  52. package/src/lib/seam/connect/model-types.ts +6 -0
  53. package/src/lib/seam/connect/models/access-codes/managed-access-code.ts +26 -2
  54. package/src/lib/seam/connect/models/connected-accounts/connected-account.ts +23 -2
  55. package/src/lib/seam/connect/models/devices/device.ts +24 -12
  56. package/src/lib/seam/connect/models/events/devices.ts +5 -1
  57. package/src/lib/seam/connect/openapi.ts +209 -23
  58. package/src/lib/seam/connect/route-types.ts +377 -92
package/dist/connect.cjs CHANGED
@@ -33,1559 +33,1590 @@ __export(schemas_exports, {
33
33
  webhook: () => webhook,
34
34
  workspace: () => workspace
35
35
  });
36
- var access_code = zod.z.object({
37
- common_code_key: zod.z.string().nullable().describe(
38
- "Unique identifier for a group of access codes that share the same code."
39
- ),
40
- is_scheduled_on_device: zod.z.boolean().optional().describe(
41
- "Indicates whether the code is set on the device according to a preconfigured schedule."
42
- ),
43
- type: zod.z.enum(["time_bound", "ongoing"]).describe(
44
- 'Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration.'
45
- ),
46
- is_waiting_for_code_assignment: zod.z.boolean().optional().describe(
47
- "Indicates whether the access code is waiting for a code assignment."
48
- ),
49
- access_code_id: zod.z.string().uuid().describe("Unique identifier for the access code."),
50
- device_id: zod.z.string().uuid().describe(
51
- "Unique identifier for the device associated with the access code."
52
- ),
53
- name: zod.z.string().nullable().describe(
54
- "Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes."
55
- ),
56
- code: zod.z.string().nullable().describe(
57
- "Code used for access. Typically, a numeric or alphanumeric string."
58
- ),
59
- created_at: zod.z.string().datetime().describe("Date and time at which the access code was created."),
60
- errors: zod.z.any().describe(
61
- 'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.'
62
- ),
63
- warnings: zod.z.any().describe(
64
- 'Collection of warnings associated with the access code, structured in a dictionary format. A unique "warning_code" keys each warning. Each warning entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the warning. "created_at" is a date that indicates when the warning was generated. This structure enables detailed tracking and timely response to potential issues that are not critical but that may require attention.'
65
- ),
66
- is_managed: zod.z.literal(true).describe("Indicates whether Seam manages the access code."),
67
- starts_at: zod.z.string().datetime().nullable().optional().describe(
68
- "Date and time at which the time-bound access code becomes active."
69
- ),
70
- ends_at: zod.z.string().datetime().nullable().optional().describe(
71
- "Date and time after which the time-bound access code becomes inactive."
72
- ),
73
- status: zod.z.enum(["setting", "set", "unset", "removing", "unknown"]).describe(`
74
- Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting.
75
- `),
76
- is_backup_access_code_available: zod.z.boolean().describe(
77
- "Indicates whether a backup access code is available for use if the primary access code is lost or compromised."
78
- ),
79
- is_backup: zod.z.boolean().optional().describe("Indicates whether the access code is a backup code."),
80
- pulled_backup_access_code_id: zod.z.string().uuid().nullable().optional().describe(
81
- "Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code."
82
- ),
83
- is_external_modification_allowed: zod.z.boolean().describe(
84
- "Indicates whether changes to the access code from external sources are permitted."
85
- ),
86
- is_one_time_use: zod.z.boolean().describe(
87
- 'Indicates whether the access code can only be used once. If "true," the code becomes invalid after the first use.'
88
- ),
89
- is_offline_access_code: zod.z.boolean().describe(
90
- 'Indicates whether the access code is intended for use in offline scenarios. If "true," this code can be created on a device without a network connection.'
91
- )
36
+ zod.z.record(
37
+ zod.z.string().max(40),
38
+ zod.z.union([zod.z.string().max(500), zod.z.boolean(), zod.z.null()])
39
+ ).refine((val) => Object.keys(val).length <= 50, {
40
+ message: "Custom metadata is limited to a maximum of 50 keys"
92
41
  });
93
- var unmanaged_access_code = access_code.pick({
94
- type: true,
95
- access_code_id: true,
96
- device_id: true,
97
- name: true,
98
- code: true,
99
- created_at: true,
100
- errors: true,
101
- warnings: true,
102
- is_managed: true,
103
- starts_at: true,
104
- ends_at: true
105
- }).extend({
106
- is_managed: zod.z.literal(false),
107
- status: zod.z.enum(["set"])
42
+ var custom_metadata = zod.z.record(
43
+ zod.z.string(),
44
+ zod.z.union([zod.z.string(), zod.z.boolean()])
45
+ );
46
+
47
+ // src/lib/seam/connect/models/connected-accounts/connected-account.ts
48
+ var common_connected_account_error = zod.z.object({
49
+ message: zod.z.string(),
50
+ is_connected_account_error: zod.z.literal(true)
108
51
  });
109
- var acs_access_group_external_type = zod.z.enum([
110
- "pti_unit",
111
- "pti_access_level",
112
- "salto_access_group",
113
- "brivo_group"
114
- ]);
115
- var acs_access_group = zod.z.object({
116
- acs_access_group_id: zod.z.string().uuid(),
117
- acs_system_id: zod.z.string().uuid(),
118
- workspace_id: zod.z.string().uuid(),
119
- name: zod.z.string(),
120
- access_group_type: acs_access_group_external_type.describe(`
121
- ---
122
- deprecated: use external_type
123
- ---
124
- `),
125
- access_group_type_display_name: zod.z.string().describe(`
126
- ---
127
- deprecated: use external_type_display_name
128
- ---
129
- `),
130
- display_name: zod.z.string(),
131
- external_type: acs_access_group_external_type,
132
- external_type_display_name: zod.z.string(),
133
- created_at: zod.z.string().datetime()
52
+ var common_connected_account_warning = zod.z.object({
53
+ message: zod.z.string()
134
54
  });
135
- var acs_entrance_latch_metadata = zod.z.object({
136
- accessibility_type: zod.z.string(),
137
- door_name: zod.z.string(),
138
- door_type: zod.z.string(),
139
- is_connected: zod.z.boolean()
55
+ var connected_account_error = common_connected_account_error.extend({
56
+ error_code: zod.z.string()
140
57
  });
141
- var acs_entrance_visionline_metadata = zod.z.object({
142
- door_name: zod.z.string(),
143
- door_category: zod.z.enum([
144
- "entrance",
145
- "guest",
146
- "elevator reader",
147
- "common",
148
- "common (PMS)"
149
- ]),
150
- profiles: zod.z.array(
151
- zod.z.object({
152
- visionline_door_profile_id: zod.z.string(),
153
- visionline_door_profile_type: zod.z.enum(["BLE", "commonDoor", "touch"])
154
- })
155
- ).optional()
58
+ var connected_account_warning = common_connected_account_warning.extend({
59
+ warning_code: zod.z.string()
156
60
  });
157
- var acs_credential_visionline_metadata = zod.z.object({
158
- card_function_type: zod.z.enum(["guest", "staff"]),
159
- joiner_acs_credential_ids: zod.z.array(zod.z.string().uuid()).optional(),
160
- guest_acs_entrance_ids: zod.z.array(zod.z.string().uuid()).optional(),
161
- common_acs_entrance_ids: zod.z.array(zod.z.string().uuid()).optional()
61
+ var connected_account = zod.z.object({
62
+ connected_account_id: zod.z.string().uuid().optional(),
63
+ created_at: zod.z.string().datetime().optional(),
64
+ user_identifier: zod.z.object({
65
+ username: zod.z.string().optional(),
66
+ api_url: zod.z.string().optional(),
67
+ email: zod.z.string().optional(),
68
+ phone: zod.z.string().optional(),
69
+ exclusive: zod.z.boolean().optional()
70
+ }).optional(),
71
+ account_type: zod.z.string().optional(),
72
+ account_type_display_name: zod.z.string(),
73
+ errors: zod.z.array(connected_account_error),
74
+ warnings: zod.z.array(connected_account_warning),
75
+ custom_metadata,
76
+ automatically_manage_new_devices: zod.z.boolean()
162
77
  });
163
-
164
- // src/lib/seam/connect/models/acs/acs-credential.ts
165
- var acs_credential_external_type = zod.z.enum([
166
- "pti_card",
167
- "brivo_credential",
168
- "hid_credential",
169
- "visionline_card"
78
+ var capabilities = zod.z.enum([
79
+ "access_code",
80
+ "lock",
81
+ "noise_detection",
82
+ "thermostat",
83
+ "battery",
84
+ "phone"
170
85
  ]);
171
- var acs_credential_access_method_type = zod.z.enum([
172
- "code",
173
- "card",
174
- "mobile_key"
86
+ var access_code_code_constraint = zod.z.object({
87
+ constraint_type: zod.z.enum([
88
+ "no_zeros",
89
+ // Nuki
90
+ "cannot_start_with_12",
91
+ // Nuki
92
+ "no_triple_consecutive_ints",
93
+ // Brivo
94
+ "cannot_specify_pin_code",
95
+ // Lockly
96
+ "pin_code_matches_existing_set",
97
+ // Salto
98
+ "start_date_in_future",
99
+ // Kwikset
100
+ "no_ascending_or_descending_sequence",
101
+ // Tedee
102
+ "at_least_three_unique_digits",
103
+ // Tedee
104
+ "cannot_contain_089"
105
+ // TTLock (for some cylinder devices only)
106
+ ])
107
+ });
108
+ var access_code_name_constraint = zod.z.object({
109
+ constraint_type: zod.z.enum(["name_length", "name_must_be_unique"]),
110
+ // Nuki, Kwikset
111
+ min_length: zod.z.number().optional(),
112
+ max_length: zod.z.number().optional()
113
+ });
114
+ var access_code_constraint = zod.z.union([
115
+ access_code_code_constraint,
116
+ access_code_name_constraint
175
117
  ]);
176
- var acs_credential = zod.z.object({
177
- acs_credential_id: zod.z.string().uuid(),
178
- acs_user_id: zod.z.string().uuid().optional(),
179
- acs_credential_pool_id: zod.z.string().uuid().optional(),
180
- acs_system_id: zod.z.string().uuid(),
181
- parent_acs_credential_id: zod.z.string().uuid().optional(),
182
- display_name: zod.z.string().min(1),
183
- code: zod.z.string().optional().nullable(),
184
- access_method: acs_credential_access_method_type,
185
- external_type: acs_credential_external_type.optional(),
186
- external_type_display_name: zod.z.string().optional(),
187
- created_at: zod.z.string().datetime(),
188
- workspace_id: zod.z.string().uuid(),
189
- starts_at: zod.z.string().optional(),
190
- ends_at: zod.z.string().optional(),
191
- errors: zod.z.array(
192
- zod.z.object({
193
- error_code: zod.z.string(),
194
- message: zod.z.string()
195
- })
196
- ),
197
- warnings: zod.z.array(
198
- zod.z.object({
199
- warning_code: zod.z.string(),
200
- message: zod.z.string()
201
- })
202
- ),
203
- is_multi_phone_sync_credential: zod.z.boolean().optional(),
204
- is_latest_desired_state_synced_with_provider: zod.z.boolean().optional(),
205
- latest_desired_state_synced_with_provider_at: zod.z.string().datetime().optional(),
206
- visionline_metadata: acs_credential_visionline_metadata.optional()
118
+ var access_code_capability_properties = zod.z.object({
119
+ _experimental_supported_code_from_access_codes_lengths: zod.z.array(zod.z.number()).optional(),
120
+ code_constraints: zod.z.array(access_code_constraint).optional(),
121
+ supported_code_lengths: zod.z.array(zod.z.number()).optional(),
122
+ max_active_codes_supported: zod.z.number().optional(),
123
+ supports_backup_access_code_pool: zod.z.boolean().optional(),
124
+ has_native_entry_events: zod.z.boolean().optional()
207
125
  });
208
- var acs_entrance = zod.z.object({
209
- acs_system_id: zod.z.string().uuid(),
210
- acs_entrance_id: zod.z.string().uuid(),
211
- created_at: zod.z.string().datetime(),
212
- display_name: zod.z.string(),
213
- errors: zod.z.array(
214
- zod.z.object({
215
- error_code: zod.z.string(),
216
- message: zod.z.string()
217
- })
218
- ),
219
- latch_metadata: acs_entrance_latch_metadata.optional(),
220
- visionline_metadata: acs_entrance_visionline_metadata.optional()
126
+ var lock_capability_properties = zod.z.object({
127
+ locked: zod.z.boolean().optional(),
128
+ keypad_battery: zod.z.object({
129
+ level: zod.z.number()
130
+ }).optional(),
131
+ door_open: zod.z.boolean().optional()
221
132
  });
222
- var acs_system_capability_flags = zod.z.object({
223
- can_automate_enrollment: zod.z.boolean().optional().describe(
224
- "Indicates whether it is possible to [launch enrollment automations](https://docs.seam.co/latest/capability-guides/mobile-access-in-development/issuing-mobile-credentials-from-an-access-control-system#prepare-the-phones-for-a-user-identity-to-start-receiving-mobile-credentials-using-an-enrollment-aut) for the `acs_system`."
225
- ),
226
- can_create_acs_access_groups: zod.z.boolean().optional().describe(
227
- "Indicates whether the `acs_system` supports creating [access groups](https://docs.seam.co/latest/capability-guides/access-systems/assigning-users-to-access-groups). See also [Access Group-based Access Control Systems](https://docs.seam.co/latest/capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems)."
228
- ),
229
- can_remove_acs_users_from_acs_access_groups: zod.z.boolean().optional().describe(
230
- "Indicates whether the `acs_system` supports [removing users from access groups](https://docs.seam.co/latest/capability-guides/access-systems/assigning-users-to-access-groups#remove-an-acs-user-from-an-access-group). See also [Access Group-based Access Control Systems](https://docs.seam.co/latest/capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems)."
231
- ),
232
- can_add_acs_users_to_acs_access_groups: zod.z.boolean().optional().describe(
233
- "Indicates whether the `acs_system` supports [adding users to access groups](https://docs.seam.co/latest/capability-guides/access-systems/assigning-users-to-access-groups#add-an-acs-user-to-an-access-group). See also [Access Group-based Access Control Systems](https://docs.seam.co/latest/capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems)."
234
- )
133
+ var hvac_mode_setting = zod.z.enum(["off", "heat", "cool", "heat_cool"]);
134
+ var fan_mode_setting = zod.z.enum(["auto", "on"]);
135
+
136
+ // src/lib/seam/connect/models/thermostats/climate-setting.ts
137
+ var climate_setting = zod.z.object({
138
+ automatic_heating_enabled: zod.z.boolean(),
139
+ automatic_cooling_enabled: zod.z.boolean(),
140
+ hvac_mode_setting,
141
+ cooling_set_point_celsius: zod.z.number().optional(),
142
+ heating_set_point_celsius: zod.z.number().optional(),
143
+ cooling_set_point_fahrenheit: zod.z.number().optional(),
144
+ heating_set_point_fahrenheit: zod.z.number().optional(),
145
+ manual_override_allowed: zod.z.boolean()
235
146
  });
236
- var acs_system_external_type = zod.z.enum([
237
- "pti_site",
238
- "alta_org",
239
- "salto_site",
240
- "brivo_account",
241
- "hid_credential_manager_organization",
242
- "visionline_system",
243
- "assa_abloy_credential_service",
244
- "latch_building"
245
- ]);
246
- var common_acs_system_error = zod.z.object({
247
- created_at: zod.z.string().datetime().describe("Date and time at which Seam created the error."),
248
- message: zod.z.string().describe(
249
- "Detailed description of the error. Provides insights into the issue and potentially how to rectify it."
147
+ var climate_setting_schedule = zod.z.object({
148
+ climate_setting_schedule_id: zod.z.string().uuid(),
149
+ schedule_type: zod.z.literal("time_bound"),
150
+ device_id: zod.z.string().uuid(),
151
+ name: zod.z.string().optional(),
152
+ schedule_starts_at: zod.z.string(),
153
+ schedule_ends_at: zod.z.string(),
154
+ created_at: zod.z.string().datetime(),
155
+ errors: zod.z.any().describe(
156
+ 'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.'
250
157
  )
158
+ }).merge(climate_setting.partial());
159
+
160
+ // src/lib/seam/connect/models/devices/capability-properties/thermostat.ts
161
+ var base_thermostat_capability_properties = zod.z.object({
162
+ temperature_fahrenheit: zod.z.number(),
163
+ temperature_celsius: zod.z.number(),
164
+ relative_humidity: zod.z.number().min(0).max(1),
165
+ can_enable_automatic_heating: zod.z.boolean(),
166
+ can_enable_automatic_cooling: zod.z.boolean(),
167
+ available_hvac_mode_settings: zod.z.array(hvac_mode_setting),
168
+ is_heating_available: zod.z.literal(false),
169
+ is_cooling_available: zod.z.literal(false),
170
+ is_heating: zod.z.boolean(),
171
+ is_cooling: zod.z.boolean(),
172
+ is_fan_running: zod.z.boolean(),
173
+ fan_mode_setting,
174
+ /**
175
+ * this is true if the current thermostat settings differ that what is on seam, and `current_climate_setting.manual_override_allowed: true`
176
+ */
177
+ is_temporary_manual_override_active: zod.z.boolean(),
178
+ /**
179
+ * can be derived from `default_climate_setting`, or `active_climate_setting_schedule` if one is active
180
+ */
181
+ current_climate_setting: climate_setting,
182
+ default_climate_setting: climate_setting.optional(),
183
+ is_climate_setting_schedule_active: zod.z.boolean(),
184
+ active_climate_setting_schedule: climate_setting_schedule.optional()
251
185
  });
252
- var error_code_description = "Unique identifier of the type of error. Enables quick recognition and categorization of the issue.";
253
- var seam_bridge_disconnected = common_acs_system_error.extend({
254
- error_code: zod.z.literal("seam_bridge_disconnected").describe(error_code_description)
255
- }).describe(`Indicates that the Seam API cannot communicate with the [Seam Bridge](https://docs.seam.co/latest/capability-guides/seam-bridge), for example, if the Seam Bridge executable has stopped or if the computer running the Seam Bridge executable is offline.
256
- This error might also occur if the Seam Bridge is connected to the wrong [workspace](https://docs.seam.co/latest/core-concepts/workspaces).
257
- See also [Troubleshooting Your Access Control System](https://docs.seam.co/latest/capability-guides/capability-guides/access-systems/troubleshooting-your-access-control-system#acs_system.errors.seam_bridge_disconnected).`);
258
- var visionline_instance_unreachable = common_acs_system_error.extend({
259
- error_code: zod.z.literal("visionline_instance_unreachable").describe(error_code_description)
260
- }).describe(`Indicates that the Seam Bridge is functioning correctly and the Seam API can communicate with the Seam Bridge, but the Seam API cannot connect to the on-premises [Visionline access control system](https://docs.seam.co/latest/device-and-system-integration-guides/assa-abloy-visionline-access-control-system).
261
- For example, the IP address of the on-premises access control system may be set incorrectly within the Seam [workspace](https://docs.seam.co/latest/core-concepts/workspaces).
262
- See also [Troubleshooting Your Access Control System](https://docs.seam.co/latest/capability-guides/capability-guides/access-systems/troubleshooting-your-access-control-system#acs_system.errors.visionline_instance_unreachable).`);
263
- var acs_system_error = zod.z.union([seam_bridge_disconnected, visionline_instance_unreachable]).describe("Error associated with the `acs_system`.");
264
- zod.z.object({
265
- seam_bridge_disconnected: seam_bridge_disconnected.optional().nullable(),
266
- visionline_instance_unreachable: visionline_instance_unreachable.optional().nullable()
267
- });
268
- var acs_system_warning = zod.z.object({}).describe(
269
- `
270
- ---
271
- undocumented: Currently, no warnings defined for \`acs_system\`s.
272
- ---
273
- `
186
+ var cooling_thermostat_capability_properties = base_thermostat_capability_properties.merge(
187
+ zod.z.object({
188
+ min_cooling_set_point_celsius: zod.z.number(),
189
+ min_cooling_set_point_fahrenheit: zod.z.number(),
190
+ max_cooling_set_point_celsius: zod.z.number(),
191
+ max_cooling_set_point_fahrenheit: zod.z.number(),
192
+ is_cooling_available: zod.z.literal(true)
193
+ })
274
194
  );
275
- zod.z.object({});
276
- var acs_system = zod.z.object({
277
- acs_system_id: zod.z.string().uuid().describe("ID of the `acs_system`."),
278
- external_type: acs_system_external_type.describe("Brand-specific terminology for the `acs_system` type.").optional(),
279
- external_type_display_name: zod.z.string().describe(
280
- "Display name that corresponds to the brand-specific terminology for the `acs_system` type."
281
- ).optional(),
282
- system_type: acs_system_external_type.describe(
283
- `
284
- ---
285
- deprecated: Use \`external_type\`.
286
- ---
287
- `
288
- ).optional(),
289
- system_type_display_name: zod.z.string().optional().describe(`
290
- ---
291
- deprecated: Use \`external_type_display_name\`.
292
- ---
293
- `),
294
- name: zod.z.string().describe("Name of the `acs_system`."),
295
- created_at: zod.z.string().datetime().describe("Date and time at which the `acs_system` was created."),
296
- workspace_id: zod.z.string().uuid().describe(
297
- "ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces) that contains the `acs_system`."
298
- ),
299
- connected_account_ids: zod.z.array(zod.z.string().uuid()).describe(
300
- "IDs of the [connected accounts](https://docs.seam.co/latest/core-concepts/connected-accounts) associated with the `acs_system`."
301
- ),
302
- image_url: zod.z.string().describe("URL for the image that represents the `acs_system`."),
303
- image_alt_text: zod.z.string().describe("Alternative text for the `acs_system` image."),
304
- errors: zod.z.array(acs_system_error).describe("Errors associated with the `acs_system`."),
305
- warnings: zod.z.array(acs_system_warning).describe(
306
- `
307
- ---
308
- undocumented: Currently, no warnings defined for \`acs_system\`s.
309
- ---
310
- `
311
- )
312
- }).merge(acs_system_capability_flags).describe(
313
- "Represents an [access control system](https://docs.seam.co/latest/capability-guides/access-systems)."
195
+ var heating_thermostat_capability_properties = base_thermostat_capability_properties.merge(
196
+ zod.z.object({
197
+ min_heating_set_point_celsius: zod.z.number(),
198
+ min_heating_set_point_fahrenheit: zod.z.number(),
199
+ max_heating_set_point_celsius: zod.z.number(),
200
+ max_heating_set_point_fahrenheit: zod.z.number(),
201
+ is_heating_available: zod.z.literal(true)
202
+ })
314
203
  );
315
- var phone_number = zod.z.coerce.string().trim().refine(
316
- (val) => {
317
- return /^\+[1-9]\d{1,14}$/.test(val);
318
- },
319
- {
320
- message: "Phone number must be in E.164 format: +14155552671"
321
- }
204
+ var heating_cooling_thermostat_capability_properties = cooling_thermostat_capability_properties.merge(heating_thermostat_capability_properties).merge(
205
+ zod.z.object({
206
+ is_cooling_available: zod.z.literal(true),
207
+ is_heating_available: zod.z.literal(true),
208
+ min_heating_cooling_delta_celsius: zod.z.number(),
209
+ min_heating_cooling_delta_fahrenheit: zod.z.number()
210
+ })
322
211
  );
323
- var start_end_schedule = zod.z.object({
324
- starts_at: zod.z.string().datetime(),
325
- ends_at: zod.z.string().datetime()
326
- });
327
- var schedule = start_end_schedule;
212
+ var thermostat_capability_properties = zod.z.union([
213
+ heating_cooling_thermostat_capability_properties.partial(),
214
+ heating_thermostat_capability_properties.partial(),
215
+ cooling_thermostat_capability_properties.partial()
216
+ ]);
328
217
 
329
- // src/lib/seam/connect/models/acs/acs-user.ts
330
- var acs_user_external_type = zod.z.enum([
331
- "pti_user",
332
- "brivo_user",
333
- "hid_credential_manager_user",
334
- "salto_site_user",
335
- "latch_user"
218
+ // src/lib/seam/connect/models/devices/capability-properties/index.ts
219
+ var capability_properties = zod.z.intersection(
220
+ access_code_capability_properties.partial().merge(lock_capability_properties.partial()),
221
+ thermostat_capability_properties
222
+ );
223
+
224
+ // src/lib/seam/devicedb/models/index.ts
225
+ var models_exports = {};
226
+ __export(models_exports, {
227
+ base_device_model_v1: () => base_device_model_v1,
228
+ device_capability_flags: () => device_capability_flags,
229
+ device_category: () => device_category,
230
+ device_connection_type: () => device_connection_type,
231
+ device_model_category_specific_properties: () => device_model_category_specific_properties,
232
+ device_model_v1: () => device_model_v1,
233
+ image_reference: () => image_reference,
234
+ manufacturer: () => manufacturer,
235
+ manufacturer_annotation: () => manufacturer_annotation,
236
+ manufacturer_annotation_code: () => manufacturer_annotation_code,
237
+ manufacturer_integration_support_level: () => manufacturer_integration_support_level,
238
+ thermostat: () => thermostat
239
+ });
240
+ var device_capability_flags = zod.z.object({
241
+ can_remotely_unlock: zod.z.boolean(),
242
+ can_remotely_lock: zod.z.boolean(),
243
+ can_program_offline_access_codes: zod.z.boolean(),
244
+ can_program_online_access_codes: zod.z.boolean()
245
+ }).partial();
246
+ var device_model_capability_flags_map = {
247
+ can_remotely_lock: zod.z.literal(true),
248
+ can_remotely_unlock: zod.z.literal(true),
249
+ can_program_offline_access_codes: zod.z.literal(true),
250
+ can_program_online_access_codes: zod.z.literal(true)
251
+ };
252
+ var device_model_capability_flags = zod.z.object(device_model_capability_flags_map).partial();
253
+ var hardware = zod.z.object({
254
+ has_physical_key: zod.z.boolean()
255
+ }).partial();
256
+ var image_reference = zod.z.object({
257
+ url: zod.z.string().url(),
258
+ width: zod.z.number(),
259
+ height: zod.z.number()
260
+ });
261
+ var manufacturer_integration_support_level = zod.z.enum([
262
+ "stable",
263
+ "beta",
264
+ "planned",
265
+ "unsupported",
266
+ "inquire"
336
267
  ]);
337
- var user_fields = zod.z.object({
338
- full_name: zod.z.string().optional(),
339
- email: zod.z.string().email().optional().describe(`
340
- ---
341
- deprecated: use email_address.
342
- ---
343
- `),
344
- email_address: zod.z.string().email().optional(),
345
- phone_number: phone_number.optional()
268
+ var manufacturer_annotation_code = zod.z.enum(["subscription_required"]);
269
+ var manufacturer_annotation = zod.z.object({
270
+ annotation_code: manufacturer_annotation_code,
271
+ message: zod.z.string().trim().nonempty()
346
272
  });
347
- var acs_user = zod.z.object({
348
- acs_user_id: zod.z.string().uuid(),
349
- acs_system_id: zod.z.string().uuid(),
350
- hid_acs_system_id: zod.z.string().uuid().optional(),
351
- workspace_id: zod.z.string().uuid(),
352
- created_at: zod.z.string().datetime(),
273
+ var manufacturer = zod.z.object({
274
+ manufacturer_id: zod.z.string().uuid(),
353
275
  display_name: zod.z.string(),
354
- external_type: acs_user_external_type.optional(),
355
- external_type_display_name: zod.z.string().optional(),
356
- is_suspended: zod.z.boolean(),
357
- access_schedule: schedule.optional(),
358
- user_identity_id: zod.z.string().optional(),
359
- user_identity_full_name: zod.z.string().nullable().optional(),
360
- user_identity_email_address: zod.z.string().nullable().optional(),
361
- user_identity_phone_number: zod.z.string().nullable().optional()
362
- }).merge(user_fields);
363
- var common_action_attempt = zod.z.object({
364
- action_attempt_id: zod.z.string().uuid().describe(`
365
- ---
366
- title: Action Attempt ID
367
- ---
368
- The ID of the action attempt.
369
- `),
370
- status: zod.z.enum(["pending", "success", "error"])
371
- });
372
- var common_pending_action_attempt = common_action_attempt.extend({
373
- status: zod.z.literal("pending"),
374
- result: zod.z.null(),
375
- error: zod.z.null()
376
- });
377
- var common_succeeded_action_attempt = common_action_attempt.extend({
378
- status: zod.z.literal("success"),
379
- error: zod.z.null()
380
- });
381
- var common_failed_action_attempt = common_action_attempt.extend({
382
- status: zod.z.literal("error"),
383
- result: zod.z.null()
276
+ logo: image_reference.optional(),
277
+ /** @deprecated */
278
+ integration: manufacturer_integration_support_level,
279
+ integration_support_level: manufacturer_integration_support_level,
280
+ is_connect_webview_supported: zod.z.boolean(),
281
+ requires_seam_support_to_add_account: zod.z.boolean(),
282
+ device_model_count: zod.z.number(),
283
+ annotations: zod.z.array(manufacturer_annotation),
284
+ website: zod.z.string().url().optional(),
285
+ legal_name: zod.z.string().optional(),
286
+ parent_organization: zod.z.string().optional(),
287
+ headquarters: zod.z.array(zod.z.string()).optional(),
288
+ countries_of_origin: zod.z.array(zod.z.string()).optional(),
289
+ founding_year: zod.z.string().optional(),
290
+ us_customer_support_tel: zod.z.string().optional(),
291
+ us_customer_support_email: zod.z.string().email().optional(),
292
+ us_customer_support_contact_url: zod.z.string().url().optional(),
293
+ seam_api_guide: zod.z.string().optional(),
294
+ description: zod.z.string().optional()
384
295
  });
385
296
 
386
- // src/lib/seam/connect/models/action-attempts/deprecated.ts
387
- var error = zod.z.object({
388
- type: zod.z.string(),
389
- message: zod.z.string()
390
- });
391
- var result = zod.z.any();
392
- var sync_access_codes_action_attempt = zod.z.discriminatedUnion("status", [
393
- common_pending_action_attempt.extend({
394
- action_type: zod.z.literal("SYNC_ACCESS_CODES")
395
- }),
396
- common_succeeded_action_attempt.extend({
397
- action_type: zod.z.literal("SYNC_ACCESS_CODES"),
398
- result
399
- }),
400
- common_failed_action_attempt.extend({
401
- action_type: zod.z.literal("SYNC_ACCESS_CODES"),
402
- error
403
- })
297
+ // src/lib/seam/devicedb/models/device-model.ts
298
+ var device_category = zod.z.enum([
299
+ "smartlock",
300
+ "sensor",
301
+ "thermostat",
302
+ "relay",
303
+ "intercom",
304
+ "accessory"
404
305
  ]);
405
- var create_access_code_action_attempt = zod.z.discriminatedUnion("status", [
406
- common_pending_action_attempt.extend({
407
- action_type: zod.z.literal("CREATE_ACCESS_CODE")
408
- }),
409
- common_succeeded_action_attempt.extend({
410
- action_type: zod.z.literal("CREATE_ACCESS_CODE"),
411
- result
412
- }),
413
- common_failed_action_attempt.extend({
414
- action_type: zod.z.literal("CREATE_ACCESS_CODE"),
415
- error
416
- })
306
+ var device_connection_type = zod.z.enum([
307
+ "wifi",
308
+ "zwave",
309
+ "zigbee",
310
+ "unknown"
417
311
  ]);
418
- var delete_access_code_action_attempt = zod.z.discriminatedUnion("status", [
419
- common_pending_action_attempt.extend({
420
- action_type: zod.z.literal("DELETE_ACCESS_CODE")
421
- }),
422
- common_succeeded_action_attempt.extend({
423
- action_type: zod.z.literal("DELETE_ACCESS_CODE"),
424
- result
312
+ var smartlock = zod.z.object({
313
+ main_category: zod.z.literal(device_category.enum.smartlock),
314
+ physical_properties: zod.z.object({
315
+ lock_type: zod.z.enum([
316
+ "deadbolt",
317
+ "lever",
318
+ "mortise",
319
+ "lockbox",
320
+ "cylinder",
321
+ "padlock",
322
+ "locker",
323
+ "unknown"
324
+ ]),
325
+ has_physical_key: zod.z.boolean(),
326
+ has_camera: zod.z.boolean()
425
327
  }),
426
- common_failed_action_attempt.extend({
427
- action_type: zod.z.literal("DELETE_ACCESS_CODE"),
428
- error
328
+ software_features: zod.z.object({
329
+ can_remotely_unlock: zod.z.boolean(),
330
+ can_program_access_codes: zod.z.boolean(),
331
+ can_program_access_schedules: zod.z.boolean(),
332
+ can_program_access_codes_offline: zod.z.boolean()
429
333
  })
430
- ]);
431
- var update_access_code_action_attempt = zod.z.discriminatedUnion("status", [
432
- common_pending_action_attempt.extend({
433
- action_type: zod.z.literal("UPDATE_ACCESS_CODE")
434
- }),
435
- common_succeeded_action_attempt.extend({
436
- action_type: zod.z.literal("UPDATE_ACCESS_CODE"),
437
- result
438
- }),
439
- common_failed_action_attempt.extend({
440
- action_type: zod.z.literal("UPDATE_ACCESS_CODE"),
441
- error
334
+ }).merge(
335
+ device_model_capability_flags.pick({
336
+ can_remotely_lock: true,
337
+ can_remotely_unlock: true,
338
+ can_program_offline_access_codes: true,
339
+ can_program_online_access_codes: true
442
340
  })
443
- ]);
444
- var create_noise_threshold_action_attempt = zod.z.discriminatedUnion("status", [
445
- common_pending_action_attempt.extend({
446
- action_type: zod.z.literal("CREATE_NOISE_THRESHOLD")
447
- }),
448
- common_succeeded_action_attempt.extend({
449
- action_type: zod.z.literal("CREATE_NOISE_THRESHOLD"),
450
- result
451
- }),
452
- common_failed_action_attempt.extend({
453
- action_type: zod.z.literal("CREATE_NOISE_THRESHOLD"),
454
- error
341
+ );
342
+ var sensor = zod.z.object({
343
+ main_category: zod.z.literal(device_category.enum.sensor),
344
+ physical_properties: zod.z.object({
345
+ has_noise_sensor: zod.z.boolean(),
346
+ has_humidity_sensor: zod.z.boolean(),
347
+ has_temperature_sensor: zod.z.boolean(),
348
+ has_occupancy_detection: zod.z.boolean()
455
349
  })
456
- ]);
457
- var delete_noise_threshold_action_attempt = zod.z.discriminatedUnion("status", [
458
- common_pending_action_attempt.extend({
459
- action_type: zod.z.literal("DELETE_NOISE_THRESHOLD")
460
- }),
461
- common_succeeded_action_attempt.extend({
462
- action_type: zod.z.literal("DELETE_NOISE_THRESHOLD"),
463
- result
350
+ });
351
+ var thermostat = zod.z.object({
352
+ main_category: zod.z.literal(device_category.enum.thermostat),
353
+ physical_properties: zod.z.object({
354
+ available_modes: zod.z.enum(["heat", "cool", "fan", "eco"]).array(),
355
+ is_heat_pump_compatible: zod.z.boolean(),
356
+ has_occupancy_detection: zod.z.boolean(),
357
+ supports_demand_response: zod.z.boolean(),
358
+ has_humidity_sensor: zod.z.boolean(),
359
+ has_temperature_sensor: zod.z.boolean(),
360
+ supports_emergency_heating_mode: zod.z.boolean()
464
361
  }),
465
- common_failed_action_attempt.extend({
466
- action_type: zod.z.literal("DELETE_NOISE_THRESHOLD"),
467
- error
362
+ software_features: zod.z.object({
363
+ can_program_climate_schedules: zod.z.boolean()
468
364
  })
469
- ]);
470
- var update_noise_threshold_action_attempt = zod.z.discriminatedUnion("status", [
471
- common_pending_action_attempt.extend({
472
- action_type: zod.z.literal("UPDATE_NOISE_THRESHOLD")
473
- }),
474
- common_succeeded_action_attempt.extend({
475
- action_type: zod.z.literal("UPDATE_NOISE_THRESHOLD"),
476
- result
365
+ });
366
+ var relay = zod.z.object({
367
+ main_category: zod.z.literal(device_category.enum.relay)
368
+ });
369
+ var intercom = zod.z.object({
370
+ main_category: zod.z.literal(device_category.enum.intercom),
371
+ physical_properties: zod.z.object({
372
+ has_camera: zod.z.boolean(),
373
+ has_rfid_reader: zod.z.boolean().default(false),
374
+ has_nfc_reader: zod.z.boolean().default(false),
375
+ has_wiegand_interface: zod.z.boolean().default(false)
477
376
  }),
478
- common_failed_action_attempt.extend({
479
- action_type: zod.z.literal("UPDATE_NOISE_THRESHOLD"),
480
- error
377
+ software_features: zod.z.object({
378
+ can_remotely_unlock: zod.z.boolean(),
379
+ can_program_access_codes: zod.z.boolean(),
380
+ can_unlock_with_face_recognition: zod.z.boolean().default(false),
381
+ supports_onvif: zod.z.boolean().default(false)
481
382
  })
482
- ]);
483
- var deprecated_action_attempts = [
484
- ...sync_access_codes_action_attempt.options,
485
- ...create_access_code_action_attempt.options,
486
- ...delete_access_code_action_attempt.options,
487
- ...update_access_code_action_attempt.options,
488
- ...create_noise_threshold_action_attempt.options,
489
- ...delete_noise_threshold_action_attempt.options,
490
- ...update_noise_threshold_action_attempt.options
491
- ];
492
- var action_type = zod.z.literal("LOCK_DOOR");
493
- var error2 = zod.z.object({
494
- type: zod.z.string(),
495
- message: zod.z.string()
496
383
  });
497
- var result2 = zod.z.object({});
498
- var lock_door_action_attempt = zod.z.discriminatedUnion("status", [
499
- common_pending_action_attempt.extend({
500
- action_type
501
- }).describe("Locking door."),
502
- common_succeeded_action_attempt.extend({
503
- action_type,
504
- result: result2
505
- }).describe("Locking door succeeded."),
506
- common_failed_action_attempt.extend({ action_type, error: error2 }).describe("Locking door failed.")
507
- ]);
508
- var action_type2 = zod.z.literal("RESET_SANDBOX_WORKSPACE");
509
- var error3 = zod.z.object({
510
- type: zod.z.string(),
511
- message: zod.z.string()
384
+ var accessory = zod.z.object({
385
+ main_category: zod.z.literal(device_category.enum.accessory)
512
386
  });
513
- var result3 = zod.z.object({});
514
- var reset_sandbox_workspace_action_attempt = zod.z.discriminatedUnion(
515
- "status",
516
- [
517
- common_pending_action_attempt.extend({
518
- action_type: action_type2
519
- }).describe("Resetting sandbox workspace."),
520
- common_succeeded_action_attempt.extend({
521
- action_type: action_type2,
522
- result: result3
523
- }).describe("Resetting sandbox workspace succeeded."),
524
- common_failed_action_attempt.extend({
525
- action_type: action_type2,
526
- error: error3
527
- }).describe("Resetting sandbox workspace failed.")
528
- ]
387
+ var device_model_category_specific_properties = zod.z.discriminatedUnion(
388
+ "main_category",
389
+ [smartlock, sensor, thermostat, relay, intercom, accessory]
529
390
  );
530
- var action_type3 = zod.z.literal("SET_COOL");
531
- var error4 = zod.z.object({
532
- type: zod.z.string(),
533
- message: zod.z.string()
534
- });
535
- var result4 = zod.z.object({});
536
- var set_cool_action_attempt = zod.z.discriminatedUnion("status", [
537
- common_pending_action_attempt.extend({
538
- action_type: action_type3
539
- }).describe("Setting HVAC to cool."),
540
- common_succeeded_action_attempt.extend({
541
- action_type: action_type3,
542
- result: result4
543
- }).describe("Setting HVAC to cool succeeded."),
544
- common_failed_action_attempt.extend({ action_type: action_type3, error: error4 }).describe("Setting HVAC to cool failed.")
545
- ]);
546
- var action_type4 = zod.z.literal("SET_FAN_MODE");
547
- var error5 = zod.z.object({
548
- type: zod.z.string(),
549
- message: zod.z.string()
550
- });
551
- var result5 = zod.z.object({});
552
- var set_fan_mode_action_attempt = zod.z.discriminatedUnion("status", [
553
- common_pending_action_attempt.extend({
554
- action_type: action_type4
555
- }).describe("Setting fan mode."),
556
- common_succeeded_action_attempt.extend({
557
- action_type: action_type4,
558
- result: result5
559
- }).describe("Setting fan mode succeeded."),
560
- common_failed_action_attempt.extend({ action_type: action_type4, error: error5 }).describe("Setting fan mode failed.")
561
- ]);
562
- var action_type5 = zod.z.literal("SET_HEAT");
563
- var error6 = zod.z.object({
564
- type: zod.z.string(),
565
- message: zod.z.string()
566
- });
567
- var result6 = zod.z.object({});
568
- var set_heat_action_attempt = zod.z.discriminatedUnion("status", [
569
- common_pending_action_attempt.extend({
570
- action_type: action_type5
571
- }).describe("Setting HVAC to heat mode."),
572
- common_succeeded_action_attempt.extend({
573
- action_type: action_type5,
574
- result: result6
575
- }).describe("Setting HVAC to heat mode succeeded."),
576
- common_failed_action_attempt.extend({ action_type: action_type5, error: error6 }).describe("Setting HVAC to heat mode failed.")
577
- ]);
578
- var action_type6 = zod.z.literal("SET_HEAT_COOL");
579
- var error7 = zod.z.object({
580
- type: zod.z.string(),
581
- message: zod.z.string()
582
- });
583
- var result7 = zod.z.object({});
584
- var set_heat_cool_action_attempt = zod.z.discriminatedUnion("status", [
585
- common_pending_action_attempt.extend({
586
- action_type: action_type6
587
- }).describe("Setting HVAC to heat-cool mode."),
588
- common_succeeded_action_attempt.extend({
589
- action_type: action_type6,
590
- result: result7
591
- }).describe("Setting HVAC to heat-cool mode succeeded."),
592
- common_failed_action_attempt.extend({ action_type: action_type6, error: error7 }).describe("Setting heat-cool mode failed.")
593
- ]);
594
- var action_type7 = zod.z.literal("SET_THERMOSTAT_OFF");
595
- var error8 = zod.z.object({
596
- type: zod.z.string(),
597
- message: zod.z.string()
598
- });
599
- var result8 = zod.z.object({});
600
- var set_thermostat_off_action_attempt = zod.z.discriminatedUnion(
601
- "status",
602
- [
603
- common_pending_action_attempt.extend({
604
- action_type: action_type7
605
- }).describe("Turning HVAC off."),
606
- common_succeeded_action_attempt.extend({
607
- action_type: action_type7,
608
- result: result8
609
- }).describe("Turning HVAC off succeeded."),
610
- common_failed_action_attempt.extend({ action_type: action_type7, error: error8 }).describe("Turning HVAC off failed.")
611
- ]
612
- );
613
- var action_type8 = zod.z.literal("UNLOCK_DOOR");
614
- var error9 = zod.z.object({
615
- type: zod.z.string(),
616
- message: zod.z.string()
617
- });
618
- var result9 = zod.z.object({});
619
- var unlock_door_action_attempt = zod.z.discriminatedUnion("status", [
620
- common_pending_action_attempt.extend({
621
- action_type: action_type8
622
- }).describe("Unlocking door."),
623
- common_succeeded_action_attempt.extend({
624
- action_type: action_type8,
625
- result: result9
626
- }).describe("Unlocking door succeeded."),
627
- common_failed_action_attempt.extend({ action_type: action_type8, error: error9 }).describe("Unlocking door failed.")
628
- ]);
629
-
630
- // src/lib/seam/connect/models/action-attempts/action-attempt.ts
631
- var action_attempt = zod.z.union([
632
- ...lock_door_action_attempt.options,
633
- ...unlock_door_action_attempt.options,
634
- ...reset_sandbox_workspace_action_attempt.options,
635
- ...set_cool_action_attempt.options,
636
- ...set_heat_action_attempt.options,
637
- ...set_heat_cool_action_attempt.options,
638
- ...set_fan_mode_action_attempt.options,
639
- ...set_thermostat_off_action_attempt.options,
640
- ...deprecated_action_attempts
641
- ]);
642
- var client_session = zod.z.object({
643
- client_session_id: zod.z.string().uuid(),
644
- workspace_id: zod.z.string().uuid(),
645
- created_at: zod.z.string().datetime(),
646
- token: zod.z.string(),
647
- user_identifier_key: zod.z.string().nullable(),
648
- device_count: zod.z.number(),
649
- connected_account_ids: zod.z.array(zod.z.string().uuid()),
650
- connect_webview_ids: zod.z.array(zod.z.string().uuid()),
651
- user_identity_ids: zod.z.array(zod.z.string().uuid())
652
- });
653
- zod.z.record(
654
- zod.z.string().max(40),
655
- zod.z.union([zod.z.string().max(500), zod.z.boolean(), zod.z.null()])
656
- ).refine((val) => Object.keys(val).length <= 50, {
657
- message: "Custom metadata is limited to a maximum of 50 keys"
391
+ var base_device_model_v1 = zod.z.object({
392
+ device_model_id: zod.z.string().uuid(),
393
+ manufacturer: manufacturer.omit({
394
+ device_model_count: true
395
+ }),
396
+ is_device_supported: zod.z.boolean(),
397
+ display_name: zod.z.string(),
398
+ description: zod.z.string(),
399
+ product_url: zod.z.string().optional(),
400
+ main_connection_type: device_connection_type,
401
+ hardware,
402
+ aesthetic_variants: zod.z.object({
403
+ slug: zod.z.string(),
404
+ display_name: zod.z.string(),
405
+ primary_color_hex: zod.z.string().optional(),
406
+ manufacturer_sku: zod.z.string().optional(),
407
+ front_image: image_reference.optional(),
408
+ back_image: image_reference.optional(),
409
+ images: image_reference.array()
410
+ }).array(),
411
+ power_sources: zod.z.enum([
412
+ "battery",
413
+ "hardwired",
414
+ "mechanical_harvesting",
415
+ "wireless",
416
+ "ethernet"
417
+ ]).array()
658
418
  });
659
- var custom_metadata = zod.z.record(
660
- zod.z.string(),
661
- zod.z.union([zod.z.string(), zod.z.boolean()])
419
+ var device_model_v1 = base_device_model_v1.and(
420
+ device_model_category_specific_properties
662
421
  );
663
-
664
- // src/lib/seam/connect/models/connect-webviews/connect-webview.ts
665
- var connect_webview_device_selection_mode = zod.z.enum([
666
- "none",
667
- "single",
668
- "multiple"
669
- ]);
670
- var connect_webview = zod.z.object({
671
- connect_webview_id: zod.z.string().uuid(),
672
- workspace_id: zod.z.string().uuid(),
673
- created_at: zod.z.string().datetime(),
674
- connected_account_id: zod.z.string().uuid().nullable(),
675
- url: zod.z.string().url(),
676
- device_selection_mode: connect_webview_device_selection_mode,
677
- // TODO: Use enum value.
678
- accepted_providers: zod.z.array(zod.z.string()),
679
- accepted_devices: zod.z.array(zod.z.string()).describe(
680
- `
681
- ---
682
- deprecated: Unused. Will be removed.
683
- ---
684
- `
685
- ),
686
- any_device_allowed: zod.z.boolean().describe(
687
- `
688
- ---
689
- deprecated: Unused. Will be removed.
690
- ---
691
- `
692
- ),
693
- any_provider_allowed: zod.z.boolean(),
694
- login_successful: zod.z.boolean(),
695
- status: zod.z.enum(["pending", "failed", "authorized"]),
696
- custom_redirect_url: zod.z.string().url().nullable(),
697
- custom_redirect_failure_url: zod.z.string().url().nullable(),
698
- custom_metadata,
699
- automatically_manage_new_devices: zod.z.boolean(),
700
- wait_for_device_creation: zod.z.boolean(),
701
- authorized_at: zod.z.string().datetime().nullable(),
702
- selected_provider: zod.z.string().nullable()
703
- });
704
- var connected_account = zod.z.object({
705
- connected_account_id: zod.z.string().uuid().optional(),
706
- created_at: zod.z.string().datetime().optional(),
707
- user_identifier: zod.z.object({
708
- username: zod.z.string().optional(),
709
- api_url: zod.z.string().optional(),
710
- email: zod.z.string().optional(),
711
- phone: zod.z.string().optional(),
712
- exclusive: zod.z.boolean().optional()
713
- }).optional(),
714
- account_type: zod.z.string().optional(),
715
- account_type_display_name: zod.z.string(),
716
- errors: zod.z.any(),
717
- warnings: zod.z.any(),
718
- custom_metadata,
719
- automatically_manage_new_devices: zod.z.boolean()
720
- });
721
- var capabilities = zod.z.enum([
722
- "access_code",
723
- "lock",
724
- "noise_detection",
725
- "thermostat",
726
- "battery",
727
- "phone"
728
- ]);
729
- var access_code_code_constraint = zod.z.object({
730
- constraint_type: zod.z.enum([
731
- "no_zeros",
732
- // Nuki
733
- "cannot_start_with_12",
734
- // Nuki
735
- "no_triple_consecutive_ints",
736
- // Brivo
737
- "cannot_specify_pin_code",
738
- // Lockly
739
- "pin_code_matches_existing_set",
740
- // Salto
741
- "start_date_in_future",
742
- // Kwikset
743
- "no_ascending_or_descending_sequence",
744
- // Tedee
745
- "at_least_three_unique_digits",
746
- // Tedee
747
- "cannot_contain_089"
748
- // TTLock (for some cylinder devices only)
749
- ])
422
+ var dormakaba_oracode_time_slot = zod.z.object({
423
+ name: zod.z.string(),
424
+ prefix: zod.z.number(),
425
+ // Seam TOD
426
+ check_in_time: zod.z.string(),
427
+ // Seam TOD
428
+ check_out_time: zod.z.string(),
429
+ is_24_hour: zod.z.boolean(),
430
+ is_biweekly_mode: zod.z.boolean(),
431
+ is_one_shot: zod.z.boolean(),
432
+ is_master: zod.z.boolean(),
433
+ ext_dormakaba_oracode_user_level_prefix: zod.z.number(),
434
+ dormakaba_oracode_user_level_id: zod.z.string().uuid()
750
435
  });
751
- var access_code_name_constraint = zod.z.object({
752
- constraint_type: zod.z.enum(["name_length", "name_must_be_unique"]),
753
- // Nuki, Kwikset
754
- min_length: zod.z.number().optional(),
755
- max_length: zod.z.number().optional()
436
+ var device_metadata = zod.z.object({
437
+ august_metadata: zod.z.object({
438
+ lock_id: zod.z.string(),
439
+ lock_name: zod.z.string(),
440
+ house_name: zod.z.string(),
441
+ has_keypad: zod.z.boolean(),
442
+ keypad_battery_level: zod.z.string().optional(),
443
+ model: zod.z.string().optional(),
444
+ house_id: zod.z.string().optional()
445
+ }),
446
+ avigilon_alta_metadata: zod.z.object({
447
+ entry_name: zod.z.string(),
448
+ org_name: zod.z.string(),
449
+ zone_id: zod.z.number(),
450
+ zone_name: zod.z.string(),
451
+ site_id: zod.z.number(),
452
+ site_name: zod.z.string(),
453
+ entry_relays_total_count: zod.z.number()
454
+ }),
455
+ schlage_metadata: zod.z.object({
456
+ device_id: zod.z.string(),
457
+ device_name: zod.z.string(),
458
+ access_code_length: zod.z.number().nullable(),
459
+ model: zod.z.string().optional()
460
+ }),
461
+ smartthings_metadata: zod.z.object({
462
+ device_id: zod.z.string(),
463
+ device_name: zod.z.string(),
464
+ model: zod.z.string().optional(),
465
+ location_id: zod.z.string().optional()
466
+ }),
467
+ lockly_metadata: zod.z.object({
468
+ device_id: zod.z.string(),
469
+ device_name: zod.z.string(),
470
+ model: zod.z.string().optional()
471
+ }),
472
+ nuki_metadata: zod.z.object({
473
+ device_id: zod.z.string(),
474
+ device_name: zod.z.string(),
475
+ keypad_battery_critical: zod.z.boolean().optional(),
476
+ keypad_paired: zod.z.boolean().optional(),
477
+ keypad_2_paired: zod.z.boolean().optional()
478
+ }),
479
+ kwikset_metadata: zod.z.object({
480
+ device_id: zod.z.string(),
481
+ device_name: zod.z.string(),
482
+ model_number: zod.z.string()
483
+ }),
484
+ salto_metadata: zod.z.object({
485
+ lock_id: zod.z.string(),
486
+ customer_reference: zod.z.string(),
487
+ lock_type: zod.z.string(),
488
+ battery_level: zod.z.string(),
489
+ locked_state: zod.z.string(),
490
+ model: zod.z.string().optional()
491
+ }),
492
+ genie_metadata: zod.z.object({
493
+ device_name: zod.z.string(),
494
+ door_name: zod.z.string()
495
+ }),
496
+ brivo_metadata: zod.z.object({
497
+ device_name: zod.z.string()
498
+ }),
499
+ igloo_metadata: zod.z.object({
500
+ device_id: zod.z.string(),
501
+ bridge_id: zod.z.string(),
502
+ model: zod.z.string().optional()
503
+ }),
504
+ noiseaware_metadata: zod.z.object({
505
+ device_model: zod.z.enum(["indoor", "outdoor"]),
506
+ noise_level_nrs: zod.z.number(),
507
+ noise_level_decibel: zod.z.number(),
508
+ device_name: zod.z.string(),
509
+ device_id: zod.z.string()
510
+ }),
511
+ minut_metadata: zod.z.object({
512
+ device_id: zod.z.string(),
513
+ device_name: zod.z.string(),
514
+ latest_sensor_values: zod.z.object({
515
+ temperature: zod.z.object({
516
+ time: zod.z.string(),
517
+ value: zod.z.number()
518
+ }),
519
+ sound: zod.z.object({
520
+ time: zod.z.string(),
521
+ value: zod.z.number()
522
+ }),
523
+ humidity: zod.z.object({
524
+ time: zod.z.string(),
525
+ value: zod.z.number()
526
+ }),
527
+ pressure: zod.z.object({
528
+ time: zod.z.string(),
529
+ value: zod.z.number()
530
+ }),
531
+ accelerometer_z: zod.z.object({
532
+ time: zod.z.string(),
533
+ value: zod.z.number()
534
+ })
535
+ })
536
+ }),
537
+ four_suites_metadata: zod.z.object({
538
+ device_id: zod.z.number(),
539
+ device_name: zod.z.string(),
540
+ reclose_delay_in_seconds: zod.z.number()
541
+ }),
542
+ two_n_metadata: zod.z.object({
543
+ device_id: zod.z.number(),
544
+ device_name: zod.z.string()
545
+ }),
546
+ controlbyweb_metadata: zod.z.object({
547
+ device_id: zod.z.string(),
548
+ device_name: zod.z.string(),
549
+ relay_name: zod.z.string().nullable()
550
+ }),
551
+ ttlock_metadata: zod.z.object({
552
+ lock_id: zod.z.number(),
553
+ lock_alias: zod.z.string(),
554
+ feature_value: zod.z.string()
555
+ }),
556
+ seam_bridge_metadata: zod.z.object({
557
+ unlock_method: zod.z.enum(["bridge", "doorking"]).optional(),
558
+ device_num: zod.z.number(),
559
+ name: zod.z.string()
560
+ }),
561
+ igloohome_metadata: zod.z.object({
562
+ device_id: zod.z.string(),
563
+ device_name: zod.z.string(),
564
+ bridge_id: zod.z.string().optional(),
565
+ bridge_name: zod.z.string().optional(),
566
+ keypad_id: zod.z.string().optional()
567
+ }),
568
+ nest_metadata: zod.z.object({
569
+ nest_device_id: zod.z.string(),
570
+ device_name: zod.z.string(),
571
+ // set by Google
572
+ custom_name: zod.z.string()
573
+ // set by device owner
574
+ }),
575
+ ecobee_metadata: zod.z.object({
576
+ ecobee_device_id: zod.z.string(),
577
+ device_name: zod.z.string()
578
+ }),
579
+ honeywell_resideo_metadata: zod.z.object({
580
+ honeywell_resideo_device_id: zod.z.string(),
581
+ device_name: zod.z.string()
582
+ }),
583
+ hubitat_metadata: zod.z.object({
584
+ device_id: zod.z.string(),
585
+ device_name: zod.z.string(),
586
+ device_label: zod.z.string()
587
+ }),
588
+ dormakaba_oracode_metadata: zod.z.object({
589
+ door_id: zod.z.number(),
590
+ door_name: zod.z.string(),
591
+ device_id: zod.z.number().optional(),
592
+ door_is_wireless: zod.z.boolean(),
593
+ site_id: zod.z.number(),
594
+ site_name: zod.z.string(),
595
+ iana_timezone: zod.z.string().optional(),
596
+ predefined_time_slots: zod.z.array(dormakaba_oracode_time_slot).optional()
597
+ }),
598
+ wyze_metadata: zod.z.object({
599
+ device_id: zod.z.string(),
600
+ device_name: zod.z.string(),
601
+ product_name: zod.z.string(),
602
+ product_type: zod.z.string(),
603
+ product_model: zod.z.string(),
604
+ device_info_model: zod.z.string(),
605
+ keypad_uuid: zod.z.string().optional(),
606
+ locker_status_hardlock: zod.z.number().optional()
607
+ }),
608
+ tedee_metadata: zod.z.object({
609
+ device_id: zod.z.number(),
610
+ serial_number: zod.z.string(),
611
+ device_name: zod.z.string(),
612
+ device_model: zod.z.string(),
613
+ bridge_id: zod.z.number(),
614
+ bridge_name: zod.z.string(),
615
+ keypad_id: zod.z.number().optional()
616
+ })
617
+ }).partial();
618
+ var LOCK_DEVICE_TYPE = {
619
+ AKUVOX_LOCK: "akuvox_lock",
620
+ AUGUST_LOCK: "august_lock",
621
+ BRIVO_ACCESS_POINT: "brivo_access_point",
622
+ BUTTERFLYMX_PANEL: "butterflymx_panel",
623
+ AVIGILON_ALTA_ENTRY: "avigilon_alta_entry",
624
+ DOORKING_LOCK: "doorking_lock",
625
+ GENIE_DOOR: "genie_door",
626
+ IGLOO_LOCK: "igloo_lock",
627
+ LINEAR_LOCK: "linear_lock",
628
+ LOCKLY_LOCK: "lockly_lock",
629
+ KWIKSET_LOCK: "kwikset_lock",
630
+ NUKI_LOCK: "nuki_lock",
631
+ SALTO_LOCK: "salto_lock",
632
+ SCHLAGE_LOCK: "schlage_lock",
633
+ SEAM_RELAY: "seam_relay",
634
+ SMARTTHINGS_LOCK: "smartthings_lock",
635
+ WYZE_LOCK: "wyze_lock",
636
+ YALE_LOCK: "yale_lock",
637
+ TWO_N_INTERCOM: "two_n_intercom",
638
+ CONTROLBYWEB_DEVICE: "controlbyweb_device",
639
+ TTLOCK_LOCK: "ttlock_lock",
640
+ IGLOOHOME_LOCK: "igloohome_lock",
641
+ HUBITAT_LOCK: "hubitat_lock",
642
+ FOUR_SUITES_DOOR: "four_suites_door",
643
+ DORMAKABA_ORACODE_DOOR: "dormakaba_oracode_door",
644
+ TEDEE_LOCK: "tedee_lock"
645
+ };
646
+ var lock_device_type = zod.z.enum(
647
+ Object.values(LOCK_DEVICE_TYPE)
648
+ );
649
+ var NOISE_SENSOR_DEVICE_TYPE = {
650
+ NOISEAWARE_ACTIVITY_ZONE: "noiseaware_activity_zone",
651
+ MINUT_SENSOR: "minut_sensor"
652
+ };
653
+ var noise_sensor_device_type = zod.z.enum(
654
+ Object.values(NOISE_SENSOR_DEVICE_TYPE)
655
+ );
656
+ var THERMOSTAT_DEVICE_TYPE = {
657
+ ECOBEE_THERMOSTAT: "ecobee_thermostat",
658
+ NEST_THERMOSTAT: "nest_thermostat",
659
+ HONEYWELL_RESIDEO_THERMOSTAT: "honeywell_resideo_thermostat"
660
+ };
661
+ var thermostat_device_type = zod.z.enum(
662
+ Object.values(THERMOSTAT_DEVICE_TYPE)
663
+ );
664
+ var PHONE_DEVICE_TYPE = {
665
+ IOS_PHONE: "ios_phone",
666
+ ANDROID_PHONE: "android_phone"
667
+ };
668
+ var PHONE_DEVICE_TYPE_LIST = Object.values(
669
+ PHONE_DEVICE_TYPE
670
+ );
671
+ var phone_device_type = zod.z.enum(
672
+ Object.values(PHONE_DEVICE_TYPE_LIST)
673
+ );
674
+ var any_device_type = zod.z.union([
675
+ lock_device_type,
676
+ noise_sensor_device_type,
677
+ thermostat_device_type,
678
+ phone_device_type
679
+ ]);
680
+ var phone_specific_properties = zod.z.object({
681
+ assa_abloy_credential_service_metadata: zod.z.object({
682
+ has_active_endpoint: zod.z.boolean(),
683
+ endpoints: zod.z.array(
684
+ zod.z.object({
685
+ endpoint_id: zod.z.string(),
686
+ is_active: zod.z.boolean()
687
+ })
688
+ )
689
+ }).optional()
690
+ });
691
+
692
+ // src/lib/seam/connect/models/devices/device.ts
693
+ var device_capability_flags2 = models_exports.device_capability_flags.extend({
694
+ can_simulate_removal: zod.z.boolean().optional(),
695
+ can_simulate_connection: zod.z.boolean().optional(),
696
+ can_simulate_disconnection: zod.z.boolean().optional()
697
+ });
698
+ var battery_status = zod.z.enum(["critical", "low", "good", "full"]);
699
+ var common_device_error = zod.z.object({
700
+ message: zod.z.string(),
701
+ is_device_error: zod.z.literal(true)
702
+ });
703
+ var common_device_warning = zod.z.object({
704
+ message: zod.z.string()
705
+ });
706
+ var device_error = common_device_error.extend({
707
+ error_code: zod.z.string()
708
+ });
709
+ var device_warning = common_device_warning.extend({
710
+ warning_code: zod.z.string()
711
+ });
712
+ var common_device_properties = zod.z.object({
713
+ online: zod.z.boolean().describe("Indicates whether the device is online."),
714
+ name: zod.z.string().describe(`
715
+ ---
716
+ deprecated: use device.display_name instead
717
+ ---
718
+ Name of the device.
719
+ `),
720
+ accessory_keypad: zod.z.object({
721
+ is_connected: zod.z.boolean().describe(
722
+ "Indicates if the accessory_keypad is connected to the device."
723
+ ),
724
+ battery: zod.z.object({
725
+ level: zod.z.number().min(0).max(1)
726
+ }).optional().describe("Indicates if the keypad battery properties.")
727
+ }).optional().describe("Represents the accessory keypad state."),
728
+ appearance: zod.z.object({
729
+ name: zod.z.string().describe(
730
+ "Name of the device as seen from the provider API and application, not settable through Seam."
731
+ )
732
+ }),
733
+ model: zod.z.object({
734
+ can_connect_accessory_keypad: zod.z.boolean().optional().describe("Indicates whether the device can connect a accessory keypad."),
735
+ display_name: zod.z.string().describe("Display name of the device model."),
736
+ manufacturer_display_name: zod.z.string().describe(
737
+ "Display name that corresponds to the manufacturer-specific terminology for the device."
738
+ ),
739
+ has_built_in_keypad: zod.z.boolean().optional().describe(
740
+ "Indicates whether the device has a built in accessory keypad."
741
+ ),
742
+ offline_access_codes_supported: zod.z.boolean().optional().describe("Indicates whether the device supports offline access codes."),
743
+ online_access_codes_supported: zod.z.boolean().optional().describe("Indicates whether the device supports online access codes."),
744
+ accessory_keypad_supported: zod.z.boolean().optional().describe(
745
+ `
746
+ ---
747
+ deprecated: use device.properties.model.can_connect_accessory_keypad
748
+ ---
749
+ `
750
+ )
751
+ }),
752
+ has_direct_power: zod.z.boolean().optional().describe("Indicates whether the device has direct power."),
753
+ battery_level: zod.z.number().min(0).max(1).optional().describe(
754
+ "Indicates the battery level of the device as a decimal value between 0 and 1, inclusive."
755
+ ),
756
+ battery: zod.z.object({
757
+ level: zod.z.number().min(0).max(1),
758
+ status: battery_status
759
+ }).optional().describe(
760
+ 'Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage.'
761
+ ),
762
+ // todo: use enum
763
+ manufacturer: zod.z.string().optional().describe("Manufacturer of the device."),
764
+ image_url: zod.z.string().url().optional().describe("Image URL for the device."),
765
+ image_alt_text: zod.z.string().optional().describe("Alt text for the device image."),
766
+ serial_number: zod.z.string().optional().describe("Serial number of the device."),
767
+ online_access_codes_enabled: zod.z.boolean().describe(
768
+ "Indicates whether it is currently possible to use online access codes for the device."
769
+ ).optional(),
770
+ offline_access_codes_enabled: zod.z.boolean().describe(
771
+ "Indicates whether it is currently possible to use offline access codes for the device."
772
+ ).optional(),
773
+ // Deprecated legacy capability support props
774
+ supports_accessory_keypad: zod.z.boolean().describe(
775
+ `
776
+ ---
777
+ deprecated: use device.properties.model.can_connect_accessory_keypad
778
+ ---
779
+ `
780
+ ).optional(),
781
+ supports_offline_access_codes: zod.z.boolean().describe(
782
+ `
783
+ ---
784
+ deprecated: use offline_access_codes_enabled
785
+ ---
786
+ `
787
+ ).optional(),
788
+ noise_level_decibels: zod.z.number().describe(
789
+ "Indicates current noise level in decibels, if the device supports noise detection."
790
+ ).optional(),
791
+ currently_triggering_noise_threshold_ids: zod.z.array(zod.z.string()).describe("Array of noise threshold IDs that are currently triggering.").optional()
792
+ });
793
+ var device = zod.z.object({
794
+ device_id: zod.z.string().uuid().describe("Unique identifier for the device."),
795
+ device_type: any_device_type.describe("Type of the device."),
796
+ nickname: zod.z.string().optional().describe(
797
+ "Optional nickname to describe the device, settable through Seam"
798
+ ),
799
+ display_name: zod.z.string().describe(
800
+ "Display name of the device, defaults to nickname (if it is set) or properties.appearance.name otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices."
801
+ ),
802
+ capabilities_supported: zod.z.array(capabilities).describe(
803
+ 'Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health.'
804
+ ),
805
+ properties: common_device_properties.and(phone_specific_properties.partial()).and(device_metadata).and(capability_properties).describe("Properties of the device."),
806
+ location: zod.z.object({
807
+ location_name: zod.z.string().optional().describe("Name of the device location."),
808
+ timezone: zod.z.string().optional().describe("Time zone of the device location.")
809
+ }).nullable().describe("Location information for the device."),
810
+ connected_account_id: zod.z.string().uuid().describe(
811
+ "Unique identifier for the account associated with the device."
812
+ ),
813
+ workspace_id: zod.z.string().uuid().describe(
814
+ "Unique identifier for the Seam workspace associated with the device."
815
+ ),
816
+ errors: zod.z.array(zod.z.union([device_error, connected_account_error])).describe(
817
+ 'Array of errors associated with the device. 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.'
818
+ ),
819
+ warnings: zod.z.array(device_warning).describe(
820
+ 'Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it.'
821
+ ),
822
+ created_at: zod.z.string().datetime().describe("Date and time at which the device object was created."),
823
+ is_managed: zod.z.literal(true).describe("Indicates whether Seam manages the device."),
824
+ custom_metadata
825
+ }).merge(device_capability_flags2);
826
+ var DEVICE_PROVIDERS = {
827
+ AKUVOX: "akuvox",
828
+ AUGUST: "august",
829
+ AVIGILON_ALTA: "avigilon_alta",
830
+ BRIVO: "brivo",
831
+ BUTTERFLYMX: "butterflymx",
832
+ SCHLAGE: "schlage",
833
+ SMARTTHINGS: "smartthings",
834
+ YALE: "yale",
835
+ GENIE: "genie",
836
+ DOORKING: "doorking",
837
+ SALTO: "salto",
838
+ LOCKLY: "lockly",
839
+ TTLOCK: "ttlock",
840
+ LINEAR: "linear",
841
+ NOISEAWARE: "noiseaware",
842
+ NUKI: "nuki",
843
+ SEAM_RELAY_ADMIN: "seam_relay_admin",
844
+ IGLOO: "igloo",
845
+ KWIKSET: "kwikset",
846
+ MINUT: "minut",
847
+ MY_2N: "my_2n",
848
+ CONTROLBYWEB: "controlbyweb",
849
+ NEST: "nest",
850
+ IGLOOHOME: "igloohome",
851
+ ECOBEE: "ecobee",
852
+ HUBITAT: "hubitat",
853
+ FOUR_SUITES: "four_suites",
854
+ DORMAKABA_ORACODE: "dormakaba_oracode",
855
+ PTI: "pti",
856
+ WYZE: "wyze",
857
+ SEAM_PASSPORT: "seam_passport",
858
+ VISIONLINE: "visionline",
859
+ ASSA_ABLOY_CREDENTIAL_SERVICE: "assa_abloy_credential_service",
860
+ SEAM_BRIDGE: "seam_bridge",
861
+ TEDEE: "tedee",
862
+ HONEYWELL_RESIDEO: "honeywell_resideo",
863
+ LATCH: "latch"
864
+ };
865
+ var ALL_DEVICE_PROVIDERS = Object.values(DEVICE_PROVIDERS);
866
+ var PROVIDER_CATEGORY_MAP = {
867
+ stable: [
868
+ "august",
869
+ "avigilon_alta",
870
+ "brivo",
871
+ "schlage",
872
+ "smartthings",
873
+ "yale",
874
+ "nuki",
875
+ "salto",
876
+ "controlbyweb",
877
+ "minut",
878
+ "my_2n",
879
+ "kwikset",
880
+ "ttlock",
881
+ "noiseaware",
882
+ "igloohome",
883
+ "ecobee",
884
+ "four_suites",
885
+ "lockly",
886
+ "wyze",
887
+ "nest",
888
+ "tedee",
889
+ "seam_bridge",
890
+ "honeywell_resideo",
891
+ "visionline",
892
+ "assa_abloy_credential_service",
893
+ "latch"
894
+ ],
895
+ consumer_smartlocks: [
896
+ "august",
897
+ "schlage",
898
+ "yale",
899
+ "smartthings",
900
+ "nuki",
901
+ "ttlock",
902
+ "kwikset",
903
+ "igloohome",
904
+ "wyze"
905
+ ],
906
+ thermostats: ["ecobee", "nest"],
907
+ noise_sensors: ["minut", "noiseaware"],
908
+ access_control_systems: [
909
+ "pti",
910
+ "visionline",
911
+ "assa_abloy_credential_service",
912
+ "latch"
913
+ ],
914
+ internal_beta: ALL_DEVICE_PROVIDERS
915
+ };
916
+ var PROVIDER_CATEGORIES = Object.keys(PROVIDER_CATEGORY_MAP);
917
+ var PUBLIC_PROVIDER_CATEGORIES = PROVIDER_CATEGORIES.filter((category) => category !== "internal_beta");
918
+ var device_provider = zod.z.object({
919
+ device_provider_name: zod.z.enum(ALL_DEVICE_PROVIDERS),
920
+ display_name: zod.z.string(),
921
+ image_url: zod.z.string(),
922
+ provider_categories: zod.z.array(zod.z.enum(PUBLIC_PROVIDER_CATEGORIES))
923
+ });
924
+ var unmanaged_device = device.pick({
925
+ device_id: true,
926
+ device_type: true,
927
+ connected_account_id: true,
928
+ capabilities_supported: true,
929
+ workspace_id: true,
930
+ errors: true,
931
+ warnings: true,
932
+ created_at: true
933
+ }).extend({
934
+ is_managed: zod.z.literal(false),
935
+ properties: common_device_properties.pick({
936
+ accessory_keypad: true,
937
+ name: true,
938
+ online: true,
939
+ manufacturer: true,
940
+ image_url: true,
941
+ image_alt_text: true,
942
+ battery_level: true,
943
+ battery: true,
944
+ online_access_codes_enabled: true,
945
+ offline_access_codes_enabled: true,
946
+ model: true
947
+ })
948
+ }).merge(device_capability_flags2);
949
+
950
+ // src/lib/seam/connect/models/access-codes/managed-access-code.ts
951
+ var common_access_code_error = zod.z.object({
952
+ message: zod.z.string(),
953
+ is_access_code_error: zod.z.literal(true)
954
+ });
955
+ var common_access_code_warning = zod.z.object({
956
+ message: zod.z.string()
957
+ });
958
+ var access_code_error = common_access_code_error.extend({
959
+ error_code: zod.z.string()
960
+ });
961
+ var access_code_warning = common_access_code_warning.extend({
962
+ warning_code: zod.z.string()
963
+ });
964
+ var access_code = zod.z.object({
965
+ common_code_key: zod.z.string().nullable().describe(
966
+ "Unique identifier for a group of access codes that share the same code."
967
+ ),
968
+ is_scheduled_on_device: zod.z.boolean().optional().describe(
969
+ "Indicates whether the code is set on the device according to a preconfigured schedule."
970
+ ),
971
+ type: zod.z.enum(["time_bound", "ongoing"]).describe(
972
+ 'Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration.'
973
+ ),
974
+ is_waiting_for_code_assignment: zod.z.boolean().optional().describe(
975
+ "Indicates whether the access code is waiting for a code assignment."
976
+ ),
977
+ access_code_id: zod.z.string().uuid().describe("Unique identifier for the access code."),
978
+ device_id: zod.z.string().uuid().describe(
979
+ "Unique identifier for the device associated with the access code."
980
+ ),
981
+ name: zod.z.string().nullable().describe(
982
+ "Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes."
983
+ ),
984
+ code: zod.z.string().nullable().describe(
985
+ "Code used for access. Typically, a numeric or alphanumeric string."
986
+ ),
987
+ created_at: zod.z.string().datetime().describe("Date and time at which the access code was created."),
988
+ errors: zod.z.array(zod.z.union([access_code_error, device_error, connected_account_error])).describe(
989
+ 'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.'
990
+ ),
991
+ warnings: zod.z.array(access_code_warning).describe(
992
+ 'Collection of warnings associated with the access code, structured in a dictionary format. A unique "warning_code" keys each warning. Each warning entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the warning. "created_at" is a date that indicates when the warning was generated. This structure enables detailed tracking and timely response to potential issues that are not critical but that may require attention.'
993
+ ),
994
+ is_managed: zod.z.literal(true).describe("Indicates whether Seam manages the access code."),
995
+ starts_at: zod.z.string().datetime().nullable().optional().describe(
996
+ "Date and time at which the time-bound access code becomes active."
997
+ ),
998
+ ends_at: zod.z.string().datetime().nullable().optional().describe(
999
+ "Date and time after which the time-bound access code becomes inactive."
1000
+ ),
1001
+ status: zod.z.enum(["setting", "set", "unset", "removing", "unknown"]).describe(`
1002
+ Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting.
1003
+ `),
1004
+ is_backup_access_code_available: zod.z.boolean().describe(
1005
+ "Indicates whether a backup access code is available for use if the primary access code is lost or compromised."
1006
+ ),
1007
+ is_backup: zod.z.boolean().optional().describe("Indicates whether the access code is a backup code."),
1008
+ pulled_backup_access_code_id: zod.z.string().uuid().nullable().optional().describe(
1009
+ "Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code."
1010
+ ),
1011
+ is_external_modification_allowed: zod.z.boolean().describe(
1012
+ "Indicates whether changes to the access code from external sources are permitted."
1013
+ ),
1014
+ is_one_time_use: zod.z.boolean().describe(
1015
+ 'Indicates whether the access code can only be used once. If "true," the code becomes invalid after the first use.'
1016
+ ),
1017
+ is_offline_access_code: zod.z.boolean().describe(
1018
+ 'Indicates whether the access code is intended for use in offline scenarios. If "true," this code can be created on a device without a network connection.'
1019
+ )
756
1020
  });
757
- var access_code_constraint = zod.z.union([
758
- access_code_code_constraint,
759
- access_code_name_constraint
1021
+ var unmanaged_access_code = access_code.pick({
1022
+ type: true,
1023
+ access_code_id: true,
1024
+ device_id: true,
1025
+ name: true,
1026
+ code: true,
1027
+ created_at: true,
1028
+ errors: true,
1029
+ warnings: true,
1030
+ is_managed: true,
1031
+ starts_at: true,
1032
+ ends_at: true
1033
+ }).extend({
1034
+ is_managed: zod.z.literal(false),
1035
+ status: zod.z.enum(["set"])
1036
+ });
1037
+ var acs_access_group_external_type = zod.z.enum([
1038
+ "pti_unit",
1039
+ "pti_access_level",
1040
+ "salto_access_group",
1041
+ "brivo_group"
760
1042
  ]);
761
- var access_code_capability_properties = zod.z.object({
762
- _experimental_supported_code_from_access_codes_lengths: zod.z.array(zod.z.number()).optional(),
763
- code_constraints: zod.z.array(access_code_constraint).optional(),
764
- supported_code_lengths: zod.z.array(zod.z.number()).optional(),
765
- max_active_codes_supported: zod.z.number().optional(),
766
- supports_backup_access_code_pool: zod.z.boolean().optional(),
767
- has_native_entry_events: zod.z.boolean().optional()
1043
+ var acs_access_group = zod.z.object({
1044
+ acs_access_group_id: zod.z.string().uuid(),
1045
+ acs_system_id: zod.z.string().uuid(),
1046
+ workspace_id: zod.z.string().uuid(),
1047
+ name: zod.z.string(),
1048
+ access_group_type: acs_access_group_external_type.describe(`
1049
+ ---
1050
+ deprecated: use external_type
1051
+ ---
1052
+ `),
1053
+ access_group_type_display_name: zod.z.string().describe(`
1054
+ ---
1055
+ deprecated: use external_type_display_name
1056
+ ---
1057
+ `),
1058
+ display_name: zod.z.string(),
1059
+ external_type: acs_access_group_external_type,
1060
+ external_type_display_name: zod.z.string(),
1061
+ created_at: zod.z.string().datetime()
768
1062
  });
769
- var lock_capability_properties = zod.z.object({
770
- locked: zod.z.boolean().optional(),
771
- keypad_battery: zod.z.object({
772
- level: zod.z.number()
773
- }).optional(),
774
- door_open: zod.z.boolean().optional()
1063
+ var acs_entrance_latch_metadata = zod.z.object({
1064
+ accessibility_type: zod.z.string(),
1065
+ door_name: zod.z.string(),
1066
+ door_type: zod.z.string(),
1067
+ is_connected: zod.z.boolean()
775
1068
  });
776
- var hvac_mode_setting = zod.z.enum(["off", "heat", "cool", "heat_cool"]);
777
- var fan_mode_setting = zod.z.enum(["auto", "on"]);
778
-
779
- // src/lib/seam/connect/models/thermostats/climate-setting.ts
780
- var climate_setting = zod.z.object({
781
- automatic_heating_enabled: zod.z.boolean(),
782
- automatic_cooling_enabled: zod.z.boolean(),
783
- hvac_mode_setting,
784
- cooling_set_point_celsius: zod.z.number().optional(),
785
- heating_set_point_celsius: zod.z.number().optional(),
786
- cooling_set_point_fahrenheit: zod.z.number().optional(),
787
- heating_set_point_fahrenheit: zod.z.number().optional(),
788
- manual_override_allowed: zod.z.boolean()
1069
+ var acs_entrance_visionline_metadata = zod.z.object({
1070
+ door_name: zod.z.string(),
1071
+ door_category: zod.z.enum([
1072
+ "entrance",
1073
+ "guest",
1074
+ "elevator reader",
1075
+ "common",
1076
+ "common (PMS)"
1077
+ ]),
1078
+ profiles: zod.z.array(
1079
+ zod.z.object({
1080
+ visionline_door_profile_id: zod.z.string(),
1081
+ visionline_door_profile_type: zod.z.enum(["BLE", "commonDoor", "touch"])
1082
+ })
1083
+ ).optional()
789
1084
  });
790
- var climate_setting_schedule = zod.z.object({
791
- climate_setting_schedule_id: zod.z.string().uuid(),
792
- schedule_type: zod.z.literal("time_bound"),
793
- device_id: zod.z.string().uuid(),
794
- name: zod.z.string().optional(),
795
- schedule_starts_at: zod.z.string(),
796
- schedule_ends_at: zod.z.string(),
797
- created_at: zod.z.string().datetime(),
798
- errors: zod.z.any().describe(
799
- 'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.'
800
- )
801
- }).merge(climate_setting.partial());
802
-
803
- // src/lib/seam/connect/models/devices/capability-properties/thermostat.ts
804
- var base_thermostat_capability_properties = zod.z.object({
805
- temperature_fahrenheit: zod.z.number(),
806
- temperature_celsius: zod.z.number(),
807
- relative_humidity: zod.z.number().min(0).max(1),
808
- can_enable_automatic_heating: zod.z.boolean(),
809
- can_enable_automatic_cooling: zod.z.boolean(),
810
- available_hvac_mode_settings: zod.z.array(hvac_mode_setting),
811
- is_heating_available: zod.z.literal(false),
812
- is_cooling_available: zod.z.literal(false),
813
- is_heating: zod.z.boolean(),
814
- is_cooling: zod.z.boolean(),
815
- is_fan_running: zod.z.boolean(),
816
- fan_mode_setting,
817
- /**
818
- * this is true if the current thermostat settings differ that what is on seam, and `current_climate_setting.manual_override_allowed: true`
819
- */
820
- is_temporary_manual_override_active: zod.z.boolean(),
821
- /**
822
- * can be derived from `default_climate_setting`, or `active_climate_setting_schedule` if one is active
823
- */
824
- current_climate_setting: climate_setting,
825
- default_climate_setting: climate_setting.optional(),
826
- is_climate_setting_schedule_active: zod.z.boolean(),
827
- active_climate_setting_schedule: climate_setting_schedule.optional()
1085
+ var acs_credential_visionline_metadata = zod.z.object({
1086
+ card_function_type: zod.z.enum(["guest", "staff"]),
1087
+ joiner_acs_credential_ids: zod.z.array(zod.z.string().uuid()).optional(),
1088
+ guest_acs_entrance_ids: zod.z.array(zod.z.string().uuid()).optional(),
1089
+ common_acs_entrance_ids: zod.z.array(zod.z.string().uuid()).optional()
828
1090
  });
829
- var cooling_thermostat_capability_properties = base_thermostat_capability_properties.merge(
830
- zod.z.object({
831
- min_cooling_set_point_celsius: zod.z.number(),
832
- min_cooling_set_point_fahrenheit: zod.z.number(),
833
- max_cooling_set_point_celsius: zod.z.number(),
834
- max_cooling_set_point_fahrenheit: zod.z.number(),
835
- is_cooling_available: zod.z.literal(true)
836
- })
837
- );
838
- var heating_thermostat_capability_properties = base_thermostat_capability_properties.merge(
839
- zod.z.object({
840
- min_heating_set_point_celsius: zod.z.number(),
841
- min_heating_set_point_fahrenheit: zod.z.number(),
842
- max_heating_set_point_celsius: zod.z.number(),
843
- max_heating_set_point_fahrenheit: zod.z.number(),
844
- is_heating_available: zod.z.literal(true)
845
- })
846
- );
847
- var heating_cooling_thermostat_capability_properties = cooling_thermostat_capability_properties.merge(heating_thermostat_capability_properties).merge(
848
- zod.z.object({
849
- is_cooling_available: zod.z.literal(true),
850
- is_heating_available: zod.z.literal(true),
851
- min_heating_cooling_delta_celsius: zod.z.number(),
852
- min_heating_cooling_delta_fahrenheit: zod.z.number()
853
- })
854
- );
855
- var thermostat_capability_properties = zod.z.union([
856
- heating_cooling_thermostat_capability_properties.partial(),
857
- heating_thermostat_capability_properties.partial(),
858
- cooling_thermostat_capability_properties.partial()
859
- ]);
860
-
861
- // src/lib/seam/connect/models/devices/capability-properties/index.ts
862
- var capability_properties = zod.z.intersection(
863
- access_code_capability_properties.partial().merge(lock_capability_properties.partial()),
864
- thermostat_capability_properties
865
- );
866
1091
 
867
- // src/lib/seam/devicedb/models/index.ts
868
- var models_exports = {};
869
- __export(models_exports, {
870
- base_device_model_v1: () => base_device_model_v1,
871
- device_capability_flags: () => device_capability_flags,
872
- device_category: () => device_category,
873
- device_connection_type: () => device_connection_type,
874
- device_model_category_specific_properties: () => device_model_category_specific_properties,
875
- device_model_v1: () => device_model_v1,
876
- image_reference: () => image_reference,
877
- manufacturer: () => manufacturer,
878
- manufacturer_annotation: () => manufacturer_annotation,
879
- manufacturer_annotation_code: () => manufacturer_annotation_code,
880
- manufacturer_integration_support_level: () => manufacturer_integration_support_level,
881
- thermostat: () => thermostat
1092
+ // src/lib/seam/connect/models/acs/acs-credential.ts
1093
+ var acs_credential_external_type = zod.z.enum([
1094
+ "pti_card",
1095
+ "brivo_credential",
1096
+ "hid_credential",
1097
+ "visionline_card"
1098
+ ]);
1099
+ var acs_credential_access_method_type = zod.z.enum([
1100
+ "code",
1101
+ "card",
1102
+ "mobile_key"
1103
+ ]);
1104
+ var acs_credential = zod.z.object({
1105
+ acs_credential_id: zod.z.string().uuid(),
1106
+ acs_user_id: zod.z.string().uuid().optional(),
1107
+ acs_credential_pool_id: zod.z.string().uuid().optional(),
1108
+ acs_system_id: zod.z.string().uuid(),
1109
+ parent_acs_credential_id: zod.z.string().uuid().optional(),
1110
+ display_name: zod.z.string().min(1),
1111
+ code: zod.z.string().optional().nullable(),
1112
+ access_method: acs_credential_access_method_type,
1113
+ external_type: acs_credential_external_type.optional(),
1114
+ external_type_display_name: zod.z.string().optional(),
1115
+ created_at: zod.z.string().datetime(),
1116
+ workspace_id: zod.z.string().uuid(),
1117
+ starts_at: zod.z.string().optional(),
1118
+ ends_at: zod.z.string().optional(),
1119
+ errors: zod.z.array(
1120
+ zod.z.object({
1121
+ error_code: zod.z.string(),
1122
+ message: zod.z.string()
1123
+ })
1124
+ ),
1125
+ warnings: zod.z.array(
1126
+ zod.z.object({
1127
+ warning_code: zod.z.string(),
1128
+ message: zod.z.string()
1129
+ })
1130
+ ),
1131
+ is_multi_phone_sync_credential: zod.z.boolean().optional(),
1132
+ is_latest_desired_state_synced_with_provider: zod.z.boolean().optional(),
1133
+ latest_desired_state_synced_with_provider_at: zod.z.string().datetime().optional(),
1134
+ visionline_metadata: acs_credential_visionline_metadata.optional()
882
1135
  });
883
- var device_capability_flags = zod.z.object({
884
- can_remotely_unlock: zod.z.boolean(),
885
- can_remotely_lock: zod.z.boolean(),
886
- can_program_offline_access_codes: zod.z.boolean(),
887
- can_program_online_access_codes: zod.z.boolean()
888
- }).partial();
889
- var device_model_capability_flags_map = {
890
- can_remotely_lock: zod.z.literal(true),
891
- can_remotely_unlock: zod.z.literal(true),
892
- can_program_offline_access_codes: zod.z.literal(true),
893
- can_program_online_access_codes: zod.z.literal(true)
894
- };
895
- var device_model_capability_flags = zod.z.object(device_model_capability_flags_map).partial();
896
- var hardware = zod.z.object({
897
- has_physical_key: zod.z.boolean()
898
- }).partial();
899
- var image_reference = zod.z.object({
900
- url: zod.z.string().url(),
901
- width: zod.z.number(),
902
- height: zod.z.number()
1136
+ var acs_entrance = zod.z.object({
1137
+ acs_system_id: zod.z.string().uuid(),
1138
+ acs_entrance_id: zod.z.string().uuid(),
1139
+ created_at: zod.z.string().datetime(),
1140
+ display_name: zod.z.string(),
1141
+ errors: zod.z.array(
1142
+ zod.z.object({
1143
+ error_code: zod.z.string(),
1144
+ message: zod.z.string()
1145
+ })
1146
+ ),
1147
+ latch_metadata: acs_entrance_latch_metadata.optional(),
1148
+ visionline_metadata: acs_entrance_visionline_metadata.optional()
903
1149
  });
904
- var manufacturer_integration_support_level = zod.z.enum([
905
- "stable",
906
- "beta",
907
- "planned",
908
- "unsupported",
909
- "inquire"
1150
+ var acs_system_capability_flags = zod.z.object({
1151
+ can_automate_enrollment: zod.z.boolean().optional().describe(
1152
+ "Indicates whether it is possible to [launch enrollment automations](https://docs.seam.co/latest/capability-guides/mobile-access-in-development/issuing-mobile-credentials-from-an-access-control-system#prepare-the-phones-for-a-user-identity-to-start-receiving-mobile-credentials-using-an-enrollment-aut) for the `acs_system`."
1153
+ ),
1154
+ can_create_acs_access_groups: zod.z.boolean().optional().describe(
1155
+ "Indicates whether the `acs_system` supports creating [access groups](https://docs.seam.co/latest/capability-guides/access-systems/assigning-users-to-access-groups). See also [Access Group-based Access Control Systems](https://docs.seam.co/latest/capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems)."
1156
+ ),
1157
+ can_remove_acs_users_from_acs_access_groups: zod.z.boolean().optional().describe(
1158
+ "Indicates whether the `acs_system` supports [removing users from access groups](https://docs.seam.co/latest/capability-guides/access-systems/assigning-users-to-access-groups#remove-an-acs-user-from-an-access-group). See also [Access Group-based Access Control Systems](https://docs.seam.co/latest/capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems)."
1159
+ ),
1160
+ can_add_acs_users_to_acs_access_groups: zod.z.boolean().optional().describe(
1161
+ "Indicates whether the `acs_system` supports [adding users to access groups](https://docs.seam.co/latest/capability-guides/access-systems/assigning-users-to-access-groups#add-an-acs-user-to-an-access-group). See also [Access Group-based Access Control Systems](https://docs.seam.co/latest/capability-guides/access-systems/understanding-access-control-system-differences#access-group-based-access-control-systems)."
1162
+ )
1163
+ });
1164
+ var acs_system_external_type = zod.z.enum([
1165
+ "pti_site",
1166
+ "alta_org",
1167
+ "salto_site",
1168
+ "brivo_account",
1169
+ "hid_credential_manager_organization",
1170
+ "visionline_system",
1171
+ "assa_abloy_credential_service",
1172
+ "latch_building"
910
1173
  ]);
911
- var manufacturer_annotation_code = zod.z.enum(["subscription_required"]);
912
- var manufacturer_annotation = zod.z.object({
913
- annotation_code: manufacturer_annotation_code,
914
- message: zod.z.string().trim().nonempty()
1174
+ var common_acs_system_error = zod.z.object({
1175
+ created_at: zod.z.string().datetime().describe("Date and time at which Seam created the error."),
1176
+ message: zod.z.string().describe(
1177
+ "Detailed description of the error. Provides insights into the issue and potentially how to rectify it."
1178
+ )
915
1179
  });
916
- var manufacturer = zod.z.object({
917
- manufacturer_id: zod.z.string().uuid(),
918
- display_name: zod.z.string(),
919
- logo: image_reference.optional(),
920
- /** @deprecated */
921
- integration: manufacturer_integration_support_level,
922
- integration_support_level: manufacturer_integration_support_level,
923
- is_connect_webview_supported: zod.z.boolean(),
924
- requires_seam_support_to_add_account: zod.z.boolean(),
925
- device_model_count: zod.z.number(),
926
- annotations: zod.z.array(manufacturer_annotation),
927
- website: zod.z.string().url().optional(),
928
- legal_name: zod.z.string().optional(),
929
- parent_organization: zod.z.string().optional(),
930
- headquarters: zod.z.array(zod.z.string()).optional(),
931
- countries_of_origin: zod.z.array(zod.z.string()).optional(),
932
- founding_year: zod.z.string().optional(),
933
- us_customer_support_tel: zod.z.string().optional(),
934
- us_customer_support_email: zod.z.string().email().optional(),
935
- us_customer_support_contact_url: zod.z.string().url().optional(),
936
- seam_api_guide: zod.z.string().optional(),
937
- description: zod.z.string().optional()
1180
+ var error_code_description = "Unique identifier of the type of error. Enables quick recognition and categorization of the issue.";
1181
+ var seam_bridge_disconnected = common_acs_system_error.extend({
1182
+ error_code: zod.z.literal("seam_bridge_disconnected").describe(error_code_description)
1183
+ }).describe(`Indicates that the Seam API cannot communicate with the [Seam Bridge](https://docs.seam.co/latest/capability-guides/seam-bridge), for example, if the Seam Bridge executable has stopped or if the computer running the Seam Bridge executable is offline.
1184
+ This error might also occur if the Seam Bridge is connected to the wrong [workspace](https://docs.seam.co/latest/core-concepts/workspaces).
1185
+ See also [Troubleshooting Your Access Control System](https://docs.seam.co/latest/capability-guides/capability-guides/access-systems/troubleshooting-your-access-control-system#acs_system.errors.seam_bridge_disconnected).`);
1186
+ var visionline_instance_unreachable = common_acs_system_error.extend({
1187
+ error_code: zod.z.literal("visionline_instance_unreachable").describe(error_code_description)
1188
+ }).describe(`Indicates that the Seam Bridge is functioning correctly and the Seam API can communicate with the Seam Bridge, but the Seam API cannot connect to the on-premises [Visionline access control system](https://docs.seam.co/latest/device-and-system-integration-guides/assa-abloy-visionline-access-control-system).
1189
+ For example, the IP address of the on-premises access control system may be set incorrectly within the Seam [workspace](https://docs.seam.co/latest/core-concepts/workspaces).
1190
+ See also [Troubleshooting Your Access Control System](https://docs.seam.co/latest/capability-guides/capability-guides/access-systems/troubleshooting-your-access-control-system#acs_system.errors.visionline_instance_unreachable).`);
1191
+ var acs_system_error = zod.z.union([seam_bridge_disconnected, visionline_instance_unreachable]).describe("Error associated with the `acs_system`.");
1192
+ zod.z.object({
1193
+ seam_bridge_disconnected: seam_bridge_disconnected.optional().nullable(),
1194
+ visionline_instance_unreachable: visionline_instance_unreachable.optional().nullable()
938
1195
  });
939
-
940
- // src/lib/seam/devicedb/models/device-model.ts
941
- var device_category = zod.z.enum([
942
- "smartlock",
943
- "sensor",
944
- "thermostat",
945
- "relay",
946
- "intercom",
947
- "accessory"
948
- ]);
949
- var device_connection_type = zod.z.enum([
950
- "wifi",
951
- "zwave",
952
- "zigbee",
953
- "unknown"
954
- ]);
955
- var smartlock = zod.z.object({
956
- main_category: zod.z.literal(device_category.enum.smartlock),
957
- physical_properties: zod.z.object({
958
- lock_type: zod.z.enum([
959
- "deadbolt",
960
- "lever",
961
- "mortise",
962
- "lockbox",
963
- "cylinder",
964
- "padlock",
965
- "locker",
966
- "unknown"
967
- ]),
968
- has_physical_key: zod.z.boolean(),
969
- has_camera: zod.z.boolean()
970
- }),
971
- software_features: zod.z.object({
972
- can_remotely_unlock: zod.z.boolean(),
973
- can_program_access_codes: zod.z.boolean(),
974
- can_program_access_schedules: zod.z.boolean(),
975
- can_program_access_codes_offline: zod.z.boolean()
976
- })
977
- }).merge(
978
- device_model_capability_flags.pick({
979
- can_remotely_lock: true,
980
- can_remotely_unlock: true,
981
- can_program_offline_access_codes: true,
982
- can_program_online_access_codes: true
983
- })
1196
+ var acs_system_warning = zod.z.object({}).describe(
1197
+ `
1198
+ ---
1199
+ undocumented: Currently, no warnings defined for \`acs_system\`s.
1200
+ ---
1201
+ `
984
1202
  );
985
- var sensor = zod.z.object({
986
- main_category: zod.z.literal(device_category.enum.sensor),
987
- physical_properties: zod.z.object({
988
- has_noise_sensor: zod.z.boolean(),
989
- has_humidity_sensor: zod.z.boolean(),
990
- has_temperature_sensor: zod.z.boolean(),
991
- has_occupancy_detection: zod.z.boolean()
992
- })
1203
+ zod.z.object({});
1204
+ var acs_system = zod.z.object({
1205
+ acs_system_id: zod.z.string().uuid().describe("ID of the `acs_system`."),
1206
+ external_type: acs_system_external_type.describe("Brand-specific terminology for the `acs_system` type.").optional(),
1207
+ external_type_display_name: zod.z.string().describe(
1208
+ "Display name that corresponds to the brand-specific terminology for the `acs_system` type."
1209
+ ).optional(),
1210
+ system_type: acs_system_external_type.describe(
1211
+ `
1212
+ ---
1213
+ deprecated: Use \`external_type\`.
1214
+ ---
1215
+ `
1216
+ ).optional(),
1217
+ system_type_display_name: zod.z.string().optional().describe(`
1218
+ ---
1219
+ deprecated: Use \`external_type_display_name\`.
1220
+ ---
1221
+ `),
1222
+ name: zod.z.string().describe("Name of the `acs_system`."),
1223
+ created_at: zod.z.string().datetime().describe("Date and time at which the `acs_system` was created."),
1224
+ workspace_id: zod.z.string().uuid().describe(
1225
+ "ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces) that contains the `acs_system`."
1226
+ ),
1227
+ connected_account_ids: zod.z.array(zod.z.string().uuid()).describe(
1228
+ "IDs of the [connected accounts](https://docs.seam.co/latest/core-concepts/connected-accounts) associated with the `acs_system`."
1229
+ ),
1230
+ image_url: zod.z.string().describe("URL for the image that represents the `acs_system`."),
1231
+ image_alt_text: zod.z.string().describe("Alternative text for the `acs_system` image."),
1232
+ errors: zod.z.array(acs_system_error).describe("Errors associated with the `acs_system`."),
1233
+ warnings: zod.z.array(acs_system_warning).describe(
1234
+ `
1235
+ ---
1236
+ undocumented: Currently, no warnings defined for \`acs_system\`s.
1237
+ ---
1238
+ `
1239
+ )
1240
+ }).merge(acs_system_capability_flags).describe(
1241
+ "Represents an [access control system](https://docs.seam.co/latest/capability-guides/access-systems)."
1242
+ );
1243
+ var phone_number = zod.z.coerce.string().trim().refine(
1244
+ (val) => {
1245
+ return /^\+[1-9]\d{1,14}$/.test(val);
1246
+ },
1247
+ {
1248
+ message: "Phone number must be in E.164 format: +14155552671"
1249
+ }
1250
+ );
1251
+ var start_end_schedule = zod.z.object({
1252
+ starts_at: zod.z.string().datetime(),
1253
+ ends_at: zod.z.string().datetime()
993
1254
  });
994
- var thermostat = zod.z.object({
995
- main_category: zod.z.literal(device_category.enum.thermostat),
996
- physical_properties: zod.z.object({
997
- available_modes: zod.z.enum(["heat", "cool", "fan", "eco"]).array(),
998
- is_heat_pump_compatible: zod.z.boolean(),
999
- has_occupancy_detection: zod.z.boolean(),
1000
- supports_demand_response: zod.z.boolean(),
1001
- has_humidity_sensor: zod.z.boolean(),
1002
- has_temperature_sensor: zod.z.boolean(),
1003
- supports_emergency_heating_mode: zod.z.boolean()
1004
- }),
1005
- software_features: zod.z.object({
1006
- can_program_climate_schedules: zod.z.boolean()
1007
- })
1255
+ var schedule = start_end_schedule;
1256
+
1257
+ // src/lib/seam/connect/models/acs/acs-user.ts
1258
+ var acs_user_external_type = zod.z.enum([
1259
+ "pti_user",
1260
+ "brivo_user",
1261
+ "hid_credential_manager_user",
1262
+ "salto_site_user",
1263
+ "latch_user"
1264
+ ]);
1265
+ var user_fields = zod.z.object({
1266
+ full_name: zod.z.string().optional(),
1267
+ email: zod.z.string().email().optional().describe(`
1268
+ ---
1269
+ deprecated: use email_address.
1270
+ ---
1271
+ `),
1272
+ email_address: zod.z.string().email().optional(),
1273
+ phone_number: phone_number.optional()
1008
1274
  });
1009
- var relay = zod.z.object({
1010
- main_category: zod.z.literal(device_category.enum.relay)
1275
+ var acs_user = zod.z.object({
1276
+ acs_user_id: zod.z.string().uuid(),
1277
+ acs_system_id: zod.z.string().uuid(),
1278
+ hid_acs_system_id: zod.z.string().uuid().optional(),
1279
+ workspace_id: zod.z.string().uuid(),
1280
+ created_at: zod.z.string().datetime(),
1281
+ display_name: zod.z.string(),
1282
+ external_type: acs_user_external_type.optional(),
1283
+ external_type_display_name: zod.z.string().optional(),
1284
+ is_suspended: zod.z.boolean(),
1285
+ access_schedule: schedule.optional(),
1286
+ user_identity_id: zod.z.string().optional(),
1287
+ user_identity_full_name: zod.z.string().nullable().optional(),
1288
+ user_identity_email_address: zod.z.string().nullable().optional(),
1289
+ user_identity_phone_number: zod.z.string().nullable().optional()
1290
+ }).merge(user_fields);
1291
+ var common_action_attempt = zod.z.object({
1292
+ action_attempt_id: zod.z.string().uuid().describe(`
1293
+ ---
1294
+ title: Action Attempt ID
1295
+ ---
1296
+ The ID of the action attempt.
1297
+ `),
1298
+ status: zod.z.enum(["pending", "success", "error"])
1011
1299
  });
1012
- var intercom = zod.z.object({
1013
- main_category: zod.z.literal(device_category.enum.intercom),
1014
- physical_properties: zod.z.object({
1015
- has_camera: zod.z.boolean(),
1016
- has_rfid_reader: zod.z.boolean().default(false),
1017
- has_nfc_reader: zod.z.boolean().default(false),
1018
- has_wiegand_interface: zod.z.boolean().default(false)
1019
- }),
1020
- software_features: zod.z.object({
1021
- can_remotely_unlock: zod.z.boolean(),
1022
- can_program_access_codes: zod.z.boolean(),
1023
- can_unlock_with_face_recognition: zod.z.boolean().default(false),
1024
- supports_onvif: zod.z.boolean().default(false)
1025
- })
1300
+ var common_pending_action_attempt = common_action_attempt.extend({
1301
+ status: zod.z.literal("pending"),
1302
+ result: zod.z.null(),
1303
+ error: zod.z.null()
1026
1304
  });
1027
- var accessory = zod.z.object({
1028
- main_category: zod.z.literal(device_category.enum.accessory)
1305
+ var common_succeeded_action_attempt = common_action_attempt.extend({
1306
+ status: zod.z.literal("success"),
1307
+ error: zod.z.null()
1029
1308
  });
1030
- var device_model_category_specific_properties = zod.z.discriminatedUnion(
1031
- "main_category",
1032
- [smartlock, sensor, thermostat, relay, intercom, accessory]
1033
- );
1034
- var base_device_model_v1 = zod.z.object({
1035
- device_model_id: zod.z.string().uuid(),
1036
- manufacturer: manufacturer.omit({
1037
- device_model_count: true
1038
- }),
1039
- is_device_supported: zod.z.boolean(),
1040
- display_name: zod.z.string(),
1041
- description: zod.z.string(),
1042
- product_url: zod.z.string().optional(),
1043
- main_connection_type: device_connection_type,
1044
- hardware,
1045
- aesthetic_variants: zod.z.object({
1046
- slug: zod.z.string(),
1047
- display_name: zod.z.string(),
1048
- primary_color_hex: zod.z.string().optional(),
1049
- manufacturer_sku: zod.z.string().optional(),
1050
- front_image: image_reference.optional(),
1051
- back_image: image_reference.optional(),
1052
- images: image_reference.array()
1053
- }).array(),
1054
- power_sources: zod.z.enum([
1055
- "battery",
1056
- "hardwired",
1057
- "mechanical_harvesting",
1058
- "wireless",
1059
- "ethernet"
1060
- ]).array()
1309
+ var common_failed_action_attempt = common_action_attempt.extend({
1310
+ status: zod.z.literal("error"),
1311
+ result: zod.z.null()
1061
1312
  });
1062
- var device_model_v1 = base_device_model_v1.and(
1063
- device_model_category_specific_properties
1064
- );
1065
- var dormakaba_oracode_time_slot = zod.z.object({
1066
- name: zod.z.string(),
1067
- prefix: zod.z.number(),
1068
- // Seam TOD
1069
- check_in_time: zod.z.string(),
1070
- // Seam TOD
1071
- check_out_time: zod.z.string(),
1072
- is_24_hour: zod.z.boolean(),
1073
- is_biweekly_mode: zod.z.boolean(),
1074
- is_one_shot: zod.z.boolean(),
1075
- is_master: zod.z.boolean(),
1076
- ext_dormakaba_oracode_user_level_prefix: zod.z.number(),
1077
- dormakaba_oracode_user_level_id: zod.z.string().uuid()
1313
+
1314
+ // src/lib/seam/connect/models/action-attempts/deprecated.ts
1315
+ var error = zod.z.object({
1316
+ type: zod.z.string(),
1317
+ message: zod.z.string()
1078
1318
  });
1079
- var device_metadata = zod.z.object({
1080
- august_metadata: zod.z.object({
1081
- lock_id: zod.z.string(),
1082
- lock_name: zod.z.string(),
1083
- house_name: zod.z.string(),
1084
- has_keypad: zod.z.boolean(),
1085
- keypad_battery_level: zod.z.string().optional(),
1086
- model: zod.z.string().optional(),
1087
- house_id: zod.z.string().optional()
1088
- }),
1089
- avigilon_alta_metadata: zod.z.object({
1090
- entry_name: zod.z.string(),
1091
- org_name: zod.z.string(),
1092
- zone_id: zod.z.number(),
1093
- zone_name: zod.z.string(),
1094
- site_id: zod.z.number(),
1095
- site_name: zod.z.string(),
1096
- entry_relays_total_count: zod.z.number()
1097
- }),
1098
- schlage_metadata: zod.z.object({
1099
- device_id: zod.z.string(),
1100
- device_name: zod.z.string(),
1101
- access_code_length: zod.z.number().nullable(),
1102
- model: zod.z.string().optional()
1103
- }),
1104
- smartthings_metadata: zod.z.object({
1105
- device_id: zod.z.string(),
1106
- device_name: zod.z.string(),
1107
- model: zod.z.string().optional(),
1108
- location_id: zod.z.string().optional()
1109
- }),
1110
- lockly_metadata: zod.z.object({
1111
- device_id: zod.z.string(),
1112
- device_name: zod.z.string(),
1113
- model: zod.z.string().optional()
1114
- }),
1115
- nuki_metadata: zod.z.object({
1116
- device_id: zod.z.string(),
1117
- device_name: zod.z.string(),
1118
- keypad_battery_critical: zod.z.boolean().optional(),
1119
- keypad_paired: zod.z.boolean().optional(),
1120
- keypad_2_paired: zod.z.boolean().optional()
1121
- }),
1122
- kwikset_metadata: zod.z.object({
1123
- device_id: zod.z.string(),
1124
- device_name: zod.z.string(),
1125
- model_number: zod.z.string()
1126
- }),
1127
- salto_metadata: zod.z.object({
1128
- lock_id: zod.z.string(),
1129
- customer_reference: zod.z.string(),
1130
- lock_type: zod.z.string(),
1131
- battery_level: zod.z.string(),
1132
- locked_state: zod.z.string(),
1133
- model: zod.z.string().optional()
1134
- }),
1135
- genie_metadata: zod.z.object({
1136
- device_name: zod.z.string(),
1137
- door_name: zod.z.string()
1138
- }),
1139
- brivo_metadata: zod.z.object({
1140
- device_name: zod.z.string()
1141
- }),
1142
- igloo_metadata: zod.z.object({
1143
- device_id: zod.z.string(),
1144
- bridge_id: zod.z.string(),
1145
- model: zod.z.string().optional()
1146
- }),
1147
- noiseaware_metadata: zod.z.object({
1148
- device_model: zod.z.enum(["indoor", "outdoor"]),
1149
- noise_level_nrs: zod.z.number(),
1150
- noise_level_decibel: zod.z.number(),
1151
- device_name: zod.z.string(),
1152
- device_id: zod.z.string()
1319
+ var result = zod.z.any();
1320
+ var sync_access_codes_action_attempt = zod.z.discriminatedUnion("status", [
1321
+ common_pending_action_attempt.extend({
1322
+ action_type: zod.z.literal("SYNC_ACCESS_CODES")
1153
1323
  }),
1154
- minut_metadata: zod.z.object({
1155
- device_id: zod.z.string(),
1156
- device_name: zod.z.string(),
1157
- latest_sensor_values: zod.z.object({
1158
- temperature: zod.z.object({
1159
- time: zod.z.string(),
1160
- value: zod.z.number()
1161
- }),
1162
- sound: zod.z.object({
1163
- time: zod.z.string(),
1164
- value: zod.z.number()
1165
- }),
1166
- humidity: zod.z.object({
1167
- time: zod.z.string(),
1168
- value: zod.z.number()
1169
- }),
1170
- pressure: zod.z.object({
1171
- time: zod.z.string(),
1172
- value: zod.z.number()
1173
- }),
1174
- accelerometer_z: zod.z.object({
1175
- time: zod.z.string(),
1176
- value: zod.z.number()
1177
- })
1178
- })
1324
+ common_succeeded_action_attempt.extend({
1325
+ action_type: zod.z.literal("SYNC_ACCESS_CODES"),
1326
+ result
1179
1327
  }),
1180
- four_suites_metadata: zod.z.object({
1181
- device_id: zod.z.number(),
1182
- device_name: zod.z.string(),
1183
- reclose_delay_in_seconds: zod.z.number()
1328
+ common_failed_action_attempt.extend({
1329
+ action_type: zod.z.literal("SYNC_ACCESS_CODES"),
1330
+ error
1331
+ })
1332
+ ]);
1333
+ var create_access_code_action_attempt = zod.z.discriminatedUnion("status", [
1334
+ common_pending_action_attempt.extend({
1335
+ action_type: zod.z.literal("CREATE_ACCESS_CODE")
1184
1336
  }),
1185
- two_n_metadata: zod.z.object({
1186
- device_id: zod.z.number(),
1187
- device_name: zod.z.string()
1337
+ common_succeeded_action_attempt.extend({
1338
+ action_type: zod.z.literal("CREATE_ACCESS_CODE"),
1339
+ result
1188
1340
  }),
1189
- controlbyweb_metadata: zod.z.object({
1190
- device_id: zod.z.string(),
1191
- device_name: zod.z.string(),
1192
- relay_name: zod.z.string().nullable()
1341
+ common_failed_action_attempt.extend({
1342
+ action_type: zod.z.literal("CREATE_ACCESS_CODE"),
1343
+ error
1344
+ })
1345
+ ]);
1346
+ var delete_access_code_action_attempt = zod.z.discriminatedUnion("status", [
1347
+ common_pending_action_attempt.extend({
1348
+ action_type: zod.z.literal("DELETE_ACCESS_CODE")
1193
1349
  }),
1194
- ttlock_metadata: zod.z.object({
1195
- lock_id: zod.z.number(),
1196
- lock_alias: zod.z.string(),
1197
- feature_value: zod.z.string()
1350
+ common_succeeded_action_attempt.extend({
1351
+ action_type: zod.z.literal("DELETE_ACCESS_CODE"),
1352
+ result
1198
1353
  }),
1199
- seam_bridge_metadata: zod.z.object({
1200
- unlock_method: zod.z.enum(["bridge", "doorking"]).optional(),
1201
- device_num: zod.z.number(),
1202
- name: zod.z.string()
1354
+ common_failed_action_attempt.extend({
1355
+ action_type: zod.z.literal("DELETE_ACCESS_CODE"),
1356
+ error
1357
+ })
1358
+ ]);
1359
+ var update_access_code_action_attempt = zod.z.discriminatedUnion("status", [
1360
+ common_pending_action_attempt.extend({
1361
+ action_type: zod.z.literal("UPDATE_ACCESS_CODE")
1203
1362
  }),
1204
- igloohome_metadata: zod.z.object({
1205
- device_id: zod.z.string(),
1206
- device_name: zod.z.string(),
1207
- bridge_id: zod.z.string().optional(),
1208
- bridge_name: zod.z.string().optional(),
1209
- keypad_id: zod.z.string().optional()
1363
+ common_succeeded_action_attempt.extend({
1364
+ action_type: zod.z.literal("UPDATE_ACCESS_CODE"),
1365
+ result
1210
1366
  }),
1211
- nest_metadata: zod.z.object({
1212
- nest_device_id: zod.z.string(),
1213
- device_name: zod.z.string(),
1214
- // set by Google
1215
- custom_name: zod.z.string()
1216
- // set by device owner
1367
+ common_failed_action_attempt.extend({
1368
+ action_type: zod.z.literal("UPDATE_ACCESS_CODE"),
1369
+ error
1370
+ })
1371
+ ]);
1372
+ var create_noise_threshold_action_attempt = zod.z.discriminatedUnion("status", [
1373
+ common_pending_action_attempt.extend({
1374
+ action_type: zod.z.literal("CREATE_NOISE_THRESHOLD")
1217
1375
  }),
1218
- ecobee_metadata: zod.z.object({
1219
- ecobee_device_id: zod.z.string(),
1220
- device_name: zod.z.string()
1376
+ common_succeeded_action_attempt.extend({
1377
+ action_type: zod.z.literal("CREATE_NOISE_THRESHOLD"),
1378
+ result
1221
1379
  }),
1222
- honeywell_resideo_metadata: zod.z.object({
1223
- honeywell_resideo_device_id: zod.z.string(),
1224
- device_name: zod.z.string()
1380
+ common_failed_action_attempt.extend({
1381
+ action_type: zod.z.literal("CREATE_NOISE_THRESHOLD"),
1382
+ error
1383
+ })
1384
+ ]);
1385
+ var delete_noise_threshold_action_attempt = zod.z.discriminatedUnion("status", [
1386
+ common_pending_action_attempt.extend({
1387
+ action_type: zod.z.literal("DELETE_NOISE_THRESHOLD")
1225
1388
  }),
1226
- hubitat_metadata: zod.z.object({
1227
- device_id: zod.z.string(),
1228
- device_name: zod.z.string(),
1229
- device_label: zod.z.string()
1389
+ common_succeeded_action_attempt.extend({
1390
+ action_type: zod.z.literal("DELETE_NOISE_THRESHOLD"),
1391
+ result
1230
1392
  }),
1231
- dormakaba_oracode_metadata: zod.z.object({
1232
- door_id: zod.z.number(),
1233
- door_name: zod.z.string(),
1234
- device_id: zod.z.number().optional(),
1235
- door_is_wireless: zod.z.boolean(),
1236
- site_id: zod.z.number(),
1237
- site_name: zod.z.string(),
1238
- iana_timezone: zod.z.string().optional(),
1239
- predefined_time_slots: zod.z.array(dormakaba_oracode_time_slot).optional()
1393
+ common_failed_action_attempt.extend({
1394
+ action_type: zod.z.literal("DELETE_NOISE_THRESHOLD"),
1395
+ error
1396
+ })
1397
+ ]);
1398
+ var update_noise_threshold_action_attempt = zod.z.discriminatedUnion("status", [
1399
+ common_pending_action_attempt.extend({
1400
+ action_type: zod.z.literal("UPDATE_NOISE_THRESHOLD")
1240
1401
  }),
1241
- wyze_metadata: zod.z.object({
1242
- device_id: zod.z.string(),
1243
- device_name: zod.z.string(),
1244
- product_name: zod.z.string(),
1245
- product_type: zod.z.string(),
1246
- product_model: zod.z.string(),
1247
- device_info_model: zod.z.string(),
1248
- keypad_uuid: zod.z.string().optional(),
1249
- locker_status_hardlock: zod.z.number().optional()
1402
+ common_succeeded_action_attempt.extend({
1403
+ action_type: zod.z.literal("UPDATE_NOISE_THRESHOLD"),
1404
+ result
1250
1405
  }),
1251
- tedee_metadata: zod.z.object({
1252
- device_id: zod.z.number(),
1253
- serial_number: zod.z.string(),
1254
- device_name: zod.z.string(),
1255
- device_model: zod.z.string(),
1256
- bridge_id: zod.z.number(),
1257
- bridge_name: zod.z.string(),
1258
- keypad_id: zod.z.number().optional()
1406
+ common_failed_action_attempt.extend({
1407
+ action_type: zod.z.literal("UPDATE_NOISE_THRESHOLD"),
1408
+ error
1259
1409
  })
1260
- }).partial();
1261
- var LOCK_DEVICE_TYPE = {
1262
- AKUVOX_LOCK: "akuvox_lock",
1263
- AUGUST_LOCK: "august_lock",
1264
- BRIVO_ACCESS_POINT: "brivo_access_point",
1265
- BUTTERFLYMX_PANEL: "butterflymx_panel",
1266
- AVIGILON_ALTA_ENTRY: "avigilon_alta_entry",
1267
- DOORKING_LOCK: "doorking_lock",
1268
- GENIE_DOOR: "genie_door",
1269
- IGLOO_LOCK: "igloo_lock",
1270
- LINEAR_LOCK: "linear_lock",
1271
- LOCKLY_LOCK: "lockly_lock",
1272
- KWIKSET_LOCK: "kwikset_lock",
1273
- NUKI_LOCK: "nuki_lock",
1274
- SALTO_LOCK: "salto_lock",
1275
- SCHLAGE_LOCK: "schlage_lock",
1276
- SEAM_RELAY: "seam_relay",
1277
- SMARTTHINGS_LOCK: "smartthings_lock",
1278
- WYZE_LOCK: "wyze_lock",
1279
- YALE_LOCK: "yale_lock",
1280
- TWO_N_INTERCOM: "two_n_intercom",
1281
- CONTROLBYWEB_DEVICE: "controlbyweb_device",
1282
- TTLOCK_LOCK: "ttlock_lock",
1283
- IGLOOHOME_LOCK: "igloohome_lock",
1284
- HUBITAT_LOCK: "hubitat_lock",
1285
- FOUR_SUITES_DOOR: "four_suites_door",
1286
- DORMAKABA_ORACODE_DOOR: "dormakaba_oracode_door",
1287
- TEDEE_LOCK: "tedee_lock"
1288
- };
1289
- var lock_device_type = zod.z.enum(
1290
- Object.values(LOCK_DEVICE_TYPE)
1291
- );
1292
- var NOISE_SENSOR_DEVICE_TYPE = {
1293
- NOISEAWARE_ACTIVITY_ZONE: "noiseaware_activity_zone",
1294
- MINUT_SENSOR: "minut_sensor"
1295
- };
1296
- var noise_sensor_device_type = zod.z.enum(
1297
- Object.values(NOISE_SENSOR_DEVICE_TYPE)
1298
- );
1299
- var THERMOSTAT_DEVICE_TYPE = {
1300
- ECOBEE_THERMOSTAT: "ecobee_thermostat",
1301
- NEST_THERMOSTAT: "nest_thermostat",
1302
- HONEYWELL_RESIDEO_THERMOSTAT: "honeywell_resideo_thermostat"
1303
- };
1304
- var thermostat_device_type = zod.z.enum(
1305
- Object.values(THERMOSTAT_DEVICE_TYPE)
1306
- );
1307
- var PHONE_DEVICE_TYPE = {
1308
- IOS_PHONE: "ios_phone",
1309
- ANDROID_PHONE: "android_phone"
1310
- };
1311
- var PHONE_DEVICE_TYPE_LIST = Object.values(
1312
- PHONE_DEVICE_TYPE
1313
- );
1314
- var phone_device_type = zod.z.enum(
1315
- Object.values(PHONE_DEVICE_TYPE_LIST)
1410
+ ]);
1411
+ var deprecated_action_attempts = [
1412
+ ...sync_access_codes_action_attempt.options,
1413
+ ...create_access_code_action_attempt.options,
1414
+ ...delete_access_code_action_attempt.options,
1415
+ ...update_access_code_action_attempt.options,
1416
+ ...create_noise_threshold_action_attempt.options,
1417
+ ...delete_noise_threshold_action_attempt.options,
1418
+ ...update_noise_threshold_action_attempt.options
1419
+ ];
1420
+ var action_type = zod.z.literal("LOCK_DOOR");
1421
+ var error2 = zod.z.object({
1422
+ type: zod.z.string(),
1423
+ message: zod.z.string()
1424
+ });
1425
+ var result2 = zod.z.object({});
1426
+ var lock_door_action_attempt = zod.z.discriminatedUnion("status", [
1427
+ common_pending_action_attempt.extend({
1428
+ action_type
1429
+ }).describe("Locking door."),
1430
+ common_succeeded_action_attempt.extend({
1431
+ action_type,
1432
+ result: result2
1433
+ }).describe("Locking door succeeded."),
1434
+ common_failed_action_attempt.extend({ action_type, error: error2 }).describe("Locking door failed.")
1435
+ ]);
1436
+ var action_type2 = zod.z.literal("RESET_SANDBOX_WORKSPACE");
1437
+ var error3 = zod.z.object({
1438
+ type: zod.z.string(),
1439
+ message: zod.z.string()
1440
+ });
1441
+ var result3 = zod.z.object({});
1442
+ var reset_sandbox_workspace_action_attempt = zod.z.discriminatedUnion(
1443
+ "status",
1444
+ [
1445
+ common_pending_action_attempt.extend({
1446
+ action_type: action_type2
1447
+ }).describe("Resetting sandbox workspace."),
1448
+ common_succeeded_action_attempt.extend({
1449
+ action_type: action_type2,
1450
+ result: result3
1451
+ }).describe("Resetting sandbox workspace succeeded."),
1452
+ common_failed_action_attempt.extend({
1453
+ action_type: action_type2,
1454
+ error: error3
1455
+ }).describe("Resetting sandbox workspace failed.")
1456
+ ]
1316
1457
  );
1317
- var any_device_type = zod.z.union([
1318
- lock_device_type,
1319
- noise_sensor_device_type,
1320
- thermostat_device_type,
1321
- phone_device_type
1458
+ var action_type3 = zod.z.literal("SET_COOL");
1459
+ var error4 = zod.z.object({
1460
+ type: zod.z.string(),
1461
+ message: zod.z.string()
1462
+ });
1463
+ var result4 = zod.z.object({});
1464
+ var set_cool_action_attempt = zod.z.discriminatedUnion("status", [
1465
+ common_pending_action_attempt.extend({
1466
+ action_type: action_type3
1467
+ }).describe("Setting HVAC to cool."),
1468
+ common_succeeded_action_attempt.extend({
1469
+ action_type: action_type3,
1470
+ result: result4
1471
+ }).describe("Setting HVAC to cool succeeded."),
1472
+ common_failed_action_attempt.extend({ action_type: action_type3, error: error4 }).describe("Setting HVAC to cool failed.")
1322
1473
  ]);
1323
- var phone_specific_properties = zod.z.object({
1324
- assa_abloy_credential_service_metadata: zod.z.object({
1325
- has_active_endpoint: zod.z.boolean(),
1326
- endpoints: zod.z.array(
1327
- zod.z.object({
1328
- endpoint_id: zod.z.string(),
1329
- is_active: zod.z.boolean()
1330
- })
1331
- )
1332
- }).optional()
1474
+ var action_type4 = zod.z.literal("SET_FAN_MODE");
1475
+ var error5 = zod.z.object({
1476
+ type: zod.z.string(),
1477
+ message: zod.z.string()
1333
1478
  });
1334
-
1335
- // src/lib/seam/connect/models/devices/device.ts
1336
- var device_capability_flags2 = models_exports.device_capability_flags.extend({
1337
- can_simulate_removal: zod.z.boolean().optional(),
1338
- can_simulate_connection: zod.z.boolean().optional(),
1339
- can_simulate_disconnection: zod.z.boolean().optional()
1479
+ var result5 = zod.z.object({});
1480
+ var set_fan_mode_action_attempt = zod.z.discriminatedUnion("status", [
1481
+ common_pending_action_attempt.extend({
1482
+ action_type: action_type4
1483
+ }).describe("Setting fan mode."),
1484
+ common_succeeded_action_attempt.extend({
1485
+ action_type: action_type4,
1486
+ result: result5
1487
+ }).describe("Setting fan mode succeeded."),
1488
+ common_failed_action_attempt.extend({ action_type: action_type4, error: error5 }).describe("Setting fan mode failed.")
1489
+ ]);
1490
+ var action_type5 = zod.z.literal("SET_HEAT");
1491
+ var error6 = zod.z.object({
1492
+ type: zod.z.string(),
1493
+ message: zod.z.string()
1494
+ });
1495
+ var result6 = zod.z.object({});
1496
+ var set_heat_action_attempt = zod.z.discriminatedUnion("status", [
1497
+ common_pending_action_attempt.extend({
1498
+ action_type: action_type5
1499
+ }).describe("Setting HVAC to heat mode."),
1500
+ common_succeeded_action_attempt.extend({
1501
+ action_type: action_type5,
1502
+ result: result6
1503
+ }).describe("Setting HVAC to heat mode succeeded."),
1504
+ common_failed_action_attempt.extend({ action_type: action_type5, error: error6 }).describe("Setting HVAC to heat mode failed.")
1505
+ ]);
1506
+ var action_type6 = zod.z.literal("SET_HEAT_COOL");
1507
+ var error7 = zod.z.object({
1508
+ type: zod.z.string(),
1509
+ message: zod.z.string()
1340
1510
  });
1341
- var battery_status = zod.z.enum(["critical", "low", "good", "full"]);
1342
- var common_device_properties = zod.z.object({
1343
- online: zod.z.boolean().describe("Indicates whether the device is online."),
1344
- name: zod.z.string().describe(`
1345
- ---
1346
- deprecated: use device.display_name instead
1347
- ---
1348
- Name of the device.
1349
- `),
1350
- accessory_keypad: zod.z.object({
1351
- is_connected: zod.z.boolean().describe(
1352
- "Indicates if the accessory_keypad is connected to the device."
1353
- ),
1354
- battery: zod.z.object({
1355
- level: zod.z.number().min(0).max(1)
1356
- }).optional().describe("Indicates if the keypad battery properties.")
1357
- }).optional().describe("Represents the accessory keypad state."),
1358
- appearance: zod.z.object({
1359
- name: zod.z.string().describe(
1360
- "Name of the device as seen from the provider API and application, not settable through Seam."
1361
- )
1362
- }),
1363
- model: zod.z.object({
1364
- can_connect_accessory_keypad: zod.z.boolean().optional().describe("Indicates whether the device can connect a accessory keypad."),
1365
- display_name: zod.z.string().describe("Display name of the device model."),
1366
- manufacturer_display_name: zod.z.string().describe(
1367
- "Display name that corresponds to the manufacturer-specific terminology for the device."
1368
- ),
1369
- has_built_in_keypad: zod.z.boolean().optional().describe(
1370
- "Indicates whether the device has a built in accessory keypad."
1371
- ),
1372
- offline_access_codes_supported: zod.z.boolean().optional().describe("Indicates whether the device supports offline access codes."),
1373
- online_access_codes_supported: zod.z.boolean().optional().describe("Indicates whether the device supports online access codes."),
1374
- accessory_keypad_supported: zod.z.boolean().optional().describe(
1375
- `
1376
- ---
1377
- deprecated: use device.properties.model.can_connect_accessory_keypad
1378
- ---
1379
- `
1380
- )
1381
- }),
1382
- has_direct_power: zod.z.boolean().optional().describe("Indicates whether the device has direct power."),
1383
- battery_level: zod.z.number().min(0).max(1).optional().describe(
1384
- "Indicates the battery level of the device as a decimal value between 0 and 1, inclusive."
1385
- ),
1386
- battery: zod.z.object({
1387
- level: zod.z.number().min(0).max(1),
1388
- status: battery_status
1389
- }).optional().describe(
1390
- 'Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage.'
1391
- ),
1392
- // todo: use enum
1393
- manufacturer: zod.z.string().optional().describe("Manufacturer of the device."),
1394
- image_url: zod.z.string().url().optional().describe("Image URL for the device."),
1395
- image_alt_text: zod.z.string().optional().describe("Alt text for the device image."),
1396
- serial_number: zod.z.string().optional().describe("Serial number of the device."),
1397
- online_access_codes_enabled: zod.z.boolean().describe(
1398
- "Indicates whether it is currently possible to use online access codes for the device."
1399
- ).optional(),
1400
- offline_access_codes_enabled: zod.z.boolean().describe(
1401
- "Indicates whether it is currently possible to use offline access codes for the device."
1402
- ).optional(),
1403
- // Deprecated legacy capability support props
1404
- supports_accessory_keypad: zod.z.boolean().describe(
1405
- `
1406
- ---
1407
- deprecated: use device.properties.model.can_connect_accessory_keypad
1408
- ---
1409
- `
1410
- ).optional(),
1411
- supports_offline_access_codes: zod.z.boolean().describe(
1412
- `
1413
- ---
1414
- deprecated: use offline_access_codes_enabled
1415
- ---
1416
- `
1417
- ).optional(),
1418
- noise_level_decibels: zod.z.number().describe(
1419
- "Indicates current noise level in decibels, if the device supports noise detection."
1420
- ).optional(),
1421
- currently_triggering_noise_threshold_ids: zod.z.array(zod.z.string()).describe("Array of noise threshold IDs that are currently triggering.").optional()
1511
+ var result7 = zod.z.object({});
1512
+ var set_heat_cool_action_attempt = zod.z.discriminatedUnion("status", [
1513
+ common_pending_action_attempt.extend({
1514
+ action_type: action_type6
1515
+ }).describe("Setting HVAC to heat-cool mode."),
1516
+ common_succeeded_action_attempt.extend({
1517
+ action_type: action_type6,
1518
+ result: result7
1519
+ }).describe("Setting HVAC to heat-cool mode succeeded."),
1520
+ common_failed_action_attempt.extend({ action_type: action_type6, error: error7 }).describe("Setting heat-cool mode failed.")
1521
+ ]);
1522
+ var action_type7 = zod.z.literal("SET_THERMOSTAT_OFF");
1523
+ var error8 = zod.z.object({
1524
+ type: zod.z.string(),
1525
+ message: zod.z.string()
1422
1526
  });
1423
- var device = zod.z.object({
1424
- device_id: zod.z.string().uuid().describe("Unique identifier for the device."),
1425
- device_type: any_device_type.describe("Type of the device."),
1426
- nickname: zod.z.string().optional().describe(
1427
- "Optional nickname to describe the device, settable through Seam"
1428
- ),
1429
- display_name: zod.z.string().describe(
1430
- "Display name of the device, defaults to nickname (if it is set) or properties.appearance.name otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices."
1431
- ),
1432
- capabilities_supported: zod.z.array(capabilities).describe(
1433
- 'Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health.'
1434
- ),
1435
- properties: common_device_properties.and(phone_specific_properties.partial()).and(device_metadata).and(capability_properties).describe("Properties of the device."),
1436
- location: zod.z.object({
1437
- location_name: zod.z.string().optional().describe("Name of the device location."),
1438
- timezone: zod.z.string().optional().describe("Time zone of the device location.")
1439
- }).nullable().describe("Location information for the device."),
1440
- connected_account_id: zod.z.string().uuid().describe(
1441
- "Unique identifier for the account associated with the device."
1442
- ),
1443
- workspace_id: zod.z.string().uuid().describe(
1444
- "Unique identifier for the Seam workspace associated with the device."
1445
- ),
1446
- errors: zod.z.array(
1447
- zod.z.object({
1448
- error_code: zod.z.string(),
1449
- message: zod.z.string()
1450
- })
1451
- ).describe(
1452
- 'Array of errors associated with the device. 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.'
1453
- ),
1454
- warnings: zod.z.array(
1455
- zod.z.object({
1456
- warning_code: zod.z.string(),
1457
- message: zod.z.string()
1458
- })
1459
- ).describe(
1460
- 'Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it.'
1461
- ),
1462
- created_at: zod.z.string().datetime().describe("Date and time at which the device object was created."),
1463
- is_managed: zod.z.literal(true).describe("Indicates whether Seam manages the device."),
1464
- custom_metadata
1465
- }).merge(device_capability_flags2);
1466
- var DEVICE_PROVIDERS = {
1467
- AKUVOX: "akuvox",
1468
- AUGUST: "august",
1469
- AVIGILON_ALTA: "avigilon_alta",
1470
- BRIVO: "brivo",
1471
- BUTTERFLYMX: "butterflymx",
1472
- SCHLAGE: "schlage",
1473
- SMARTTHINGS: "smartthings",
1474
- YALE: "yale",
1475
- GENIE: "genie",
1476
- DOORKING: "doorking",
1477
- SALTO: "salto",
1478
- LOCKLY: "lockly",
1479
- TTLOCK: "ttlock",
1480
- LINEAR: "linear",
1481
- NOISEAWARE: "noiseaware",
1482
- NUKI: "nuki",
1483
- SEAM_RELAY_ADMIN: "seam_relay_admin",
1484
- IGLOO: "igloo",
1485
- KWIKSET: "kwikset",
1486
- MINUT: "minut",
1487
- MY_2N: "my_2n",
1488
- CONTROLBYWEB: "controlbyweb",
1489
- NEST: "nest",
1490
- IGLOOHOME: "igloohome",
1491
- ECOBEE: "ecobee",
1492
- HUBITAT: "hubitat",
1493
- FOUR_SUITES: "four_suites",
1494
- DORMAKABA_ORACODE: "dormakaba_oracode",
1495
- PTI: "pti",
1496
- WYZE: "wyze",
1497
- SEAM_PASSPORT: "seam_passport",
1498
- VISIONLINE: "visionline",
1499
- ASSA_ABLOY_CREDENTIAL_SERVICE: "assa_abloy_credential_service",
1500
- SEAM_BRIDGE: "seam_bridge",
1501
- TEDEE: "tedee",
1502
- HONEYWELL_RESIDEO: "honeywell_resideo",
1503
- LATCH: "latch"
1504
- };
1505
- var ALL_DEVICE_PROVIDERS = Object.values(DEVICE_PROVIDERS);
1506
- var PROVIDER_CATEGORY_MAP = {
1507
- stable: [
1508
- "august",
1509
- "avigilon_alta",
1510
- "brivo",
1511
- "schlage",
1512
- "smartthings",
1513
- "yale",
1514
- "nuki",
1515
- "salto",
1516
- "controlbyweb",
1517
- "minut",
1518
- "my_2n",
1519
- "kwikset",
1520
- "ttlock",
1521
- "noiseaware",
1522
- "igloohome",
1523
- "ecobee",
1524
- "four_suites",
1525
- "lockly",
1526
- "wyze",
1527
- "nest",
1528
- "tedee",
1529
- "seam_bridge",
1530
- "honeywell_resideo",
1531
- "visionline",
1532
- "assa_abloy_credential_service",
1533
- "latch"
1534
- ],
1535
- consumer_smartlocks: [
1536
- "august",
1537
- "schlage",
1538
- "yale",
1539
- "smartthings",
1540
- "nuki",
1541
- "ttlock",
1542
- "kwikset",
1543
- "igloohome",
1544
- "wyze"
1545
- ],
1546
- thermostats: ["ecobee", "nest"],
1547
- noise_sensors: ["minut", "noiseaware"],
1548
- access_control_systems: [
1549
- "pti",
1550
- "visionline",
1551
- "assa_abloy_credential_service",
1552
- "latch"
1553
- ],
1554
- internal_beta: ALL_DEVICE_PROVIDERS
1555
- };
1556
- var PROVIDER_CATEGORIES = Object.keys(PROVIDER_CATEGORY_MAP);
1557
- var PUBLIC_PROVIDER_CATEGORIES = PROVIDER_CATEGORIES.filter((category) => category !== "internal_beta");
1558
- var device_provider = zod.z.object({
1559
- device_provider_name: zod.z.enum(ALL_DEVICE_PROVIDERS),
1560
- display_name: zod.z.string(),
1561
- image_url: zod.z.string(),
1562
- provider_categories: zod.z.array(zod.z.enum(PUBLIC_PROVIDER_CATEGORIES))
1527
+ var result8 = zod.z.object({});
1528
+ var set_thermostat_off_action_attempt = zod.z.discriminatedUnion(
1529
+ "status",
1530
+ [
1531
+ common_pending_action_attempt.extend({
1532
+ action_type: action_type7
1533
+ }).describe("Turning HVAC off."),
1534
+ common_succeeded_action_attempt.extend({
1535
+ action_type: action_type7,
1536
+ result: result8
1537
+ }).describe("Turning HVAC off succeeded."),
1538
+ common_failed_action_attempt.extend({ action_type: action_type7, error: error8 }).describe("Turning HVAC off failed.")
1539
+ ]
1540
+ );
1541
+ var action_type8 = zod.z.literal("UNLOCK_DOOR");
1542
+ var error9 = zod.z.object({
1543
+ type: zod.z.string(),
1544
+ message: zod.z.string()
1545
+ });
1546
+ var result9 = zod.z.object({});
1547
+ var unlock_door_action_attempt = zod.z.discriminatedUnion("status", [
1548
+ common_pending_action_attempt.extend({
1549
+ action_type: action_type8
1550
+ }).describe("Unlocking door."),
1551
+ common_succeeded_action_attempt.extend({
1552
+ action_type: action_type8,
1553
+ result: result9
1554
+ }).describe("Unlocking door succeeded."),
1555
+ common_failed_action_attempt.extend({ action_type: action_type8, error: error9 }).describe("Unlocking door failed.")
1556
+ ]);
1557
+
1558
+ // src/lib/seam/connect/models/action-attempts/action-attempt.ts
1559
+ var action_attempt = zod.z.union([
1560
+ ...lock_door_action_attempt.options,
1561
+ ...unlock_door_action_attempt.options,
1562
+ ...reset_sandbox_workspace_action_attempt.options,
1563
+ ...set_cool_action_attempt.options,
1564
+ ...set_heat_action_attempt.options,
1565
+ ...set_heat_cool_action_attempt.options,
1566
+ ...set_fan_mode_action_attempt.options,
1567
+ ...set_thermostat_off_action_attempt.options,
1568
+ ...deprecated_action_attempts
1569
+ ]);
1570
+ var client_session = zod.z.object({
1571
+ client_session_id: zod.z.string().uuid(),
1572
+ workspace_id: zod.z.string().uuid(),
1573
+ created_at: zod.z.string().datetime(),
1574
+ token: zod.z.string(),
1575
+ user_identifier_key: zod.z.string().nullable(),
1576
+ device_count: zod.z.number(),
1577
+ connected_account_ids: zod.z.array(zod.z.string().uuid()),
1578
+ connect_webview_ids: zod.z.array(zod.z.string().uuid()),
1579
+ user_identity_ids: zod.z.array(zod.z.string().uuid())
1580
+ });
1581
+ var connect_webview_device_selection_mode = zod.z.enum([
1582
+ "none",
1583
+ "single",
1584
+ "multiple"
1585
+ ]);
1586
+ var connect_webview = zod.z.object({
1587
+ connect_webview_id: zod.z.string().uuid(),
1588
+ workspace_id: zod.z.string().uuid(),
1589
+ created_at: zod.z.string().datetime(),
1590
+ connected_account_id: zod.z.string().uuid().nullable(),
1591
+ url: zod.z.string().url(),
1592
+ device_selection_mode: connect_webview_device_selection_mode,
1593
+ // TODO: Use enum value.
1594
+ accepted_providers: zod.z.array(zod.z.string()),
1595
+ accepted_devices: zod.z.array(zod.z.string()).describe(
1596
+ `
1597
+ ---
1598
+ deprecated: Unused. Will be removed.
1599
+ ---
1600
+ `
1601
+ ),
1602
+ any_device_allowed: zod.z.boolean().describe(
1603
+ `
1604
+ ---
1605
+ deprecated: Unused. Will be removed.
1606
+ ---
1607
+ `
1608
+ ),
1609
+ any_provider_allowed: zod.z.boolean(),
1610
+ login_successful: zod.z.boolean(),
1611
+ status: zod.z.enum(["pending", "failed", "authorized"]),
1612
+ custom_redirect_url: zod.z.string().url().nullable(),
1613
+ custom_redirect_failure_url: zod.z.string().url().nullable(),
1614
+ custom_metadata,
1615
+ automatically_manage_new_devices: zod.z.boolean(),
1616
+ wait_for_device_creation: zod.z.boolean(),
1617
+ authorized_at: zod.z.string().datetime().nullable(),
1618
+ selected_provider: zod.z.string().nullable()
1563
1619
  });
1564
- var unmanaged_device = device.pick({
1565
- device_id: true,
1566
- device_type: true,
1567
- connected_account_id: true,
1568
- capabilities_supported: true,
1569
- workspace_id: true,
1570
- errors: true,
1571
- warnings: true,
1572
- created_at: true
1573
- }).extend({
1574
- is_managed: zod.z.literal(false),
1575
- properties: common_device_properties.pick({
1576
- accessory_keypad: true,
1577
- name: true,
1578
- online: true,
1579
- manufacturer: true,
1580
- image_url: true,
1581
- image_alt_text: true,
1582
- battery_level: true,
1583
- battery: true,
1584
- online_access_codes_enabled: true,
1585
- offline_access_codes_enabled: true,
1586
- model: true
1587
- })
1588
- }).merge(device_capability_flags2);
1589
1620
  var common_event = zod.z.object({
1590
1621
  event_id: zod.z.string().uuid().describe(`
1591
1622
  ---
@@ -1971,7 +2002,11 @@ var device_accessory_keypad_disconnected_event = device_event.extend({
1971
2002
  }).describe("A accessory keypad was disconnected to a device.");
1972
2003
  var noise_sensor_noise_threshold_triggered_event = device_event.extend({
1973
2004
  event_type: zod.z.literal("noise_sensor.noise_threshold_triggered"),
1974
- // TODO: import from ../devices
2005
+ noise_level_decibels: zod.z.number().optional(),
2006
+ noise_level_nrs: zod.z.number().optional(),
2007
+ noise_threshold_id: zod.z.string().uuid().optional(),
2008
+ noise_threshold_name: zod.z.string().optional(),
2009
+ // TODO: remove metadata from this event
1975
2010
  noiseaware_metadata: zod.z.record(zod.z.unknown()).optional().describe(`
1976
2011
  ---
1977
2012
  title: Noiseaware Metadata
@@ -2148,7 +2183,46 @@ var openapi_default = {
2148
2183
  type: "string"
2149
2184
  },
2150
2185
  errors: {
2151
- description: 'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.'
2186
+ description: 'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.',
2187
+ items: {
2188
+ oneOf: [
2189
+ {
2190
+ properties: {
2191
+ error_code: { type: "string" },
2192
+ is_access_code_error: { enum: [true], type: "boolean" },
2193
+ message: { type: "string" }
2194
+ },
2195
+ required: ["message", "is_access_code_error", "error_code"],
2196
+ type: "object"
2197
+ },
2198
+ {
2199
+ properties: {
2200
+ error_code: { type: "string" },
2201
+ is_device_error: { enum: [true], type: "boolean" },
2202
+ message: { type: "string" }
2203
+ },
2204
+ required: ["message", "is_device_error", "error_code"],
2205
+ type: "object"
2206
+ },
2207
+ {
2208
+ properties: {
2209
+ error_code: { type: "string" },
2210
+ is_connected_account_error: {
2211
+ enum: [true],
2212
+ type: "boolean"
2213
+ },
2214
+ message: { type: "string" }
2215
+ },
2216
+ required: [
2217
+ "message",
2218
+ "is_connected_account_error",
2219
+ "error_code"
2220
+ ],
2221
+ type: "object"
2222
+ }
2223
+ ]
2224
+ },
2225
+ type: "array"
2152
2226
  },
2153
2227
  is_backup: {
2154
2228
  description: "Indicates whether the access code is a backup code.",
@@ -2211,7 +2285,16 @@ var openapi_default = {
2211
2285
  type: "string"
2212
2286
  },
2213
2287
  warnings: {
2214
- description: 'Collection of warnings associated with the access code, structured in a dictionary format. A unique "warning_code" keys each warning. Each warning entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the warning. "created_at" is a date that indicates when the warning was generated. This structure enables detailed tracking and timely response to potential issues that are not critical but that may require attention.'
2288
+ description: 'Collection of warnings associated with the access code, structured in a dictionary format. A unique "warning_code" keys each warning. Each warning entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the warning. "created_at" is a date that indicates when the warning was generated. This structure enables detailed tracking and timely response to potential issues that are not critical but that may require attention.',
2289
+ items: {
2290
+ properties: {
2291
+ message: { type: "string" },
2292
+ warning_code: { type: "string" }
2293
+ },
2294
+ required: ["message", "warning_code"],
2295
+ type: "object"
2296
+ },
2297
+ type: "array"
2215
2298
  }
2216
2299
  },
2217
2300
  required: [
@@ -2222,6 +2305,8 @@ var openapi_default = {
2222
2305
  "name",
2223
2306
  "code",
2224
2307
  "created_at",
2308
+ "errors",
2309
+ "warnings",
2225
2310
  "is_managed",
2226
2311
  "status",
2227
2312
  "is_backup_access_code_available",
@@ -3945,7 +4030,18 @@ var openapi_default = {
3945
4030
  },
3946
4031
  type: "object"
3947
4032
  },
3948
- errors: {},
4033
+ errors: {
4034
+ items: {
4035
+ properties: {
4036
+ error_code: { type: "string" },
4037
+ is_connected_account_error: { enum: [true], type: "boolean" },
4038
+ message: { type: "string" }
4039
+ },
4040
+ required: ["message", "is_connected_account_error", "error_code"],
4041
+ type: "object"
4042
+ },
4043
+ type: "array"
4044
+ },
3949
4045
  user_identifier: {
3950
4046
  properties: {
3951
4047
  api_url: { type: "string" },
@@ -3956,10 +4052,22 @@ var openapi_default = {
3956
4052
  },
3957
4053
  type: "object"
3958
4054
  },
3959
- warnings: {}
4055
+ warnings: {
4056
+ items: {
4057
+ properties: {
4058
+ message: { type: "string" },
4059
+ warning_code: { type: "string" }
4060
+ },
4061
+ required: ["message", "warning_code"],
4062
+ type: "object"
4063
+ },
4064
+ type: "array"
4065
+ }
3960
4066
  },
3961
4067
  required: [
3962
4068
  "account_type_display_name",
4069
+ "errors",
4070
+ "warnings",
3963
4071
  "custom_metadata",
3964
4072
  "automatically_manage_new_devices"
3965
4073
  ],
@@ -4066,12 +4174,33 @@ var openapi_default = {
4066
4174
  errors: {
4067
4175
  description: 'Array of errors associated with the device. 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.',
4068
4176
  items: {
4069
- properties: {
4070
- error_code: { type: "string" },
4071
- message: { type: "string" }
4072
- },
4073
- required: ["error_code", "message"],
4074
- type: "object"
4177
+ oneOf: [
4178
+ {
4179
+ properties: {
4180
+ error_code: { type: "string" },
4181
+ is_device_error: { enum: [true], type: "boolean" },
4182
+ message: { type: "string" }
4183
+ },
4184
+ required: ["message", "is_device_error", "error_code"],
4185
+ type: "object"
4186
+ },
4187
+ {
4188
+ properties: {
4189
+ error_code: { type: "string" },
4190
+ is_connected_account_error: {
4191
+ enum: [true],
4192
+ type: "boolean"
4193
+ },
4194
+ message: { type: "string" }
4195
+ },
4196
+ required: [
4197
+ "message",
4198
+ "is_connected_account_error",
4199
+ "error_code"
4200
+ ],
4201
+ type: "object"
4202
+ }
4203
+ ]
4075
4204
  },
4076
4205
  type: "array"
4077
4206
  },
@@ -5402,7 +5531,7 @@ var openapi_default = {
5402
5531
  message: { type: "string" },
5403
5532
  warning_code: { type: "string" }
5404
5533
  },
5405
- required: ["warning_code", "message"],
5534
+ required: ["message", "warning_code"],
5406
5535
  type: "object"
5407
5536
  },
5408
5537
  type: "array"
@@ -5617,12 +5746,33 @@ var openapi_default = {
5617
5746
  errors: {
5618
5747
  description: 'Array of errors associated with the device. 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.',
5619
5748
  items: {
5620
- properties: {
5621
- error_code: { type: "string" },
5622
- message: { type: "string" }
5623
- },
5624
- required: ["error_code", "message"],
5625
- type: "object"
5749
+ oneOf: [
5750
+ {
5751
+ properties: {
5752
+ error_code: { type: "string" },
5753
+ is_device_error: { enum: [true], type: "boolean" },
5754
+ message: { type: "string" }
5755
+ },
5756
+ required: ["message", "is_device_error", "error_code"],
5757
+ type: "object"
5758
+ },
5759
+ {
5760
+ properties: {
5761
+ error_code: { type: "string" },
5762
+ is_connected_account_error: {
5763
+ enum: [true],
5764
+ type: "boolean"
5765
+ },
5766
+ message: { type: "string" }
5767
+ },
5768
+ required: [
5769
+ "message",
5770
+ "is_connected_account_error",
5771
+ "error_code"
5772
+ ],
5773
+ type: "object"
5774
+ }
5775
+ ]
5626
5776
  },
5627
5777
  type: "array"
5628
5778
  },
@@ -5680,7 +5830,7 @@ var openapi_default = {
5680
5830
  message: { type: "string" },
5681
5831
  warning_code: { type: "string" }
5682
5832
  },
5683
- required: ["warning_code", "message"],
5833
+ required: ["message", "warning_code"],
5684
5834
  type: "object"
5685
5835
  },
5686
5836
  type: "array"
@@ -5745,7 +5895,46 @@ var openapi_default = {
5745
5895
  type: "string"
5746
5896
  },
5747
5897
  errors: {
5748
- description: 'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.'
5898
+ description: 'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.',
5899
+ items: {
5900
+ oneOf: [
5901
+ {
5902
+ properties: {
5903
+ error_code: { type: "string" },
5904
+ is_access_code_error: { enum: [true], type: "boolean" },
5905
+ message: { type: "string" }
5906
+ },
5907
+ required: ["message", "is_access_code_error", "error_code"],
5908
+ type: "object"
5909
+ },
5910
+ {
5911
+ properties: {
5912
+ error_code: { type: "string" },
5913
+ is_device_error: { enum: [true], type: "boolean" },
5914
+ message: { type: "string" }
5915
+ },
5916
+ required: ["message", "is_device_error", "error_code"],
5917
+ type: "object"
5918
+ },
5919
+ {
5920
+ properties: {
5921
+ error_code: { type: "string" },
5922
+ is_connected_account_error: {
5923
+ enum: [true],
5924
+ type: "boolean"
5925
+ },
5926
+ message: { type: "string" }
5927
+ },
5928
+ required: [
5929
+ "message",
5930
+ "is_connected_account_error",
5931
+ "error_code"
5932
+ ],
5933
+ type: "object"
5934
+ }
5935
+ ]
5936
+ },
5937
+ type: "array"
5749
5938
  },
5750
5939
  is_managed: { enum: [false], type: "boolean" },
5751
5940
  name: {
@@ -5766,7 +5955,16 @@ var openapi_default = {
5766
5955
  type: "string"
5767
5956
  },
5768
5957
  warnings: {
5769
- description: 'Collection of warnings associated with the access code, structured in a dictionary format. A unique "warning_code" keys each warning. Each warning entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the warning. "created_at" is a date that indicates when the warning was generated. This structure enables detailed tracking and timely response to potential issues that are not critical but that may require attention.'
5958
+ description: 'Collection of warnings associated with the access code, structured in a dictionary format. A unique "warning_code" keys each warning. Each warning entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the warning. "created_at" is a date that indicates when the warning was generated. This structure enables detailed tracking and timely response to potential issues that are not critical but that may require attention.',
5959
+ items: {
5960
+ properties: {
5961
+ message: { type: "string" },
5962
+ warning_code: { type: "string" }
5963
+ },
5964
+ required: ["message", "warning_code"],
5965
+ type: "object"
5966
+ },
5967
+ type: "array"
5770
5968
  }
5771
5969
  },
5772
5970
  required: [
@@ -5776,6 +5974,8 @@ var openapi_default = {
5776
5974
  "name",
5777
5975
  "code",
5778
5976
  "created_at",
5977
+ "errors",
5978
+ "warnings",
5779
5979
  "is_managed",
5780
5980
  "status"
5781
5981
  ],
@@ -5872,12 +6072,33 @@ var openapi_default = {
5872
6072
  errors: {
5873
6073
  description: 'Array of errors associated with the device. 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.',
5874
6074
  items: {
5875
- properties: {
5876
- error_code: { type: "string" },
5877
- message: { type: "string" }
5878
- },
5879
- required: ["error_code", "message"],
5880
- type: "object"
6075
+ oneOf: [
6076
+ {
6077
+ properties: {
6078
+ error_code: { type: "string" },
6079
+ is_device_error: { enum: [true], type: "boolean" },
6080
+ message: { type: "string" }
6081
+ },
6082
+ required: ["message", "is_device_error", "error_code"],
6083
+ type: "object"
6084
+ },
6085
+ {
6086
+ properties: {
6087
+ error_code: { type: "string" },
6088
+ is_connected_account_error: {
6089
+ enum: [true],
6090
+ type: "boolean"
6091
+ },
6092
+ message: { type: "string" }
6093
+ },
6094
+ required: [
6095
+ "message",
6096
+ "is_connected_account_error",
6097
+ "error_code"
6098
+ ],
6099
+ type: "object"
6100
+ }
6101
+ ]
5881
6102
  },
5882
6103
  type: "array"
5883
6104
  },
@@ -6009,7 +6230,7 @@ var openapi_default = {
6009
6230
  message: { type: "string" },
6010
6231
  warning_code: { type: "string" }
6011
6232
  },
6012
- required: ["warning_code", "message"],
6233
+ required: ["message", "warning_code"],
6013
6234
  type: "object"
6014
6235
  },
6015
6236
  type: "array"