@seamapi/types 1.358.0 → 1.360.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 +532 -11
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +2726 -1075
- package/lib/seam/connect/model-types.d.ts +1 -1
- package/lib/seam/connect/models/access-codes/managed-access-code.d.ts +100 -0
- package/lib/seam/connect/models/access-codes/unmanaged-access-code.d.ts +100 -0
- package/lib/seam/connect/models/acs/acs-access-group.d.ts +14 -14
- package/lib/seam/connect/models/acs/acs-credential.d.ts +74 -74
- package/lib/seam/connect/models/acs/acs-encoder.d.ts +8 -8
- package/lib/seam/connect/models/acs/acs-system.d.ts +72 -72
- package/lib/seam/connect/models/acs/acs-user.d.ts +104 -104
- package/lib/seam/connect/models/action-attempts/action-attempt.d.ts +168 -168
- package/lib/seam/connect/models/action-attempts/encode-credential.d.ts +72 -72
- package/lib/seam/connect/models/action-attempts/scan-credential.d.ts +96 -96
- package/lib/seam/connect/models/connect-webviews/connect-webview.d.ts +2 -2
- package/lib/seam/connect/models/connected-accounts/connected-account.d.ts +634 -21
- package/lib/seam/connect/models/connected-accounts/connected-account.js +56 -0
- package/lib/seam/connect/models/connected-accounts/connected-account.js.map +1 -1
- package/lib/seam/connect/models/devices/device-metadata.d.ts +24 -24
- package/lib/seam/connect/models/devices/device.d.ts +146 -46
- package/lib/seam/connect/models/devices/unmanaged-device.d.ts +127 -27
- package/lib/seam/connect/models/events/access-codes.d.ts +68 -68
- package/lib/seam/connect/models/events/connect-webviews.d.ts +4 -4
- package/lib/seam/connect/models/events/connected-accounts.d.ts +28 -28
- package/lib/seam/connect/models/events/devices.d.ts +188 -128
- package/lib/seam/connect/models/events/devices.js +10 -0
- package/lib/seam/connect/models/events/devices.js.map +1 -1
- package/lib/seam/connect/models/events/seam-event.d.ts +144 -115
- package/lib/seam/connect/openapi.d.ts +482 -4
- package/lib/seam/connect/openapi.js +469 -2
- package/lib/seam/connect/openapi.js.map +1 -1
- package/lib/seam/connect/route-types.d.ts +601 -2
- package/package.json +2 -2
- package/src/lib/seam/connect/model-types.ts +0 -2
- package/src/lib/seam/connect/models/connected-accounts/connected-account.ts +77 -2
- package/src/lib/seam/connect/models/events/devices.ts +13 -0
- package/src/lib/seam/connect/openapi.ts +502 -2
- package/src/lib/seam/connect/route-types.ts +633 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamapi/types",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.360.0",
|
|
4
4
|
"description": "TypeScript types for the Seam API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"zod": "^3.21.4"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@seamapi/blueprint": "^0.
|
|
95
|
+
"@seamapi/blueprint": "^0.37.1",
|
|
96
96
|
"@types/node": "^20.8.10",
|
|
97
97
|
"concurrently": "^8.2.0",
|
|
98
98
|
"del-cli": "^5.0.0",
|
|
@@ -3,6 +3,10 @@ import { z } from 'zod'
|
|
|
3
3
|
import { custom_metadata } from '../custom-metadata.js'
|
|
4
4
|
|
|
5
5
|
const common_connected_account_error = z.object({
|
|
6
|
+
created_at: z
|
|
7
|
+
.string()
|
|
8
|
+
.datetime()
|
|
9
|
+
.describe('Date and time at which Seam created the error.'),
|
|
6
10
|
message: z.string(),
|
|
7
11
|
is_connected_account_error: z.literal(true),
|
|
8
12
|
})
|
|
@@ -14,6 +18,10 @@ const warning_code_description =
|
|
|
14
18
|
'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.'
|
|
15
19
|
|
|
16
20
|
const common_connected_account_warning = z.object({
|
|
21
|
+
created_at: z
|
|
22
|
+
.string()
|
|
23
|
+
.datetime()
|
|
24
|
+
.describe('Date and time at which Seam created the warning.'),
|
|
17
25
|
message: z.string(),
|
|
18
26
|
})
|
|
19
27
|
|
|
@@ -33,12 +41,44 @@ export const invalid_credentials = common_connected_account_error
|
|
|
33
41
|
})
|
|
34
42
|
.describe('Credentials provided were invalid.')
|
|
35
43
|
|
|
44
|
+
export const salto_ks_subscription_limit_exceeded =
|
|
45
|
+
common_connected_account_error
|
|
46
|
+
.extend({
|
|
47
|
+
error_code: z
|
|
48
|
+
.literal('salto_ks_subscription_limit_exceeded')
|
|
49
|
+
.describe(error_code_description),
|
|
50
|
+
salto_ks_metadata: z.object({
|
|
51
|
+
sites: z.array(
|
|
52
|
+
z.object({
|
|
53
|
+
site_id: z.string(),
|
|
54
|
+
site_name: z.string(),
|
|
55
|
+
subscribed_site_user_count: z.number().int().min(0),
|
|
56
|
+
site_user_subscription_limit: z.number().int().min(0),
|
|
57
|
+
}),
|
|
58
|
+
),
|
|
59
|
+
}),
|
|
60
|
+
})
|
|
61
|
+
.describe(
|
|
62
|
+
'Indicates that the maximum number of users allowed for the site has been reached. This means that new access codes cannot be created. Contact Salto support to increase the user limit.',
|
|
63
|
+
)
|
|
64
|
+
|
|
36
65
|
export const connected_account_error = z.discriminatedUnion('error_code', [
|
|
37
66
|
account_disconnected,
|
|
38
67
|
invalid_credentials,
|
|
68
|
+
salto_ks_subscription_limit_exceeded,
|
|
39
69
|
])
|
|
40
70
|
|
|
41
|
-
|
|
71
|
+
const connected_account_error_map = z.object({
|
|
72
|
+
account_disconnected: account_disconnected.nullable().optional(),
|
|
73
|
+
invalid_credentials: invalid_credentials.nullable().optional(),
|
|
74
|
+
salto_ks_subscription_limit_exceeded: salto_ks_subscription_limit_exceeded
|
|
75
|
+
.nullable()
|
|
76
|
+
.optional(),
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
export type ConnectedAccountErrorMap = z.infer<
|
|
80
|
+
typeof connected_account_error_map
|
|
81
|
+
>
|
|
42
82
|
|
|
43
83
|
export const unknown_issue_with_connected_account =
|
|
44
84
|
common_connected_account_warning
|
|
@@ -60,14 +100,49 @@ const scheduled_maintenance_window = common_connected_account_warning
|
|
|
60
100
|
})
|
|
61
101
|
.describe('Scheduled downtime for account planned.')
|
|
62
102
|
|
|
103
|
+
const salto_ks_subscription_limit_almost_reached =
|
|
104
|
+
common_connected_account_warning
|
|
105
|
+
.extend({
|
|
106
|
+
warning_code: z
|
|
107
|
+
.literal('salto_ks_subscription_limit_almost_reached')
|
|
108
|
+
.describe(warning_code_description),
|
|
109
|
+
salto_ks_metadata: z.object({
|
|
110
|
+
sites: z.array(
|
|
111
|
+
z.object({
|
|
112
|
+
site_id: z.string(),
|
|
113
|
+
site_name: z.string(),
|
|
114
|
+
site_user_subscription_limit: z.number().int().min(0),
|
|
115
|
+
subscribed_site_user_count: z.number().int().min(0),
|
|
116
|
+
}),
|
|
117
|
+
),
|
|
118
|
+
}),
|
|
119
|
+
})
|
|
120
|
+
.describe(
|
|
121
|
+
'Indicates that the Salto KS site has exceeded 80% of the maximum number of allowed users. Please increase your subscription limit, or delete some users from your site to rectify this.',
|
|
122
|
+
)
|
|
123
|
+
|
|
63
124
|
const connected_account_warning = z
|
|
64
125
|
.discriminatedUnion('warning_code', [
|
|
65
126
|
scheduled_maintenance_window,
|
|
66
127
|
unknown_issue_with_connected_account,
|
|
128
|
+
salto_ks_subscription_limit_almost_reached,
|
|
67
129
|
])
|
|
68
130
|
.describe('Warning associated with the `connected_account`.')
|
|
69
131
|
|
|
70
|
-
|
|
132
|
+
const connected_account_warning_map = z.object({
|
|
133
|
+
scheduled_maintenance_window: scheduled_maintenance_window
|
|
134
|
+
.nullable()
|
|
135
|
+
.optional(),
|
|
136
|
+
unknown_issue_with_connected_account: unknown_issue_with_connected_account
|
|
137
|
+
.nullable()
|
|
138
|
+
.optional(),
|
|
139
|
+
salto_ks_subscription_limit_almost_reached:
|
|
140
|
+
salto_ks_subscription_limit_almost_reached.nullable().optional(),
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
export type ConnectedAccountWarningMap = z.infer<
|
|
144
|
+
typeof connected_account_warning_map
|
|
145
|
+
>
|
|
71
146
|
|
|
72
147
|
export const connected_account = z.object({
|
|
73
148
|
connected_account_id: z.string().uuid().optional(),
|
|
@@ -651,6 +651,18 @@ export const temperature_changed_event = device_event.extend({
|
|
|
651
651
|
|
|
652
652
|
export type TemperatureChangedEvent = z.infer<typeof temperature_changed_event>
|
|
653
653
|
|
|
654
|
+
export const device_name_changed_event = device_event.extend({
|
|
655
|
+
event_type: z.literal('device.name_changed'),
|
|
656
|
+
new_name: z.string().describe('The new name of the device.'),
|
|
657
|
+
}).describe(`
|
|
658
|
+
---
|
|
659
|
+
route_path: /devices
|
|
660
|
+
---
|
|
661
|
+
The name of a [device](https://docs.seam.co/latest/core-concepts/devices) was changed.
|
|
662
|
+
`)
|
|
663
|
+
|
|
664
|
+
export type DeviceNameChangedEvent = z.infer<typeof device_name_changed_event>
|
|
665
|
+
|
|
654
666
|
export const device_events = [
|
|
655
667
|
device_connected_event,
|
|
656
668
|
device_added_event,
|
|
@@ -684,4 +696,5 @@ export const device_events = [
|
|
|
684
696
|
temperature_threshold_no_longer_exceeded_event,
|
|
685
697
|
temperature_reached_set_point_event,
|
|
686
698
|
temperature_changed_event,
|
|
699
|
+
device_name_changed_event,
|
|
687
700
|
] as const
|