@seamapi/types 1.358.0 → 1.359.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.
Files changed (35) hide show
  1. package/dist/connect.cjs +467 -10
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +2286 -812
  4. package/lib/seam/connect/model-types.d.ts +1 -1
  5. package/lib/seam/connect/models/access-codes/managed-access-code.d.ts +100 -0
  6. package/lib/seam/connect/models/access-codes/unmanaged-access-code.d.ts +100 -0
  7. package/lib/seam/connect/models/acs/acs-access-group.d.ts +14 -14
  8. package/lib/seam/connect/models/acs/acs-credential.d.ts +74 -74
  9. package/lib/seam/connect/models/acs/acs-encoder.d.ts +8 -8
  10. package/lib/seam/connect/models/acs/acs-system.d.ts +72 -72
  11. package/lib/seam/connect/models/acs/acs-user.d.ts +104 -104
  12. package/lib/seam/connect/models/action-attempts/action-attempt.d.ts +168 -168
  13. package/lib/seam/connect/models/action-attempts/encode-credential.d.ts +72 -72
  14. package/lib/seam/connect/models/action-attempts/scan-credential.d.ts +96 -96
  15. package/lib/seam/connect/models/connect-webviews/connect-webview.d.ts +2 -2
  16. package/lib/seam/connect/models/connected-accounts/connected-account.d.ts +634 -21
  17. package/lib/seam/connect/models/connected-accounts/connected-account.js +56 -0
  18. package/lib/seam/connect/models/connected-accounts/connected-account.js.map +1 -1
  19. package/lib/seam/connect/models/devices/device-metadata.d.ts +24 -24
  20. package/lib/seam/connect/models/devices/device.d.ts +146 -46
  21. package/lib/seam/connect/models/devices/unmanaged-device.d.ts +127 -27
  22. package/lib/seam/connect/models/events/access-codes.d.ts +68 -68
  23. package/lib/seam/connect/models/events/connect-webviews.d.ts +4 -4
  24. package/lib/seam/connect/models/events/connected-accounts.d.ts +28 -28
  25. package/lib/seam/connect/models/events/devices.d.ts +128 -128
  26. package/lib/seam/connect/models/events/seam-event.d.ts +114 -114
  27. package/lib/seam/connect/openapi.d.ts +366 -4
  28. package/lib/seam/connect/openapi.js +415 -2
  29. package/lib/seam/connect/openapi.js.map +1 -1
  30. package/lib/seam/connect/route-types.d.ts +567 -0
  31. package/package.json +1 -1
  32. package/src/lib/seam/connect/model-types.ts +0 -2
  33. package/src/lib/seam/connect/models/connected-accounts/connected-account.ts +77 -2
  34. package/src/lib/seam/connect/openapi.ts +445 -2
  35. package/src/lib/seam/connect/route-types.ts +597 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.358.0",
3
+ "version": "1.359.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -12,8 +12,6 @@ export type {
12
12
  Bridge,
13
13
  ClientSession,
14
14
  ConnectedAccount,
15
- ConnectedAccountError,
16
- ConnectedAccountWarning,
17
15
  ConnectWebview,
18
16
  CustomMetadata,
19
17
  Device,
@@ -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
- export type ConnectedAccountError = z.infer<typeof connected_account_error>
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
- export type ConnectedAccountWarning = z.infer<typeof connected_account_warning>
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(),