@seamapi/types 1.404.0 → 1.404.2

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.404.0",
3
+ "version": "1.404.2",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -9,15 +9,38 @@ export const connect_webview_device_selection_mode = z.enum([
9
9
  ])
10
10
 
11
11
  export const connect_webview = z.object({
12
- connect_webview_id: z.string().uuid(),
13
- workspace_id: z.string().uuid(),
14
- created_at: z.string().datetime(),
15
- connected_account_id: z.string().uuid().nullable(),
16
- url: z.string().url(),
12
+ connect_webview_id: z.string().uuid().describe('ID of the Connect Webview.'),
13
+ workspace_id: z
14
+ .string()
15
+ .uuid()
16
+ .describe(
17
+ 'ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces) that contains the Connect Webview.',
18
+ ),
19
+ created_at: z
20
+ .string()
21
+ .datetime()
22
+ .describe('Date and time at which the Connect Webview was created.'),
23
+ connected_account_id: z
24
+ .string()
25
+ .uuid()
26
+ .nullable()
27
+ .describe(
28
+ 'ID of the [connected account](https://docs.seam.co/latest/core-concepts/connected-accounts) associated with the Connect Webview.',
29
+ ),
30
+ url: z
31
+ .string()
32
+ .url()
33
+ .describe(
34
+ 'URL for the Connect Webview. You use the URL to display the Connect Webview flow to your user.',
35
+ ),
17
36
  device_selection_mode: connect_webview_device_selection_mode,
18
37
 
19
38
  // TODO: Use enum value.
20
- accepted_providers: z.array(z.string()),
39
+ accepted_providers: z
40
+ .array(z.string())
41
+ .describe(
42
+ 'List of accepted [provider keys](https://docs.seam.co/latest/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews).',
43
+ ),
21
44
 
22
45
  accepted_devices: z.array(z.string()).describe(
23
46
  `
@@ -36,16 +59,57 @@ export const connect_webview = z.object({
36
59
  `,
37
60
  ),
38
61
 
39
- any_provider_allowed: z.boolean(),
40
- login_successful: z.boolean(),
41
- status: z.enum(['pending', 'failed', 'authorized']),
42
- custom_redirect_url: z.string().url().nullable(),
43
- custom_redirect_failure_url: z.string().url().nullable(),
62
+ any_provider_allowed: z
63
+ .boolean()
64
+ .describe('Indicates whether any provider is allowed.'),
65
+ login_successful: z
66
+ .boolean()
67
+ .describe(
68
+ 'Indicates whether the user logged in successfully using the Connect Webview.',
69
+ ),
70
+ status: z
71
+ .enum(['pending', 'failed', 'authorized'])
72
+ .describe(
73
+ 'Status of the Connect Webview. `authorized` indicates that the user has successfully logged into their device or system account, thereby completing the Connect Webview.',
74
+ ),
75
+ custom_redirect_url: z
76
+ .string()
77
+ .url()
78
+ .nullable()
79
+ .describe(
80
+ 'URL to which the Connect Webview should redirect when the user successfully pairs a device or system. If you do not set the `custom_redirect_failure_url`, the Connect Webview redirects to the `custom_redirect_url` when an unexpected error occurs.',
81
+ ),
82
+ custom_redirect_failure_url: z
83
+ .string()
84
+ .url()
85
+ .nullable()
86
+ .describe(
87
+ 'URL to which the Connect Webview should redirect when an unexpected error occurs.',
88
+ ),
44
89
  custom_metadata,
45
- automatically_manage_new_devices: z.boolean(),
46
- wait_for_device_creation: z.boolean(),
47
- authorized_at: z.string().datetime().nullable(),
48
- selected_provider: z.string().nullable(),
90
+ automatically_manage_new_devices: z
91
+ .boolean()
92
+ .describe(
93
+ 'Indicates whether Seam should [import all new devices](https://docs.seam.co/latest/core-concepts/connect-webviews/customizing-connect-webviews#automatically_manage_new_devices) for the connected account to make these devices available for use and management by the Seam API.',
94
+ ),
95
+ wait_for_device_creation: z
96
+ .boolean()
97
+ .describe(
98
+ 'Indicates whether Seam should [finish syncing all devices](https://docs.seam.co/latest/core-concepts/connect-webviews/customizing-connect-webviews#wait_for_device_creation) in a newly-connected account before completing the associated Connect Webview.',
99
+ ),
100
+ authorized_at: z
101
+ .string()
102
+ .datetime()
103
+ .nullable()
104
+ .describe(
105
+ 'Date and time at which the user authorized (through the Connect Webview) the management of their devices.',
106
+ ),
107
+ selected_provider: z
108
+ .string()
109
+ .nullable()
110
+ .describe(
111
+ 'Selected provider of the Connect Webview, one of the [provider keys](https://docs.seam.co/latest/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews).',
112
+ ),
49
113
  }).describe(`
50
114
  ---
51
115
  route_path: /connect_webviews
@@ -7,9 +7,21 @@ const common_connected_account_error = z.object({
7
7
  .string()
8
8
  .datetime()
9
9
  .describe('Date and time at which Seam created the error.'),
10
- message: z.string(),
11
- is_connected_account_error: z.boolean().optional(),
12
- is_bridge_error: z.boolean().optional(),
10
+ message: z
11
+ .string()
12
+ .describe(
13
+ 'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
14
+ ),
15
+ is_connected_account_error: z
16
+ .boolean()
17
+ .optional()
18
+ .describe(
19
+ 'Indicates whether the error is related specifically to the connected account.',
20
+ ),
21
+ is_bridge_error: z
22
+ .boolean()
23
+ .optional()
24
+ .describe('Indicates whether the error is related to Seam Bridge.'),
13
25
  })
14
26
 
15
27
  const error_code_description =
@@ -23,7 +35,11 @@ const common_connected_account_warning = z.object({
23
35
  .string()
24
36
  .datetime()
25
37
  .describe('Date and time at which Seam created the warning.'),
26
- message: z.string(),
38
+ message: z
39
+ .string()
40
+ .describe(
41
+ 'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.',
42
+ ),
27
43
  })
28
44
 
29
45
  export const account_disconnected = common_connected_account_error
@@ -42,11 +58,15 @@ export const invalid_credentials = common_connected_account_error
42
58
  })
43
59
  .describe('Credentials provided were invalid.')
44
60
 
45
- export const bridge_disconnected = common_connected_account_error.extend({
46
- error_code: z.literal('bridge_disconnected').describe(error_code_description),
47
- })
48
- .describe(`Indicates that the Seam API cannot communicate with [Seam Bridge](https://docs.seam.co/latest/capability-guides/seam-bridge), for example, if Seam Bridge executable has stopped or if the computer running the Seam Bridge executable is offline.
49
- See also [Troubleshooting Your Access Control System](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system#acs_system.errors.seam_bridge_disconnected).`)
61
+ export const bridge_disconnected = common_connected_account_error
62
+ .extend({
63
+ error_code: z
64
+ .literal('bridge_disconnected')
65
+ .describe(error_code_description),
66
+ })
67
+ .describe(
68
+ 'Indicates that the Seam API cannot communicate with [Seam Bridge](https://docs.seam.co/latest/capability-guides/seam-bridge), for example, if Seam Bridge executable has stopped or if the computer running the Seam Bridge executable is offline. See also [Troubleshooting Your Access Control System](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system#acs_system.errors.seam_bridge_disconnected).',
69
+ )
50
70
 
51
71
  export const salto_ks_subscription_limit_exceeded =
52
72
  common_connected_account_error
@@ -54,16 +74,48 @@ export const salto_ks_subscription_limit_exceeded =
54
74
  error_code: z
55
75
  .literal('salto_ks_subscription_limit_exceeded')
56
76
  .describe(error_code_description),
57
- salto_ks_metadata: z.object({
58
- sites: z.array(
59
- z.object({
60
- site_id: z.string(),
61
- site_name: z.string(),
62
- subscribed_site_user_count: z.number().int().min(0),
63
- site_user_subscription_limit: z.number().int().min(0),
64
- }),
77
+ salto_ks_metadata: z
78
+ .object({
79
+ sites: z
80
+ .array(
81
+ z
82
+ .object({
83
+ site_id: z
84
+ .string()
85
+ .describe(
86
+ 'ID of a Salto site associated with the connected account that has an error.',
87
+ ),
88
+ site_name: z
89
+ .string()
90
+ .describe(
91
+ 'Name of a Salto site associated with the connected account that has an error.',
92
+ ),
93
+ subscribed_site_user_count: z
94
+ .number()
95
+ .int()
96
+ .min(0)
97
+ .describe(
98
+ 'Count of subscribed site users for a Salto site associated with the connected account that has an error.',
99
+ ),
100
+ site_user_subscription_limit: z
101
+ .number()
102
+ .int()
103
+ .min(0)
104
+ .describe(
105
+ 'Subscription limit of site users for a Salto site associated with the connected account that has an error.',
106
+ ),
107
+ })
108
+ .describe(
109
+ 'Salto site associated with the connected account that has an error.',
110
+ ),
111
+ )
112
+ .describe(
113
+ 'Salto sites associated with the connected account that has an error.',
114
+ ),
115
+ })
116
+ .describe(
117
+ 'Salto KS metadata associated with the connected account that has an error.',
65
118
  ),
66
- }),
67
119
  })
68
120
  .describe(
69
121
  '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.',
@@ -101,7 +153,7 @@ export const unknown_issue_with_connected_account =
101
153
  .describe(warning_code_description),
102
154
  })
103
155
  .describe(
104
- 'An unknown issue occurred while syncing the state of this connected account with the provider. This issue may affect the proper functioning of one or more resources in this account.',
156
+ 'An unknown issue occurred while syncing the state of the connected account with the provider. This issue may affect the proper functioning of one or more resources in the account.',
105
157
  )
106
158
 
107
159
  const scheduled_maintenance_window = common_connected_account_warning
@@ -110,7 +162,7 @@ const scheduled_maintenance_window = common_connected_account_warning
110
162
  .literal('scheduled_maintenance_window')
111
163
  .describe(warning_code_description),
112
164
  })
113
- .describe('Scheduled downtime for account planned.')
165
+ .describe('Scheduled downtime planned for the connected account.')
114
166
 
115
167
  const salto_ks_subscription_limit_almost_reached =
116
168
  common_connected_account_warning
@@ -118,19 +170,51 @@ const salto_ks_subscription_limit_almost_reached =
118
170
  warning_code: z
119
171
  .literal('salto_ks_subscription_limit_almost_reached')
120
172
  .describe(warning_code_description),
121
- salto_ks_metadata: z.object({
122
- sites: z.array(
123
- z.object({
124
- site_id: z.string(),
125
- site_name: z.string(),
126
- site_user_subscription_limit: z.number().int().min(0),
127
- subscribed_site_user_count: z.number().int().min(0),
128
- }),
173
+ salto_ks_metadata: z
174
+ .object({
175
+ sites: z
176
+ .array(
177
+ z
178
+ .object({
179
+ site_id: z
180
+ .string()
181
+ .describe(
182
+ 'ID of a Salto site associated with the connected account that has a warning.',
183
+ ),
184
+ site_name: z
185
+ .string()
186
+ .describe(
187
+ 'Name of a Salto site associated with the connected account that has a warning.',
188
+ ),
189
+ site_user_subscription_limit: z
190
+ .number()
191
+ .int()
192
+ .min(0)
193
+ .describe(
194
+ 'Subscription limit of site users for a Salto site associated with the connected account that has a warning.',
195
+ ),
196
+ subscribed_site_user_count: z
197
+ .number()
198
+ .int()
199
+ .min(0)
200
+ .describe(
201
+ 'Count of subscribed site users for a Salto site associated with the connected account that has a warning.',
202
+ ),
203
+ })
204
+ .describe(
205
+ 'Salto site associated with the connected account that has a warning.',
206
+ ),
207
+ )
208
+ .describe(
209
+ 'Salto sites associated with the connected account that has a warning.',
210
+ ),
211
+ })
212
+ .describe(
213
+ 'Salto KS metadata associated with the connected account that has a warning.',
129
214
  ),
130
- }),
131
215
  })
132
216
  .describe(
133
- '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.',
217
+ 'Indicates that the Salto KS site has exceeded 80% of the maximum number of allowed users. Increase your subscription limit or delete some users from your site.',
134
218
  )
135
219
 
136
220
  const connected_account_warning = z
@@ -139,7 +223,7 @@ const connected_account_warning = z
139
223
  unknown_issue_with_connected_account,
140
224
  salto_ks_subscription_limit_almost_reached,
141
225
  ])
142
- .describe('Warning associated with the `connected_account`.')
226
+ .describe('Warning associated with the connected account.')
143
227
 
144
228
  const connected_account_warning_map = z.object({
145
229
  scheduled_maintenance_window: scheduled_maintenance_window
@@ -157,23 +241,67 @@ export type ConnectedAccountWarningMap = z.infer<
157
241
  >
158
242
 
159
243
  export const connected_account = z.object({
160
- connected_account_id: z.string().uuid().optional(),
161
- created_at: z.string().datetime().optional(),
244
+ connected_account_id: z
245
+ .string()
246
+ .uuid()
247
+ .optional()
248
+ .describe('Unique identifier for the connected account.'),
249
+ created_at: z
250
+ .string()
251
+ .datetime()
252
+ .optional()
253
+ .describe('Date and time at which the connected account was created.'),
162
254
  user_identifier: z
163
255
  .object({
164
- username: z.string().optional(),
165
- api_url: z.string().optional(),
166
- email: z.string().optional(),
167
- phone: z.string().optional(),
168
- exclusive: z.boolean().optional(),
256
+ username: z
257
+ .string()
258
+ .optional()
259
+ .describe(
260
+ 'Username of the user identifier associated with the connected account.',
261
+ ),
262
+ api_url: z
263
+ .string()
264
+ .optional()
265
+ .describe(
266
+ 'API URL for the user identifier associated with the connected account.',
267
+ ),
268
+ email: z
269
+ .string()
270
+ .optional()
271
+ .describe(
272
+ 'Email address of the user identifier associated with the connected account.',
273
+ ),
274
+ phone: z
275
+ .string()
276
+ .optional()
277
+ .describe(
278
+ 'Phone number of the user identifier associated with the connected account.',
279
+ ),
280
+ exclusive: z
281
+ .boolean()
282
+ .optional()
283
+ .describe(
284
+ 'Indicates whether the user identifier associated with the connected account is exclusive.',
285
+ ),
169
286
  })
170
- .optional(),
171
- account_type: z.string().optional(),
172
- account_type_display_name: z.string(),
173
- errors: z.array(connected_account_error),
174
- warnings: z.array(connected_account_warning),
287
+ .optional()
288
+ .describe('User identifier associated with the connected account.'),
289
+ account_type: z.string().optional().describe('Type of connected account.'),
290
+ account_type_display_name: z
291
+ .string()
292
+ .describe('Display name for the connected account type.'),
293
+ errors: z
294
+ .array(connected_account_error)
295
+ .describe('Errors associated with the connected account.'),
296
+ warnings: z
297
+ .array(connected_account_warning)
298
+ .describe('Warnings associated with the connected account.'),
175
299
  custom_metadata,
176
- automatically_manage_new_devices: z.boolean(),
300
+ automatically_manage_new_devices: z
301
+ .boolean()
302
+ .describe(
303
+ 'Indicates whether Seam should [import all new devices](https://docs.seam.co/latest/core-concepts/connect-webviews/customizing-connect-webviews#automatically_manage_new_devices) for the connected account to make these devices available for use and management by the Seam API.',
304
+ ),
177
305
  }).describe(`
178
306
  ---
179
307
  route_path: /connected_accounts
@@ -8,11 +8,15 @@ export const custom_metadata_input = z
8
8
  .refine((val) => Object.keys(val).length <= 50, {
9
9
  message: 'Custom metadata is limited to a maximum of 50 keys',
10
10
  })
11
+ .describe(
12
+ 'Set of up to 50 key:value pairs, with key names up to 40 characters long. Accepts string or Boolean values. Strings are limited to 500 characters. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/latest/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/latest/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/latest/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application.',
13
+ )
11
14
 
12
- export const custom_metadata = z.record(
13
- z.string(),
14
- z.union([z.string(), z.boolean()]),
15
- )
15
+ export const custom_metadata = z
16
+ .record(z.string(), z.union([z.string(), z.boolean()]))
17
+ .describe(
18
+ 'Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/latest/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/latest/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/latest/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application.',
19
+ )
16
20
 
17
21
  export type CustomMetadata = z.output<typeof custom_metadata>
18
22