Skip to content

Commit 008dc99

Browse files
authored
feat: Add location (#1576)
1 parent 8f5d439 commit 008dc99

File tree

7 files changed

+866
-2
lines changed

7 files changed

+866
-2
lines changed

src/lib/seam/connect/internal/schemas.ts

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ export {
3434
seam_event as event,
3535
seam_event_type as event_type,
3636
fan_mode_setting,
37+
geolocation,
38+
location,
3739
lock_device_type,
3840
access_code as managed_access_code,
3941
device as managed_device,

src/lib/seam/connect/models/acs/acs-system.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const acs_system_capability_flags = z.object({
2727
),
2828
})
2929

30-
export const location = z.object({
30+
export const acs_location = z.object({
3131
time_zone: z
3232
.string()
3333
.nullable()
@@ -274,7 +274,7 @@ export const acs_system = z
274274
deprecated: Use \`external_type_display_name\`.
275275
---
276276
`),
277-
location,
277+
location: acs_location,
278278
name: z
279279
.string()
280280
.describe(

src/lib/seam/connect/models/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export * from './connected-accounts/index.js'
99
export * from './custom-metadata.js'
1010
export * from './devices/index.js'
1111
export * from './events/index.js'
12+
export * from './locations/index.js'
1213
export * from './noise-sensors/index.js'
1314
export * from './pagination.js'
1415
export * from './phone-number.js'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './location.js'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { z } from 'zod'
2+
3+
export const geolocation = z.object({
4+
latitude: z.number(),
5+
longitude: z.number(),
6+
})
7+
8+
export const location = z.object({
9+
location_id: z
10+
.string()
11+
.uuid()
12+
.describe('Unique identifier for the location.'),
13+
workspace_id: z
14+
.string()
15+
.uuid()
16+
.describe(
17+
'Unique identifier for the Seam workspace associated with the location.',
18+
),
19+
display_name: z.string().describe('Display name of the location.'),
20+
geolocation: geolocation
21+
.optional()
22+
.describe('Geographical location of the location.'),
23+
time_zone: z.string().optional().describe('Time zone of the location.'),
24+
created_at: z
25+
.string()
26+
.datetime()
27+
.describe('Date and time at which the location object was created.'),
28+
})
29+
30+
export type Location = z.infer<typeof location>

0 commit comments

Comments
 (0)