@seamapi/types 1.176.0 → 1.177.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 +1390 -142
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +13104 -2318
- package/lib/seam/connect/model-types.d.ts +1 -1
- package/lib/seam/connect/models/action-attempts/action-attempt.d.ts +1038 -0
- package/lib/seam/connect/models/action-attempts/action-attempt.js +22 -0
- package/lib/seam/connect/models/action-attempts/action-attempt.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/common.d.ts +53 -0
- package/lib/seam/connect/models/action-attempts/common.js +24 -0
- package/lib/seam/connect/models/action-attempts/common.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/deprecated.d.ts +485 -0
- package/lib/seam/connect/models/action-attempts/deprecated.js +108 -0
- package/lib/seam/connect/models/action-attempts/deprecated.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/index.d.ts +1 -0
- package/lib/seam/connect/models/action-attempts/index.js +2 -0
- package/lib/seam/connect/models/action-attempts/index.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/lock-door.d.ts +72 -0
- package/lib/seam/connect/models/action-attempts/lock-door.js +25 -0
- package/lib/seam/connect/models/action-attempts/lock-door.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/reset-sandbox-workspace.d.ts +71 -0
- package/lib/seam/connect/models/action-attempts/reset-sandbox-workspace.js +28 -0
- package/lib/seam/connect/models/action-attempts/reset-sandbox-workspace.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/set-cool.d.ts +71 -0
- package/lib/seam/connect/models/action-attempts/set-cool.js +25 -0
- package/lib/seam/connect/models/action-attempts/set-cool.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/set-fan-mode.d.ts +71 -0
- package/lib/seam/connect/models/action-attempts/set-fan-mode.js +25 -0
- package/lib/seam/connect/models/action-attempts/set-fan-mode.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/set-heat-cool.d.ts +71 -0
- package/lib/seam/connect/models/action-attempts/set-heat-cool.js +25 -0
- package/lib/seam/connect/models/action-attempts/set-heat-cool.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/set-heat.d.ts +71 -0
- package/lib/seam/connect/models/action-attempts/set-heat.js +25 -0
- package/lib/seam/connect/models/action-attempts/set-heat.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/set-thermostat-off.d.ts +71 -0
- package/lib/seam/connect/models/action-attempts/set-thermostat-off.js +25 -0
- package/lib/seam/connect/models/action-attempts/set-thermostat-off.js.map +1 -0
- package/lib/seam/connect/models/action-attempts/unlock-door.d.ts +72 -0
- package/lib/seam/connect/models/action-attempts/unlock-door.js +25 -0
- package/lib/seam/connect/models/action-attempts/unlock-door.js.map +1 -0
- package/lib/seam/connect/models/devices/managed-device.js +6 -2
- package/lib/seam/connect/models/devices/managed-device.js.map +1 -1
- package/lib/seam/connect/models/events/access-codes.d.ts +1 -1
- package/lib/seam/connect/models/events/access-codes.js +1 -1
- package/lib/seam/connect/models/events/access-codes.js.map +1 -1
- package/lib/seam/connect/models/events/acs/common.d.ts +1 -1
- package/lib/seam/connect/models/events/acs/common.js +1 -1
- package/lib/seam/connect/models/events/acs/common.js.map +1 -1
- package/lib/seam/connect/models/events/acs/credentials.d.ts +1 -1
- package/lib/seam/connect/models/events/acs/credentials.js +1 -1
- package/lib/seam/connect/models/events/acs/credentials.js.map +1 -1
- package/lib/seam/connect/models/events/acs/users.d.ts +1 -1
- package/lib/seam/connect/models/events/acs/users.js +1 -1
- package/lib/seam/connect/models/events/acs/users.js.map +1 -1
- package/lib/seam/connect/models/events/action-attempts.d.ts +10 -10
- package/lib/seam/connect/models/events/client-sessions.d.ts +1 -1
- package/lib/seam/connect/models/events/client-sessions.js +1 -1
- package/lib/seam/connect/models/events/client-sessions.js.map +1 -1
- package/lib/seam/connect/models/events/common.d.ts +1 -1
- package/lib/seam/connect/models/events/common.js +1 -1
- package/lib/seam/connect/models/events/common.js.map +1 -1
- package/lib/seam/connect/models/events/connected-accounts.d.ts +1 -1
- package/lib/seam/connect/models/events/connected-accounts.js +1 -1
- package/lib/seam/connect/models/events/connected-accounts.js.map +1 -1
- package/lib/seam/connect/models/events/devices.d.ts +1 -1
- package/lib/seam/connect/models/events/devices.js +1 -1
- package/lib/seam/connect/models/events/devices.js.map +1 -1
- package/lib/seam/connect/models/events/enrollment-automations.d.ts +1 -1
- package/lib/seam/connect/models/events/enrollment-automations.js +1 -1
- package/lib/seam/connect/models/events/enrollment-automations.js.map +1 -1
- package/lib/seam/connect/models/events/phones.d.ts +1 -1
- package/lib/seam/connect/models/events/phones.js +1 -1
- package/lib/seam/connect/models/events/phones.js.map +1 -1
- package/lib/seam/connect/models/events/seam-event.d.ts +1 -1
- package/lib/seam/connect/models/events/seam-event.js +1 -1
- package/lib/seam/connect/models/events/seam-event.js.map +1 -1
- package/lib/seam/connect/models/index.d.ts +1 -0
- package/lib/seam/connect/models/index.js +1 -0
- package/lib/seam/connect/models/index.js.map +1 -1
- package/lib/seam/connect/openapi.d.ts +116 -4
- package/lib/seam/connect/openapi.js +999 -11
- package/lib/seam/connect/openapi.js.map +1 -1
- package/lib/seam/connect/route-types.d.ts +11960 -2324
- package/lib/seam/connect/schemas.d.ts +1 -1
- package/lib/seam/connect/schemas.js +1 -1
- package/lib/seam/connect/schemas.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/seam/connect/model-types.ts +1 -0
- package/src/lib/seam/connect/models/action-attempts/action-attempt.ts +25 -0
- package/src/lib/seam/connect/models/action-attempts/common.ts +27 -0
- package/src/lib/seam/connect/models/action-attempts/deprecated.ts +122 -0
- package/src/lib/seam/connect/models/action-attempts/index.ts +1 -0
- package/src/lib/seam/connect/models/action-attempts/lock-door.ts +35 -0
- package/src/lib/seam/connect/models/action-attempts/reset-sandbox-workspace.ts +39 -0
- package/src/lib/seam/connect/models/action-attempts/set-cool.ts +33 -0
- package/src/lib/seam/connect/models/action-attempts/set-fan-mode.ts +33 -0
- package/src/lib/seam/connect/models/action-attempts/set-heat-cool.ts +33 -0
- package/src/lib/seam/connect/models/action-attempts/set-heat.ts +33 -0
- package/src/lib/seam/connect/models/action-attempts/set-thermostat-off.ts +36 -0
- package/src/lib/seam/connect/models/action-attempts/unlock-door.ts +35 -0
- package/src/lib/seam/connect/models/devices/managed-device.ts +8 -2
- package/src/lib/seam/connect/models/events/access-codes.ts +1 -1
- package/src/lib/seam/connect/models/events/acs/common.ts +1 -1
- package/src/lib/seam/connect/models/events/acs/credentials.ts +1 -1
- package/src/lib/seam/connect/models/events/acs/users.ts +1 -1
- package/src/lib/seam/connect/models/events/client-sessions.ts +1 -1
- package/src/lib/seam/connect/models/events/common.ts +1 -1
- package/src/lib/seam/connect/models/events/connected-accounts.ts +1 -1
- package/src/lib/seam/connect/models/events/devices.ts +1 -1
- package/src/lib/seam/connect/models/events/enrollment-automations.ts +1 -1
- package/src/lib/seam/connect/models/events/phones.ts +1 -1
- package/src/lib/seam/connect/models/events/seam-event.ts +1 -1
- package/src/lib/seam/connect/models/index.ts +1 -0
- package/src/lib/seam/connect/openapi.ts +1044 -11
- package/src/lib/seam/connect/route-types.ts +13034 -2684
- package/src/lib/seam/connect/schemas.ts +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export { connect_webview, custom_metadata, seam_event } from './models/index.js';
|
|
1
|
+
export { action_attempt, connect_webview, custom_metadata, seam_event, } from './models/index.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { connect_webview, custom_metadata, seam_event } from './models/index.js';
|
|
1
|
+
export { action_attempt, connect_webview, custom_metadata, seam_event, } from './models/index.js';
|
|
2
2
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/lib/seam/connect/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EACf,eAAe,EACf,UAAU,GACX,MAAM,mBAAmB,CAAA"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import { deprecated_action_attempts } from './deprecated.js'
|
|
4
|
+
import { lock_door_action_attempt } from './lock-door.js'
|
|
5
|
+
import { reset_sandbox_workspace_action_attempt } from './reset-sandbox-workspace.js'
|
|
6
|
+
import { set_cool_action_attempt } from './set-cool.js'
|
|
7
|
+
import { set_fan_mode_action_attempt } from './set-fan-mode.js'
|
|
8
|
+
import { set_heat_action_attempt } from './set-heat.js'
|
|
9
|
+
import { set_heat_cool_action_attempt } from './set-heat-cool.js'
|
|
10
|
+
import { set_thermostat_off_action_attempt } from './set-thermostat-off.js'
|
|
11
|
+
import { unlock_door_action_attempt } from './unlock-door.js'
|
|
12
|
+
|
|
13
|
+
export const action_attempt = z.union([
|
|
14
|
+
...lock_door_action_attempt.options,
|
|
15
|
+
...unlock_door_action_attempt.options,
|
|
16
|
+
...reset_sandbox_workspace_action_attempt.options,
|
|
17
|
+
...set_cool_action_attempt.options,
|
|
18
|
+
...set_heat_action_attempt.options,
|
|
19
|
+
...set_heat_cool_action_attempt.options,
|
|
20
|
+
...set_fan_mode_action_attempt.options,
|
|
21
|
+
...set_thermostat_off_action_attempt.options,
|
|
22
|
+
...deprecated_action_attempts,
|
|
23
|
+
])
|
|
24
|
+
|
|
25
|
+
export type ActionAttempt = z.infer<typeof action_attempt>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const common_action_attempt = z.object({
|
|
4
|
+
action_attempt_id: z.string().uuid().describe(`
|
|
5
|
+
---
|
|
6
|
+
title: Action Attempt ID
|
|
7
|
+
---
|
|
8
|
+
The ID of the action attempt.
|
|
9
|
+
`),
|
|
10
|
+
status: z.enum(['pending', 'success', 'error']),
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export const common_pending_action_attempt = common_action_attempt.extend({
|
|
14
|
+
status: z.literal('pending'),
|
|
15
|
+
result: z.null(),
|
|
16
|
+
error: z.null(),
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
export const common_succeeded_action_attempt = common_action_attempt.extend({
|
|
20
|
+
status: z.literal('success'),
|
|
21
|
+
error: z.null(),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export const common_failed_action_attempt = common_action_attempt.extend({
|
|
25
|
+
status: z.literal('error'),
|
|
26
|
+
result: z.null(),
|
|
27
|
+
})
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
common_failed_action_attempt,
|
|
5
|
+
common_pending_action_attempt,
|
|
6
|
+
common_succeeded_action_attempt,
|
|
7
|
+
} from './common.js'
|
|
8
|
+
|
|
9
|
+
const error = z.object({
|
|
10
|
+
type: z.string(),
|
|
11
|
+
message: z.string(),
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
const result = z.any()
|
|
15
|
+
|
|
16
|
+
const sync_access_codes_action_attempt = z.discriminatedUnion('status', [
|
|
17
|
+
common_pending_action_attempt.extend({
|
|
18
|
+
action_type: z.literal('SYNC_ACCESS_CODES'),
|
|
19
|
+
}),
|
|
20
|
+
common_succeeded_action_attempt.extend({
|
|
21
|
+
action_type: z.literal('SYNC_ACCESS_CODES'),
|
|
22
|
+
result,
|
|
23
|
+
}),
|
|
24
|
+
common_failed_action_attempt.extend({
|
|
25
|
+
action_type: z.literal('SYNC_ACCESS_CODES'),
|
|
26
|
+
error,
|
|
27
|
+
}),
|
|
28
|
+
])
|
|
29
|
+
|
|
30
|
+
const create_access_code_action_attempt = z.discriminatedUnion('status', [
|
|
31
|
+
common_pending_action_attempt.extend({
|
|
32
|
+
action_type: z.literal('CREATE_ACCESS_CODE'),
|
|
33
|
+
}),
|
|
34
|
+
common_succeeded_action_attempt.extend({
|
|
35
|
+
action_type: z.literal('CREATE_ACCESS_CODE'),
|
|
36
|
+
result,
|
|
37
|
+
}),
|
|
38
|
+
common_failed_action_attempt.extend({
|
|
39
|
+
action_type: z.literal('CREATE_ACCESS_CODE'),
|
|
40
|
+
error,
|
|
41
|
+
}),
|
|
42
|
+
])
|
|
43
|
+
|
|
44
|
+
const delete_access_code_action_attempt = z.discriminatedUnion('status', [
|
|
45
|
+
common_pending_action_attempt.extend({
|
|
46
|
+
action_type: z.literal('DELETE_ACCESS_CODE'),
|
|
47
|
+
}),
|
|
48
|
+
common_succeeded_action_attempt.extend({
|
|
49
|
+
action_type: z.literal('DELETE_ACCESS_CODE'),
|
|
50
|
+
result,
|
|
51
|
+
}),
|
|
52
|
+
common_failed_action_attempt.extend({
|
|
53
|
+
action_type: z.literal('DELETE_ACCESS_CODE'),
|
|
54
|
+
error,
|
|
55
|
+
}),
|
|
56
|
+
])
|
|
57
|
+
|
|
58
|
+
const update_access_code_action_attempt = z.discriminatedUnion('status', [
|
|
59
|
+
common_pending_action_attempt.extend({
|
|
60
|
+
action_type: z.literal('UPDATE_ACCESS_CODE'),
|
|
61
|
+
}),
|
|
62
|
+
common_succeeded_action_attempt.extend({
|
|
63
|
+
action_type: z.literal('UPDATE_ACCESS_CODE'),
|
|
64
|
+
result,
|
|
65
|
+
}),
|
|
66
|
+
common_failed_action_attempt.extend({
|
|
67
|
+
action_type: z.literal('UPDATE_ACCESS_CODE'),
|
|
68
|
+
error,
|
|
69
|
+
}),
|
|
70
|
+
])
|
|
71
|
+
|
|
72
|
+
const create_noise_threshold_action_attempt = z.discriminatedUnion('status', [
|
|
73
|
+
common_pending_action_attempt.extend({
|
|
74
|
+
action_type: z.literal('CREATE_NOISE_THRESHOLD'),
|
|
75
|
+
}),
|
|
76
|
+
common_succeeded_action_attempt.extend({
|
|
77
|
+
action_type: z.literal('CREATE_NOISE_THRESHOLD'),
|
|
78
|
+
result,
|
|
79
|
+
}),
|
|
80
|
+
common_failed_action_attempt.extend({
|
|
81
|
+
action_type: z.literal('CREATE_NOISE_THRESHOLD'),
|
|
82
|
+
error,
|
|
83
|
+
}),
|
|
84
|
+
])
|
|
85
|
+
|
|
86
|
+
const delete_noise_threshold_action_attempt = z.discriminatedUnion('status', [
|
|
87
|
+
common_pending_action_attempt.extend({
|
|
88
|
+
action_type: z.literal('DELETE_NOISE_THRESHOLD'),
|
|
89
|
+
}),
|
|
90
|
+
common_succeeded_action_attempt.extend({
|
|
91
|
+
action_type: z.literal('DELETE_NOISE_THRESHOLD'),
|
|
92
|
+
result,
|
|
93
|
+
}),
|
|
94
|
+
common_failed_action_attempt.extend({
|
|
95
|
+
action_type: z.literal('DELETE_NOISE_THRESHOLD'),
|
|
96
|
+
error,
|
|
97
|
+
}),
|
|
98
|
+
])
|
|
99
|
+
|
|
100
|
+
const update_noise_threshold_action_attempt = z.discriminatedUnion('status', [
|
|
101
|
+
common_pending_action_attempt.extend({
|
|
102
|
+
action_type: z.literal('UPDATE_NOISE_THRESHOLD'),
|
|
103
|
+
}),
|
|
104
|
+
common_succeeded_action_attempt.extend({
|
|
105
|
+
action_type: z.literal('UPDATE_NOISE_THRESHOLD'),
|
|
106
|
+
result,
|
|
107
|
+
}),
|
|
108
|
+
common_failed_action_attempt.extend({
|
|
109
|
+
action_type: z.literal('UPDATE_NOISE_THRESHOLD'),
|
|
110
|
+
error,
|
|
111
|
+
}),
|
|
112
|
+
])
|
|
113
|
+
|
|
114
|
+
export const deprecated_action_attempts = [
|
|
115
|
+
...sync_access_codes_action_attempt.options,
|
|
116
|
+
...create_access_code_action_attempt.options,
|
|
117
|
+
...delete_access_code_action_attempt.options,
|
|
118
|
+
...update_access_code_action_attempt.options,
|
|
119
|
+
...create_noise_threshold_action_attempt.options,
|
|
120
|
+
...delete_noise_threshold_action_attempt.options,
|
|
121
|
+
...update_noise_threshold_action_attempt.options,
|
|
122
|
+
] as const
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './action-attempt.js'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
common_failed_action_attempt,
|
|
5
|
+
common_pending_action_attempt,
|
|
6
|
+
common_succeeded_action_attempt,
|
|
7
|
+
} from './common.js'
|
|
8
|
+
|
|
9
|
+
const action_type = z.literal('LOCK_DOOR')
|
|
10
|
+
|
|
11
|
+
const error = z.object({
|
|
12
|
+
type: z.string(),
|
|
13
|
+
message: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const result = z.object({})
|
|
17
|
+
|
|
18
|
+
export const lock_door_action_attempt = z.discriminatedUnion('status', [
|
|
19
|
+
common_pending_action_attempt
|
|
20
|
+
.extend({
|
|
21
|
+
action_type,
|
|
22
|
+
})
|
|
23
|
+
.describe('Locking door.'),
|
|
24
|
+
common_succeeded_action_attempt
|
|
25
|
+
.extend({
|
|
26
|
+
action_type,
|
|
27
|
+
result,
|
|
28
|
+
})
|
|
29
|
+
.describe('Locking door succeeded.'),
|
|
30
|
+
common_failed_action_attempt
|
|
31
|
+
.extend({ action_type, error })
|
|
32
|
+
.describe('Locking door failed.'),
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
export type LockDoorActionAttempt = z.infer<typeof lock_door_action_attempt>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
common_failed_action_attempt,
|
|
5
|
+
common_pending_action_attempt,
|
|
6
|
+
common_succeeded_action_attempt,
|
|
7
|
+
} from './common.js'
|
|
8
|
+
|
|
9
|
+
const action_type = z.literal('RESET_SANDBOX_WORKSPACE')
|
|
10
|
+
|
|
11
|
+
const error = z.object({
|
|
12
|
+
type: z.string(),
|
|
13
|
+
message: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const result = z.object({})
|
|
17
|
+
|
|
18
|
+
export const reset_sandbox_workspace_action_attempt = z.discriminatedUnion(
|
|
19
|
+
'status',
|
|
20
|
+
[
|
|
21
|
+
common_pending_action_attempt
|
|
22
|
+
.extend({
|
|
23
|
+
action_type,
|
|
24
|
+
})
|
|
25
|
+
.describe('Resetting sandbox workspace.'),
|
|
26
|
+
common_succeeded_action_attempt
|
|
27
|
+
.extend({
|
|
28
|
+
action_type,
|
|
29
|
+
result,
|
|
30
|
+
})
|
|
31
|
+
.describe('Resetting sandbox workspace succeeded.'),
|
|
32
|
+
common_failed_action_attempt
|
|
33
|
+
.extend({
|
|
34
|
+
action_type,
|
|
35
|
+
error,
|
|
36
|
+
})
|
|
37
|
+
.describe('Resetting sandbox workspace failed.'),
|
|
38
|
+
],
|
|
39
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
common_failed_action_attempt,
|
|
5
|
+
common_pending_action_attempt,
|
|
6
|
+
common_succeeded_action_attempt,
|
|
7
|
+
} from './common.js'
|
|
8
|
+
|
|
9
|
+
const action_type = z.literal('SET_COOL')
|
|
10
|
+
|
|
11
|
+
const error = z.object({
|
|
12
|
+
type: z.string(),
|
|
13
|
+
message: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const result = z.object({})
|
|
17
|
+
|
|
18
|
+
export const set_cool_action_attempt = z.discriminatedUnion('status', [
|
|
19
|
+
common_pending_action_attempt
|
|
20
|
+
.extend({
|
|
21
|
+
action_type,
|
|
22
|
+
})
|
|
23
|
+
.describe('Setting HVAC to cool.'),
|
|
24
|
+
common_succeeded_action_attempt
|
|
25
|
+
.extend({
|
|
26
|
+
action_type,
|
|
27
|
+
result,
|
|
28
|
+
})
|
|
29
|
+
.describe('Setting HVAC to cool succeeded.'),
|
|
30
|
+
common_failed_action_attempt
|
|
31
|
+
.extend({ action_type, error })
|
|
32
|
+
.describe('Setting HVAC to cool failed.'),
|
|
33
|
+
])
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
common_failed_action_attempt,
|
|
5
|
+
common_pending_action_attempt,
|
|
6
|
+
common_succeeded_action_attempt,
|
|
7
|
+
} from './common.js'
|
|
8
|
+
|
|
9
|
+
const action_type = z.literal('SET_FAN_MODE')
|
|
10
|
+
|
|
11
|
+
const error = z.object({
|
|
12
|
+
type: z.string(),
|
|
13
|
+
message: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const result = z.object({})
|
|
17
|
+
|
|
18
|
+
export const set_fan_mode_action_attempt = z.discriminatedUnion('status', [
|
|
19
|
+
common_pending_action_attempt
|
|
20
|
+
.extend({
|
|
21
|
+
action_type,
|
|
22
|
+
})
|
|
23
|
+
.describe('Setting fan mode.'),
|
|
24
|
+
common_succeeded_action_attempt
|
|
25
|
+
.extend({
|
|
26
|
+
action_type,
|
|
27
|
+
result,
|
|
28
|
+
})
|
|
29
|
+
.describe('Setting fan mode succeeded.'),
|
|
30
|
+
common_failed_action_attempt
|
|
31
|
+
.extend({ action_type, error })
|
|
32
|
+
.describe('Setting fan mode failed.'),
|
|
33
|
+
])
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
common_failed_action_attempt,
|
|
5
|
+
common_pending_action_attempt,
|
|
6
|
+
common_succeeded_action_attempt,
|
|
7
|
+
} from './common.js'
|
|
8
|
+
|
|
9
|
+
const action_type = z.literal('SET_HEAT_COOL')
|
|
10
|
+
|
|
11
|
+
const error = z.object({
|
|
12
|
+
type: z.string(),
|
|
13
|
+
message: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const result = z.object({})
|
|
17
|
+
|
|
18
|
+
export const set_heat_cool_action_attempt = z.discriminatedUnion('status', [
|
|
19
|
+
common_pending_action_attempt
|
|
20
|
+
.extend({
|
|
21
|
+
action_type,
|
|
22
|
+
})
|
|
23
|
+
.describe('Setting HVAC to heat-cool mode.'),
|
|
24
|
+
common_succeeded_action_attempt
|
|
25
|
+
.extend({
|
|
26
|
+
action_type,
|
|
27
|
+
result,
|
|
28
|
+
})
|
|
29
|
+
.describe('Setting HVAC to heat-cool mode succeeded.'),
|
|
30
|
+
common_failed_action_attempt
|
|
31
|
+
.extend({ action_type, error })
|
|
32
|
+
.describe('Setting heat-cool mode failed.'),
|
|
33
|
+
])
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
common_failed_action_attempt,
|
|
5
|
+
common_pending_action_attempt,
|
|
6
|
+
common_succeeded_action_attempt,
|
|
7
|
+
} from './common.js'
|
|
8
|
+
|
|
9
|
+
const action_type = z.literal('SET_HEAT')
|
|
10
|
+
|
|
11
|
+
const error = z.object({
|
|
12
|
+
type: z.string(),
|
|
13
|
+
message: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const result = z.object({})
|
|
17
|
+
|
|
18
|
+
export const set_heat_action_attempt = z.discriminatedUnion('status', [
|
|
19
|
+
common_pending_action_attempt
|
|
20
|
+
.extend({
|
|
21
|
+
action_type,
|
|
22
|
+
})
|
|
23
|
+
.describe('Setting HVAC to heat mode.'),
|
|
24
|
+
common_succeeded_action_attempt
|
|
25
|
+
.extend({
|
|
26
|
+
action_type,
|
|
27
|
+
result,
|
|
28
|
+
})
|
|
29
|
+
.describe('Setting HVAC to heat mode succeeded.'),
|
|
30
|
+
common_failed_action_attempt
|
|
31
|
+
.extend({ action_type, error })
|
|
32
|
+
.describe('Setting HVAC to heat mode failed.'),
|
|
33
|
+
])
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
common_failed_action_attempt,
|
|
5
|
+
common_pending_action_attempt,
|
|
6
|
+
common_succeeded_action_attempt,
|
|
7
|
+
} from './common.js'
|
|
8
|
+
|
|
9
|
+
const action_type = z.literal('SET_THERMOSTAT_OFF')
|
|
10
|
+
|
|
11
|
+
const error = z.object({
|
|
12
|
+
type: z.string(),
|
|
13
|
+
message: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const result = z.object({})
|
|
17
|
+
|
|
18
|
+
export const set_thermostat_off_action_attempt = z.discriminatedUnion(
|
|
19
|
+
'status',
|
|
20
|
+
[
|
|
21
|
+
common_pending_action_attempt
|
|
22
|
+
.extend({
|
|
23
|
+
action_type,
|
|
24
|
+
})
|
|
25
|
+
.describe('Turning HVAC off.'),
|
|
26
|
+
common_succeeded_action_attempt
|
|
27
|
+
.extend({
|
|
28
|
+
action_type,
|
|
29
|
+
result,
|
|
30
|
+
})
|
|
31
|
+
.describe('Turning HVAC off succeeded.'),
|
|
32
|
+
common_failed_action_attempt
|
|
33
|
+
.extend({ action_type, error })
|
|
34
|
+
.describe('Turning HVAC off failed.'),
|
|
35
|
+
],
|
|
36
|
+
)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
common_failed_action_attempt,
|
|
5
|
+
common_pending_action_attempt,
|
|
6
|
+
common_succeeded_action_attempt,
|
|
7
|
+
} from './common.js'
|
|
8
|
+
|
|
9
|
+
const action_type = z.literal('UNLOCK_DOOR')
|
|
10
|
+
|
|
11
|
+
const error = z.object({
|
|
12
|
+
type: z.string(),
|
|
13
|
+
message: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const result = z.object({})
|
|
17
|
+
|
|
18
|
+
export const unlock_door_action_attempt = z.discriminatedUnion('status', [
|
|
19
|
+
common_pending_action_attempt
|
|
20
|
+
.extend({
|
|
21
|
+
action_type,
|
|
22
|
+
})
|
|
23
|
+
.describe('Unlocking door.'),
|
|
24
|
+
common_succeeded_action_attempt
|
|
25
|
+
.extend({
|
|
26
|
+
action_type,
|
|
27
|
+
result,
|
|
28
|
+
})
|
|
29
|
+
.describe('Unlocking door succeeded.'),
|
|
30
|
+
common_failed_action_attempt
|
|
31
|
+
.extend({ action_type, error })
|
|
32
|
+
.describe('Unlocking door failed.'),
|
|
33
|
+
])
|
|
34
|
+
|
|
35
|
+
export type UnlockDoorActionAttempt = z.infer<typeof unlock_door_action_attempt>
|
|
@@ -77,7 +77,13 @@ export const common_device_properties = z.object({
|
|
|
77
77
|
accessory_keypad_supported: z
|
|
78
78
|
.boolean()
|
|
79
79
|
.optional()
|
|
80
|
-
.describe(
|
|
80
|
+
.describe(
|
|
81
|
+
`
|
|
82
|
+
---
|
|
83
|
+
deprecated: use device.properties.model.can_connect_accessory_keypad
|
|
84
|
+
---
|
|
85
|
+
`,
|
|
86
|
+
),
|
|
81
87
|
}),
|
|
82
88
|
has_direct_power: z
|
|
83
89
|
.boolean()
|
|
@@ -128,7 +134,7 @@ export const common_device_properties = z.object({
|
|
|
128
134
|
.describe(
|
|
129
135
|
`
|
|
130
136
|
---
|
|
131
|
-
deprecated: use model.
|
|
137
|
+
deprecated: use device.properties.model.can_connect_accessory_keypad
|
|
132
138
|
---
|
|
133
139
|
`,
|
|
134
140
|
)
|