@seamapi/types 1.222.0 → 1.224.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.222.0",
3
+ "version": "1.224.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -92,7 +92,7 @@
92
92
  "zod": "^3.21.4"
93
93
  },
94
94
  "devDependencies": {
95
- "@seamapi/blueprint": "^0.12.0",
95
+ "@seamapi/blueprint": "^0.13.0",
96
96
  "@types/node": "^20.8.10",
97
97
  "concurrently": "^8.2.0",
98
98
  "del-cli": "^5.0.0",
@@ -73,8 +73,20 @@ const visionline_instance_unreachable = common_acs_system_error.extend({
73
73
  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).
74
74
  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).`)
75
75
 
76
+ const salto_site_user_limit_reached = common_acs_system_error.extend({
77
+ error_code: z
78
+ .literal('salto_site_user_limit_reached')
79
+ .describe(
80
+ 'You have reached the maximum number of users allowed for your site; Please contact Salto support to increase your user limit.',
81
+ ),
82
+ })
83
+
76
84
  const acs_system_error = z
77
- .union([seam_bridge_disconnected, visionline_instance_unreachable])
85
+ .union([
86
+ seam_bridge_disconnected,
87
+ visionline_instance_unreachable,
88
+ salto_site_user_limit_reached,
89
+ ])
78
90
  .describe('Error associated with the `acs_system`.')
79
91
 
80
92
  const acs_system_error_map = z.object({
@@ -82,13 +94,44 @@ const acs_system_error_map = z.object({
82
94
  visionline_instance_unreachable: visionline_instance_unreachable
83
95
  .optional()
84
96
  .nullable(),
97
+ salto_site_user_limit_reached: salto_site_user_limit_reached
98
+ .optional()
99
+ .nullable(),
85
100
  })
86
101
 
87
102
  export type AcsSystemErrorMap = z.infer<typeof acs_system_error_map>
88
103
 
89
- const acs_system_warning = z.object({})
104
+ const common_acs_system_warning = z.object({
105
+ created_at: z
106
+ .string()
107
+ .datetime()
108
+ .describe('Date and time at which Seam created the warning.'),
109
+ message: z
110
+ .string()
111
+ .describe(
112
+ 'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.',
113
+ ),
114
+ })
115
+
116
+ const salto_site_user_limit_almost_reached = common_acs_system_warning.extend({
117
+ warning_code: z
118
+ .literal('salto_site_user_limit_almost_reached')
119
+ .describe(
120
+ 'You have reached more than 80% of the maximum number of users allowed for your site; Please contact Salto support to increase your user limit.',
121
+ ),
122
+ })
123
+
124
+ const acs_system_warning =
125
+ // z.union([
126
+ salto_site_user_limit_almost_reached
127
+ // ])
128
+ .describe('Warning associated with the `acs_system`.')
90
129
 
91
- const acs_system_warning_map = z.object({})
130
+ const acs_system_warning_map = z.object({
131
+ salto_site_user_limit_almost_reached: salto_site_user_limit_almost_reached
132
+ .optional()
133
+ .nullable(),
134
+ })
92
135
 
93
136
  export type AcsSystemWarningMap = z.infer<typeof acs_system_warning_map>
94
137
 
@@ -150,13 +193,9 @@ export const acs_system = z
150
193
  errors: z
151
194
  .array(acs_system_error)
152
195
  .describe('Errors associated with the `acs_system`.'),
153
- warnings: z.array(acs_system_warning).describe(
154
- `
155
- ---
156
- undocumented: Currently, no warnings defined for \`acs_system\`s.
157
- ---
158
- `,
159
- ),
196
+ warnings: z
197
+ .array(acs_system_warning)
198
+ .describe('Warnings associated with the `acs_system`.'),
160
199
  })
161
200
  .merge(acs_system_capability_flags)
162
201
  .describe(
@@ -7,70 +7,40 @@ import {
7
7
  hvac_mode_setting,
8
8
  } from '../../thermostats/index.js'
9
9
 
10
- const base_thermostat_capability_properties = z.object({
11
- temperature_fahrenheit: z.number(),
12
- temperature_celsius: z.number(),
13
- relative_humidity: z.number().min(0).max(1),
14
- can_enable_automatic_heating: z.boolean(),
15
- can_enable_automatic_cooling: z.boolean(),
16
- available_hvac_mode_settings: z.array(hvac_mode_setting),
17
- is_heating_available: z.literal(false),
18
- is_cooling_available: z.literal(false),
19
- is_heating: z.boolean(),
20
- is_cooling: z.boolean(),
21
- is_fan_running: z.boolean(),
22
- fan_mode_setting,
23
-
24
- /**
25
- * this is true if the current thermostat settings differ that what is on seam, and `current_climate_setting.manual_override_allowed: true`
26
- */
27
- is_temporary_manual_override_active: z.boolean(),
28
-
29
- /**
30
- * can be derived from `default_climate_setting`, or `active_climate_setting_schedule` if one is active
31
- */
32
- current_climate_setting: climate_setting,
33
- default_climate_setting: climate_setting.optional(),
34
- is_climate_setting_schedule_active: z.boolean(),
35
- active_climate_setting_schedule: climate_setting_schedule.optional(),
36
- })
37
-
38
- export const cooling_thermostat_capability_properties =
39
- base_thermostat_capability_properties.merge(
40
- z.object({
41
- min_cooling_set_point_celsius: z.number(),
42
- min_cooling_set_point_fahrenheit: z.number(),
43
- max_cooling_set_point_celsius: z.number(),
44
- max_cooling_set_point_fahrenheit: z.number(),
45
- is_cooling_available: z.literal(true),
46
- }),
47
- )
48
-
49
- export const heating_thermostat_capability_properties =
50
- base_thermostat_capability_properties.merge(
51
- z.object({
52
- min_heating_set_point_celsius: z.number(),
53
- min_heating_set_point_fahrenheit: z.number(),
54
- max_heating_set_point_celsius: z.number(),
55
- max_heating_set_point_fahrenheit: z.number(),
56
- is_heating_available: z.literal(true),
57
- }),
58
- )
59
-
60
- export const heating_cooling_thermostat_capability_properties =
61
- cooling_thermostat_capability_properties
62
- .merge(heating_thermostat_capability_properties)
63
- .merge(
64
- z.object({
65
- is_cooling_available: z.literal(true),
66
- is_heating_available: z.literal(true),
67
- min_heating_cooling_delta_celsius: z.number(),
68
- min_heating_cooling_delta_fahrenheit: z.number(),
69
- }),
70
- )
71
-
72
- export const thermostat_capability_properties = z.union([
73
- heating_cooling_thermostat_capability_properties.partial(),
74
- heating_thermostat_capability_properties.partial(),
75
- cooling_thermostat_capability_properties.partial(),
76
- ])
10
+ export const thermostat_capability_properties = z
11
+ .object({
12
+ temperature_fahrenheit: z.number(),
13
+ temperature_celsius: z.number(),
14
+ relative_humidity: z.number().min(0).max(1),
15
+ can_enable_automatic_heating: z.boolean(),
16
+ can_enable_automatic_cooling: z.boolean(),
17
+ available_hvac_mode_settings: z.array(hvac_mode_setting),
18
+ is_heating: z.boolean(),
19
+ is_cooling: z.boolean(),
20
+ is_fan_running: z.boolean(),
21
+ fan_mode_setting,
22
+
23
+ /**
24
+ * this is true if the current thermostat settings differ that what is on seam, and `current_climate_setting.manual_override_allowed: true`
25
+ */
26
+ is_temporary_manual_override_active: z.boolean(),
27
+
28
+ /**
29
+ * can be derived from `default_climate_setting`, or `active_climate_setting_schedule` if one is active
30
+ */
31
+ current_climate_setting: climate_setting,
32
+ default_climate_setting: climate_setting,
33
+ is_climate_setting_schedule_active: z.boolean(),
34
+ active_climate_setting_schedule: climate_setting_schedule,
35
+ min_cooling_set_point_celsius: z.number(),
36
+ min_cooling_set_point_fahrenheit: z.number(),
37
+ max_cooling_set_point_celsius: z.number(),
38
+ max_cooling_set_point_fahrenheit: z.number(),
39
+ min_heating_set_point_celsius: z.number(),
40
+ min_heating_set_point_fahrenheit: z.number(),
41
+ max_heating_set_point_celsius: z.number(),
42
+ max_heating_set_point_fahrenheit: z.number(),
43
+ min_heating_cooling_delta_celsius: z.number(),
44
+ min_heating_cooling_delta_fahrenheit: z.number(),
45
+ })
46
+ .partial()