Skip to content

Commit dd13e04

Browse files
seambotrazor-x
andauthored
feat: Add acs_encoder removed error and event (#1250)
Co-authored-by: Evan Sosenko <evan@getseam.com>
1 parent efebca6 commit dd13e04

File tree

6 files changed

+128
-42
lines changed

6 files changed

+128
-42
lines changed

src/lib/seam/connect/models/acs/acs-encoder.ts

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,42 @@
11
import { z } from 'zod'
22

3+
const common_acs_encoder_error = z.object({
4+
created_at: z
5+
.string()
6+
.datetime()
7+
.describe('Date and time at which Seam created the error.'),
8+
message: z
9+
.string()
10+
.describe(
11+
'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
12+
),
13+
})
14+
15+
const error_code_description =
16+
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.'
17+
18+
const acs_encoder_removed = common_acs_encoder_error.extend({
19+
error_code: z.literal('acs_encoder_removed').describe(error_code_description),
20+
_event_id: z
21+
.string()
22+
.uuid()
23+
.describe(
24+
'ID of the event that was created when the `acs_encoder` was removed.',
25+
),
26+
})
27+
28+
const acs_encoder_error =
29+
// z.union([
30+
acs_encoder_removed
31+
// ])
32+
.describe('Error associated with the `acs_encoder`.')
33+
34+
export const acs_encoder_error_map = z.object({
35+
acs_encoder_removed: acs_encoder_removed.optional().nullable(),
36+
})
37+
38+
export type AcsEncoderErrorMap = z.infer<typeof acs_encoder_error_map>
39+
340
export const acs_encoder = z.object({
441
acs_encoder_id: z.string().uuid().describe('ID of the `acs_encoder`.'),
542
acs_system_id: z
@@ -14,12 +51,9 @@ export const acs_encoder = z.object({
1451
.describe(
1552
'ID of the [workspace](https://docs.seam.co/latest/core-concepts/workspaces) that contains the `acs_system`.',
1653
),
17-
errors: z.array(
18-
z.object({
19-
error_code: z.string(),
20-
message: z.string(),
21-
}),
22-
),
54+
errors: z
55+
.array(acs_encoder_error)
56+
.describe('Errors associated with the `acs_encoder`.'),
2357
created_at: z
2458
.string()
2559
.datetime()

src/lib/seam/connect/models/acs/acs-system.ts

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ const seam_bridge_disconnected = common_acs_system_error.extend({
7575
.describe(`Indicates that the Seam API cannot communicate with the [Seam Bridge](https://docs.seam.co/latest/capability-guides/seam-bridge), for example, if the Seam Bridge executable has stopped or if the computer running the Seam Bridge executable is offline.
7676
This error might also occur if the Seam Bridge is connected to the wrong [workspace](https://docs.seam.co/latest/core-concepts/workspaces).
7777
See also [Troubleshooting Your Access Control System](https://docs.seam.co/latest/capability-guides/capability-guides/access-systems/troubleshooting-your-access-control-system#acs_system.errors.seam_bridge_disconnected).`)
78+
7879
const visionline_instance_unreachable = common_acs_system_error.extend({
7980
error_code: z
8081
.literal('visionline_instance_unreachable')
@@ -84,29 +85,36 @@ const visionline_instance_unreachable = common_acs_system_error.extend({
8485
For example, the IP address of the on-premises access control system may be set incorrectly within the Seam [workspace](https://docs.seam.co/latest/core-concepts/workspaces).
8586
See also [Troubleshooting Your Access Control System](https://docs.seam.co/latest/capability-guides/capability-guides/access-systems/troubleshooting-your-access-control-system#acs_system.errors.visionline_instance_unreachable).`)
8687

87-
const salto_ks_subscription_limit_exceeded = common_acs_system_error.extend({
88-
error_code: z
89-
.literal('salto_ks_subscription_limit_exceeded')
90-
.describe(
91-
'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.',
92-
),
93-
})
88+
const salto_ks_subscription_limit_exceeded = common_acs_system_error
89+
.extend({
90+
error_code: z
91+
.literal('salto_ks_subscription_limit_exceeded')
92+
.describe(error_code_description),
93+
})
94+
.describe(
95+
'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.',
96+
)
9497

95-
const acs_system_disconnected = common_acs_system_error.extend({
96-
error_code: z
97-
.literal('acs_system_disconnected')
98-
.describe(
99-
'Indicates that the access system has been disconnected. Please refer to [this guide](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system guide) to resolve the issue.',
100-
),
101-
})
98+
const acs_system_disconnected = common_acs_system_error
99+
.extend({
100+
error_code: z
101+
.literal('acs_system_disconnected')
102+
.describe(error_code_description),
103+
})
104+
.describe(
105+
'Indicates that the access system has been disconnected. See [this guide](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system guide) to resolve the issue.',
106+
)
107+
108+
const account_disconnected = common_acs_system_error
109+
.extend({
110+
error_code: z
111+
.literal('account_disconnected')
112+
.describe(error_code_description),
113+
})
114+
.describe(
115+
'Indicates that the login credentials are invalid. Reconnect the account using the Connect Webview to restore access.',
116+
)
102117

103-
const account_disconnected = common_acs_system_error.extend({
104-
error_code: z
105-
.literal('account_disconnected')
106-
.describe(
107-
'Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access.',
108-
),
109-
})
110118
const acs_system_error = z
111119
.union([
112120
seam_bridge_disconnected,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { z } from 'zod'
2+
3+
import { common_acs_event } from './common.js'
4+
5+
const acs_encoder_event = common_acs_event.extend({
6+
acs_encoder_id: z.string().uuid().describe('ID of the ACS encoder.'),
7+
})
8+
9+
export const acs_encoder_added_event = acs_encoder_event
10+
.extend({
11+
event_type: z.literal('acs_encoder.added'),
12+
})
13+
.describe('An ACS encoder was added.')
14+
15+
export type AcsEncoderAddedEvent = z.infer<typeof acs_encoder_added_event>
16+
17+
export const acs_encoder_removed_event = acs_encoder_event
18+
.extend({
19+
event_type: z.literal('acs_encoder.removed'),
20+
})
21+
.describe('An ACS encoder was removed.')
22+
23+
export type AcsEncoderRemovedEvent = z.infer<typeof acs_encoder_removed_event>
24+
25+
export const acs_encoder_events = [
26+
acs_encoder_added_event,
27+
acs_encoder_removed_event,
28+
] as const
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { acs_credential_events } from './credentials.js'
2+
import { acs_encoder_events } from './encoders.js'
23
import { acs_system_events } from './systems.js'
34
import { acs_user_events } from './users.js'
45

56
export const acs_events = [
67
...acs_system_events,
78
...acs_credential_events,
89
...acs_user_events,
10+
...acs_encoder_events,
911
] as const

src/lib/seam/connect/openapi.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,8 @@ export default {
700700
type: 'object',
701701
},
702702
{
703+
description:
704+
'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.',
703705
properties: {
704706
created_at: {
705707
description:
@@ -709,7 +711,7 @@ export default {
709711
},
710712
error_code: {
711713
description:
712-
'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.',
714+
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
713715
enum: ['salto_ks_subscription_limit_exceeded'],
714716
type: 'string',
715717
},
@@ -723,6 +725,8 @@ export default {
723725
type: 'object',
724726
},
725727
{
728+
description:
729+
'Indicates that the access system has been disconnected. See [this guide](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system guide) to resolve the issue.',
726730
properties: {
727731
created_at: {
728732
description:
@@ -732,7 +736,7 @@ export default {
732736
},
733737
error_code: {
734738
description:
735-
'Indicates that the access system has been disconnected. Please refer to [this guide](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system guide) to resolve the issue.',
739+
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
736740
enum: ['acs_system_disconnected'],
737741
type: 'string',
738742
},
@@ -746,6 +750,8 @@ export default {
746750
type: 'object',
747751
},
748752
{
753+
description:
754+
'Indicates that the login credentials are invalid. Reconnect the account using the Connect Webview to restore access.',
749755
properties: {
750756
created_at: {
751757
description:
@@ -755,7 +761,7 @@ export default {
755761
},
756762
error_code: {
757763
description:
758-
'Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access.',
764+
'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
759765
enum: ['account_disconnected'],
760766
type: 'string',
761767
},
@@ -13789,6 +13795,8 @@ export default {
1378913795
'acs_user.deleted',
1379013796
'acs_credential.deleted',
1379113797
'acs_credential.issued',
13798+
'acs_encoder.added',
13799+
'acs_encoder.removed',
1379213800
'enrollment_automation.deleted',
1379313801
'client_session.deleted',
1379413802
'action_attempt.lock_door.succeeded',
@@ -13863,6 +13871,8 @@ export default {
1386313871
'acs_user.deleted',
1386413872
'acs_credential.deleted',
1386513873
'acs_credential.issued',
13874+
'acs_encoder.added',
13875+
'acs_encoder.removed',
1386613876
'enrollment_automation.deleted',
1386713877
'client_session.deleted',
1386813878
'action_attempt.lock_door.succeeded',

src/lib/seam/connect/route-types.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8148,23 +8148,23 @@ export interface Routes {
81488148
created_at: string
81498149
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
81508150
message: string
8151-
/** 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. */
8151+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
81528152
error_code: 'salto_ks_subscription_limit_exceeded'
81538153
}
81548154
| {
81558155
/** Date and time at which Seam created the error. */
81568156
created_at: string
81578157
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
81588158
message: string
8159-
/** Indicates that the access system has been disconnected. Please refer to [this guide](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system guide) to resolve the issue. */
8159+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
81608160
error_code: 'acs_system_disconnected'
81618161
}
81628162
| {
81638163
/** Date and time at which Seam created the error. */
81648164
created_at: string
81658165
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
81668166
message: string
8167-
/** Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access. */
8167+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
81688168
error_code: 'account_disconnected'
81698169
}
81708170
>
@@ -8295,23 +8295,23 @@ export interface Routes {
82958295
created_at: string
82968296
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
82978297
message: string
8298-
/** 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. */
8298+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
82998299
error_code: 'salto_ks_subscription_limit_exceeded'
83008300
}
83018301
| {
83028302
/** Date and time at which Seam created the error. */
83038303
created_at: string
83048304
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
83058305
message: string
8306-
/** Indicates that the access system has been disconnected. Please refer to [this guide](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system guide) to resolve the issue. */
8306+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
83078307
error_code: 'acs_system_disconnected'
83088308
}
83098309
| {
83108310
/** Date and time at which Seam created the error. */
83118311
created_at: string
83128312
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
83138313
message: string
8314-
/** Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access. */
8314+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
83158315
error_code: 'account_disconnected'
83168316
}
83178317
>
@@ -8442,23 +8442,23 @@ export interface Routes {
84428442
created_at: string
84438443
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
84448444
message: string
8445-
/** 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. */
8445+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
84468446
error_code: 'salto_ks_subscription_limit_exceeded'
84478447
}
84488448
| {
84498449
/** Date and time at which Seam created the error. */
84508450
created_at: string
84518451
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
84528452
message: string
8453-
/** Indicates that the access system has been disconnected. Please refer to [this guide](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system guide) to resolve the issue. */
8453+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
84548454
error_code: 'acs_system_disconnected'
84558455
}
84568456
| {
84578457
/** Date and time at which Seam created the error. */
84588458
created_at: string
84598459
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
84608460
message: string
8461-
/** Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access. */
8461+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
84628462
error_code: 'account_disconnected'
84638463
}
84648464
>
@@ -13749,6 +13749,8 @@ export interface Routes {
1374913749
| 'acs_user.deleted'
1375013750
| 'acs_credential.deleted'
1375113751
| 'acs_credential.issued'
13752+
| 'acs_encoder.added'
13753+
| 'acs_encoder.removed'
1375213754
| 'enrollment_automation.deleted'
1375313755
| 'client_session.deleted'
1375413756
| 'action_attempt.lock_door.succeeded'
@@ -13821,6 +13823,8 @@ export interface Routes {
1382113823
| 'acs_user.deleted'
1382213824
| 'acs_credential.deleted'
1382313825
| 'acs_credential.issued'
13826+
| 'acs_encoder.added'
13827+
| 'acs_encoder.removed'
1382413828
| 'enrollment_automation.deleted'
1382513829
| 'client_session.deleted'
1382613830
| 'action_attempt.lock_door.succeeded'
@@ -31777,23 +31781,23 @@ export interface Routes {
3177731781
created_at: string
3177831782
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
3177931783
message: string
31780-
/** 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. */
31784+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
3178131785
error_code: 'salto_ks_subscription_limit_exceeded'
3178231786
}
3178331787
| {
3178431788
/** Date and time at which Seam created the error. */
3178531789
created_at: string
3178631790
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
3178731791
message: string
31788-
/** Indicates that the access system has been disconnected. Please refer to [this guide](https://docs.seam.co/latest/capability-guides/access-systems/troubleshooting-your-access-control-system guide) to resolve the issue. */
31792+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
3178931793
error_code: 'acs_system_disconnected'
3179031794
}
3179131795
| {
3179231796
/** Date and time at which Seam created the error. */
3179331797
created_at: string
3179431798
/** Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */
3179531799
message: string
31796-
/** Indicates that the login credentials are invalid. Please reconnect the account using the Connect Webview to restore access. */
31800+
/** Unique identifier of the type of error. Enables quick recognition and categorization of the issue. */
3179731801
error_code: 'account_disconnected'
3179831802
}
3179931803
>

0 commit comments

Comments
 (0)