@seamapi/types 1.51.0 → 1.52.1
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/dist/connect.cjs +229 -35
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +542 -60
- package/lib/seam/connect/openapi.d.ts +215 -23
- package/lib/seam/connect/openapi.js +228 -34
- package/lib/seam/connect/openapi.js.map +1 -1
- package/lib/seam/connect/route-types.d.ts +327 -37
- package/lib/seam/connect/unstable/models/devices/managed-device.js +83 -33
- package/lib/seam/connect/unstable/models/devices/managed-device.js.map +1 -1
- package/lib/seam/connect/unstable/models/user-identity.d.ts +6 -0
- package/lib/seam/connect/unstable/models/user-identity.js +2 -0
- package/lib/seam/connect/unstable/models/user-identity.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/seam/connect/openapi.ts +248 -34
- package/src/lib/seam/connect/route-types.ts +327 -36
- package/src/lib/seam/connect/unstable/models/devices/managed-device.ts +111 -41
- package/src/lib/seam/connect/unstable/models/user-identity.ts +2 -0
|
@@ -11,80 +11,150 @@ export const battery_status = z.enum(['critical', 'low', 'good', 'full'])
|
|
|
11
11
|
export type BatteryStatus = z.infer<typeof battery_status>
|
|
12
12
|
|
|
13
13
|
export const common_device_properties = z.object({
|
|
14
|
-
online: z.boolean(),
|
|
15
|
-
name: z
|
|
14
|
+
online: z.boolean().describe('Indicates whether the device is online.'),
|
|
15
|
+
name: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe(
|
|
18
|
+
'Name of the device. Enables administrators and users to identify the device easily, especially when there are numerous devices.',
|
|
19
|
+
),
|
|
16
20
|
model: z.object({
|
|
17
|
-
display_name: z.string(),
|
|
18
|
-
manufacturer_display_name: z
|
|
21
|
+
display_name: z.string().describe('Display name of the device model.'),
|
|
22
|
+
manufacturer_display_name: z
|
|
23
|
+
.string()
|
|
24
|
+
.describe(
|
|
25
|
+
'Display name that corresponds to the manufacturer-specific terminology for the device.',
|
|
26
|
+
),
|
|
19
27
|
|
|
20
|
-
offline_access_codes_supported: z
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
offline_access_codes_supported: z
|
|
29
|
+
.boolean()
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Indicates whether the device supports offline access codes.'),
|
|
32
|
+
online_access_codes_supported: z
|
|
33
|
+
.boolean()
|
|
34
|
+
.optional()
|
|
35
|
+
.describe('Indicates whether the device supports online access codes.'),
|
|
36
|
+
accessory_keypad_supported: z
|
|
37
|
+
.boolean()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('Indicates whether the device supports an accessory keypad.'),
|
|
23
40
|
}),
|
|
24
|
-
has_direct_power: z
|
|
25
|
-
|
|
41
|
+
has_direct_power: z
|
|
42
|
+
.boolean()
|
|
43
|
+
.optional()
|
|
44
|
+
.describe('Indicates whether the device has direct power.'),
|
|
45
|
+
battery_level: z
|
|
46
|
+
.number()
|
|
47
|
+
.min(0)
|
|
48
|
+
.max(1)
|
|
49
|
+
.optional()
|
|
50
|
+
.describe(
|
|
51
|
+
'Indicates the battery level of the device as a decimal value between 0 and 1, inclusive.',
|
|
52
|
+
),
|
|
26
53
|
battery: z
|
|
27
54
|
.object({
|
|
28
55
|
level: z.number().min(0).max(1),
|
|
29
56
|
status: battery_status,
|
|
30
57
|
})
|
|
31
|
-
.optional()
|
|
58
|
+
.optional()
|
|
59
|
+
.describe(
|
|
60
|
+
'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.',
|
|
61
|
+
),
|
|
32
62
|
// todo: use enum
|
|
33
|
-
manufacturer: z.string().optional(),
|
|
34
|
-
image_url: z.string().url().optional(),
|
|
35
|
-
image_alt_text: z
|
|
36
|
-
|
|
63
|
+
manufacturer: z.string().optional().describe('Manufacturer of the device.'),
|
|
64
|
+
image_url: z.string().url().optional().describe('Image URL for the device.'),
|
|
65
|
+
image_alt_text: z
|
|
66
|
+
.string()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe('Alt text for the device image.'),
|
|
69
|
+
serial_number: z.string().optional().describe('Serial number of the device.'),
|
|
37
70
|
|
|
38
71
|
online_access_codes_enabled: z
|
|
39
72
|
.boolean()
|
|
40
|
-
.describe(
|
|
73
|
+
.describe(
|
|
74
|
+
'Indicates whether it is currently possible to use online access codes for the device.',
|
|
75
|
+
)
|
|
41
76
|
.optional(),
|
|
42
77
|
offline_access_codes_enabled: z
|
|
43
78
|
.boolean()
|
|
44
|
-
.describe(
|
|
79
|
+
.describe(
|
|
80
|
+
'Indicates whether it is currently possible to use offline access codes for the device.',
|
|
81
|
+
)
|
|
45
82
|
.optional(),
|
|
46
83
|
|
|
47
84
|
// Deprecated legacy capability support props
|
|
48
85
|
supports_accessory_keypad: z
|
|
49
86
|
.boolean()
|
|
50
|
-
.describe('Deprecated:
|
|
87
|
+
.describe('Deprecated: Use model.offline_access_codes_enabled.')
|
|
51
88
|
.optional(),
|
|
52
89
|
supports_offline_access_codes: z
|
|
53
90
|
.boolean()
|
|
54
|
-
.describe('Deprecated:
|
|
91
|
+
.describe('Deprecated: Use model.accessory_keypad_supported.')
|
|
55
92
|
.optional(),
|
|
56
93
|
})
|
|
57
94
|
|
|
58
95
|
export const managed_device = z.object({
|
|
59
|
-
device_id: z.string().uuid(),
|
|
60
|
-
device_type: any_device_type,
|
|
61
|
-
capabilities_supported: z
|
|
96
|
+
device_id: z.string().uuid().describe('Unique identifier for the device.'),
|
|
97
|
+
device_type: any_device_type.describe('Type of the device.'),
|
|
98
|
+
capabilities_supported: z
|
|
99
|
+
.array(capabilities)
|
|
100
|
+
.describe(
|
|
101
|
+
'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.',
|
|
102
|
+
),
|
|
62
103
|
properties: common_device_properties
|
|
63
104
|
.and(device_metadata)
|
|
64
|
-
.and(capability_properties)
|
|
105
|
+
.and(capability_properties)
|
|
106
|
+
.describe('Properties of the device.'),
|
|
65
107
|
location: z
|
|
66
108
|
// todo: optional instead of nullable
|
|
67
109
|
.object({
|
|
68
|
-
location_name: z
|
|
69
|
-
|
|
110
|
+
location_name: z
|
|
111
|
+
.string()
|
|
112
|
+
.optional()
|
|
113
|
+
.describe('Name of the device location.'),
|
|
114
|
+
timezone: z
|
|
115
|
+
.string()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe('Time zone of the device location.'),
|
|
70
118
|
})
|
|
71
|
-
.nullable()
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
119
|
+
.nullable()
|
|
120
|
+
.describe('Location information for the device.'),
|
|
121
|
+
connected_account_id: z
|
|
122
|
+
.string()
|
|
123
|
+
.uuid()
|
|
124
|
+
.describe('Unique identifier for the account associated with the device.'),
|
|
125
|
+
workspace_id: z
|
|
126
|
+
.string()
|
|
127
|
+
.uuid()
|
|
128
|
+
.describe(
|
|
129
|
+
'Unique identifier for the Seam workspace associated with the device.',
|
|
130
|
+
),
|
|
131
|
+
errors: z
|
|
132
|
+
.array(
|
|
133
|
+
z.object({
|
|
134
|
+
error_code: z.string(),
|
|
135
|
+
message: z.string(),
|
|
136
|
+
}),
|
|
137
|
+
)
|
|
138
|
+
.describe(
|
|
139
|
+
'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.',
|
|
140
|
+
),
|
|
141
|
+
warnings: z
|
|
142
|
+
.array(
|
|
143
|
+
z.object({
|
|
144
|
+
warning_code: z.string(),
|
|
145
|
+
message: z.string(),
|
|
146
|
+
}),
|
|
147
|
+
)
|
|
148
|
+
.describe(
|
|
149
|
+
'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.',
|
|
150
|
+
),
|
|
151
|
+
created_at: z
|
|
152
|
+
.string()
|
|
153
|
+
.datetime()
|
|
154
|
+
.describe('Date and time at which the device object was created.'),
|
|
155
|
+
is_managed: z
|
|
156
|
+
.literal(true)
|
|
157
|
+
.describe('Indicates whether Seam manages the device.'),
|
|
88
158
|
})
|
|
89
159
|
|
|
90
160
|
export type ManagedDevice = z.infer<typeof managed_device>
|
|
@@ -4,6 +4,8 @@ export const user_identity = z.object({
|
|
|
4
4
|
user_identity_id: z.string().uuid(),
|
|
5
5
|
user_identity_key: z.string().nullish(),
|
|
6
6
|
email_address: z.string().email().nullish(),
|
|
7
|
+
first_name: z.string().nullish(),
|
|
8
|
+
last_name: z.string().nullish(),
|
|
7
9
|
created_at: z.string().datetime(),
|
|
8
10
|
workspace_id: z.string().uuid(),
|
|
9
11
|
})
|