@seamapi/types 1.177.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.177.0",
3
+ "version": "1.177.1",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod'
2
2
 
3
+ import { deprecated_action_attempts } from './deprecated.js'
3
4
  import { lock_door_action_attempt } from './lock-door.js'
4
5
  import { reset_sandbox_workspace_action_attempt } from './reset-sandbox-workspace.js'
5
6
  import { set_cool_action_attempt } from './set-cool.js'
@@ -18,8 +19,7 @@ export const action_attempt = z.union([
18
19
  ...set_heat_cool_action_attempt.options,
19
20
  ...set_fan_mode_action_attempt.options,
20
21
  ...set_thermostat_off_action_attempt.options,
22
+ ...deprecated_action_attempts,
21
23
  ])
22
24
 
23
25
  export type ActionAttempt = z.infer<typeof action_attempt>
24
-
25
- export type ActionAttemptType = ActionAttempt['action_type']
@@ -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