@seamapi/types 0.7.0 → 0.9.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/dist/connect.cjs +1 -1
- package/dist/connect.cjs.map +1 -1
- package/lib/seam/connect/enums.d.ts +1 -0
- package/lib/seam/connect/enums.js +2 -0
- package/lib/seam/connect/enums.js.map +1 -0
- package/lib/seam/connect/index.d.ts +2 -2
- package/lib/seam/connect/index.js +2 -2
- package/lib/seam/connect/index.js.map +1 -1
- package/lib/seam/connect/internal.d.ts +1 -0
- package/lib/seam/connect/internal.js +2 -0
- package/lib/seam/connect/internal.js.map +1 -0
- package/lib/seam/connect/route-types.d.ts +26 -18
- package/lib/seam/connect/stable/model-types.js.map +1 -0
- package/lib/seam/connect/stable/models/connect-webview.js.map +1 -0
- package/lib/seam/connect/stable/models/index.js.map +1 -0
- package/lib/seam/connect/stable/schemas.js.map +1 -0
- package/lib/seam/connect/unstable/index.d.ts +3 -0
- package/lib/seam/connect/unstable/index.js +4 -0
- package/lib/seam/connect/unstable/index.js.map +1 -0
- package/lib/seam/connect/unstable/model-types.d.ts +1 -0
- package/lib/seam/connect/unstable/model-types.js +2 -0
- package/lib/seam/connect/unstable/model-types.js.map +1 -0
- package/lib/seam/connect/unstable/models/capabilities-supported.d.ts +3 -0
- package/lib/seam/connect/unstable/models/capabilities-supported.js +9 -0
- package/lib/seam/connect/unstable/models/capabilities-supported.js.map +1 -0
- package/lib/seam/connect/unstable/models/device-type.d.ts +50 -0
- package/lib/seam/connect/unstable/models/device-type.js +47 -0
- package/lib/seam/connect/unstable/models/device-type.js.map +1 -0
- package/lib/seam/connect/unstable/models/index.d.ts +4 -0
- package/lib/seam/connect/unstable/models/index.js +5 -0
- package/lib/seam/connect/unstable/models/index.js.map +1 -0
- package/lib/seam/connect/unstable/models/managed-device.d.ts +103 -0
- package/lib/seam/connect/unstable/models/managed-device.js +32 -0
- package/lib/seam/connect/unstable/models/managed-device.js.map +1 -0
- package/lib/seam/connect/unstable/models/unmanaged-device.d.ts +115 -0
- package/lib/seam/connect/unstable/models/unmanaged-device.js +28 -0
- package/lib/seam/connect/unstable/models/unmanaged-device.js.map +1 -0
- package/lib/seam/connect/unstable/schemas.d.ts +1 -0
- package/lib/seam/connect/unstable/schemas.js +2 -0
- package/lib/seam/connect/unstable/schemas.js.map +1 -0
- package/package.json +1 -1
- package/src/lib/seam/connect/enums.ts +8 -0
- package/src/lib/seam/connect/index.ts +3 -2
- package/src/lib/seam/connect/internal.ts +1 -0
- package/src/lib/seam/connect/route-types.ts +348 -330
- package/src/lib/seam/connect/unstable/index.ts +5 -0
- package/src/lib/seam/connect/unstable/model-types.ts +9 -0
- package/src/lib/seam/connect/unstable/models/capabilities-supported.ts +11 -0
- package/src/lib/seam/connect/unstable/models/device-type.ts +85 -0
- package/src/lib/seam/connect/unstable/models/index.ts +4 -0
- package/src/lib/seam/connect/unstable/models/managed-device.ts +39 -0
- package/src/lib/seam/connect/unstable/models/unmanaged-device.ts +31 -0
- package/src/lib/seam/connect/unstable/schemas.ts +9 -0
- package/lib/seam/connect/model-types.js.map +0 -1
- package/lib/seam/connect/models/connect-webview.js.map +0 -1
- package/lib/seam/connect/models/index.js.map +0 -1
- package/lib/seam/connect/schemas.js.map +0 -1
- /package/lib/seam/connect/{model-types.d.ts → stable/model-types.d.ts} +0 -0
- /package/lib/seam/connect/{model-types.js → stable/model-types.js} +0 -0
- /package/lib/seam/connect/{models → stable/models}/connect-webview.d.ts +0 -0
- /package/lib/seam/connect/{models → stable/models}/connect-webview.js +0 -0
- /package/lib/seam/connect/{models → stable/models}/index.d.ts +0 -0
- /package/lib/seam/connect/{models → stable/models}/index.js +0 -0
- /package/lib/seam/connect/{schemas.d.ts → stable/schemas.d.ts} +0 -0
- /package/lib/seam/connect/{schemas.js → stable/schemas.js} +0 -0
- /package/src/lib/seam/connect/{model-types.ts → stable/model-types.ts} +0 -0
- /package/src/lib/seam/connect/{models → stable/models}/connect-webview.ts +0 -0
- /package/src/lib/seam/connect/{models → stable/models}/index.ts +0 -0
- /package/src/lib/seam/connect/{schemas.ts → stable/schemas.ts} +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
/** Locks */
|
|
4
|
+
export const LOCK_DEVICE_TYPE = {
|
|
5
|
+
AKUVOX_LOCK: 'akuvox_lock',
|
|
6
|
+
AUGUST_LOCK: 'august_lock',
|
|
7
|
+
BRIVO_ACCESS_POINT: 'brivo_access_point',
|
|
8
|
+
BUTTERFLYMX_PANEL: 'butterflymx_panel',
|
|
9
|
+
DOORKING_LOCK: 'doorking_lock',
|
|
10
|
+
GENIE_DOOR: 'genie_door',
|
|
11
|
+
IGLOO_LOCK: 'igloo_lock',
|
|
12
|
+
LINEAR_LOCK: 'linear_lock',
|
|
13
|
+
LOCKLY_LOCK: 'lockly_lock',
|
|
14
|
+
KWIKSET_LOCK: 'kwikset_lock',
|
|
15
|
+
NUKI_LOCK: 'nuki_lock',
|
|
16
|
+
SALTO_LOCK: 'salto_lock',
|
|
17
|
+
SCHLAGE_LOCK: 'schlage_lock',
|
|
18
|
+
SEAM_RELAY: 'seam_relay',
|
|
19
|
+
SMARTTHINGS_LOCK: 'smartthings_lock',
|
|
20
|
+
YALE_LOCK: 'yale_lock',
|
|
21
|
+
TWO_N_INTERCOM: 'two_n_intercom',
|
|
22
|
+
CONTROLBYWEB_DEVICE: 'controlbyweb_device',
|
|
23
|
+
TTLOCK_LOCK: 'ttlock_lock',
|
|
24
|
+
IGLOOHOME_LOCK: 'igloohome_lock',
|
|
25
|
+
HUBITAT_LOCK: 'hubitat_lock',
|
|
26
|
+
} as const
|
|
27
|
+
|
|
28
|
+
type LockDeviceTypeFromMapping =
|
|
29
|
+
(typeof LOCK_DEVICE_TYPE)[keyof typeof LOCK_DEVICE_TYPE]
|
|
30
|
+
|
|
31
|
+
export const LOCK_DEVICE_TYPE_LIST = Object.values(
|
|
32
|
+
LOCK_DEVICE_TYPE,
|
|
33
|
+
) as LockDeviceTypeFromMapping[]
|
|
34
|
+
|
|
35
|
+
export const lock_device_type = z.enum(
|
|
36
|
+
Object.values(LOCK_DEVICE_TYPE) as [LockDeviceTypeFromMapping],
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
export type LockDeviceType = z.infer<typeof lock_device_type>
|
|
40
|
+
|
|
41
|
+
/** Noise Sensors */
|
|
42
|
+
export const NOISE_SENSOR_DEVICE_TYPE = {
|
|
43
|
+
NOISEAWARE_ACTIVITY_ZONE: 'noiseaware_activity_zone',
|
|
44
|
+
MINUT_SENSOR: 'minut_sensor',
|
|
45
|
+
} as const
|
|
46
|
+
|
|
47
|
+
type NoiseSensorDeviceTypeFromMapping =
|
|
48
|
+
(typeof NOISE_SENSOR_DEVICE_TYPE)[keyof typeof NOISE_SENSOR_DEVICE_TYPE]
|
|
49
|
+
|
|
50
|
+
export const NOISE_SENSOR_DEVICE_TYPE_LIST = Object.values(
|
|
51
|
+
NOISE_SENSOR_DEVICE_TYPE,
|
|
52
|
+
) as NoiseSensorDeviceTypeFromMapping[]
|
|
53
|
+
|
|
54
|
+
export const noise_sensor_device_type = z.enum(
|
|
55
|
+
Object.values(NOISE_SENSOR_DEVICE_TYPE) as [NoiseSensorDeviceTypeFromMapping],
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
export type NoiseSensorDeviceType = z.infer<typeof noise_sensor_device_type>
|
|
59
|
+
|
|
60
|
+
/** Thermostats */
|
|
61
|
+
export const THERMOSTAT_DEVICE_TYPE = {
|
|
62
|
+
ECOBEE_THERMOSTAT: 'ecobee_thermostat',
|
|
63
|
+
NEST_THERMOSTAT: 'nest_thermostat',
|
|
64
|
+
} as const
|
|
65
|
+
|
|
66
|
+
type ThermostatDeviceTypeFromMapping =
|
|
67
|
+
(typeof THERMOSTAT_DEVICE_TYPE)[keyof typeof THERMOSTAT_DEVICE_TYPE]
|
|
68
|
+
|
|
69
|
+
export const THERMOSTAT_DEVICE_TYPE_LIST = Object.values(
|
|
70
|
+
THERMOSTAT_DEVICE_TYPE,
|
|
71
|
+
) as ThermostatDeviceTypeFromMapping[]
|
|
72
|
+
|
|
73
|
+
export const thermostat_device_type = z.enum(
|
|
74
|
+
Object.values(THERMOSTAT_DEVICE_TYPE) as [ThermostatDeviceTypeFromMapping],
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
export type ThermostatDeviceType = z.infer<typeof thermostat_device_type>
|
|
78
|
+
|
|
79
|
+
export const any_device_type = z.union([
|
|
80
|
+
lock_device_type,
|
|
81
|
+
noise_sensor_device_type,
|
|
82
|
+
thermostat_device_type,
|
|
83
|
+
])
|
|
84
|
+
|
|
85
|
+
export type AnyDeviceType = z.infer<typeof any_device_type>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import { capabilities } from './capabilities-supported.js'
|
|
4
|
+
import { any_device_type } from './device-type.js'
|
|
5
|
+
|
|
6
|
+
export const managed_device = z.object({
|
|
7
|
+
device_id: z.string().uuid(),
|
|
8
|
+
device_type: any_device_type,
|
|
9
|
+
capabilities_supported: z.array(capabilities),
|
|
10
|
+
properties: z
|
|
11
|
+
.object({
|
|
12
|
+
online: z.boolean(),
|
|
13
|
+
name: z.string(),
|
|
14
|
+
model: z.object({
|
|
15
|
+
display_name: z.string(),
|
|
16
|
+
}),
|
|
17
|
+
})
|
|
18
|
+
.and(z.record(z.string(), z.any())),
|
|
19
|
+
// todo: better type
|
|
20
|
+
location: z.any(),
|
|
21
|
+
connected_account_id: z.string().uuid(),
|
|
22
|
+
workspace_id: z.string().uuid(),
|
|
23
|
+
errors: z.array(
|
|
24
|
+
z.object({
|
|
25
|
+
error_code: z.string(),
|
|
26
|
+
message: z.string(),
|
|
27
|
+
}),
|
|
28
|
+
),
|
|
29
|
+
warnings: z.array(
|
|
30
|
+
z.object({
|
|
31
|
+
warning_code: z.string(),
|
|
32
|
+
message: z.string(),
|
|
33
|
+
}),
|
|
34
|
+
),
|
|
35
|
+
created_at: z.string().datetime(),
|
|
36
|
+
is_managed: z.literal(true),
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
export type ManagedDevice = z.infer<typeof managed_device>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import { managed_device } from './managed-device.js'
|
|
4
|
+
|
|
5
|
+
export const unmanaged_device = managed_device
|
|
6
|
+
.pick({
|
|
7
|
+
device_id: true,
|
|
8
|
+
device_type: true,
|
|
9
|
+
connected_account_id: true,
|
|
10
|
+
capabilities_supported: true,
|
|
11
|
+
workspace_id: true,
|
|
12
|
+
errors: true,
|
|
13
|
+
warnings: true,
|
|
14
|
+
created_at: true,
|
|
15
|
+
})
|
|
16
|
+
.extend({
|
|
17
|
+
is_managed: z.literal(false),
|
|
18
|
+
// todo: should pick from the managed_device schema instead of re-defining
|
|
19
|
+
properties: z.object({
|
|
20
|
+
name: z.string(),
|
|
21
|
+
online: z.boolean(),
|
|
22
|
+
manufacturer: z.string().optional(),
|
|
23
|
+
image_url: z.string().optional(),
|
|
24
|
+
image_alt_text: z.string().optional(),
|
|
25
|
+
model: z.object({
|
|
26
|
+
display_name: z.string(),
|
|
27
|
+
}),
|
|
28
|
+
}),
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
export type UnmanagedDevice = z.infer<typeof unmanaged_device>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-types.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/model-types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"connect-webview.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/models/connect-webview.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrC,oBAAoB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IAClD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IACrB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC/B,qBAAqB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC7D,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACvC,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IACrC,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE;IACjC,kBAAkB,EAAE,CAAC,CAAC,OAAO,EAAE;IAC/B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;CACpD,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/models/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|